Use callback instead of coroutine function (#60821)

This commit is contained in:
Milan Meulemans
2021-12-02 09:52:19 +01:00
committed by GitHub
parent a9b2036de1
commit 831e69d07c
+3 -2
View File
@@ -25,7 +25,7 @@ from homeassistant.components.light import (
)
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_TOKEN
from homeassistant.core import HomeAssistant
from homeassistant.core import HomeAssistant, callback
import homeassistant.helpers.config_validation as cv
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity_platform import AddEntitiesCallback
@@ -194,7 +194,8 @@ class NanoleafLight(NanoleafEntity, LightEntity):
_LOGGER.info("Fetching %s data recovered", self.name)
self._attr_available = True
async def async_handle_update(self) -> None:
@callback
def async_handle_update(self) -> None:
"""Handle state update."""
self.async_write_ha_state()
if not self.available: