diff --git a/custom_components/tahoma/cover_devices/tahoma_cover.py b/custom_components/tahoma/cover_devices/tahoma_cover.py index 8fd4e3374..993920bc8 100644 --- a/custom_components/tahoma/cover_devices/tahoma_cover.py +++ b/custom_components/tahoma/cover_devices/tahoma_cover.py @@ -103,9 +103,6 @@ async def async_set_cover_tilt_position(self, **kwargs): def is_closed(self): """Return if the cover is closed.""" - if self.current_cover_position is not None: - return self.current_cover_position == 0 - state = self.executor.select_state( CORE_OPEN_CLOSED_STATE, CORE_SLATS_OPEN_CLOSED_STATE, @@ -117,6 +114,10 @@ def is_closed(self): if state is not None: return state == STATE_CLOSED + # Keep this condition after the previous one. Some device like the pedestrian gate, always return 50 as position. + if self.current_cover_position is not None: + return self.current_cover_position == 0 + if self.current_cover_tilt_position is not None: return self.current_cover_tilt_position == 0