Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion pyhilo/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
7 changes: 3 additions & 4 deletions pyhilo/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"""
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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 <me@dvd.dev>"]
Expand Down
Loading