bleparser 3.7.1__tar.gz → 3.7.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.
Files changed (51) hide show
  1. {bleparser-3.7.1 → bleparser-3.7.3}/PKG-INFO +15 -3
  2. {bleparser-3.7.1 → bleparser-3.7.3}/README.md +11 -1
  3. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/bthome.py +8 -1
  4. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/bthome_const.py +3 -0
  5. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser.egg-info/PKG-INFO +15 -3
  6. {bleparser-3.7.1 → bleparser-3.7.3}/setup.cfg +1 -1
  7. {bleparser-3.7.1 → bleparser-3.7.3}/LICENSE +0 -0
  8. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/__init__.py +0 -0
  9. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/acconeer.py +0 -0
  10. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/airmentor.py +0 -0
  11. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/almendo.py +0 -0
  12. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/altbeacon.py +0 -0
  13. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/amazfit.py +0 -0
  14. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/atc.py +0 -0
  15. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/bluemaestro.py +0 -0
  16. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/bparasite.py +0 -0
  17. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/brifit.py +0 -0
  18. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/const.py +0 -0
  19. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/govee.py +0 -0
  20. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/helpers.py +0 -0
  21. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/hhcc.py +0 -0
  22. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/ibeacon.py +0 -0
  23. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/inkbird.py +0 -0
  24. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/inode.py +0 -0
  25. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/jaalee.py +0 -0
  26. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/jinou.py +0 -0
  27. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/kegtron.py +0 -0
  28. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/kkm.py +0 -0
  29. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/laica.py +0 -0
  30. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/mikrotik.py +0 -0
  31. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/miscale.py +0 -0
  32. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/moat.py +0 -0
  33. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/oral_b.py +0 -0
  34. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/qingping.py +0 -0
  35. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/relsib.py +0 -0
  36. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/ruuvitag.py +0 -0
  37. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/sensirion.py +0 -0
  38. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/sensorpush.py +0 -0
  39. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/smartdry.py +0 -0
  40. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/switchbot.py +0 -0
  41. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/teltonika.py +0 -0
  42. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/thermoplus.py +0 -0
  43. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/thermopro.py +0 -0
  44. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/tilt.py +0 -0
  45. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/xiaogui.py +0 -0
  46. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser/xiaomi.py +0 -0
  47. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser.egg-info/SOURCES.txt +0 -0
  48. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser.egg-info/dependency_links.txt +0 -0
  49. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser.egg-info/requires.txt +0 -0
  50. {bleparser-3.7.1 → bleparser-3.7.3}/package/bleparser.egg-info/top_level.txt +0 -0
  51. {bleparser-3.7.1 → bleparser-3.7.3}/pyproject.toml +0 -0
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: bleparser
3
- Version: 3.7.1
3
+ Version: 3.7.3
4
4
  Summary: Parser for passive BLE advertisements
5
5
  Home-page: https://github.com/Ernst79/bleparser
6
6
  Author: Ernst79
@@ -12,6 +12,8 @@ Classifier: Operating System :: OS Independent
12
12
  Requires-Python: >=3.8
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
+ Requires-Dist: pycryptodomex
16
+ Dynamic: license-file
15
17
 
16
18
  # BLE parser for passive BLE advertisements
17
19
 
@@ -101,7 +103,7 @@ sensor_data, tracker_data = self.parse_advertisement(
101
103
  )
