aiohomematic 2026.1.29__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.
Files changed (188) hide show
  1. aiohomematic/__init__.py +110 -0
  2. aiohomematic/_log_context_protocol.py +29 -0
  3. aiohomematic/api.py +410 -0
  4. aiohomematic/async_support.py +250 -0
  5. aiohomematic/backend_detection.py +462 -0
  6. aiohomematic/central/__init__.py +103 -0
  7. aiohomematic/central/async_rpc_server.py +760 -0
  8. aiohomematic/central/central_unit.py +1152 -0
  9. aiohomematic/central/config.py +463 -0
  10. aiohomematic/central/config_builder.py +772 -0
  11. aiohomematic/central/connection_state.py +160 -0
  12. aiohomematic/central/coordinators/__init__.py +38 -0
  13. aiohomematic/central/coordinators/cache.py +414 -0
  14. aiohomematic/central/coordinators/client.py +480 -0
  15. aiohomematic/central/coordinators/connection_recovery.py +1141 -0
  16. aiohomematic/central/coordinators/device.py +1166 -0
  17. aiohomematic/central/coordinators/event.py +514 -0
  18. aiohomematic/central/coordinators/hub.py +532 -0
  19. aiohomematic/central/decorators.py +184 -0
  20. aiohomematic/central/device_registry.py +229 -0
  21. aiohomematic/central/events/__init__.py +104 -0
  22. aiohomematic/central/events/bus.py +1392 -0
  23. aiohomematic/central/events/integration.py +424 -0
  24. aiohomematic/central/events/types.py +194 -0
  25. aiohomematic/central/health.py +762 -0
  26. aiohomematic/central/rpc_server.py +353 -0
  27. aiohomematic/central/scheduler.py +794 -0
  28. aiohomematic/central/state_machine.py +391 -0
  29. aiohomematic/client/__init__.py +203 -0
  30. aiohomematic/client/_rpc_errors.py +187 -0
  31. aiohomematic/client/backends/__init__.py +48 -0
  32. aiohomematic/client/backends/base.py +335 -0
  33. aiohomematic/client/backends/capabilities.py +138 -0
  34. aiohomematic/client/backends/ccu.py +487 -0
  35. aiohomematic/client/backends/factory.py +116 -0
  36. aiohomematic/client/backends/homegear.py +294 -0
  37. aiohomematic/client/backends/json_ccu.py +252 -0
  38. aiohomematic/client/backends/protocol.py +316 -0
  39. aiohomematic/client/ccu.py +1857 -0
  40. aiohomematic/client/circuit_breaker.py +459 -0
  41. aiohomematic/client/config.py +64 -0
  42. aiohomematic/client/handlers/__init__.py +40 -0
  43. aiohomematic/client/handlers/backup.py +157 -0
  44. aiohomematic/client/handlers/base.py +79 -0
  45. aiohomematic/client/handlers/device_ops.py +1085 -0
  46. aiohomematic/client/handlers/firmware.py +144 -0
  47. aiohomematic/client/handlers/link_mgmt.py +199 -0
  48. aiohomematic/client/handlers/metadata.py +436 -0
  49. aiohomematic/client/handlers/programs.py +144 -0
  50. aiohomematic/client/handlers/sysvars.py +100 -0
  51. aiohomematic/client/interface_client.py +1304 -0
  52. aiohomematic/client/json_rpc.py +2068 -0
  53. aiohomematic/client/request_coalescer.py +282 -0
  54. aiohomematic/client/rpc_proxy.py +629 -0
  55. aiohomematic/client/state_machine.py +324 -0
  56. aiohomematic/const.py +2207 -0
  57. aiohomematic/context.py +275 -0
  58. aiohomematic/converter.py +270 -0
  59. aiohomematic/decorators.py +390 -0
  60. aiohomematic/exceptions.py +185 -0
  61. aiohomematic/hmcli.py +997 -0
  62. aiohomematic/i18n.py +193 -0
  63. aiohomematic/interfaces/__init__.py +407 -0
  64. aiohomematic/interfaces/central.py +1067 -0
  65. aiohomematic/interfaces/client.py +1096 -0
  66. aiohomematic/interfaces/coordinators.py +63 -0
  67. aiohomematic/interfaces/model.py +1921 -0
  68. aiohomematic/interfaces/operations.py +217 -0
  69. aiohomematic/logging_context.py +134 -0
  70. aiohomematic/metrics/__init__.py +125 -0
  71. aiohomematic/metrics/_protocols.py +140 -0
  72. aiohomematic/metrics/aggregator.py +534 -0
  73. aiohomematic/metrics/dataclasses.py +489 -0
  74. aiohomematic/metrics/emitter.py +292 -0
  75. aiohomematic/metrics/events.py +183 -0
  76. aiohomematic/metrics/keys.py +300 -0
  77. aiohomematic/metrics/observer.py +563 -0
  78. aiohomematic/metrics/stats.py +172 -0
  79. aiohomematic/model/__init__.py +189 -0
  80. aiohomematic/model/availability.py +65 -0
  81. aiohomematic/model/calculated/__init__.py +89 -0
  82. aiohomematic/model/calculated/climate.py +276 -0
  83. aiohomematic/model/calculated/data_point.py +315 -0
  84. aiohomematic/model/calculated/field.py +147 -0
  85. aiohomematic/model/calculated/operating_voltage_level.py +286 -0
  86. aiohomematic/model/calculated/support.py +232 -0
  87. aiohomematic/model/custom/__init__.py +214 -0
  88. aiohomematic/model/custom/capabilities/__init__.py +67 -0
  89. aiohomematic/model/custom/capabilities/climate.py +41 -0
  90. aiohomematic/model/custom/capabilities/light.py +87 -0
  91. aiohomematic/model/custom/capabilities/lock.py +44 -0
  92. aiohomematic/model/custom/capabilities/siren.py +63 -0
  93. aiohomematic/model/custom/climate.py +1130 -0
  94. aiohomematic/model/custom/cover.py +722 -0
  95. aiohomematic/model/custom/data_point.py +360 -0
  96. aiohomematic/model/custom/definition.py +300 -0
  97. aiohomematic/model/custom/field.py +89 -0
  98. aiohomematic/model/custom/light.py +1174 -0
  99. aiohomematic/model/custom/lock.py +322 -0
  100. aiohomematic/model/custom/mixins.py +445 -0
  101. aiohomematic/model/custom/profile.py +945 -0
  102. aiohomematic/model/custom/registry.py +251 -0
  103. aiohomematic/model/custom/siren.py +462 -0
  104. aiohomematic/model/custom/switch.py +195 -0
  105. aiohomematic/model/custom/text_display.py +289 -0
  106. aiohomematic/model/custom/valve.py +78 -0
  107. aiohomematic/model/data_point.py +1416 -0
  108. aiohomematic/model/device.py +1840 -0
  109. aiohomematic/model/event.py +216 -0
  110. aiohomematic/model/generic/__init__.py +327 -0
  111. aiohomematic/model/generic/action.py +40 -0
  112. aiohomematic/model/generic/action_select.py +62 -0
  113. aiohomematic/model/generic/binary_sensor.py +30 -0
  114. aiohomematic/model/generic/button.py +31 -0
  115. aiohomematic/model/generic/data_point.py +177 -0
  116. aiohomematic/model/generic/dummy.py +150 -0
  117. aiohomematic/model/generic/number.py +76 -0
  118. aiohomematic/model/generic/select.py +56 -0
  119. aiohomematic/model/generic/sensor.py +76 -0
  120. aiohomematic/model/generic/switch.py +54 -0
  121. aiohomematic/model/generic/text.py +33 -0
  122. aiohomematic/model/hub/__init__.py +100 -0
  123. aiohomematic/model/hub/binary_sensor.py +24 -0
  124. aiohomematic/model/hub/button.py +28 -0
  125. aiohomematic/model/hub/connectivity.py +190 -0
  126. aiohomematic/model/hub/data_point.py +342 -0
  127. aiohomematic/model/hub/hub.py +864 -0
  128. aiohomematic/model/hub/inbox.py +135 -0
  129. aiohomematic/model/hub/install_mode.py +393 -0
  130. aiohomematic/model/hub/metrics.py +208 -0
  131. aiohomematic/model/hub/number.py +42 -0
  132. aiohomematic/model/hub/select.py +52 -0
  133. aiohomematic/model/hub/sensor.py +37 -0
  134. aiohomematic/model/hub/switch.py +43 -0
  135. aiohomematic/model/hub/text.py +30 -0
  136. aiohomematic/model/hub/update.py +221 -0
  137. aiohomematic/model/support.py +592 -0
  138. aiohomematic/model/update.py +140 -0
  139. aiohomematic/model/week_profile.py +1827 -0
  140. aiohomematic/property_decorators.py +719 -0
  141. aiohomematic/py.typed +0 -0
  142. aiohomematic/rega_scripts/accept_device_in_inbox.fn +51 -0
  143. aiohomematic/rega_scripts/create_backup_start.fn +28 -0
  144. aiohomematic/rega_scripts/create_backup_status.fn +89 -0
  145. aiohomematic/rega_scripts/fetch_all_device_data.fn +97 -0
  146. aiohomematic/rega_scripts/get_backend_info.fn +25 -0
  147. aiohomematic/rega_scripts/get_inbox_devices.fn +61 -0
  148. aiohomematic/rega_scripts/get_program_descriptions.fn +31 -0
  149. aiohomematic/rega_scripts/get_serial.fn +44 -0
  150. aiohomematic/rega_scripts/get_service_messages.fn +83 -0
  151. aiohomematic/rega_scripts/get_system_update_info.fn +39 -0
  152. aiohomematic/rega_scripts/get_system_variable_descriptions.fn +31 -0
  153. aiohomematic/rega_scripts/set_program_state.fn +17 -0
  154. aiohomematic/rega_scripts/set_system_variable.fn +19 -0
  155. aiohomematic/rega_scripts/trigger_firmware_update.fn +67 -0
  156. aiohomematic/schemas.py +256 -0
  157. aiohomematic/store/__init__.py +55 -0
  158. aiohomematic/store/dynamic/__init__.py +43 -0
  159. aiohomematic/store/dynamic/command.py +250 -0
  160. aiohomematic/store/dynamic/data.py +175 -0
  161. aiohomematic/store/dynamic/details.py +187 -0
  162. aiohomematic/store/dynamic/ping_pong.py +416 -0
  163. aiohomematic/store/persistent/__init__.py +71 -0
  164. aiohomematic/store/persistent/base.py +285 -0
  165. aiohomematic/store/persistent/device.py +233 -0
  166. aiohomematic/store/persistent/incident.py +380 -0
  167. aiohomematic/store/persistent/paramset.py +241 -0
  168. aiohomematic/store/persistent/session.py +556 -0
  169. aiohomematic/store/serialization.py +150 -0
  170. aiohomematic/store/storage.py +689 -0
  171. aiohomematic/store/types.py +526 -0
  172. aiohomematic/store/visibility/__init__.py +40 -0
  173. aiohomematic/store/visibility/parser.py +141 -0
  174. aiohomematic/store/visibility/registry.py +722 -0
  175. aiohomematic/store/visibility/rules.py +307 -0
  176. aiohomematic/strings.json +237 -0
  177. aiohomematic/support.py +706 -0
  178. aiohomematic/tracing.py +236 -0
  179. aiohomematic/translations/de.json +237 -0
  180. aiohomematic/translations/en.json +237 -0
  181. aiohomematic/type_aliases.py +51 -0
  182. aiohomematic/validator.py +128 -0
  183. aiohomematic-2026.1.29.dist-info/METADATA +296 -0
  184. aiohomematic-2026.1.29.dist-info/RECORD +188 -0
  185. aiohomematic-2026.1.29.dist-info/WHEEL +5 -0
  186. aiohomematic-2026.1.29.dist-info/entry_points.txt +2 -0
  187. aiohomematic-2026.1.29.dist-info/licenses/LICENSE +21 -0
  188. aiohomematic-2026.1.29.dist-info/top_level.txt +1 -0
