lghorizon 0.9.0.dev4__py3-none-any.whl → 0.9.1__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 +58 -25
- lghorizon/const.py +23 -81
- 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.1.dist-info/METADATA +189 -0
- lghorizon-0.9.1.dist-info/RECORD +17 -0
- lghorizon/models.py +0 -768
- lghorizon-0.9.0.dev4.dist-info/METADATA +0 -41
- lghorizon-0.9.0.dev4.dist-info/RECORD +0 -12
- {lghorizon-0.9.0.dev4.dist-info → lghorizon-0.9.1.dist-info}/WHEEL +0 -0
- {lghorizon-0.9.0.dev4.dist-info → lghorizon-0.9.1.dist-info}/licenses/LICENSE +0 -0
- {lghorizon-0.9.0.dev4.dist-info → lghorizon-0.9.1.dist-info}/top_level.txt +0 -0
lghorizon/__init__.py
CHANGED
|
@@ -1,41 +1,74 @@
|
|
|
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
|
-
|
|
18
|
-
|
|
19
|
-
ONLINE_STANDBY,
|
|
20
|
-
RECORDING_TYPE_SHOW,
|
|
21
|
-
RECORDING_TYPE_SEASON,
|
|
22
|
-
RECORDING_TYPE_SINGLE,
|
|
23
|
-
)
|
|
37
|
+
|
|
38
|
+
from .const import COUNTRY_SETTINGS
|
|
24
39
|
|
|
25
40
|
__all__ = [
|
|
26
41
|
"LGHorizonApi",
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"LGHorizonRecordingShow",
|
|
31
|
-
"LGHorizonRecordingEpisode",
|
|
42
|
+
"LGHorizonDevice",
|
|
43
|
+
"LGHorizonAuth",
|
|
44
|
+
"LGHorizonChannel",
|
|
32
45
|
"LGHorizonCustomer",
|
|
33
|
-
"
|
|
46
|
+
"LGHorizonDeviceState",
|
|
47
|
+
"LGHorizonProfile",
|
|
48
|
+
"LGHorizonApiError",
|
|
34
49
|
"LGHorizonApiConnectionError",
|
|
50
|
+
"LGHorizonApiUnauthorizedError",
|
|
35
51
|
"LGHorizonApiLockedError",
|
|
36
|
-
"
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
|
|
52
|
+
"LGHorizonRecordingList",
|
|
53
|
+
"LGHorizonRecordingSeason",
|
|
54
|
+
"LGHorizonRecordingSingle",
|
|
55
|
+
"LGHorizonRecordingShow",
|
|
56
|
+
"LGHorizonRecordingQuota",
|
|
57
|
+
"LGHorizonRecordingType",
|
|
58
|
+
"LGHorizonUIStateType",
|
|
59
|
+
"LGHorizonMessageType",
|
|
60
|
+
"LGHorizonRunningState",
|
|
61
|
+
"LGHorizonRecordingSource",
|
|
62
|
+
"LGHorizonRecordingState",
|
|
63
|
+
"LGHorizonSourceType",
|
|
64
|
+
"LGHorizonPlayerState",
|
|
65
|
+
"LGHorizonAppsState",
|
|
66
|
+
"LGHorizonUIState",
|
|
67
|
+
"LGHorizonProfileOptions",
|
|
68
|
+
"LGHorizonProfile",
|
|
69
|
+
"LGHorizonAuth",
|
|
70
|
+
"LGHorizonServicesConfig",
|
|
71
|
+
"LGHorizonRecording",
|
|
72
|
+
"LGHorizonShowRecordingList",
|
|
73
|
+
"COUNTRY_SETTINGS",
|
|
74
|
+
]
|
lghorizon/const.py
CHANGED
|
@@ -38,111 +38,53 @@ 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
|
-
"
|
|
46
|
-
"
|
|
47
|
-
{
|
|
48
|
-
"channelId": "NL_000073_019506",
|
|
49
|
-
"channelName": "Netflix",
|
|
50
|
-
"channelNumber": "150",
|
|
51
|
-
},
|
|
52
|
-
{
|
|
53
|
-
"channelId": "NL_000074_019507",
|
|
54
|
-
"channelName": "Videoland",
|
|
55
|
-
"channelNumber": "151",
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"channelId": "NL_000194_019352",
|
|
59
|
-
"channelName": "NPO",
|
|
60
|
-
"channelNumber": "152",
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"channelId": "NL_000199_019356",
|
|
64
|
-
"channelName": "Prime Video",
|
|
65
|
-
"channelNumber": "153",
|
|
66
|
-
},
|
|
67
|
-
],
|
|
68
|
-
"platform_types": {
|
|
69
|
-
"EOS": {"manufacturer": "Arris", "model": "DCX960"},
|
|
70
|
-
"APOLLO": {"manufacturer": "Arris", "model": "VIP5002W"},
|
|
71
|
-
},
|
|
72
|
-
"language": "nl",
|
|
52
|
+
"use_refreshtoken": False,
|
|
53
|
+
"name": "Ziggo",
|
|
73
54
|
},
|
|
74
55
|
"ch": {
|
|
75
56
|
"api_url": "https://spark-prod-ch.gnp.cloud.sunrisetv.ch",
|
|
76
|
-
"
|
|
77
|
-
"
|
|
57
|
+
"use_refreshtoken": True,
|
|
58
|
+
"name": "UPC Switzerland",
|
|
78
59
|
},
|
|
79
60
|
"be-basetv": {
|
|
80
61
|
"api_url": "https://spark-prod-be.gnp.cloud.base.tv",
|
|
81
|
-
"
|
|
82
|
-
"
|
|
83
|
-
"platform_types": {
|
|
84
|
-
"EOS": {"manufacturer": "Arris", "model": "DCX960"},
|
|
85
|
-
"HORIZON": {"manufacturer": "Arris", "model": "VIP5002W"},
|
|
86
|
-
},
|
|
62
|
+
"use_refreshtoken": True,
|
|
63
|
+
"name": "BASE TV (BE)",
|
|
87
64
|
},
|
|
88
65
|
"be-nl": {
|
|
89
66
|
"api_url": "https://spark-prod-be.gnp.cloud.telenet.tv",
|
|
90
|
-
"
|
|
91
|
-
"
|
|
92
|
-
"oauth_add_accept_header": False,
|
|
93
|
-
"oauth_url": "https://login.prd.telenet.be/openid/login.do",
|
|
94
|
-
"oauth_quote_login": False,
|
|
95
|
-
"oauth_redirect_header": "Location",
|
|
96
|
-
"channels": [
|
|
97
|
-
{"channelId": "netflix", "channelName": "Netflix", "channelNumber": "600"},
|
|
98
|
-
{"channelId": "youtube", "channelName": "Youtube", "channelNumber": "-1"},
|
|
99
|
-
],
|
|
100
|
-
"platform_types": {
|
|
101
|
-
"EOS": {"manufacturer": "Arris", "model": "DCX960"},
|
|
102
|
-
"HORIZON": {"manufacturer": "Arris", "model": "DCX960"},
|
|
103
|
-
"EOS2": {"manufacturer": "HUMAX", "model": "2008C-STB-TN"},
|
|
104
|
-
},
|
|
105
|
-
"language": "nl",
|
|
67
|
+
"use_refreshtoken": True,
|
|
68
|
+
"name": "Telenet (BE)",
|
|
106
69
|
},
|
|
107
70
|
"be-nl-preprod": {
|
|
108
71
|
"api_url": "https://spark-preprod-be.gnp.cloud.telenet.tv",
|
|
109
|
-
"
|
|
110
|
-
"
|
|
111
|
-
"oauth_password_fieldname": "j_password",
|
|
112
|
-
"oauth_add_accept_header": False,
|
|
113
|
-
"oauth_url": "https://login.prd.telenet.be/openid/login.do",
|
|
114
|
-
"oauth_quote_login": False,
|
|
115
|
-
"oauth_redirect_header": "Location",
|
|
116
|
-
"channels": [
|
|
117
|
-
{"channelId": "netflix", "channelName": "Netflix", "channelNumber": "600"},
|
|
118
|
-
{"channelId": "youtube", "channelName": "Youtube", "channelNumber": "-1"},
|
|
119
|
-
],
|
|
120
|
-
"platform_types": {
|
|
121
|
-
"EOS": {"manufacturer": "Arris", "model": "DCX960"},
|
|
122
|
-
"HORIZON": {"manufacturer": "Arris", "model": "DCX960"},
|
|
123
|
-
"EOS2": {"manufacturer": "HUMAX", "model": "2008C-STB-TN"},
|
|
124
|
-
},
|
|
125
|
-
"language": "nl",
|
|
72
|
+
"use_refreshtoken": True,
|
|
73
|
+
"name": "Telenet (BE, PREPROD)",
|
|
126
74
|
},
|
|
127
75
|
"gb": {
|
|
128
76
|
"api_url": "https://spark-prod-gb.gnp.cloud.virgintvgo.virginmedia.com",
|
|
129
|
-
"
|
|
130
|
-
"
|
|
77
|
+
"use_refreshtoken": True,
|
|
78
|
+
"name": "Virgin Media (GB)",
|
|
131
79
|
},
|
|
132
80
|
"ie": {
|
|
133
81
|
"api_url": "https://spark-prod-ie.gnp.cloud.virginmediatv.ie",
|
|
134
|
-
"
|
|
135
|
-
"
|
|
136
|
-
"language": "en",
|
|
82
|
+
"use_refreshtoken": False,
|
|
83
|
+
"name": "Virgin Media (IE)",
|
|
137
84
|
},
|
|
138
85
|
"pl": {
|
|
139
86
|
"api_url": "https://spark-prod-pl.gnp.cloud.upctv.pl",
|
|
140
|
-
"
|
|
141
|
-
"
|
|
142
|
-
"language": "pl",
|
|
143
|
-
"platform_types": {
|
|
144
|
-
"EOS": {"manufacturer": "Arris", "model": "DCX960"},
|
|
145
|
-
"APOLLO": {"manufacturer": "Arris", "model": "VIP5002W"},
|
|
146
|
-
},
|
|
87
|
+
"use_refreshtoken": False,
|
|
88
|
+
"name": "UPC (PL)",
|
|
147
89
|
},
|
|
148
90
|
}
|
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))
|