Explicitly return None in Velux covers (#45596)

pull/45602/head
Franck Nijhof 2021-01-27 10:17:26 +01:00 committed by GitHub
parent 491e66793e
commit 26e266181d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 6 deletions

View File

@ -96,6 +96,7 @@ class VeluxCover(CoverEntity):
"""Return the current position of the cover."""
if isinstance(self.node, Blind):
return 100 - self.node.orientation.position_percent
return None
@property
def device_class(self):
@ -154,9 +155,8 @@ class VeluxCover(CoverEntity):
async def async_set_cover_tilt_position(self, **kwargs):
"""Move cover tilt to a specific position."""
if ATTR_TILT_POSITION in kwargs:
position_percent = 100 - kwargs[ATTR_TILT_POSITION]
orientation = Position(position_percent=position_percent)
await self.node.set_orientation(
orientation=orientation, wait_for_completion=False
)
position_percent = 100 - kwargs[ATTR_TILT_POSITION]
orientation = Position(position_percent=position_percent)
await self.node.set_orientation(
orientation=orientation, wait_for_completion=False
)