Skip to content

Commit

Permalink
#317 typo
Browse files Browse the repository at this point in the history
  • Loading branch information
magnuselden authored and magnuselden committed Dec 10, 2023
1 parent 71ebeb7 commit 24333c5
Showing 1 changed file with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from __future__ import annotations

import logging
import time
from typing import TYPE_CHECKING, Tuple

from peaqevcore.common.models.observer_types import ObserverTypes
Expand All @@ -27,7 +28,8 @@ class ChargeController(IChargeController):
def __init__(
self, hub: HomeAssistantHub, charger_states: dict, charger_type: ChargerType
):
self._aux_running_grace_timer = WaitTimer(timeout=300, init_now=False)
self._aux_running_grace_timer = WaitTimer(timeout=300, init_now=True)
self._init_time = time.time()
super().__init__(hub, charger_states, charger_type)

@property
Expand Down Expand Up @@ -103,8 +105,8 @@ async def async_get_status_connected(
return ChargeControllerStates.Error, True

async def _aux_check_running_charger_mismatch(self, status_type: ChargeControllerStates) -> None:
if self._aux_running_grace_timer.is_timeout() and self._aux_running_grace_timer.value > 0:
_LOGGER.warning(f"Charger seems to be running without Peaqev controlling it. Attempting aux stop. If you wish to charge without Peaqev you need to disable it on the switch.")
if self._aux_running_grace_timer.is_timeout():
_LOGGER.warning(f"Charger seems to be running without Peaqev controlling it. Attempting aux stop. If you wish to charge without Peaqev you need to disable it on the switch. {self._aux_running_grace_timer.value}, {self._aux_running_grace_timer.timeout}, {self._init_time}")
await self.hub.observer.async_broadcast(ObserverTypes.KillswitchDead)
self._aux_running_grace_timer.reset()
elif status_type in [
Expand Down

0 comments on commit 24333c5

Please sign in to comment.