mirror of
https://github.com/home-assistant/core.git
synced 2025-07-21 12:17:07 +00:00
Resolve potential roku setup memory leaks (#49025)
* resolve potential roku setup memory leaks * Update __init__.py
This commit is contained in:
parent
a261bb35eb
commit
f7b6d3164a
@ -47,10 +47,12 @@ 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 = RokuDataUpdateCoordinator(hass, host=entry.data[CONF_HOST])
|
||||
await coordinator.async_config_entry_first_refresh()
|
||||
coordinator = hass.data[DOMAIN].get(entry.entry_id)
|
||||
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:
|
||||
hass.async_create_task(
|
||||
|
Loading…
x
Reference in New Issue
Block a user