python-ember-mug 1.3.2__tar.gz → 1.3.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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: python-ember-mug
3
- Version: 1.3.2
3
+ Version: 1.3.3
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/
@@ -23,7 +23,7 @@ Requires-Dist: bleak<2.2.0,>=1.0.1
23
23
  Provides-Extra: dev
24
24
  Requires-Dist: ipython; extra == 'dev'
25
25
  Provides-Extra: docs
26
- Requires-Dist: black; extra == 'docs'
26
+ Requires-Dist: black>=26.3.1; extra == 'docs'
27
27
  Requires-Dist: mkdocs-autorefs; extra == 'docs'
28
28
  Requires-Dist: mkdocs-gen-files; extra == 'docs'
29
29
  Requires-Dist: mkdocs-include-markdown-plugin<8.0.0,>=7.0.0; 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.2"
9
+ __version__ = "1.3.3"
@@ -17,6 +17,7 @@ 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
19
19
 
20
+ from .. import __version__
20
21
  from ..formatting import format_capacity
21
22
  from ..utils import get_model_info_from_advertiser_data
22
23
  from .helpers import CommandLoop, print_changes, print_info, print_table, validate_mac
@@ -206,19 +207,20 @@ class EmberMugCli:
206
207
  type=validate_mac,
207
208
  help="Only look for this specific address",
208
209
  )
209
- shared_parser.add_argument(
210
+ self.parser.add_argument(
210
211
  "-d",
211
212
  "--debug",
212
213
  action="store_true",
213
214
  help="Print extra information for development or debugging issues",
214
215
  )
215
- shared_parser.add_argument(
216
+ self.parser.add_argument(
216
217
  "--log-file",
217
218
  type=FileType("w", encoding="utf-8"),
218
219
  nargs="?",
219
220
  default=sys.stdout,
220
221
  help="File to write logs too (Will be overwritten)",
221
222
  )
223
+ self.parser.add_argument("--version", action="version", version=__version__)
222
224
  shared_parser.add_argument("-r", "--raw", help="No formatting. One value per line.", action="store_true")
223
225
  if IS_LINUX is True:
224
226
  # Only works on Linux with BlueZ so don't add for others.
@@ -41,7 +41,7 @@ from .utils import (
41
41
  )
42
42
 
43
43
  if TYPE_CHECKING:
44
- from collections.abc import AsyncIterator, Awaitable, Callable
44
+ from collections.abc import AsyncGenerator, Awaitable, Callable
45
45
 
46
46
  from bleak.backends.characteristic import BleakGATTCharacteristic
47
47
  from bleak.backends.device import BLEDevice
@@ -525,7 +525,7 @@ class EmberMug:
525
525
  self._client_kwargs = {**kwargs}
526
526
 
527
527
  @contextlib.asynccontextmanager
528
- async def connection(self, **kwargs: str) -> AsyncIterator[EmberMug]:
528
+ async def connection(self, **kwargs: str) -> AsyncGenerator[EmberMug]:
529
529
  """Establish a connection and close automatically."""
530
530
  self.set_client_options(**kwargs)
531
531
  # This will happen automatically, but calling it now will give us immediate feedback
@@ -65,7 +65,7 @@ def get_colour_from_int(colour_id: int) -> DeviceColour | None: # noqa: PLR0911
65
65
  """Extrapolate device colour from integer in advertiser data."""
66
66
  if colour_id in (-127, -63, 1, 14, 65):
67
67
  return DeviceColour.BLACK
68
- if colour_id in (-126, -62, 2):
68
+ if colour_id in (-126, -62, 2, 130):
69
69
  return DeviceColour.WHITE
70
70
  if colour_id in (-120, -117, -63, -56, -53, 8, 11):
71
71
  return DeviceColour.RED
@@ -32,7 +32,7 @@ docs = [
32
32
  "mkdocs-autorefs",
33
33
  "mkdocs-literate-nav",
34
34
  "mkdocs-gen-files",
35
- "black",
35
+ "black>=26.3.1",
36
36
  "termynal",
37
37
  ]
38
38
  dev = ["ipython"]