lghorizon 0.7.3__py3-none-any.whl → 0.7.3b2__py3-none-any.whl

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.
@@ -277,14 +277,7 @@ class LGHorizonApi:
277
277
  box.register_mqtt()
278
278
 
279
279
  def _on_mqtt_message(self, message: str, topic: str) -> None:
280
- if "action" in message and message["action"] == "OPS.getProfilesUpdate":
281
- self._update_customer()
282
- self._channels.clear()
283
- self._get_channels()
284
- box: LGHorizonBox
285
- for box in self.settop_boxes.values():
286
- box.update_channels(self._channels)
287
- elif "source" in message:
280
+ if "source" in message:
288
281
  deviceId = message["source"]
289
282
  if not isinstance(deviceId, str):
290
283
  _logger.debug("ignoring message - not a string")
@@ -296,7 +289,6 @@ class LGHorizonApi:
296
289
  self.settop_boxes[deviceId].update_state(message)
297
290
  if "status" in message:
298
291
  self._handle_box_update(deviceId, message)
299
-
300
292
  except Exception:
301
293
  _logger.exception("Could not handle status message")
302
294
  _logger.warning(f"Full message: {str(message)}")
@@ -396,9 +388,14 @@ class LGHorizonApi:
396
388
  return json_response
397
389
 
398
390
  def _register_customer_and_boxes(self):
399
- self._update_customer()
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)
400
397
  self._get_channels()
401
- if len(self.customer.settop_boxes) == 0:
398
+ if "assignedDevices" not in personalisation_result:
402
399
  _logger.warning("No boxes found.")
403
400
  return
404
401
  _logger.info("Registering boxes")
@@ -419,14 +416,6 @@ class LGHorizonApi:
419
416
  self.settop_boxes[box.deviceId] = box
420
417
  _logger.info("Box %s registered...", box.deviceId)
421
418
 
422
- def _update_customer(self):
423
- _logger.info("Get customer data")
424
- personalisation_result = self._do_api_call(
425
- f"{self._config['personalizationService']['URL']}/v1/customer/{self._auth.householdId}?with=profiles%2Cdevices"
426
- )
427
- _logger.debug("Personalisation result: %s ", personalisation_result)
428
- self.customer = LGHorizonCustomer(personalisation_result)
429
-
430
419
  def _get_channels(self):
431
420
  self._update_entitlements()
432
421
  _logger.info("Retrieving channels...")
lghorizon/models.py CHANGED
@@ -438,9 +438,6 @@ class LGHorizonBox:
438
438
  self.manufacturer = platform_type["manufacturer"]
439
439
  self.model = platform_type["model"]
440
440
 
441
- def update_channels(self, channels: Dict[str, LGHorizonChannel]):
442
- self._channels = channels
443
-
444
441
  def register_mqtt(self) -> None:
445
442
  if not self._mqtt_client.is_connected:
446
443
  raise Exception("MQTT client not connected.")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lghorizon
3
- Version: 0.7.3
3
+ Version: 0.7.3b2
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
@@ -0,0 +1,12 @@
1
+ lghorizon/__init__.py,sha256=XqePG0hj8NnudOcfCtEWqPsWP5l2headzrQhkfuDlv8,544
2
+ lghorizon/const.py,sha256=S8UWatG7JPCqd1zk-iOoILTvFDEj7YhLcEXxLGhyJXs,4755
3
+ lghorizon/exceptions.py,sha256=-6v55KDTogBldGAg1wV9Mrxm5L5BsaVguhBgVMOeJHk,404
4
+ lghorizon/helpers.py,sha256=ZWpi7B3hBvwGV02KWQQHVyj7FLLUDtIvKc-Iqsj5VHA,263
5
+ lghorizon/lghorizon_api.py,sha256=mLXu_A4rByx2Xu8vbVq3MnN5gXYe3W0NoGJVMFNy7Yo,21591
6
+ lghorizon/models.py,sha256=lUKUJiebK65l0lfOwAzDvn0fC6UIvvQS6HI6a0ROZ_8,24437
7
+ lghorizon/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
+ lghorizon-0.7.3b2.dist-info/LICENSE,sha256=6Dh2tur1gMX3r3rITjVwUONBEJxyyPZDY8p6DZXtimE,1059
9
+ lghorizon-0.7.3b2.dist-info/METADATA,sha256=dC0Fxghges-tPQRX0NkcWYM2mcV7kaYpc3qK-rqxwYc,1039
10
+ lghorizon-0.7.3b2.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
11
+ lghorizon-0.7.3b2.dist-info/top_level.txt,sha256=usii76_AxGfPI6gjrrh-NyZxcQQuF1B8_Q9kd7sID8Q,10
12
+ lghorizon-0.7.3b2.dist-info/RECORD,,
@@ -1,12 +0,0 @@
1
- lghorizon/__init__.py,sha256=XqePG0hj8NnudOcfCtEWqPsWP5l2headzrQhkfuDlv8,544
2
- lghorizon/const.py,sha256=S8UWatG7JPCqd1zk-iOoILTvFDEj7YhLcEXxLGhyJXs,4755
3
- lghorizon/exceptions.py,sha256=-6v55KDTogBldGAg1wV9Mrxm5L5BsaVguhBgVMOeJHk,404
4
- lghorizon/helpers.py,sha256=ZWpi7B3hBvwGV02KWQQHVyj7FLLUDtIvKc-Iqsj5VHA,263
5
- lghorizon/lghorizon_api.py,sha256=PcC-zmy_VK5WgUQChnwySE9CE5LPP1E3HXA_Pp_ExMg,21956
6
- lghorizon/models.py,sha256=S_Pq8z9PpaN10b17aoi2j-mCIdZf-TK411pBGRPDkvc,24542
7
- lghorizon/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
8
- lghorizon-0.7.3.dist-info/LICENSE,sha256=6Dh2tur1gMX3r3rITjVwUONBEJxyyPZDY8p6DZXtimE,1059
9
- lghorizon-0.7.3.dist-info/METADATA,sha256=VNpdXkA8YGvC7xQEXzI2y1IsyT03MsRVoWG2Q6L7078,1037
10
- lghorizon-0.7.3.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
11
- lghorizon-0.7.3.dist-info/top_level.txt,sha256=usii76_AxGfPI6gjrrh-NyZxcQQuF1B8_Q9kd7sID8Q,10
12
- lghorizon-0.7.3.dist-info/RECORD,,