lghorizon 0.7.3b2__tar.gz → 0.7.3b3__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.3b2 → lghorizon-0.7.3b3}/PKG-INFO +1 -1
  2. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/lghorizon/lghorizon_api.py +16 -8
  3. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/lghorizon.egg-info/PKG-INFO +1 -1
  4. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/.coverage +0 -0
  5. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/.flake8 +0 -0
  6. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/.github/workflows/build-on-pr.yml +0 -0
  7. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/.github/workflows/publish-to-pypi.yml +0 -0
  8. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/.gitignore +0 -0
  9. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/LICENSE +0 -0
  10. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/README.md +0 -0
  11. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/instructions.txt +0 -0
  12. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/lghorizon/__init__.py +0 -0
  13. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/lghorizon/const.py +0 -0
  14. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/lghorizon/exceptions.py +0 -0
  15. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/lghorizon/helpers.py +0 -0
  16. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/lghorizon/models.py +0 -0
  17. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/lghorizon/py.typed +0 -0
  18. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/lghorizon.egg-info/SOURCES.txt +0 -0
  19. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/lghorizon.egg-info/dependency_links.txt +0 -0
  20. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/lghorizon.egg-info/not-zip-safe +0 -0
  21. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/lghorizon.egg-info/requires.txt +0 -0
  22. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/lghorizon.egg-info/top_level.txt +0 -0
  23. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/lib64 +0 -0
  24. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/pyvenv.cfg +0 -0
  25. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/renovate.json +0 -0
  26. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/secrets_stub.json +0 -0
  27. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/setup.cfg +0 -0
  28. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/setup.py +0 -0
  29. {lghorizon-0.7.3b2 → lghorizon-0.7.3b3}/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lghorizon
3
- Version: 0.7.3b2
3
+ Version: 0.7.3b3
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
@@ -277,7 +277,11 @@ class LGHorizonApi:
277
277
  box.register_mqtt()
278
278
 
279
279
  def _on_mqtt_message(self, message: str, topic: str) -> None:
280
- if "source" in message:
280
+ if "action" in message and message["action"] == "OPS.getProfilesUpdate":
281
+ self._update_customer()
282
+ self._channels.clear()
283
+ self._get_channels()
284
+ elif "source" in message:
281
285
  deviceId = message["source"]
282
286
  if not isinstance(deviceId, str):
283
287
  _logger.debug("ignoring message - not a string")
@@ -289,6 +293,7 @@ class LGHorizonApi:
289
293
  self.settop_boxes[deviceId].update_state(message)
290
294
  if "status" in message:
291
295
  self._handle_box_update(deviceId, message)
296
+
292
297
  except Exception:
293
298
  _logger.exception("Could not handle status message")
294
299
  _logger.warning(f"Full message: {str(message)}")
@@ -388,14 +393,9 @@ class LGHorizonApi:
388
393
  return json_response
389
394
 
390
395
  def _register_customer_and_boxes(self):
391
- _logger.info("Get personalisation info...")
392
- personalisation_result = self._do_api_call(
393
- f"{self._config['personalizationService']['URL']}/v1/customer/{self._auth.householdId}?with=profiles%2Cdevices"
394
- )
395
- _logger.debug("Personalisation result: %s ", personalisation_result)
396
- self.customer = LGHorizonCustomer(personalisation_result)
396
+ self._update_customer()
397
397
  self._get_channels()
398
- if "assignedDevices" not in personalisation_result:
398
+ if len(self.customer.settop_boxes) == 0:
399
399
  _logger.warning("No boxes found.")
400
400
  return
401
401
  _logger.info("Registering boxes")
@@ -416,6 +416,14 @@ class LGHorizonApi:
416
416
  self.settop_boxes[box.deviceId] = box
417
417
  _logger.info("Box %s registered...", box.deviceId)
418
418
 
419
+ def _update_customer(self):
420
+ _logger.info("Get customer data")
421
+ personalisation_result = self._do_api_call(
422
+ f"{self._config['personalizationService']['URL']}/v1/customer/{self._auth.householdId}?with=profiles%2Cdevices"
423
+ )
424
+ _logger.debug("Personalisation result: %s ", personalisation_result)
425
+ self.customer = LGHorizonCustomer(personalisation_result)
426
+
419
427
  def _get_channels(self):
420
428
  self._update_entitlements()
421
429
  _logger.info("Retrieving channels...")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lghorizon
3
- Version: 0.7.3b2
3
+ Version: 0.7.3b3
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