From b6394664532f284ce5073d5e813ae63843413849 Mon Sep 17 00:00:00 2001
From: "J. Nick Koston" <nick@koston.org>
Date: Sat, 4 Jan 2025 00:30:41 -1000
Subject: [PATCH] Bump bleak-esphome to 2.0.0 (#134580)

---
 homeassistant/components/eq3btsmart/manifest.json | 2 +-
 homeassistant/components/esphome/bluetooth.py     | 4 +---
 homeassistant/components/esphome/domain_data.py   | 5 -----
 homeassistant/components/esphome/manager.py       | 4 +---
 homeassistant/components/esphome/manifest.json    | 2 +-
 requirements_all.txt                              | 2 +-
 requirements_test_all.txt                         | 2 +-
 tests/components/esphome/bluetooth/test_client.py | 2 --
 8 files changed, 6 insertions(+), 17 deletions(-)

diff --git a/homeassistant/components/eq3btsmart/manifest.json b/homeassistant/components/eq3btsmart/manifest.json
index ed80ad9aabf..43f18d4fffc 100644
--- a/homeassistant/components/eq3btsmart/manifest.json
+++ b/homeassistant/components/eq3btsmart/manifest.json
@@ -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"]
 }
diff --git a/homeassistant/components/esphome/bluetooth.py b/homeassistant/components/esphome/bluetooth.py
index 37ae28df0ca..004bea1835d 100644
--- a/homeassistant/components/esphome/bluetooth.py
+++ b/homeassistant/components/esphome/bluetooth.py
@@ -7,7 +7,6 @@ from typing import TYPE_CHECKING
 
 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
@@ -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
diff --git a/homeassistant/components/esphome/domain_data.py b/homeassistant/components/esphome/domain_data.py
index aa46469c40e..ed307b46fd6 100644
--- a/homeassistant/components/esphome/domain_data.py
+++ b/homeassistant/components/esphome/domain_data.py
@@ -6,8 +6,6 @@ from dataclasses import dataclass, field
 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
 
@@ -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.
diff --git a/homeassistant/components/esphome/manager.py b/homeassistant/components/esphome/manager.py
index 007b4e791e1..dfd318c0c74 100644
--- a/homeassistant/components/esphome/manager.py
+++ b/homeassistant/components/esphome/manager.py
@@ -423,9 +423,7 @@ class ESPHomeManager:
 
         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 (
diff --git a/homeassistant/components/esphome/manifest.json b/homeassistant/components/esphome/manifest.json
index 775ffbff4c8..b04fa4db428 100644
--- a/homeassistant/components/esphome/manifest.json
+++ b/homeassistant/components/esphome/manifest.json
@@ -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."]
 }
diff --git a/requirements_all.txt b/requirements_all.txt
index 4c51a1e105d..30f96e366aa 100644
--- a/requirements_all.txt
+++ b/requirements_all.txt
@@ -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
diff --git a/requirements_test_all.txt b/requirements_test_all.txt
index e0a15bf3b56..d50cf3be694 100644
--- a/requirements_test_all.txt
+++ b/requirements_test_all.txt
@@ -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
diff --git a/tests/components/esphome/bluetooth/test_client.py b/tests/components/esphome/bluetooth/test_client.py
index 98993be37d0..77d315f096d 100644
--- a/tests/components/esphome/bluetooth/test_client.py
+++ b/tests/components/esphome/bluetooth/test_client.py
@@ -4,7 +4,6 @@ from __future__ import annotations
 
 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
@@ -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,
-- 
GitLab