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

Zigbee2mqtt device parser #1302

Merged

Conversation

atrovato
Copy link
Contributor

@atrovato atrovato commented Sep 19, 2021

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 you are adding a new features/services, did you run integration comparator? (npm run compare-translations on front)
  • 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

Add automatic device builder from Zigbee2mqtt device definition message.

Now service read the MQTT retained message from zigbee2mqtt containing device definition and map it to Gladys device / features : https://www.zigbee2mqtt.io/information/mqtt_topics_and_message_structure.html#zigbee2mqttbridgedevices

No more "device model" mapping.

Tests from : https://community.gladysassistant.com/t/zigbee2mqtt-debug/6080/46?u=alextrovato

@codecov
Copy link

codecov bot commented Sep 19, 2021

Codecov Report

Merging #1302 (27ca5d2) into master (456695b) will decrease coverage by 0.10%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1302      +/-   ##
==========================================
- Coverage   96.64%   96.54%   -0.11%     
==========================================
  Files         684      613      -71     
  Lines        8994     8729     -265     
==========================================
- Hits         8692     8427     -265     
  Misses        302      302              
Impacted Files Coverage Δ
server/utils/constants.js 100.00% <ø> (ø)
...services/zigbee2mqtt/api/zigbee2mqtt.controller.js 100.00% <100.00%> (ø)
server/services/zigbee2mqtt/exposes/binaryType.js 100.00% <100.00%> (ø)
...rver/services/zigbee2mqtt/exposes/compositeType.js 100.00% <100.00%> (ø)
server/services/zigbee2mqtt/exposes/enumType.js 100.00% <100.00%> (ø)
server/services/zigbee2mqtt/exposes/index.js 100.00% <100.00%> (ø)
server/services/zigbee2mqtt/exposes/numericType.js 100.00% <100.00%> (ø)
...r/services/zigbee2mqtt/lib/getDiscoveredDevices.js 100.00% <100.00%> (ø)
...rver/services/zigbee2mqtt/lib/handleMqttMessage.js 100.00% <100.00%> (ø)
server/services/zigbee2mqtt/lib/index.js 100.00% <100.00%> (ø)
... and 6 more

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 456695b...27ca5d2. Read the comment docs.

@atrovato atrovato force-pushed the zigbee2mqtt-device-parser branch from 034f76d to ac54d97 Compare September 26, 2021 08:18
@atrovato atrovato force-pushed the zigbee2mqtt-device-parser branch 4 times, most recently from cea535d to e8e9a98 Compare October 3, 2021 21:24
@atrovato atrovato mentioned this pull request Oct 9, 2021
@atrovato atrovato force-pushed the zigbee2mqtt-device-parser branch from e8e9a98 to fff9332 Compare October 17, 2021 07:08
@atrovato atrovato marked this pull request as ready for review October 17, 2021 09:16
Copy link
Contributor

@Pierre-Gilles Pierre-Gilles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First, thanks for this great PR, it'll help a lot of people !! :D

A few general feedbacks / questions about the PR. I'm no Zigbee expert, so I'm more looking forward to get the feedback of @cicoub13 / @VonOx

server/services/zigbee2mqtt/exposes/numericType.js Outdated Show resolved Hide resolved
server/services/zigbee2mqtt/exposes/enumType.js Outdated Show resolved Hide resolved
server/services/zigbee2mqtt/exposes/numericType.js Outdated Show resolved Hide resolved
server/services/zigbee2mqtt/exposes/numericType.js Outdated Show resolved Hide resolved
server/services/zigbee2mqtt/exposes/numericType.js Outdated Show resolved Hide resolved
server/services/zigbee2mqtt/api/zigbee2mqtt.controller.js Outdated Show resolved Hide resolved
server/services/zigbee2mqtt/exposes/binaryType.js Outdated Show resolved Hide resolved
@atrovato atrovato force-pushed the zigbee2mqtt-device-parser branch from f6abbb1 to ce82979 Compare October 30, 2021 07:33
Copy link
Contributor

@Pierre-Gilles Pierre-Gilles left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi !

Thanks for this PR, it looks super clean to me! :)

I added a few questions on gas sensors, but that's really a minor feedback just to be sure.

If you are confident it works fine, I'm ok to merge this 🙂 (I saw several people saying that it works fine on the forum, so it seems good to me)

server/services/zigbee2mqtt/exposes/numericType.js Outdated Show resolved Hide resolved
@atrovato
Copy link
Contributor Author

atrovato commented Nov 1, 2021

Thanks,
I just reply to your both comments (formaldehyd removed for now, gas was already managed this way).

@Pierre-Gilles
Copy link
Contributor

Ok, so I can merge this now ?

@atrovato
Copy link
Contributor Author

atrovato commented Nov 1, 2021

Yes !!! :D

@Pierre-Gilles Pierre-Gilles merged commit 925994d into GladysAssistant:master Nov 1, 2021
@relativeci
Copy link

relativeci bot commented Nov 1, 2021

Job #136: Bundle Size — 6.67MB (0%).

925994d vs 925994d

Changed metrics (1/8)
Metric Current Baseline
Cache Invalidation 0% 42.81%
Changed assets by type (0/7)

No changes


View Job #136 report on app.relative-ci.com

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants