Skip to content

Commit

Permalink
Shorten ChargingBinarySensor cooldown
Browse files Browse the repository at this point in the history
  • Loading branch information
dan-r committed Jan 2, 2024
1 parent 712b9d8 commit d54e8d3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions custom_components/ohme/binary_sensor.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,9 +188,9 @@ def _calculate_state(self) -> bool:
@callback
def _handle_coordinator_update(self) -> None:
"""Update data."""
# Don't accept updates if 20s hasnt passed
# Don't accept updates if 5s hasnt passed
# State calculations use deltas that may be unreliable to check if requests are too often
if self._last_updated and (utcnow().timestamp() - self._last_updated.timestamp() < 20):
if self._last_updated and (utcnow().timestamp() - self._last_updated.timestamp() < 5):
_LOGGER.debug("ChargingBinarySensor: State update too soon - suppressing")
return

Expand Down

0 comments on commit d54e8d3

Please sign in to comment.