diff --git a/pyhilo/const.py b/pyhilo/const.py index 9941d5f..407d310 100755 --- a/pyhilo/const.py +++ b/pyhilo/const.py @@ -7,7 +7,7 @@ LOG: Final = logging.getLogger(__package__) DEFAULT_STATE_FILE: Final = "hilo_state.yaml" REQUEST_RETRY: Final = 9 -PYHILO_VERSION: Final = "2025.12.02" +PYHILO_VERSION: Final = "2025.12.03" # TODO: Find a way to keep previous line in sync with pyproject.toml automatically CONTENT_TYPE_FORM: Final = "application/x-www-form-urlencoded" diff --git a/pyhilo/event.py b/pyhilo/event.py index 0fea4af..6b50e6c 100755 --- a/pyhilo/event.py +++ b/pyhilo/event.py @@ -81,9 +81,9 @@ def should_check_for_allowed_wh(self) -> bool: """This function is used to authorize subscribing to a specific event in Hilo to receive the allowed_kWh that is made available in the pre_heat phase""" now = datetime.now(self.preheat_start.tzinfo) - time_since_preheat_start = (self.preheat_start - now).total_seconds() + time_since_preheat_start = (now - self.preheat_start).total_seconds() already_has_allowed_wh = self.allowed_kWh > 0 - return 1800 <= time_since_preheat_start <= 2700 and not already_has_allowed_wh + return 1800 <= time_since_preheat_start < 7200 and not already_has_allowed_wh def as_dict(self) -> dict[str, Any]: """Formats the information received as a dictionary""" @@ -108,9 +108,8 @@ def _convert_phases(self, phases: dict[str, Any]) -> None: self.phases_list.append(phase) for phase in self.__annotations__: if phase not in self.phases_list: - now_with_tz = datetime.now(timezone.utc).astimezone() # On t'aime Carl - setattr(self, phase, now_with_tz) + setattr(self, phase, datetime(2099, 12, 31, tzinfo=timezone.utc)) def _create_phases( self, hours: int, phase_name: str, parent_phase: str diff --git a/pyproject.toml b/pyproject.toml index c52f7b9..e373d6b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -40,7 +40,7 @@ exclude = ".venv/.*" [tool.poetry] name = "python-hilo" -version = "2025.12.2" +version = "2025.12.3" description = "A Python3, async interface to the Hilo API" readme = "README.md" authors = ["David Vallee Delisle "]