lghorizon 0.7.1__py3-none-any.whl → 0.7.2__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 -1
- {lghorizon-0.7.1.dist-info → lghorizon-0.7.2.dist-info}/METADATA +1 -1
- {lghorizon-0.7.1.dist-info → lghorizon-0.7.2.dist-info}/RECORD +6 -6
- {lghorizon-0.7.1.dist-info → lghorizon-0.7.2.dist-info}/WHEEL +1 -1
- {lghorizon-0.7.1.dist-info → lghorizon-0.7.2.dist-info}/LICENSE +0 -0
- {lghorizon-0.7.1.dist-info → lghorizon-0.7.2.dist-info}/top_level.txt +0 -0
lghorizon/lghorizon_api.py
CHANGED
|
@@ -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(
|
|
@@ -2,11 +2,11 @@ lghorizon/__init__.py,sha256=_VjVE44ErvJJMnF5QgXdlw_nQzbHZUhGWw5hF40PolQ,426
|
|
|
2
2
|
lghorizon/const.py,sha256=S8UWatG7JPCqd1zk-iOoILTvFDEj7YhLcEXxLGhyJXs,4755
|
|
3
3
|
lghorizon/exceptions.py,sha256=spEjRvbNdce2fauQiOFromAbV1QcfA0uMUt0nRVnnkM,318
|
|
4
4
|
lghorizon/helpers.py,sha256=ZWpi7B3hBvwGV02KWQQHVyj7FLLUDtIvKc-Iqsj5VHA,263
|
|
5
|
-
lghorizon/lghorizon_api.py,sha256=
|
|
5
|
+
lghorizon/lghorizon_api.py,sha256=5jv06pO7vnLd7ddY0ag1KY6ZGqUNKQULlwYRqqJXjFE,20899
|
|
6
6
|
lghorizon/models.py,sha256=yrKlQMnHCy8FHwCel3lcTUEnd7_JQbETqf5yGW3S84o,23893
|
|
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.2.dist-info/LICENSE,sha256=6Dh2tur1gMX3r3rITjVwUONBEJxyyPZDY8p6DZXtimE,1059
|
|
9
|
+
lghorizon-0.7.2.dist-info/METADATA,sha256=41HST2UBGXTFeSiUe79wb94FlFwpx5qobCFVS7SHC4w,1037
|
|
10
|
+
lghorizon-0.7.2.dist-info/WHEEL,sha256=OVMc5UfuAQiSplgO0_WdW7vXVGAt9Hdd6qtN4HotdyA,91
|
|
11
|
+
lghorizon-0.7.2.dist-info/top_level.txt,sha256=usii76_AxGfPI6gjrrh-NyZxcQQuF1B8_Q9kd7sID8Q,10
|
|
12
|
+
lghorizon-0.7.2.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|