Skip to content

Commit

Permalink
Fixed bug with blinds cover position
Browse files Browse the repository at this point in the history
  • Loading branch information
c503ghosh committed Feb 23, 2024
1 parent be8b74c commit 0d9d6a7
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions custom_components/dirigera_platform/mocks/ikea_blinds_mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,15 @@ def close_cover(self, **kwargs):

def set_cover_position(self, **kwargs):
logger.debug("blinds set_cover_position {}".format(kwargs))
logger.debug(kwargs['position'])
logger.debug("Current: {}, Target: {}".format(self._current_level, self._target_level))

position = int(kwargs[0])
if position >= 0 and position <= 100:
self._target_level = position
self._current_level = position

if 'position' in kwargs:
position = kwargs['position']
if position >= 0 and position <= 100:
self._target_level = position
self._current_level = position
logger.debug("Now: Current: {}, Target: {}".format(self._current_level, self._target_level))

async def async_will_remove_from_hass(self) -> None:
ikea_blinds_mock.counter = ikea_blinds_mock.counter - 1

0 comments on commit 0d9d6a7

Please sign in to comment.