Skip to content

Commit

Permalink
↕️ fix deviated_position option for cover (#2264)
Browse files Browse the repository at this point in the history
  • Loading branch information
al-one committed Jan 2, 2025
1 parent c74a9fa commit 7da81c8
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions custom_components/xiaomi_miot/cover.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,12 @@ def set_state(self, data: dict):
'target2current_position': True,
})
if (val := self._attr_current_cover_position) != None:
if self._deviated_position is None:
pass
elif val <= self._deviated_position:
self._attr_current_cover_position = 0
elif val >= (100 - self._deviated_position):
self._attr_current_cover_position = 100
self._attr_is_closed = val <= self._closed_position

async def async_open_cover(self, **kwargs):
Expand Down

0 comments on commit 7da81c8

Please sign in to comment.