lghorizon 0.7.1__tar.gz → 0.7.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.
Files changed (29) hide show
  1. {lghorizon-0.7.1 → lghorizon-0.7.2}/PKG-INFO +1 -1
  2. {lghorizon-0.7.1 → lghorizon-0.7.2}/lghorizon/lghorizon_api.py +16 -1
  3. {lghorizon-0.7.1 → lghorizon-0.7.2}/lghorizon.egg-info/PKG-INFO +1 -1
  4. {lghorizon-0.7.1 → lghorizon-0.7.2}/.coverage +0 -0
  5. {lghorizon-0.7.1 → lghorizon-0.7.2}/.flake8 +0 -0
  6. {lghorizon-0.7.1 → lghorizon-0.7.2}/.github/workflows/build-on-pr.yml +0 -0
  7. {lghorizon-0.7.1 → lghorizon-0.7.2}/.github/workflows/publish-to-pypi.yml +0 -0
  8. {lghorizon-0.7.1 → lghorizon-0.7.2}/.gitignore +0 -0
  9. {lghorizon-0.7.1 → lghorizon-0.7.2}/LICENSE +0 -0
  10. {lghorizon-0.7.1 → lghorizon-0.7.2}/README.md +0 -0
  11. {lghorizon-0.7.1 → lghorizon-0.7.2}/instructions.txt +0 -0
  12. {lghorizon-0.7.1 → lghorizon-0.7.2}/lghorizon/__init__.py +0 -0
  13. {lghorizon-0.7.1 → lghorizon-0.7.2}/lghorizon/const.py +0 -0
  14. {lghorizon-0.7.1 → lghorizon-0.7.2}/lghorizon/exceptions.py +0 -0
  15. {lghorizon-0.7.1 → lghorizon-0.7.2}/lghorizon/helpers.py +0 -0
  16. {lghorizon-0.7.1 → lghorizon-0.7.2}/lghorizon/models.py +0 -0
  17. {lghorizon-0.7.1 → lghorizon-0.7.2}/lghorizon/py.typed +0 -0
  18. {lghorizon-0.7.1 → lghorizon-0.7.2}/lghorizon.egg-info/SOURCES.txt +0 -0
  19. {lghorizon-0.7.1 → lghorizon-0.7.2}/lghorizon.egg-info/dependency_links.txt +0 -0
  20. {lghorizon-0.7.1 → lghorizon-0.7.2}/lghorizon.egg-info/not-zip-safe +0 -0
  21. {lghorizon-0.7.1 → lghorizon-0.7.2}/lghorizon.egg-info/requires.txt +0 -0
  22. {lghorizon-0.7.1 → lghorizon-0.7.2}/lghorizon.egg-info/top_level.txt +0 -0
  23. {lghorizon-0.7.1 → lghorizon-0.7.2}/lib64 +0 -0
  24. {lghorizon-0.7.1 → lghorizon-0.7.2}/pyvenv.cfg +0 -0
  25. {lghorizon-0.7.1 → lghorizon-0.7.2}/renovate.json +0 -0
  26. {lghorizon-0.7.1 → lghorizon-0.7.2}/secrets_stub.json +0 -0
  27. {lghorizon-0.7.1 → lghorizon-0.7.2}/setup.cfg +0 -0
  28. {lghorizon-0.7.1 → lghorizon-0.7.2}/setup.py +0 -0
  29. {lghorizon-0.7.1 → lghorizon-0.7.2}/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lghorizon
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Python client for Liberty Global Horizon settop boxes
5
5
  Home-page: https://github.com/sholofly/LGHorizon-python
6
6
  Author: Rudolf Offereins
@@ -35,7 +35,7 @@ from .const import (
35
35
  RECORDING_TYPE_SEASON,
36
36
  RECORDING_TYPE_SHOW,
37
37
  )
38
- from typing import Any, Dict, List
38
+ from typing import Any, Callable, Dict, List
39
39
 
40
40
  _logger = logging.getLogger(__name__)
41
41
  _supported_platforms = ["EOS", "EOS2", "HORIZON", "APOLLO"]
@@ -56,6 +56,7 @@ class LGHorizonApi:
56
56
  _entitlements: List[str] = None
57
57
  _identifier: str = None
58
58
  _config: str = None
59
+ _refresh_callback: Callable = None
59
60
 
60
61
  def __init__(
61
62
  self,
@@ -146,8 +147,15 @@ class LGHorizonApi:
146
147
  self._auth.fill(auth_response.json())
147
148
  self.refresh_token = self._auth.refreshToken
148
149
  self._session.cookies["ACCESSTOKEN"] = self._auth.accessToken
150
+
151
+ if self._refresh_callback:
152
+ self._refresh_callback ()
153
+
149
154
  _logger.debug("Authorization succeeded")
150
155
 
156
+ def set_callback(self, refresh_callback: Callable) -> None:
157
+ self._refresh_callback = refresh_callback
158
+
151
159
  def authorize_telenet(self):
152
160
  try:
153
161
  login_session = Session()
@@ -257,6 +265,9 @@ class LGHorizonApi:
257
265
  def _on_mqtt_message(self, message: str, topic: str) -> None:
258
266
  if "source" in message:
259
267
  deviceId = message["source"]
268
+ if not isinstance(deviceId,str):
269
+ _logger.debug("ignoring message - not a string")
270
+ return
260
271
  if not deviceId in self.settop_boxes.keys():
261
272
  return
262
273
  try:
@@ -420,6 +431,10 @@ class LGHorizonApi:
420
431
 
421
432
  def get_recording_capacity(self) -> int:
422
433
  """Returns remaining recording capacity"""
434
+ ctry_code = self._country_code[0:2]
435
+ if ctry_code == "gb":
436
+ _logger.debug("GB: not supported")
437
+ return None
423
438
  try:
424
439
  _logger.info("Retrieving recordingcapacity...")
425
440
  quota_content = self._do_api_call(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lghorizon
3
- Version: 0.7.1
3
+ Version: 0.7.2
4
4
  Summary: Python client for Liberty Global Horizon settop boxes
5
5
  Home-page: https://github.com/sholofly/LGHorizon-python
6
6
  Author: Rudolf Offereins
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes