aioccl 2025.6.3__tar.gz → 2025.6.4__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.3 → aioccl-2025.6.4}/PKG-INFO +1 -1
- {aioccl-2025.6.3 → aioccl-2025.6.4}/aioccl/device.py +14 -10
- {aioccl-2025.6.3 → aioccl-2025.6.4}/aioccl.egg-info/PKG-INFO +1 -1
- {aioccl-2025.6.3 → aioccl-2025.6.4}/setup.py +1 -1
- {aioccl-2025.6.3 → aioccl-2025.6.4}/LICENSE +0 -0
- {aioccl-2025.6.3 → aioccl-2025.6.4}/README.md +0 -0
- {aioccl-2025.6.3 → aioccl-2025.6.4}/aioccl/__init__.py +0 -0
- {aioccl-2025.6.3 → aioccl-2025.6.4}/aioccl/exception.py +0 -0
- {aioccl-2025.6.3 → aioccl-2025.6.4}/aioccl/sensor.py +0 -0
- {aioccl-2025.6.3 → aioccl-2025.6.4}/aioccl/server.py +0 -0
- {aioccl-2025.6.3 → aioccl-2025.6.4}/aioccl.egg-info/SOURCES.txt +0 -0
- {aioccl-2025.6.3 → aioccl-2025.6.4}/aioccl.egg-info/dependency_links.txt +0 -0
- {aioccl-2025.6.3 → aioccl-2025.6.4}/aioccl.egg-info/requires.txt +0 -0
- {aioccl-2025.6.3 → aioccl-2025.6.4}/aioccl.egg-info/top_level.txt +0 -0
- {aioccl-2025.6.3 → aioccl-2025.6.4}/setup.cfg +0 -0
@@ -145,20 +145,24 @@ class CCLDevice:
|
|
145
145
|
"""Remove a registered callback."""
|
146
146
|
self._new_sensor_callbacks.discard(callback)
|
147
147
|
|
148
|
-
def _publish_new_sensors(self) ->
|
148
|
+
def _publish_new_sensors(self) -> int:
|
149
149
|
"""Schedule all registered callbacks to add new sensors."""
|
150
|
-
|
150
|
+
success_count = 0
|
151
|
+
error_count = 0
|
151
152
|
for sensor in self._new_sensors[:]:
|
152
153
|
try:
|
154
|
+
assert len(self._new_sensor_callbacks) > 0
|
153
155
|
for callback in self._new_sensor_callbacks:
|
154
|
-
callback(sensor)
|
156
|
+
if callback(sensor) is not True:
|
157
|
+
raise CCLDataUpdateException("Failed to publish new sensor")
|
155
158
|
self._new_sensors.remove(sensor)
|
156
|
-
|
157
|
-
except Exception
|
158
|
-
|
159
|
-
|
160
|
-
|
159
|
+
success_count += 1
|
160
|
+
except Exception: # pylint: disable=broad-exception-caught
|
161
|
+
error_count += 1
|
162
|
+
if error_count > 0:
|
163
|
+
_LOGGER.warning(
|
164
|
+
"Failed to add %s sensors for device %s",
|
165
|
+
error_count,
|
161
166
|
self.device_id,
|
162
|
-
err,
|
163
167
|
)
|
164
|
-
return
|
168
|
+
return success_count
|
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
|