mirror of
https://github.com/home-assistant/core.git
synced 2025-07-25 22:27:07 +00:00
Bump bleak-esphome to 2.0.0 (#134580)
This commit is contained in:
parent
aafc1ff074
commit
3063f0b565
@ -22,5 +22,5 @@
|
|||||||
"integration_type": "device",
|
"integration_type": "device",
|
||||||
"iot_class": "local_polling",
|
"iot_class": "local_polling",
|
||||||
"loggers": ["eq3btsmart"],
|
"loggers": ["eq3btsmart"],
|
||||||
"requirements": ["eq3btsmart==1.4.1", "bleak-esphome==1.1.0"]
|
"requirements": ["eq3btsmart==1.4.1", "bleak-esphome==2.0.0"]
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,6 @@ from typing import TYPE_CHECKING
|
|||||||
|
|
||||||
from aioesphomeapi import APIClient, DeviceInfo
|
from aioesphomeapi import APIClient, DeviceInfo
|
||||||
from bleak_esphome import connect_scanner
|
from bleak_esphome import connect_scanner
|
||||||
from bleak_esphome.backend.cache import ESPHomeBluetoothCache
|
|
||||||
|
|
||||||
from homeassistant.components.bluetooth import async_register_scanner
|
from homeassistant.components.bluetooth import async_register_scanner
|
||||||
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback as hass_callback
|
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback as hass_callback
|
||||||
@ -28,10 +27,9 @@ def async_connect_scanner(
|
|||||||
entry_data: RuntimeEntryData,
|
entry_data: RuntimeEntryData,
|
||||||
cli: APIClient,
|
cli: APIClient,
|
||||||
device_info: DeviceInfo,
|
device_info: DeviceInfo,
|
||||||
cache: ESPHomeBluetoothCache,
|
|
||||||
) -> CALLBACK_TYPE:
|
) -> CALLBACK_TYPE:
|
||||||
"""Connect scanner."""
|
"""Connect scanner."""
|
||||||
client_data = connect_scanner(cli, device_info, cache, entry_data.available)
|
client_data = connect_scanner(cli, device_info, entry_data.available)
|
||||||
entry_data.bluetooth_device = client_data.bluetooth_device
|
entry_data.bluetooth_device = client_data.bluetooth_device
|
||||||
client_data.disconnect_callbacks = entry_data.disconnect_callbacks
|
client_data.disconnect_callbacks = entry_data.disconnect_callbacks
|
||||||
scanner = client_data.scanner
|
scanner = client_data.scanner
|
||||||
|
@ -6,8 +6,6 @@ from dataclasses import dataclass, field
|
|||||||
from functools import cache
|
from functools import cache
|
||||||
from typing import Self
|
from typing import Self
|
||||||
|
|
||||||
from bleak_esphome.backend.cache import ESPHomeBluetoothCache
|
|
||||||
|
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.json import JSONEncoder
|
from homeassistant.helpers.json import JSONEncoder
|
||||||
|
|
||||||
@ -22,9 +20,6 @@ class DomainData:
|
|||||||
"""Define a class that stores global esphome data in hass.data[DOMAIN]."""
|
"""Define a class that stores global esphome data in hass.data[DOMAIN]."""
|
||||||
|
|
||||||
_stores: dict[str, ESPHomeStorage] = field(default_factory=dict)
|
_stores: dict[str, ESPHomeStorage] = field(default_factory=dict)
|
||||||
bluetooth_cache: ESPHomeBluetoothCache = field(
|
|
||||||
default_factory=ESPHomeBluetoothCache
|
|
||||||
)
|
|
||||||
|
|
||||||
def get_entry_data(self, entry: ESPHomeConfigEntry) -> RuntimeEntryData:
|
def get_entry_data(self, entry: ESPHomeConfigEntry) -> RuntimeEntryData:
|
||||||
"""Return the runtime entry data associated with this config entry.
|
"""Return the runtime entry data associated with this config entry.
|
||||||
|
@ -423,9 +423,7 @@ class ESPHomeManager:
|
|||||||
|
|
||||||
if device_info.bluetooth_proxy_feature_flags_compat(api_version):
|
if device_info.bluetooth_proxy_feature_flags_compat(api_version):
|
||||||
entry_data.disconnect_callbacks.add(
|
entry_data.disconnect_callbacks.add(
|
||||||
async_connect_scanner(
|
async_connect_scanner(hass, entry_data, cli, device_info)
|
||||||
hass, entry_data, cli, device_info, self.domain_data.bluetooth_cache
|
|
||||||
)
|
|
||||||
)
|
)
|
||||||
|
|
||||||
if device_info.voice_assistant_feature_flags_compat(api_version) and (
|
if device_info.voice_assistant_feature_flags_compat(api_version) and (
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
"requirements": [
|
"requirements": [
|
||||||
"aioesphomeapi==28.0.0",
|
"aioesphomeapi==28.0.0",
|
||||||
"esphome-dashboard-api==1.2.3",
|
"esphome-dashboard-api==1.2.3",
|
||||||
"bleak-esphome==1.1.0"
|
"bleak-esphome==2.0.0"
|
||||||
],
|
],
|
||||||
"zeroconf": ["_esphomelib._tcp.local."]
|
"zeroconf": ["_esphomelib._tcp.local."]
|
||||||
}
|
}
|
||||||
|
@ -585,7 +585,7 @@ bizkaibus==0.1.1
|
|||||||
|
|
||||||
# homeassistant.components.eq3btsmart
|
# homeassistant.components.eq3btsmart
|
||||||
# homeassistant.components.esphome
|
# homeassistant.components.esphome
|
||||||
bleak-esphome==1.1.0
|
bleak-esphome==2.0.0
|
||||||
|
|
||||||
# homeassistant.components.bluetooth
|
# homeassistant.components.bluetooth
|
||||||
bleak-retry-connector==3.6.0
|
bleak-retry-connector==3.6.0
|
||||||
|
@ -516,7 +516,7 @@ bimmer-connected[china]==0.17.2
|
|||||||
|
|
||||||
# homeassistant.components.eq3btsmart
|
# homeassistant.components.eq3btsmart
|
||||||
# homeassistant.components.esphome
|
# homeassistant.components.esphome
|
||||||
bleak-esphome==1.1.0
|
bleak-esphome==2.0.0
|
||||||
|
|
||||||
# homeassistant.components.bluetooth
|
# homeassistant.components.bluetooth
|
||||||
bleak-retry-connector==3.6.0
|
bleak-retry-connector==3.6.0
|
||||||
|
@ -4,7 +4,6 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from aioesphomeapi import APIClient, APIVersion, BluetoothProxyFeature, DeviceInfo
|
from aioesphomeapi import APIClient, APIVersion, BluetoothProxyFeature, DeviceInfo
|
||||||
from bleak.exc import BleakError
|
from bleak.exc import BleakError
|
||||||
from bleak_esphome.backend.cache import ESPHomeBluetoothCache
|
|
||||||
from bleak_esphome.backend.client import ESPHomeClient, ESPHomeClientData
|
from bleak_esphome.backend.client import ESPHomeClient, ESPHomeClientData
|
||||||
from bleak_esphome.backend.device import ESPHomeBluetoothDevice
|
from bleak_esphome.backend.device import ESPHomeBluetoothDevice
|
||||||
from bleak_esphome.backend.scanner import ESPHomeScanner
|
from bleak_esphome.backend.scanner import ESPHomeScanner
|
||||||
@ -27,7 +26,6 @@ async def client_data_fixture(
|
|||||||
connector = HaBluetoothConnector(ESPHomeClientData, ESP_MAC_ADDRESS, lambda: True)
|
connector = HaBluetoothConnector(ESPHomeClientData, ESP_MAC_ADDRESS, lambda: True)
|
||||||
return ESPHomeClientData(
|
return ESPHomeClientData(
|
||||||
bluetooth_device=ESPHomeBluetoothDevice(ESP_NAME, ESP_MAC_ADDRESS),
|
bluetooth_device=ESPHomeBluetoothDevice(ESP_NAME, ESP_MAC_ADDRESS),
|
||||||
cache=ESPHomeBluetoothCache(),
|
|
||||||
client=mock_client,
|
client=mock_client,
|
||||||
device_info=DeviceInfo(
|
device_info=DeviceInfo(
|
||||||
mac_address=ESP_MAC_ADDRESS,
|
mac_address=ESP_MAC_ADDRESS,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user