aioccl 2024.8.4__tar.gz → 2024.8.5__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-2024.8.4 → aioccl-2024.8.5}/PKG-INFO +1 -1
- {aioccl-2024.8.4 → aioccl-2024.8.5}/aioccl/sensor.py +11 -5
- {aioccl-2024.8.4 → aioccl-2024.8.5}/aioccl.egg-info/PKG-INFO +1 -1
- {aioccl-2024.8.4 → aioccl-2024.8.5}/setup.py +1 -1
- {aioccl-2024.8.4 → aioccl-2024.8.5}/LICENSE +0 -0
- {aioccl-2024.8.4 → aioccl-2024.8.5}/README.md +0 -0
- {aioccl-2024.8.4 → aioccl-2024.8.5}/aioccl/__init__.py +0 -0
- {aioccl-2024.8.4 → aioccl-2024.8.5}/aioccl/device.py +0 -0
- {aioccl-2024.8.4 → aioccl-2024.8.5}/aioccl/server.py +0 -0
- {aioccl-2024.8.4 → aioccl-2024.8.5}/aioccl.egg-info/SOURCES.txt +0 -0
- {aioccl-2024.8.4 → aioccl-2024.8.5}/aioccl.egg-info/dependency_links.txt +0 -0
- {aioccl-2024.8.4 → aioccl-2024.8.5}/aioccl.egg-info/requires.txt +0 -0
- {aioccl-2024.8.4 → aioccl-2024.8.5}/aioccl.egg-info/top_level.txt +0 -0
- {aioccl-2024.8.4 → aioccl-2024.8.5}/setup.cfg +0 -0
@@ -9,7 +9,7 @@ class CCLSensor:
|
|
9
9
|
|
10
10
|
def __init__(self, key: str):
|
11
11
|
"""Initialize a CCL sensor."""
|
12
|
-
self._value: None | str | int | float
|
12
|
+
self._value: None | str | int | float = None
|
13
13
|
|
14
14
|
if key in CCL_SENSORS.keys():
|
15
15
|
self._key = key
|
@@ -36,12 +36,18 @@ class CCLSensor:
|
|
36
36
|
return CCL_SENSORS[self._key].binary
|
37
37
|
|
38
38
|
@property
|
39
|
-
def value(self):
|
39
|
+
def value(self) -> None | str | int | float:
|
40
40
|
if self.sensor_type == CCLSensorTypes.CH_SENSOR_TYPE:
|
41
41
|
return CCL_CH_SENSOR_TYPES.get(self._value)
|
42
42
|
elif self.sensor_type in CCL_LEVEL_SENSORS:
|
43
43
|
return 'Lv ' + self._value
|
44
|
-
|
44
|
+
try:
|
45
|
+
return int(self._value)
|
46
|
+
except ValueError:
|
47
|
+
try:
|
48
|
+
return float(self._value)
|
49
|
+
except ValueError:
|
50
|
+
return self._value
|
45
51
|
|
46
52
|
@value.setter
|
47
53
|
def value(self, new_value):
|
@@ -153,8 +159,8 @@ CCL_SENSORS: dict[str, CCLSensorPreset] = {
|
|
153
159
|
't234c7bat': CCLSensorPreset('Battery: CH7', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
154
160
|
't11bat': CCLSensorPreset('Battery: CO', CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS),
|
155
161
|
't10bat': CCLSensorPreset('Battery: CO\u2082', CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS),
|
156
|
-
'inbat': CCLSensorPreset('Battery: Console', CCLSensorTypes.BATTERY_BINARY, True),
|
157
|
-
't9bat': CCLSensorPreset('Battery:Formaldehyde/VOC', CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS),
|
162
|
+
'inbat': CCLSensorPreset('Battery: Console', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
163
|
+
't9bat': CCLSensorPreset('Battery: Formaldehyde/VOC', CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS),
|
158
164
|
't6c1bat': CCLSensorPreset('Battery: Leakage CH1', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
159
165
|
't1bat': CCLSensorPreset('Battery: Main Sensor Array', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
160
166
|
't8bat': CCLSensorPreset('Battery: PM2.5/10', CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS),
|
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
|