lghorizon 0.8.7__py3-none-any.whl → 0.9.0__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/__init__.py +55 -25
- lghorizon/const.py +11 -4
- lghorizon/exceptions.py +3 -3
- lghorizon/helpers.py +1 -1
- lghorizon/lghorizon_api.py +263 -502
- lghorizon/lghorizon_device.py +409 -0
- lghorizon/lghorizon_device_state_processor.py +365 -0
- lghorizon/lghorizon_message_factory.py +38 -0
- lghorizon/lghorizon_models.py +1512 -0
- lghorizon/lghorizon_mqtt_client.py +335 -0
- lghorizon/lghorizon_recording_factory.py +55 -0
- lghorizon-0.9.0.dist-info/METADATA +191 -0
- lghorizon-0.9.0.dist-info/RECORD +17 -0
- {lghorizon-0.8.7.dist-info → lghorizon-0.9.0.dist-info}/WHEEL +1 -1
- lghorizon/models.py +0 -768
- lghorizon-0.8.7.dist-info/METADATA +0 -41
- lghorizon-0.8.7.dist-info/RECORD +0 -12
- {lghorizon-0.8.7.dist-info → lghorizon-0.9.0.dist-info}/licenses/LICENSE +0 -0
- {lghorizon-0.8.7.dist-info → lghorizon-0.9.0.dist-info}/top_level.txt +0 -0
lghorizon/__init__.py
CHANGED
|
@@ -1,41 +1,71 @@
|
|
|
1
1
|
"""Python client for LG Horizon."""
|
|
2
2
|
|
|
3
3
|
from .lghorizon_api import LGHorizonApi
|
|
4
|
-
from .
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
from .lghorizon_device import LGHorizonDevice
|
|
5
|
+
from .lghorizon_models import (
|
|
6
|
+
LGHorizonAuth,
|
|
7
|
+
LGHorizonChannel,
|
|
8
|
+
LGHorizonCustomer,
|
|
9
|
+
LGHorizonDeviceState,
|
|
10
|
+
LGHorizonProfile,
|
|
11
|
+
LGHorizonRecording,
|
|
12
|
+
LGHorizonRecordingList,
|
|
13
|
+
LGHorizonShowRecordingList,
|
|
14
|
+
LGHorizonRecordingSeason,
|
|
7
15
|
LGHorizonRecordingSingle,
|
|
8
16
|
LGHorizonRecordingShow,
|
|
9
|
-
|
|
10
|
-
|
|
17
|
+
LGHorizonRecordingQuota,
|
|
18
|
+
LGHorizonRecordingType,
|
|
19
|
+
LGHorizonUIStateType,
|
|
20
|
+
LGHorizonMessageType,
|
|
21
|
+
LGHorizonRunningState,
|
|
22
|
+
LGHorizonRecordingSource,
|
|
23
|
+
LGHorizonRecordingState,
|
|
24
|
+
LGHorizonSourceType,
|
|
25
|
+
LGHorizonPlayerState,
|
|
26
|
+
LGHorizonAppsState,
|
|
27
|
+
LGHorizonUIState,
|
|
28
|
+
LGHorizonProfileOptions,
|
|
29
|
+
LGHorizonServicesConfig,
|
|
11
30
|
)
|
|
12
31
|
from .exceptions import (
|
|
13
|
-
|
|
32
|
+
LGHorizonApiError,
|
|
14
33
|
LGHorizonApiConnectionError,
|
|
34
|
+
LGHorizonApiUnauthorizedError,
|
|
15
35
|
LGHorizonApiLockedError,
|
|
16
36
|
)
|
|
17
|
-
from .const import (
|
|
18
|
-
ONLINE_RUNNING,
|
|
19
|
-
ONLINE_STANDBY,
|
|
20
|
-
RECORDING_TYPE_SHOW,
|
|
21
|
-
RECORDING_TYPE_SEASON,
|
|
22
|
-
RECORDING_TYPE_SINGLE,
|
|
23
|
-
)
|
|
24
37
|
|
|
25
38
|
__all__ = [
|
|
26
39
|
"LGHorizonApi",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"LGHorizonRecordingShow",
|
|
31
|
-
"LGHorizonRecordingEpisode",
|
|
40
|
+
"LGHorizonDevice",
|
|
41
|
+
"LGHorizonAuth",
|
|
42
|
+
"LGHorizonChannel",
|
|
32
43
|
"LGHorizonCustomer",
|
|
33
|
-
"
|
|
44
|
+
"LGHorizonDeviceState",
|
|
45
|
+
"LGHorizonProfile",
|
|
46
|
+
"LGHorizonApiError",
|
|
34
47
|
"LGHorizonApiConnectionError",
|
|
48
|
+
"LGHorizonApiUnauthorizedError",
|
|
35
49
|
"LGHorizonApiLockedError",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
50
|
+
"LGHorizonRecordingList",
|
|
51
|
+
"LGHorizonRecordingSeason",
|
|
52
|
+
"LGHorizonRecordingSingle",
|
|
53
|
+
"LGHorizonRecordingShow",
|
|
54
|
+
"LGHorizonRecordingQuota",
|
|
55
|
+
"LGHorizonRecordingType",
|
|
56
|
+
"LGHorizonUIStateType",
|
|
57
|
+
"LGHorizonMessageType",
|
|
58
|
+
"LGHorizonRunningState",
|
|
59
|
+
"LGHorizonRecordingSource",
|
|
60
|
+
"LGHorizonRecordingState",
|
|
61
|
+
"LGHorizonSourceType",
|
|
62
|
+
"LGHorizonPlayerState",
|
|
63
|
+
"LGHorizonAppsState",
|
|
64
|
+
"LGHorizonUIState",
|
|
65
|
+
"LGHorizonProfileOptions",
|
|
66
|
+
"LGHorizonProfile",
|
|
67
|
+
"LGHorizonAuth",
|
|
68
|
+
"LGHorizonServicesConfig",
|
|
69
|
+
"LGHorizonRecording",
|
|
70
|
+
"LGHorizonShowRecordingList",
|
|
71
|
+
]
|
lghorizon/const.py
CHANGED
|
@@ -38,11 +38,18 @@ RECORDING_TYPE_SEASON = "season"
|
|
|
38
38
|
|
|
39
39
|
BE_AUTH_URL = "https://login.prd.telenet.be/openid/login.do"
|
|
40
40
|
|
|
41
|
+
PLATFORM_TYPES = {
|
|
42
|
+
"EOS": {"manufacturer": "Arris", "model": "DCX960"},
|
|
43
|
+
"EOS2": {"manufacturer": "HUMAX", "model": "2008C-STB-TN"},
|
|
44
|
+
"HORIZON": {"manufacturer": "Arris", "model": "DCX960"},
|
|
45
|
+
"APOLLO": {"manufacturer": "Arris", "model": "VIP5002W"},
|
|
46
|
+
}
|
|
47
|
+
|
|
41
48
|
COUNTRY_SETTINGS = {
|
|
42
49
|
"nl": {
|
|
43
50
|
"api_url": "https://spark-prod-nl.gnp.cloud.ziggogo.tv",
|
|
44
51
|
"mqtt_url": "obomsg.prod.nl.horizon.tv",
|
|
45
|
-
"
|
|
52
|
+
"use_refreshtoken": False,
|
|
46
53
|
"channels": [
|
|
47
54
|
{
|
|
48
55
|
"channelId": "NL_000073_019506",
|
|
@@ -106,7 +113,7 @@ COUNTRY_SETTINGS = {
|
|
|
106
113
|
},
|
|
107
114
|
"be-nl-preprod": {
|
|
108
115
|
"api_url": "https://spark-preprod-be.gnp.cloud.telenet.tv",
|
|
109
|
-
"
|
|
116
|
+
"use_refreshtoken": True,
|
|
110
117
|
"oauth_username_fieldname": "j_username",
|
|
111
118
|
"oauth_password_fieldname": "j_password",
|
|
112
119
|
"oauth_add_accept_header": False,
|
|
@@ -131,13 +138,13 @@ COUNTRY_SETTINGS = {
|
|
|
131
138
|
},
|
|
132
139
|
"ie": {
|
|
133
140
|
"api_url": "https://spark-prod-ie.gnp.cloud.virginmediatv.ie",
|
|
134
|
-
"
|
|
141
|
+
"use_refreshtoken": False,
|
|
135
142
|
"channels": [],
|
|
136
143
|
"language": "en",
|
|
137
144
|
},
|
|
138
145
|
"pl": {
|
|
139
146
|
"api_url": "https://spark-prod-pl.gnp.cloud.upctv.pl",
|
|
140
|
-
"
|
|
147
|
+
"use_refreshtoken": False,
|
|
141
148
|
"channels": [],
|
|
142
149
|
"language": "pl",
|
|
143
150
|
"platform_types": {
|
lghorizon/exceptions.py
CHANGED
|
@@ -6,12 +6,12 @@ class LGHorizonApiError(Exception):
|
|
|
6
6
|
|
|
7
7
|
|
|
8
8
|
class LGHorizonApiConnectionError(LGHorizonApiError):
|
|
9
|
-
"""
|
|
9
|
+
"""Exception for connection-related errors with the LG Horizon API."""
|
|
10
10
|
|
|
11
11
|
|
|
12
12
|
class LGHorizonApiUnauthorizedError(Exception):
|
|
13
|
-
"""
|
|
13
|
+
"""Exception for unauthorized access to the LG Horizon API."""
|
|
14
14
|
|
|
15
15
|
|
|
16
16
|
class LGHorizonApiLockedError(LGHorizonApiUnauthorizedError):
|
|
17
|
-
"""
|
|
17
|
+
"""Exception for locked account errors with the LG Horizon API."""
|
lghorizon/helpers.py
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
import random
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
def make_id(string_length=10):
|
|
6
|
+
async def make_id(string_length=10):
|
|
7
7
|
"""Create an id with given length."""
|
|
8
8
|
letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
|
|
9
9
|
return "".join(random.choice(letters) for i in range(string_length))
|