python-ember-mug 1.3.0b7__tar.gz → 1.3.1__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.
- {python_ember_mug-1.3.0b7 → python_ember_mug-1.3.1}/PKG-INFO +1 -1
- {python_ember_mug-1.3.0b7 → python_ember_mug-1.3.1}/ember_mug/__init__.py +2 -2
- {python_ember_mug-1.3.0b7 → python_ember_mug-1.3.1}/ember_mug/cli/commands.py +3 -2
- {python_ember_mug-1.3.0b7 → python_ember_mug-1.3.1}/ember_mug/consts.py +1 -0
- {python_ember_mug-1.3.0b7 → python_ember_mug-1.3.1}/ember_mug/utils.py +4 -2
- {python_ember_mug-1.3.0b7 → python_ember_mug-1.3.1}/.gitignore +0 -0
- {python_ember_mug-1.3.0b7 → python_ember_mug-1.3.1}/LICENSE +0 -0
- {python_ember_mug-1.3.0b7 → python_ember_mug-1.3.1}/README.md +0 -0
- {python_ember_mug-1.3.0b7 → python_ember_mug-1.3.1}/ember_mug/__main__.py +0 -0
- {python_ember_mug-1.3.0b7 → python_ember_mug-1.3.1}/ember_mug/cli/__init__.py +0 -0
- {python_ember_mug-1.3.0b7 → python_ember_mug-1.3.1}/ember_mug/cli/helpers.py +0 -0
- {python_ember_mug-1.3.0b7 → python_ember_mug-1.3.1}/ember_mug/data.py +0 -0
- {python_ember_mug-1.3.0b7 → python_ember_mug-1.3.1}/ember_mug/formatting.py +0 -0
- {python_ember_mug-1.3.0b7 → python_ember_mug-1.3.1}/ember_mug/mug.py +0 -0
- {python_ember_mug-1.3.0b7 → python_ember_mug-1.3.1}/ember_mug/scanner.py +0 -0
- {python_ember_mug-1.3.0b7 → python_ember_mug-1.3.1}/pyproject.toml +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: python-ember-mug
|
|
3
|
-
Version: 1.3.
|
|
3
|
+
Version: 1.3.1
|
|
4
4
|
Summary: Python Library for Ember Mugs.
|
|
5
5
|
Project-URL: Changelog, https://sopelj.github.io/python-ember-mug/changelog/
|
|
6
6
|
Project-URL: Documentation, https://sopelj.github.io/python-ember-mug/
|
|
@@ -12,7 +12,7 @@ from typing import TYPE_CHECKING, ClassVar
|
|
|
12
12
|
|
|
13
13
|
from bleak import AdvertisementData, BleakError
|
|
14
14
|
|
|
15
|
-
from ember_mug.consts import ATTR_LABELS, EMBER_BLE_SIG, EXTRA_ATTRS, IS_LINUX, VolumeLevel
|
|
15
|
+
from ember_mug.consts import ATTR_LABELS, EMBER_BLE_SIG, EXTRA_ATTRS, IS_LINUX, TESTING_BLE_SIG, VolumeLevel
|
|
16
16
|
from ember_mug.data import Colour, DeviceModel
|
|
17
17
|
from ember_mug.mug import EmberMug
|
|
18
18
|
from ember_mug.scanner import discover_devices, find_device
|
|
@@ -33,9 +33,10 @@ get_attribute_names = [n.replace("_", "-") for n in all_attrs]
|
|
|
33
33
|
async def get_device(args: Namespace) -> EmberMug:
|
|
34
34
|
"""Help to get the devices based on command args."""
|
|
35
35
|
device, advertisement = await find_device_cmd(args)
|
|
36
|
+
manufacturer_data = advertisement.manufacturer_data
|
|
36
37
|
model_info = get_model_info_from_advertiser_data(advertisement)
|
|
37
38
|
if model_info.model == DeviceModel.UNKNOWN_DEVICE and not args.raw:
|
|
38
|
-
data =
|
|
39
|
+
data = manufacturer_data.get(EMBER_BLE_SIG, manufacturer_data.get(TESTING_BLE_SIG, None))
|
|
39
40
|
print(f"Warning: No model found matching advertisement data: {data!r}")
|
|
40
41
|
|
|
41
42
|
mug = EmberMug(
|
|
@@ -10,7 +10,7 @@ from typing import TYPE_CHECKING, Any
|
|
|
10
10
|
|
|
11
11
|
from bleak import AdvertisementData, BleakError
|
|
12
12
|
|
|
13
|
-
from ember_mug.consts import EMBER_BLE_SIG, TRAVEL_MUG_SERVICE_UUIDS, DeviceColour, DeviceModel
|
|
13
|
+
from ember_mug.consts import EMBER_BLE_SIG, TESTING_BLE_SIG, TRAVEL_MUG_SERVICE_UUIDS, DeviceColour, DeviceModel
|
|
14
14
|
|
|
15
15
|
if TYPE_CHECKING:
|
|
16
16
|
from bleak import BleakClient
|
|
@@ -134,7 +134,9 @@ def get_model_info_from_advertiser_data(advertisement: AdvertisementData) -> Mod
|
|
|
134
134
|
"""Extract model info from manufacturer data in advertiser data."""
|
|
135
135
|
from ember_mug.data import ModelInfo # noqa: PLC0415
|
|
136
136
|
|
|
137
|
-
|
|
137
|
+
manufacturer_data = advertisement.manufacturer_data
|
|
138
|
+
|
|
139
|
+
model_data = manufacturer_data.get(EMBER_BLE_SIG, manufacturer_data.get(TESTING_BLE_SIG, None))
|
|
138
140
|
if model_data is not None:
|
|
139
141
|
if len(model_data) < 4:
|
|
140
142
|
model_id = bytes_to_big_int(model_data, signed=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
|
|
File without changes
|
|
File without changes
|