aioccl 2025.6.8__tar.gz → 2025.7__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.
- {aioccl-2025.6.8 → aioccl-2025.7}/PKG-INFO +1 -1
- {aioccl-2025.6.8 → aioccl-2025.7}/aioccl/device.py +11 -11
- {aioccl-2025.6.8 → aioccl-2025.7}/aioccl.egg-info/PKG-INFO +1 -1
- {aioccl-2025.6.8 → aioccl-2025.7}/setup.py +1 -1
- {aioccl-2025.6.8 → aioccl-2025.7}/LICENSE +0 -0
- {aioccl-2025.6.8 → aioccl-2025.7}/README.md +0 -0
- {aioccl-2025.6.8 → aioccl-2025.7}/aioccl/__init__.py +0 -0
- {aioccl-2025.6.8 → aioccl-2025.7}/aioccl/exception.py +0 -0
- {aioccl-2025.6.8 → aioccl-2025.7}/aioccl/sensor.py +0 -0
- {aioccl-2025.6.8 → aioccl-2025.7}/aioccl/server.py +0 -0
- {aioccl-2025.6.8 → aioccl-2025.7}/aioccl.egg-info/SOURCES.txt +0 -0
- {aioccl-2025.6.8 → aioccl-2025.7}/aioccl.egg-info/dependency_links.txt +0 -0
- {aioccl-2025.6.8 → aioccl-2025.7}/aioccl.egg-info/requires.txt +0 -0
- {aioccl-2025.6.8 → aioccl-2025.7}/aioccl.egg-info/top_level.txt +0 -0
- {aioccl-2025.6.8 → aioccl-2025.7}/setup.cfg +0 -0
@@ -7,7 +7,7 @@ import time
|
|
7
7
|
from typing import Callable, TypedDict
|
8
8
|
|
9
9
|
from .exception import CCLDataUpdateException
|
10
|
-
from .sensor import CCLSensor
|
10
|
+
from .sensor import CCLSensor
|
11
11
|
|
12
12
|
_LOGGER = logging.getLogger(__name__)
|
13
13
|
|
@@ -83,8 +83,7 @@ class CCLDevice:
|
|
83
83
|
def fw_ver(self) -> str | None:
|
84
84
|
"""Return the firmware version."""
|
85
85
|
return self._info["fw_ver"]
|
86
|
-
|
87
|
-
@property
|
86
|
+
|
88
87
|
def get_sensors(self) -> dict[str, CCLSensor]:
|
89
88
|
"""Get all types of sensor data under this device."""
|
90
89
|
if self._info["last_update_time"] is None:
|
@@ -92,6 +91,15 @@ class CCLDevice:
|
|
92
91
|
if len(self._sensors) == 0 or time.monotonic() - self._info["last_update_time"] > 600:
|
93
92
|
raise CCLDataUpdateException("Device is offline or not ready")
|
94
93
|
return self._sensors
|
94
|
+
|
95
|
+
def set_update_callback(self, callback: Callable[[], None]) -> None:
|
96
|
+
"""Set the callback function to update sensor data."""
|
97
|
+
self._update_callback = callback
|
98
|
+
|
99
|
+
def set_new_sensor_callback(self, callback: Callable[[], None]) -> None:
|
100
|
+
"""Set the callback function to add a new sensor."""
|
101
|
+
self._new_sensor_callback = callback
|
102
|
+
|
95
103
|
|
96
104
|
def update_info(self, new_info: dict[str, None | str]) -> None:
|
97
105
|
"""Add or update device info."""
|
@@ -128,10 +136,6 @@ class CCLDevice:
|
|
128
136
|
self._sensors[key].value = value
|
129
137
|
self.push_updates()
|
130
138
|
|
131
|
-
def set_update_callback(self, callback: Callable[[], None]) -> None:
|
132
|
-
"""Set the callback function to update sensor data."""
|
133
|
-
self._update_callback = callback
|
134
|
-
|
135
139
|
def _publish_updates(self) -> None:
|
136
140
|
"""Call the function to update sensor data."""
|
137
141
|
try:
|
@@ -143,10 +147,6 @@ class CCLDevice:
|
|
143
147
|
err,
|
144
148
|
)
|
145
149
|
|
146
|
-
def set_new_sensor_callback(self, callback: Callable[[], None]) -> None:
|
147
|
-
"""Set the callback function to add a new sensor."""
|
148
|
-
self._new_sensor_callback = callback
|
149
|
-
|
150
150
|
def _publish_new_sensors(self) -> int:
|
151
151
|
"""Schedule all registered callbacks to add new sensors."""
|
152
152
|
success_count = 0
|
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
|
File without changes
|