Skip to content

Commit 00d766e

Browse files
authored
Merge pull request #354 from dvd-dev/undo_bad_fix
Undo bad fix
2 parents 8d72954 + a2f1f91 commit 00d766e

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

pyhilo/const.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
LOG: Final = logging.getLogger(__package__)
88
DEFAULT_STATE_FILE: Final = "hilo_state.yaml"
99
REQUEST_RETRY: Final = 9
10-
PYHILO_VERSION: Final = "2025.12.02"
10+
PYHILO_VERSION: Final = "2025.12.03"
1111
# TODO: Find a way to keep previous line in sync with pyproject.toml automatically
1212

1313
CONTENT_TYPE_FORM: Final = "application/x-www-form-urlencoded"

pyhilo/event.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,9 +81,9 @@ def should_check_for_allowed_wh(self) -> bool:
8181
"""This function is used to authorize subscribing to a specific event in Hilo to receive the allowed_kWh
8282
that is made available in the pre_heat phase"""
8383
now = datetime.now(self.preheat_start.tzinfo)
84-
time_since_preheat_start = (self.preheat_start - now).total_seconds()
84+
time_since_preheat_start = (now - self.preheat_start).total_seconds()
8585
already_has_allowed_wh = self.allowed_kWh > 0
86-
return 1800 <= time_since_preheat_start <= 2700 and not already_has_allowed_wh
86+
return 1800 <= time_since_preheat_start < 7200 and not already_has_allowed_wh
8787

8888
def as_dict(self) -> dict[str, Any]:
8989
"""Formats the information received as a dictionary"""
@@ -108,9 +108,8 @@ def _convert_phases(self, phases: dict[str, Any]) -> None:
108108
self.phases_list.append(phase)
109109
for phase in self.__annotations__:
110110
if phase not in self.phases_list:
111-
now_with_tz = datetime.now(timezone.utc).astimezone()
112111
# On t'aime Carl
113-
setattr(self, phase, now_with_tz)
112+
setattr(self, phase, datetime(2099, 12, 31, tzinfo=timezone.utc))
114113

115114
def _create_phases(
116115
self, hours: int, phase_name: str, parent_phase: str

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ exclude = ".venv/.*"
4040

4141
[tool.poetry]
4242
name = "python-hilo"
43-
version = "2025.12.2"
43+
version = "2025.12.3"
4444
description = "A Python3, async interface to the Hilo API"
4545
readme = "README.md"
4646
authors = ["David Vallee Delisle <[email protected]>"]

0 commit comments

Comments
 (0)