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