|
6 | 6 | import random |
7 | 7 | import string |
8 | 8 | import sys |
9 | | -from typing import Any, Callable, Dict, Union, cast |
| 9 | +from typing import Any, Callable, Union, cast |
10 | 10 | from urllib import parse |
11 | 11 |
|
12 | 12 | from aiohttp import ClientSession |
13 | 13 | from aiohttp.client_exceptions import ClientResponseError |
14 | 14 | import backoff |
15 | | -from gql import Client, gql |
16 | | -from gql.transport.aiohttp import AIOHTTPTransport |
17 | 15 |
|
18 | 16 | from pyhilo.const import ( |
19 | 17 | ANDROID_CLIENT_ENDPOINT, |
|
45 | 43 | ) |
46 | 44 | from pyhilo.device import DeviceAttribute, HiloDevice, get_device_attributes |
47 | 45 | from pyhilo.exceptions import InvalidCredentialsError, RequestError |
48 | | -from pyhilo.graphql import GraphQlHelper |
49 | 46 | from pyhilo.util.state import ( |
50 | 47 | StateDict, |
51 | 48 | WebsocketDict, |
@@ -513,22 +510,6 @@ async def get_devices(self, location_id: int) -> list[dict[str, Any]]: |
513 | 510 | devices.append(callback()) |
514 | 511 | return devices |
515 | 512 |
|
516 | | - async def call_get_location_query(self, location_hilo_id: string) -> Dict[str, Any]: |
517 | | - access_token = await self.async_get_access_token() |
518 | | - transport = AIOHTTPTransport( |
519 | | - url="https://platform.hiloenergie.com/api/digital-twin/v3/graphql", |
520 | | - headers={"Authorization": f"Bearer {access_token}"}, |
521 | | - ) |
522 | | - client = Client(transport=transport, fetch_schema_from_transport=True) |
523 | | - query = gql(GraphQlHelper.query_get_location()) |
524 | | - |
525 | | - async with client as session: |
526 | | - result = await session.execute( |
527 | | - query, variable_values={"locationHiloId": location_hilo_id} |
528 | | - ) |
529 | | - LOG.info(result) |
530 | | - return result |
531 | | - |
532 | 513 | async def _set_device_attribute( |
533 | 514 | self, |
534 | 515 | device: HiloDevice, |
|
0 commit comments