python-ember-mug 1.1.0__tar.gz → 1.1.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.
Files changed (28) hide show
  1. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/PKG-INFO +15 -14
  2. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/README.md +5 -5
  3. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/ember_mug/__init__.py +1 -1
  4. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/ember_mug/__main__.py +1 -0
  5. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/ember_mug/cli/__init__.py +1 -0
  6. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/ember_mug/cli/commands.py +1 -0
  7. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/ember_mug/cli/helpers.py +1 -0
  8. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/ember_mug/consts.py +4 -3
  9. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/ember_mug/data.py +1 -0
  10. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/ember_mug/formatting.py +1 -0
  11. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/ember_mug/mug.py +2 -1
  12. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/ember_mug/scanner.py +4 -1
  13. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/ember_mug/utils.py +3 -2
  14. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/pyproject.toml +13 -10
  15. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/tests/cli/test_commands.py +2 -1
  16. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/tests/cli/test_helpers.py +1 -0
  17. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/tests/conftest.py +2 -1
  18. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/tests/test_connection.py +1 -0
  19. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/tests/test_consts.py +1 -0
  20. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/tests/test_data.py +1 -0
  21. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/tests/test_formatting.py +1 -0
  22. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/tests/test_mug_data.py +1 -0
  23. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/tests/test_scanner.py +1 -0
  24. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/tests/test_utils.py +1 -0
  25. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/.gitignore +0 -0
  26. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/LICENSE +0 -0
  27. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/tests/__init__.py +0 -0
  28. {python_ember_mug-1.1.0 → python_ember_mug-1.1.1}/tests/cli/__init__.py +0 -0
@@ -1,11 +1,11 @@
1
- Metadata-Version: 2.3
1
+ Metadata-Version: 2.4
2
2
  Name: python-ember-mug
3
- Version: 1.1.0
3
+ Version: 1.1.1
4
4
  Summary: Python Library for Ember Mugs.
5
+ Project-URL: Changelog, https://sopelj.github.io/python-ember-mug/changelog/
5
6
  Project-URL: Documentation, https://sopelj.github.io/python-ember-mug/
6
7
  Project-URL: Source code, https://github.com/sopelj/python-ember-mug/
7
8
  Project-URL: Bug Tracker, https://github.com/sopelj/python-ember-mug/issues
8
- Project-URL: Changelog, https://github.com/sopelj/python-ember-mug/blob/main/CHANGELOG.md
9
9
  Author-email: Jesse Sopel <jesse.sopel@gmail.com>
10
10
  License-Expression: MIT
11
11
  License-File: LICENSE
@@ -15,20 +15,21 @@ Classifier: Natural Language :: English
15
15
  Classifier: Programming Language :: Python :: 3
16
16
  Classifier: Programming Language :: Python :: 3.11
17
17
  Classifier: Programming Language :: Python :: 3.12
18
+ Classifier: Programming Language :: Python :: 3.13
18
19
  Requires-Python: >=3.11
19
20
  Requires-Dist: bleak-retry-connector>=3.5.0
20
- Requires-Dist: bleak>=0.22.2
21
+ Requires-Dist: bleak>=0.22.2; python_version < '3.13'
22
+ Requires-Dist: bleak>=0.22.3; python_version <= '3.13'
21
23
  Provides-Extra: docs
22
24
  Requires-Dist: black; extra == 'docs'
23
25
  Requires-Dist: mkdocs-autorefs; extra == 'docs'
24
26
  Requires-Dist: mkdocs-gen-files; extra == 'docs'
25
- Requires-Dist: mkdocs-include-markdown-plugin<8.0.0,>=3.6.1; extra == 'docs'
27
+ Requires-Dist: mkdocs-include-markdown-plugin<8.0.0,>=7.0.0; extra == 'docs'
26
28
  Requires-Dist: mkdocs-literate-nav; extra == 'docs'
27
29
  Requires-Dist: mkdocs-material-extensions; extra == 'docs'
