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:
|
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…
x
Reference in New Issue
Block a user