bluetooth-sensor-state-data 1.8.0__tar.gz → 1.9.0__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.
- {bluetooth_sensor_state_data-1.8.0 → bluetooth_sensor_state_data-1.9.0}/PKG-INFO +2 -2
- {bluetooth_sensor_state_data-1.8.0 → bluetooth_sensor_state_data-1.9.0}/pyproject.toml +2 -2
- {bluetooth_sensor_state_data-1.8.0 → bluetooth_sensor_state_data-1.9.0}/src/bluetooth_sensor_state_data/__init__.py +10 -7
- {bluetooth_sensor_state_data-1.8.0 → bluetooth_sensor_state_data-1.9.0}/LICENSE +0 -0
- {bluetooth_sensor_state_data-1.8.0 → bluetooth_sensor_state_data-1.9.0}/README.md +0 -0
- {bluetooth_sensor_state_data-1.8.0 → bluetooth_sensor_state_data-1.9.0}/src/bluetooth_sensor_state_data/py.typed +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: bluetooth-sensor-state-data
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.9.0
|
|
4
4
|
Summary: Models for storing and converting Bluetooth Sensor State Data
|
|
5
5
|
License: Apache-2.0
|
|
6
6
|
Author: J. Nick Koston
|
|
@@ -20,7 +20,7 @@ Provides-Extra: docs
|
|
|
20
20
|
Requires-Dist: Sphinx (>=5,<8) ; extra == "docs"
|
|
21
21
|
Requires-Dist: bluetooth-data-tools (>=1.28.0)
|
|
22
22
|
Requires-Dist: habluetooth (>=3.42.0)
|
|
23
|
-
Requires-Dist: myst-parser (>=0.18,<
|
|
23
|
+
Requires-Dist: myst-parser (>=0.18,<4.1) ; extra == "docs"
|
|
24
24
|
Requires-Dist: sensor-state-data (>=2.0)
|
|
25
25
|
Requires-Dist: sphinx-rtd-theme (>=1,<4) ; extra == "docs"
|
|
26
26
|
Project-URL: Bug Tracker, https://github.com/bluetooth-devices/bluetooth-sensor-state-data/issues
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "bluetooth-sensor-state-data"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.9.0"
|
|
4
4
|
license = "Apache-2.0"
|
|
5
5
|
description = "Models for storing and converting Bluetooth Sensor State Data"
|
|
6
6
|
authors = [{ name = "J. Nick Koston", email = "nick@koston.org" }]
|
|
@@ -32,7 +32,7 @@ python = ">=3.11,<3.14"
|
|
|
32
32
|
# Documentation Dependencies
|
|
33
33
|
Sphinx = {version = ">=5,<8", optional = true}
|
|
34
34
|
sphinx-rtd-theme = {version = ">=1,<4", optional = true}
|
|
35
|
-
myst-parser = {version = ">=0.18,<
|
|
35
|
+
myst-parser = {version = ">=0.18,<4.1", optional = true}
|
|
36
36
|
sensor-state-data = ">=2.0"
|
|
37
37
|
bluetooth-data-tools = ">=1.28.0"
|
|
38
38
|
habluetooth = ">=3.42.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
from __future__ import annotations
|
|
2
2
|
|
|
3
|
-
__version__ = "1.
|
|
3
|
+
__version__ = "1.9.0"
|
|
4
4
|
|
|
5
5
|
from abc import abstractmethod
|
|
6
6
|
|
|
@@ -40,12 +40,16 @@ class BluetoothData(SensorData):
|
|
|
40
40
|
if exclude_ids:
|
|
41
41
|
# If there are specific manufacturer data IDs to exclude,
|
|
42
42
|
# then remove them from the set of manufacturer data.
|
|
43
|
-
|
|
43
|
+
changed_manufacturer_data = {
|
|
44
44
|
k: v
|
|
45
45
|
for k, v in changed_manufacturer_data.items()
|
|
46
46
|
if k not in exclude_ids
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
# If we can't work out the changed manufacturer data
|
|
49
|
+
# fall back to the normal method.
|
|
50
|
+
if changed_manufacturer_data:
|
|
51
|
+
return changed_manufacturer_data
|
|
52
|
+
|
|
49
53
|
manufacturer_data = data.manufacturer_data
|
|
50
54
|
source = data.source
|
|
51
55
|
last_manufacturer_data = self._last_manufacturer_data_by_source.get(source)
|
|
@@ -60,13 +64,12 @@ class BluetoothData(SensorData):
|
|
|
60
64
|
new_manufacturer_data = manufacturer_data
|
|
61
65
|
|
|
62
66
|
self._last_manufacturer_data_by_source[source] = manufacturer_data
|
|
67
|
+
single_manufacturer_data = len(new_manufacturer_data) == 1
|
|
63
68
|
|
|
64
|
-
if not last_manufacturer_data:
|
|
69
|
+
if not last_manufacturer_data or single_manufacturer_data:
|
|
65
70
|
# If there is no previous data and there is only one value
|
|
66
71
|
# return it
|
|
67
|
-
return
|
|
68
|
-
new_manufacturer_data.copy() if len(new_manufacturer_data) == 1 else {}
|
|
69
|
-
)
|
|
72
|
+
return new_manufacturer_data if single_manufacturer_data else {}
|
|
70
73
|
|
|
71
74
|
return dict(new_manufacturer_data.items() - last_manufacturer_data.items())
|
|
72
75
|
|
|
File without changes
|
|
File without changes
|
|
File without changes
|