From 26e266181de850e4e636c272de949cceedf93ecb Mon Sep 17 00:00:00 2001 From: Franck Nijhof Date: Wed, 27 Jan 2021 10:17:26 +0100 Subject: [PATCH] Explicitly return None in Velux covers (#45596) --- homeassistant/components/velux/cover.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/homeassistant/components/velux/cover.py b/homeassistant/components/velux/cover.py index 3c853b11cb5..187c0d36178 100644 --- a/homeassistant/components/velux/cover.py +++ b/homeassistant/components/velux/cover.py @@ -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 + )