From 4b3449fe0c6b73c1329270d71b6d9a435942f5f0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20H=C3=B6rsken?= Date: Sat, 28 Jun 2025 21:57:26 +0200 Subject: [PATCH] Fix error if cover position is not available or unknown (#147732) --- homeassistant/components/wmspro/cover.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/homeassistant/components/wmspro/cover.py b/homeassistant/components/wmspro/cover.py index 0d9ccb8547d..77dd928bc95 100644 --- a/homeassistant/components/wmspro/cover.py +++ b/homeassistant/components/wmspro/cover.py @@ -53,6 +53,8 @@ class WebControlProCover(WebControlProGenericEntity, CoverEntity): def current_cover_position(self) -> int | None: """Return current position of cover.""" action = self._dest.action(self._drive_action_desc) + if action is None or action["percentage"] is None: + return None return 100 - action["percentage"] async def async_set_cover_position(self, **kwargs: Any) -> None: