From 9308026350c1124a659fa826d5118ebe3e0777a6 Mon Sep 17 00:00:00 2001 From: gluap Date: Sun, 31 Dec 2023 19:48:50 +0100 Subject: [PATCH] return unknown state if none is known --- custom_components/duofern/cover.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/custom_components/duofern/cover.py b/custom_components/duofern/cover.py index 5292030..f5c6d9c 100644 --- a/custom_components/duofern/cover.py +++ b/custom_components/duofern/cover.py @@ -102,8 +102,10 @@ def current_cover_position(self) -> int | None: return self._state @property - def is_closed(self) -> bool: + def is_closed(self) -> bool | None: """Return true if cover is close.""" + if self._state is None: + return None return self._state == 0 @property