pymiele 0.3.0__tar.gz → 0.3.1__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.
- {pymiele-0.3.0 → pymiele-0.3.1}/PKG-INFO +1 -1
- {pymiele-0.3.0 → pymiele-0.3.1}/pymiele/const.py +1 -1
- pymiele-0.3.1/pymiele/model.py +295 -0
- {pymiele-0.3.0 → pymiele-0.3.1}/pymiele.egg-info/PKG-INFO +1 -1
- {pymiele-0.3.0 → pymiele-0.3.1}/setup.cfg +1 -1
- pymiele-0.3.0/pymiele/model.py +0 -698
- {pymiele-0.3.0 → pymiele-0.3.1}/LICENSE +0 -0
- {pymiele-0.3.0 → pymiele-0.3.1}/README.md +0 -0
- {pymiele-0.3.0 → pymiele-0.3.1}/pymiele/__init__.py +0 -0
- {pymiele-0.3.0 → pymiele-0.3.1}/pymiele/py.typed +0 -0
- {pymiele-0.3.0 → pymiele-0.3.1}/pymiele/pymiele.py +0 -0
- {pymiele-0.3.0 → pymiele-0.3.1}/pymiele.egg-info/SOURCES.txt +0 -0
- {pymiele-0.3.0 → pymiele-0.3.1}/pymiele.egg-info/dependency_links.txt +0 -0
- {pymiele-0.3.0 → pymiele-0.3.1}/pymiele.egg-info/requires.txt +0 -0
- {pymiele-0.3.0 → pymiele-0.3.1}/pymiele.egg-info/top_level.txt +0 -0
- {pymiele-0.3.0 → pymiele-0.3.1}/pyproject.toml +0 -0
@@ -0,0 +1,295 @@
|
|
1
|
+
"""Data models for Miele API."""
|
2
|
+
# Todo: Move to pymiele when complete and stable
|
3
|
+
|
4
|
+
from __future__ import annotations
|
5
|
+
|
6
|
+
|
7
|
+
class MieleDevices:
|
8
|
+
"""Data for all devices from API."""
|
9
|
+
|
10
|
+
def __init__(self, raw_data: dict) -> None:
|
11
|
+
"""Initialize MieleDevices."""
|
12
|
+
self.raw_data = raw_data
|
13
|
+
|
14
|
+
@property
|
15
|
+
def devices(self) -> list[str]:
|
16
|
+
"""Return list of all devices."""
|
17
|
+
|
18
|
+
return list(self.raw_data.keys())
|
19
|
+
|
20
|
+
|
21
|
+
class MieleDevice:
|
22
|
+
"""Data for a single device from API."""
|
23
|
+
|
24
|
+
def __init__(self, raw_data: dict) -> None:
|
25
|
+
"""Initialize MieleDevice."""
|
26
|
+
self.raw_data = raw_data
|
27
|
+
|
28
|
+
@property
|
29
|
+
def raw(self) -> dict:
|
30
|
+
"""Return raw data."""
|
31
|
+
return self.raw_data
|
32
|
+
|
33
|
+
@property
|
34
|
+
def fab_number(self) -> str:
|
35
|
+
"""Return the ID of the device."""
|
36
|
+
return str(self.raw_data["ident"]["deviceIdentLabel"]["fabNumber"])
|
37
|
+
|
38
|
+
@property
|
39
|
+
def device_type(self) -> int:
|
40
|
+
"""Return the type of the device."""
|
41
|
+
return self.raw_data["ident"]["type"]["value_raw"]
|
42
|
+
|
43
|
+
@property
|
44
|
+
def device_type_localized(self) -> str:
|
45
|
+
"""Return the type of the device."""
|
46
|
+
return self.raw_data["ident"]["type"]["value_localized"]
|
47
|
+
|
48
|
+
@property
|
49
|
+
def device_name(self) -> str:
|
50
|
+
"""Return the name of the device."""
|
51
|
+
return self.raw_data["ident"]["deviceName"]
|
52
|
+
|
53
|
+
@property
|
54
|
+
def tech_type(self) -> str:
|
55
|
+
"""Return the tech type of the device."""
|
56
|
+
return self.raw_data["ident"]["deviceIdentLabel"]["techType"]
|
57
|
+
|
58
|
+
@property
|
59
|
+
def xkm_tech_type(self) -> str:
|
60
|
+
"""Return the xkm tech type of the device."""
|
61
|
+
return self.raw_data["ident"]["xkmIdentLabel"]["techType"]
|
62
|
+
|
63
|
+
@property
|
64
|
+
def xkm_release_version(self) -> str:
|
65
|
+
"""Return the xkm release version of the device."""
|
66
|
+
return self.raw_data["ident"]["xkmIdentLabel"]["releaseVersion"]
|
67
|
+
|
68
|
+
@property
|
69
|
+
def state_program_id(self) -> int:
|
70
|
+
"""Return the program ID of the device."""
|
71
|
+
return self.raw_data["state"]["ProgramID"]["value_raw"]
|
72
|
+
|
73
|
+
@property
|
74
|
+
def state_status(self) -> int:
|
75
|
+
"""Return the status of the device."""
|
76
|
+
return self.raw_data["state"]["status"]["value_raw"]
|
77
|
+
|
78
|
+
@property
|
79
|
+
def state_program_type(self) -> int:
|
80
|
+
"""Return the program type of the device."""
|
81
|
+
return self.raw_data["state"]["programType"]["value_raw"]
|
82
|
+
|
83
|
+
@property
|
84
|
+
def state_program_phase(self) -> int:
|
85
|
+
"""Return the program phase of the device."""
|
86
|
+
return self.raw_data["state"]["programPhase"]["value_raw"]
|
87
|
+
|
88
|
+
@property
|
89
|
+
def state_remaining_time(self) -> list[int]:
|
90
|
+
"""Return the remaining time of the device."""
|
91
|
+
return self.raw_data["state"]["remainingTime"]
|
92
|
+
|
93
|
+
@property
|
94
|
+
def state_start_time(self) -> list[int]:
|
95
|
+
"""Return the start time of the device."""
|
96
|
+
return self.raw_data["state"]["startTime"]
|
97
|
+
|
98
|
+
@property
|
99
|
+
def state_target_temperature(self) -> list[dict]:
|
100
|
+
"""Return the target temperature of the device."""
|
101
|
+
return self.raw_data["state"]["targetTemperature"]
|
102
|
+
|
103
|
+
@property
|
104
|
+
def state_core_target_temperature(self) -> list[dict]:
|
105
|
+
"""Return the core target temperature of the device."""
|
106
|
+
return self.raw_data["state"]["coreTargetTemperature"]
|
107
|
+
|
108
|
+
@property
|
109
|
+
def state_temperature(self) -> list[int]:
|
110
|
+
"""Return the temperature of the device."""
|
111
|
+
return [temp["value_raw"] for temp in self.raw_data["state"]["temperature"]]
|
112
|
+
|
113
|
+
@property
|
114
|
+
def state_temperature_1(self) -> int:
|
115
|
+
"""Return the temperature in zone 1 of the device."""
|
116
|
+
return self.raw_data["state"]["temperature"][0]["value_raw"]
|
117
|
+
|
118
|
+
@property
|
119
|
+
def state_temperature_2(self) -> int:
|
120
|
+
"""Return the temperature in zone 2 of the device."""
|
121
|
+
return self.raw_data["state"]["temperature"][1]["value_raw"]
|
122
|
+
|
123
|
+
@property
|
124
|
+
def state_temperature_3(self) -> int:
|
125
|
+
"""Return the temperature in zone 3 of the device."""
|
126
|
+
return self.raw_data["state"]["temperature"][2]["value_raw"]
|
127
|
+
|
128
|
+
@property
|
129
|
+
def state_core_temperature(self) -> list[dict]:
|
130
|
+
"""Return the core temperature of the device."""
|
131
|
+
return self.raw_data["state"]["coreTemperature"]
|
132
|
+
|
133
|
+
@property
|
134
|
+
def state_core_temperature_1(self) -> list[dict]:
|
135
|
+
"""Return the core temperature in zone 1 of the device."""
|
136
|
+
return self.raw_data["state"]["coreTemperature"][0]["value_raw"]
|
137
|
+
|
138
|
+
@property
|
139
|
+
def state_core_temperature_2(self) -> list[dict]:
|
140
|
+
"""Return the core temperature in zone 2 of the device."""
|
141
|
+
return self.raw_data["state"]["coreTemperature"][1]["value_raw"]
|
142
|
+
|
143
|
+
@property
|
144
|
+
def state_signal_info(self) -> bool:
|
145
|
+
"""Return the signal info of the device."""
|
146
|
+
return self.raw_data["state"]["signalInfo"]
|
147
|
+
|
148
|
+
@property
|
149
|
+
def state_signal_failure(self) -> bool:
|
150
|
+
"""Return the signal failure of the device."""
|
151
|
+
return self.raw_data["state"]["signalFailure"]
|
152
|
+
|
153
|
+
@property
|
154
|
+
def state_signal_door(self) -> bool:
|
155
|
+
"""Return the signal door of the device."""
|
156
|
+
return self.raw_data["state"]["signalDoor"]
|
157
|
+
|
158
|
+
@property
|
159
|
+
def state_full_remote_control(self) -> bool:
|
160
|
+
"""Return the remote control enable of the device."""
|
161
|
+
return self.raw_data["state"]["remoteEnable"]["fullRemoteControl"]
|
162
|
+
|
163
|
+
@property
|
164
|
+
def state_smart_grid(self) -> bool:
|
165
|
+
"""Return the smart grid of the device."""
|
166
|
+
return self.raw_data["state"]["remoteEnable"]["smartGrid"]
|
167
|
+
|
168
|
+
@property
|
169
|
+
def state_mobile_start(self) -> bool:
|
170
|
+
"""Return the mobile start of the device."""
|
171
|
+
return self.raw_data["state"]["remoteEnable"]["mobileStart"]
|
172
|
+
|
173
|
+
@property
|
174
|
+
def state_ambient_light(self) -> bool:
|
175
|
+
"""Return the ambient light of the device."""
|
176
|
+
return self.raw_data["state"]["ambientLight"]
|
177
|
+
|
178
|
+
@property
|
179
|
+
def state_light(self) -> bool:
|
180
|
+
"""Return the light of the device."""
|
181
|
+
return self.raw_data["state"]["light"]
|
182
|
+
|
183
|
+
@property
|
184
|
+
def state_elapsed_time(self) -> list[int]:
|
185
|
+
"""Return the elapsed time of the device."""
|
186
|
+
return self.raw_data["state"]["elapsedTime"]
|
187
|
+
|
188
|
+
@property
|
189
|
+
def state_spinning_speed(self) -> int | None:
|
190
|
+
"""Return the spinning speed of the device."""
|
191
|
+
return self.raw_data["state"]["spinningSpeed"]
|
192
|
+
|
193
|
+
@property
|
194
|
+
def state_drying_step(self) -> int | None:
|
195
|
+
"""Return the drying step of the device."""
|
196
|
+
return self.raw_data["state"]["dryingStep"]
|
197
|
+
|
198
|
+
@property
|
199
|
+
def state_ventilation_step(self) -> int | None:
|
200
|
+
"""Return the ventilation step of the device."""
|
201
|
+
return self.raw_data["state"]["ventilationStep"]
|
202
|
+
|
203
|
+
@property
|
204
|
+
def state_plate_step(self) -> list[dict]:
|
205
|
+
"""Return the plate step of the device."""
|
206
|
+
return self.raw_data["state"]["plateStep"]
|
207
|
+
|
208
|
+
@property
|
209
|
+
def state_eco_feedback(self) -> dict | None:
|
210
|
+
"""Return the eco feedback of the device."""
|
211
|
+
return self.raw_data["state"]["ecoFeedback"]
|
212
|
+
|
213
|
+
@property
|
214
|
+
def state_battery_level(self) -> int | None:
|
215
|
+
"""Return the battery level of the device."""
|
216
|
+
return self.raw_data["state"]["batteryLevel"]
|
217
|
+
|
218
|
+
|
219
|
+
class MieleAction:
|
220
|
+
"""Actions for Miele devices."""
|
221
|
+
|
222
|
+
def __init__(self, raw_data: dict) -> None:
|
223
|
+
"""Initialize MieleAction."""
|
224
|
+
self.raw_data = raw_data
|
225
|
+
|
226
|
+
# Todo : Add process actions
|
227
|
+
@property
|
228
|
+
def raw(self) -> dict:
|
229
|
+
"""Return raw data."""
|
230
|
+
return self.raw_data
|
231
|
+
|
232
|
+
@property
|
233
|
+
def actions(self) -> list[str]:
|
234
|
+
"""Return list of all actions."""
|
235
|
+
return list(self.raw_data.keys())
|
236
|
+
|
237
|
+
@property
|
238
|
+
def modes(self) -> list[int]:
|
239
|
+
"""Return list of modes."""
|
240
|
+
return list(self.raw_data["modes"])
|
241
|
+
|
242
|
+
@property
|
243
|
+
def process_actions(self) -> list[int]:
|
244
|
+
"""Return list of process actions."""
|
245
|
+
return list(self.raw_data["processAction"])
|
246
|
+
|
247
|
+
@property
|
248
|
+
def light(self) -> list[int]:
|
249
|
+
"""Return list of light actions."""
|
250
|
+
return list(self.raw_data["light"])
|
251
|
+
|
252
|
+
@property
|
253
|
+
def ambient_light(self) -> list[int]:
|
254
|
+
"""Return list of ambient light actions."""
|
255
|
+
return list(self.raw_data["ambientLight"])
|
256
|
+
|
257
|
+
@property
|
258
|
+
def start_time(self) -> list[int]:
|
259
|
+
"""Return list of start time actions."""
|
260
|
+
return list(self.raw_data["start_time"])
|
261
|
+
|
262
|
+
@property
|
263
|
+
def ventilation_setp(self) -> list[int]:
|
264
|
+
"""Return list of ventilation step actions."""
|
265
|
+
return list(self.raw_data["ventilationStep"])
|
266
|
+
|
267
|
+
@property
|
268
|
+
def program_id(self) -> list[int]:
|
269
|
+
"""Return list of program id actions."""
|
270
|
+
return list(self.raw_data["programId"])
|
271
|
+
|
272
|
+
@property
|
273
|
+
def runOnTime(self) -> list[int]:
|
274
|
+
"""Return list of run on time actions."""
|
275
|
+
return list(self.raw_data["runOnTime"])
|
276
|
+
|
277
|
+
@property
|
278
|
+
def target_temperature(self) -> list[dict]:
|
279
|
+
"""Return list of target temperature actions."""
|
280
|
+
return list(self.raw_data["targetTemperature"])
|
281
|
+
|
282
|
+
@property
|
283
|
+
def power_on_enabled(self) -> bool:
|
284
|
+
"""Return powerOn enabled."""
|
285
|
+
return self.raw_data["powerOn"]
|
286
|
+
|
287
|
+
@property
|
288
|
+
def power_off_enabled(self) -> bool:
|
289
|
+
"""Return powerOff enabled."""
|
290
|
+
return self.raw_data["powerOff"]
|
291
|
+
|
292
|
+
@property
|
293
|
+
def device_name_enabled(self) -> bool:
|
294
|
+
"""Return deviceName enabled."""
|
295
|
+
return self.raw_data["deviceName"]
|
pymiele-0.3.0/pymiele/model.py
DELETED
@@ -1,698 +0,0 @@
|
|
1
|
-
"""Data models for Miele API."""
|
2
|
-
# Todo: Move to pymiele when complete and stable
|
3
|
-
|
4
|
-
from __future__ import annotations
|
5
|
-
|
6
|
-
|
7
|
-
class MieleDevices:
|
8
|
-
"""Data for all devices from API."""
|
9
|
-
|
10
|
-
def __init__(self, raw_data: dict) -> None:
|
11
|
-
"""Initialize MieleDevices."""
|
12
|
-
self.raw_data = raw_data
|
13
|
-
|
14
|
-
@property
|
15
|
-
def devices(self) -> list[str]:
|
16
|
-
"""Return list of all devices."""
|
17
|
-
|
18
|
-
return list(self.raw_data.keys())
|
19
|
-
|
20
|
-
|
21
|
-
class MieleDevice:
|
22
|
-
"""Data for a single device from API."""
|
23
|
-
|
24
|
-
def __init__(self, raw_data: dict) -> None:
|
25
|
-
"""Initialize MieleDevice."""
|
26
|
-
self.raw_data = raw_data
|
27
|
-
|
28
|
-
@property
|
29
|
-
def raw(self) -> dict:
|
30
|
-
"""Return raw data."""
|
31
|
-
return self.raw_data
|
32
|
-
|
33
|
-
@property
|
34
|
-
def fab_number(self) -> str:
|
35
|
-
"""Return the ID of the device."""
|
36
|
-
return str(self.raw_data["ident"]["deviceIdentLabel"]["fabNumber"])
|
37
|
-
|
38
|
-
@property
|
39
|
-
def device_type(self) -> int:
|
40
|
-
"""Return the type of the device."""
|
41
|
-
return self.raw_data["ident"]["type"]["value_raw"]
|
42
|
-
|
43
|
-
@property
|
44
|
-
def device_type_localized(self) -> int:
|
45
|
-
"""Return the type of the device."""
|
46
|
-
return self.raw_data["ident"]["type"]["value_localized"]
|
47
|
-
|
48
|
-
@property
|
49
|
-
def device_name(self) -> str:
|
50
|
-
"""Return the name of the device."""
|
51
|
-
return self.raw_data["ident"]["deviceName"]
|
52
|
-
|
53
|
-
@property
|
54
|
-
def tech_type(self) -> str:
|
55
|
-
"""Return the tech type of the device."""
|
56
|
-
return self.raw_data["ident"]["deviceIdentLabel"]["techType"]
|
57
|
-
|
58
|
-
@property
|
59
|
-
def xkm_tech_type(self) -> str:
|
60
|
-
"""Return the xkm tech type of the device."""
|
61
|
-
return self.raw_data["ident"]["xkmIdentLabel"]["techType"]
|
62
|
-
|
63
|
-
@property
|
64
|
-
def xkm_release_version(self) -> str:
|
65
|
-
"""Return the xkm release version of the device."""
|
66
|
-
return self.raw_data["ident"]["xkmIdentLabel"]["releaseVersion"]
|
67
|
-
|
68
|
-
@property
|
69
|
-
def state_program_id(self) -> int:
|
70
|
-
"""Return the program ID of the device."""
|
71
|
-
return self.raw_data["state"]["ProgramID"]["value_raw"]
|
72
|
-
|
73
|
-
@property
|
74
|
-
def state_status(self) -> int:
|
75
|
-
"""Return the status of the device."""
|
76
|
-
return self.raw_data["state"]["status"]["value_raw"]
|
77
|
-
|
78
|
-
@property
|
79
|
-
def state_program_type(self) -> int:
|
80
|
-
"""Return the program type of the device."""
|
81
|
-
return self.raw_data["state"]["programType"]["value_raw"]
|
82
|
-
|
83
|
-
@property
|
84
|
-
def state_program_phase(self) -> int:
|
85
|
-
"""Return the program phase of the device."""
|
86
|
-
return self.raw_data["state"]["programPhase"]["value_raw"]
|
87
|
-
|
88
|
-
@property
|
89
|
-
def state_remaining_time(self) -> list[int]:
|
90
|
-
"""Return the remaining time of the device."""
|
91
|
-
return self.raw_data["state"]["remainingTime"]
|
92
|
-
|
93
|
-
@property
|
94
|
-
def state_start_time(self) -> list[int]:
|
95
|
-
"""Return the start time of the device."""
|
96
|
-
return self.raw_data["state"]["startTime"]
|
97
|
-
|
98
|
-
@property
|
99
|
-
def state_target_temperature(self) -> list[dict]:
|
100
|
-
"""Return the target temperature of the device."""
|
101
|
-
return self.raw_data["state"]["targetTemperature"]
|
102
|
-
|
103
|
-
@property
|
104
|
-
def state_core_target_temperature(self) -> list[dict]:
|
105
|
-
"""Return the core target temperature of the device."""
|
106
|
-
return self.raw_data["state"]["coreTargetTemperature"]
|
107
|
-
|
108
|
-
@property
|
109
|
-
def state_temperature(self) -> list[int]:
|
110
|
-
"""Return the temperature of the device."""
|
111
|
-
return [temp["value_raw"] for temp in self.raw_data["state"]["temperature"]]
|
112
|
-
|
113
|
-
@property
|
114
|
-
def state_temperature_1(self) -> int:
|
115
|
-
"""Return the temperature in zone 1 of the device."""
|
116
|
-
return self.raw_data["state"]["temperature"][0]["value_raw"]
|
117
|
-
|
118
|
-
@property
|
119
|
-
def state_temperature_2(self) -> int:
|
120
|
-
"""Return the temperature in zone 2 of the device."""
|
121
|
-
return self.raw_data["state"]["temperature"][1]["value_raw"]
|
122
|
-
|
123
|
-
@property
|
124
|
-
def state_temperature_3(self) -> int:
|
125
|
-
"""Return the temperature in zone 3 of the device."""
|
126
|
-
return self.raw_data["state"]["temperature"][2]["value_raw"]
|
127
|
-
|
128
|
-
@property
|
129
|
-
def state_core_temperature(self) -> list[dict]:
|
130
|
-
"""Return the core temperature of the device."""
|
131
|
-
return self.raw_data["state"]["coreTemperature"]
|
132
|
-
|
133
|
-
@property
|
134
|
-
def state_core_temperature_1(self) -> list[dict]:
|
135
|
-
"""Return the core temperature in zone 1 of the device."""
|
136
|
-
return self.raw_data["state"]["coreTemperature"][0]["value_raw"]
|
137
|
-
|
138
|
-
@property
|
139
|
-
def state_core_temperature_2(self) -> list[dict]:
|
140
|
-
"""Return the core temperature in zone 2 of the device."""
|
141
|
-
return self.raw_data["state"]["coreTemperature"][1]["value_raw"]
|
142
|
-
|
143
|
-
@property
|
144
|
-
def state_signal_info(self) -> bool:
|
145
|
-
"""Return the signal info of the device."""
|
146
|
-
return self.raw_data["state"]["signalInfo"]
|
147
|
-
|
148
|
-
@property
|
149
|
-
def state_signal_failure(self) -> bool:
|
150
|
-
"""Return the signal failure of the device."""
|
151
|
-
return self.raw_data["state"]["signalFailure"]
|
152
|
-
|
153
|
-
@property
|
154
|
-
def state_signal_door(self) -> bool:
|
155
|
-
"""Return the signal door of the device."""
|
156
|
-
return self.raw_data["state"]["signalDoor"]
|
157
|
-
|
158
|
-
@property
|
159
|
-
def state_full_remote_control(self) -> bool:
|
160
|
-
"""Return the remote control enable of the device."""
|
161
|
-
return self.raw_data["state"]["remoteEnable"]["fullRemoteControl"]
|
162
|
-
|
163
|
-
@property
|
164
|
-
def state_smart_grid(self) -> bool:
|
165
|
-
"""Return the smart grid of the device."""
|
166
|
-
return self.raw_data["state"]["remoteEnable"]["smartGrid"]
|
167
|
-
|
168
|
-
@property
|
169
|
-
def state_mobile_start(self) -> bool:
|
170
|
-
"""Return the mobile start of the device."""
|
171
|
-
return self.raw_data["state"]["remoteEnable"]["mobileStart"]
|
172
|
-
|
173
|
-
@property
|
174
|
-
def state_ambient_light(self) -> bool:
|
175
|
-
"""Return the ambient light of the device."""
|
176
|
-
return self.raw_data["state"]["ambientLight"]
|
177
|
-
|
178
|
-
@property
|
179
|
-
def state_light(self) -> bool:
|
180
|
-
"""Return the light of the device."""
|
181
|
-
return self.raw_data["state"]["light"]
|
182
|
-
|
183
|
-
@property
|
184
|
-
def state_elapsed_time(self) -> list[int]:
|
185
|
-
"""Return the elapsed time of the device."""
|
186
|
-
return self.raw_data["state"]["elapsedTime"]
|
187
|
-
|
188
|
-
@property
|
189
|
-
def state_spinning_speed(self) -> int | None:
|
190
|
-
"""Return the spinning speed of the device."""
|
191
|
-
return self.raw_data["state"]["spinningSpeed"]
|
192
|
-
|
193
|
-
@property
|
194
|
-
def state_drying_step(self) -> int | None:
|
195
|
-
"""Return the drying step of the device."""
|
196
|
-
return self.raw_data["state"]["dryingStep"]
|
197
|
-
|
198
|
-
@property
|
199
|
-
def state_ventilation_step(self) -> int | None:
|
200
|
-
"""Return the ventilation step of the device."""
|
201
|
-
return self.raw_data["state"]["ventilationStep"]
|
202
|
-
|
203
|
-
@property
|
204
|
-
def state_plate_step(self) -> list[dict]:
|
205
|
-
"""Return the plate step of the device."""
|
206
|
-
return self.raw_data["state"]["plateStep"]
|
207
|
-
|
208
|
-
@property
|
209
|
-
def state_eco_feedback(self) -> dict | None:
|
210
|
-
"""Return the eco feedback of the device."""
|
211
|
-
return self.raw_data["state"]["ecoFeedback"]
|
212
|
-
|
213
|
-
@property
|
214
|
-
def state_battery_level(self) -> int | None:
|
215
|
-
"""Return the battery level of the device."""
|
216
|
-
return self.raw_data["state"]["batteryLevel"]
|
217
|
-
|
218
|
-
|
219
|
-
class MieleAction:
|
220
|
-
"""Actions for Miele devices."""
|
221
|
-
|
222
|
-
def __init__(self, raw_data: dict) -> None:
|
223
|
-
"""Initialize MieleAction."""
|
224
|
-
self.raw_data = raw_data
|
225
|
-
|
226
|
-
# Todo : Add process actions
|
227
|
-
@property
|
228
|
-
def raw(self) -> dict:
|
229
|
-
"""Return raw data."""
|
230
|
-
return self.raw_data
|
231
|
-
|
232
|
-
@property
|
233
|
-
def actions(self) -> list[str]:
|
234
|
-
"""Return list of all actions."""
|
235
|
-
return list(self.raw_data.keys())
|
236
|
-
|
237
|
-
@property
|
238
|
-
def modes(self) -> list[int]:
|
239
|
-
"""Return list of modes."""
|
240
|
-
return list(self.raw_data["modes"])
|
241
|
-
|
242
|
-
@property
|
243
|
-
def process_actions(self) -> list[int]:
|
244
|
-
"""Return list of process actions."""
|
245
|
-
return list(self.raw_data["processAction"])
|
246
|
-
|
247
|
-
@property
|
248
|
-
def light(self) -> list[int]:
|
249
|
-
"""Return list of light actions."""
|
250
|
-
return list(self.raw_data["light"])
|
251
|
-
|
252
|
-
@property
|
253
|
-
def ambient_light(self) -> list[int]:
|
254
|
-
"""Return list of ambient light actions."""
|
255
|
-
return list(self.raw_data["ambientLight"])
|
256
|
-
|
257
|
-
@property
|
258
|
-
def start_time(self) -> list[int]:
|
259
|
-
"""Return list of start time actions."""
|
260
|
-
return list(self.raw_data["start_time"])
|
261
|
-
|
262
|
-
@property
|
263
|
-
def ventilation_setp(self) -> list[int]:
|
264
|
-
"""Return list of ventilation step actions."""
|
265
|
-
return list(self.raw_data["ventilationStep"])
|
266
|
-
|
267
|
-
@property
|
268
|
-
def program_id(self) -> list[int]:
|
269
|
-
"""Return list of program id actions."""
|
270
|
-
return list(self.raw_data["programId"])
|
271
|
-
|
272
|
-
@property
|
273
|
-
def runOnTime(self) -> list[int]:
|
274
|
-
"""Return list of run on time actions."""
|
275
|
-
return list(self.raw_data["runOnTime"])
|
276
|
-
|
277
|
-
@property
|
278
|
-
def target_temperature(self) -> list[dict]:
|
279
|
-
"""Return list of target temperature actions."""
|
280
|
-
return list(self.raw_data["targetTemperature"])
|
281
|
-
|
282
|
-
@property
|
283
|
-
def power_on_enabled(self) -> bool:
|
284
|
-
"""Return powerOn enabled."""
|
285
|
-
return self.raw_data["powerOn"]
|
286
|
-
|
287
|
-
@property
|
288
|
-
def power_off_enabled(self) -> bool:
|
289
|
-
"""Return powerOff enabled."""
|
290
|
-
return self.raw_data["powerOff"]
|
291
|
-
|
292
|
-
@property
|
293
|
-
def device_name_enabled(self) -> bool:
|
294
|
-
"""Return deviceName enabled."""
|
295
|
-
return self.raw_data["deviceName"]
|
296
|
-
|
297
|
-
|
298
|
-
# Todo: Remove reference data
|
299
|
-
# TEST_DATA = """
|
300
|
-
# { "711934968": {
|
301
|
-
# "ident": {
|
302
|
-
# "type": {
|
303
|
-
# "key_localized": "Device type",
|
304
|
-
# "value_raw": 20,
|
305
|
-
# "value_localized": "Freezer"
|
306
|
-
# },
|
307
|
-
# "deviceName": "",
|
308
|
-
# "protocolVersion": 201,
|
309
|
-
# "deviceIdentLabel": {
|
310
|
-
# "fabNumber": "711934968",
|
311
|
-
# "fabIndex": "21",
|
312
|
-
# "techType": "FNS 28463 E ed/",
|
313
|
-
# "matNumber": "10805070",
|
314
|
-
# "swids": [
|
315
|
-
# "4497"
|
316
|
-
# ]
|
317
|
-
# },
|
318
|
-
# "xkmIdentLabel": {
|
319
|
-
# "techType": "EK042",
|
320
|
-
# "releaseVersion": "31.17"
|
321
|
-
# }
|
322
|
-
# },
|
323
|
-
# "state": {
|
324
|
-
# "ProgramID": {
|
325
|
-
# "value_raw": 0,
|
326
|
-
# "value_localized": "",
|
327
|
-
# "key_localized": "Program name"
|
328
|
-
# },
|
329
|
-
# "status": {
|
330
|
-
# "value_raw": 5,
|
331
|
-
# "value_localized": "In use",
|
332
|
-
# "key_localized": "status"
|
333
|
-
# },
|
334
|
-
# "programType": {
|
335
|
-
# "value_raw": 0,
|
336
|
-
# "value_localized": "",
|
337
|
-
# "key_localized": "Program type"
|
338
|
-
# },
|
339
|
-
# "programPhase": {
|
340
|
-
# "value_raw": 0,
|
341
|
-
# "value_localized": "",
|
342
|
-
# "key_localized": "Program phase"
|
343
|
-
# },
|
344
|
-
# "remainingTime": [
|
345
|
-
# 0,
|
346
|
-
# 0
|
347
|
-
# ],
|
348
|
-
# "startTime": [
|
349
|
-
# 0,
|
350
|
-
# 0
|
351
|
-
# ],
|
352
|
-
# "targetTemperature": [
|
353
|
-
# {
|
354
|
-
# "value_raw": -1800,
|
355
|
-
# "value_localized": -18,
|
356
|
-
# "unit": "Celsius"
|
357
|
-
# },
|
358
|
-
# {
|
359
|
-
# "value_raw": -32768,
|
360
|
-
# "value_localized": null,
|
361
|
-
# "unit": "Celsius"
|
362
|
-
# },
|
363
|
-
# {
|
364
|
-
# "value_raw": -32768,
|
365
|
-
# "value_localized": null,
|
366
|
-
# "unit": "Celsius"
|
367
|
-
# }
|
368
|
-
# ],
|
369
|
-
# "coreTargetTemperature": [],
|
370
|
-
# "temperature": [
|
371
|
-
# {
|
372
|
-
# "value_raw": -1800,
|
373
|
-
# "value_localized": -18,
|
374
|
-
# "unit": "Celsius"
|
375
|
-
# },
|
376
|
-
# {
|
377
|
-
# "value_raw": -32768,
|
378
|
-
# "value_localized": null,
|
379
|
-
# "unit": "Celsius"
|
380
|
-
# },
|
381
|
-
# {
|
382
|
-
# "value_raw": -32768,
|
383
|
-
# "value_localized": null,
|
384
|
-
# "unit": "Celsius"
|
385
|
-
# }
|
386
|
-
# ],
|
387
|
-
# "coreTemperature": [],
|
388
|
-
# "signalInfo": false,
|
389
|
-
# "signalFailure": false,
|
390
|
-
# "signalDoor": false,
|
391
|
-
# "remoteEnable": {
|
392
|
-
# "fullRemoteControl": true,
|
393
|
-
# "smartGrid": false,
|
394
|
-
# "mobileStart": false
|
395
|
-
# },
|
396
|
-
# "ambientLight": null,
|
397
|
-
# "light": null,
|
398
|
-
# "elapsedTime": [],
|
399
|
-
# "spinningSpeed": {
|
400
|
-
# "unit": "rpm",
|
401
|
-
# "value_raw": null,
|
402
|
-
# "value_localized": null,
|
403
|
-
# "key_localized": "Spin speed"
|
404
|
-
# },
|
405
|
-
# "dryingStep": {
|
406
|
-
# "value_raw": null,
|
407
|
-
# "value_localized": "",
|
408
|
-
# "key_localized": "Drying level"
|
409
|
-
# },
|
410
|
-
# "ventilationStep": {
|
411
|
-
# "value_raw": null,
|
412
|
-
# "value_localized": "",
|
413
|
-
# "key_localized": "Fan level"
|
414
|
-
# },
|
415
|
-
# "plateStep": [],
|
416
|
-
# "ecoFeedback": null,
|
417
|
-
# "batteryLevel": null
|
418
|
-
# }
|
419
|
-
# },
|
420
|
-
# "711944869": {
|
421
|
-
# "ident": {
|
422
|
-
# "type": {
|
423
|
-
# "key_localized": "Device type",
|
424
|
-
# "value_raw": 19,
|
425
|
-
# "value_localized": "Refrigerator"
|
426
|
-
# },
|
427
|
-
# "deviceName": "",
|
428
|
-
# "protocolVersion": 201,
|
429
|
-
# "deviceIdentLabel": {
|
430
|
-
# "fabNumber": "711944869",
|
431
|
-
# "fabIndex": "17",
|
432
|
-
# "techType": "KS 28423 D ed/c",
|
433
|
-
# "matNumber": "10804770",
|
434
|
-
# "swids": [
|
435
|
-
# "4497"
|
436
|
-
# ]
|
437
|
-
# },
|
438
|
-
# "xkmIdentLabel": {
|
439
|
-
# "techType": "EK042",
|
440
|
-
# "releaseVersion": "31.17"
|
441
|
-
# }
|
442
|
-
# },
|
443
|
-
# "state": {
|
444
|
-
# "ProgramID": {
|
445
|
-
# "value_raw": 0,
|
446
|
-
# "value_localized": "",
|
447
|
-
# "key_localized": "Program name"
|
448
|
-
# },
|
449
|
-
# "status": {
|
450
|
-
# "value_raw": 5,
|
451
|
-
# "value_localized": "In use",
|
452
|
-
# "key_localized": "status"
|
453
|
-
# },
|
454
|
-
# "programType": {
|
455
|
-
# "value_raw": 0,
|
456
|
-
# "value_localized": "",
|
457
|
-
# "key_localized": "Program type"
|
458
|
-
# },
|
459
|
-
# "programPhase": {
|
460
|
-
# "value_raw": 0,
|
461
|
-
# "value_localized": "",
|
462
|
-
# "key_localized": "Program phase"
|
463
|
-
# },
|
464
|
-
# "remainingTime": [
|
465
|
-
# 0,
|
466
|
-
# 0
|
467
|
-
# ],
|
468
|
-
# "startTime": [
|
469
|
-
# 0,
|
470
|
-
# 0
|
471
|
-
# ],
|
472
|
-
# "targetTemperature": [
|
473
|
-
# {
|
474
|
-
# "value_raw": 400,
|
475
|
-
# "value_localized": 4,
|
476
|
-
# "unit": "Celsius"
|
477
|
-
# },
|
478
|
-
# {
|
479
|
-
# "value_raw": -32768,
|
480
|
-
# "value_localized": null,
|
481
|
-
# "unit": "Celsius"
|
482
|
-
# },
|
483
|
-
# {
|
484
|
-
# "value_raw": -32768,
|
485
|
-
# "value_localized": null,
|
486
|
-
# "unit": "Celsius"
|
487
|
-
# }
|
488
|
-
# ],
|
489
|
-
# "coreTargetTemperature": [],
|
490
|
-
# "temperature": [
|
491
|
-
# {
|
492
|
-
# "value_raw": 400,
|
493
|
-
# "value_localized": 4,
|
494
|
-
# "unit": "Celsius"
|
495
|
-
# },
|
496
|
-
# {
|
497
|
-
# "value_raw": -32768,
|
498
|
-
# "value_localized": null,
|
499
|
-
# "unit": "Celsius"
|
500
|
-
# },
|
501
|
-
# {
|
502
|
-
# "value_raw": -32768,
|
503
|
-
# "value_localized": null,
|
504
|
-
# "unit": "Celsius"
|
505
|
-
# }
|
506
|
-
# ],
|
507
|
-
# "coreTemperature": [],
|
508
|
-
# "signalInfo": false,
|
509
|
-
# "signalFailure": false,
|
510
|
-
# "signalDoor": false,
|
511
|
-
# "remoteEnable": {
|
512
|
-
# "fullRemoteControl": true,
|
513
|
-
# "smartGrid": false,
|
514
|
-
# "mobileStart": false
|
515
|
-
# },
|
516
|
-
# "ambientLight": null,
|
517
|
-
# "light": null,
|
518
|
-
# "elapsedTime": [],
|
519
|
-
# "spinningSpeed": {
|
520
|
-
# "unit": "rpm",
|
521
|
-
# "value_raw": null,
|
522
|
-
# "value_localized": null,
|
523
|
-
# "key_localized": "Spin speed"
|
524
|
-
# },
|
525
|
-
# "dryingStep": {
|
526
|
-
# "value_raw": null,
|
527
|
-
# "value_localized": "",
|
528
|
-
# "key_localized": "Drying level"
|
529
|
-
# },
|
530
|
-
# "ventilationStep": {
|
531
|
-
# "value_raw": null,
|
532
|
-
# "value_localized": "",
|
533
|
-
# "key_localized": "Fan level"
|
534
|
-
# },
|
535
|
-
# "plateStep": [],
|
536
|
-
# "ecoFeedback": null,
|
537
|
-
# "batteryLevel": null
|
538
|
-
# }
|
539
|
-
# },
|
540
|
-
# "000186528088": {
|
541
|
-
# "ident": {
|
542
|
-
# "type": {
|
543
|
-
# "key_localized": "Device type",
|
544
|
-
# "value_raw": 1,
|
545
|
-
# "value_localized": "Washing machine"
|
546
|
-
# },
|
547
|
-
# "deviceName": "",
|
548
|
-
# "protocolVersion": 4,
|
549
|
-
# "deviceIdentLabel": {
|
550
|
-
# "fabNumber": "000186528088",
|
551
|
-
# "fabIndex": "44",
|
552
|
-
# "techType": "WCI870",
|
553
|
-
# "matNumber": "11387290",
|
554
|
-
# "swids": [
|
555
|
-
# "5975",
|
556
|
-
# "20456",
|
557
|
-
# "25213",
|
558
|
-
# "25191",
|
559
|
-
# "25446",
|
560
|
-
# "25205",
|
561
|
-
# "25447",
|
562
|
-
# "25319"
|
563
|
-
# ]
|
564
|
-
# },
|
565
|
-
# "xkmIdentLabel": {
|
566
|
-
# "techType": "EK057",
|
567
|
-
# "releaseVersion": "08.32"
|
568
|
-
# }
|
569
|
-
# },
|
570
|
-
# "state": {
|
571
|
-
# "ProgramID": {
|
572
|
-
# "value_raw": 0,
|
573
|
-
# "value_localized": "",
|
574
|
-
# "key_localized": "Program name"
|
575
|
-
# },
|
576
|
-
# "status": {
|
577
|
-
# "value_raw": 1,
|
578
|
-
# "value_localized": "Off",
|
579
|
-
# "key_localized": "status"
|
580
|
-
# },
|
581
|
-
# "programType": {
|
582
|
-
# "value_raw": 0,
|
583
|
-
# "value_localized": "",
|
584
|
-
# "key_localized": "Program type"
|
585
|
-
# },
|
586
|
-
# "programPhase": {
|
587
|
-
# "value_raw": 0,
|
588
|
-
# "value_localized": "",
|
589
|
-
# "key_localized": "Program phase"
|
590
|
-
# },
|
591
|
-
# "remainingTime": [
|
592
|
-
# 0,
|
593
|
-
# 0
|
594
|
-
# ],
|
595
|
-
# "startTime": [
|
596
|
-
# 0,
|
597
|
-
# 0
|
598
|
-
# ],
|
599
|
-
# "targetTemperature": [
|
600
|
-
# {
|
601
|
-
# "value_raw": -32768,
|
602
|
-
# "value_localized": null,
|
603
|
-
# "unit": "Celsius"
|
604
|
-
# },
|
605
|
-
# {
|
606
|
-
# "value_raw": -32768,
|
607
|
-
# "value_localized": null,
|
608
|
-
# "unit": "Celsius"
|
609
|
-
# },
|
610
|
-
# {
|
611
|
-
# "value_raw": -32768,
|
612
|
-
# "value_localized": null,
|
613
|
-
# "unit": "Celsius"
|
614
|
-
# }
|
615
|
-
# ],
|
616
|
-
# "coreTargetTemperature": [
|
617
|
-
# {
|
618
|
-
# "value_raw": -32768,
|
619
|
-
# "value_localized": null,
|
620
|
-
# "unit": "Celsius"
|
621
|
-
# }
|
622
|
-
# ],
|
623
|
-
# "temperature": [
|
624
|
-
# {
|
625
|
-
# "value_raw": -32768,
|
626
|
-
# "value_localized": null,
|
627
|
-
# "unit": "Celsius"
|
628
|
-
# },
|
629
|
-
# {
|
630
|
-
# "value_raw": -32768,
|
631
|
-
# "value_localized": null,
|
632
|
-
# "unit": "Celsius"
|
633
|
-
# },
|
634
|
-
# {
|
635
|
-
# "value_raw": -32768,
|
636
|
-
# "value_localized": null,
|
637
|
-
# "unit": "Celsius"
|
638
|
-
# }
|
639
|
-
# ],
|
640
|
-
# "coreTemperature": [
|
641
|
-
# {
|
642
|
-
# "value_raw": -32768,
|
643
|
-
# "value_localized": null,
|
644
|
-
# "unit": "Celsius"
|
645
|
-
# }
|
646
|
-
# ],
|
647
|
-
# "signalInfo": false,
|
648
|
-
# "signalFailure": false,
|
649
|
-
# "signalDoor": true,
|
650
|
-
# "remoteEnable": {
|
651
|
-
# "fullRemoteControl": true,
|
652
|
-
# "smartGrid": false,
|
653
|
-
# "mobileStart": false
|
654
|
-
# },
|
655
|
-
# "ambientLight": null,
|
656
|
-
# "light": null,
|
657
|
-
# "elapsedTime": [
|
658
|
-
# 0,
|
659
|
-
# 0
|
660
|
-
# ],
|
661
|
-
# "spinningSpeed": {
|
662
|
-
# "unit": "rpm",
|
663
|
-
# "value_raw": null,
|
664
|
-
# "value_localized": null,
|
665
|
-
# "key_localized": "Spin speed"
|
666
|
-
# },
|
667
|
-
# "dryingStep": {
|
668
|
-
# "value_raw": null,
|
669
|
-
# "value_localized": "",
|
670
|
-
# "key_localized": "Drying level"
|
671
|
-
# },
|
672
|
-
# "ventilationStep": {
|
673
|
-
# "value_raw": null,
|
674
|
-
# "value_localized": "",
|
675
|
-
# "key_localized": "Fan level"
|
676
|
-
# },
|
677
|
-
# "plateStep": [],
|
678
|
-
# "ecoFeedback": null,
|
679
|
-
# "batteryLevel": null
|
680
|
-
# }
|
681
|
-
# }
|
682
|
-
# }
|
683
|
-
# """
|
684
|
-
|
685
|
-
# raw = json.loads(TEST_DATA)
|
686
|
-
|
687
|
-
# data = MieleDevices(raw)
|
688
|
-
# print(data.devices)
|
689
|
-
# print(data.raw_data[data.devices[0]])
|
690
|
-
|
691
|
-
# machine = MieleDevice(data.raw_data[data.devices[0]])
|
692
|
-
# print(machine.fab_number)
|
693
|
-
# print(machine.device_type)
|
694
|
-
# print(machine.device_name)
|
695
|
-
# print(machine.tech_type)
|
696
|
-
# print(machine.xkm_tech_type)
|
697
|
-
# print(machine.xkm_release_version)
|
698
|
-
# print(machine.state_program_id)
|
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
|