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.10.02"
PYHILO_VERSION: Final = "2025.11.01"
# 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
9 changes: 8 additions & 1 deletion pyhilo/graphql.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import asyncio
import logging
import ssl
from typing import Any, Dict, List, Optional

from gql import Client, gql
Expand Down Expand Up @@ -552,11 +553,17 @@ async def subscribe_to_device_updated(

# Setting log level to suppress keepalive messages on gql transport
logging.getLogger("gql.transport.websockets").setLevel(logging.WARNING)

#
loop = asyncio.get_event_loop()
ssl_context = await loop.run_in_executor(None, ssl.create_default_context)

while True: # Loop to reconnect if the connection is lost
LOG.debug("subscribe_to_device_updated while true")
access_token = await self._get_access_token()
transport = WebsocketsTransport(
url=f"wss://platform.hiloenergie.com/api/digital-twin/v3/graphql?access_token={access_token}"
url=f"wss://platform.hiloenergie.com/api/digital-twin/v3/graphql?access_token={access_token}",
ssl=ssl_context,
)
client = Client(transport=transport, fetch_schema_from_transport=True)
query = gql(self.SUBSCRIPTION_DEVICE_UPDATED)
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.10.2"
version = "2025.11.1"
description = "A Python3, async interface to the Hilo API"
readme = "README.md"
authors = ["David Vallee Delisle <me@dvd.dev>"]
Expand Down
Loading