mirror of
https://github.com/home-assistant/core.git
synced 2025-07-22 01:28:27 +00:00
Update PyMicroBot to 0.0.23 (#148700)
This commit is contained in:
@ -2,42 +2,14 @@
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import Generator
|
||||
from contextlib import contextmanager
|
||||
|
||||
import bleak
|
||||
from microbot import MicroBotApiClient
|
||||
|
||||
from homeassistant.components import bluetooth
|
||||
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_ADDRESS, Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import ConfigEntryNotReady
|
||||
|
||||
|
||||
@contextmanager
|
||||
def patch_unused_bleak_discover_import() -> Generator[None]:
|
||||
"""Patch bleak.discover import in microbot. It is unused and was removed in bleak 1.0.0."""
|
||||
|
||||
def getattr_bleak(name: str) -> object:
|
||||
if name == "discover":
|
||||
return None
|
||||
raise AttributeError
|
||||
|
||||
original_func = bleak.__dict__.get("__getattr__")
|
||||
bleak.__dict__["__getattr__"] = getattr_bleak
|
||||
try:
|
||||
yield
|
||||
finally:
|
||||
if original_func is not None:
|
||||
bleak.__dict__["__getattr__"] = original_func
|
||||
|
||||
|
||||
with patch_unused_bleak_discover_import():
|
||||
from microbot import MicroBotApiClient
|
||||
|
||||
from .coordinator import ( # noqa: E402
|
||||
MicroBotConfigEntry,
|
||||
MicroBotDataUpdateCoordinator,
|
||||
)
|
||||
from .coordinator import MicroBotConfigEntry, MicroBotDataUpdateCoordinator
|
||||
|
||||
PLATFORMS: list[str] = [Platform.SWITCH]
|
||||
|
||||
|
@ -16,5 +16,5 @@
|
||||
"integration_type": "hub",
|
||||
"iot_class": "assumed_state",
|
||||
"loggers": ["keymitt_ble"],
|
||||
"requirements": ["PyMicroBot==0.0.17"]
|
||||
"requirements": ["PyMicroBot==0.0.23"]
|
||||
}
|
||||
|
2
requirements_all.txt
generated
2
requirements_all.txt
generated
@ -70,7 +70,7 @@ PyMetEireann==2024.11.0
|
||||
PyMetno==0.13.0
|
||||
|
||||
# homeassistant.components.keymitt_ble
|
||||
PyMicroBot==0.0.17
|
||||
PyMicroBot==0.0.23
|
||||
|
||||
# homeassistant.components.mobile_app
|
||||
# homeassistant.components.owntracks
|
||||
|
2
requirements_test_all.txt
generated
2
requirements_test_all.txt
generated
@ -67,7 +67,7 @@ PyMetEireann==2024.11.0
|
||||
PyMetno==0.13.0
|
||||
|
||||
# homeassistant.components.keymitt_ble
|
||||
PyMicroBot==0.0.17
|
||||
PyMicroBot==0.0.23
|
||||
|
||||
# homeassistant.components.mobile_app
|
||||
# homeassistant.components.owntracks
|
||||
|
@ -178,7 +178,6 @@ OSI_APPROVED_LICENSES = {
|
||||
}
|
||||
|
||||
EXCEPTIONS = {
|
||||
"PyMicroBot", # https://github.com/spycle/pyMicroBot/pull/3
|
||||
"PySwitchmate", # https://github.com/Danielhiversen/pySwitchmate/pull/16
|
||||
"PyXiaomiGateway", # https://github.com/Danielhiversen/PyXiaomiGateway/pull/201
|
||||
"chacha20poly1305", # LGPL
|
||||
|
Reference in New Issue
Block a user