aiohomematic 2025.9.3__py3-none-any.whl → 2025.9.5__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/caches/dynamic.py +2 -2
- aiohomematic/central/__init__.py +13 -13
- aiohomematic/central/xml_rpc_server.py +9 -14
- aiohomematic/client/__init__.py +44 -44
- aiohomematic/client/_rpc_errors.py +1 -1
- aiohomematic/client/json_rpc.py +27 -27
- aiohomematic/client/xml_rpc.py +5 -14
- aiohomematic/const.py +1 -1
- aiohomematic/model/__init__.py +1 -1
- aiohomematic/model/calculated/data_point.py +2 -2
- aiohomematic/model/custom/definition.py +1 -1
- aiohomematic/model/data_point.py +10 -10
- aiohomematic/model/device.py +6 -6
- aiohomematic/model/generic/data_point.py +3 -3
- aiohomematic/model/hub/__init__.py +3 -3
- aiohomematic/model/hub/data_point.py +3 -3
- aiohomematic/property_decorators.py +2 -44
- aiohomematic/support.py +2 -7
- {aiohomematic-2025.9.3.dist-info → aiohomematic-2025.9.5.dist-info}/METADATA +4 -4
- {aiohomematic-2025.9.3.dist-info → aiohomematic-2025.9.5.dist-info}/RECORD +24 -24
- aiohomematic_support/client_local.py +15 -15
- {aiohomematic-2025.9.3.dist-info → aiohomematic-2025.9.5.dist-info}/WHEEL +0 -0
- {aiohomematic-2025.9.3.dist-info → aiohomematic-2025.9.5.dist-info}/licenses/LICENSE +0 -0
- {aiohomematic-2025.9.3.dist-info → aiohomematic-2025.9.5.dist-info}/top_level.txt +0 -0
aiohomematic/caches/dynamic.py
CHANGED
|
@@ -170,7 +170,7 @@ class DeviceDetailsCache:
|
|
|
170
170
|
self._refreshed_at = INIT_DATETIME
|
|
171
171
|
|
|
172
172
|
async def load(self, direct_call: bool = False) -> None:
|
|
173
|
-
"""Fetch names from backend."""
|
|
173
|
+
"""Fetch names from the backend."""
|
|
174
174
|
if direct_call is False and changed_within_seconds(
|
|
175
175
|
last_change=self._refreshed_at, max_age=int(MAX_CACHE_AGE / 3)
|
|
176
176
|
):
|
|
@@ -286,7 +286,7 @@ class CentralDataCache:
|
|
|
286
286
|
self._refreshed_at: Final[dict[Interface, datetime]] = {}
|
|
287
287
|
|
|
288
288
|
async def load(self, direct_call: bool = False, interface: Interface | None = None) -> None:
|
|
289
|
-
"""Fetch data from backend."""
|
|
289
|
+
"""Fetch data from the backend."""
|
|
290
290
|
_LOGGER.debug("load: Loading device data for %s", self._central.name)
|
|
291
291
|
for client in self._central.clients:
|
|
292
292
|
if interface and interface != client.interface:
|
aiohomematic/central/__init__.py
CHANGED
|
@@ -11,7 +11,7 @@ interfaces, devices, channels, data points, events, and background jobs.
|
|
|
11
11
|
|
|
12
12
|
The central unit ties together the various submodules: caches, client adapters
|
|
13
13
|
(JSON-RPC/XML-RPC), device and data point models, and visibility/description caches.
|
|
14
|
-
It exposes high-level APIs to query and manipulate the
|
|
14
|
+
It exposes high-level APIs to query and manipulate the backend state while
|
|
15
15
|
encapsulating transport and scheduling details.
|
|
16
16
|
|
|
17
17
|
Public API (selected)
|
|
@@ -191,7 +191,7 @@ INTERFACE_EVENT_SCHEMA = vol.Schema(
|
|
|
191
191
|
|
|
192
192
|
|
|
193
193
|
class CentralUnit(LogContextMixin, PayloadMixin):
|
|
194
|
-
"""Central unit that collects everything to handle communication from/to
|
|
194
|
+
"""Central unit that collects everything to handle communication from/to the backend."""
|
|
195
195
|
|
|
196
196
|
def __init__(self, central_config: CentralConfig) -> None:
|
|
197
197
|
"""Init the central unit."""
|
|
@@ -208,7 +208,7 @@ class CentralUnit(LogContextMixin, PayloadMixin):
|
|
|
208
208
|
self._xml_rpc_server: xmlrpc.XmlRpcServer | None = None
|
|
209
209
|
self._json_rpc_client: JsonRpcAioHttpClient | None = None
|
|
210
210
|
|
|
211
|
-
# Caches for
|
|
211
|
+
# Caches for the backend data
|
|
212
212
|
self._data_cache: Final = CentralDataCache(central=self)
|
|
213
213
|
self._device_details: Final = DeviceDetailsCache(central=self)
|
|
214
214
|
self._device_descriptions: Final = DeviceDescriptionCache(central=self)
|
|
@@ -233,7 +233,7 @@ class CentralUnit(LogContextMixin, PayloadMixin):
|
|
|
233
233
|
# e.g. DEVICES_CREATED, HUB_REFRESHED
|
|
234
234
|
self._backend_system_callbacks: Final[set[Callable]] = set()
|
|
235
235
|
# Signature: (interface_id, channel_address, parameter, value)
|
|
236
|
-
# Re-Fired events from
|
|
236
|
+
# Re-Fired events from the backend for parameter updates
|
|
237
237
|
self._backend_parameter_callbacks: Final[set[Callable]] = set()
|
|
238
238
|
# Signature: (event_type, event_data)
|
|
239
239
|
# Events like INTERFACE, KEYPRESS, ...
|
|
@@ -665,7 +665,7 @@ class CentralUnit(LogContextMixin, PayloadMixin):
|
|
|
665
665
|
and interface_config.interface not in self.primary_client.system_information.available_interfaces
|
|
666
666
|
):
|
|
667
667
|
_LOGGER.warning(
|
|
668
|
-
"CREATE_CLIENTS failed: Interface: %s is not available for backend %s",
|
|
668
|
+
"CREATE_CLIENTS failed: Interface: %s is not available for the backend %s",
|
|
669
669
|
interface_config.interface,
|
|
670
670
|
self.name,
|
|
671
671
|
)
|
|
@@ -721,7 +721,7 @@ class CentralUnit(LogContextMixin, PayloadMixin):
|
|
|
721
721
|
for client in self._clients.copy().values():
|
|
722
722
|
if client.interface not in self.system_information.available_interfaces:
|
|
723
723
|
_LOGGER.debug(
|
|
724
|
-
"INIT_CLIENTS failed: Interface: %s is not available for backend %s",
|
|
724
|
+
"INIT_CLIENTS failed: Interface: %s is not available for the backend %s",
|
|
725
725
|
client.interface,
|
|
726
726
|
self.name,
|
|
727
727
|
)
|
|
@@ -1211,7 +1211,7 @@ class CentralUnit(LogContextMixin, PayloadMixin):
|
|
|
1211
1211
|
|
|
1212
1212
|
@callback_backend_system(system_event=BackendSystemEvent.LIST_DEVICES)
|
|
1213
1213
|
def list_devices(self, interface_id: str) -> list[DeviceDescription]:
|
|
1214
|
-
"""Return already existing devices to
|
|
1214
|
+
"""Return already existing devices to the backend."""
|
|
1215
1215
|
result = self._device_descriptions.get_raw_device_descriptions(interface_id=interface_id)
|
|
1216
1216
|
_LOGGER.debug("LIST_DEVICES: interface_id = %s, channel_count = %i", interface_id, len(result))
|
|
1217
1217
|
return result
|
|
@@ -1274,13 +1274,13 @@ class CentralUnit(LogContextMixin, PayloadMixin):
|
|
|
1274
1274
|
self._last_event_seen_for_interface[interface_id] = datetime.now()
|
|
1275
1275
|
|
|
1276
1276
|
async def execute_program(self, pid: str) -> bool:
|
|
1277
|
-
"""Execute a program on
|
|
1277
|
+
"""Execute a program on the backend."""
|
|
1278
1278
|
if client := self.primary_client:
|
|
1279
1279
|
return await client.execute_program(pid=pid)
|
|
1280
1280
|
return False
|
|
1281
1281
|
|
|
1282
1282
|
async def set_program_state(self, pid: str, state: bool) -> bool:
|
|
1283
|
-
"""Execute a program on
|
|
1283
|
+
"""Execute a program on the backend."""
|
|
1284
1284
|
if client := self.primary_client:
|
|
1285
1285
|
return await client.set_program_state(pid=pid, state=state)
|
|
1286
1286
|
return False
|
|
@@ -1310,13 +1310,13 @@ class CentralUnit(LogContextMixin, PayloadMixin):
|
|
|
1310
1310
|
)
|
|
1311
1311
|
|
|
1312
1312
|
async def get_system_variable(self, legacy_name: str) -> Any | None:
|
|
1313
|
-
"""Get system variable from
|
|
1313
|
+
"""Get system variable from the backend."""
|
|
1314
1314
|
if client := self.primary_client:
|
|
1315
1315
|
return await client.get_system_variable(legacy_name)
|
|
1316
1316
|
return None
|
|
1317
1317
|
|
|
1318
1318
|
async def set_system_variable(self, legacy_name: str, value: Any) -> None:
|
|
1319
|
-
"""Set variable value on
|
|
1319
|
+
"""Set variable value on the backend."""
|
|
1320
1320
|
if dp := self.get_sysvar_data_point(legacy_name=legacy_name):
|
|
1321
1321
|
await dp.send_variable(value=value)
|
|
1322
1322
|
else:
|
|
@@ -1552,7 +1552,7 @@ class CentralUnit(LogContextMixin, PayloadMixin):
|
|
|
1552
1552
|
"""
|
|
1553
1553
|
Fire backend_parameter callback in central.
|
|
1554
1554
|
|
|
1555
|
-
Re-Fired events from
|
|
1555
|
+
Re-Fired events from the backend for parameter updates.
|
|
1556
1556
|
"""
|
|
1557
1557
|
for callback_handler in self._backend_parameter_callbacks:
|
|
1558
1558
|
try:
|
|
@@ -1597,7 +1597,7 @@ class CentralUnit(LogContextMixin, PayloadMixin):
|
|
|
1597
1597
|
|
|
1598
1598
|
|
|
1599
1599
|
class _Scheduler(threading.Thread):
|
|
1600
|
-
"""Periodically check connection to
|
|
1600
|
+
"""Periodically check connection to the backend, and load data when required."""
|
|
1601
1601
|
|
|
1602
1602
|
def __init__(self, central: CentralUnit) -> None:
|
|
1603
1603
|
"""Init the connection checker."""
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
XML-RPC server module.
|
|
5
5
|
|
|
6
6
|
Provides the XML-RPC server which handles communication
|
|
7
|
-
with the
|
|
7
|
+
with the backend.
|
|
8
8
|
"""
|
|
9
9
|
|
|
10
10
|
from __future__ import annotations
|
|
@@ -25,7 +25,7 @@ _LOGGER: Final = logging.getLogger(__name__)
|
|
|
25
25
|
|
|
26
26
|
# pylint: disable=invalid-name
|
|
27
27
|
class RPCFunctions:
|
|
28
|
-
"""The XML-RPC functions the
|
|
28
|
+
"""The XML-RPC functions the backend will expect."""
|
|
29
29
|
|
|
30
30
|
def __init__(self, xml_rpc_server: XmlRpcServer) -> None:
|
|
31
31
|
"""Init RPCFunctions."""
|
|
@@ -46,7 +46,7 @@ class RPCFunctions:
|
|
|
46
46
|
|
|
47
47
|
@callback_backend_system(system_event=BackendSystemEvent.ERROR)
|
|
48
48
|
def error(self, interface_id: str, error_code: str, msg: str) -> None:
|
|
49
|
-
"""When some error occurs the
|
|
49
|
+
"""When some error occurs the backend will send its error message here."""
|
|
50
50
|
# Structured boundary log (warning level). XML-RPC server received error notification.
|
|
51
51
|
try:
|
|
52
52
|
raise RuntimeError(str(msg))
|
|
@@ -67,13 +67,13 @@ class RPCFunctions:
|
|
|
67
67
|
)
|
|
68
68
|
|
|
69
69
|
def listDevices(self, interface_id: str) -> list[dict[str, Any]]:
|
|
70
|
-
"""Return already existing devices to
|
|
70
|
+
"""Return already existing devices to the backend."""
|
|
71
71
|
if central := self.get_central(interface_id):
|
|
72
72
|
return [dict(device_description) for device_description in central.list_devices(interface_id=interface_id)]
|
|
73
73
|
return []
|
|
74
74
|
|
|
75
75
|
def newDevices(self, interface_id: str, device_descriptions: list[dict[str, Any]]) -> None:
|
|
76
|
-
"""Add new devices send from backend."""
|
|
76
|
+
"""Add new devices send from the backend."""
|
|
77
77
|
central: hmcu.CentralUnit | None
|
|
78
78
|
if central := self.get_central(interface_id):
|
|
79
79
|
central.looper.create_task(
|
|
@@ -82,7 +82,7 @@ class RPCFunctions:
|
|
|
82
82
|
)
|
|
83
83
|
|
|
84
84
|
def deleteDevices(self, interface_id: str, addresses: list[str]) -> None:
|
|
85
|
-
"""Delete devices send from backend."""
|
|
85
|
+
"""Delete devices send from the backend."""
|
|
86
86
|
central: hmcu.CentralUnit | None
|
|
87
87
|
if central := self.get_central(interface_id):
|
|
88
88
|
central.looper.create_task(
|
|
@@ -118,7 +118,7 @@ class RPCFunctions:
|
|
|
118
118
|
@callback_backend_system(system_event=BackendSystemEvent.RE_ADDED_DEVICE)
|
|
119
119
|
def readdedDevice(self, interface_id: str, addresses: list[str]) -> None:
|
|
120
120
|
"""
|
|
121
|
-
Re-Add device from backend.
|
|
121
|
+
Re-Add device from the backend.
|
|
122
122
|
|
|
123
123
|
Probably irrelevant for us.
|
|
124
124
|
Gets called when a known devices is put into learn-mode
|
|
@@ -160,17 +160,12 @@ class AioHomematicXMLRPCServer(SimpleXMLRPCServer):
|
|
|
160
160
|
"""
|
|
161
161
|
|
|
162
162
|
def system_listMethods(self, interface_id: str | None = None) -> list[str]:
|
|
163
|
-
"""
|
|
164
|
-
Return a list of the methods supported by the server.
|
|
165
|
-
|
|
166
|
-
system.listMethods() => ['add', 'subtract', 'multiple']
|
|
167
|
-
Required for HomeMatic CCU usage.
|
|
168
|
-
"""
|
|
163
|
+
"""Return a list of the methods supported by the server."""
|
|
169
164
|
return SimpleXMLRPCServer.system_listMethods(self)
|
|
170
165
|
|
|
171
166
|
|
|
172
167
|
class XmlRpcServer(threading.Thread):
|
|
173
|
-
"""XML-RPC server thread to handle messages from
|
|
168
|
+
"""XML-RPC server thread to handle messages from the backend."""
|
|
174
169
|
|
|
175
170
|
_initialized: bool = False
|
|
176
171
|
_instances: Final[dict[tuple[str, int], XmlRpcServer]] = {}
|
aiohomematic/client/__init__.py
CHANGED
|
@@ -248,7 +248,7 @@ class Client(ABC, LogContextMixin):
|
|
|
248
248
|
return self.interface in INTERFACES_SUPPORTING_FIRMWARE_UPDATES
|
|
249
249
|
|
|
250
250
|
async def initialize_proxy(self) -> ProxyInitState:
|
|
251
|
-
"""Init the proxy has to tell the
|
|
251
|
+
"""Init the proxy has to tell the backend where to send the events."""
|
|
252
252
|
|
|
253
253
|
if not self.supports_xml_rpc:
|
|
254
254
|
if device_descriptions := await self.list_devices():
|
|
@@ -277,7 +277,7 @@ class Client(ABC, LogContextMixin):
|
|
|
277
277
|
return ProxyInitState.INIT_SUCCESS
|
|
278
278
|
|
|
279
279
|
async def deinitialize_proxy(self) -> ProxyInitState:
|
|
280
|
-
"""De-init to stop
|
|
280
|
+
"""De-init to stop the backend from sending events for this remote."""
|
|
281
281
|
if not self.supports_xml_rpc:
|
|
282
282
|
return ProxyInitState.DE_INIT_SUCCESS
|
|
283
283
|
|
|
@@ -356,12 +356,12 @@ class Client(ABC, LogContextMixin):
|
|
|
356
356
|
@abstractmethod
|
|
357
357
|
@inspector(re_raise=False, measure_performance=True)
|
|
358
358
|
async def fetch_all_device_data(self) -> None:
|
|
359
|
-
"""Fetch all device data from
|
|
359
|
+
"""Fetch all device data from the backend."""
|
|
360
360
|
|
|
361
361
|
@abstractmethod
|
|
362
362
|
@inspector(re_raise=False, measure_performance=True)
|
|
363
363
|
async def fetch_device_details(self) -> None:
|
|
364
|
-
"""Fetch names from backend."""
|
|
364
|
+
"""Fetch names from the backend."""
|
|
365
365
|
|
|
366
366
|
@inspector(re_raise=False, no_raise_return=False)
|
|
367
367
|
async def is_connected(self) -> bool:
|
|
@@ -420,39 +420,39 @@ class Client(ABC, LogContextMixin):
|
|
|
420
420
|
@abstractmethod
|
|
421
421
|
@inspector(re_raise=False, no_raise_return=False)
|
|
422
422
|
async def check_connection_availability(self, handle_ping_pong: bool) -> bool:
|
|
423
|
-
"""Send ping to
|
|
423
|
+
"""Send ping to the backend to generate PONG event."""
|
|
424
424
|
|
|
425
425
|
@abstractmethod
|
|
426
426
|
@inspector
|
|
427
427
|
async def execute_program(self, pid: str) -> bool:
|
|
428
|
-
"""Execute a program on
|
|
428
|
+
"""Execute a program on the backend."""
|
|
429
429
|
|
|
430
430
|
@abstractmethod
|
|
431
431
|
@inspector
|
|
432
432
|
async def set_program_state(self, pid: str, state: bool) -> bool:
|
|
433
|
-
"""Set the program state on
|
|
433
|
+
"""Set the program state on the backend."""
|
|
434
434
|
|
|
435
435
|
@abstractmethod
|
|
436
436
|
@inspector(measure_performance=True)
|
|
437
437
|
async def set_system_variable(self, legacy_name: str, value: Any) -> bool:
|
|
438
|
-
"""Set a system variable on
|
|
438
|
+
"""Set a system variable on the backend."""
|
|
439
439
|
|
|
440
440
|
@abstractmethod
|
|
441
441
|
@inspector
|
|
442
442
|
async def delete_system_variable(self, name: str) -> bool:
|
|
443
|
-
"""Delete a system variable from
|
|
443
|
+
"""Delete a system variable from the backend."""
|
|
444
444
|
|
|
445
445
|
@abstractmethod
|
|
446
446
|
@inspector
|
|
447
447
|
async def get_system_variable(self, name: str) -> Any:
|
|
448
|
-
"""Get single system variable from
|
|
448
|
+
"""Get single system variable from the backend."""
|
|
449
449
|
|
|
450
450
|
@abstractmethod
|
|
451
451
|
@inspector(re_raise=False)
|
|
452
452
|
async def get_all_system_variables(
|
|
453
453
|
self, markers: tuple[DescriptionMarker | str, ...]
|
|
454
454
|
) -> tuple[SystemVariableData, ...] | None:
|
|
455
|
-
"""Get all system variables from
|
|
455
|
+
"""Get all system variables from the backend."""
|
|
456
456
|
|
|
457
457
|
@abstractmethod
|
|
458
458
|
@inspector(re_raise=False)
|
|
@@ -483,7 +483,7 @@ class Client(ABC, LogContextMixin):
|
|
|
483
483
|
|
|
484
484
|
@inspector(re_raise=False)
|
|
485
485
|
async def get_device_description(self, device_address: str) -> DeviceDescription | None:
|
|
486
|
-
"""Get device descriptions from
|
|
486
|
+
"""Get device descriptions from the backend."""
|
|
487
487
|
try:
|
|
488
488
|
if device_description := cast(
|
|
489
489
|
DeviceDescription | None,
|
|
@@ -560,7 +560,7 @@ class Client(ABC, LogContextMixin):
|
|
|
560
560
|
parameter: str,
|
|
561
561
|
call_source: CallSource = CallSource.MANUAL_OR_SCHEDULED,
|
|
562
562
|
) -> Any:
|
|
563
|
-
"""Return a value from
|
|
563
|
+
"""Return a value from the backend."""
|
|
564
564
|
try:
|
|
565
565
|
_LOGGER.debug(
|
|
566
566
|
"GET_VALUE: channel_address %s, parameter %s, paramset_key, %s, source:%s",
|
|
@@ -707,7 +707,7 @@ class Client(ABC, LogContextMixin):
|
|
|
707
707
|
call_source: CallSource = CallSource.MANUAL_OR_SCHEDULED,
|
|
708
708
|
) -> dict[str, Any]:
|
|
709
709
|
"""
|
|
710
|
-
Return a paramset from
|
|
710
|
+
Return a paramset from the backend.
|
|
711
711
|
|
|
712
712
|
Address is usually the channel_address,
|
|
713
713
|
but for bidcos devices there is a master paramset at the device.
|
|
@@ -835,7 +835,7 @@ class Client(ABC, LogContextMixin):
|
|
|
835
835
|
values: dict[str, Any],
|
|
836
836
|
rx_mode: CommandRxMode | None = None,
|
|
837
837
|
) -> None:
|
|
838
|
-
"""Put paramset into
|
|
838
|
+
"""Put paramset into the backend."""
|
|
839
839
|
if rx_mode:
|
|
840
840
|
await self._proxy.putParamset(channel_address, paramset_key, values, rx_mode)
|
|
841
841
|
else:
|
|
@@ -946,7 +946,7 @@ class Client(ABC, LogContextMixin):
|
|
|
946
946
|
async def _get_paramset_description(
|
|
947
947
|
self, address: str, paramset_key: ParamsetKey
|
|
948
948
|
) -> dict[str, ParameterData] | None:
|
|
949
|
-
"""Get paramset description from
|
|
949
|
+
"""Get paramset description from the backend."""
|
|
950
950
|
try:
|
|
951
951
|
return cast(
|
|
952
952
|
dict[str, ParameterData],
|
|
@@ -979,7 +979,7 @@ class Client(ABC, LogContextMixin):
|
|
|
979
979
|
|
|
980
980
|
@inspector(re_raise=False, measure_performance=True)
|
|
981
981
|
async def list_devices(self) -> tuple[DeviceDescription, ...] | None:
|
|
982
|
-
"""List devices of
|
|
982
|
+
"""List devices of the backend."""
|
|
983
983
|
try:
|
|
984
984
|
return tuple(await self._proxy_read.listDevices())
|
|
985
985
|
except BaseHomematicException as bhexc:
|
|
@@ -1089,7 +1089,7 @@ class ClientCCU(Client):
|
|
|
1089
1089
|
|
|
1090
1090
|
@inspector(re_raise=False, measure_performance=True)
|
|
1091
1091
|
async def fetch_all_device_data(self) -> None:
|
|
1092
|
-
"""Fetch all device data from
|
|
1092
|
+
"""Fetch all device data from the backend."""
|
|
1093
1093
|
try:
|
|
1094
1094
|
if all_device_data := await self._json_rpc_client.get_all_device_data(interface=self.interface):
|
|
1095
1095
|
_LOGGER.debug(
|
|
@@ -1140,12 +1140,12 @@ class ClientCCU(Client):
|
|
|
1140
1140
|
|
|
1141
1141
|
@inspector
|
|
1142
1142
|
async def execute_program(self, pid: str) -> bool:
|
|
1143
|
-
"""Execute a program on
|
|
1143
|
+
"""Execute a program on the backend."""
|
|
1144
1144
|
return await self._json_rpc_client.execute_program(pid=pid)
|
|
1145
1145
|
|
|
1146
1146
|
@inspector
|
|
1147
1147
|
async def set_program_state(self, pid: str, state: bool) -> bool:
|
|
1148
|
-
"""Set the program state on
|
|
1148
|
+
"""Set the program state on the backend."""
|
|
1149
1149
|
return await self._json_rpc_client.set_program_state(pid=pid, state=state)
|
|
1150
1150
|
|
|
1151
1151
|
@inspector
|
|
@@ -1165,24 +1165,24 @@ class ClientCCU(Client):
|
|
|
1165
1165
|
|
|
1166
1166
|
@inspector(measure_performance=True)
|
|
1167
1167
|
async def set_system_variable(self, legacy_name: str, value: Any) -> bool:
|
|
1168
|
-
"""Set a system variable on
|
|
1168
|
+
"""Set a system variable on the backend."""
|
|
1169
1169
|
return await self._json_rpc_client.set_system_variable(legacy_name=legacy_name, value=value)
|
|
1170
1170
|
|
|
1171
1171
|
@inspector
|
|
1172
1172
|
async def delete_system_variable(self, name: str) -> bool:
|
|
1173
|
-
"""Delete a system variable from
|
|
1173
|
+
"""Delete a system variable from the backend."""
|
|
1174
1174
|
return await self._json_rpc_client.delete_system_variable(name=name)
|
|
1175
1175
|
|
|
1176
1176
|
@inspector
|
|
1177
1177
|
async def get_system_variable(self, name: str) -> Any:
|
|
1178
|
-
"""Get single system variable from
|
|
1178
|
+
"""Get single system variable from the backend."""
|
|
1179
1179
|
return await self._json_rpc_client.get_system_variable(name=name)
|
|
1180
1180
|
|
|
1181
1181
|
@inspector(re_raise=False)
|
|
1182
1182
|
async def get_all_system_variables(
|
|
1183
1183
|
self, markers: tuple[DescriptionMarker | str, ...]
|
|
1184
1184
|
) -> tuple[SystemVariableData, ...] | None:
|
|
1185
|
-
"""Get all system variables from
|
|
1185
|
+
"""Get all system variables from the backend."""
|
|
1186
1186
|
return await self._json_rpc_client.get_all_system_variables(markers=markers)
|
|
1187
1187
|
|
|
1188
1188
|
@inspector(re_raise=False)
|
|
@@ -1192,7 +1192,7 @@ class ClientCCU(Client):
|
|
|
1192
1192
|
|
|
1193
1193
|
@inspector(re_raise=False, no_raise_return={})
|
|
1194
1194
|
async def get_all_rooms(self) -> dict[str, set[str]]:
|
|
1195
|
-
"""Get all rooms from
|
|
1195
|
+
"""Get all rooms from the backend."""
|
|
1196
1196
|
rooms: dict[str, set[str]] = {}
|
|
1197
1197
|
channel_ids_room = await self._json_rpc_client.get_all_channel_ids_room()
|
|
1198
1198
|
for address, channel_id in self.central.device_details.device_channel_ids.items():
|
|
@@ -1204,7 +1204,7 @@ class ClientCCU(Client):
|
|
|
1204
1204
|
|
|
1205
1205
|
@inspector(re_raise=False, no_raise_return={})
|
|
1206
1206
|
async def get_all_functions(self) -> dict[str, set[str]]:
|
|
1207
|
-
"""Get all functions from
|
|
1207
|
+
"""Get all functions from the backend."""
|
|
1208
1208
|
functions: dict[str, set[str]] = {}
|
|
1209
1209
|
channel_ids_function = await self._json_rpc_client.get_all_channel_ids_function()
|
|
1210
1210
|
for address, channel_id in self.central.device_details.device_channel_ids.items():
|
|
@@ -1220,7 +1220,7 @@ class ClientCCU(Client):
|
|
|
1220
1220
|
|
|
1221
1221
|
|
|
1222
1222
|
class ClientJsonCCU(ClientCCU):
|
|
1223
|
-
"""Client implementation for CCU backend."""
|
|
1223
|
+
"""Client implementation for CCU-like backend (CCU-Jack, CuXD)."""
|
|
1224
1224
|
|
|
1225
1225
|
@inspector
|
|
1226
1226
|
async def init_client(self) -> None:
|
|
@@ -1239,7 +1239,7 @@ class ClientJsonCCU(ClientCCU):
|
|
|
1239
1239
|
|
|
1240
1240
|
@inspector(re_raise=False)
|
|
1241
1241
|
async def get_device_description(self, device_address: str) -> DeviceDescription | None:
|
|
1242
|
-
"""Get device descriptions from
|
|
1242
|
+
"""Get device descriptions from the backend."""
|
|
1243
1243
|
try:
|
|
1244
1244
|
if device_description := await self._json_rpc_client.get_device_description(
|
|
1245
1245
|
interface=self.interface, address=device_address
|
|
@@ -1257,7 +1257,7 @@ class ClientJsonCCU(ClientCCU):
|
|
|
1257
1257
|
call_source: CallSource = CallSource.MANUAL_OR_SCHEDULED,
|
|
1258
1258
|
) -> dict[str, Any]:
|
|
1259
1259
|
"""
|
|
1260
|
-
Return a paramset from
|
|
1260
|
+
Return a paramset from the backend.
|
|
1261
1261
|
|
|
1262
1262
|
Address is usually the channel_address,
|
|
1263
1263
|
but for bidcos devices there is a master paramset at the device.
|
|
@@ -1288,7 +1288,7 @@ class ClientJsonCCU(ClientCCU):
|
|
|
1288
1288
|
parameter: str,
|
|
1289
1289
|
call_source: CallSource = CallSource.MANUAL_OR_SCHEDULED,
|
|
1290
1290
|
) -> Any:
|
|
1291
|
-
"""Return a value from
|
|
1291
|
+
"""Return a value from the backend."""
|
|
1292
1292
|
try:
|
|
1293
1293
|
_LOGGER.debug(
|
|
1294
1294
|
"GET_VALUE: channel_address %s, parameter %s, paramset_key, %s, source:%s",
|
|
@@ -1334,7 +1334,7 @@ class ClientJsonCCU(ClientCCU):
|
|
|
1334
1334
|
async def _get_paramset_description(
|
|
1335
1335
|
self, address: str, paramset_key: ParamsetKey
|
|
1336
1336
|
) -> dict[str, ParameterData] | None:
|
|
1337
|
-
"""Get paramset description from
|
|
1337
|
+
"""Get paramset description from the backend."""
|
|
1338
1338
|
try:
|
|
1339
1339
|
return cast(
|
|
1340
1340
|
dict[str, ParameterData],
|
|
@@ -1359,7 +1359,7 @@ class ClientJsonCCU(ClientCCU):
|
|
|
1359
1359
|
values: dict[str, Any],
|
|
1360
1360
|
rx_mode: CommandRxMode | None = None,
|
|
1361
1361
|
) -> None:
|
|
1362
|
-
"""Put paramset into
|
|
1362
|
+
"""Put paramset into the backend."""
|
|
1363
1363
|
# _values: list[dict[str, Any]] = []
|
|
1364
1364
|
for parameter, value in values.items():
|
|
1365
1365
|
await self._exec_set_value(
|
|
@@ -1441,7 +1441,7 @@ class ClientHomegear(Client):
|
|
|
1441
1441
|
|
|
1442
1442
|
@inspector(re_raise=False)
|
|
1443
1443
|
async def fetch_all_device_data(self) -> None:
|
|
1444
|
-
"""Fetch all device data from
|
|
1444
|
+
"""Fetch all device data from the backend."""
|
|
1445
1445
|
return
|
|
1446
1446
|
|
|
1447
1447
|
@inspector(re_raise=False, measure_performance=True)
|
|
@@ -1481,36 +1481,36 @@ class ClientHomegear(Client):
|
|
|
1481
1481
|
|
|
1482
1482
|
@inspector
|
|
1483
1483
|
async def execute_program(self, pid: str) -> bool:
|
|
1484
|
-
"""Execute a program on
|
|
1484
|
+
"""Execute a program on the backend."""
|
|
1485
1485
|
return True
|
|
1486
1486
|
|
|
1487
1487
|
@inspector
|
|
1488
1488
|
async def set_program_state(self, pid: str, state: bool) -> bool:
|
|
1489
|
-
"""Set the program state on
|
|
1489
|
+
"""Set the program state on the backend."""
|
|
1490
1490
|
return True
|
|
1491
1491
|
|
|
1492
1492
|
@inspector(measure_performance=True)
|
|
1493
1493
|
async def set_system_variable(self, legacy_name: str, value: Any) -> bool:
|
|
1494
|
-
"""Set a system variable on
|
|
1494
|
+
"""Set a system variable on the backend."""
|
|
1495
1495
|
await self._proxy.setSystemVariable(legacy_name, value)
|
|
1496
1496
|
return True
|
|
1497
1497
|
|
|
1498
1498
|
@inspector
|
|
1499
1499
|
async def delete_system_variable(self, name: str) -> bool:
|
|
1500
|
-
"""Delete a system variable from
|
|
1500
|
+
"""Delete a system variable from the backend."""
|
|
1501
1501
|
await self._proxy.deleteSystemVariable(name)
|
|
1502
1502
|
return True
|
|
1503
1503
|
|
|
1504
1504
|
@inspector
|
|
1505
1505
|
async def get_system_variable(self, name: str) -> Any:
|
|
1506
|
-
"""Get single system variable from
|
|
1506
|
+
"""Get single system variable from the backend."""
|
|
1507
1507
|
return await self._proxy.getSystemVariable(name)
|
|
1508
1508
|
|
|
1509
1509
|
@inspector(re_raise=False)
|
|
1510
1510
|
async def get_all_system_variables(
|
|
1511
1511
|
self, markers: tuple[DescriptionMarker | str, ...]
|
|
1512
1512
|
) -> tuple[SystemVariableData, ...] | None:
|
|
1513
|
-
"""Get all system variables from
|
|
1513
|
+
"""Get all system variables from the backend."""
|
|
1514
1514
|
variables: list[SystemVariableData] = []
|
|
1515
1515
|
if hg_variables := await self._proxy.getAllSystemVariables():
|
|
1516
1516
|
for name, value in hg_variables.items():
|
|
@@ -1524,12 +1524,12 @@ class ClientHomegear(Client):
|
|
|
1524
1524
|
|
|
1525
1525
|
@inspector(re_raise=False, no_raise_return={})
|
|
1526
1526
|
async def get_all_rooms(self) -> dict[str, set[str]]:
|
|
1527
|
-
"""Get all rooms from
|
|
1527
|
+
"""Get all rooms from the backend."""
|
|
1528
1528
|
return {}
|
|
1529
1529
|
|
|
1530
1530
|
@inspector(re_raise=False, no_raise_return={})
|
|
1531
1531
|
async def get_all_functions(self) -> dict[str, set[str]]:
|
|
1532
|
-
"""Get all functions from
|
|
1532
|
+
"""Get all functions from the backend."""
|
|
1533
1533
|
return {}
|
|
1534
1534
|
|
|
1535
1535
|
async def _get_system_information(self) -> SystemInformation:
|
|
@@ -1586,7 +1586,7 @@ class _ClientConfig:
|
|
|
1586
1586
|
raise NoConnectionException(f"Unable to connect {extract_exc_args(exc=exc)}.") from exc
|
|
1587
1587
|
|
|
1588
1588
|
async def _get_version(self) -> str:
|
|
1589
|
-
"""Return the version of the backend."""
|
|
1589
|
+
"""Return the version of the the backend."""
|
|
1590
1590
|
if self.interface in (Interface.CCU_JACK, Interface.CUXD):
|
|
1591
1591
|
return "0"
|
|
1592
1592
|
check_proxy = await self._create_simple_xml_rpc_proxy()
|
|
@@ -1601,7 +1601,7 @@ class _ClientConfig:
|
|
|
1601
1601
|
async def create_xml_rpc_proxy(
|
|
1602
1602
|
self, auth_enabled: bool | None = None, max_workers: int = DEFAULT_MAX_WORKERS
|
|
1603
1603
|
) -> XmlRpcProxy:
|
|
1604
|
-
"""Return a XmlRPC proxy for backend communication."""
|
|
1604
|
+
"""Return a XmlRPC proxy for the backend communication."""
|
|
1605
1605
|
config = self.central.config
|
|
1606
1606
|
xml_rpc_headers = (
|
|
1607
1607
|
build_xml_rpc_headers(
|
|
@@ -1624,7 +1624,7 @@ class _ClientConfig:
|
|
|
1624
1624
|
return xml_proxy
|
|
1625
1625
|
|
|
1626
1626
|
async def _create_simple_xml_rpc_proxy(self) -> XmlRpcProxy:
|
|
1627
|
-
"""Return a XmlRPC proxy for backend communication."""
|
|
1627
|
+
"""Return a XmlRPC proxy for the backend communication."""
|
|
1628
1628
|
return await self.create_xml_rpc_proxy(auth_enabled=True, max_workers=0)
|
|
1629
1629
|
|
|
1630
1630
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"""
|
|
4
4
|
Error mapping helpers for RPC transports.
|
|
5
5
|
|
|
6
|
-
This module centralizes small, transport-agnostic utilities to turn backend
|
|
6
|
+
This module centralizes small, transport-agnostic utilities to turn the backend
|
|
7
7
|
errors into domain-specific exceptions with useful context. It is used by both
|
|
8
8
|
JSON-RPC and XML-RPC clients.
|
|
9
9
|
|