mirror of
https://github.com/home-assistant/core.git
synced 2025-11-12 04:20:17 +00:00
Reduce config entry setup/unload boilerplate G-J (#49737)
This commit is contained in:
@@ -269,17 +269,9 @@ class HKDevice:
|
||||
|
||||
await self.pairing.unsubscribe(self.watchable_characteristics)
|
||||
|
||||
unloads = []
|
||||
for platform in self.platforms:
|
||||
unloads.append(
|
||||
self.hass.config_entries.async_forward_entry_unload(
|
||||
self.config_entry, platform
|
||||
)
|
||||
)
|
||||
|
||||
results = await asyncio.gather(*unloads)
|
||||
|
||||
return False not in results
|
||||
return await self.hass.config_entries.async_unload_platforms(
|
||||
self.config_entry, self.platforms
|
||||
)
|
||||
|
||||
async def async_refresh_entity_map(self, config_num):
|
||||
"""Handle setup of a HomeKit accessory."""
|
||||
|
||||
Reference in New Issue
Block a user