aioccl 2024.9.1__py3-none-any.whl → 2024.9.2__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/sensor.py +7 -4
- {aioccl-2024.9.1.dist-info → aioccl-2024.9.2.dist-info}/METADATA +1 -1
- aioccl-2024.9.2.dist-info/RECORD +9 -0
- aioccl-2024.9.1.dist-info/RECORD +0 -9
- {aioccl-2024.9.1.dist-info → aioccl-2024.9.2.dist-info}/LICENSE +0 -0
- {aioccl-2024.9.1.dist-info → aioccl-2024.9.2.dist-info}/WHEEL +0 -0
- {aioccl-2024.9.1.dist-info → aioccl-2024.9.2.dist-info}/top_level.txt +0 -0
aioccl/sensor.py
CHANGED
@@ -39,10 +39,13 @@ 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
|
44
|
+
elif self.sensor_type == CCLSensorTypes.BATTERY_BINARY:
|
45
|
+
try:
|
46
|
+
return int(self._value) - 1
|
47
|
+
except ValueError:
|
48
|
+
pass
|
46
49
|
|
47
50
|
try:
|
48
51
|
return int(self._value)
|
@@ -101,8 +104,8 @@ CCL_SENSOR_VALUES: dict[str, dict[str, str]] = {
|
|
101
104
|
'4': 'Soil',
|
102
105
|
},
|
103
106
|
'LEAKAGE': {
|
104
|
-
'0': '
|
105
|
-
'1': '
|
107
|
+
'0': 'No Leak',
|
108
|
+
'1': 'Leaking',
|
106
109
|
}
|
107
110
|
}
|
108
111
|
|
@@ -0,0 +1,9 @@
|
|
1
|
+
aioccl/__init__.py,sha256=iL1OC2F_rf3qkswi-bO8Y_uj2-lf284LCnyxwqdLUU8,137
|
2
|
+
aioccl/device.py,sha256=Cr33h7HrM2YS-u9BxoJASd2X5nBba37_fC85XunhVcs,5132
|
3
|
+
aioccl/sensor.py,sha256=XETDVRuOnxPttEE9Y-KYDgZHFvU4IbUHwBTMaa66TsY,14351
|
4
|
+
aioccl/server.py,sha256=-ZDii20CLqj4_jqVVqRMlnvg-CCtJiZjuMMDamem0DE,3717
|
5
|
+
aioccl-2024.9.2.dist-info/LICENSE,sha256=PBRsTHchx7o0TQ2R2ktEAfFmn1iNHTxcOP_xaeuSAuo,11349
|
6
|
+
aioccl-2024.9.2.dist-info/METADATA,sha256=m2Orbnjsypy7Lb-Q4fbtmdB_taocxDYVDoAjHqJffXE,769
|
7
|
+
aioccl-2024.9.2.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
|
8
|
+
aioccl-2024.9.2.dist-info/top_level.txt,sha256=-xIJfyfXTaW_EH7XCIHyxjSSSwjLmawa2qhsrHZH1vA,7
|
9
|
+
aioccl-2024.9.2.dist-info/RECORD,,
|
aioccl-2024.9.1.dist-info/RECORD
DELETED
@@ -1,9 +0,0 @@
|
|
1
|
-
aioccl/__init__.py,sha256=iL1OC2F_rf3qkswi-bO8Y_uj2-lf284LCnyxwqdLUU8,137
|
2
|
-
aioccl/device.py,sha256=Cr33h7HrM2YS-u9BxoJASd2X5nBba37_fC85XunhVcs,5132
|
3
|
-
aioccl/sensor.py,sha256=ff8KKuUKMm0puH-ZC-E6f0xBgNAPssh1KVrTSBpJgiQ,14273
|
4
|
-
aioccl/server.py,sha256=-ZDii20CLqj4_jqVVqRMlnvg-CCtJiZjuMMDamem0DE,3717
|
5
|
-
aioccl-2024.9.1.dist-info/LICENSE,sha256=PBRsTHchx7o0TQ2R2ktEAfFmn1iNHTxcOP_xaeuSAuo,11349
|
6
|
-
aioccl-2024.9.1.dist-info/METADATA,sha256=tbMk1LfDXALMQWQCAZavWGEaDfZfY8QYhWZHVmBDrWY,769
|
7
|
-
aioccl-2024.9.1.dist-info/WHEEL,sha256=UvcQYKBHoFqaQd6LKyqHw9fxEolWLQnlzP0h_LgJAfI,91
|
8
|
-
aioccl-2024.9.1.dist-info/top_level.txt,sha256=-xIJfyfXTaW_EH7XCIHyxjSSSwjLmawa2qhsrHZH1vA,7
|
9
|
-
aioccl-2024.9.1.dist-info/RECORD,,
|
File without changes
|
File without changes
|
File without changes
|