Use callback instead of coroutine function (#60821)

pull/60822/head
Milan Meulemans 2021-12-02 09:52:19 +01:00 committed by GitHub
parent a9b2036de1
commit 831e69d07c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

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: