diff --git a/custom_components/xiaomi_miot/cover.py b/custom_components/xiaomi_miot/cover.py index fa28f510c..18a8c0e7e 100644 --- a/custom_components/xiaomi_miot/cover.py +++ b/custom_components/xiaomi_miot/cover.py @@ -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):