aioccl 2024.9.1__tar.gz → 2024.9.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-2024.9.1 → aioccl-2024.9.3}/PKG-INFO +1 -1
- {aioccl-2024.9.1 → aioccl-2024.9.3}/aioccl/device.py +1 -6
- {aioccl-2024.9.1 → aioccl-2024.9.3}/aioccl/sensor.py +18 -17
- {aioccl-2024.9.1 → aioccl-2024.9.3}/aioccl.egg-info/PKG-INFO +1 -1
- {aioccl-2024.9.1 → aioccl-2024.9.3}/setup.py +1 -1
- {aioccl-2024.9.1 → aioccl-2024.9.3}/LICENSE +0 -0
- {aioccl-2024.9.1 → aioccl-2024.9.3}/README.md +0 -0
- {aioccl-2024.9.1 → aioccl-2024.9.3}/aioccl/__init__.py +0 -0
- {aioccl-2024.9.1 → aioccl-2024.9.3}/aioccl/server.py +0 -0
- {aioccl-2024.9.1 → aioccl-2024.9.3}/aioccl.egg-info/SOURCES.txt +0 -0
- {aioccl-2024.9.1 → aioccl-2024.9.3}/aioccl.egg-info/dependency_links.txt +0 -0
- {aioccl-2024.9.1 → aioccl-2024.9.3}/aioccl.egg-info/requires.txt +0 -0
- {aioccl-2024.9.1 → aioccl-2024.9.3}/aioccl.egg-info/top_level.txt +0 -0
- {aioccl-2024.9.1 → aioccl-2024.9.3}/setup.cfg +0 -0
@@ -9,7 +9,7 @@ from .sensor import CCLSensor, CCL_SENSORS
|
|
9
9
|
|
10
10
|
_LOGGER = logging.getLogger(__name__)
|
11
11
|
|
12
|
-
CCL_DEVICE_INFO_TYPES = ("serial_no", "mac_address", "model", "
|
12
|
+
CCL_DEVICE_INFO_TYPES = ("serial_no", "mac_address", "model", "fw_ver")
|
13
13
|
|
14
14
|
class CCLDevice:
|
15
15
|
def __init__(self, passkey: str):
|
@@ -43,10 +43,6 @@ class CCLDevice:
|
|
43
43
|
def name(self) -> str | None:
|
44
44
|
return self._model + " - " + self.device_id
|
45
45
|
|
46
|
-
@property
|
47
|
-
def serial_no(self) -> str | None:
|
48
|
-
return self._serial_no
|
49
|
-
|
50
46
|
@property
|
51
47
|
def mac_address(self) -> str | None:
|
52
48
|
return self._mac_address
|
@@ -69,7 +65,6 @@ class CCLDevice:
|
|
69
65
|
|
70
66
|
def update_info(self, info: dict[str, None | str]) -> None:
|
71
67
|
"""Add or update device info."""
|
72
|
-
self._serial_no = info.get('serial_no')
|
73
68
|
self._mac_address = info.get('mac_address')
|
74
69
|
self._model = info.get('model')
|
75
70
|
self._fw_ver = info.get('fw_ver')
|
@@ -39,18 +39,15 @@ class CCLSensor:
|
|
39
39
|
def value(self) -> None | str | int | float:
|
40
40
|
if self.sensor_type.name in CCL_SENSOR_VALUES:
|
41
41
|
return CCL_SENSOR_VALUES[self.sensor_type.name].get(self._value)
|
42
|
-
elif self.sensor_type == CCLSensorTypes.BATTERY_BINARY:
|
43
|
-
return self._value - 1
|
44
42
|
elif self.sensor_type in CCL_LEVEL_SENSORS:
|
45
43
|
return 'Lv ' + self._value
|
46
|
-
|
47
|
-
try:
|
48
|
-
return int(self._value)
|
49
|
-
except ValueError:
|
44
|
+
elif self.sensor_type == CCLSensorTypes.BATTERY_BINARY:
|
50
45
|
try:
|
51
|
-
return
|
46
|
+
return int(self._value) - 1
|
52
47
|
except ValueError:
|
53
|
-
|
48
|
+
pass
|
49
|
+
else:
|
50
|
+
return self._value
|
54
51
|
|
55
52
|
@value.setter
|
56
53
|
def value(self, new_value):
|
@@ -85,9 +82,9 @@ class CCLSensorTypes(enum.Enum):
|
|
85
82
|
AQI = 19
|
86
83
|
LEAKAGE = 20
|
87
84
|
BATTERY = 21
|
88
|
-
|
89
|
-
|
90
|
-
|
85
|
+
LIGHTNING_DISTANCE = 22
|
86
|
+
LIGHTNING_DURATION = 23
|
87
|
+
LIGHTNING_FREQUENCY = 24
|
91
88
|
|
92
89
|
class CCLDeviceCompartment(enum.Enum):
|
93
90
|
MAIN = 'Console and Sensor Array'
|
@@ -101,8 +98,8 @@ CCL_SENSOR_VALUES: dict[str, dict[str, str]] = {
|
|
101
98
|
'4': 'Soil',
|
102
99
|
},
|
103
100
|
'LEAKAGE': {
|
104
|
-
'0': '
|
105
|
-
'1': '
|
101
|
+
'0': 'No Leak',
|
102
|
+
'1': 'Leaking',
|
106
103
|
}
|
107
104
|
}
|
108
105
|
|
@@ -170,10 +167,14 @@ CCL_SENSORS: dict[str, CCLSensorPreset] = {
|
|
170
167
|
't6c5wls': CCLSensorPreset('Leakage CH5', CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER),
|
171
168
|
't6c6wls': CCLSensorPreset('Leakage CH6', CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER),
|
172
169
|
't6c7wls': CCLSensorPreset('Leakage CH7', CCLSensorTypes.LEAKAGE, CCLDeviceCompartment.OTHER),
|
173
|
-
't5lskm': CCLSensorPreset('Lightning Distance', CCLSensorTypes.
|
174
|
-
't5lst': CCLSensorPreset('Lightning: Last Strike', CCLSensorTypes.
|
175
|
-
't5lsf': CCLSensorPreset('Lightning:
|
176
|
-
'
|
170
|
+
't5lskm': CCLSensorPreset('Lightning Distance', CCLSensorTypes.LIGHTNING_DISTANCE, CCLDeviceCompartment.OTHER),
|
171
|
+
't5lst': CCLSensorPreset('Lightning: Last Strike', CCLSensorTypes.LIGHTNING_DURATION, CCLDeviceCompartment.OTHER),
|
172
|
+
't5lsf': CCLSensorPreset('Lightning: Past 60 mins Strikes', CCLSensorTypes.LIGHTNING_FREQUENCY, CCLDeviceCompartment.OTHER),
|
173
|
+
't5ls30mtc': CCLSensorPreset('Lightning: Strikes in 30 mins', CCLSensorTypes.LIGHTNING_FREQUENCY, CCLDeviceCompartment.OTHER),
|
174
|
+
't5ls5mtc': CCLSensorPreset('Lightning: Strikes in 5 mins', CCLSensorTypes.LIGHTNING_FREQUENCY, CCLDeviceCompartment.OTHER),
|
175
|
+
't5ls1dtc': CCLSensorPreset('Lightning: Strikes in day', CCLSensorTypes.LIGHTNING_FREQUENCY, CCLDeviceCompartment.OTHER),
|
176
|
+
't5ls1htc': CCLSensorPreset('Lightning: Strikes in hour', CCLSensorTypes.LIGHTNING_FREQUENCY, CCLDeviceCompartment.OTHER),
|
177
|
+
|
177
178
|
# Status 78-119
|
178
179
|
't234c1bat': CCLSensorPreset('Battery: CH1', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
179
180
|
't234c2bat': CCLSensorPreset('Battery: CH2', CCLSensorTypes.BATTERY_BINARY, CCLDeviceCompartment.STATUS, True),
|
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
|