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 GitHub
parent e35e460e69
commit 30189fb5d5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -79,6 +79,9 @@ class KNXCover(KnxEntity, CoverEntity):
@property
def is_closed(self):
"""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()
@property