102
104
  ```
103
105
 
104
- `service_data_list` and `man_spec_data_list` have to be in a list, as a BKE advertisement can contain multiple service data/manufacturer specific data packets.
106
+ `service_data_list` and `man_spec_data_list` have to be in a list, as a BLE advertisement can contain multiple service data/manufacturer specific data packets.
105
107
 
106
108
  **report_unknown**
107
109
 
@@ -119,6 +121,11 @@ Boolean. Most sensors send multipe advertisements with the exact same data, to i
119
121
 
120
122
  List with MAC addresses or UUIDs of devices that are being parsed, if `discovery` is set to `False`. If `discovery` is set to `True`, all supported sensors will be parsed. Default: `[]`
121
123
 
124
+ The MAC addresses should be in bytes.
125
+ ```python
126
+ sensor_whitelist=[bytes.fromhex("A4:C1:38:56:53:84".replace(":", ""))],
127
+ ```
128
+
122
129
  **tracker_whitelist**
123
130
 
124
131
  List with devices (MAC addresses or UUIDs) to track. Default: `[]`
@@ -127,6 +134,11 @@ List with devices (MAC addresses or UUIDs) to track. Default: `[]`
127
134
 
128
135
  Dictionary with mac + encryption key pairs, for sensors that require an encryption key to decrypt the payload. Default: `{}`
129
136
 
137
+ The mac and encryption key pairs should be in bytes.
138
+ ```python
139
+ aeskeys={bytes.fromhex("A4:C1:38:56:53:84".replace(":", "")): bytes.fromhex("a115210eed7a88e50ad52662e732a9fb") for mac, aeskey in AESKEYS.items()},
140
+ ```
141
+
130
142
  ## Result
131
143
 
132
144
  The parser result are two two dictionaries, one with sensor data (e.g. temperature readings) and one with tracking data.
@@ -86,7 +86,7 @@ sensor_data, tracker_data = self.parse_advertisement(
86
86
  )
87
87
  ```
88
88
 
89
- `service_data_list` and `man_spec_data_list` have to be in a list, as a BKE advertisement can contain multiple service data/manufacturer specific data packets.
89
+ `service_data_list` and `man_spec_data_list` have to be in a list, as a BLE advertisement can contain multiple service data/manufacturer specific data packets.
90
90
 
91
91
  **report_unknown**
92
92
 
@@ -104,6 +104,11 @@ Boolean. Most sensors send multipe advertisements with the exact same data, to i
104
104
 
105
105
  List with MAC addresses or UUIDs of devices that are being parsed, if `discovery` is set to `False`. If `discovery` is set to `True`, all supported sensors will be parsed. Default: `[]`
106
106
 
107
+ The MAC addresses should be in bytes.
108
+ ```python
109
+ sensor_whitelist=[bytes.fromhex("A4:C1:38:56:53:84".replace(":", ""))],
110
+ ```
111
+
107
112
  **tracker_whitelist**
108
113
 
109
114
  List with devices (MAC addresses or UUIDs) to track. Default: `[]`
@@ -112,6 +117,11 @@ List with devices (MAC addresses or UUIDs) to track. Default: `[]`
112
117
 
113
118
  Dictionary with mac + encryption key pairs, for sensors that require an encryption key to decrypt the payload. Default: `{}`
114
119
 
120
+ The mac and encryption key pairs should be in bytes.
121
+ ```python
122
+ aeskeys={bytes.fromhex("A4:C1:38:56:53:84".replace(":", "")): bytes.fromhex("a115210eed7a88e50ad52662e732a9fb") for mac, aeskey in AESKEYS.items()},
123
+ ```
124
+
115
125
  ## Result
116
126
 
117
127
  The parser result are two two dictionaries, one with sensor data (e.g. temperature readings) and one with tracking data.
@@ -220,6 +220,13 @@ def parse_payload(self, payload, sw_version):
220
220
  )
221
221
  continue
222
222
 
223
+ # Old Shelly buttons send 0xFE when held, rather than 0x80.
224
+ if (
225
+ MEAS_TYPES[meas["measurement type"]].meas_format == "button" and
226
+ meas["measurement data"] == b"\xFE"
227
+ ):
228
+ meas["measurement data"] = b'\x80'
229
+
223
230
  if meas["measurement type"] in dup_meas_types:
224
231
  # Add a postfix for advertisements with multiple measurements of the same type
225
232
  postfix_counter = postfix_dict.get(meas["measurement type"], 0) + 1
