Skip to content

Commit

Permalink
Fix shades and keen vents (#104)
Browse files Browse the repository at this point in the history
Co-authored-by: TheJulianJES <[email protected]>
  • Loading branch information
dmulcahey and TheJulianJES authored Jul 29, 2024
1 parent 3a4ac1e commit d932682
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
8 changes: 8 additions & 0 deletions tests/test_cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,6 +578,10 @@ async def test_shade(
| CoverEntityFeature.SET_POSITION
)

# coverage (these are always False for now)
assert entity.is_opening is False
assert entity.is_closing is False

# test that the state has changed from unavailable to off
await send_attributes_report(
zha_gateway, cluster_on_off, {cluster_on_off.AttributeDefs.on_off.id: 0}
Expand Down Expand Up @@ -736,6 +740,10 @@ async def test_keen_vent(
| CoverEntityFeature.SET_POSITION
)

# coverage (these are always False for now)
assert entity.is_opening is False
assert entity.is_closing is False

# test that the state has changed from unavailable to off
await send_attributes_report(zha_gateway, cluster_on_off, {8: 0, 0: False, 1: 1})
assert entity.state["state"] == STATE_CLOSED
Expand Down
12 changes: 11 additions & 1 deletion zha/application/platforms/cover/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,17 @@ def state(self) -> dict[str, Any]:
)
return response

@property
@functools.cached_property
def is_opening(self) -> bool:
"""Return if the cover is opening or not."""
return False

@functools.cached_property
def is_closing(self) -> bool:
"""Return if the cover is closing or not."""
return False

@functools.cached_property
def supported_features(self) -> CoverEntityFeature:
"""Return supported features."""
return self._attr_supported_features
Expand Down

0 comments on commit d932682

Please sign in to comment.