aiohomematic/i18n.py ADDED
@@ -0,0 +1,193 @@
1
+ # SPDX-License-Identifier: MIT
2
+ # Copyright (c) 2021-2026
3
+ """
4
+ Simple i18n helper to localize exceptions (first iteration).
5
+
6
+ Usage:
7
+ - Call set_locale("de") early (CentralUnit will do this from CentralConfig).
8
+ - Use tr("key", name="value") to render localized strings with Python str.format.
9
+
10
+ Lookup order:
11
+ 1) translations/<locale>.json
12
+ 2) strings.json (base) in package root `aiohomematic/`
13
+ 3) Fallback to the key itself
14
+ """
15
+
16
+ from __future__ import annotations
17
+
18
+ import asyncio
19
+ import logging
20
+ import pkgutil
21
+ from threading import RLock
22
+ from typing import Any, Final
23
+
24
+ import orjson
25
+
26
+ from aiohomematic.const import DEFAULT_LOCALE
27
+
28
+ _ACTIVE_CATALOG: dict[str, str] = {}
29
+ _ACTIVE_LOCALE: str = DEFAULT_LOCALE
30
+ _BASE_CACHE_LOADED: bool = False
31
+ _BASE_CATALOG: dict[str, str] = {}
32
+ _CACHE: dict[str, dict[str, str]] = {}
33
+ _CURRENT_LOCALE: str = DEFAULT_LOCALE
34
+ _LOCK: Final = RLock()
35
+ _TRANSLATIONS_PKG = "aiohomematic"
36
+
37
+ _LOGGER: Final = logging.getLogger(__name__)
38
+
39
+ # Eagerly load the base catalog at import time to avoid any later I/O on first use
40
+ # and to satisfy environments that prefer initialization-time loading.
41
+ try: # pragma: no cover - trivial import-time path
42
+ # This will load packaged resources via pkgutil without using builtins.open in our code.
43
+ # Protected by the lock to keep thread safety consistent.
44
+ def _eager_init_base() -> None:
45
+ if not _BASE_CACHE_LOADED:
46
+ _load_base_catalog()
47
+
48
+ _eager_init_base()
49
+ except Exception: # pragma: no cover - defensive
50
+ # If eager load fails for any reason, lazy load will occur on first access.
51
+ pass
52
+
53
+
54
+ class _SafeDict(dict[str, str]):
55
+ """Dict that leaves unknown placeholders untouched during format_map."""
56
+
57
+ def __missing__(self, k: str) -> str: # pragma: no cover - trivial # kwonly: disable
58
+ """Return the key as-is if not found in the dict."""
59
+ return "{" + k + "}"
60
+
61
+
62
+ def _load_json_resource(*, package: str, resource: str, in_translations: bool = True) -> dict[str, str]:
63
+ """
64
+ Load a JSON resource from the package. By default from `translations/` subdir.
65
+
66
+ Uses pkgutil.get_data to read packaged data (works in editable installs and wheels).
67
+ """
68
+ try:
69
+ resource_path = f"translations/{resource}" if in_translations else resource
70
+ if not (data_bytes := pkgutil.get_data(package=package, resource=resource_path)):
71
+ return {}
72
+ data = orjson.loads(data_bytes)
73
+ return {str(k): str(v) for k, v in data.items()}
74
+ except Exception as exc: # pragma: no cover - defensive
75
+ _LOGGER.debug("Failed to load translation resource %s/%s: %s", package, resource_path, exc)
76
+ return {}
77
+
78
+
79
+ def _load_base_catalog() -> None:
80
+ """Load the base catalog (strings.json) once."""
81
+ global _BASE_CACHE_LOADED, _BASE_CATALOG, _ACTIVE_CATALOG # noqa: PLW0603 # pylint: disable=global-statement
82
+ with _LOCK:
83
+ if _BASE_CACHE_LOADED:
84
+ return
85
+ _BASE_CATALOG = _load_json_resource(package=_TRANSLATIONS_PKG, resource="strings.json", in_translations=False)
86
+ # Initialize active catalog with whatever we have for the current locale (likely base on first import)
87
+ _ACTIVE_CATALOG = {**_BASE_CATALOG, **(_CACHE.get(_CURRENT_LOCALE) or {})}
88
+ _BASE_CACHE_LOADED = True
89
+
90
+
91
+ def _get_catalog(*, locale: str) -> dict[str, str]:
92
+ """Get the catalog for a locale as a plain dict (cached)."""
93
+ _load_base_catalog()
94
+ if locale in _CACHE:
95
+ return _CACHE[locale]
96
+ with _LOCK:
97
+ if locale in _CACHE:
98
+ return _CACHE[locale]
99
+ localized = _load_json_resource(package=_TRANSLATIONS_PKG, resource=f"{locale}.json")
100
+ # merge with base; localized should override base
101
+ merged: dict[str, str] = {**_BASE_CATALOG, **(localized or {})}
102
+ _CACHE[locale] = merged
103
+ # If this is the active locale, refresh the active catalog reference for fast-path lookups
104
+ if locale == _ACTIVE_LOCALE:
105
+ global _ACTIVE_CATALOG # noqa: PLW0603 # pylint: disable=global-statement
106
+ _ACTIVE_CATALOG = merged
107
+ return merged
108
+
109
+
110
+ def set_locale(*, locale: str | None = None) -> None:
111
+ """
112
+ Set the current locale used for translations.
113
+
114
+ None or empty -> defaults to "en".
115
+ Updates the active catalog reference immediately so subsequent `tr()` calls
116
+ reflect the new locale without requiring background preload.
117
+ """
118
+ global _CURRENT_LOCALE, _ACTIVE_LOCALE, _ACTIVE_CATALOG # noqa: PLW0603 # pylint: disable=global-statement
119
+ new_locale = (locale or DEFAULT_LOCALE).strip() or DEFAULT_LOCALE
120
+ # Ensure base is available
121
+ _load_base_catalog()
122
+ # Build or fetch the merged catalog synchronously (uses pkgutil.get_data under the hood)
123
+ merged = _get_catalog(locale=new_locale)
124
+ with _LOCK:
125
+ _CURRENT_LOCALE = new_locale
126
+ _ACTIVE_LOCALE = new_locale
127
+ _ACTIVE_CATALOG = merged
128
+
129
+
130
+ def get_locale() -> str:
131
+ """Return the currently active locale code (e.g. 'en', 'de')."""
132
+ return _CURRENT_LOCALE
133
+
134
+
135
+ def tr(*, key: str, **kwargs: Any) -> str:
136
+ """
137
+ Translate the given key using the active locale with Python str.format kwargs.
138
+
139
+ Fallback order: <locale>.json -> strings.json -> key.
140
+ Unknown placeholders are ignored (left as-is by format_map with default dict).
141
+ Optimized for the hot path: use an active-catalog reference and avoid formatting
142
+ when not needed.
143
+ """
144
+ # Fast path: read from active catalog without extra lookups/allocations
145
+ if (template := _ACTIVE_CATALOG.get(key)) is None:
146
+ # Fallback to base without additional loading (base is eager-loaded). We intentionally
147
+ # avoid synchronous resource loading on the hot path; locales should be preloaded.
148
+ template = _BASE_CATALOG.get(key, key)
149
+
150
+ # If no formatting arguments, or template has no placeholders, return as-is
151
+ if not kwargs or ("{" not in template):
152
+ return template
153
+
154
+ try:
155
+ safe_kwargs: dict[str, str] = {str(k): str(v) for k, v in kwargs.items()}
156
+ return template.format_map(_SafeDict(safe_kwargs))
157
+ except Exception: # pragma: no cover - keep robust against bad format strings
158
+ return template
159
+
160
+
161
+ async def preload_locale(*, locale: str) -> None:
162
+ """
163
+ Asynchronously preload and cache a locale catalog.
164
+
165
+ This avoids doing synchronous package resource loading in the event loop by offloading
166
+ the work to a thread via asyncio.to_thread. Safe to call multiple times; uses cache.
167
+ """
168
+ # Normalize locale like set_locale does
169
+ normalized = (locale or DEFAULT_LOCALE).strip() or DEFAULT_LOCALE
170
+
171
+ def _load_sync() -> None:
172
+ # Just call the normal loader which handles locking and caching
173
+ _get_catalog(locale=normalized)
174
+
175
+ # Offload synchronous resource loading to thread to avoid blocking the loop
176
+ await asyncio.to_thread(_load_sync)
177
+
178
+
179
+ def schedule_preload_locale(*, locale: str) -> asyncio.Task[None] | None:
180
+ """
181
+ Schedule a background task to preload a locale if an event loop is running.
182
+
183
+ If called when no loop is running, it will load synchronously and return None.
184
+ Returns the created Task when scheduled.
185
+ """
186
+ try:
187
+ loop = asyncio.get_running_loop()
188
+ except RuntimeError:
189
+ # no running loop; load synchronously
190
+ _get_catalog(locale=(locale or DEFAULT_LOCALE).strip() or DEFAULT_LOCALE)
191
+ return None
192
+
193
+ return loop.create_task(preload_locale(locale=locale))
@@ -0,0 +1,407 @@
1
+ # SPDX-License-Identifier: MIT
2
+ # Copyright (c) 2021-2026
3
+ """
4
+ Protocol interfaces for reducing CentralUnit coupling.
5
+
6
+ This package defines protocol interfaces that components can depend on
7
+ instead of directly depending on CentralUnit. This allows for:
8
+ - Better testability (mock implementations)
9
+ - Clearer dependencies (only expose what's needed)
10
+ - Reduced coupling (components don't access full CentralUnit API)
11
+
12
+ Protocol Categories
13
+ -------------------
14
+
15
+ **Identity & Configuration:**
16
+ Protocols providing system identification and configuration access.
17
+
18
+ - `CentralInfoProtocol`: Central system identification (name, model, version)
19
+ - `ConfigProviderProtocol`: Configuration access (config property)
20
+ - `SystemInfoProviderProtocol`: Backend system information
21
+ - `CentralUnitStateProviderProtocol`: Central unit lifecycle state
22
+
23
+ **Event System:**
24
+ Protocols for event publishing and subscription.
25
+
26
+ - `EventBusProviderProtocol`: Access to the central event bus
27
+ - `EventPublisherProtocol`: Publishing backend and Homematic events
28
+ - `EventSubscriptionManagerProtocol`: Managing event subscriptions
29
+ - `LastEventTrackerProtocol`: Tracking last event timestamps
30
+
31
+ **Cache Read (Providers):**
32
+ Protocols for reading cached data. Follow naming convention ``*Provider``.
33
+
34
+ - `DataCacheProviderProtocol`: Read device data cache
35
+ - `DeviceDetailsProviderProtocol`: Read device metadata (rooms, names, functions)
36
+ - `DeviceDescriptionProviderProtocol`: Read device descriptions
37
+ - `ParamsetDescriptionProviderProtocol`: Read paramset descriptions
38
+ - `ParameterVisibilityProviderProtocol`: Check parameter visibility rules
39
+
40
+ **Cache Write (Writers):**
41
+ Protocols for writing to caches. Follow naming convention ``*Writer``.
42
+
43
+ - `DataCacheWriter`: Write to device data cache
44
+ - `DeviceDetailsWriter`: Write device metadata
45
+ - `ParamsetDescriptionWriter`: Write paramset descriptions
46
+
47
+ **Client Management:**
48
+ Protocols for client lifecycle and communication.
49
+
50
+ *Client Sub-Protocols (ISP):*
51
+ - `ClientIdentityProtocol`: Basic identification (interface, interface_id, model)
52
+ - `ClientConnectionProtocol`: Connection state management
53
+ - `ClientLifecycleProtocol`: Lifecycle operations (init, stop, proxy)
54
+ - `DeviceDiscoveryOperationsProtocol`: Device discovery operations
55
+ - `ParamsetOperationsProtocol`: Paramset operations
56
+ - `ValueOperationsProtocol`: Value read/write operations
57
+ - `LinkOperationsProtocol`: Device linking operations
58
+ - `FirmwareOperationsProtocol`: Firmware update operations
59
+ - `SystemVariableOperationsProtocol`: System variable operations
60
+ - `ProgramOperationsProtocol`: Program execution operations
61
+ - `BackupOperationsProtocol`: Backup operations
62
+ - `MetadataOperationsProtocol`: Metadata and system operations
63
+ - `ClientSupportProtocol`: Utility methods and caches
64
+
65
+ *Client Composite:*
66
+ - `ClientProtocol`: Composite of all client sub-protocols
67
+
68
+ *Client Utilities:*
69
+ - `ClientProviderProtocol`: Lookup clients by interface_id
70
+ - `ClientFactoryProtocol`: Create new client instances
71
+ - `ClientDependenciesProtocol`: Composite of dependencies for clients
72
+ - `PrimaryClientProviderProtocol`: Access to primary client
73
+ - `JsonRpcClientProviderProtocol`: JSON-RPC client access
74
+ - `ConnectionStateProviderProtocol`: Connection state information
75
+
76
+ **Device & Channel Lookup:**
77
+ Protocols for finding devices and channels.
78
+
79
+ - `DeviceProviderProtocol`: Access device registry
80
+ - `DeviceLookupProtocol`: Find devices by various criteria
81
+ - `ChannelLookupProtocol`: Find channels by address
82
+ - `DataPointProviderProtocol`: Find data points
83
+ - `DeviceDescriptionsAccess`: Access device descriptions
84
+
85
+ **Device Operations:**
86
+ Protocols for device-related operations.
87
+
88
+ - `DeviceManagementProtocol`: Device lifecycle operations
89
+ - `DeviceDataRefresherProtocol`: Refresh device data from backend
90
+ - `NewDeviceHandlerProtocol`: Handle new device discovery
91
+
92
+ **Hub Operations:**
93
+ Protocols for hub-level operations (programs, sysvars).
94
+
95
+ - `HubDataFetcherProtocol`: Fetch hub data
96
+ - `HubDataPointManagerProtocol`: Manage hub data points
97
+ - `HubFetchOperationsProtocol`: Hub fetch operations
98
+
99
+ **Task Scheduling:**
100
+ Protocols for async task management.
101
+
102
+ - `TaskScheduler`: Schedule and manage async tasks
103
+
104
+ **Model Protocols:**
105
+ Protocols defining the runtime model structure.
106
+
107
+ *Device/Channel:*
108
+ - `DeviceProtocol`: Physical device representation
109
+ - `ChannelProtocol`: Device channel representation
110
+ - `HubProtocol`: Hub-level data point
111
+
112
+ *DataPoint Hierarchy:*
113
+ - `CallbackDataPointProtocol`: Base for all callback data points
114
+ - `BaseDataPointProtocol`: Base for device data points
115
+ - `BaseParameterDataPointProtocol`: Parameter-based data points
116
+ - `GenericDataPointProtocol`: Generic parameter data points
117
+ - `GenericEventProtocol`: Event-type data points
118
+ - `CustomDataPointProtocol`: Device-specific data points
119
+ - `CalculatedDataPointProtocol`: Derived/calculated values
120
+
121
+ *Hub DataPoints:*
122
+ - `GenericHubDataPointProtocol`: Base for hub data points
123
+ - `GenericSysvarDataPointProtocol`: System variable data points
124
+ - `GenericProgramDataPointProtocol`: Program data points
125
+ - `GenericInstallModeDataPointProtocol`: Install mode data points
126
+ - `HubSensorDataPointProtocol`: Hub sensor data points
127
+ - `HubBinarySensorDataPointProtocol`: Hub binary sensor data points
128
+
129
+ *Other:*
130
+ - `WeekProfileProtocol`: Weekly schedule management
131
+
132
+ **Utility Protocols:**
133
+ Other utility protocols.
134
+
135
+ - `BackupProviderProtocol`: Backup operations
136
+ - `FileOperationsProtocol`: File I/O operations
137
+ - `CoordinatorProviderProtocol`: Access to coordinators
138
+ - `CallbackAddressProviderProtocol`: Callback address management
139
+ - `ClientCoordinationProtocol`: Client coordination operations
140
+ - `SessionRecorderProviderProtocol`: Session recording access
141
+ - `CommandTrackerProtocol`: Command tracker operations
142
+ - `PingPongTrackerProtocol`: Ping/pong cache operations
143
+
144
+ Submodules
145
+ ----------
146
+
147
+ For explicit imports, use the submodules:
148
+
149
+ - ``aiohomematic.interfaces.central``: Central unit protocols
150
+ - ``aiohomematic.interfaces.client``: Client-related protocols
151
+ - ``aiohomematic.interfaces.model``: Device, Channel, DataPoint protocols
152
+ - ``aiohomematic.interfaces.operations``: Cache and visibility protocols
153
+ - ``aiohomematic.interfaces.coordinators``: Coordinator-specific protocols
154
+ """
155
+
156
+ from __future__ import annotations
157
+
158
+ from aiohomematic._log_context_protocol import LogContextProtocol
159
+ from aiohomematic.interfaces.central import (
160
+ BackupProviderProtocol,
161
+ CentralConfigProtocol,
162
+ CentralHealthProtocol,
163
+ CentralInfoProtocol,
164
+ # Central composite protocol
165
+ CentralProtocol,
166
+ CentralStateMachineProtocol,
167
+ CentralStateMachineProviderProtocol,
168
+ CentralUnitStateProviderProtocol,
169
+ ChannelLookupProtocol,
170
+ ConfigProviderProtocol,
171
+ ConnectionHealthProtocol,
172
+ DataCacheProviderProtocol,
173
+ DataPointProviderProtocol,
174
+ DeviceDataRefresherProtocol,
175
+ DeviceManagementProtocol,
176
+ DeviceProviderProtocol,
177
+ EventBusProviderProtocol,
178
+ EventPublisherProtocol,
179
+ EventSubscriptionManagerProtocol,
180
+ FileOperationsProtocol,
181
+ HealthProviderProtocol,
182
+ HealthTrackerProtocol,
183
+ HubDataFetcherProtocol,
184
+ HubDataPointManagerProtocol,
185
+ HubFetchOperationsProtocol,
186
+ MetricsProviderProtocol,
187
+ SystemInfoProviderProtocol,
188
+ )
189
+ from aiohomematic.interfaces.client import (
190
+ # Client sub-protocols
191
+ BackupOperationsProtocol,
192
+ # Client utilities
193
+ CallbackAddressProviderProtocol,
194
+ ClientConnectionProtocol,
195
+ ClientCoordinationProtocol,
196
+ ClientDependenciesProtocol,
197
+ ClientFactoryProtocol,
198
+ ClientIdentityProtocol,
199
+ ClientLifecycleProtocol,
200
+ # Client composite protocol
201
+ ClientProtocol,
202
+ ClientProviderProtocol,
203
+ ClientSupportProtocol,
204
+ CommandTrackerProtocol,
205
+ ConnectionStateProviderProtocol,
206
+ DataCacheWriterProtocol,
207
+ DeviceDescriptionsAccessProtocol,
208
+ DeviceDetailsWriterProtocol,
209
+ DeviceDiscoveryOperationsProtocol,
210
+ DeviceLookupProtocol,
211
+ FirmwareOperationsProtocol,
212
+ JsonRpcClientProviderProtocol,
213
+ LastEventTrackerProtocol,
214
+ LinkOperationsProtocol,
215
+ MetadataOperationsProtocol,
216
+ NewDeviceHandlerProtocol,
217
+ ParamsetDescriptionWriterProtocol,
218
+ ParamsetOperationsProtocol,
219
+ PingPongTrackerProtocol,
220
+ PrimaryClientProviderProtocol,
221
+ ProgramOperationsProtocol,
222
+ SessionRecorderProviderProtocol,
223
+ SystemVariableOperationsProtocol,
224
+ ValueOperationsProtocol,
225
+ )
226
+ from aiohomematic.interfaces.coordinators import CoordinatorProviderProtocol
227
+ from aiohomematic.interfaces.model import (
228
+ BaseDataPointProtocol,
229
+ BaseParameterDataPointProtocol,
230
+ BaseParameterDataPointProtocolAny,
231
+ CalculatedDataPointProtocol,
232
+ CallbackDataPointProtocol,
233
+ # Channel sub-protocols
234
+ ChannelDataPointAccessProtocol,
235
+ ChannelGroupingProtocol,
236
+ ChannelIdentityProtocol,
237
+ ChannelLifecycleProtocol,
238
+ ChannelLinkManagementProtocol,
239
+ ChannelMetadataProtocol,
240
+ ChannelProtocol,
241
+ CustomDataPointProtocol,
242
+ # Device sub-protocols
243
+ DeviceAvailabilityProtocol,
244
+ DeviceChannelAccessProtocol,
245
+ DeviceConfigurationProtocol,
246
+ DeviceFirmwareProtocol,
247
+ DeviceGroupManagementProtocol,
248
+ DeviceIdentityProtocol,
249
+ DeviceLifecycleProtocol,
250
+ DeviceLinkManagementProtocol,
251
+ DeviceProtocol,
252
+ DeviceProvidersProtocol,
253
+ DeviceWeekProfileProtocol,
254
+ GenericDataPointProtocol,
255
+ GenericDataPointProtocolAny,
256
+ GenericEventProtocol,
257
+ GenericEventProtocolAny,
258
+ GenericHubDataPointProtocol,
259
+ GenericInstallModeDataPointProtocol,
260
+ GenericProgramDataPointProtocol,
261
+ GenericSysvarDataPointProtocol,
262
+ HubBinarySensorDataPointProtocol,
263
+ HubProtocol,
264
+ HubSensorDataPointProtocol,
265
+ WeekProfileProtocol,
266
+ )
267
+ from aiohomematic.interfaces.operations import (
268
+ CacheWithStatisticsProtocol,
269
+ DeviceDescriptionProviderProtocol,
270
+ DeviceDetailsProviderProtocol,
271
+ IncidentRecorderProtocol,
272
+ ParameterVisibilityProviderProtocol,
273
+ ParamsetDescriptionProviderProtocol,
274
+ TaskSchedulerProtocol,
275
+ )
276
+
277
+ __all__ = [
278
+ # Cache protocols
279
+ "CacheWithStatisticsProtocol",
280
+ # Cache providers
281
+ "DataCacheProviderProtocol",
282
+ "DeviceDescriptionProviderProtocol",
283
+ "DeviceDescriptionsAccessProtocol",
284
+ "DeviceDetailsProviderProtocol",
285
+ "ParameterVisibilityProviderProtocol",
286
+ "ParamsetDescriptionProviderProtocol",
287
+ # Cache writers
288
+ "DataCacheWriterProtocol",
289
+ "DeviceDetailsWriterProtocol",
290
+ "ParamsetDescriptionWriterProtocol",
291
+ # Central composite
292
+ "CentralProtocol",
293
+ # Central config
294
+ "CentralConfigProtocol",
295
+ # Central health
296
+ "CentralHealthProtocol",
297
+ "ConnectionHealthProtocol",
298
+ "HealthProviderProtocol",
299
+ "HealthTrackerProtocol",
300
+ # Central identity
301
+ "CentralInfoProtocol",
302
+ "CentralUnitStateProviderProtocol",
303
+ "ConfigProviderProtocol",
304
+ "SystemInfoProviderProtocol",
305
+ # Central state machine
306
+ "CentralStateMachineProtocol",
307
+ "CentralStateMachineProviderProtocol",
308
+ # Client composite
309
+ "ClientProtocol",
310
+ # Client operations
311
+ "BackupOperationsProtocol",
312
+ "ClientConnectionProtocol",
313
+ "ClientIdentityProtocol",
314
+ "ClientLifecycleProtocol",
315
+ "ClientSupportProtocol",
316
+ "DeviceDiscoveryOperationsProtocol",
317
+ "FirmwareOperationsProtocol",
318
+ "LinkOperationsProtocol",
319
+ "MetadataOperationsProtocol",
320
+ "ParamsetOperationsProtocol",
321
+ "ProgramOperationsProtocol",
322
+ "SystemVariableOperationsProtocol",
323
+ "ValueOperationsProtocol",
324
+ # Client providers
325
+ "ClientDependenciesProtocol",
326
+ "ClientFactoryProtocol",
327
+ "ClientProviderProtocol",
328
+ "ConnectionStateProviderProtocol",
329
+ "JsonRpcClientProviderProtocol",
330
+ "PrimaryClientProviderProtocol",
331
+ # Device and channel lookup
332
+ "ChannelLookupProtocol",
333
+ "DataPointProviderProtocol",
334
+ "DeviceLookupProtocol",
335
+ "DeviceProviderProtocol",
336
+ # Device operations
337
+ "DeviceDataRefresherProtocol",
338
+ "DeviceManagementProtocol",
339
+ "NewDeviceHandlerProtocol",
340
+ # Event system
341
+ "EventBusProviderProtocol",
342
+ "EventPublisherProtocol",
343
+ "EventSubscriptionManagerProtocol",
344
+ "LastEventTrackerProtocol",
345
+ # Hub operations
346
+ "HubDataFetcherProtocol",
347
+ "HubDataPointManagerProtocol",
348
+ "HubFetchOperationsProtocol",
349
+ # Incident recording
350
+ "IncidentRecorderProtocol",
351
+ # Log context
352
+ "LogContextProtocol",
353
+ # Metrics
354
+ "MetricsProviderProtocol",
355
+ # Model channel
356
+ "ChannelDataPointAccessProtocol",
357
+ "ChannelGroupingProtocol",
358
+ "ChannelIdentityProtocol",
359
+ "ChannelLifecycleProtocol",
360
+ "ChannelLinkManagementProtocol",
361
+ "ChannelMetadataProtocol",
362
+ "ChannelProtocol",
363
+ # Model data point
364
+ "BaseDataPointProtocol",
365
+ "BaseParameterDataPointProtocol",
366
+ "BaseParameterDataPointProtocolAny",
367
+ "CalculatedDataPointProtocol",
368
+ "CallbackDataPointProtocol",
369
+ "CustomDataPointProtocol",
370
+ "GenericDataPointProtocol",
371
+ "GenericDataPointProtocolAny",
372
+ "GenericEventProtocol",
373
+ "GenericEventProtocolAny",
374
+ # Model device
375
+ "DeviceAvailabilityProtocol",
376
+ "DeviceChannelAccessProtocol",
377
+ "DeviceConfigurationProtocol",
378
+ "DeviceFirmwareProtocol",
379
+ "DeviceGroupManagementProtocol",
380
+ "DeviceIdentityProtocol",
381
+ "DeviceLifecycleProtocol",
382
+ "DeviceLinkManagementProtocol",
383
+ "DeviceProtocol",
384
+ "DeviceProvidersProtocol",
385
+ "DeviceWeekProfileProtocol",
386
+ # Model hub
387
+ "GenericHubDataPointProtocol",
388
+ "GenericInstallModeDataPointProtocol",
389
+ "GenericProgramDataPointProtocol",
390
+ "GenericSysvarDataPointProtocol",
391
+ "HubBinarySensorDataPointProtocol",
392
+ "HubProtocol",
393
+ "HubSensorDataPointProtocol",
394
+ # Model week profile
395
+ "WeekProfileProtocol",
396
+ # Task scheduling
397
+ "TaskSchedulerProtocol",
398
+ # Utility protocols
399
+ "BackupProviderProtocol",
400
+ "CallbackAddressProviderProtocol",
401
+ "ClientCoordinationProtocol",
402
+ "CommandTrackerProtocol",
403
+ "CoordinatorProviderProtocol",
404
+ "FileOperationsProtocol",
405
+ "PingPongTrackerProtocol",
406
+ "SessionRecorderProviderProtocol",
407
+ ]