Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
basbruss committed Apr 12, 2024
1 parent 86ae9b9 commit f0e1e02
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
2 changes: 1 addition & 1 deletion custom_components/adaptive_cover/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
11 changes: 4 additions & 7 deletions custom_components/adaptive_cover/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -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__)

Expand Down Expand Up @@ -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."""
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit f0e1e02

Please sign in to comment.