Add missing is_closed property to powerview tilt only entities (#113792)

* add tilt closed

* add current positioning
pull/112449/head
kingy444 2024-03-23 06:34:00 +11:00 committed by GitHub
parent 205c457a77
commit 7d9fa64a66
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 0 deletions

View File

@ -520,6 +520,22 @@ class PowerViewShadeTiltOnly(PowerViewShadeWithTiltBase):
self._attr_supported_features |= CoverEntityFeature.STOP_TILT
self._max_tilt = self._shade.shade_limits.tilt_max
@property
def current_cover_position(self) -> int:
"""Return the current position of cover."""
# allows using parent class with no other alterations
return CLOSED_POSITION
@property
def transition_steps(self) -> int:
"""Return the steps to make a move."""
return self.positions.tilt
@property
def is_closed(self) -> bool:
"""Return if the cover is closed."""
return self.positions.tilt <= CLOSED_POSITION
class PowerViewShadeTopDown(PowerViewShadeBase):
"""Representation of a shade that lowers from the roof to the floor.