• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

OpenWonderLabs / homebridge-switchbot / 15918360283
1%
latest: 1%

Build:
Build:
LAST BUILD BRANCH: beta-4.3.2
DEFAULT BRANCH: latest
Ran 27 Jun 2025 04:44AM UTC
Jobs 3
Files 41
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

27 Jun 2025 04:43AM UTC coverage: 1.396% (+0.005%) from 1.391%
15918360283

push

github

web-flow
Solves issue with deviceRefreshStatus method usage (#1217)

## :recycle: Current situation

As reported in the ticket
https://github.com/OpenWonderLabs/homebridge-switchbot/issues/1209#issue-3054148604
the update of the parameters of some sensors connected to hub 2 does not
seem to work correctly.

I extended the explanation in this comment in that thread:

https://github.com/OpenWonderLabs/homebridge-switchbot/issues/1209#issuecomment-2953947681

To report the information here too:

The problem seems to be that the response obtained from the status of a
device is destructured by recovering only the body, thus losing the
statusCode, subsequently the method that verifies the response from the
status code returns false, not finding the data present in the variable
`deviceStatus`

```ts
      const response = await this.deviceRefreshStatus()
      const deviceStatus: any = response.body
      // ...
      if (await this.successfulStatusCodes(deviceStatus)) {          // This cant check the statusCode cause it's not present in the `response.body` but in the `response.statusCode`
      // ...
```

## :bulb: Proposed solution

Change the usage of data obtained from the `pushChangeRequest` and
`deviceRefreshStatus` methods.

## :gear: Release Notes

- Solves issue with status code check from API responses in some cases.

## :heavy_plus_sign: Additional Information
*If applicable, provide additional context in this section.*

### Testing

*Which tests were added? Which existing tests were adapted/changed?
Which situations are covered, and what edge cases are missing?*

### Reviewer Nudging

It is probably easier to review starting from the `src/device/device.ts`
file and then review the other changes which are very similar to each
other.

--

I apologize if this is not the correct way to open a PR or if there are
other inaccuracies.

Thank you very much and good work 😄

4 of 41 branches covered (9.76%)

Branch coverage included in aggregate %.

0 of 61 new or added lines in 31 files covered. (0.0%)

215 of 15646 relevant lines covered (1.37%)

0.04 hits per line

New Missed Lines in Diff

Lines Coverage ∆ File
1
1.48
0.0% src/device/contact.ts
1
1.81
0.01% src/device/hub.ts
1
1.89
0.01% src/device/iosensor.ts
1
1.89
0.01% src/device/meter.ts
1
1.89
0.01% src/device/meterplus.ts
1
1.58
0.0% src/device/meterpro.ts
1
1.79
0.01% src/device/motion.ts
1
1.74
0.01% src/device/waterdetector.ts
1
0.48
0.0% src/irdevice/airconditioner.ts
1
2.2
0.01% src/irdevice/airpurifier.ts
1
2.33
0.03% src/irdevice/camera.ts
1
1.18
0.01% src/irdevice/fan.ts
1
1.22
0.01% src/irdevice/light.ts
1
0.31
0.0% src/irdevice/other.ts
1
0.68
0.0% src/irdevice/tv.ts
1
2.33
0.03% src/irdevice/vacuumcleaner.ts
1
2.27
0.03% src/irdevice/waterheater.ts
2
0.63
0.0% src/device/blindtilt.ts
2
0.73
0.0% src/device/bot.ts
2
1.06
0.0% src/device/lock.ts
2
1.5
0.01% src/device/plug.ts
2
0.93
0.0% src/device/relayswitch.ts
2
0.35
0.0% src/irdevice/irdevice.ts
3
0.58
0.0% src/device/device.ts
3
1.14
0.01% src/device/robotvacuumcleaner.ts
4
0.82
0.0% src/device/curtain.ts
4
0.94
0.01% src/device/fan.ts
4
0.95
0.01% src/device/humidifier.ts
4
0.76
0.0% src/device/lightstrip.ts
5
0.87
0.01% src/device/ceilinglight.ts
5
0.68
0.0% src/device/colorbulb.ts
Jobs
ID Job ID Ran Files Coverage
1 run-18 - 15918360283.1 27 Jun 2025 04:44AM UTC 41
1.39
GitHub Action Run
2 run-20 - 15918360283.2 27 Jun 2025 04:44AM UTC 41
1.39
GitHub Action Run
3 run-22 - 15918360283.3 27 Jun 2025 04:44AM UTC 41
1.39
GitHub Action Run
Source Files on build 15918360283
  • Tree
  • List 41
  • Changed 31
  • Source Changed 31
  • Coverage Changed 29
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #15918360283
  • 08a164ee on github
  • Prev Build on v4.3.1 (#13669205730)
  • Next Build on beta-4.3.2 (#16526512141)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc