aioccl 2025.6.1__tar.gz → 2025.6.3__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.1 → aioccl-2025.6.3}/PKG-INFO +1 -1
- {aioccl-2025.6.1 → aioccl-2025.6.3}/aioccl/device.py +4 -1
- aioccl-2025.6.3/aioccl/exception.py +7 -0
- {aioccl-2025.6.1 → aioccl-2025.6.3}/aioccl/server.py +3 -0
- {aioccl-2025.6.1 → aioccl-2025.6.3}/aioccl.egg-info/PKG-INFO +1 -1
- {aioccl-2025.6.1 → aioccl-2025.6.3}/aioccl.egg-info/SOURCES.txt +1 -0
- {aioccl-2025.6.1 → aioccl-2025.6.3}/setup.py +1 -1
- {aioccl-2025.6.1 → aioccl-2025.6.3}/LICENSE +0 -0
- {aioccl-2025.6.1 → aioccl-2025.6.3}/README.md +0 -0
- {aioccl-2025.6.1 → aioccl-2025.6.3}/aioccl/__init__.py +0 -0
- {aioccl-2025.6.1 → aioccl-2025.6.3}/aioccl/sensor.py +0 -0
- {aioccl-2025.6.1 → aioccl-2025.6.3}/aioccl.egg-info/dependency_links.txt +0 -0
- {aioccl-2025.6.1 → aioccl-2025.6.3}/aioccl.egg-info/requires.txt +0 -0
- {aioccl-2025.6.1 → aioccl-2025.6.3}/aioccl.egg-info/top_level.txt +0 -0
- {aioccl-2025.6.1 → aioccl-2025.6.3}/setup.cfg +0 -0
@@ -6,6 +6,7 @@ import logging
|
|
6
6
|
import time
|
7
7
|
from typing import Callable, TypedDict
|
8
8
|
|
9
|
+
from .exception import CCLDataUpdateException
|
9
10
|
from .sensor import CCLSensor, CCL_SENSORS
|
10
11
|
|
11
12
|
_LOGGER = logging.getLogger(__name__)
|
@@ -83,10 +84,12 @@ class CCLDevice:
|
|
83
84
|
def fw_ver(self) -> str | None:
|
84
85
|
"""Return the firmware version."""
|
85
86
|
return self._info["fw_ver"]
|
86
|
-
|
87
|
+
|
87
88
|
@property
|
88
89
|
def get_sensors(self) -> dict[str, CCLSensor]:
|
89
90
|
"""Get all types of sensor data under this device."""
|
91
|
+
if len(self._sensors) == 0:
|
92
|
+
raise CCLDataUpdateException("Device is offline or not ready")
|
90
93
|
return self._sensors
|
91
94
|
|
92
95
|
def update_info(self, new_info: dict[str, None | str]) -> None:
|
@@ -8,6 +8,7 @@ import logging
|
|
8
8
|
from aiohttp import web
|
9
9
|
|
10
10
|
from .device import CCLDevice, CCL_DEVICE_INFO_TYPES
|
11
|
+
from .exception import CCLDeviceRegistrationException
|
11
12
|
from .sensor import CCL_SENSORS
|
12
13
|
|
13
14
|
_LOGGER = logging.getLogger(__name__)
|
@@ -23,6 +24,8 @@ class CCLServer:
|
|
23
24
|
@staticmethod
|
24
25
|
def register(device: CCLDevice) -> None:
|
25
26
|
"""Register a device with a passkey."""
|
27
|
+
if CCLServer.devices.get(device.passkey, None) is not None:
|
28
|
+
raise CCLDeviceRegistrationException("Device already exists")
|
26
29
|
CCLServer.devices[device.passkey] = device
|
27
30
|
_LOGGER.debug("Device registered: %s", device.passkey)
|
28
31
|
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|