Skip to content

Commit

Permalink
Merge pull request #90 from zabuldon/dev
Browse files Browse the repository at this point in the history
2020-07-03
  • Loading branch information
alandtse committed Jul 3, 2020
2 parents c4954af + 0033c27 commit f0c2310
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions teslajsonpy/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -584,15 +584,16 @@ def _calculate_next_interval(vin: Text) -> int:
):
if self.__update_state[vin] != "trying_to_sleep":
self.__update_state[vin] = "trying_to_sleep"
sleep_interval = max(SLEEP_INTERVAL, self.update_interval)
_LOGGER.debug(
"%s trying to sleep; scan throttled to %s seconds and will ignore updates for %s seconds",
vin[-5:],
SLEEP_INTERVAL,
sleep_interval,
round(
SLEEP_INTERVAL + self._last_update_time[vin] - cur_time, 2
sleep_interval + self._last_update_time[vin] - cur_time, 2,
),
)
return SLEEP_INTERVAL
return sleep_interval
if self.__update_state[vin] != "normal":
self.__update_state[vin] = "normal"
_LOGGER.debug(
Expand Down

0 comments on commit f0c2310

Please sign in to comment.