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.01"
PYHILO_VERSION: Final = "2025.12.02"
# 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
3 changes: 2 additions & 1 deletion pyhilo/event.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,9 @@ 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, from_utc_timestamp("2023-11-15T20:00:00+00:00"))
setattr(self, phase, now_with_tz)

def _create_phases(
self, hours: int, phase_name: str, parent_phase: str
Expand Down
7 changes: 7 additions & 0 deletions pyhilo/websocket.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,10 @@ async def async_connect(self) -> None:
LOG.debug("Websocket: async_connect() called but already connected")
return

if self._api.session.closed:
LOG.error("Websocket: Cannot connect, session is closed")
raise CannotConnectError("Session is closed")

LOG.info("Websocket: Connecting to server %s", self._api.endpoint)
if self._api.log_traces:
LOG.debug("[TRACE] Websocket URL: %s", self._api.full_ws_url)
Expand Down Expand Up @@ -344,6 +348,9 @@ async def async_listen(self) -> None:
messages = await self._async_receive_json()
for msg in messages:
self._parse_message(msg)
except asyncio.CancelledError:
LOG.info("Websocket: Listen cancelled.")
raise
except ConnectionClosedError as err:
LOG.error(f"Websocket: Closed while listening: {err}")
LOG.exception(err)
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.1"
version = "2025.12.2"
description = "A Python3, async interface to the Hilo API"
readme = "README.md"
authors = ["David Vallee Delisle <me@dvd.dev>"]
Expand Down
Loading