|
Ran
|
Jobs
3
|
Files
19
|
Run time
1min
|
Badge
README BADGES
|
push
github
Fix the return value of `SwitchBotOpenAPI.getDeviceStatus()` method (#290) ## :recycle: Current situation *Describe the current situation. Explain current problems, if there are any. Be as descriptive as possible (e.g., including examples or code snippets).* `SwitchBotOpenAPI.getDeviceStatus()` method returns an object like below: ``` { response: { statusCode: 100, body: { version: 'V2.9', battery: 41, lockState: 'locked', doorState: 'closed', calibrate: true, deviceId: 'XXXXXXXX', deviceType: 'XXXXXXXX', hubDeviceId: 'XXXXXXXX' }, message: 'success' }, statusCode: 200 } ``` But `SwitchBotOpenAPI.getDeviceStatus()` expects to return `{ response: deviceStatus, statusCode: deviceStatusRequest['statusCode'] }` type. ## :bulb: Proposed solution *Describe the proposed solution and changes. How does it affect the project? How does it affect the internal structure (e.g., refactorings)?* [This line](https://github.com/OpenWonderLabs/node-switchbot/blob/ca9e2255e/src/switchbot-openapi.ts#L201) does not return `deviceStatus` type but `deviceStatusRequest` type. So this PR fix the internal type in the `getDeviceStatus()` method so that it returns an expected object. ## :gear: Release Notes *Provide a summary of the changes or features from a user's point of view. If there are breaking changes, provide migration guides using code examples of the affected features.* ## :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 *Where should the reviewer start? what is a good entry point?*
17 of 27 branches covered (62.96%)
Branch coverage included in aggregate %.
0 of 1 new or added line in 1 file covered. (0.0%)
412 of 2866 relevant lines covered (14.38%)
0.43 hits per line
| Lines | Coverage | ∆ | File |
|---|---|---|---|
| 1 |
4.09 |
0.0% | src/switchbot-openapi.ts |
| ID | Job ID | Ran | Files | Coverage | |
|---|---|---|---|---|---|
| 1 | run-18 - 13172011085.1 | 19 |
14.76 |
GitHub Action Run | |
| 2 | run-22 - 13172011085.2 | 19 |
14.5 |
GitHub Action Run | |
| 3 | run-20 - 13172011085.3 | 19 |
14.76 |
GitHub Action Run |
| Coverage | ∆ | File | Lines | Relevant | Covered | Missed | Hits/Line | Branch Hits | Branch Misses |
|---|