bwt-api 1.0.3__tar.gz → 1.0.4__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.
- {bwt_api-1.0.3 → bwt_api-1.0.4}/PKG-INFO +1 -1
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api/data.py +12 -46
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api.egg-info/PKG-INFO +1 -1
- bwt_api-1.0.4/src/bwt_api.egg-info/scm_version.json +8 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tests/data/smartdos/gatt_0104.json +1 -1
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tests/data/smartdos/gatt_0201.json +2 -2
- bwt_api-1.0.3/src/bwt_api.egg-info/scm_version.json +0 -8
- {bwt_api-1.0.3 → bwt_api-1.0.4}/.coveragerc +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/.devcontainer/devcontainer.json +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/.github/workflows/python-package.yml +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/.github/workflows/python-publish.yml +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/.gitignore +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/LICENSE.txt +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/README.rst +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/pyproject.toml +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/setup.cfg +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/setup.py +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api/__init__.py +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api/api.py +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api/bwt.py +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api/bwt_api.py +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api/error.py +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api/exception.py +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api/silk_api.py +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api/skeleton.py +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api/smart_dos_api.py +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api.egg-info/SOURCES.txt +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api.egg-info/dependency_links.txt +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api.egg-info/entry_points.txt +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api.egg-info/not-zip-safe +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api.egg-info/requires.txt +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api.egg-info/scm_file_list.json +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/src/bwt_api.egg-info/top_level.txt +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tests/conftest.py +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tests/data/perla/GetCurrentData.json +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tests/data/perla/GetDailyData.json +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tests/data/perla/GetMonthlyData.json +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tests/data/perla/GetYearlyData.json +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tests/data/silk/registers.json +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tests/data/smartdos/gatt_0202.json +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tests/data/smartdos/gatt_0208.json +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tests/data/smartdos/gatt_0401.json +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tests/data/smartdos/gatt_0402.json +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tests/data/smartdos/gatt_0503.json +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tests/data/smartdos/gatt_0505.json +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tests/test_api.py +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tests/test_distinguish.py +0 -0
- {bwt_api-1.0.3 → bwt_api-1.0.4}/tox.ini +0 -0
|
@@ -33,55 +33,21 @@ class SmartDosStatus(enum.IntEnum):
|
|
|
33
33
|
def _missing_(cls, value):
|
|
34
34
|
return None
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"""Return SmartDosStatus values considered normal/OK."""
|
|
39
|
-
return [
|
|
40
|
-
cls.STANDBY,
|
|
41
|
-
cls.METERING_ACTIVE,
|
|
42
|
-
]
|
|
36
|
+
def is_fatal(self) -> bool:
|
|
37
|
+
return self not in WARNING_CODES
|
|
43
38
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
"""Return SmartDosStatus values that indicate warnings."""
|
|
47
|
-
return [
|
|
48
|
-
cls.MINERAL_CONTAINER_LEVEL_LOW,
|
|
49
|
-
cls.SMART_MINERAL_RUNNING_LOW,
|
|
50
|
-
]
|
|
39
|
+
def is_normal(self) -> bool:
|
|
40
|
+
return self in NORMAL_CODES
|
|
51
41
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
cls.MINERAL_CONTAINER_EMPTY,
|
|
57
|
-
cls.PUMP_FAULT,
|
|
58
|
-
cls.PUMP_POWER_FAULT,
|
|
59
|
-
cls.SMART_MINERAL_RUN_OUT,
|
|
60
|
-
cls.AQA_VOLUME_ALARM,
|
|
61
|
-
cls.AQA_WATCH_ALARM,
|
|
62
|
-
cls.AQA_MAXFLOW_ALARM,
|
|
63
|
-
cls.PUMP_CONTROL_FAULT,
|
|
64
|
-
]
|
|
42
|
+
NORMAL_CODES = [
|
|
43
|
+
SmartDosStatus.STANDBY,
|
|
44
|
+
SmartDosStatus.METERING_ACTIVE,
|
|
45
|
+
]
|
|
65
46
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
Accepts either an int or a SmartDosStatus member. Returns `BwtStatus.OK`,
|
|
71
|
-
`BwtStatus.WARNING`, or `BwtStatus.ERROR`, or `None` for unknown values.
|
|
72
|
-
"""
|
|
73
|
-
try:
|
|
74
|
-
status = cls(value)
|
|
75
|
-
except Exception:
|
|
76
|
-
return None
|
|
77
|
-
|
|
78
|
-
if status in cls.normal():
|
|
79
|
-
return BwtStatus.OK
|
|
80
|
-
if status in cls.warning():
|
|
81
|
-
return BwtStatus.WARNING
|
|
82
|
-
if status in cls.error():
|
|
83
|
-
return BwtStatus.ERROR
|
|
84
|
-
return None
|
|
47
|
+
WARNING_CODES = [
|
|
48
|
+
SmartDosStatus.MINERAL_CONTAINER_LEVEL_LOW,
|
|
49
|
+
SmartDosStatus.SMART_MINERAL_RUNNING_LOW,
|
|
50
|
+
]
|
|
85
51
|
|
|
86
52
|
|
|
87
53
|
class SubstanceType(enum.IntEnum):
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"fwRev": "1.2.0",
|
|
3
3
|
"hwRev": "2.4.0(A)",
|
|
4
|
-
"productCode": "
|
|
5
|
-
"iotDevId": "
|
|
4
|
+
"productCode": "1AAA-2BBB",
|
|
5
|
+
"iotDevId": "abcdefgh-1234-5678-abcd-1234567890ab",
|
|
6
6
|
"iotDevType": "bwt_bewados",
|
|
7
7
|
"iotDevVariant": "dev",
|
|
8
8
|
"uptime": 6510811,
|
|
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
|
|
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
|
|
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
|
|
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
|
|
File without changes
|