Skip to content

Commit

Permalink
Bump bleak-esphome to 2.0.0 (home-assistant#134580)
Browse files Browse the repository at this point in the history
  • Loading branch information
bdraco authored Jan 4, 2025
1 parent 69241e4 commit b639466
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 17 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/eq3btsmart/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,5 @@
"integration_type": "device",
"iot_class": "local_polling",
"loggers": ["eq3btsmart"],
"requirements": ["eq3btsmart==1.4.1", "bleak-esphome==1.1.0"]
"requirements": ["eq3btsmart==1.4.1", "bleak-esphome==2.0.0"]
}
4 changes: 1 addition & 3 deletions homeassistant/components/esphome/bluetooth.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@

from aioesphomeapi import APIClient, DeviceInfo
from bleak_esphome import connect_scanner
from bleak_esphome.backend.cache import ESPHomeBluetoothCache

from homeassistant.components.bluetooth import async_register_scanner
from homeassistant.core import CALLBACK_TYPE, HomeAssistant, callback as hass_callback
Expand All @@ -28,10 +27,9 @@ def async_connect_scanner(
entry_data: RuntimeEntryData,
cli: APIClient,
device_info: DeviceInfo,
cache: ESPHomeBluetoothCache,
) -> CALLBACK_TYPE:
"""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
client_data.disconnect_callbacks = entry_data.disconnect_callbacks
scanner = client_data.scanner
Expand Down
5 changes: 0 additions & 5 deletions homeassistant/components/esphome/domain_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@
from functools import cache
from typing import Self

from bleak_esphome.backend.cache import ESPHomeBluetoothCache

from homeassistant.core import HomeAssistant
from homeassistant.helpers.json import JSONEncoder

Expand All @@ -22,9 +20,6 @@ class DomainData:
"""Define a class that stores global esphome data in hass.data[DOMAIN]."""

_stores: dict[str, ESPHomeStorage] = field(default_factory=dict)
bluetooth_cache: ESPHomeBluetoothCache = field(
default_factory=ESPHomeBluetoothCache
)

def get_entry_data(self, entry: ESPHomeConfigEntry) -> RuntimeEntryData:
"""Return the runtime entry data associated with this config entry.
Expand Down
4 changes: 1 addition & 3 deletions homeassistant/components/esphome/manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,9 +423,7 @@ async def _on_connnect(self) -> None:

if device_info.bluetooth_proxy_feature_flags_compat(api_version):
entry_data.disconnect_callbacks.add(
async_connect_scanner(
hass, entry_data, cli, device_info, self.domain_data.bluetooth_cache
)
async_connect_scanner(hass, entry_data, cli, device_info)
)

if device_info.voice_assistant_feature_flags_compat(api_version) and (
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/esphome/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"requirements": [
"aioesphomeapi==28.0.0",
"esphome-dashboard-api==1.2.3",
"bleak-esphome==1.1.0"
"bleak-esphome==2.0.0"
],
"zeroconf": ["_esphomelib._tcp.local."]
}
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -591,7 +591,7 @@ bizkaibus==0.1.1

# homeassistant.components.eq3btsmart
# homeassistant.components.esphome
bleak-esphome==1.1.0
bleak-esphome==2.0.0

# homeassistant.components.bluetooth
bleak-retry-connector==3.6.0
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ bimmer-connected[china]==0.17.2

# homeassistant.components.eq3btsmart
# homeassistant.components.esphome
bleak-esphome==1.1.0
bleak-esphome==2.0.0

# homeassistant.components.bluetooth
bleak-retry-connector==3.6.0
Expand Down
2 changes: 0 additions & 2 deletions tests/components/esphome/bluetooth/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

from aioesphomeapi import APIClient, APIVersion, BluetoothProxyFeature, DeviceInfo
from bleak.exc import BleakError
from bleak_esphome.backend.cache import ESPHomeBluetoothCache
from bleak_esphome.backend.client import ESPHomeClient, ESPHomeClientData
from bleak_esphome.backend.device import ESPHomeBluetoothDevice
from bleak_esphome.backend.scanner import ESPHomeScanner
Expand All @@ -27,7 +26,6 @@ async def client_data_fixture(
connector = HaBluetoothConnector(ESPHomeClientData, ESP_MAC_ADDRESS, lambda: True)
return ESPHomeClientData(
bluetooth_device=ESPHomeBluetoothDevice(ESP_NAME, ESP_MAC_ADDRESS),
cache=ESPHomeBluetoothCache(),
client=mock_client,
device_info=DeviceInfo(
mac_address=ESP_MAC_ADDRESS,
Expand Down

0 comments on commit b639466

Please sign in to comment.