Skip to content

Verify cover supported features per window covering type #410

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

Merged

Conversation

jeverley
Copy link
Contributor

@jeverley jeverley commented Apr 7, 2025

What's changed

  • The current_position and current_tilt_position state attributes now report None if their features are not supported by the device, resolves #142352
    • This is required because some devices are reporting a position of 0 rather than null
  • Revise supported_features logic so it excludes tilt only window covering types when enabling lift features
    • This means that lift features will still be enabled as a fallback if the window_covering_type attribute value is undefined by the device
    • Previously lift features were enabled for all devices, they should not be enabled for WCT.Shutter or WCT.Tilt_blind_tilt_only types, see Table 7-41. Window Covering Type from the Cluster Library Specification 07-5123 Revision 8

image

  • Updates to cover platform tests
    • Check lift only devices don't have tilt features enabled and that state attribute current_tilt_position is always None
    • Check tilt only devices don't have lift features enabled and that state attribute current_position is always None

Fixes issue

Related

FYI @TheJulianJES, @puddly, @dmulcahey

Copy link

codecov bot commented Apr 7, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 96.70%. Comparing base (33b221d) to head (d519f6e).
Report is 2 commits behind head on dev.

Additional details and impacted files
@@            Coverage Diff             @@
##              dev     #410      +/-   ##
==========================================
+ Coverage   96.69%   96.70%   +0.01%     
==========================================
  Files          61       61              
  Lines        9863     9867       +4     
==========================================
+ Hits         9537     9542       +5     
+ Misses        326      325       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@jeverley jeverley force-pushed the cover-handle-lift-only-devices-reporting-tilt-position branch from 90f300b to aab8119 Compare April 7, 2025 10:45
@jeverley jeverley force-pushed the cover-handle-lift-only-devices-reporting-tilt-position branch from aab8119 to d9cfa64 Compare April 7, 2025 10:46
@jeverley jeverley changed the title Amend _attr_supported_features logic and position attributes to respe… Ensure a cover's supported features and attributes are respective of its window covering type Apr 7, 2025
@jeverley jeverley changed the title Ensure a cover's supported features and attributes are respective of its window covering type Ensure a cover's supported features and attributes are respective of its window covering type attribute Apr 7, 2025
@jeverley jeverley force-pushed the cover-handle-lift-only-devices-reporting-tilt-position branch from dc502ce to 5953d0f Compare April 8, 2025 08:48
jeverley added a commit to jeverley/zha that referenced this pull request Apr 9, 2025
…e HA cache

This adds a timeout for movement states restored from the entity cache.

Uses zigpy#410 as a base.
@TheJulianJES TheJulianJES changed the title Ensure a cover's supported features and attributes are respective of its window covering type attribute Verify cover supported features per window covering type Apr 14, 2025
@puddly puddly merged commit 42196e3 into zigpy:dev Apr 15, 2025
9 checks passed
puddly pushed a commit to jeverley/zha that referenced this pull request Apr 15, 2025
…e HA cache

This adds a timeout for movement states restored from the entity cache.

Uses zigpy#410 as a base.
jeverley added a commit to jeverley/zha that referenced this pull request Apr 23, 2025
…e HA cache

This adds a timeout for movement states restored from the entity cache.

Uses zigpy#410 as a base.
puddly pushed a commit that referenced this pull request Apr 29, 2025
* Refresh cover state after the default timeout after restoring from the HA cache

This adds a timeout for movement states restored from the entity cache.

Uses #410 as a base.

* Implement checks to ensure a movement state is not restored if the device has already reached the movement extrema

- Updates tests to use a common mock cover device creation function to reduce code repetition

* Remove `_is_completely_open` property and init `_state` with None

- We init `_state` with None and let the `_determine_cover_state` function populate the value from current positions
- Ensures all lines are coverable by tests

* Ensure cover state restore and transition timer handles are cancelled upon entity removal

* Add tests for on_remove timer cancellations

* Make use of clear_transition methods to cancel timers on removal

* Test cleanup

* Add annotations for async_update test

* Consolidate cover calls to `maybe_emit_state_changed_event` into `_determine_cover_position` function

* Ensure position attributes are still updated when the state doesn't change
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Zigbee Soma Smart Shades 3 covers report OPEN state when closed
3 participants