Fix Soma cover tilt (#99717)
parent
a4cb06d09f
commit
10bb8f5396
|
@ -51,6 +51,8 @@ class SomaTilt(SomaEntity, CoverEntity):
|
|||
| CoverEntityFeature.STOP_TILT
|
||||
| CoverEntityFeature.SET_TILT_POSITION
|
||||
)
|
||||
CLOSED_UP_THRESHOLD = 80
|
||||
CLOSED_DOWN_THRESHOLD = 20
|
||||
|
||||
@property
|
||||
def current_cover_tilt_position(self) -> int:
|
||||
|
@ -60,7 +62,12 @@ class SomaTilt(SomaEntity, CoverEntity):
|
|||
@property
|
||||
def is_closed(self) -> bool:
|
||||
"""Return if the cover tilt is closed."""
|
||||
return self.current_position == 0
|
||||
if (
|
||||
self.current_position < self.CLOSED_DOWN_THRESHOLD
|
||||
or self.current_position > self.CLOSED_UP_THRESHOLD
|
||||
):
|
||||
return True
|
||||
return False
|
||||
|
||||
def close_cover_tilt(self, **kwargs: Any) -> None:
|
||||
"""Close the cover tilt."""
|
||||
|
|
Loading…
Reference in New Issue