mirror of
https://github.com/home-assistant/core.git
synced 2025-07-08 22:07:10 +00:00
Use callback instead of coroutine function (#60821)
This commit is contained in:
parent
a9b2036de1
commit
831e69d07c
@ -25,7 +25,7 @@ from homeassistant.components.light import (
|
|||||||
)
|
)
|
||||||
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
||||||
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_TOKEN
|
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
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
@ -194,7 +194,8 @@ class NanoleafLight(NanoleafEntity, LightEntity):
|
|||||||
_LOGGER.info("Fetching %s data recovered", self.name)
|
_LOGGER.info("Fetching %s data recovered", self.name)
|
||||||
self._attr_available = True
|
self._attr_available = True
|
||||||
|
|
||||||
async def async_handle_update(self) -> None:
|
@callback
|
||||||
|
def async_handle_update(self) -> None:
|
||||||
"""Handle state update."""
|
"""Handle state update."""
|
||||||
self.async_write_ha_state()
|
self.async_write_ha_state()
|
||||||
if not self.available:
|
if not self.available:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user