Reduce boilerplate to setup config entry platforms A-C (#49681)
Co-authored-by: Franck Nijhof <git@frenck.dev>
This commit is contained in:
parent
922eec0909
commit
51be2f860a
34 changed files with 119 additions and 409 deletions
|
@ -264,20 +264,9 @@ class AxisNetworkDevice:
|
|||
"""Reset this device to default state."""
|
||||
self.disconnect_from_stream()
|
||||
|
||||
unload_ok = all(
|
||||
await asyncio.gather(
|
||||
*[
|
||||
self.hass.config_entries.async_forward_entry_unload(
|
||||
self.config_entry, platform
|
||||
)
|
||||
for platform in PLATFORMS
|
||||
]
|
||||
)
|
||||
return await self.hass.config_entries.async_unload_platforms(
|
||||
self.config_entry, PLATFORMS
|
||||
)
|
||||
if not unload_ok:
|
||||
return False
|
||||
|
||||
return True
|
||||
|
||||
|
||||
async def get_device(hass, host, port, username, password):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue