-
Notifications
You must be signed in to change notification settings - Fork 824
Fix Tuya BlitzWolf motion sensor #3629
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
Fix Tuya BlitzWolf motion sensor #3629
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #3629 +/- ##
==========================================
+ Coverage 89.83% 89.84% +0.01%
==========================================
Files 322 322
Lines 10350 10371 +21
==========================================
+ Hits 9298 9318 +20
- Misses 1052 1053 +1 ☔ View full report in Codecov by Sentry. |
Hmm, looking at the code we had for this before, I'm now also wondering if this sensor correctly sends a "reset" message. I think that code was written before we had a proper Tuya datapoint conversion though. |
Ok, got the sensor now and we need a timeout. The current zhaquirks code for |
This code is somewhat copied from `MotionWithReset` and related clusters from the base `zhaquirks` module. However, that code is outdated and still uses `Bus` somewhat and listens to the IAS zone status change commands. We generally listen to IAS zone status attribute updates now. This is also needed for the Tuya DP conversion.
These aren't needed anymore
Changes work as expected now. |
if self._timer_handle: | ||
self._timer_handle.cancel() |
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.
Ah, missed to cover this one line. During a long-ish reset_s
time, we should just re-send the motion message once to also cover this and make sure the delay restarts in tests, although the latter is a bit awkward to do, as we currently modify reset_s
to 0
. We may want to consider using the looptime
lib here(?)
Hmm, |
Proposed change
This reverts the BlitzWolf motion sensors to use the
IasZone
cluster instead of using theOccupancySensing
cluster.This change was made to keep existing entities working. The missing auto-reset delay was also reintroduced.
cc @prairiesnpr
Additional information
Small follow-up to #3612
Checklist
pre-commit
checks pass / the code has been formatted using Black