aioccl 2024.9.7__tar.gz → 2024.10__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.9.7 → aioccl-2024.10}/PKG-INFO +1 -1
- {aioccl-2024.9.7 → aioccl-2024.10}/aioccl/__init__.py +1 -1
- {aioccl-2024.9.7 → aioccl-2024.10}/aioccl/device.py +13 -5
- aioccl-2024.10/aioccl/sensor.py +528 -0
- {aioccl-2024.9.7 → aioccl-2024.10}/aioccl/server.py +41 -29
- {aioccl-2024.9.7 → aioccl-2024.10}/aioccl.egg-info/PKG-INFO +1 -1
- {aioccl-2024.9.7 → aioccl-2024.10}/setup.py +3 -1
- aioccl-2024.9.7/aioccl/sensor.py +0 -218
- {aioccl-2024.9.7 → aioccl-2024.10}/LICENSE +0 -0
- {aioccl-2024.9.7 → aioccl-2024.10}/README.md +0 -0
- {aioccl-2024.9.7 → aioccl-2024.10}/aioccl.egg-info/SOURCES.txt +0 -0
- {aioccl-2024.9.7 → aioccl-2024.10}/aioccl.egg-info/dependency_links.txt +0 -0
- {aioccl-2024.9.7 → aioccl-2024.10}/aioccl.egg-info/requires.txt +0 -0
- {aioccl-2024.9.7 → aioccl-2024.10}/aioccl.egg-info/top_level.txt +0 -0
- {aioccl-2024.9.7 → aioccl-2024.10}/setup.cfg +0 -0
@@ -1,4 +1,4 @@
|
|
1
|
-
"""
|
1
|
+
"""CCL device mapping."""
|
2
2
|
from __future__ import annotations
|
3
3
|
|
4
4
|
import logging
|
@@ -33,34 +33,42 @@ class CCLDevice:
|
|
33
33
|
|
34
34
|
@property
|
35
35
|
def passkey(self) -> str:
|
36
|
+
"""Return the passkey."""
|
36
37
|
return self._passkey
|
37
38
|
|
38
39
|
@property
|
39
40
|
def device_id(self) -> str | None:
|
41
|
+
"""Return the device ID."""
|
40
42
|
return self._mac_address.replace(":", "").lower()[-6:]
|
41
43
|
|
42
44
|
@property
|
43
45
|
def name(self) -> str | None:
|
46
|
+
"""Return the display name."""
|
44
47
|
return self._model + " - " + self.device_id
|
45
48
|
|
46
49
|
@property
|
47
50
|
def mac_address(self) -> str | None:
|
51
|
+
"""Return the MAC address."""
|
48
52
|
return self._mac_address
|
49
53
|
|
50
54
|
@property
|
51
55
|
def model(self) -> str | None:
|
56
|
+
"""Return the model."""
|
52
57
|
return self._model
|
53
58
|
|
54
59
|
@property
|
55
60
|
def fw_ver(self) -> str | None:
|
61
|
+
"""Return the firmware version."""
|
56
62
|
return self._fw_ver
|
57
63
|
|
58
64
|
@property
|
59
65
|
def binary_sensors(self) -> dict[str, CCLSensor] | None:
|
66
|
+
"""Store binary sensor data under this device."""
|
60
67
|
return self._binary_sensors
|
61
68
|
|
62
69
|
@property
|
63
70
|
def sensors(self) -> dict[str, CCLSensor] | None:
|
71
|
+
"""Store sensor data under this device."""
|
64
72
|
return self._sensors
|
65
73
|
|
66
74
|
def update_info(self, info: dict[str, None | str]) -> None:
|
@@ -73,12 +81,12 @@ class CCLDevice:
|
|
73
81
|
"""Add or update all sensor values."""
|
74
82
|
for key, value in sensors.items():
|
75
83
|
if CCL_SENSORS.get(key).binary:
|
76
|
-
if not
|
84
|
+
if key not in self._binary_sensors:
|
77
85
|
self._binary_sensors[key] = CCLSensor(key)
|
78
86
|
self._new_sensors.append(self._binary_sensors[key])
|
79
87
|
self._binary_sensors[key].value = value
|
80
88
|
else:
|
81
|
-
if not
|
89
|
+
if key not in self._sensors:
|
82
90
|
self._sensors[key] = CCLSensor(key)
|
83
91
|
self._new_sensors.append(self._sensors[key])
|
84
92
|
self._sensors[key].value = value
|
@@ -100,7 +108,7 @@ class CCLDevice:
|
|
100
108
|
try:
|
101
109
|
for callback in self._update_callbacks:
|
102
110
|
callback()
|
103
|
-
except Exception as err:
|
111
|
+
except Exception as err: # pylint: disable=broad-exception-caught
|
104
112
|
_LOGGER.warning("Error while publishing sensor updates: %s", err)
|
105
113
|
|
106
114
|
def register_new_binary_sensor_cb(self, callback: Callable[[], None]) -> None:
|
@@ -131,5 +139,5 @@ class CCLDevice:
|
|
131
139
|
for callback in self._new_sensor_callbacks:
|
132
140
|
callback(sensor)
|
133
141
|
self._new_sensors.remove(sensor)
|
134
|
-
except Exception as err:
|
142
|
+
except Exception as err: # pylint: disable=broad-exception-caught
|
135
143
|
_LOGGER.warning("Error while publishing new sensors: %s", err)
|
@@ -0,0 +1,528 @@
|
|
1
|
+
"""CCL sensor mapping."""
|
2
|
+
|
3
|
+
from __future__ import annotations
|
4
|
+
|
5
|
+
from dataclasses import dataclass
|
6
|
+
import enum
|
7
|
+
|
8
|
+
|
9
|
+
class CCLSensor:
|
10
|
+
"""Class that represents a CCLSensor object in the aioCCL API."""
|
11
|
+
|
12
|
+
def __init__(self, key: str):
|
13
|
+
"""Initialize a CCL sensor."""
|
14
|
+
self._value: None | str | int | float = None
|
15
|
+
|
16
|
+
if key in CCL_SENSORS.keys():
|
17
|
+
self._key = key
|
18
|
+
|
19
|
+
@property
|
20
|
+
def key(self) -> str:
|
21
|
+
"""Key ID of the sensor."""
|
22
|
+
return self._key
|
23
|
+
|
24
|
+
@property
|
25
|
+
def name(self) -> str:
|
26
|
+
"""Display name of the sensor."""
|
27
|
+
return CCL_SENSORS[self._key].name
|
28
|
+
|
29
|
+
@property
|
30
|
+
def sensor_type(self) -> CCLSensorTypes:
|
31
|
+
"""Type of the sensor."""
|
32
|
+
return CCL_SENSORS[self._key].sensor_type
|
33
|
+
|
34
|
+
@property
|
35
|
+
def compartment(self) -> None | str:
|
36
|
+
"""Decide which compartment it belongs to."""
|
37
|
+
if CCL_SENSORS[self._key].compartment is not None:
|
38
|
+
return CCL_SENSORS[self._key].compartment.value
|
39
|
+
|
40
|
+
@property
|
41
|
+
def binary(self) -> bool:
|
42
|
+
"""Decide if the sensor is binary."""
|
43
|
+
return CCL_SENSORS[self._key].binary
|
44
|
+
|
45
|
+
@property
|
46
|
+
def value(self) -> None | str | int | float:
|
47
|
+
"""Return the intrinsic sensor value."""
|
48
|
+
if self.sensor_type.name in CCL_SENSOR_VALUES:
|
49
|
+
return CCL_SENSOR_VALUES[self.sensor_type.name].get(self._value)
|
50
|
+
elif self.sensor_type == CCLSensorTypes.BATTERY_BINARY:
|
51
|
+
try:
|
52
|
+
return int(self._value) - 1
|
53
|
+
except ValueError:
|
54
|
+
pass
|
55
|
+
else:
|
56
|
+
return self._value
|
57
|
+
|
58
|
+
@value.setter
|
59
|
+
def value(self, new_value):
|
60
|
+
self._value = new_value
|
61
|
+
|
62
|
+
|
63
|
+
@dataclass
|
64
|
+
class CCLSensorPreset:
|
65
|
+
"""Attributes of a CCL sensor."""
|
66
|
+
|
67
|
+
name: str
|
68
|
+
sensor_type: str
|
69
|
+
compartment: None | CCLDeviceCompartment = None
|
70
|
+
binary: bool = False
|
71
|
+
|
72
|
+
|
73
|
+
class CCLSensorTypes(enum.Enum):
|
74
|
+
"""List of CCL sensor types."""
|
75
|
+
|
76
|
+
PRESSURE = 1
|
77
|
+
TEMPERATURE = 2
|
78
|
+
HUMIDITY = 3
|
79
|
+
WIND_DIRECITON = 4
|
80
|
+
WIND_SPEED = 5
|
81
|
+
RAIN_RATE = 6
|
82
|
+
RAINFALL = 7
|
83
|
+
UVI = 8
|
84
|
+
RADIATION = 9
|
85
|
+
BATTERY_BINARY = 10
|
86
|
+
CONNECTION = 11
|
87
|
+
CH_SENSOR_TYPE = 12
|
88
|
+
CO = 13
|
89
|
+
CO2 = 14
|
90
|
+
VOLATILE = 15
|
91
|
+
VOC = 16
|
92
|
+
PM10 = 17
|
93
|
+
PM25 = 18
|
94
|
+
AQI = 19
|
95
|
+
LEAKAGE = 20
|
96
|
+
BATTERY = 21
|
97
|
+
LIGHTNING_DISTANCE = 22
|
98
|
+
LIGHTNING_DURATION = 23
|
99
|
+
LIGHTNING_FREQUENCY = 24
|
100
|
+
BATTERY_VOLTAGE = 25
|
101
|
+
|
102
|
+
|
103
|
+
class CCLDeviceCompartment(enum.Enum):
|
104
|
+
"""Grouping of CCL sensors."""
|
105
|
+
|
106
|
+
MAIN = "Console & Sensor Array"
|
107
|
+
OTHER = "Other Sensors"
|
108
|
+
STATUS = "Status"
|
109
|
+
|
110
|
+
|
111
|
+
CCL_SENSOR_VALUES: dict[str, dict[str, str]] = {
|
112
|
+
"CH_SENSOR_TYPE": {
|
113
|
+
2: "thermo-hygro",
|
114
|
+
3: "pool",
|
115
|
+
4: "soil",
|
116
|
+
},
|
117
|
+
"LEAKAGE": {
|
118
|
+
0: "no_leak",
|
119
|
+
1: "leaking",
|
120
|
+
},
|
121
|
+
}
|
122
|
+
|
123
|
+
CCL_SENSORS: dict[str, CCLSensorPreset] = {
|
124
|
+
# Main Sensors 12-34
|
125
|
+
"abar": CCLSensorPreset(
|
126
|
+
"Air Pressure (Absolute)", CCLSensorTypes.PRESSURE, CCLDeviceCompartment.MAIN
|
127
|
+
),
|
128
|
+
"rbar": CCLSensorPreset(
|
129
|
+
"Air Pressure (Relative)", CCLSensorTypes.PRESSURE, CCLDeviceCompartment.MAIN
|
130
|
+
),
|
131
|
+
"t1dew": CCLSensorPreset(
|
132
|
+
"Index: Dew Point", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN
|
133
|
+
),
|
134
|
+
"t1feels": CCLSensorPreset(
|
135
|
+
"Index: Feels Like", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN
|
136
|
+
),
|
137
|
+
"t1heat": CCLSensorPreset(
|
138
|
+
"Index: Heat Index", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN
|
139
|
+
),
|
140
|
+
"t1wbgt": CCLSensorPreset(
|
141
|
+
"Index: WBGT", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN
|
142
|
+
),
|
143
|
+
"t1chill": CCLSensorPreset(
|
144
|
+
"Index: Wind Chill", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN
|
145
|
+
),
|
146
|
+
"inhum": CCLSensorPreset(
|
147
|
+
"Indoor Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.MAIN
|
148
|
+
),
|
149
|
+
"intem": CCLSensorPreset(
|
150
|
+
"Indoor Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN
|
151
|
+
),
|
152
|
+
"t1solrad": CCLSensorPreset(
|
153
|
+
"Light Intensity", CCLSensorTypes.RADIATION, CCLDeviceCompartment.MAIN
|
154
|
+
),
|
155
|
+
"t1hum": CCLSensorPreset(
|
156
|
+
"Outdoor Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.MAIN
|
157
|
+
),
|
158
|
+
"t1tem": CCLSensorPreset(
|
159
|
+
"Outdoor Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN
|
160
|
+
),
|
161
|
+
"t1rainra": CCLSensorPreset(
|
162
|
+
"Rain Rate", CCLSensorTypes.RAIN_RATE, CCLDeviceCompartment.MAIN
|
163
|
+
),
|
164
|
+
"t1rainhr": CCLSensorPreset(
|
165
|
+
"Rainfall: Hourly ", CCLSensorTypes.RAINFALL, CCLDeviceCompartment.MAIN
|
166
|
+
),
|
167
|
+
"t1raindy": CCLSensorPreset(
|
168
|
+
"Rainfall: Daily", CCLSensorTypes.RAINFALL, CCLDeviceCompartment.MAIN
|
169
|
+
),
|
170
|
+
"t1rainwy": CCLSensorPreset(
|
171
|
+
"Rainfall: Weekly", CCLSensorTypes.RAINFALL, CCLDeviceCompartment.MAIN
|
172
|
+
),
|
173
|
+
"t1rainmth": CCLSensorPreset(
|
174
|
+
"Rainfall: Monthly", CCLSensorTypes.RAINFALL, CCLDeviceCompartment.MAIN
|
175
|
+
),
|
176
|
+
"t1rainyr": CCLSensorPreset(
|
177
|
+
"Rainfall: Yearly", CCLSensorTypes.RAINFALL, CCLDeviceCompartment.MAIN
|
178
|
+
),
|
179
|
+
"t1uvi": CCLSensorPreset("UV Index", CCLSensorTypes.UVI, CCLDeviceCompartment.MAIN),
|
180
|
+
"t1wdir": CCLSensorPreset(
|
181
|
+
"Wind Direction", CCLSensorTypes.WIND_DIRECITON, CCLDeviceCompartment.MAIN
|
182
|
+
),
|
183
|
+
"t1wgust": CCLSensorPreset(
|
184
|
+
"Wind Gust", CCLSensorTypes.WIND_SPEED, CCLDeviceCompartment.MAIN
|
185
|
+
),
|
186
|
+
"t1ws": CCLSensorPreset(
|
187
|
+
"Wind Speed", CCLSensorTypes.WIND_SPEED, CCLDeviceCompartment.MAIN
|
188
|
+
),
|
189
|
+
"t1ws10mav": CCLSensorPreset(
|
190
|
+
"Wind Speed (10 mins AVG.)",
|
191
|
+
CCLSensorTypes.WIND_SPEED,
|
192
|
+
CCLDeviceCompartment.MAIN,
|
193
|
+
),
|
194
|
+
# Additional Sensors 35-77
|
195
|
+
"t11co": CCLSensorPreset(
|
196
|
+
"Air Quality: CO", CCLSensorTypes.CO, CCLDeviceCompartment.OTHER
|
197
|
+
),
|
198
|
+
"t10co2": CCLSensorPreset(
|
199
|
+
"Air Quality: CO\u2082", CCLSensorTypes.CO2, CCLDeviceCompartment.OTHER
|
200
|
+
),
|
201
|
+
"t9hcho": CCLSensorPreset(
|
202
|
+
"Air Quality: HCHO", CCLSensorTypes.VOLATILE, CCLDeviceCompartment.OTHER
|
203
|
+
),
|
204
|
+
"t8pm10": CCLSensorPreset(
|
205
|
+
"Air Quality: PM10", CCLSensorTypes.PM10, CCLDeviceCompartment.OTHER
|
206
|
+
),
|
207
|
+
"t8pm10ai": CCLSensorPreset(
|
208
|
+
"Air Quality: PM10 AQI", CCLSensorTypes.AQI, CCLDeviceCompartment.OTHER
|
209
|
+
),
|
210
|
+
"t8pm25": CCLSensorPreset(
|
211
|
+
"Air Quality: PM2.5", CCLSensorTypes.PM25, CCLDeviceCompartment.OTHER
|
212
|
+
),
|
213
|
+
"t8pm25ai": CCLSensorPreset(
|
214
|
+
"Air Quality: PM2.5 AQI", CCLSensorTypes.AQI, CCLDeviceCompartment.OTHER
|
215
|
+
),
|
216
|
+
"t9voclv": CCLSensorPreset(
|
217
|
+
"Air Quality: VOC Level", CCLSensorTypes.VOC, CCLDeviceCompartment.OTHER
|
218
|
+
),
|
219
|
+
"t234c1tem": CCLSensorPreset(
|
220
|
+
"CH1 Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER
|
221
|
+
),
|
222
|
+
"t234c1hum": CCLSensorPreset(
|
223
|
+
"CH1 Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER
|
224
|
+
),
|
225
|
+
"t234c1tp": CCLSensorPreset(
|
226
|
+
"CH1 Type", CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER
|
227
|
+
),
|
228
|
+
"t234c2tem": CCLSensorPreset(
|
229
|
+
"CH2 Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER
|
230
|
+
),
|
231
|
+
"t234c2hum": CCLSensorPreset(
|
232
|
+
"CH2 Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER
|
233
|
+
),
|
234
|
+
"t234c2tp": CCLSensorPreset(
|
235
|
+
"CH2 Type", CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER
|
236
|
+
),
|
237
|
+
"t234c3tem": CCLSensorPreset(
|
238
|
+
"CH3 Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER
|
239
|
+
),
|
240
|
+
"t234c3hum": CCLSensorPreset(
|
241
|
+
"CH3 Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER
|
242
|
+
),
|
243
|
+
"t234c3tp": CCLSensorPreset(
|
244
|
+
"CH3 Type", CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER
|
245
|
+
),
|
246
|
+
"t234c4tem": CCLSensorPreset(
|
247
|
+
"CH4 Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER
|
248
|
+
),
|
249
|
+
"t234c4hum": CCLSensorPreset(
|
250
|
+
"CH4 Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER
|
251
|
+
),
|
252
|
+
"t234c4tp": CCLSensorPreset(
|
253
|
+
"CH4 Type", CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER
|
254
|
+
),
|
255
|
+
"t234c5tem": CCLSensorPreset(
|
256
|
+
"CH5 Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER
|
257
|
+
),
|
258
|
+
"t234c5hum": CCLSensorPreset(
|
259
|
+
"CH5 Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER
|
260
|
+
),
|
261
|
+
"t234c5tp": CCLSensorPreset(
|
262
|
+
"CH5 Type", CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER
|
263
|
+
),
|
264
|
+
"t234c6tem": CCLSensorPreset(
|
265
|
+
"CH6 Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER
|
266
|
+
),
|
267
|
+
"t234c6hum": CCLSensorPreset(
|
268
|
+
"CH6 Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER
|
269
|
+
),
|
270
|
+
"t234c6tp": CCLSensorPreset(
|
271
|
+
"CH6 Type", CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER
|
272
|
+
),
|
273
|
+
"t234c7tem": CCLSensorPreset(
|
274
|
+
"CH7 Temperature", CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER
|
275
|
+
),
|
276
|
+
"t234c7hum": CCLSensorPreset(
|
277
|
+
"CH7 Humidity", CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER
|
278
|
+
),
|
279
|
+
"t234c7tp": CCLSensorPreset(
|
280
|
+
"CH7 Type", CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER
|
281
|
+
),
|
282
|
+
"t6c1wls": CCLSensorPreset(
|
283
|
+
"Leakage CH1", CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER
|
284
|
+
),
|
285
|
+
"t6c2wls": CCLSensorPreset(
|
286
|
+
"Leakage CH2", CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER
|
287
|
+
),
|
288
|
+
"t6c3wls": CCLSensorPreset(
|
289
|
+
"Leakage CH3", CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER
|
290
|
+
),
|
291
|
+
"t6c4wls": CCLSensorPreset(
|
292
|
+
"Leakage CH4", CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER
|
293
|
+
),
|
294
|
+
"t6c5wls": CCLSensorPreset(
|
295
|
+
"Leakage CH5", CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER
|
296
|
+
),
|
297
|
+
"t6c6wls": CCLSensorPreset(
|
298
|
+
"Leakage CH6", CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER
|
299
|
+
),
|
300
|
+
"t6c7wls": CCLSensorPreset(
|
301
|
+
"Leakage CH7", CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER
|
302
|
+
),
|
303
|
+
"t5lskm": CCLSensorPreset(
|
304
|
+
"Lightning Distance",
|
305
|
+
CCLSensorTypes.LIGHTNING_DISTANCE,
|
306
|
+
CCLDeviceCompartment.OTHER,
|
307
|
+
),
|
308
|
+
"t5lsf": CCLSensorPreset(
|
309
|
+
"Lightning: Past 60 mins Strikes",
|
310
|
+
CCLSensorTypes.LIGHTNING_FREQUENCY,
|
311
|
+
CCLDeviceCompartment.OTHER,
|
312
|
+
),
|
313
|
+
"t5ls30mtc": CCLSensorPreset(
|
314
|
+
"Lightning: Strikes in 30 mins",
|
315
|
+
CCLSensorTypes.LIGHTNING_FREQUENCY,
|
316
|
+
CCLDeviceCompartment.OTHER,
|
317
|
+
),
|
318
|
+
"t5ls5mtc": CCLSensorPreset(
|
319
|
+
"Lightning: Strikes in 5 mins",
|
320
|
+
CCLSensorTypes.LIGHTNING_FREQUENCY,
|
321
|
+
CCLDeviceCompartment.OTHER,
|
322
|
+
),
|
323
|
+
"t5ls1dtc": CCLSensorPreset(
|
324
|
+
"Lightning: Strikes in day",
|
325
|
+
CCLSensorTypes.LIGHTNING_FREQUENCY,
|
326
|
+
CCLDeviceCompartment.OTHER,
|
327
|
+
),
|
328
|
+
"t5ls1htc": CCLSensorPreset(
|
329
|
+
"Lightning: Strikes in hour",
|
330
|
+
CCLSensorTypes.LIGHTNING_FREQUENCY,
|
331
|
+
CCLDeviceCompartment.OTHER,
|
332
|
+
),
|
333
|
+
# Status 78-119
|
334
|
+
"t234c1bat": CCLSensorPreset(
|
335
|
+
"Battery: CH1", CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True
|
336
|
+
),
|
337
|
+
"t234c2bat": CCLSensorPreset(
|
338
|
+
"Battery: CH2", CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True
|
339
|
+
),
|
340
|
+
"t234c3bat": CCLSensorPreset(
|
341
|
+
"Battery: CH3", CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True
|
342
|
+
),
|
343
|
+
"t234c4bat": CCLSensorPreset(
|
344
|
+
"Battery: CH4", CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True
|
345
|
+
),
|
346
|
+
"t234c5bat": CCLSensorPreset(
|
347
|
+
"Battery: CH5", CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True
|
348
|
+
),
|
349
|
+
"t234c6bat": CCLSensorPreset(
|
350
|
+
"Battery: CH6", CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True
|
351
|
+
),
|
352
|
+
"t234c7bat": CCLSensorPreset(
|
353
|
+
"Battery: CH7", CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True
|
354
|
+
),
|
355
|
+
"t11bat": CCLSensorPreset(
|
356
|
+
"Battery Level: CO", CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS
|
357
|
+
),
|
358
|
+
"t10bat": CCLSensorPreset(
|
359
|
+
"Battery Level: CO\u2082", CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS
|
360
|
+
),
|
361
|
+
"inbat": CCLSensorPreset(
|
362
|
+
"Battery: Console",
|
363
|
+
CCLSensorTypes.BATTERY_BINARY,
|
364
|
+
CCLDeviceCompartment.STATUS,
|
365
|
+
True,
|
366
|
+
),
|
367
|
+
"t9bat": CCLSensorPreset(
|
368
|
+
"Battery Level: HCHO/VOC", CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS
|
369
|
+
),
|
370
|
+
"t6c1bat": CCLSensorPreset(
|
371
|
+
"Battery: Leakage CH1",
|
372
|
+
CCLSensorTypes.BATTERY_BINARY,
|
373
|
+
CCLDeviceCompartment.STATUS,
|
374
|
+
True,
|
375
|
+
),
|
376
|
+
"t6c2bat": CCLSensorPreset(
|
377
|
+
"Battery: Leakage CH2",
|
378
|
+
CCLSensorTypes.BATTERY_BINARY,
|
379
|
+
CCLDeviceCompartment.STATUS,
|
380
|
+
True,
|
381
|
+
),
|
382
|
+
"t6c3bat": CCLSensorPreset(
|
383
|
+
"Battery: Leakage CH3",
|
384
|
+
CCLSensorTypes.BATTERY_BINARY,
|
385
|
+
CCLDeviceCompartment.STATUS,
|
386
|
+
True,
|
387
|
+
),
|
388
|
+
"t6c4bat": CCLSensorPreset(
|
389
|
+
"Battery: Leakage CH4",
|
390
|
+
CCLSensorTypes.BATTERY_BINARY,
|
391
|
+
CCLDeviceCompartment.STATUS,
|
392
|
+
True,
|
393
|
+
),
|
394
|
+
"t6c5bat": CCLSensorPreset(
|
395
|
+
"Battery: Leakage CH5",
|
396
|
+
CCLSensorTypes.BATTERY_BINARY,
|
397
|
+
CCLDeviceCompartment.STATUS,
|
398
|
+
True,
|
399
|
+
),
|
400
|
+
"t6c6bat": CCLSensorPreset(
|
401
|
+
"Battery: Leakage CH6",
|
402
|
+
CCLSensorTypes.BATTERY_BINARY,
|
403
|
+
CCLDeviceCompartment.STATUS,
|
404
|
+
True,
|
405
|
+
),
|
406
|
+
"t6c7bat": CCLSensorPreset(
|
407
|
+
"Battery: Leakage CH7",
|
408
|
+
CCLSensorTypes.BATTERY_BINARY,
|
409
|
+
CCLDeviceCompartment.STATUS,
|
410
|
+
True,
|
411
|
+
),
|
412
|
+
"t5lsbat": CCLSensorPreset(
|
413
|
+
"Battery: Lightning Sensor",
|
414
|
+
CCLSensorTypes.BATTERY_BINARY,
|
415
|
+
CCLDeviceCompartment.STATUS,
|
416
|
+
True,
|
417
|
+
),
|
418
|
+
"t1bat": CCLSensorPreset(
|
419
|
+
"Battery: Sensor Array",
|
420
|
+
CCLSensorTypes.BATTERY_BINARY,
|
421
|
+
CCLDeviceCompartment.STATUS,
|
422
|
+
True,
|
423
|
+
),
|
424
|
+
"t1batvt": CCLSensorPreset(
|
425
|
+
"Battery Voltage: Sensor Array",
|
426
|
+
CCLSensorTypes.BATTERY_VOLTAGE,
|
427
|
+
CCLDeviceCompartment.STATUS,
|
428
|
+
),
|
429
|
+
"t8bat": CCLSensorPreset(
|
430
|
+
"Battery Level: PM2.5/10", CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS
|
431
|
+
),
|
432
|
+
"t234c1cn": CCLSensorPreset(
|
433
|
+
"Connection: CH1", CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True
|
434
|
+
),
|
435
|
+
"t234c2cn": CCLSensorPreset(
|
436
|
+
"Connection: CH2", CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True
|
437
|
+
),
|
438
|
+
"t234c3cn": CCLSensorPreset(
|
439
|
+
"Connection: CH3", CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True
|
440
|
+
),
|
441
|
+
"t234c4cn": CCLSensorPreset(
|
442
|
+
"Connection: CH4", CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True
|
443
|
+
),
|
444
|
+
"t234c5cn": CCLSensorPreset(
|
445
|
+
"Connection: CH5", CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True
|
446
|
+
),
|
447
|
+
"t234c6cn": CCLSensorPreset(
|
448
|
+
"Connection: CH6", CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True
|
449
|
+
),
|
450
|
+
"t234c7cn": CCLSensorPreset(
|
451
|
+
"Connection: CH7", CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True
|
452
|
+
),
|
453
|
+
"t6c1cn": CCLSensorPreset(
|
454
|
+
"Connection: Leakage CH1",
|
455
|
+
CCLSensorTypes.CONNECTION,
|
456
|
+
CCLDeviceCompartment.STATUS,
|
457
|
+
True,
|
458
|
+
),
|
459
|
+
"t6c2cn": CCLSensorPreset(
|
460
|
+
"Connection: Leakage CH2",
|
461
|
+
CCLSensorTypes.CONNECTION,
|
462
|
+
CCLDeviceCompartment.STATUS,
|
463
|
+
True,
|
464
|
+
),
|
465
|
+
"t6c3cn": CCLSensorPreset(
|
466
|
+
"Connection: Leakage CH3",
|
467
|
+
CCLSensorTypes.CONNECTION,
|
468
|
+
CCLDeviceCompartment.STATUS,
|
469
|
+
True,
|
470
|
+
),
|
471
|
+
"t6c4cn": CCLSensorPreset(
|
472
|
+
"Connection: Leakage CH4",
|
473
|
+
CCLSensorTypes.CONNECTION,
|
474
|
+
CCLDeviceCompartment.STATUS,
|
475
|
+
True,
|
476
|
+
),
|
477
|
+
"t6c5cn": CCLSensorPreset(
|
478
|
+
"Connection: Leakage CH5",
|
479
|
+
CCLSensorTypes.CONNECTION,
|
480
|
+
CCLDeviceCompartment.STATUS,
|
481
|
+
True,
|
482
|
+
),
|
483
|
+
"t6c6cn": CCLSensorPreset(
|
484
|
+
"Connection: Leakage CH6",
|
485
|
+
CCLSensorTypes.CONNECTION,
|
486
|
+
CCLDeviceCompartment.STATUS,
|
487
|
+
True,
|
488
|
+
),
|
489
|
+
"t6c7cn": CCLSensorPreset(
|
490
|
+
"Connection: Leakage CH7",
|
491
|
+
CCLSensorTypes.CONNECTION,
|
492
|
+
CCLDeviceCompartment.STATUS,
|
493
|
+
True,
|
494
|
+
),
|
495
|
+
"t5lscn": CCLSensorPreset(
|
496
|
+
"Connection: Lightning Sensor",
|
497
|
+
CCLSensorTypes.CONNECTION,
|
498
|
+
CCLDeviceCompartment.STATUS,
|
499
|
+
True,
|
500
|
+
),
|
501
|
+
"t11cn": CCLSensorPreset(
|
502
|
+
"Connection: CO", CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True
|
503
|
+
),
|
504
|
+
"t10cn": CCLSensorPreset(
|
505
|
+
"Connection: CO\u2082",
|
506
|
+
CCLSensorTypes.CONNECTION,
|
507
|
+
CCLDeviceCompartment.STATUS,
|
508
|
+
True,
|
509
|
+
),
|
510
|
+
"t9cn": CCLSensorPreset(
|
511
|
+
"Connection: HCHO/VOC",
|
512
|
+
CCLSensorTypes.CONNECTION,
|
513
|
+
CCLDeviceCompartment.STATUS,
|
514
|
+
True,
|
515
|
+
),
|
516
|
+
"t1cn": CCLSensorPreset(
|
517
|
+
"Connection: Sensor Array",
|
518
|
+
CCLSensorTypes.CONNECTION,
|
519
|
+
CCLDeviceCompartment.STATUS,
|
520
|
+
True,
|
521
|
+
),
|
522
|
+
"t8cn": CCLSensorPreset(
|
523
|
+
"Connection: PM2.5/10",
|
524
|
+
CCLSensorTypes.CONNECTION,
|
525
|
+
CCLDeviceCompartment.STATUS,
|
526
|
+
True,
|
527
|
+
),
|
528
|
+
}
|
@@ -1,7 +1,7 @@
|
|
1
1
|
"""CCL API server and handler."""
|
2
|
+
|
2
3
|
from __future__ import annotations
|
3
4
|
|
4
|
-
import asyncio
|
5
5
|
import logging
|
6
6
|
|
7
7
|
from aiohttp import web
|
@@ -12,73 +12,81 @@ from .sensor import CCL_SENSORS
|
|
12
12
|
|
13
13
|
_LOGGER = logging.getLogger(__name__)
|
14
14
|
|
15
|
+
|
15
16
|
class CCLServer:
|
17
|
+
"""Represent a CCL server manager."""
|
18
|
+
|
16
19
|
LISTEN_PORT = 42373
|
17
|
-
|
20
|
+
|
18
21
|
devices: dict[str, CCLDevice] = {}
|
19
|
-
|
22
|
+
|
23
|
+
@staticmethod
|
20
24
|
def add_copy(device: CCLDevice) -> None:
|
21
25
|
"""Attach a device copy to the server."""
|
22
26
|
CCLServer.devices.setdefault(device.passkey, device)
|
23
27
|
_LOGGER.debug(CCLServer.devices)
|
24
28
|
|
25
|
-
#routes = web.RouteTableDef()
|
29
|
+
# routes = web.RouteTableDef()
|
26
30
|
|
31
|
+
@staticmethod
|
27
32
|
async def _handler(request: web.BaseRequest) -> web.Response:
|
28
33
|
"""Handle POST requests for data updating."""
|
34
|
+
|
29
35
|
class HandlerStorage:
|
36
|
+
"""Store data for a single request."""
|
37
|
+
|
30
38
|
body: dict[str, None | str | int | float]
|
31
39
|
info: dict[str, None | str]
|
32
40
|
sensors: dict[str, None | str | int | float]
|
33
|
-
|
41
|
+
|
34
42
|
_LOGGER.debug("Request received.")
|
35
|
-
|
43
|
+
|
36
44
|
# Resetting variables
|
37
45
|
_device: CCLDevice = None
|
38
46
|
|
39
47
|
HandlerStorage.body = {}
|
40
48
|
HandlerStorage.info = {}
|
41
49
|
HandlerStorage.sensors = {}
|
42
|
-
|
50
|
+
|
43
51
|
_status: None | int = None
|
44
52
|
_text: None | str = None
|
45
|
-
|
53
|
+
|
46
54
|
try:
|
47
|
-
for passkey in CCLServer.devices:
|
48
|
-
if passkey == request.match_info[
|
49
|
-
_device = CCLServer.devices[passkey]
|
55
|
+
for passkey, _device in CCLServer.devices.items():
|
56
|
+
if passkey == request.match_info["passkey"]:
|
50
57
|
break
|
51
58
|
assert _device, 404
|
52
|
-
|
53
|
-
assert request.content_type ==
|
59
|
+
|
60
|
+
assert request.content_type == "application/json", 400
|
54
61
|
assert 0 < request.content_length <= 5000, 400
|
55
|
-
|
62
|
+
|
56
63
|
HandlerStorage.body = await request.json()
|
57
64
|
_LOGGER.debug(HandlerStorage.body)
|
58
|
-
|
59
|
-
except Exception as err:
|
65
|
+
|
66
|
+
except Exception as err: # pylint: disable=broad-exception-caught
|
60
67
|
_status = err.args[0]
|
61
|
-
if _status == 400:
|
62
|
-
|
68
|
+
if _status == 400:
|
69
|
+
_text = "400 Bad Request"
|
70
|
+
elif _status == 404:
|
71
|
+
_text = "404 Not Found"
|
63
72
|
else:
|
64
73
|
_status = 500
|
65
74
|
_text = "500 Internal Server Error"
|
66
75
|
_LOGGER.debug("Request exception occured: %s", err)
|
67
|
-
|
76
|
+
return web.Response(status=_status, text=_text)
|
77
|
+
|
68
78
|
else:
|
69
79
|
for key, value in HandlerStorage.body.items():
|
70
80
|
if key in CCL_DEVICE_INFO_TYPES:
|
71
81
|
HandlerStorage.info.setdefault(key, value)
|
72
|
-
elif key in CCL_SENSORS
|
82
|
+
elif key in CCL_SENSORS:
|
73
83
|
HandlerStorage.sensors.setdefault(key, value)
|
74
|
-
|
84
|
+
|
75
85
|
_device.update_info(HandlerStorage.info)
|
76
86
|
_device.update_sensors(HandlerStorage.sensors)
|
77
87
|
_status = 200
|
78
88
|
_text = "200 OK"
|
79
89
|
_LOGGER.debug("Request processed.")
|
80
|
-
|
81
|
-
finally:
|
82
90
|
return web.Response(status=_status, text=_text)
|
83
91
|
|
84
92
|
app = web.Application()
|
@@ -87,27 +95,31 @@ class CCLServer:
|
|
87
95
|
|
88
96
|
resource = cors.add(app.router.add_resource("/{passkey}"))
|
89
97
|
route = cors.add(
|
90
|
-
resource.add_route("POST", _handler),
|
98
|
+
resource.add_route("POST", _handler),
|
99
|
+
{
|
91
100
|
"*": aiohttp_cors.ResourceOptions(
|
92
101
|
allow_credentials=True,
|
93
102
|
expose_headers="*",
|
94
103
|
allow_headers="*",
|
95
104
|
)
|
96
|
-
}
|
105
|
+
},
|
106
|
+
)
|
97
107
|
|
108
|
+
@staticmethod
|
98
109
|
async def run() -> None:
|
99
110
|
"""Try to run the API server in case none is available."""
|
100
111
|
try:
|
101
112
|
_LOGGER.debug("Trying to start the API server.")
|
102
|
-
runner = web.AppRunner(CCLServer.app)
|
103
|
-
await runner.setup()
|
104
|
-
site = web.TCPSite(runner, port=CCLServer.LISTEN_PORT)
|
113
|
+
CCLServer.runner = web.AppRunner(CCLServer.app)
|
114
|
+
await CCLServer.runner.setup()
|
115
|
+
site = web.TCPSite(CCLServer.runner, port=CCLServer.LISTEN_PORT)
|
105
116
|
await site.start()
|
106
|
-
except Exception as err:
|
117
|
+
except Exception as err: # pylint: disable=broad-exception-caught
|
107
118
|
_LOGGER.warning("Failed to run the API server: %s", err)
|
108
119
|
else:
|
109
120
|
_LOGGER.debug("Successfully started the API server.")
|
110
121
|
|
122
|
+
@staticmethod
|
111
123
|
async def stop() -> None:
|
112
124
|
"""Stop running the API server."""
|
113
125
|
await CCLServer.runner.cleanup()
|
aioccl-2024.9.7/aioccl/sensor.py
DELETED
@@ -1,218 +0,0 @@
|
|
1
|
-
from __future__ import annotations
|
2
|
-
|
3
|
-
from dataclasses import dataclass
|
4
|
-
import enum
|
5
|
-
from typing import TypedDict
|
6
|
-
|
7
|
-
class CCLSensor:
|
8
|
-
"""Class that represents a CCLSensor object in the aioCCL API."""
|
9
|
-
|
10
|
-
def __init__(self, key: str):
|
11
|
-
"""Initialize a CCL sensor."""
|
12
|
-
self._value: None | str | int | float = None
|
13
|
-
|
14
|
-
if key in CCL_SENSORS.keys():
|
15
|
-
self._key = key
|
16
|
-
|
17
|
-
@property
|
18
|
-
def key(self) -> str:
|
19
|
-
return self._key
|
20
|
-
|
21
|
-
@property
|
22
|
-
def name(self) -> str:
|
23
|
-
return CCL_SENSORS[self._key].name
|
24
|
-
|
25
|
-
@property
|
26
|
-
def sensor_type(self) -> CCLSensorTypes:
|
27
|
-
return CCL_SENSORS[self._key].sensor_type
|
28
|
-
|
29
|
-
@property
|
30
|
-
def compartment(self) -> None | str:
|
31
|
-
if CCL_SENSORS[self._key].compartment is not None:
|
32
|
-
return CCL_SENSORS[self._key].compartment.value
|
33
|
-
|
34
|
-
@property
|
35
|
-
def binary(self) -> bool:
|
36
|
-
return CCL_SENSORS[self._key].binary
|
37
|
-
|
38
|
-
@property
|
39
|
-
def value(self) -> None | str | int | float:
|
40
|
-
if self.sensor_type.name in CCL_SENSOR_VALUES:
|
41
|
-
return CCL_SENSOR_VALUES[self.sensor_type.name].get(self._value)
|
42
|
-
elif self.sensor_type == CCLSensorTypes.BATTERY_BINARY:
|
43
|
-
try:
|
44
|
-
return int(self._value) - 1
|
45
|
-
except ValueError:
|
46
|
-
pass
|
47
|
-
else:
|
48
|
-
return self._value
|
49
|
-
|
50
|
-
@value.setter
|
51
|
-
def value(self, new_value):
|
52
|
-
self._value = new_value
|
53
|
-
|
54
|
-
@dataclass
|
55
|
-
class CCLSensorPreset:
|
56
|
-
name: str
|
57
|
-
sensor_type: str
|
58
|
-
compartment: None | CCLDeviceCompartment = None
|
59
|
-
binary: bool = False
|
60
|
-
|
61
|
-
class CCLSensorTypes(enum.Enum):
|
62
|
-
PRESSURE = 1
|
63
|
-
TEMPERATURE = 2
|
64
|
-
HUMIDITY = 3
|
65
|
-
WIND_DIRECITON = 4
|
66
|
-
WIND_SPEED = 5
|
67
|
-
RAIN_RATE = 6
|
68
|
-
RAINFALL = 7
|
69
|
-
UVI = 8
|
70
|
-
RADIATION = 9
|
71
|
-
BATTERY_BINARY = 10
|
72
|
-
CONNECTION = 11
|
73
|
-
CH_SENSOR_TYPE = 12
|
74
|
-
CO = 13
|
75
|
-
CO2 = 14
|
76
|
-
VOLATILE = 15
|
77
|
-
VOC = 16
|
78
|
-
PM10 = 17
|
79
|
-
PM25 = 18
|
80
|
-
AQI = 19
|
81
|
-
LEAKAGE = 20
|
82
|
-
BATTERY = 21
|
83
|
-
LIGHTNING_DISTANCE = 22
|
84
|
-
LIGHTNING_DURATION = 23
|
85
|
-
LIGHTNING_FREQUENCY = 24
|
86
|
-
BATTERY_VOLTAGE = 25
|
87
|
-
|
88
|
-
class CCLDeviceCompartment(enum.Enum):
|
89
|
-
MAIN = 'Console and Sensor Array'
|
90
|
-
OTHER = 'Other Sensors'
|
91
|
-
STATUS = 'Status'
|
92
|
-
|
93
|
-
CCL_SENSOR_VALUES: dict[str, dict[str, str]] = {
|
94
|
-
'CH_SENSOR_TYPE': {
|
95
|
-
2: 'Thermo-Hygro',
|
96
|
-
3: 'Pool',
|
97
|
-
4: 'Soil',
|
98
|
-
},
|
99
|
-
'LEAKAGE': {
|
100
|
-
0: 'No Leak',
|
101
|
-
1: 'Leaking',
|
102
|
-
}
|
103
|
-
}
|
104
|
-
|
105
|
-
CCL_SENSORS: dict[str, CCLSensorPreset] = {
|
106
|
-
# Main Sensors 12-34
|
107
|
-
'abar': CCLSensorPreset('Air Pressure (Absolute)', CCLSensorTypes.PRESSURE, CCLDeviceCompartment.MAIN),
|
108
|
-
'rbar': CCLSensorPreset('Air Pressure (Relative)', CCLSensorTypes.PRESSURE, CCLDeviceCompartment.MAIN),
|
109
|
-
't1dew': CCLSensorPreset('Index: Dew Point', CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN),
|
110
|
-
't1feels': CCLSensorPreset('Index: Feels Like', CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN),
|
111
|
-
't1heat': CCLSensorPreset('Index: Heat Index', CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN),
|
112
|
-
't1wbgt': CCLSensorPreset('Index: WBGT', CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN),
|
113
|
-
't1chill': CCLSensorPreset('Index: Wind Chill', CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN),
|
114
|
-
'inhum': CCLSensorPreset('Indoor Humidity', CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.MAIN),
|
115
|
-
'intem': CCLSensorPreset('Indoor Temperature', CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN),
|
116
|
-
't1solrad': CCLSensorPreset('Light Intensity', CCLSensorTypes.RADIATION, CCLDeviceCompartment.MAIN),
|
117
|
-
't1hum': CCLSensorPreset('Outdoor Humidity', CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.MAIN),
|
118
|
-
't1tem': CCLSensorPreset('Outdoor Temperature', CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.MAIN),
|
119
|
-
't1rainra': CCLSensorPreset('Rain Rate', CCLSensorTypes.RAIN_RATE, CCLDeviceCompartment.MAIN),
|
120
|
-
't1rainhr': CCLSensorPreset('Rainfall: Hourly ', CCLSensorTypes.RAINFALL, CCLDeviceCompartment.MAIN),
|
121
|
-
't1raindy': CCLSensorPreset('Rainfall: Daily', CCLSensorTypes.RAINFALL, CCLDeviceCompartment.MAIN),
|
122
|
-
't1rainwy': CCLSensorPreset('Rainfall: Weekly', CCLSensorTypes.RAINFALL, CCLDeviceCompartment.MAIN),
|
123
|
-
't1rainmth': CCLSensorPreset('Rainfall: Monthly', CCLSensorTypes.RAINFALL, CCLDeviceCompartment.MAIN),
|
124
|
-
't1rainyr': CCLSensorPreset('Rainfall: Yearly', CCLSensorTypes.RAINFALL, CCLDeviceCompartment.MAIN),
|
125
|
-
't1uvi': CCLSensorPreset('UV Index', CCLSensorTypes.UVI, CCLDeviceCompartment.MAIN),
|
126
|
-
't1wdir': CCLSensorPreset('Wind Direction', CCLSensorTypes.WIND_DIRECITON, CCLDeviceCompartment.MAIN),
|
127
|
-
't1wgust': CCLSensorPreset('Wind Gust', CCLSensorTypes.WIND_SPEED, CCLDeviceCompartment.MAIN),
|
128
|
-
't1ws': CCLSensorPreset('Wind Speed', CCLSensorTypes.WIND_SPEED, CCLDeviceCompartment.MAIN),
|
129
|
-
't1ws10mav': CCLSensorPreset('Wind Speed (10 mins AVG.)', CCLSensorTypes.WIND_SPEED, CCLDeviceCompartment.MAIN),
|
130
|
-
# Additional Sensors 35-77
|
131
|
-
't11co': CCLSensorPreset('Air Quality: CO', CCLSensorTypes.CO, CCLDeviceCompartment.OTHER),
|
132
|
-
't10co2': CCLSensorPreset('Air Quality: CO\u2082', CCLSensorTypes.CO2, CCLDeviceCompartment.OTHER),
|
133
|
-
't9hcho': CCLSensorPreset('Air Quality: HCHO', CCLSensorTypes.VOLATILE, CCLDeviceCompartment.OTHER),
|
134
|
-
't8pm10': CCLSensorPreset('Air Quality: PM10', CCLSensorTypes.PM10, CCLDeviceCompartment.OTHER),
|
135
|
-
't8pm10ai': CCLSensorPreset('Air Quality: PM10 AQI', CCLSensorTypes.AQI, CCLDeviceCompartment.OTHER),
|
136
|
-
't8pm25': CCLSensorPreset('Air Quality: PM2.5', CCLSensorTypes.PM25, CCLDeviceCompartment.OTHER),
|
137
|
-
't8pm25ai': CCLSensorPreset('Air Quality: PM2.5 AQI', CCLSensorTypes.AQI, CCLDeviceCompartment.OTHER),
|
138
|
-
't9voclv': CCLSensorPreset('Air Quality: VOC Level', CCLSensorTypes.VOC, CCLDeviceCompartment.OTHER),
|
139
|
-
't234c1tem': CCLSensorPreset('CH1 Temperature', CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER),
|
140
|
-
't234c1hum': CCLSensorPreset('CH1 Humidity', CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER),
|
141
|
-
't234c1tp': CCLSensorPreset('CH1 Type', CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER),
|
142
|
-
't234c2tem': CCLSensorPreset('CH2 Temperature', CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER),
|
143
|
-
't234c2hum': CCLSensorPreset('CH2 Humidity', CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER),
|
144
|
-
't234c2tp': CCLSensorPreset('CH2 Type', CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER),
|
145
|
-
't234c3tem': CCLSensorPreset('CH3 Temperature', CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER),
|
146
|
-
't234c3hum': CCLSensorPreset('CH3 Humidity', CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER),
|
147
|
-
't234c3tp': CCLSensorPreset('CH3 Type', CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER),
|
148
|
-
't234c4tem': CCLSensorPreset('CH4 Temperature', CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER),
|
149
|
-
't234c4hum': CCLSensorPreset('CH4 Humidity', CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER),
|
150
|
-
't234c4tp': CCLSensorPreset('CH4 Type', CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER),
|
151
|
-
't234c5tem': CCLSensorPreset('CH5 Temperature', CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER),
|
152
|
-
't234c5hum': CCLSensorPreset('CH5 Humidity', CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER),
|
153
|
-
't234c5tp': CCLSensorPreset('CH5 Type', CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER),
|
154
|
-
't234c6tem': CCLSensorPreset('CH6 Temperature', CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER),
|
155
|
-
't234c6hum': CCLSensorPreset('CH6 Humidity', CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER),
|
156
|
-
't234c6tp': CCLSensorPreset('CH6 Type', CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER),
|
157
|
-
't234c7tem': CCLSensorPreset('CH7 Temperature', CCLSensorTypes.TEMPERATURE, CCLDeviceCompartment.OTHER),
|
158
|
-
't234c7hum': CCLSensorPreset('CH7 Humidity', CCLSensorTypes.HUMIDITY, CCLDeviceCompartment.OTHER),
|
159
|
-
't234c7tp': CCLSensorPreset('CH7 Type', CCLSensorTypes.CH_SENSOR_TYPE, CCLDeviceCompartment.OTHER),
|
160
|
-
't6c1wls': CCLSensorPreset('Leakage CH1', CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER),
|
161
|
-
't6c2wls': CCLSensorPreset('Leakage CH2', CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER),
|
162
|
-
't6c3wls': CCLSensorPreset('Leakage CH3', CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER),
|
163
|
-
't6c4wls': CCLSensorPreset('Leakage CH4', CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER),
|
164
|
-
't6c5wls': CCLSensorPreset('Leakage CH5', CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER),
|
165
|
-
't6c6wls': CCLSensorPreset('Leakage CH6', CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER),
|
166
|
-
't6c7wls': CCLSensorPreset('Leakage CH7', CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER),
|
167
|
-
't5lskm': CCLSensorPreset('Lightning Distance', CCLSensorTypes.LIGHTNING_DISTANCE, CCLDeviceCompartment.OTHER),
|
168
|
-
't5lsf': CCLSensorPreset('Lightning: Past 60 mins Strikes', CCLSensorTypes.LIGHTNING_FREQUENCY, CCLDeviceCompartment.OTHER),
|
169
|
-
't5ls30mtc': CCLSensorPreset('Lightning: Strikes in 30 mins', CCLSensorTypes.LIGHTNING_FREQUENCY, CCLDeviceCompartment.OTHER),
|
170
|
-
't5ls5mtc': CCLSensorPreset('Lightning: Strikes in 5 mins', CCLSensorTypes.LIGHTNING_FREQUENCY, CCLDeviceCompartment.OTHER),
|
171
|
-
't5ls1dtc': CCLSensorPreset('Lightning: Strikes in day', CCLSensorTypes.LIGHTNING_FREQUENCY, CCLDeviceCompartment.OTHER),
|
172
|
-
't5ls1htc': CCLSensorPreset('Lightning: Strikes in hour', CCLSensorTypes.LIGHTNING_FREQUENCY, CCLDeviceCompartment.OTHER),
|
173
|
-
|
174
|
-
# Status 78-119
|
175
|
-
't234c1bat': CCLSensorPreset('Battery: CH1', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
176
|
-
't234c2bat': CCLSensorPreset('Battery: CH2', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
177
|
-
't234c3bat': CCLSensorPreset('Battery: CH3', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
178
|
-
't234c4bat': CCLSensorPreset('Battery: CH4', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
179
|
-
't234c5bat': CCLSensorPreset('Battery: CH5', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
180
|
-
't234c6bat': CCLSensorPreset('Battery: CH6', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
181
|
-
't234c7bat': CCLSensorPreset('Battery: CH7', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
182
|
-
't11bat': CCLSensorPreset('Battery Level: CO', CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS),
|
183
|
-
't10bat': CCLSensorPreset('Battery Level: CO\u2082', CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS),
|
184
|
-
'inbat': CCLSensorPreset('Battery: Console', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
185
|
-
't9bat': CCLSensorPreset('Battery Level: HCHO/VOC', CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS),
|
186
|
-
't6c1bat': CCLSensorPreset('Battery: Leakage CH1', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
187
|
-
't6c2bat': CCLSensorPreset('Battery: Leakage CH2', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
188
|
-
't6c3bat': CCLSensorPreset('Battery: Leakage CH3', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
189
|
-
't6c4bat': CCLSensorPreset('Battery: Leakage CH4', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
190
|
-
't6c5bat': CCLSensorPreset('Battery: Leakage CH5', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
191
|
-
't6c6bat': CCLSensorPreset('Battery: Leakage CH6', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
192
|
-
't6c7bat': CCLSensorPreset('Battery: Leakage CH7', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
193
|
-
't5lsbat': CCLSensorPreset('Battery: Lightning Sensor', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
194
|
-
't1bat': CCLSensorPreset('Battery: Sensor Array', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
195
|
-
't1batvt': CCLSensorPreset('Battery Voltage: Sensor Array', CCLSensorTypes.BATTERY_VOLTAGE, CCLDeviceCompartment.STATUS),
|
196
|
-
't8bat': CCLSensorPreset('Battery Level: PM2.5/10', CCLSensorTypes.BATTERY, CCLDeviceCompartment.STATUS),
|
197
|
-
't234c1cn': CCLSensorPreset('Connection: CH1', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
198
|
-
't234c2cn': CCLSensorPreset('Connection: CH2', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
199
|
-
't234c3cn': CCLSensorPreset('Connection: CH3', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
200
|
-
't234c4cn': CCLSensorPreset('Connection: CH4', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
201
|
-
't234c5cn': CCLSensorPreset('Connection: CH5', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
202
|
-
't234c6cn': CCLSensorPreset('Connection: CH6', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
203
|
-
't234c7cn': CCLSensorPreset('Connection: CH7', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
204
|
-
't6c1cn': CCLSensorPreset('Connection: Leakage CH1', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
205
|
-
't6c2cn': CCLSensorPreset('Connection: Leakage CH2', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
206
|
-
't6c3cn': CCLSensorPreset('Connection: Leakage CH3', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
207
|
-
't6c4cn': CCLSensorPreset('Connection: Leakage CH4', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
208
|
-
't6c5cn': CCLSensorPreset('Connection: Leakage CH5', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
209
|
-
't6c6cn': CCLSensorPreset('Connection: Leakage CH6', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
210
|
-
't6c7cn': CCLSensorPreset('Connection: Leakage CH7', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
211
|
-
't5lscn': CCLSensorPreset('Connection: Lightning Sensor', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
212
|
-
't11cn': CCLSensorPreset('Connection: CO', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
213
|
-
't10cn': CCLSensorPreset('Connection: CO\u2082', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
214
|
-
't9cn': CCLSensorPreset('Connection: HCHO/VOC', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
215
|
-
't6c1cn': CCLSensorPreset('Connection: Leakage CH1', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
216
|
-
't1cn': CCLSensorPreset('Connection: Sensor Array', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
217
|
-
't8cn': CCLSensorPreset('Connection: PM2.5/10', CCLSensorTypes.CONNECTION, CCLDeviceCompartment.STATUS, True),
|
218
|
-
}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|