From 96eac2a81cfeb667263069e45c3965ed69c2cd74 Mon Sep 17 00:00:00 2001 From: "Ian C." <108159253+ic-dev21@users.noreply.github.com> Date: Sun, 7 Dec 2025 14:51:41 -0500 Subject: [PATCH 1/3] Update event.py MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Le fix pouvait causer problème lors d'un reboot. Mis une date future au lieu d'une date pas rapport dans le passé. --- pyhilo/event.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyhilo/event.py b/pyhilo/event.py index 0fea4af..7970010 100755 --- a/pyhilo/event.py +++ b/pyhilo/event.py @@ -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 From 01e275cb8fe5dfa70e0a9005152f73ecdc05649f Mon Sep 17 00:00:00 2001 From: "Ian C." <108159253+ic-dev21@users.noreply.github.com> Date: Sun, 7 Dec 2025 14:52:21 -0500 Subject: [PATCH 2/3] Bump up version --- pyhilo/const.py | 2 +- pyproject.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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 "] From a2f1f91f277990918aa97478d6dbd5eca7c9a049 Mon Sep 17 00:00:00 2001 From: "Ian C." <108159253+ic-dev21@users.noreply.github.com> Date: Sun, 7 Dec 2025 15:54:05 -0500 Subject: [PATCH 3/3] Update event.py This condition would never be true and thus we would never get that function to run. --- pyhilo/event.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pyhilo/event.py b/pyhilo/event.py index 7970010..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"""