Resolve potential roku setup memory leaks (#49025)
* resolve potential roku setup memory leaks * Update __init__.pypull/49106/head
parent
a261bb35eb
commit
f7b6d3164a
|
@ -47,11 +47,13 @@ async def async_setup(hass: HomeAssistantType, config: dict) -> bool:
|
|||
|
||||
async def async_setup_entry(hass: HomeAssistantType, entry: ConfigEntry) -> bool:
|
||||
"""Set up Roku from a config entry."""
|
||||
coordinator = hass.data[DOMAIN].get(entry.entry_id)
|
||||
if not coordinator:
|
||||
coordinator = RokuDataUpdateCoordinator(hass, host=entry.data[CONF_HOST])
|
||||
await coordinator.async_config_entry_first_refresh()
|
||||
|
||||
hass.data[DOMAIN][entry.entry_id] = coordinator
|
||||
|
||||
await coordinator.async_config_entry_first_refresh()
|
||||
|
||||
for platform in PLATFORMS:
|
||||
hass.async_create_task(
|
||||
hass.config_entries.async_forward_entry_setup(entry, platform)
|
||||
|
|
Loading…
Reference in New Issue