diff --git a/homeassistant/components/coolmaster/config_flow.py b/homeassistant/components/coolmaster/config_flow.py index e9cef562647..c267b283118 100644 --- a/homeassistant/components/coolmaster/config_flow.py +++ b/homeassistant/components/coolmaster/config_flow.py @@ -26,6 +26,7 @@ class CoolmasterConfigFlow(config_entries.ConfigFlow, domain=DOMAIN): VERSION = 1 CONNECTION_CLASS = config_entries.CONN_CLASS_LOCAL_POLL + @core.callback def _async_get_entry(self, data): supported_modes = [ key for (key, value) in data.items() if key in AVAILABLE_MODES and value diff --git a/homeassistant/components/esphome/config_flow.py b/homeassistant/components/esphome/config_flow.py index 53289799b43..1085f734f17 100644 --- a/homeassistant/components/esphome/config_flow.py +++ b/homeassistant/components/esphome/config_flow.py @@ -5,7 +5,7 @@ from typing import Optional from aioesphomeapi import APIClient, APIConnectionError import voluptuous as vol -from homeassistant import config_entries +from homeassistant import config_entries, core from homeassistant.helpers import ConfigType from .entry_data import DATA_KEY, RuntimeEntryData @@ -115,6 +115,7 @@ class EsphomeFlowHandler(config_entries.ConfigFlow): return await self.async_step_discovery_confirm() + @core.callback def _async_get_entry(self): return self.async_create_entry( title=self._name, diff --git a/homeassistant/components/homekit_controller/config_flow.py b/homeassistant/components/homekit_controller/config_flow.py index 7560f0d3a5d..559e0b4a997 100644 --- a/homeassistant/components/homekit_controller/config_flow.py +++ b/homeassistant/components/homekit_controller/config_flow.py @@ -352,6 +352,7 @@ class HomekitControllerFlowHandler(config_entries.ConfigFlow): return self._async_step_pair_show_form(errors) + @callback def _async_step_pair_show_form(self, errors=None): return self.async_show_form( step_id="pair", diff --git a/homeassistant/components/mysensors/light.py b/homeassistant/components/mysensors/light.py index 19eb8e9e92c..45da4a77d5f 100644 --- a/homeassistant/components/mysensors/light.py +++ b/homeassistant/components/mysensors/light.py @@ -11,6 +11,7 @@ from homeassistant.components.light import ( Light, ) from homeassistant.const import STATE_OFF, STATE_ON +from homeassistant.core import callback import homeassistant.util.color as color_util from homeassistant.util.color import rgb_hex_to_rgb_list @@ -150,11 +151,13 @@ class MySensorsLight(mysensors.device.MySensorsEntity, Light): self._values[value_type] = STATE_OFF self.async_schedule_update_ha_state() + @callback def _async_update_light(self): """Update the controller with values from light child.""" value_type = self.gateway.const.SetReq.V_LIGHT self._state = self._values[value_type] == STATE_ON + @callback def _async_update_dimmer(self): """Update the controller with values from dimmer child.""" value_type = self.gateway.const.SetReq.V_DIMMER @@ -163,6 +166,7 @@ class MySensorsLight(mysensors.device.MySensorsEntity, Light): if self._brightness == 0: self._state = False + @callback def _async_update_rgb_or_w(self): """Update the controller with values from RGB or RGBW child.""" value = self._values[self.value_type] diff --git a/homeassistant/components/sonos/media_player.py b/homeassistant/components/sonos/media_player.py index 84920b6c94d..37b479a90b1 100644 --- a/homeassistant/components/sonos/media_player.py +++ b/homeassistant/components/sonos/media_player.py @@ -762,6 +762,7 @@ class SonosEntity(MediaPlayerDevice): return await self.hass.async_add_executor_job(_get_soco_group) + @callback def _async_regroup(group): """Rebuild internal group layout.""" sonos_group = [] diff --git a/homeassistant/components/starline/config_flow.py b/homeassistant/components/starline/config_flow.py index fa559f62913..34415e9dca4 100644 --- a/homeassistant/components/starline/config_flow.py +++ b/homeassistant/components/starline/config_flow.py @@ -4,7 +4,7 @@ from typing import Optional from starline import StarlineAuth import voluptuous as vol -from homeassistant import config_entries +from homeassistant import config_entries, core from homeassistant.const import CONF_PASSWORD, CONF_USERNAME from .const import ( # pylint: disable=unused-import @@ -85,6 +85,7 @@ class StarlineFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): return await self._async_authenticate_user(error) return self._async_form_auth_captcha(error) + @core.callback def _async_form_auth_app(self, error=None): """Authenticate application form.""" errors = {} @@ -106,6 +107,7 @@ class StarlineFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): errors=errors, ) + @core.callback def _async_form_auth_user(self, error=None): """Authenticate user form.""" errors = {} @@ -127,6 +129,7 @@ class StarlineFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): errors=errors, ) + @core.callback def _async_form_auth_mfa(self, error=None): """Authenticate mfa form.""" errors = {} @@ -146,6 +149,7 @@ class StarlineFlowHandler(config_entries.ConfigFlow, domain=DOMAIN): description_placeholders={"phone_number": self._phone_number}, ) + @core.callback def _async_form_auth_captcha(self, error=None): """Captcha verification form.""" errors = {} diff --git a/homeassistant/components/upnp/sensor.py b/homeassistant/components/upnp/sensor.py index 81fd5c025b9..db121678d93 100644 --- a/homeassistant/components/upnp/sensor.py +++ b/homeassistant/components/upnp/sensor.py @@ -170,7 +170,7 @@ class PerSecondUPnPIGDSensor(UpnpSensor): """Get unit we are measuring in.""" raise NotImplementedError() - def _async_fetch_value(self): + async def _async_fetch_value(self): """Fetch a value from the IGD.""" raise NotImplementedError() diff --git a/homeassistant/config_entries.py b/homeassistant/config_entries.py index 35631225bfb..1cec1e75fe9 100644 --- a/homeassistant/config_entries.py +++ b/homeassistant/config_entries.py @@ -775,6 +775,7 @@ class ConfigEntries: return await entry.async_unload(self.hass, integration=integration) + @callback def _async_schedule_save(self) -> None: """Save the entity registry to a file.""" self._store.async_delay_save(self._data_to_save, SAVE_DELAY) diff --git a/homeassistant/helpers/entity_component.py b/homeassistant/helpers/entity_component.py index e26dc5dfbea..f6c473dd418 100644 --- a/homeassistant/helpers/entity_component.py +++ b/homeassistant/helpers/entity_component.py @@ -273,6 +273,7 @@ class EntityComponent: return processed_conf + @callback def _async_init_entity_platform( self, platform_type: str, diff --git a/homeassistant/helpers/restore_state.py b/homeassistant/helpers/restore_state.py index e8f0f9a6bac..7b2ec8c7f75 100644 --- a/homeassistant/helpers/restore_state.py +++ b/homeassistant/helpers/restore_state.py @@ -174,6 +174,7 @@ class RestoreStateData: def async_setup_dump(self, *args: Any) -> None: """Set up the restore state listeners.""" + @callback def _async_dump_states(*_: Any) -> None: self.hass.async_create_task(self.async_dump_states())