File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change 11import asyncio
22import logging
3+ import ssl
34from typing import Any , Dict , List , Optional
45
56from 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 )
You can’t perform that action at this time.
0 commit comments