Fix tilt-position for HmIPW-DRBL4 (#64208)

This commit is contained in:
Daniel Perna 2022-01-21 21:43:40 +01:00 committed by GitHub
parent 1b571db19d
commit 150bb65cad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -89,10 +89,9 @@ class HMCover(HMDevice, CoverEntity):
None is unknown, 0 is closed, 100 is fully open.
"""
if "LEVEL_2" not in self._data:
if not (position := self._data.get("LEVEL_2", 0)):
return None
return int(self._data.get("LEVEL_2", 0) * 100)
return int(position * 100)
def set_cover_tilt_position(self, **kwargs):
"""Move the cover tilt to a specific position."""