aiohomematic 2025.10.1__py3-none-any.whl → 2025.10.3__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.
Potentially problematic release.
This version of aiohomematic might be problematic. Click here for more details.
- aiohomematic/async_support.py +8 -8
- aiohomematic/caches/dynamic.py +31 -26
- aiohomematic/caches/persistent.py +34 -32
- aiohomematic/caches/visibility.py +19 -7
- aiohomematic/central/__init__.py +88 -75
- aiohomematic/central/decorators.py +2 -2
- aiohomematic/central/xml_rpc_server.py +33 -25
- aiohomematic/client/__init__.py +72 -56
- aiohomematic/client/_rpc_errors.py +3 -3
- aiohomematic/client/json_rpc.py +33 -25
- aiohomematic/client/xml_rpc.py +14 -9
- aiohomematic/const.py +2 -1
- aiohomematic/converter.py +19 -19
- aiohomematic/exceptions.py +2 -1
- aiohomematic/model/__init__.py +4 -3
- aiohomematic/model/calculated/__init__.py +1 -1
- aiohomematic/model/calculated/climate.py +9 -9
- aiohomematic/model/calculated/data_point.py +13 -7
- aiohomematic/model/calculated/operating_voltage_level.py +2 -2
- aiohomematic/model/calculated/support.py +7 -7
- aiohomematic/model/custom/__init__.py +3 -3
- aiohomematic/model/custom/climate.py +57 -34
- aiohomematic/model/custom/cover.py +32 -18
- aiohomematic/model/custom/data_point.py +9 -7
- aiohomematic/model/custom/definition.py +23 -17
- aiohomematic/model/custom/light.py +52 -23
- aiohomematic/model/custom/lock.py +16 -12
- aiohomematic/model/custom/siren.py +8 -3
- aiohomematic/model/custom/switch.py +3 -2
- aiohomematic/model/custom/valve.py +3 -2
- aiohomematic/model/data_point.py +63 -49
- aiohomematic/model/device.py +48 -42
- aiohomematic/model/event.py +6 -5
- aiohomematic/model/generic/__init__.py +6 -4
- aiohomematic/model/generic/action.py +1 -1
- aiohomematic/model/generic/data_point.py +8 -6
- aiohomematic/model/generic/number.py +3 -3
- aiohomematic/model/generic/select.py +1 -1
- aiohomematic/model/generic/sensor.py +2 -2
- aiohomematic/model/generic/switch.py +3 -3
- aiohomematic/model/hub/__init__.py +17 -16
- aiohomematic/model/hub/data_point.py +12 -7
- aiohomematic/model/hub/number.py +3 -3
- aiohomematic/model/hub/select.py +3 -3
- aiohomematic/model/hub/text.py +2 -2
- aiohomematic/model/support.py +10 -9
- aiohomematic/model/update.py +6 -6
- aiohomematic/property_decorators.py +2 -0
- aiohomematic/support.py +44 -38
- aiohomematic/validator.py +6 -6
- {aiohomematic-2025.10.1.dist-info → aiohomematic-2025.10.3.dist-info}/METADATA +1 -1
- aiohomematic-2025.10.3.dist-info/RECORD +78 -0
- aiohomematic_support/client_local.py +26 -14
- aiohomematic-2025.10.1.dist-info/RECORD +0 -78
- {aiohomematic-2025.10.1.dist-info → aiohomematic-2025.10.3.dist-info}/WHEEL +0 -0
- {aiohomematic-2025.10.1.dist-info → aiohomematic-2025.10.3.dist-info}/licenses/LICENSE +0 -0
- {aiohomematic-2025.10.1.dist-info → aiohomematic-2025.10.3.dist-info}/top_level.txt +0 -0
|
@@ -149,6 +149,7 @@ class CustomDpCover(CustomDataPoint):
|
|
|
149
149
|
@bind_collector()
|
|
150
150
|
async def set_position(
|
|
151
151
|
self,
|
|
152
|
+
*,
|
|
152
153
|
position: int | None = None,
|
|
153
154
|
tilt_position: int | None = None,
|
|
154
155
|
collector: CallParameterCollector | None = None,
|
|
@@ -165,6 +166,7 @@ class CustomDpCover(CustomDataPoint):
|
|
|
165
166
|
|
|
166
167
|
async def _set_level(
|
|
167
168
|
self,
|
|
169
|
+
*,
|
|
168
170
|
level: float | None = None,
|
|
169
171
|
tilt_level: float | None = None,
|
|
170
172
|
collector: CallParameterCollector | None = None,
|
|
@@ -194,21 +196,21 @@ class CustomDpCover(CustomDataPoint):
|
|
|
194
196
|
return None
|
|
195
197
|
|
|
196
198
|
@bind_collector()
|
|
197
|
-
async def open(self, collector: CallParameterCollector | None = None) -> None:
|
|
199
|
+
async def open(self, *, collector: CallParameterCollector | None = None) -> None:
|
|
198
200
|
"""Open the cover."""
|
|
199
201
|
if not self.is_state_change(open=True):
|
|
200
202
|
return
|
|
201
203
|
await self._set_level(level=self._open_level, collector=collector)
|
|
202
204
|
|
|
203
205
|
@bind_collector()
|
|
204
|
-
async def close(self, collector: CallParameterCollector | None = None) -> None:
|
|
206
|
+
async def close(self, *, collector: CallParameterCollector | None = None) -> None:
|
|
205
207
|
"""Close the cover."""
|
|
206
208
|
if not self.is_state_change(close=True):
|
|
207
209
|
return
|
|
208
210
|
await self._set_level(level=self._closed_level, collector=collector)
|
|
209
211
|
|
|
210
212
|
@bind_collector(enabled=False)
|
|
211
|
-
async def stop(self, collector: CallParameterCollector | None = None) -> None:
|
|
213
|
+
async def stop(self, *, collector: CallParameterCollector | None = None) -> None:
|
|
212
214
|
"""Stop the device if in motion."""
|
|
213
215
|
await self._dp_stop.send_value(value=True, collector=collector)
|
|
214
216
|
|
|
@@ -243,6 +245,7 @@ class CustomDpWindowDrive(CustomDpCover):
|
|
|
243
245
|
|
|
244
246
|
async def _set_level(
|
|
245
247
|
self,
|
|
248
|
+
*,
|
|
246
249
|
level: float | None = None,
|
|
247
250
|
tilt_level: float | None = None,
|
|
248
251
|
collector: CallParameterCollector | None = None,
|
|
@@ -321,6 +324,7 @@ class CustomDpBlind(CustomDpCover):
|
|
|
321
324
|
@bind_collector(enabled=False)
|
|
322
325
|
async def set_position(
|
|
323
326
|
self,
|
|
327
|
+
*,
|
|
324
328
|
position: int | None = None,
|
|
325
329
|
tilt_position: int | None = None,
|
|
326
330
|
collector: CallParameterCollector | None = None,
|
|
@@ -342,6 +346,7 @@ class CustomDpBlind(CustomDpCover):
|
|
|
342
346
|
|
|
343
347
|
async def _set_level(
|
|
344
348
|
self,
|
|
349
|
+
*,
|
|
345
350
|
level: float | None = None,
|
|
346
351
|
tilt_level: float | None = None,
|
|
347
352
|
collector: CallParameterCollector | None = None,
|
|
@@ -392,6 +397,7 @@ class CustomDpBlind(CustomDpCover):
|
|
|
392
397
|
@bind_collector()
|
|
393
398
|
async def _send_level(
|
|
394
399
|
self,
|
|
400
|
+
*,
|
|
395
401
|
level: float,
|
|
396
402
|
tilt_level: float,
|
|
397
403
|
collector: CallParameterCollector | None = None,
|
|
@@ -408,7 +414,7 @@ class CustomDpBlind(CustomDpCover):
|
|
|
408
414
|
await super()._set_level(level=level, collector=collector)
|
|
409
415
|
|
|
410
416
|
@bind_collector(enabled=False)
|
|
411
|
-
async def open(self, collector: CallParameterCollector | None = None) -> None:
|
|
417
|
+
async def open(self, *, collector: CallParameterCollector | None = None) -> None:
|
|
412
418
|
"""Open the cover and open the tilt."""
|
|
413
419
|
if not self.is_state_change(open=True, tilt_open=True):
|
|
414
420
|
return
|
|
@@ -419,7 +425,7 @@ class CustomDpBlind(CustomDpCover):
|
|
|
419
425
|
)
|
|
420
426
|
|
|
421
427
|
@bind_collector(enabled=False)
|
|
422
|
-
async def close(self, collector: CallParameterCollector | None = None) -> None:
|
|
428
|
+
async def close(self, *, collector: CallParameterCollector | None = None) -> None:
|
|
423
429
|
"""Close the cover and close the tilt."""
|
|
424
430
|
if not self.is_state_change(close=True, tilt_close=True):
|
|
425
431
|
return
|
|
@@ -430,7 +436,7 @@ class CustomDpBlind(CustomDpCover):
|
|
|
430
436
|
)
|
|
431
437
|
|
|
432
438
|
@bind_collector(enabled=False)
|
|
433
|
-
async def stop(self, collector: CallParameterCollector | None = None) -> None:
|
|
439
|
+
async def stop(self, *, collector: CallParameterCollector | None = None) -> None:
|
|
434
440
|
"""Stop the device if in motion."""
|
|
435
441
|
try:
|
|
436
442
|
acquired: bool = await asyncio.wait_for(
|
|
@@ -446,26 +452,26 @@ class CustomDpBlind(CustomDpCover):
|
|
|
446
452
|
self._command_processing_lock.release()
|
|
447
453
|
|
|
448
454
|
@bind_collector(enabled=False)
|
|
449
|
-
async def _stop(self, collector: CallParameterCollector | None = None) -> None:
|
|
455
|
+
async def _stop(self, *, collector: CallParameterCollector | None = None) -> None:
|
|
450
456
|
"""Stop the device if in motion. Do only call with _command_processing_lock held."""
|
|
451
457
|
await super().stop(collector=collector)
|
|
452
458
|
|
|
453
459
|
@bind_collector(enabled=False)
|
|
454
|
-
async def open_tilt(self, collector: CallParameterCollector | None = None) -> None:
|
|
460
|
+
async def open_tilt(self, *, collector: CallParameterCollector | None = None) -> None:
|
|
455
461
|
"""Open the tilt."""
|
|
456
462
|
if not self.is_state_change(tilt_open=True):
|
|
457
463
|
return
|
|
458
464
|
await self._set_level(tilt_level=self._open_tilt_level, collector=collector)
|
|
459
465
|
|
|
460
466
|
@bind_collector(enabled=False)
|
|
461
|
-
async def close_tilt(self, collector: CallParameterCollector | None = None) -> None:
|
|
467
|
+
async def close_tilt(self, *, collector: CallParameterCollector | None = None) -> None:
|
|
462
468
|
"""Close the tilt."""
|
|
463
469
|
if not self.is_state_change(tilt_close=True):
|
|
464
470
|
return
|
|
465
471
|
await self._set_level(tilt_level=self._closed_level, collector=collector)
|
|
466
472
|
|
|
467
473
|
@bind_collector(enabled=False)
|
|
468
|
-
async def stop_tilt(self, collector: CallParameterCollector | None = None) -> None:
|
|
474
|
+
async def stop_tilt(self, *, collector: CallParameterCollector | None = None) -> None:
|
|
469
475
|
"""Stop the device if in motion. Use only when command_processing_lock is held."""
|
|
470
476
|
await self.stop(collector=collector)
|
|
471
477
|
|
|
@@ -481,16 +487,16 @@ class CustomDpBlind(CustomDpCover):
|
|
|
481
487
|
return True
|
|
482
488
|
return super().is_state_change(**kwargs)
|
|
483
489
|
|
|
484
|
-
def _get_combined_value(self, level: float | None = None, tilt_level: float | None = None) -> str | None:
|
|
490
|
+
def _get_combined_value(self, *, level: float | None = None, tilt_level: float | None = None) -> str | None:
|
|
485
491
|
"""Return the combined parameter."""
|
|
486
492
|
if level is None and tilt_level is None:
|
|
487
493
|
return None
|
|
488
494
|
levels: list[str] = []
|
|
489
495
|
# the resulting hex value is based on the doubled position
|
|
490
496
|
if level is not None:
|
|
491
|
-
levels.append(convert_hm_level_to_cpv(
|
|
497
|
+
levels.append(convert_hm_level_to_cpv(value=level))
|
|
492
498
|
if tilt_level is not None:
|
|
493
|
-
levels.append(convert_hm_level_to_cpv(
|
|
499
|
+
levels.append(convert_hm_level_to_cpv(value=tilt_level))
|
|
494
500
|
|
|
495
501
|
if levels:
|
|
496
502
|
return ",".join(levels)
|
|
@@ -513,7 +519,7 @@ class CustomDpIpBlind(CustomDpBlind):
|
|
|
513
519
|
"""Return operation mode of cover."""
|
|
514
520
|
return self._dp_operation_mode.value
|
|
515
521
|
|
|
516
|
-
def _get_combined_value(self, level: float | None = None, tilt_level: float | None = None) -> str | None:
|
|
522
|
+
def _get_combined_value(self, *, level: float | None = None, tilt_level: float | None = None) -> str | None:
|
|
517
523
|
"""Return the combined parameter."""
|
|
518
524
|
if level is None and tilt_level is None:
|
|
519
525
|
return None
|
|
@@ -563,6 +569,7 @@ class CustomDpGarage(CustomDataPoint):
|
|
|
563
569
|
@bind_collector()
|
|
564
570
|
async def set_position(
|
|
565
571
|
self,
|
|
572
|
+
*,
|
|
566
573
|
position: int | None = None,
|
|
567
574
|
tilt_position: int | None = None,
|
|
568
575
|
collector: CallParameterCollector | None = None,
|
|
@@ -599,26 +606,26 @@ class CustomDpGarage(CustomDataPoint):
|
|
|
599
606
|
return None
|
|
600
607
|
|
|
601
608
|
@bind_collector()
|
|
602
|
-
async def open(self, collector: CallParameterCollector | None = None) -> None:
|
|
609
|
+
async def open(self, *, collector: CallParameterCollector | None = None) -> None:
|
|
603
610
|
"""Open the garage door."""
|
|
604
611
|
if not self.is_state_change(open=True):
|
|
605
612
|
return
|
|
606
613
|
await self._dp_door_command.send_value(value=_GarageDoorCommand.OPEN, collector=collector)
|
|
607
614
|
|
|
608
615
|
@bind_collector()
|
|
609
|
-
async def close(self, collector: CallParameterCollector | None = None) -> None:
|
|
616
|
+
async def close(self, *, collector: CallParameterCollector | None = None) -> None:
|
|
610
617
|
"""Close the garage door."""
|
|
611
618
|
if not self.is_state_change(close=True):
|
|
612
619
|
return
|
|
613
620
|
await self._dp_door_command.send_value(value=_GarageDoorCommand.CLOSE, collector=collector)
|
|
614
621
|
|
|
615
622
|
@bind_collector(enabled=False)
|
|
616
|
-
async def stop(self, collector: CallParameterCollector | None = None) -> None:
|
|
623
|
+
async def stop(self, *, collector: CallParameterCollector | None = None) -> None:
|
|
617
624
|
"""Stop the device if in motion."""
|
|
618
625
|
await self._dp_door_command.send_value(value=_GarageDoorCommand.STOP, collector=collector)
|
|
619
626
|
|
|
620
627
|
@bind_collector()
|
|
621
|
-
async def vent(self, collector: CallParameterCollector | None = None) -> None:
|
|
628
|
+
async def vent(self, *, collector: CallParameterCollector | None = None) -> None:
|
|
622
629
|
"""Move the garage door to vent position."""
|
|
623
630
|
if not self.is_state_change(vent=True):
|
|
624
631
|
return
|
|
@@ -636,6 +643,7 @@ class CustomDpGarage(CustomDataPoint):
|
|
|
636
643
|
|
|
637
644
|
|
|
638
645
|
def make_ip_cover(
|
|
646
|
+
*,
|
|
639
647
|
channel: hmd.Channel,
|
|
640
648
|
custom_config: CustomConfig,
|
|
641
649
|
) -> None:
|
|
@@ -649,6 +657,7 @@ def make_ip_cover(
|
|
|
649
657
|
|
|
650
658
|
|
|
651
659
|
def make_rf_cover(
|
|
660
|
+
*,
|
|
652
661
|
channel: hmd.Channel,
|
|
653
662
|
custom_config: CustomConfig,
|
|
654
663
|
) -> None:
|
|
@@ -662,6 +671,7 @@ def make_rf_cover(
|
|
|
662
671
|
|
|
663
672
|
|
|
664
673
|
def make_ip_blind(
|
|
674
|
+
*,
|
|
665
675
|
channel: hmd.Channel,
|
|
666
676
|
custom_config: CustomConfig,
|
|
667
677
|
) -> None:
|
|
@@ -675,6 +685,7 @@ def make_ip_blind(
|
|
|
675
685
|
|
|
676
686
|
|
|
677
687
|
def make_ip_garage(
|
|
688
|
+
*,
|
|
678
689
|
channel: hmd.Channel,
|
|
679
690
|
custom_config: CustomConfig,
|
|
680
691
|
) -> None:
|
|
@@ -688,6 +699,7 @@ def make_ip_garage(
|
|
|
688
699
|
|
|
689
700
|
|
|
690
701
|
def make_ip_hdm(
|
|
702
|
+
*,
|
|
691
703
|
channel: hmd.Channel,
|
|
692
704
|
custom_config: CustomConfig,
|
|
693
705
|
) -> None:
|
|
@@ -701,6 +713,7 @@ def make_ip_hdm(
|
|
|
701
713
|
|
|
702
714
|
|
|
703
715
|
def make_rf_blind(
|
|
716
|
+
*,
|
|
704
717
|
channel: hmd.Channel,
|
|
705
718
|
custom_config: CustomConfig,
|
|
706
719
|
) -> None:
|
|
@@ -714,6 +727,7 @@ def make_rf_blind(
|
|
|
714
727
|
|
|
715
728
|
|
|
716
729
|
def make_rf_window_drive(
|
|
730
|
+
*,
|
|
717
731
|
channel: hmd.Channel,
|
|
718
732
|
custom_config: CustomConfig,
|
|
719
733
|
) -> None:
|
|
@@ -46,6 +46,7 @@ class CustomDataPoint(BaseDataPoint):
|
|
|
46
46
|
|
|
47
47
|
def __init__(
|
|
48
48
|
self,
|
|
49
|
+
*,
|
|
49
50
|
channel: hmd.Channel,
|
|
50
51
|
unique_id: str,
|
|
51
52
|
device_profile: DeviceProfile,
|
|
@@ -183,7 +184,7 @@ class CustomDataPoint(BaseDataPoint):
|
|
|
183
184
|
"""Return the signature of the data_point."""
|
|
184
185
|
return f"{self._category}/{self._channel.device.model}/{self.data_point_name_postfix}"
|
|
185
186
|
|
|
186
|
-
async def load_data_point_value(self, call_source: CallSource, direct_call: bool = False) -> None:
|
|
187
|
+
async def load_data_point_value(self, *, call_source: CallSource, direct_call: bool = False) -> None:
|
|
187
188
|
"""Init the data point values."""
|
|
188
189
|
for dp in self._readable_data_points:
|
|
189
190
|
await dp.load_data_point_value(call_source=call_source, direct_call=direct_call)
|
|
@@ -242,7 +243,7 @@ class CustomDataPoint(BaseDataPoint):
|
|
|
242
243
|
if hmed.get_include_default_data_points(device_profile=self._device_profile):
|
|
243
244
|
self._mark_data_points(custom_data_point_def=hmed.get_default_data_points())
|
|
244
245
|
|
|
245
|
-
def _add_data_points(self, field_dict_name: hmed.CDPD, is_visible: bool | None = None) -> None:
|
|
246
|
+
def _add_data_points(self, *, field_dict_name: hmed.CDPD, is_visible: bool | None = None) -> None:
|
|
246
247
|
"""Add data points to custom data point."""
|
|
247
248
|
fields = self._device_def.get(field_dict_name, {})
|
|
248
249
|
for channel_no, channel in fields.items():
|
|
@@ -253,6 +254,7 @@ class CustomDataPoint(BaseDataPoint):
|
|
|
253
254
|
|
|
254
255
|
def _add_data_point(
|
|
255
256
|
self,
|
|
257
|
+
*,
|
|
256
258
|
field: Field,
|
|
257
259
|
data_point: hmge.GenericDataPoint | None,
|
|
258
260
|
is_visible: bool | None = None,
|
|
@@ -270,7 +272,7 @@ class CustomDataPoint(BaseDataPoint):
|
|
|
270
272
|
)
|
|
271
273
|
self._data_points[field] = data_point
|
|
272
274
|
|
|
273
|
-
def _unregister_data_point_updated_callback(self, cb: Callable, custom_id: str) -> None:
|
|
275
|
+
def _unregister_data_point_updated_callback(self, *, cb: Callable, custom_id: str) -> None:
|
|
274
276
|
"""Unregister update callback."""
|
|
275
277
|
for unregister in self._unregister_callbacks:
|
|
276
278
|
if unregister is not None:
|
|
@@ -278,7 +280,7 @@ class CustomDataPoint(BaseDataPoint):
|
|
|
278
280
|
|
|
279
281
|
super()._unregister_data_point_updated_callback(cb=cb, custom_id=custom_id)
|
|
280
282
|
|
|
281
|
-
def _mark_data_points(self, custom_data_point_def: Mapping[int | tuple[int, ...], tuple[str, ...]]) -> None:
|
|
283
|
+
def _mark_data_points(self, *, custom_data_point_def: Mapping[int | tuple[int, ...], tuple[str, ...]]) -> None:
|
|
282
284
|
"""Mark data points to be created, even though a custom data point is present."""
|
|
283
285
|
if not custom_data_point_def:
|
|
284
286
|
return
|
|
@@ -289,7 +291,7 @@ class CustomDataPoint(BaseDataPoint):
|
|
|
289
291
|
for channel_no in channel_nos:
|
|
290
292
|
self._mark_data_point(channel_no=channel_no, parameters=parameters)
|
|
291
293
|
|
|
292
|
-
def _mark_data_point(self, channel_no: int | None, parameters: tuple[str, ...]) -> None:
|
|
294
|
+
def _mark_data_point(self, *, channel_no: int | None, parameters: tuple[str, ...]) -> None:
|
|
293
295
|
"""Mark data point to be created, even though a custom data point is present."""
|
|
294
296
|
channel_address = get_channel_address(device_address=self._device.address, channel_no=channel_no)
|
|
295
297
|
|
|
@@ -298,7 +300,7 @@ class CustomDataPoint(BaseDataPoint):
|
|
|
298
300
|
dp.force_usage(forced_usage=DataPointUsage.DATA_POINT)
|
|
299
301
|
|
|
300
302
|
def _get_data_point[DataPointT: hmge.GenericDataPoint](
|
|
301
|
-
self, field: Field, data_point_type: type[DataPointT]
|
|
303
|
+
self, *, field: Field, data_point_type: type[DataPointT]
|
|
302
304
|
) -> DataPointT:
|
|
303
305
|
"""Get data point."""
|
|
304
306
|
if dp := self._data_points.get(field):
|
|
@@ -318,7 +320,7 @@ class CustomDataPoint(BaseDataPoint):
|
|
|
318
320
|
NoneTypeDataPoint(),
|
|
319
321
|
)
|
|
320
322
|
|
|
321
|
-
def has_data_point_key(self, data_point_keys: set[DataPointKey]) -> bool:
|
|
323
|
+
def has_data_point_key(self, *, data_point_keys: set[DataPointKey]) -> bool:
|
|
322
324
|
"""Return if a data_point with one of the data points is part of this data_point."""
|
|
323
325
|
result = [dp for dp in self._data_points.values() if dp.dpk in data_point_keys]
|
|
324
326
|
return len(result) > 0
|
|
@@ -594,6 +594,7 @@ def validate_custom_data_point_definition() -> Any:
|
|
|
594
594
|
|
|
595
595
|
|
|
596
596
|
def make_custom_data_point(
|
|
597
|
+
*,
|
|
597
598
|
channel: hmd.Channel,
|
|
598
599
|
data_point_class: type,
|
|
599
600
|
device_profile: DeviceProfile,
|
|
@@ -620,6 +621,7 @@ def make_custom_data_point(
|
|
|
620
621
|
|
|
621
622
|
|
|
622
623
|
def _create_custom_data_point(
|
|
624
|
+
*,
|
|
623
625
|
channel: hmd.Channel,
|
|
624
626
|
custom_data_point_class: type,
|
|
625
627
|
device_profile: DeviceProfile,
|
|
@@ -650,9 +652,9 @@ def _create_custom_data_point(
|
|
|
650
652
|
) from exc
|
|
651
653
|
|
|
652
654
|
|
|
653
|
-
def _rebase_pri_channels(device_profile: DeviceProfile, custom_config: CustomConfig) -> CustomConfig:
|
|
655
|
+
def _rebase_pri_channels(*, device_profile: DeviceProfile, custom_config: CustomConfig) -> CustomConfig:
|
|
654
656
|
"""Re base primary channel of custom config."""
|
|
655
|
-
device_def = _get_device_group(device_profile, 0)
|
|
657
|
+
device_def = _get_device_group(device_profile=device_profile, group_no=0)
|
|
656
658
|
if (pri_def := device_def[CDPD.PRIMARY_CHANNEL]) is None:
|
|
657
659
|
return custom_config
|
|
658
660
|
pri_channels = [cu + pri_def for cu in custom_config.channels]
|
|
@@ -663,9 +665,9 @@ def _rebase_pri_channels(device_profile: DeviceProfile, custom_config: CustomCon
|
|
|
663
665
|
)
|
|
664
666
|
|
|
665
667
|
|
|
666
|
-
def _relevant_channels(device_profile: DeviceProfile, custom_config: CustomConfig) -> tuple[int | None, ...]:
|
|
668
|
+
def _relevant_channels(*, device_profile: DeviceProfile, custom_config: CustomConfig) -> tuple[int | None, ...]:
|
|
667
669
|
"""Return the relevant channels."""
|
|
668
|
-
device_def = _get_device_group(device_profile, 0)
|
|
670
|
+
device_def = _get_device_group(device_profile=device_profile, group_no=0)
|
|
669
671
|
def_channels = [device_def[CDPD.PRIMARY_CHANNEL]]
|
|
670
672
|
if sec_channels := device_def.get(CDPD.SECONDARY_CHANNELS):
|
|
671
673
|
def_channels.extend(sec_channels)
|
|
@@ -681,10 +683,10 @@ def _relevant_channels(device_profile: DeviceProfile, custom_config: CustomConfi
|
|
|
681
683
|
|
|
682
684
|
|
|
683
685
|
def add_channel_groups_to_device(
|
|
684
|
-
device: hmd.Device, device_profile: DeviceProfile, custom_config: CustomConfig
|
|
686
|
+
*, device: hmd.Device, device_profile: DeviceProfile, custom_config: CustomConfig
|
|
685
687
|
) -> None:
|
|
686
688
|
"""Return the relevant channels."""
|
|
687
|
-
device_def = _get_device_group(device_profile, 0)
|
|
689
|
+
device_def = _get_device_group(device_profile=device_profile, group_no=0)
|
|
688
690
|
if (pri_channel := device_def[CDPD.PRIMARY_CHANNEL]) is None:
|
|
689
691
|
return
|
|
690
692
|
for conf_channel in custom_config.channels:
|
|
@@ -699,7 +701,7 @@ def add_channel_groups_to_device(
|
|
|
699
701
|
device.add_channel_to_group(channel_no=conf_channel + sec_channel, group_no=group_no)
|
|
700
702
|
|
|
701
703
|
|
|
702
|
-
def get_channel_group_no(device: hmd.Device, channel_no: int | None) -> int | None:
|
|
704
|
+
def get_channel_group_no(*, device: hmd.Device, channel_no: int | None) -> int | None:
|
|
703
705
|
"""Get channel group of sub_device."""
|
|
704
706
|
return device.get_channel_group_no(channel_no=channel_no)
|
|
705
707
|
|
|
@@ -711,13 +713,13 @@ def get_default_data_points() -> Mapping[int | tuple[int, ...], tuple[Parameter,
|
|
|
711
713
|
)
|
|
712
714
|
|
|
713
715
|
|
|
714
|
-
def get_include_default_data_points(device_profile: DeviceProfile) -> bool:
|
|
716
|
+
def get_include_default_data_points(*, device_profile: DeviceProfile) -> bool:
|
|
715
717
|
"""Return if default data points should be included."""
|
|
716
|
-
device = _get_device_definition(device_profile)
|
|
718
|
+
device = _get_device_definition(device_profile=device_profile)
|
|
717
719
|
return bool(device.get(CDPD.INCLUDE_DEFAULT_DPS, DEFAULT_INCLUDE_DEFAULT_DPS))
|
|
718
720
|
|
|
719
721
|
|
|
720
|
-
def _get_device_definition(device_profile: DeviceProfile) -> Mapping[CDPD, Any]:
|
|
722
|
+
def _get_device_definition(*, device_profile: DeviceProfile) -> Mapping[CDPD, Any]:
|
|
721
723
|
"""Return device from data_point definitions."""
|
|
722
724
|
return cast(
|
|
723
725
|
Mapping[CDPD, Any],
|
|
@@ -725,9 +727,9 @@ def _get_device_definition(device_profile: DeviceProfile) -> Mapping[CDPD, Any]:
|
|
|
725
727
|
)
|
|
726
728
|
|
|
727
729
|
|
|
728
|
-
def _get_device_group(device_profile: DeviceProfile, group_no: int | None) -> Mapping[CDPD, Any]:
|
|
730
|
+
def _get_device_group(*, device_profile: DeviceProfile, group_no: int | None) -> Mapping[CDPD, Any]:
|
|
729
731
|
"""Return the device group."""
|
|
730
|
-
device = _get_device_definition(device_profile)
|
|
732
|
+
device = _get_device_definition(device_profile=device_profile)
|
|
731
733
|
group = cast(dict[CDPD, Any], device[CDPD.DEVICE_GROUP])
|
|
732
734
|
# Create a deep copy of the group due to channel rebase
|
|
733
735
|
group = deepcopy(group)
|
|
@@ -750,7 +752,7 @@ def _get_device_group(device_profile: DeviceProfile, group_no: int | None) -> Ma
|
|
|
750
752
|
|
|
751
753
|
|
|
752
754
|
def _rebase_data_point_dict(
|
|
753
|
-
data_point_dict: CDPD, group: Mapping[CDPD, Any], group_no: int
|
|
755
|
+
*, data_point_dict: CDPD, group: Mapping[CDPD, Any], group_no: int
|
|
754
756
|
) -> Mapping[int | None, Any]:
|
|
755
757
|
"""Rebase data_point_dict with group_no."""
|
|
756
758
|
new_fields: dict[int | None, Any] = {}
|
|
@@ -763,7 +765,9 @@ def _rebase_data_point_dict(
|
|
|
763
765
|
return new_fields
|
|
764
766
|
|
|
765
767
|
|
|
766
|
-
def _get_device_data_points(
|
|
768
|
+
def _get_device_data_points(
|
|
769
|
+
*, device_profile: DeviceProfile, group_no: int | None
|
|
770
|
+
) -> Mapping[int, tuple[Parameter, ...]]:
|
|
767
771
|
"""Return the device data points."""
|
|
768
772
|
if (
|
|
769
773
|
additional_dps := VALID_CUSTOM_DATA_POINT_DEFINITION[CDPD.DEVICE_DEFINITIONS]
|
|
@@ -779,6 +783,7 @@ def _get_device_data_points(device_profile: DeviceProfile, group_no: int | None)
|
|
|
779
783
|
|
|
780
784
|
|
|
781
785
|
def get_custom_configs(
|
|
786
|
+
*,
|
|
782
787
|
model: str,
|
|
783
788
|
category: DataPointCategory | None = None,
|
|
784
789
|
) -> tuple[CustomConfig, ...]:
|
|
@@ -807,6 +812,7 @@ def get_custom_configs(
|
|
|
807
812
|
|
|
808
813
|
|
|
809
814
|
def _get_data_point_config_by_category(
|
|
815
|
+
*,
|
|
810
816
|
category_devices: Mapping[str, CustomConfig | tuple[CustomConfig, ...]],
|
|
811
817
|
model: str,
|
|
812
818
|
) -> CustomConfig | tuple[CustomConfig, ...] | None:
|
|
@@ -822,7 +828,7 @@ def _get_data_point_config_by_category(
|
|
|
822
828
|
return None
|
|
823
829
|
|
|
824
830
|
|
|
825
|
-
def is_multi_channel_device(model: str, category: DataPointCategory) -> bool:
|
|
831
|
+
def is_multi_channel_device(*, model: str, category: DataPointCategory) -> bool:
|
|
826
832
|
"""Return true, if device has multiple channels."""
|
|
827
833
|
channels: list[int | None] = []
|
|
828
834
|
for custom_config in get_custom_configs(model=model, category=category):
|
|
@@ -830,9 +836,9 @@ def is_multi_channel_device(model: str, category: DataPointCategory) -> bool:
|
|
|
830
836
|
return len(channels) > 1
|
|
831
837
|
|
|
832
838
|
|
|
833
|
-
def data_point_definition_exists(model: str) -> bool:
|
|
839
|
+
def data_point_definition_exists(*, model: str) -> bool:
|
|
834
840
|
"""Check if device desc exits."""
|
|
835
|
-
return len(get_custom_configs(model)) > 0
|
|
841
|
+
return len(get_custom_configs(model=model)) > 0
|
|
836
842
|
|
|
837
843
|
|
|
838
844
|
def get_required_parameters() -> tuple[Parameter, ...]:
|