Fix characteristic cache clear in homekit_controller on BLE unpair (#77309)

pull/77114/head^2
Jc2k 2022-08-25 16:22:58 +01:00 committed by GitHub
parent c741d9d045
commit f166d21390
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 9 deletions

View File

@ -20,8 +20,7 @@ from homeassistant.helpers.typing import ConfigType
from .config_flow import normalize_hkid from .config_flow import normalize_hkid
from .connection import HKDevice from .connection import HKDevice
from .const import ENTITY_MAP, KNOWN_DEVICES, TRIGGERS from .const import KNOWN_DEVICES, TRIGGERS
from .storage import EntityMapStorage
from .utils import async_get_controller from .utils import async_get_controller
_LOGGER = logging.getLogger(__name__) _LOGGER = logging.getLogger(__name__)
@ -83,10 +82,6 @@ async def async_remove_entry(hass: HomeAssistant, entry: ConfigEntry) -> None:
"""Cleanup caches before removing config entry.""" """Cleanup caches before removing config entry."""
hkid = entry.data["AccessoryPairingID"] hkid = entry.data["AccessoryPairingID"]
# Remove cached type data from .storage/homekit_controller-entity-map
entity_map_storage: EntityMapStorage = hass.data[ENTITY_MAP]
entity_map_storage.async_delete_map(hkid)
controller = await async_get_controller(hass) controller = await async_get_controller(hass)
# Remove the pairing on the device, making the device discoverable again. # Remove the pairing on the device, making the device discoverable again.

View File

@ -3,7 +3,7 @@
"name": "HomeKit Controller", "name": "HomeKit Controller",
"config_flow": true, "config_flow": true,
"documentation": "https://www.home-assistant.io/integrations/homekit_controller", "documentation": "https://www.home-assistant.io/integrations/homekit_controller",
"requirements": ["aiohomekit==1.4.0"], "requirements": ["aiohomekit==1.5.0"],
"zeroconf": ["_hap._tcp.local.", "_hap._udp.local."], "zeroconf": ["_hap._tcp.local.", "_hap._udp.local."],
"bluetooth": [{ "manufacturer_id": 76, "manufacturer_data_start": [6] }], "bluetooth": [{ "manufacturer_id": 76, "manufacturer_data_start": [6] }],
"dependencies": ["bluetooth", "zeroconf"], "dependencies": ["bluetooth", "zeroconf"],

View File

@ -168,7 +168,7 @@ aioguardian==2022.07.0
aioharmony==0.2.9 aioharmony==0.2.9
# homeassistant.components.homekit_controller # homeassistant.components.homekit_controller
aiohomekit==1.4.0 aiohomekit==1.5.0
# homeassistant.components.emulated_hue # homeassistant.components.emulated_hue
# homeassistant.components.http # homeassistant.components.http

View File

@ -152,7 +152,7 @@ aioguardian==2022.07.0
aioharmony==0.2.9 aioharmony==0.2.9
# homeassistant.components.homekit_controller # homeassistant.components.homekit_controller
aiohomekit==1.4.0 aiohomekit==1.5.0
# homeassistant.components.emulated_hue # homeassistant.components.emulated_hue
# homeassistant.components.http # homeassistant.components.http