@@ -230,7 +237,7 @@ def parse_payload(self, payload, sw_version):
230
237
 
231
238
  meas_type = MEAS_TYPES[meas["measurement type"]]
232
239
  meas_unit = meas_type.unit_of_measurement
233
- meas_format = meas_type.meas_format
240
+ meas_format = f"{meas_type.meas_format}{postfix}"
234
241
  meas_factor = meas_type.factor
235
242
  value: None | str | int | float
236
243
 
@@ -205,6 +205,9 @@ MEAS_TYPES: dict[int, MeasTypes] = {
205
205
  meas_format="moisture",
206
206
  unit_of_measurement="%",
207
207
  ),
208
+ 0x3A: MeasTypes(
209
+ meas_format="button",
210
+ ),
208
211
  0x3D: MeasTypes(
209
212
  meas_format="count",
210
213
  data_length=2,
@@ -1,6 +1,6 @@
1
- Metadata-Version: 2.1
1
+ Metadata-Version: 2.4
2
2
  Name: bleparser
3
- Version: 3.7.1
3
+ Version: 3.7.3
4
4
  Summary: Parser for passive BLE advertisements
5
5
  Home-page: https://github.com/Ernst79/bleparser
6
6
  Author: Ernst79
@@ -12,6 +12,8 @@ Classifier: Operating System :: OS Independent
12
12
  Requires-Python: >=3.8
13
13
  Description-Content-Type: text/markdown
14
14
  License-File: LICENSE
15
+ Requires-Dist: pycryptodomex
16
+ Dynamic: license-file
15
17
 
16
18
  # BLE parser for passive BLE advertisements
17
19
 
@@ -101,7 +103,7 @@ sensor_data, tracker_data = self.parse_advertisement(
101
103
  )
102
104
  ```
103
105
 
104
- `service_data_list` and `man_spec_data_list` have to be in a list, as a BKE advertisement can contain multiple service data/manufacturer specific data packets.
106
+ `service_data_list` and `man_spec_data_list` have to be in a list, as a BLE advertisement can contain multiple service data/manufacturer specific data packets.
105
107
 
106
108
  **report_unknown**
107
109
 
@@ -119,6 +121,11 @@ Boolean. Most sensors send multipe advertisements with the exact same data, to i
119
121
 
120
122
  List with MAC addresses or UUIDs of devices that are being parsed, if `discovery` is set to `False`. If `discovery` is set to `True`, all supported sensors will be parsed. Default: `[]`
121
123
 
124
+ The MAC addresses should be in bytes.
125
+ ```python
126
+ sensor_whitelist=[bytes.fromhex("A4:C1:38:56:53:84".replace(":", ""))],
127
+ ```
128
+
122
129
  **tracker_whitelist**
123
130
 
124
131
  List with devices (MAC addresses or UUIDs) to track. Default: `[]`
@@ -127,6 +134,11 @@ List with devices (MAC addresses or UUIDs) to track. Default: `[]`
127
134
 
128
135
  Dictionary with mac + encryption key pairs, for sensors that require an encryption key to decrypt the payload. Default: `{}`
129
136
 
137
+ The mac and encryption key pairs should be in bytes.
138
+ ```python
139
+ aeskeys={bytes.fromhex("A4:C1:38:56:53:84".replace(":", "")): bytes.fromhex("a115210eed7a88e50ad52662e732a9fb") for mac, aeskey in AESKEYS.items()},
140
+ ```
141
+
130
142
  ## Result
131
143
 
132
144
  The parser result are two two dictionaries, one with sensor data (e.g. temperature readings) and one with tracking data.
@@ -1,6 +1,6 @@
1
1
  [metadata]
2
2
  name = bleparser
3
- version = 3.7.1
3
+ version = 3.7.3
4
4
  author = Ernst79
5
5
  author_email = e.klamer@gmail.com
6
6
  description = Parser for passive BLE advertisements
File without changes
File without changes