aioccl 2025.6.5__py3-none-any.whl → 2025.6.7__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.
- aioccl/device.py +12 -8
- aioccl/sensor.py +17 -7
- {aioccl-2025.6.5.dist-info → aioccl-2025.6.7.dist-info}/METADATA +1 -1
- aioccl-2025.6.7.dist-info/RECORD +10 -0
- aioccl-2025.6.5.dist-info/RECORD +0 -10
- {aioccl-2025.6.5.dist-info → aioccl-2025.6.7.dist-info}/WHEEL +0 -0
- {aioccl-2025.6.5.dist-info → aioccl-2025.6.7.dist-info}/licenses/LICENSE +0 -0
- {aioccl-2025.6.5.dist-info → aioccl-2025.6.7.dist-info}/top_level.txt +0 -0
aioccl/device.py
CHANGED
@@ -98,14 +98,8 @@ class CCLDevice:
|
|
98
98
|
self._info[key] = str(value)
|
99
99
|
self._info["last_update_time"] = time.monotonic()
|
100
100
|
|
101
|
-
def
|
102
|
-
"""
|
103
|
-
for key, value in data.items():
|
104
|
-
if key not in self._sensors:
|
105
|
-
self._sensors[key] = CCLSensor(key)
|
106
|
-
self._new_sensors.append(self._sensors[key])
|
107
|
-
self._sensors[key].value = value
|
108
|
-
|
101
|
+
def push_updates(self) -> None:
|
102
|
+
"""Push sensor updates."""
|
109
103
|
add_count = self._publish_new_sensors()
|
110
104
|
if add_count > 0:
|
111
105
|
_LOGGER.debug(
|
@@ -121,6 +115,16 @@ class CCLDevice:
|
|
121
115
|
self.device_id,
|
122
116
|
self.last_update_time,
|
123
117
|
)
|
118
|
+
|
119
|
+
def process_data(self, data: dict[str, None | str | int | float]) -> None:
|
120
|
+
"""Add or update all sensor values."""
|
121
|
+
for key, value in data.items():
|
122
|
+
if key not in self._sensors:
|
123
|
+
self._sensors[key] = CCLSensor(key)
|
124
|
+
self._new_sensors.append(self._sensors[key])
|
125
|
+
self._sensors[key].last_update_time = time.monotonic()
|
126
|
+
self._sensors[key].value = value
|
127
|
+
self.push_updates()
|
124
128
|
|
125
129
|
def set_update_callback(self, callback: Callable[[], None]) -> None:
|
126
130
|
"""Set the callback function to update sensor data."""
|
aioccl/sensor.py
CHANGED
@@ -11,7 +11,8 @@ class CCLSensor:
|
|
11
11
|
|
12
12
|
def __init__(self, key: str):
|
13
13
|
"""Initialize a CCL sensor."""
|
14
|
-
self.
|
14
|
+
self._last_update_time: float | None = None
|
15
|
+
self._value: str | int | float | None = None
|
15
16
|
|
16
17
|
if key in CCL_SENSORS:
|
17
18
|
self._key = key
|
@@ -32,14 +33,23 @@ class CCLSensor:
|
|
32
33
|
return CCL_SENSORS[self._key].sensor_type
|
33
34
|
|
34
35
|
@property
|
35
|
-
def compartment(self) ->
|
36
|
+
def compartment(self) -> str | None:
|
36
37
|
"""Decide which compartment it belongs to."""
|
37
38
|
if CCL_SENSORS[self._key].compartment in CCLDeviceCompartment:
|
38
39
|
return CCL_SENSORS[self._key].compartment.value
|
39
40
|
return None
|
40
41
|
|
41
42
|
@property
|
42
|
-
def
|
43
|
+
def last_update_time(self) -> float | None:
|
44
|
+
"""Return the last update time of the sensor."""
|
45
|
+
return self._last_update_time
|
46
|
+
|
47
|
+
@last_update_time.setter
|
48
|
+
def last_update_time(self, new_value):
|
49
|
+
self._last_update_time = new_value
|
50
|
+
|
51
|
+
@property
|
52
|
+
def value(self) -> str | int | float | None:
|
43
53
|
"""Return the intrinsic sensor value."""
|
44
54
|
if self.sensor_type.name in CCL_SENSOR_VALUES:
|
45
55
|
return CCL_SENSOR_VALUES[self.sensor_type.name].get(self._value)
|
@@ -77,7 +87,7 @@ class CCLSensorTypes(enum.Enum):
|
|
77
87
|
CO = 13
|
78
88
|
CO2 = 14
|
79
89
|
VOLATILE = 15
|
80
|
-
|
90
|
+
VOC_LEVEL = 16
|
81
91
|
PM10 = 17
|
82
92
|
PM25 = 18
|
83
93
|
AQI = 19
|
@@ -92,8 +102,8 @@ class CCLSensorTypes(enum.Enum):
|
|
92
102
|
class CCLDeviceCompartment(enum.Enum):
|
93
103
|
"""Grouping of CCL sensors."""
|
94
104
|
|
95
|
-
MAIN = "Console & Sensor
|
96
|
-
OTHER = "Other
|
105
|
+
MAIN = "Console & Sensor array"
|
106
|
+
OTHER = "Other sensors"
|
97
107
|
STATUS = "Status"
|
98
108
|
|
99
109
|
|
@@ -211,7 +221,7 @@ CCL_SENSORS: dict[str, CCLSensorPreset] = {
|
|
211
221
|
"Air Quality: PM2.5 AQI", CCLSensorTypes.AQI, CCLDeviceCompartment.OTHER
|
212
222
|
),
|
213
223
|
"t9voclv": CCLSensorPreset(
|
214
|
-
"Air Quality: VOC Level", CCLSensorTypes.
|
224
|
+
"Air Quality: VOC Level", CCLSensorTypes.VOC_LEVEL, CCLDeviceCompartment.OTHER
|
215
225
|
),
|
216
226
|
"t234c1tem": CCLSensorPreset(
|
217
227
|
"CH1 Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER
|
@@ -0,0 +1,10 @@
|
|
1
|
+
aioccl/__init__.py,sha256=XnegKtbvHvUTwVuuWNLb4LB9ZuGGar0xrZYOqk7scyg,133
|
2
|
+
aioccl/device.py,sha256=q-u2IW_3waqZeQH7qSUG68R6QIEMpVjjODYyWG4ehA8,5461
|
3
|
+
aioccl/exception.py,sha256=iTukjNcnVXVhGV_sMGj2D1jzjVXB0qcyOlX2vB8G4AY,211
|
4
|
+
aioccl/sensor.py,sha256=2HFUGEYPvbWpkHsZwrrCvtCZGrI5ZGEuGuBCPE9W-NQ,16650
|
5
|
+
aioccl/server.py,sha256=W8OL64dAi2WAeS4isx8usAG-9D3q4mBIl9pxxb4Iuhw,3573
|
6
|
+
aioccl-2025.6.7.dist-info/licenses/LICENSE,sha256=PBRsTHchx7o0TQ2R2ktEAfFmn1iNHTxcOP_xaeuSAuo,11349
|
7
|
+
aioccl-2025.6.7.dist-info/METADATA,sha256=aH6ek-9-zZrcr4MVAj8O9fv-QQRXMgMOLas42eaRgQ8,991
|
8
|
+
aioccl-2025.6.7.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
9
|
+
aioccl-2025.6.7.dist-info/top_level.txt,sha256=-xIJfyfXTaW_EH7XCIHyxjSSSwjLmawa2qhsrHZH1vA,7
|
10
|
+
aioccl-2025.6.7.dist-info/RECORD,,
|
aioccl-2025.6.5.dist-info/RECORD
DELETED
@@ -1,10 +0,0 @@
|
|
1
|
-
aioccl/__init__.py,sha256=XnegKtbvHvUTwVuuWNLb4LB9ZuGGar0xrZYOqk7scyg,133
|
2
|
-
aioccl/device.py,sha256=pFisuEGqYugHch-5ziNieJTSZ5pUrUnanMqJVgV5STg,5287
|
3
|
-
aioccl/exception.py,sha256=iTukjNcnVXVhGV_sMGj2D1jzjVXB0qcyOlX2vB8G4AY,211
|
4
|
-
aioccl/sensor.py,sha256=lNmq5OPvtfItH-dfEdYXhctPITHr6fYLDM6oyTNcCZU,16304
|
5
|
-
aioccl/server.py,sha256=W8OL64dAi2WAeS4isx8usAG-9D3q4mBIl9pxxb4Iuhw,3573
|
6
|
-
aioccl-2025.6.5.dist-info/licenses/LICENSE,sha256=PBRsTHchx7o0TQ2R2ktEAfFmn1iNHTxcOP_xaeuSAuo,11349
|
7
|
-
aioccl-2025.6.5.dist-info/METADATA,sha256=Z1SONpSd3KBQUYI_KlbOSW4h8ITxt-4OuML5fWRRtwg,991
|
8
|
-
aioccl-2025.6.5.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
9
|
-
aioccl-2025.6.5.dist-info/top_level.txt,sha256=-xIJfyfXTaW_EH7XCIHyxjSSSwjLmawa2qhsrHZH1vA,7
|
10
|
-
aioccl-2025.6.5.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|