python-hilo 2023.4.1__tar.gz → 2023.4.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: python-hilo
3
- Version: 2023.4.1
3
+ Version: 2023.4.2
4
4
  Summary: A Python3, async interface to the Hilo API
5
5
  Home-page: https://github.com/dvd-dev/python-hilo
6
6
  License: MIT
@@ -53,7 +53,6 @@ from pyhilo.device import DeviceAttribute, HiloDevice, get_device_attributes
53
53
  from pyhilo.exceptions import InvalidCredentialsError, RequestError
54
54
  from pyhilo.util import schedule_callback
55
55
  from pyhilo.util.state import (
56
- RegistrationDict,
57
56
  TokenDict,
58
57
  WebsocketDict,
59
58
  WebsocketTransportsDict,
@@ -49,15 +49,13 @@ AUTOMATION_HOSTNAME: Final = "automation.hiloenergie.com"
49
49
  AUTOMATION_DEVICEHUB_ENDPOINT: Final = "/DeviceHub"
50
50
 
51
51
  # Request constants
52
- DEFAULT_USER_AGENT: Final = (
53
- f"HomeAssistantHilo/{HILO_APP_VERSION} HomeAssistant/{homeassistant.core.__version__} aiohttp/{aiohttp.__version__} Python/{platform.python_version()}"
54
- )
52
+ DEFAULT_USER_AGENT: Final = f"HomeAssistantHilo/{HILO_APP_VERSION} HomeAssistant/{homeassistant.core.__version__} aiohttp/{aiohttp.__version__} Python/{platform.python_version()}"
55
53
 
56
54
 
57
55
  # NOTE(dvd): Not sure how to get new ones so I'm using the ones from my emulator
58
56
  # We can't unfortunately randomize this device id, I believe it's generated when
59
57
  # an android device registers to the play store, but I'm no android dev.
60
- #ANDROID_DEVICE_ID: Final = 3530136576518667218
58
+ # ANDROID_DEVICE_ID: Final = 3530136576518667218
61
59
  # NOTE(dvd): Based on issue #113, this can be set to 0
62
60
  ANDROID_DEVICE_ID: Final = 3530136576518667218
63
61
 
@@ -9,7 +9,7 @@ from pyhilo.device import HiloDevice
9
9
 
10
10
  class Climate(HiloDevice):
11
11
  def __init__(self, api: API, **kwargs: dict[str, Union[str, int]]):
12
- super().__init__(api, **kwargs)
12
+ super().__init__(api, **kwargs) # type: ignore
13
13
  LOG.debug(f"Setting up Climate device: {self.name}")
14
14
 
15
15
  @property
@@ -9,7 +9,7 @@ from pyhilo.device import HiloDevice
9
9
 
10
10
  class Light(HiloDevice):
11
11
  def __init__(self, api: API, **kwargs: dict[str, Union[str, int]]):
12
- super().__init__(api, **kwargs)
12
+ super().__init__(api, **kwargs) # type: ignore
13
13
  LOG.debug(f"Setting up Light device: {self.name}")
14
14
 
15
15
  @property
@@ -9,7 +9,7 @@ from pyhilo.device import HiloDevice
9
9
 
10
10
  class Sensor(HiloDevice):
11
11
  def __init__(self, api: API, **kwargs: dict[str, Union[str, int]]):
12
- super().__init__(api, **kwargs)
12
+ super().__init__(api, **kwargs) # type: ignore
13
13
  LOG.debug(f"Setting up Sensor device: {self.name}")
14
14
 
15
15
  @property
@@ -9,7 +9,7 @@ from pyhilo.device import HiloDevice
9
9
 
10
10
  class Switch(HiloDevice):
11
11
  def __init__(self, api: API, **kwargs: dict[str, Union[str, int]]):
12
- super().__init__(api, **kwargs)
12
+ super().__init__(api, **kwargs) # type: ignore
13
13
  LOG.debug(f"Setting up Switch device: {self.name}")
14
14
 
15
15
  @property
@@ -80,9 +80,9 @@ class Devices:
80
80
  async def update(self) -> None:
81
81
  fresh_devices = await self._api.get_devices(self.location_id)
82
82
  generated_devices = []
83
- for device in fresh_devices:
84
- LOG.debug(f"Generating device {device}")
85
- dev = self.generate_device(device)
83
+ for raw_device in fresh_devices:
84
+ LOG.debug(f"Generating device {raw_device}")
85
+ dev = self.generate_device(raw_device)
86
86
  generated_devices.append(dev)
87
87
  if dev not in self.devices:
88
88
  self.devices.append(dev)
@@ -181,6 +181,7 @@ class WebsocketClient:
181
181
  raise InvalidMessageError("Received invalid JSON") from v_exc
182
182
  except json.decoder.JSONDecodeError as j_exc:
183
183
  LOG.error(f"Received invalid JSON: {msg.data}")
184
+ LOG.exception(j_exc)
184
185
  data = {}
185
186
 
186
187
  self._watchdog.trigger()
@@ -280,7 +281,7 @@ class WebsocketClient:
280
281
  )
281
282
  except (ClientError, ServerDisconnectedError, WSServerHandshakeError) as err:
282
283
  LOG.error(f"Unable to connect to WS server {err}")
283
- if hasattr(err, "status") and err.status in (401, 403, 404, 409): # type: ignore
284
+ if hasattr(err, "status") and err.status in (401, 403, 404, 409):
284
285
  raise InvalidCredentialsError("Invalid credentials") from err
285
286
  except Exception as err:
286
287
  LOG.error(f"Unable to connect to WS server {err}")
@@ -40,7 +40,7 @@ exclude = ".venv/.*"
40
40
 
41
41
  [tool.poetry]
42
42
  name = "python-hilo"
43
- version = "2023.04.01"
43
+ version = "2023.04.02"
44
44
  description = "A Python3, async interface to the Hilo API"
45
45
  readme = "README.md"
46
46
  authors = ["David Vallee Delisle <me@dvd.dev>"]
@@ -75,15 +75,15 @@ voluptuous = ">=0.13.1"
75
75
  websockets = ">=8.1,<11.0"
76
76
 
77
77
  [tool.poetry.dev-dependencies]
78
- Sphinx = "^5.3.0"
78
+ Sphinx = "^6.1.3"
79
79
  aresponses = "^2.1.4"
80
80
  asynctest = "^0.13.0"
81
- pre-commit = "^2.0.1"
81
+ pre-commit = "^3.2.2"
82
82
  pytest = "^7.2.0"
83
83
  pytest-aiohttp = "^1.0.4"
84
84
  pytest-cov = "^4.0.0"
85
85
  sphinx-rtd-theme = "^1.0.0"
86
- types-pytz = "^2022.7.0"
86
+ types-pytz = "^2023.3.0"
87
87
 
88
88
  [tool.pylint.BASIC]
89
89
  expected-line-ending-format = "LF"
File without changes
File without changes