diff --git a/custom_components/adaptive_cover/binary_sensor.py b/custom_components/adaptive_cover/binary_sensor.py index 8b57939..911b3d5 100644 --- a/custom_components/adaptive_cover/binary_sensor.py +++ b/custom_components/adaptive_cover/binary_sensor.py @@ -47,7 +47,7 @@ async def async_setup_entry( BinarySensorDeviceClass.RUNNING, coordinator, ) - async_add_entities([binary_sensor, manual_override]) + async_add_entities([binary_sensor]) class AdaptiveCoverBinarySensor( diff --git a/custom_components/adaptive_cover/coordinator.py b/custom_components/adaptive_cover/coordinator.py index 59b6299..76b73ef 100644 --- a/custom_components/adaptive_cover/coordinator.py +++ b/custom_components/adaptive_cover/coordinator.py @@ -62,12 +62,7 @@ DOMAIN, LOGGER, ) -from .helpers import ( - get_datetime_from_state, - get_last_updated, - get_safe_state, - get_time, -) +from .helpers import get_datetime_from_state, get_last_updated, get_safe_state, get_time _LOGGER = logging.getLogger(__name__) @@ -415,6 +410,8 @@ def state_change(self, states_data, our_state, blind_type, allow_reset): ) self.mark_manual_control(entity_id) self.set_last_updated(entity_id, new_state, allow_reset) + else: + self.reset(entity_id) def set_last_updated(self, entity_id, new_state, allow_reset): """Set last updated time for manual control.""" @@ -445,7 +442,7 @@ async def reset_if_needed(self): for entity_id, last_updated in manual_control_time_copy.items(): if current_time - last_updated > self.reset_duration: _LOGGER.debug( - "Resetting manual override for %s, because duration has elasped", + "Resetting manual override for %s, because duration has elapsed", entity_id, ) self.reset(entity_id)