lghorizon 0.7.3b4__tar.gz → 0.7.4__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.3b4 → lghorizon-0.7.4}/PKG-INFO +1 -1
  2. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/lghorizon/lghorizon_api.py +12 -14
  3. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/lghorizon.egg-info/PKG-INFO +1 -1
  4. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/.coverage +0 -0
  5. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/.flake8 +0 -0
  6. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/.github/workflows/build-on-pr.yml +0 -0
  7. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/.github/workflows/publish-to-pypi.yml +0 -0
  8. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/.gitignore +0 -0
  9. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/LICENSE +0 -0
  10. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/README.md +0 -0
  11. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/instructions.txt +0 -0
  12. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/lghorizon/__init__.py +0 -0
  13. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/lghorizon/const.py +0 -0
  14. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/lghorizon/exceptions.py +0 -0
  15. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/lghorizon/helpers.py +0 -0
  16. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/lghorizon/models.py +0 -0
  17. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/lghorizon/py.typed +0 -0
  18. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/lghorizon.egg-info/SOURCES.txt +0 -0
  19. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/lghorizon.egg-info/dependency_links.txt +0 -0
  20. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/lghorizon.egg-info/not-zip-safe +0 -0
  21. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/lghorizon.egg-info/requires.txt +0 -0
  22. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/lghorizon.egg-info/top_level.txt +0 -0
  23. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/lib64 +0 -0
  24. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/pyvenv.cfg +0 -0
  25. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/renovate.json +0 -0
  26. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/secrets_stub.json +0 -0
  27. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/setup.cfg +0 -0
  28. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/setup.py +0 -0
  29. {lghorizon-0.7.3b4 → lghorizon-0.7.4}/test.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lghorizon
3
- Version: 0.7.3b4
3
+ Version: 0.7.4
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
@@ -279,11 +279,7 @@ class LGHorizonApi:
279
279
  def _on_mqtt_message(self, message: str, topic: str) -> None:
280
280
  if "action" in message and message["action"] == "OPS.getProfilesUpdate":
281
281
  self._update_customer()
282
- self._channels.clear()
283
- self._get_channels()
284
282
  box: LGHorizonBox
285
- for box in self.settop_boxes.values():
286
- box.update_channels(self._channels)
287
283
  elif "source" in message:
288
284
  deviceId = message["source"]
289
285
  if not isinstance(deviceId, str):
@@ -433,13 +429,6 @@ class LGHorizonApi:
433
429
  channels_result = self._do_api_call(
434
430
  f"{self._config['linearService']['URL']}/v2/channels?cityId={self.customer.cityId}&language={self._country_settings['language']}&productClass=Orion-DASH"
435
431
  )
436
- profile_channels = []
437
- if self._profile_id and self._profile_id in self.customer.profiles:
438
- profile_channels = self.customer.profiles[
439
- self._profile_id
440
- ].favorite_channels
441
-
442
- has_profile_channels = len(profile_channels) > 0
443
432
  for channel in channels_result:
444
433
  if "isRadio" in channel and channel["isRadio"]:
445
434
  continue
@@ -449,12 +438,21 @@ class LGHorizonApi:
449
438
  if len(common_entitlements) == 0:
450
439
  continue
451
440
  channel_id = channel["id"]
452
- if has_profile_channels and channel_id not in profile_channels:
453
- continue
454
-
455
441
  self._channels[channel_id] = LGHorizonChannel(channel)
456
442
  _logger.info(f"{len(self._channels)} retrieved.")
457
443
 
444
+ def get_display_channels(self):
445
+ all_channels = self._channels.values()
446
+ if not self._profile_id or self._profile_id not in self.customer.profiles:
447
+ return all_channels
448
+ profile_channel_ids = self.customer.profiles[self._profile_id].favorite_channels
449
+ if len(profile_channel_ids) == 0:
450
+ return all_channels
451
+
452
+ return [
453
+ channel for channel in all_channels if channel.id in profile_channel_ids
454
+ ]
455
+
458
456
  def _get_replay_event(self, listingId) -> Any:
459
457
  """Get listing."""
460
458
  _logger.info("Retrieving replay event details...")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: lghorizon
3
- Version: 0.7.3b4
3
+ Version: 0.7.4
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