lghorizon 0.7.3b2__py3-none-any.whl → 0.7.3b3__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.
- lghorizon/lghorizon_api.py +16 -8
- {lghorizon-0.7.3b2.dist-info → lghorizon-0.7.3b3.dist-info}/METADATA +1 -1
- {lghorizon-0.7.3b2.dist-info → lghorizon-0.7.3b3.dist-info}/RECORD +6 -6
- {lghorizon-0.7.3b2.dist-info → lghorizon-0.7.3b3.dist-info}/LICENSE +0 -0
- {lghorizon-0.7.3b2.dist-info → lghorizon-0.7.3b3.dist-info}/WHEEL +0 -0
- {lghorizon-0.7.3b2.dist-info → lghorizon-0.7.3b3.dist-info}/top_level.txt +0 -0
lghorizon/lghorizon_api.py
CHANGED
|
@@ -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 "
|
|
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
|
-
|
|
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
|
|
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...")
|
|
@@ -2,11 +2,11 @@ lghorizon/__init__.py,sha256=XqePG0hj8NnudOcfCtEWqPsWP5l2headzrQhkfuDlv8,544
|
|
|
2
2
|
lghorizon/const.py,sha256=S8UWatG7JPCqd1zk-iOoILTvFDEj7YhLcEXxLGhyJXs,4755
|
|
3
3
|
lghorizon/exceptions.py,sha256=-6v55KDTogBldGAg1wV9Mrxm5L5BsaVguhBgVMOeJHk,404
|
|
4
4
|
lghorizon/helpers.py,sha256=ZWpi7B3hBvwGV02KWQQHVyj7FLLUDtIvKc-Iqsj5VHA,263
|
|
5
|
-
lghorizon/lghorizon_api.py,sha256=
|
|
5
|
+
lghorizon/lghorizon_api.py,sha256=9cgTOMY5OI3BDBTPRz-q3AA1LUZ3ri1JFj7S6VgdOcw,21823
|
|
6
6
|
lghorizon/models.py,sha256=lUKUJiebK65l0lfOwAzDvn0fC6UIvvQS6HI6a0ROZ_8,24437
|
|
7
7
|
lghorizon/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
8
|
-
lghorizon-0.7.
|
|
9
|
-
lghorizon-0.7.
|
|
10
|
-
lghorizon-0.7.
|
|
11
|
-
lghorizon-0.7.
|
|
12
|
-
lghorizon-0.7.
|
|
8
|
+
lghorizon-0.7.3b3.dist-info/LICENSE,sha256=6Dh2tur1gMX3r3rITjVwUONBEJxyyPZDY8p6DZXtimE,1059
|
|
9
|
+
lghorizon-0.7.3b3.dist-info/METADATA,sha256=MCqR616SRzYkwOezY9mV3s3lyfFJACi24-Owhio8ByE,1039
|
|
10
|
+
lghorizon-0.7.3b3.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
11
|
+
lghorizon-0.7.3b3.dist-info/top_level.txt,sha256=usii76_AxGfPI6gjrrh-NyZxcQQuF1B8_Q9kd7sID8Q,10
|
|
12
|
+
lghorizon-0.7.3b3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|