Add quirk for A-OK AM45 Plus Wi-Fi tubular motor#108
Conversation
|
Hi @jl1990 Can you please send attach a full diagnostic dump from Home Assistant? |
|
Hi, There are some of them in the original issue I created here: home-assistant/core#168493 I am reattaching them here. Please let me know if this is what you expected. tuya-am45-debug.log |
|
So we have a problem with "add_cover" in that at this stage it seems Home Assistant will not accept that functionnality.
What we could do instead is "suppress" the In the meantime, could you update the test fixture to include "local_strategy"? |
The AM45 Plus (product_id b9oa3zocv4qq47iy, category cl) advertises percent_state in its status_range but never pushes updates for that DP over MQTT, so the default CL mapping (which prefers percent_state) leaves current_position stuck at its startup value while the blind physically moves. Suppress percent_state at device initialisation so the default mapping falls back to percent_control, which this device does push. Include a fixture modelled on a real diagnostic dump (with local_strategy populated) and a regression test that exercises initialise_device_quirk and confirms percent_state is dropped from status_range, status, and local_strategy. tests/__init__.py: create_device now coerces local_strategy JSON keys to int, matching the CustomerDevice type in the Tuya SDK. See home-assistant/core#168493.
6ec5bd2 to
6b1ec1a
Compare
Ok, I rebased and included local_strategy. I am not sure if my changes are correct (although tests are passing), I am not familiar at all with the codebase here. If any change is needed feel free to do it or let me know what's wrong and I'll change it |
Co-authored-by: Copilot <copilot@github.com>
|
@jl1990 as you are the first to provide a quirk not everything is properly documented, and the test framework is not fully settled I hope that home-assistant/core#168897 will be merged before wednesday (cutoff for |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #108 +/- ##
==========================================
+ Coverage 96.48% 97.15% +0.66%
==========================================
Files 46 47 +1
Lines 1709 1825 +116
Branches 170 165 -5
==========================================
+ Hits 1649 1773 +124
+ Misses 46 40 -6
+ Partials 14 12 -2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Co-authored-by: Copilot <copilot@github.com>
Co-authored-by: Copilot <copilot@github.com>
|
@jl1990 |
|
@jl1990 do you think this is ready to merge? |
I just tested the quirk in my HA with the new changes and it seems to be working. I would say it's ready to merge. Thanks! |
The AM45 Plus (product_id b9oa3zocv4qq47iy, category cl) advertises percent_state in its status_range but never pushes updates for that DP over MQTT, so the default CL mapping (which prefers percent_state) leaves current_position stuck at its startup value while the blind physically moves. Bind current_position to percent_control, which this device does push.
See home-assistant/core#168493.