Skip to content

Commit b2fe17c

Browse files
authored
Update PyMicroBot to 0.0.23 (home-assistant#148700)
1 parent 611f86c commit b2fe17c

File tree

5 files changed

+5
-34
lines changed

5 files changed

+5
-34
lines changed

homeassistant/components/keymitt_ble/__init__.py

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,42 +2,14 @@
22

33
from __future__ import annotations
44

5-
from collections.abc import Generator
6-
from contextlib import contextmanager
7-
8-
import bleak
5+
from microbot import MicroBotApiClient
96

107
from homeassistant.components import bluetooth
118
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_ADDRESS, Platform
129
from homeassistant.core import HomeAssistant
1310
from homeassistant.exceptions import ConfigEntryNotReady
1411

15-
16-
@contextmanager
17-
def patch_unused_bleak_discover_import() -> Generator[None]:
18-
"""Patch bleak.discover import in microbot. It is unused and was removed in bleak 1.0.0."""
19-
20-
def getattr_bleak(name: str) -> object:
21-
if name == "discover":
22-
return None
23-
raise AttributeError
24-
25-
original_func = bleak.__dict__.get("__getattr__")
26-
bleak.__dict__["__getattr__"] = getattr_bleak
27-
try:
28-
yield
29-
finally:
30-
if original_func is not None:
31-
bleak.__dict__["__getattr__"] = original_func
32-
33-
34-
with patch_unused_bleak_discover_import():
35-
from microbot import MicroBotApiClient
36-
37-
from .coordinator import ( # noqa: E402
38-
MicroBotConfigEntry,
39-
MicroBotDataUpdateCoordinator,
40-
)
12+
from .coordinator import MicroBotConfigEntry, MicroBotDataUpdateCoordinator
4113

4214
PLATFORMS: list[str] = [Platform.SWITCH]
4315

homeassistant/components/keymitt_ble/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@
1616
"integration_type": "hub",
1717
"iot_class": "assumed_state",
1818
"loggers": ["keymitt_ble"],
19-
"requirements": ["PyMicroBot==0.0.17"]
19+
"requirements": ["PyMicroBot==0.0.23"]
2020
}

requirements_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements_test_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

script/licenses.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,6 @@ def from_dict(cls, data: PackageMetadata) -> PackageDefinition:
178178
}
179179

180180
EXCEPTIONS = {
181-
"PyMicroBot", # https://github.com/spycle/pyMicroBot/pull/3
182181
"PySwitchmate", # https://github.com/Danielhiversen/pySwitchmate/pull/16
183182
"PyXiaomiGateway", # https://github.com/Danielhiversen/PyXiaomiGateway/pull/201
184183
"chacha20poly1305", # LGPL

0 commit comments

Comments
 (0)