python-ember-mug 1.3.3__tar.gz → 1.4.0b1__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-ember-mug
3
- Version: 1.3.3
3
+ Version: 1.4.0b1
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/
@@ -19,7 +19,7 @@ Classifier: Programming Language :: Python :: 3.13
19
19
  Classifier: Programming Language :: Python :: 3.14
20
20
  Requires-Python: >=3.11
21
21
  Requires-Dist: bleak-retry-connector>=4.0.2
22
- Requires-Dist: bleak<2.2.0,>=1.0.1
22
+ Requires-Dist: bleak>=1.0.1
23
23
  Provides-Extra: dev
24
24
  Requires-Dist: ipython; extra == 'dev'
25
25
  Provides-Extra: docs
@@ -6,4 +6,4 @@ __all__ = ("EmberMug",)
6
6
 
7
7
  __author__ = """Jesse Sopel"""
8
8
  __email__ = "jesse@sopelj.ca"
9
- __version__ = "1.3.3"
9
+ __version__ = "1.4.0b1"
@@ -10,7 +10,7 @@ import sys
10
10
  from argparse import ArgumentParser, ArgumentTypeError, FileType, Namespace
11
11
  from typing import TYPE_CHECKING, ClassVar
12
12
 
13
- from bleak import AdvertisementData, BleakError
13
+ from bleak import BleakError
14
14
 
15
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
@@ -25,6 +25,7 @@ from .helpers import CommandLoop, print_changes, print_info, print_table, valida
25
25
  if TYPE_CHECKING:
26
26
  from collections.abc import Awaitable, Callable
27
27
 
28
+ from bleak import AdvertisementData
28
29
  from bleak.backends.device import BLEDevice
29
30
 
30
31
  all_attrs = list(ATTR_LABELS) + list(EXTRA_ATTRS)
@@ -206,7 +206,7 @@ class MugMeta(AsDict):
206
206
 
207
207
 
208
208
  @dataclass
209
- class MugData(AsDict):
209
+ class MugData:
210
210
  """Class to store/display the state of the mug."""
211
211
 
212
212
  # Options
@@ -266,11 +266,11 @@ class EmberMug:
266
266
 
267
267
  async def get_meta(self) -> MugMeta:
268
268
  """Fetch Meta info from the mug (Serial number and ID)."""
269
- return MugMeta.from_bytes(await self._read(MugCharacteristic.MUG_ID))
269
+ return MugMeta.from_bytes(bytes(await self._read(MugCharacteristic.MUG_ID)))
270
270
 
271
271
  async def get_battery(self) -> BatteryInfo:
272
272
  """Get Battery percent from mug gatt."""
273
- return BatteryInfo.from_bytes(await self._read(MugCharacteristic.BATTERY))
273
+ return BatteryInfo.from_bytes(bytes(await self._read(MugCharacteristic.BATTERY)))
274
274
 
275
275
  async def make_writable(self) -> bool:
276
276
  """Try to make device writable if need be."""
@@ -419,7 +419,7 @@ class EmberMug:
419
419
 
420
420
  async def get_firmware(self) -> MugFirmwareInfo:
421
421
  """Get firmware info."""
422
- return MugFirmwareInfo.from_bytes(await self._read(MugCharacteristic.FIRMWARE))
422
+ return MugFirmwareInfo.from_bytes(bytes(await self._read(MugCharacteristic.FIRMWARE)))
423
423
 
424
424
  async def update_initial(self) -> list[Change]:
425
425
  """Update attributes that don't normally change and don't need to be regularly updated."""
@@ -18,7 +18,7 @@ classifiers = [
18
18
  ]
19
19
  dependencies = [
20
20
  "bleak-retry-connector>=4.0.2",
21
- "bleak>=1.0.1,<2.2.0",
21
+ "bleak>=1.0.1",
22
22
  ]
23
23
 
24
24
  [project.optional-dependencies]
@@ -76,13 +76,14 @@ features = ["test"]
76
76
 
77
77
  [[tool.hatch.envs.test.matrix]]
78
78
  python = ["3.11", "3.12", "3.13", "3.14"]
79
+ bleak = ["1.0.1", "2.0.0", "3.0.2"]
79
80
 
80
81
  [tool.hatch.envs.test.scripts]
81
82
  cov = "pytest -vvv --asyncio-mode=auto --cov=ember_mug --cov-branch --cov-report=xml --cov-report=term-missing tests"
82
83
  no-cov = "cov --no-cov"
83
84
 
84
85
  [tool.hatch.envs.docs]
85
- python = "3.13"
86
+ python = "3.14"
86
87
  features = ["docs"]
87
88
 
88
89
  [tool.hatch.envs.docs.scripts]