28
- Requires-Dist: mkdocs-material<10.0.0,>=8.4.1; extra == 'docs'
29
- Requires-Dist: mkdocs>=1.1.21; extra == 'docs'
30
- Requires-Dist: mkdocstrings-python; extra == 'docs'
31
- Requires-Dist: mkdocstrings[python]; extra == 'docs'
30
+ Requires-Dist: mkdocs-material<10.0.0,>=9.5.44; extra == 'docs'
31
+ Requires-Dist: mkdocs>=1.6.1; extra == 'docs'
32
+ Requires-Dist: mkdocstrings-python>=1.12.0; extra == 'docs'
32
33
  Requires-Dist: termynal; extra == 'docs'
33
34
  Provides-Extra: test
34
35
  Requires-Dist: pytest-asyncio; extra == 'test'
@@ -42,16 +43,16 @@ Description-Content-Type: text/markdown
42
43
  [![python](https://img.shields.io/pypi/pyversions/python-ember-mug.svg)](https://pypi.org/project/python-ember-mug/)
43
44
  [![Build Status](https://github.com/sopelj/python-ember-mug/actions/workflows/tests.yml/badge.svg)](https://github.com/sopelj/python-ember-mug/actions/workflows/tests.yml)
44
45
  [![codecov](https://codecov.io/gh/sopelj/python-ember-mug/graph/badge.svg?token=2Lw2iVjKsG)](https://codecov.io/gh/sopelj/python-ember-mug)
45
- ![Project Maintenance](https://img.shields.io/maintenance/yes/2024.svg)
46
+ ![Project Maintenance](https://img.shields.io/maintenance/yes/2025.svg)
46
47
  [![Maintainer](https://img.shields.io/badge/maintainer-%40sopelj-blue.svg)](https://github.com/sopelj)
47
48
  [![License](https://img.shields.io/github/license/sopelj/python-ember-mug.svg)](https://github.com/sopelj/python-ember-mug/blob/main/LICENSE)
48
49
  [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen)](https://github.com/pre-commit/pre-commit)
49
50
 
50
51
  Python Library for interacting with Ember Mugs, Cups, and Travel Mugs via Bluetooth
51
52
 
52
- * [Documentation](https://sopelj.github.io/python-ember-mug)
53
- * [GitHub](https://github.com/sopelj/python-ember-mug)
54
- * [PyPI](https://pypi.org/project/python-ember-mug/)
53
+ * [📘 Documentation](https://sopelj.github.io/python-ember-mug)
54
+ * [💻 GitHub](https://github.com/sopelj/python-ember-mug)
55
+ * [🐍 PyPI](https://pypi.org/project/python-ember-mug/)
55
56
 
56
57
  ## Summary
57
58
 
@@ -123,7 +124,7 @@ async with mug.connection():
123
124
  print(mug.data.formatted)
124
125
  ```
125
126
 
126
- ### CLI
127
+ ### CLI Mode
127
128
 
128
129
  It can also be run via command line either directly with `ember-mug --help` or as a module with `python -m ember_mug --help`
129
130
  There are four options with different subsections. You can see them by specifying them before help. eg `ember-mug poll --help`
@@ -4,16 +4,16 @@
4
4
  [![python](https://img.shields.io/pypi/pyversions/python-ember-mug.svg)](https://pypi.org/project/python-ember-mug/)
5
5
  [![Build Status](https://github.com/sopelj/python-ember-mug/actions/workflows/tests.yml/badge.svg)](https://github.com/sopelj/python-ember-mug/actions/workflows/tests.yml)
6
6
  [![codecov](https://codecov.io/gh/sopelj/python-ember-mug/graph/badge.svg?token=2Lw2iVjKsG)](https://codecov.io/gh/sopelj/python-ember-mug)
7
- ![Project Maintenance](https://img.shields.io/maintenance/yes/2024.svg)
7
+ ![Project Maintenance](https://img.shields.io/maintenance/yes/2025.svg)
8
8
  [![Maintainer](https://img.shields.io/badge/maintainer-%40sopelj-blue.svg)](https://github.com/sopelj)
9
9
  [![License](https://img.shields.io/github/license/sopelj/python-ember-mug.svg)](https://github.com/sopelj/python-ember-mug/blob/main/LICENSE)
10
10
  [![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen)](https://github.com/pre-commit/pre-commit)
11
11
 
12
12
  Python Library for interacting with Ember Mugs, Cups, and Travel Mugs via Bluetooth
13
13
 
14
- * [Documentation](https://sopelj.github.io/python-ember-mug)
15
- * [GitHub](https://github.com/sopelj/python-ember-mug)
16
- * [PyPI](https://pypi.org/project/python-ember-mug/)
14
+ * [📘 Documentation](https://sopelj.github.io/python-ember-mug)
15
+ * [💻 GitHub](https://github.com/sopelj/python-ember-mug)
16
+ * [🐍 PyPI](https://pypi.org/project/python-ember-mug/)
17
17
 
18
18
  ## Summary
19
19
 
@@ -85,7 +85,7 @@ async with mug.connection():
85
85
  print(mug.data.formatted)
86
86
  ```
87
87
 
88
- ### CLI
88
+ ### CLI Mode
89
89
 
90
90
  It can also be run via command line either directly with `ember-mug --help` or as a module with `python -m ember_mug --help`
91
91
  There are four options with different subsections. You can see them by specifying them before help. eg `ember-mug poll --help`
@@ -6,4 +6,4 @@ __all__ = ("EmberMug",)
6
6
 
7
7
  __author__ = """Jesse Sopel"""
8
8
  __email__ = "jesse.sopel@gmail.com"
9
- __version__ = "1.1.0"
9
+ __version__ = "1.1.1"
@@ -1,4 +1,5 @@
1
1
  """Module to run the cli interface."""
2
+
2
3
  from .cli import run_cli
3
4
 
4
5
  if __name__ == "__main__":
@@ -1,4 +1,5 @@
1
1
  """CLI Interface."""
2
+
2
3
  import asyncio
3
4
 
4
5
  from .commands import EmberMugCli
@@ -1,4 +1,5 @@
1
1
  """CLI Interface."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
5
  import asyncio
@@ -1,4 +1,5 @@
1
1
  """Helpers for CLI Interface."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
5
  import re
@@ -1,11 +1,12 @@
1
1
  """Bluetooth UUIDs and other constants used for communicating with the mug."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
5
  import platform
5
6
  import re
6
7
  from enum import Enum, IntEnum
7
8
  from functools import cached_property
8
- from typing import Literal, NamedTuple
9
+ from typing import NamedTuple
9
10
  from uuid import UUID
10
11
 
11
12
  # Format for all the mug's Bluetooth UUIDs
@@ -68,8 +69,8 @@ class DeviceColour(str, Enum):
68
69
  class TemperatureUnit(str, Enum):
69
70
  """Temperature Units."""
70
71
 
71
- CELSIUS: Literal["°C"] = "°C"
72
- FAHRENHEIT: Literal["°F"] = "°F"
72
+ CELSIUS = "°C"
73
+ FAHRENHEIT = "°F"
73
74
 
74
75
 
75
76
  class MinMaxTemp(NamedTuple):
@@ -1,4 +1,5 @@
1
1
  """Classes for representing data from the mug."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
5
  from dataclasses import asdict, dataclass, field
@@ -1,4 +1,5 @@
1
1
  """Helpers for formatting values for display."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
5
  from typing import TYPE_CHECKING
@@ -1,4 +1,5 @@
1
1
  """Objects and methods related to connection to the mug."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
5
  import asyncio
@@ -157,7 +158,7 @@ class EmberMug:
157
158
  if self.debug is True:
158
159
  await discover_services(client)
159
160
  self._expected_disconnect = False
160
- except (asyncio.TimeoutError, BleakError) as error:
161
+ except (TimeoutError, BleakError) as error:
161
162
  logger.debug("%s: Failed to connect to the mug: %s", self.device, error)
162
163
  raise error
163
164
  # Attempt to pair for good measure
@@ -1,4 +1,5 @@
1
1
  """Scanning tools for finding mugs."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
5
  import asyncio
@@ -44,6 +45,7 @@ async def discover_devices(
44
45
  for device, advertisement in devices:
45
46
  print(device.address, advertisement)
46
47
  ```
48
+
47
49
  """
48
50
  async with BleakScanner(**build_scanner_kwargs(adapter)) as scanner:
49
51
  await asyncio.sleep(wait)
@@ -57,7 +59,7 @@ async def discover_devices(
57
59
  async def find_device(
58
60
  mac: str | None = None,
59
61
  adapter: str | None = None,
60
- timeout: int = DEFAULT_TIMEOUT,
62
+ timeout: int = DEFAULT_TIMEOUT, # noqa: ASYNC109
61
63
  ) -> tuple[BLEDevice, AdvertisementData] | tuple[None, None]:
62
64
  """
63
65
  Find a device that has previously been discovered.
@@ -67,6 +69,7 @@ async def find_device(
67
69
  ```python
68
70
  device = await find_device("my:mac:addr")
69
71
  ```
72
+
70
73
  """
71
74
  if mac is not None:
72
75
  mac = mac.lower()
@@ -1,4 +1,5 @@
1
1
  """Helpful utils for processing mug data."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
5
  import base64
@@ -96,11 +97,11 @@ def get_model_from_single_int_and_services( # noqa PLR0911
96
97
  return DeviceModel.MUG_1_10_OZ
97
98
  if model_id == 65:
98
99
  return DeviceModel.MUG_1_14_OZ
99
- if model_id in (-63, -61, -62):
100
+ if model_id in (-51, -63, -61, -62):
100
101
  return DeviceModel.MUG_2_14_OZ
101
102
  if model_id == -60:
102
103
  return DeviceModel.CUP_6_OZ
103
- if model_id in (-127, -126, -125, -124, -123, -122, -120, -117, -57, -56, -55, -53, -52, -51, 83, 131):
104
+ if model_id in (-127, -126, -125, -124, -123, -122, -120, -117, -57, -56, -55, -53, -52, 83, 131):
104
105
  return DeviceModel.MUG_2_10_OZ
105
106
  return None
106
107
 
@@ -17,10 +17,12 @@ classifiers=[
17
17
  'Programming Language :: Python :: 3',
18
18
  'Programming Language :: Python :: 3.11',
19
19
  'Programming Language :: Python :: 3.12',
20
+ 'Programming Language :: Python :: 3.13',
20
21
  ]
21
22
  dependencies = [
22
23
  "bleak-retry-connector>=3.5.0",
23
- "bleak>=0.22.2",
24
+ "bleak>=0.22.2; python_version < '3.13'",
25
+ "bleak>=0.22.3; python_version <= '3.13'",
24
26
  ]
25
27
 
26
28
  [project.optional-dependencies]
@@ -30,24 +32,23 @@ test = [
30
32
  "pytest-asyncio",
31
33
  ]
32
34
  docs = [
33
- "mkdocs>=1.1.21",
34
- "mkdocs-include-markdown-plugin>=3.6.1,<8.0.0",
35
- "mkdocs-material>=8.4.1,<10.0.0",
36
- "mkdocstrings[python]",
35
+ "mkdocs>=1.6.1",
36
+ "mkdocs-include-markdown-plugin>=7.0.0,<8.0.0",
37
+ "mkdocs-material>=9.5.44,<10.0.0",
37
38
  "mkdocs-material-extensions",
39
+ "mkdocstrings-python>=1.12.0",
38
40
  "mkdocs-autorefs",
39
41
  "mkdocs-literate-nav",
40
42
  "mkdocs-gen-files",
41
- "mkdocstrings-python",
42
43
  "black",
43
44
  "termynal",
44
45
  ]
45
46
 
46
47
  [project.urls]
48
+ "Changelog" = "https://sopelj.github.io/python-ember-mug/changelog/"
47
49
  "Documentation" = "https://sopelj.github.io/python-ember-mug/"
48
50
  "Source code" = "https://github.com/sopelj/python-ember-mug/"
49
51
  "Bug Tracker" = "https://github.com/sopelj/python-ember-mug/issues"
50
- "Changelog" = "https://github.com/sopelj/python-ember-mug/blob/main/CHANGELOG.md"
51
52
 
52
53
  [project.scripts]
53
54
  ember-mug = "ember_mug.cli:run_cli"
@@ -76,14 +77,14 @@ python = "3.12"
76
77
  features = ["test"]
77
78
 
78
79
  [[tool.hatch.envs.test.matrix]]
79
- python = ["3.11", "3.12"]
80
+ python = ["3.11", "3.12", "3.13"]
80
81
 
81
82
  [tool.hatch.envs.test.scripts]
82
83
  cov = "pytest -vvv --asyncio-mode=auto --cov=ember_mug --cov-branch --cov-report=xml --cov-report=term-missing tests"
83
84
  no-cov = "cov --no-cov"
84
85
 
85
86
  [tool.hatch.envs.docs]
86
- python = "3.11"
87
+ python = "3.12"
87
88
  features = ["docs"]
88
89
 
89
90
  [tool.hatch.envs.docs.scripts]
@@ -125,6 +126,8 @@ exclude_lines = [
125
126
  fix = true
126
127
  line-length = 120
127
128
  target-version = "py311"
129
+
130
+ [tool.ruff.lint]
128
131
  select = [
129
132
  "A",
130
133
  "ASYNC",
@@ -157,7 +160,7 @@ select = [
157
160
  ]
158
161
  ignore = ["D203", "D212", "PLR2004"]
159
162
 
160
- [tool.ruff.per-file-ignores]
163
+ [tool.ruff.lint.per-file-ignores]
161
164
  "tests/**/*.py" = [
162
165
  "D103", # No docstrings in tests needed
163
166
  "S101", # We needs asserts in tests
@@ -1,4 +1,5 @@
1
1
  """Test the CLI commands."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
5
  import sys
@@ -32,7 +33,7 @@ if TYPE_CHECKING:
32
33
  from pytest import CaptureFixture # noqa: PT013
33
34
 
34
35
 
35
- @pytest.fixture()
36
+ @pytest.fixture
36
37
  def mock_mug_with_connection() -> Generator[AsyncMock, None, None]:
37
38
  with patch("ember_mug.cli.commands.get_device") as mock:
38
39
  mock_mug = AsyncMock()
@@ -1,4 +1,5 @@
1
1
  """Test the CLI helper functions."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
5
  from argparse import ArgumentTypeError
@@ -1,4 +1,5 @@
1
1
  """Test utils and fixtures."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
5
  from enum import Enum
@@ -83,7 +84,7 @@ def ble_device_fixture() -> BLEDevice:
83
84
  return BLEDevice(address=TEST_MAC, name=TEST_MUG_BLUETOOTH_NAME, details={}, rssi=1)
84
85
 
85
86
 
86
- @pytest.fixture()
87
+ @pytest.fixture
87
88
  def mug_data() -> MugData:
88
89
  return MugData(ModelInfo())
89
90
 
@@ -1,4 +1,5 @@
1
1
  """Tests for `ember_mug.mug connections`."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
5
  from datetime import datetime
@@ -1,4 +1,5 @@
1
1
  """Tests for `ember_mug.consts`."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
5
  from uuid import UUID
@@ -1,4 +1,5 @@
1
1
  """Tests for `ember_mug.data`."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
5
  import pytest
@@ -1,4 +1,5 @@
1
1
  """Tests for `ember_mug.formatting`."""
2
+
2
3
  from ember_mug.data import Colour
3
4
  from ember_mug.formatting import format_capacity, format_led_colour, format_liquid_level, format_temp
4
5
 
@@ -1,4 +1,5 @@
1
1
  """Tests for `ember_mug.mug`."""
2
+
2
3
  from __future__ import annotations
3
4
 
4
5
  from typing import Any
@@ -1,4 +1,5 @@
1
1
  """Tests for scanner."""
2
+
2
3
  from unittest.mock import AsyncMock, MagicMock, patch
3
4
 
4
5
  import pytest
@@ -1,4 +1,5 @@
1
1
  """Tests for `ember_mug.utils`."""
2
+
2
3
  from unittest.mock import AsyncMock, MagicMock, Mock, call, patch
3
4
 
4
5
  import pytest