Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some fixes: zWave device integration and BinaryDeviceFeature component #608

Merged
merged 4 commits into from
Nov 20, 2019

Conversation

sescandell
Copy link
Contributor

@sescandell sescandell commented Nov 14, 2019

Pull Request check-list

To ensure your Pull Request can be accepted as fast as possible, make sure to review and check all of these items:

  • If your changes affects code, did your write the tests?
  • Are tests passing? (npm test on both front/server)
  • Is the linter passing? (npm run eslint on both front/server)
  • Did you run prettier? (npm run prettier on both front/server)
  • [ ] If your changes modify the API (REST or Node.js), did you modify the API documentation? (Documentation is based on comments in code)
  • [ ] If you are adding a new features/services which needs explanation, did you modify the user documentation? See the GitHub repo and the website.
  • [ ] Did you add fake requests data for the demo mode (front/src/config/demo.json) so that the demo website is working without a backend? (if needed) See https://demo.gladysassistant.com.

NOTE: these things are not required to open a PR and can be done afterwards / while the PR is open.

Description of change

This PR initially was intended to fix the Device.setValue call for zWave devices. But, making tests with a real BinarySwitch device I identified another issue with the BinarySwitch front component and the Gateway forwarder.

Changes:

  • Add the zWaveManager instance as the device property of zwave service (following the PhilipsHueService and its handler scheme)
  • An error on device feature test about setValue feedback
  • BinaryDeviceFeature: a mix between bool and int making impossible to Switch On then Switch Off the device
  • Do not try to Forward messages to the Gateway when not connected to it

@codecov
Copy link

codecov bot commented Nov 15, 2019

Codecov Report

Merging #608 into master will decrease coverage by 0.08%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #608      +/-   ##
==========================================
- Coverage   91.92%   91.83%   -0.09%     
==========================================
  Files         399      400       +1     
  Lines        4865     4876      +11     
==========================================
+ Hits         4472     4478       +6     
- Misses        393      398       +5
Flag Coverage Δ
#server 91.83% <100%> (-0.09%) ⬇️
Impacted Files Coverage Δ
server/services/zwave/index.js 93.33% <ø> (ø) ⬆️
server/lib/gateway/gateway.forwardWebsockets.js 75% <100%> (-13.89%) ⬇️
server/services/zwave/lib/index.js 100% <100%> (ø) ⬆️
server/lib/device/device.setValue.js 100% <100%> (ø) ⬆️
...rver/services/zwave/lib/commands/zwave.setValue.js 50% <0%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 5685b45...d8d91cb. Read the comment docs.

@Pierre-Gilles Pierre-Gilles merged commit 09c8732 into GladysAssistant:master Nov 20, 2019
@Pierre-Gilles
Copy link
Contributor

Thanks for this great PR, tested on merged! 👍 👏

R6n0 pushed a commit to R6n0/Gladys that referenced this pull request Dec 2, 2020
…onent and Gateway (GladysAssistant#608)

* Various changes: zWave device integration and BinaryDeviceFeature component fixes

* Add test

* Fix tests... actually Mock were broken: using spy on prototype should not be authorized.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants