Skip to content

Commit 0bda1c9

Browse files
authored
Merge pull request #341 from dvd-dev/blocking_calls
Blocking calls
2 parents ef20501 + 1d09677 commit 0bda1c9

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
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.10.02"
10+
PYHILO_VERSION: Final = "2025.11.01"
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/graphql.py

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import asyncio
22
import logging
3+
import ssl
34
from typing import Any, Dict, List, Optional
45

56
from gql import Client, gql
@@ -552,11 +553,17 @@ async def subscribe_to_device_updated(
552553

553554
# Setting log level to suppress keepalive messages on gql transport
554555
logging.getLogger("gql.transport.websockets").setLevel(logging.WARNING)
556+
557+
#
558+
loop = asyncio.get_event_loop()
559+
ssl_context = await loop.run_in_executor(None, ssl.create_default_context)
560+
555561
while True: # Loop to reconnect if the connection is lost
556562
LOG.debug("subscribe_to_device_updated while true")
557563
access_token = await self._get_access_token()
558564
transport = WebsocketsTransport(
559-
url=f"wss://platform.hiloenergie.com/api/digital-twin/v3/graphql?access_token={access_token}"
565+
url=f"wss://platform.hiloenergie.com/api/digital-twin/v3/graphql?access_token={access_token}",
566+
ssl=ssl_context,
560567
)
561568
client = Client(transport=transport, fetch_schema_from_transport=True)
562569
query = gql(self.SUBSCRIPTION_DEVICE_UPDATED)

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.10.2"
43+
version = "2025.11.1"
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)