Remove Aqara motion detection_interval sync and read detection_interval after pairing
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 48/100
Research direction
Read zha/application/platforms/virtual.py and inspect AqaraMotionDetectionIntervalSync, AqaraMotionAc02Init, and AqaraMotionAgl04Init. Check the minimum supported zha-quirks version and the related issue #782 before changing startup behavior. Add or update tests to verify detection_interval is cached after pairing and no write to ias_zone.reset_s occurs.
Written by the indexing model from the issue text.
Description
Problem
zigpy/zha-device-handlers#5067 (merged) lets the Aqara motion quirks (lumi.motion.ac02 and lumi.motion.agl04) read detection_interval from the Opple cluster cache themselves via an overridable reset_after property, and removes the quirk-side write_attributes overrides that pushed the value into ias_zone.reset_s. ZHA still carries the old startup workaround: AqaraMotionDetectionIntervalSync in zha/application/platforms/virtual.py copies detection_interval into ias_zone.reset_s on startup, which the quirks no longer need.
Proposed fix
- Remove
AqaraMotionDetectionIntervalSynconce the minimum zha-quirks version contains #5067 (otherwise older quirks lose the behaviour). - Make sure
detection_intervalis read from the device once after pairing. BothAqaraMotionAc02InitandAqaraMotionAgl04Initcurrently declare it withread_on_startup=False, so the cache can stay empty until the number entity is used and the quirk falls back to its staticreset_s(30 s for ac02, 60 s for agl04). Either read it once on join, or let this happen through quirks v2 attribute config. - Tests for the above (no
ias_zone.reset_swrite,detection_intervalpresent in the cache after joining).
Context
Related: zigpy/zha#782, which touches the same virtual entities, so this is best done after it lands. Quirk-side follow-ups are tracked in the linked zha-device-handlers issue.
- Dominant language
- Python
- Stars
- 96
- Forks
- 84
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 30
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from zigpy/zha
-
Device override creates the generic entity instead of the vendor-specific one (Light instead of HueLight, ForceOnLight, MinTransitionLight)Possibly taken @zigpy-review-bot claimed this today. Openbot: code audit
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Each time a device becomes available again, ZHA adds another firmware update listener that is never releasedPossibly taken @zigpy-review-bot claimed this 1 day ago. Openbot: code audit
Difficulty 2/5 1-3 hours Newbie friendliness 90/100
Maintainers usually reply within 1 day
-
Devices that left the network are re-initialized on every availability check, reading attributes from a device that is gonePossibly taken @zigpy-review-bot claimed this 1 day ago. Openbot: code audit
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
device specific quirks
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
pimutils/vdirsyncer#1242 ·
-
priority:P2
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
QuantConnect/lean-cli#792 ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
open-webui/open-webui#35360 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Suggest link: Destiny Verify (MIT zero-dependency pre-commit security, citation & link hygiene CLI)Open
Difficulty 1/5 Under an hour Newbie friendliness 68/100