zha-device-handlers
zha-device-handlers copied to clipboard
Add quirk for Sonoff ZBMINIR2
Proposed change
Add quirk for Sonoff ZBMINIR2
Additional information
Checklist
- [x] The changes are tested and work correctly
- [x]
pre-commitchecks pass / the code has been formatted using Black - [] Tests have been added to verify that the new code works
Codecov Report
Attention: Patch coverage is 91.30435% with 2 lines in your changes missing coverage. Please review.
Project coverage is 89.44%. Comparing base (
4d53f30) to head (82b7d05). Report is 1 commits behind head on dev.
| Files with missing lines | Patch % | Lines |
|---|---|---|
| zhaquirks/sonoff/zbminir2.py | 91.30% | 2 Missing :warning: |
Additional details and impacted files
@@ Coverage Diff @@
## dev #3428 +/- ##
=======================================
Coverage 89.44% 89.44%
=======================================
Files 311 312 +1
Lines 10031 10054 +23
=======================================
+ Hits 8972 8993 +21
- Misses 1059 1061 +2
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Try these New Features:
- Flaky Tests Detection - Detect and resolve failed and flaky tests
Hi @TheJulianJES, I've created a PR. Is there anything I need to do before merging it?
Thank you very much for your assistance.
@TheJulianJES Can this be merged? Z2M has had proper support for this device for a while, and it would be a shame to block it over variable naming.
I have tested the Quirk, few insights:
- external trigger mode config works great
- the detached mode config doesn't work right for me with switch in edge trigger mode: switch position updates HA entity state, and HA ends up confused
- I miss inching configuration (as ewelink cluster command)
I just got this device today, tried this quirk and can confirm it's still a bit weird when using detached mode like tomas said.
So I'm new to these types of devices, but is it normal that when using the external trigger mode of a pulse trigger, the relay switch shows up as on for a second, then reverts to false? This seems like it would make it basically impossible to distinguish between double-tapping the switch or holding the switch for a while. Wouldn't this be what the sensor is for?
I can confirm the strange behavior in detached mode. It looks like the state of the relay and also the state of the external switch are mapped to the switch entity.
I tried the detached mode with the same device (firmware 0x00001002) with Z2M without any issues. The state of the relay is mapped to the switch entity and on external switch use, the HA device receives toggle actions.
Since the behavior differs from Z2M, please create an issue in this repo and link it here.
I've just created a new issue for this in #3579