-
Notifications
You must be signed in to change notification settings - Fork 35
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
Improvements to Cover entity handling #376
base: dev
Are you sure you want to change the base?
Conversation
eb25950
to
7c14516
Compare
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## dev #376 +/- ##
==========================================
+ Coverage 96.42% 96.49% +0.06%
==========================================
Files 61 61
Lines 9644 9774 +130
==========================================
+ Hits 9299 9431 +132
+ Misses 345 343 -2 ☔ View full report in Codecov by Sentry. |
This aims to address issues in correctly representing the current cover status. - Fixes issue where the movement state instigated by 'go to' commands is not cleared upon completion - Implements movement timeout and previous sate comparison to determine device instigated changes - Removed target position entity attributes (we don't need to restore these) - Fix tests for tilt axis
86a57a0
to
f7281ad
Compare
More efficient on devices that frequently report position updates.
The previous logic was failing to populate the `_attr_device_class` because WindowCoveringType.Rollershade == 0x00. We should instead check for `is not None`.
694cce9
to
d60ca43
Compare
This prevents ZHA from incorrectly marking the state as opening/closing if the cover is already at its target. This could occur if the cover immediately reported an attribute update after receiving the command.
d60ca43
to
cbd377a
Compare
I've finished making amendments to this. |
- Properties return None when the value not known (per https://developers.home-assistant.io/docs/core/entity/cover/) - Move shade _attr_supported_features out of init - Improvements to common zcl/ha value conversion functions
Thanks! I've merged I have a ThirdReality blind and am noticing nothing unusual when testing this PR out. The only thing is the cover state sometimes jittering "opening -> open -> opening -> open" in the last second, but this is still an improvement over the previous functionality where the cover sometimes got "stuck" if an attribute report was missed. |
Thanks @puddly! Thinking about it, what you describe might be a side effect of the tolerance logic. i.e.
Setting the tolerance to 0 would allow us to test this hypothesis. If that's the root cause I suspect we could remove the tolerance because we now have the 5 second timeout after no position update. Edited for clarity. |
I wonder if we can implement something like the light transitioning logic we have…. Maybe it isn’t worth the effort / complexity. |
This scenario can be handled using the timeout
I think I might have fixed this particular issue with 517822e, but I'll take a look at the methods in the light cluster handler this morning and see if there's some learnings we could apply. |
I'll be pushing an update to this tomorrow with split methods for handling tilt/lift transition state timeout once I've finished testing it locally. Trying to handle them both in a single timer creates more problems than it solves with devices supporting both axis. |
- Use separate timers for lift and tilt - Add test for concurrent movement state handling
c919381
to
dad925c
Compare
Hi @puddly, @dmulcahey dad925c incorporates the separate timers for lift/tilt movement transitions. This ensures we correctly handle concurrent movement of the two axis and their transition states. I've added a test to explicitly validate this scenario performs as expected. |
- Clear active transition when setting a new target position - Use properties to abstract from previous position deque mechanism - Consider whether a transition is active when determining state
Aims to address the issue where a cover gets stuck in opening/closing state, also corrects some other bugs I've encountered whilst refactoring the code.
Changes
Fixes
Addresses issues