-
Notifications
You must be signed in to change notification settings - Fork 729
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
Add quirk for Schneider Electric 1GANG/SHUTTER/1 (MEG5113-0300) #2928
Conversation
- Fixed test definition
- Use ZCLAttributeDef for attribute
- Fix constant use
- Edit some attributes name
- Add CH2AX/SWITCH/1 signature
This commit is based on previous work by Axel Le Bot which unfortunately is incomplete and is unknown whether it works. I have hence removed the code that is not needed for the new quirk.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #2928 +/- ##
==========================================
+ Coverage 87.72% 87.81% +0.09%
==========================================
Files 298 300 +2
Lines 9119 9187 +68
==========================================
+ Hits 8000 8068 +68
Misses 1119 1119 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The changes mostly seem fine. However, I don't know if we want to ship a 6000 line readme file in the source.
Also, the cover implementation in ZHA is currently being reworked a bit:
That might land in HA Core 2024.2.0 (betas). Since these quirks also invert the covers somewhat, it would be nice if they could be tested (with and without(?) quirk) whenever that PR is merged and released to HA Core.
Thanks for the positive review, @TheJulianJES! Fair enough, I’ve removed the README. Is there maybe a better place to put it? I suppose @axellebot’s idea behind the file was to have something similar to Zigbee2MQTT’s devices DB, just for zigpy. I thought about a wiki, but zha-device-handlers doesn’t have one. Regarding home-assistant/core#108238: I can certainly test my device with/without the quirk once this has landed in a HA release. I doubt, though, that the new inversion logic will help here, as it mostly seems to be based on reversing the motor direction. I had tested that manually before implementing the quirk, and it just resulted in a swapping of the up/down push buttons – interestingly both on the wall and in the HA GUI. The opened/closed states in HA were still wrong. |
I think device / vendor things is the best place in the Wiki https://github.com/zigpy/zigpy/wiki. |
I think putting quirks-related stuff in a quirks wiki would be good. |
DEVICE_TYPE: zha.DeviceType.WINDOW_COVERING_DEVICE, # 0x0202 | ||
INPUT_CLUSTERS: [ | ||
Basic.cluster_id, # 0x0000 | ||
Identify.cluster_id, # 0x0003 | ||
Groups.cluster_id, # 0x0004 | ||
Scenes.cluster_id, # 0x0005 | ||
WindowCovering.cluster_id, # 0x0102 | ||
Diagnostic.cluster_id, # 0x0B05 | ||
], | ||
OUTPUT_CLUSTERS: [Ota.cluster_id], # 0x0019 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To stay consistent, can you remove the comments with the cluster IDs "everywhere"?
(not the SimpleDescriptor
comments above though)
Also, to structure it like the rest of our repo, I'd get rid of the |
This was requested here: <zigpy#2928 (comment)>
This was requested here: <zigpy#2928 (comment)>
@MattWestb, @TheJulianJES, thanks for your feedback regarding the wiki. Should I maybe just create an initial structure for a zigpy/zha-device-handlers wiki? @TheJulianJES, thanks again for the review. I’ve made the changes you requested. |
Yup, I think that's fine. |
Ok, I’ve created a wiki home page and added a Schneider-specific page with the deleted “README” (mostly as in a4d596c). |
This was discovered here: <zigpy#2928 (review)>
@TheJulianJES, as promised, I’ve tested HA 2024.2.0 (and hence home-assistant/core#108238) with and without the quirk from this PR:
|
This was requested here: <zigpy#2928 (comment)>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
This was requested here: <zigpy#2928 (comment)>
This was requested here: <zigpy#2928 (comment)>
…y#2928) * Add quirk for Schneider Electric 1GANG/SHUTTER/1 (MEG5113-0300) This commit is based on previous work by Axel Le Bot which unfortunately is incomplete and is unknown whether it works. I have hence removed the code that is not needed for the new quirk. * Add test asserting that unpatched ZCL commands keep working --------- Co-authored-by: Axel LE BOT <[email protected]>
Proposed change
Add a quirk for Schneider Electric 1GANG/SHUTTER/1 (MEG5113-0300) to
Additional information
This PR is based on @axellebot’s work in #1705. As the latter is incomplete, I have removed the code of which I don’t know whether it works.
I have successfully tested the quirk with a real device connected to Home Assistant via ZHA.
Checklist
pre-commit
checks pass / the code has been formatted using Black