Skip to content

Commit 3e53ec3

Browse files
authored
Merge branch 'main' into refactor-state
2 parents c076803 + fdd9255 commit 3e53ec3

File tree

13 files changed

+790
-382
lines changed

13 files changed

+790
-382
lines changed

.github/workflows/constraints.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
pip==25.0.1
22
black==25.1.0
3-
pre-commit==4.1.0
4-
flake8==7.1.2
3+
pre-commit==4.2.0
4+
flake8==7.2.0
55
reorder-python-imports==3.14.0

.github/workflows/labeler.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,6 @@ jobs:
1414
uses: actions/checkout@v4
1515

1616
- name: Run Labeler
17-
uses: crazy-max/ghaction-github-labeler@v5.2.0
17+
uses: crazy-max/ghaction-github-labeler@v5.3.0
1818
with:
1919
skip-delete: true

.github/workflows/tests.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919
uses: actions/checkout@v4
2020

2121
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
22-
uses: actions/setup-python@v5.4.0
22+
uses: actions/setup-python@v5.5.0
2323
with:
2424
python-version: ${{ env.DEFAULT_PYTHON }}
2525

poetry.lock

Lines changed: 236 additions & 226 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyhilo/api.py

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,12 @@
66
import random
77
import string
88
import sys
9-
from typing import Any, Callable, Dict, Union, cast
9+
from typing import Any, Callable, Union, cast
1010
from urllib import parse
1111

1212
from aiohttp import ClientSession
1313
from aiohttp.client_exceptions import ClientResponseError
1414
import backoff
15-
from gql import Client, gql
16-
from gql.transport.aiohttp import AIOHTTPTransport
1715

1816
from pyhilo.const import (
1917
ANDROID_CLIENT_ENDPOINT,
@@ -45,7 +43,6 @@
4543
)
4644
from pyhilo.device import DeviceAttribute, HiloDevice, get_device_attributes
4745
from pyhilo.exceptions import InvalidCredentialsError, RequestError
48-
from pyhilo.graphql import GraphQlHelper
4946
from pyhilo.util.state import (
5047
StateDict,
5148
WebsocketDict,
@@ -513,22 +510,6 @@ async def get_devices(self, location_id: int) -> list[dict[str, Any]]:
513510
devices.append(callback())
514511
return devices
515512

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-
532513
async def _set_device_attribute(
533514
self,
534515
device: HiloDevice,

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.2.02"
10+
PYHILO_VERSION: Final = "2025.4.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/device/__init__.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,7 @@ def update(self, **kwargs: Dict[str, Union[str, int, Dict]]) -> None:
8787
new_val.append(DeviceAttribute("Disconnected", "null"))
8888
elif att == "provider":
8989
att = "manufacturer"
90-
new_val = HILO_PROVIDERS.get(
91-
int(val), f"Unknown ({val})"
92-
) # type: ignore
90+
new_val = HILO_PROVIDERS.get(int(val), f"Unknown ({val})") # type: ignore
9391
else:
9492
if att == "serial":
9593
att = "identifier"
@@ -234,9 +232,7 @@ def __init__(self, **kwargs: Dict[str, Any]):
234232
# attr='intensity',
235233
# value_type='%')
236234
# }
237-
kwargs["timeStamp"] = from_utc_timestamp(
238-
kwargs.pop("timeStampUTC", "")
239-
) # type: ignore
235+
kwargs["timeStamp"] = from_utc_timestamp(kwargs.pop("timeStampUTC", "")) # type: ignore
240236
self.id = 0
241237
self.value: Union[int, bool, str] = 0
242238
self.device_id = 0

0 commit comments

Comments
 (0)