Fix KNX cover state return open when unknown (#44926)

This commit is contained in:
Matthias Alphart 2021-01-08 11:50:02 +01:00 committed by Paulus Schoutsen
parent 57d119a7fe
commit 5ef6f87ab9

View File

@ -79,6 +79,9 @@ class KNXCover(KnxEntity, CoverEntity):
@property @property
def is_closed(self): def is_closed(self):
"""Return if the cover is closed.""" """Return if the cover is closed."""
# state shall be "unknown" when xknx travelcalculator is not initialized
if self._device.current_position() is None:
return None
return self._device.is_closed() return self._device.is_closed()
@property @property