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

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

Build:
Build:
LAST BUILD BRANCH: beta-4.3.2
DEFAULT BRANCH: latest
Ran 27 Jun 2025 04:44AM UTC
Files 41
Run time 8s
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.39% (+0.005%) from 1.385%
15918360283.3

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 😄

3 of 40 branches covered (7.5%)

Branch coverage included in aggregate %.

215 of 15646 relevant lines covered (1.37%)

0.01 hits per line

Source Files on job run-22 - 15918360283.3
  • 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 Build 15918360283
  • 08a164ee on github
  • Prev Job for on beta-4.3.2 (#13669205730.1)
  • Next Job for on beta-4.3.2 (#16526512141.1)
  • 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