diff --git a/homeassistant/components/tado/binary_sensor.py b/homeassistant/components/tado/binary_sensor.py index ef880bee50b..0eff510051d 100644 --- a/homeassistant/components/tado/binary_sensor.py +++ b/homeassistant/components/tado/binary_sensor.py @@ -108,7 +108,7 @@ class TadoDeviceBinarySensor(TadoDeviceEntity, BinarySensorEntity): self._state = None - async def async_added_to_hass(self): + async def async_added_to_hass(self) -> None: """Register for sensor updates.""" self.async_on_remove( @@ -184,7 +184,7 @@ class TadoZoneBinarySensor(TadoZoneEntity, BinarySensorEntity): self._state_attributes = None self._tado_zone_data = None - async def async_added_to_hass(self): + async def async_added_to_hass(self) -> None: """Register for sensor updates.""" self.async_on_remove( diff --git a/homeassistant/components/tado/climate.py b/homeassistant/components/tado/climate.py index ae9c2097f75..879b13310a4 100644 --- a/homeassistant/components/tado/climate.py +++ b/homeassistant/components/tado/climate.py @@ -2,6 +2,7 @@ from __future__ import annotations import logging +from typing import Any import voluptuous as vol @@ -273,7 +274,7 @@ class TadoClimate(TadoZoneEntity, ClimateEntity): self._async_update_zone_data() - async def async_added_to_hass(self): + async def async_added_to_hass(self) -> None: """Register for sensor updates.""" self.async_on_remove( @@ -349,7 +350,7 @@ class TadoClimate(TadoZoneEntity, ClimateEntity): """List of available fan modes.""" return self._supported_fan_modes - def set_fan_mode(self, fan_mode: str): + def set_fan_mode(self, fan_mode: str) -> None: """Turn fan on/off.""" self._control_hvac(fan_mode=HA_TO_TADO_FAN_MODE_MAP[fan_mode]) @@ -365,7 +366,7 @@ class TadoClimate(TadoZoneEntity, ClimateEntity): """Return a list of available preset modes.""" return SUPPORT_PRESET - def set_preset_mode(self, preset_mode): + def set_preset_mode(self, preset_mode: str) -> None: """Set new preset mode.""" self._tado.set_presence(preset_mode) @@ -406,7 +407,7 @@ class TadoClimate(TadoZoneEntity, ClimateEntity): self._tado.set_temperature_offset(self._device_id, offset) - def set_temperature(self, **kwargs): + def set_temperature(self, **kwargs: Any) -> None: """Set new target temperature.""" if (temperature := kwargs.get(ATTR_TEMPERATURE)) is None: return @@ -428,7 +429,7 @@ class TadoClimate(TadoZoneEntity, ClimateEntity): self._control_hvac(hvac_mode=HA_TO_TADO_HVAC_MODE_MAP[hvac_mode]) @property - def available(self): + def available(self) -> bool: """Return if the device is available.""" return self._tado_zone_data.available @@ -482,7 +483,7 @@ class TadoClimate(TadoZoneEntity, ClimateEntity): ] = self._tado_zone_data.default_overlay_termination_duration return state_attr - def set_swing_mode(self, swing_mode): + def set_swing_mode(self, swing_mode: str) -> None: """Set swing modes for the device.""" self._control_hvac(swing_mode=swing_mode) diff --git a/homeassistant/components/tado/sensor.py b/homeassistant/components/tado/sensor.py index 40dcce397c6..22f4608f670 100644 --- a/homeassistant/components/tado/sensor.py +++ b/homeassistant/components/tado/sensor.py @@ -102,7 +102,7 @@ class TadoHomeSensor(TadoHomeEntity, SensorEntity): self._state_attributes = None self._tado_weather_data = self._tado.data["weather"] - async def async_added_to_hass(self): + async def async_added_to_hass(self) -> None: """Register for sensor updates.""" self.async_on_remove( @@ -211,7 +211,7 @@ class TadoZoneSensor(TadoZoneEntity, SensorEntity): self._state_attributes = None self._tado_zone_data = None - async def async_added_to_hass(self): + async def async_added_to_hass(self) -> None: """Register for sensor updates.""" self.async_on_remove( diff --git a/homeassistant/components/tado/water_heater.py b/homeassistant/components/tado/water_heater.py index a009fdc3b92..3bd3ae48026 100644 --- a/homeassistant/components/tado/water_heater.py +++ b/homeassistant/components/tado/water_heater.py @@ -1,5 +1,6 @@ """Support for Tado hot water zones.""" import logging +from typing import Any import voluptuous as vol @@ -152,7 +153,7 @@ class TadoWaterHeater(TadoZoneEntity, WaterHeaterEntity): self._overlay_mode = CONST_MODE_SMART_SCHEDULE self._tado_zone_data = None - async def async_added_to_hass(self): + async def async_added_to_hass(self) -> None: """Register for sensor updates.""" self.async_on_remove( @@ -211,7 +212,7 @@ class TadoWaterHeater(TadoZoneEntity, WaterHeaterEntity): """Return the maximum temperature.""" return self._max_temperature - def set_operation_mode(self, operation_mode): + def set_operation_mode(self, operation_mode: str) -> None: """Set new operation mode.""" mode = None @@ -233,7 +234,7 @@ class TadoWaterHeater(TadoZoneEntity, WaterHeaterEntity): hvac_mode=CONST_MODE_HEAT, target_temp=temperature, duration=time_period ) - def set_temperature(self, **kwargs): + def set_temperature(self, **kwargs: Any) -> None: """Set new target temperature.""" temperature = kwargs.get(ATTR_TEMPERATURE) if not self._supports_temperature_control or temperature is None: diff --git a/homeassistant/components/tank_utility/sensor.py b/homeassistant/components/tank_utility/sensor.py index 1e10eee6841..f902abc22e0 100644 --- a/homeassistant/components/tank_utility/sensor.py +++ b/homeassistant/components/tank_utility/sensor.py @@ -133,7 +133,7 @@ class TankUtilitySensor(SensorEntity): data.update(data.pop("lastReading", {})) return data - def update(self): + def update(self) -> None: """Set the device state and attributes.""" data = self.get_data() self._state = round(data[SENSOR_TYPE], SENSOR_ROUNDING_PRECISION) diff --git a/homeassistant/components/tapsaff/binary_sensor.py b/homeassistant/components/tapsaff/binary_sensor.py index 9608971e78a..5ffa8690f94 100644 --- a/homeassistant/components/tapsaff/binary_sensor.py +++ b/homeassistant/components/tapsaff/binary_sensor.py @@ -61,7 +61,7 @@ class TapsAffSensor(BinarySensorEntity): """Return true if taps aff.""" return self.data.is_taps_aff - def update(self): + def update(self) -> None: """Get the latest data.""" self.data.update() diff --git a/homeassistant/components/ted5000/sensor.py b/homeassistant/components/ted5000/sensor.py index b62efc01f0a..e579ac6c359 100644 --- a/homeassistant/components/ted5000/sensor.py +++ b/homeassistant/components/ted5000/sensor.py @@ -98,7 +98,7 @@ class Ted5000Sensor(SensorEntity): with suppress(KeyError): return self._gateway.data[self._mtu][self._unit] - def update(self): + def update(self) -> None: """Get the latest data from REST API.""" self._gateway.update() diff --git a/homeassistant/components/tellduslive/switch.py b/homeassistant/components/tellduslive/switch.py index a1bb2ffc9e1..fbecda2e775 100644 --- a/homeassistant/components/tellduslive/switch.py +++ b/homeassistant/components/tellduslive/switch.py @@ -1,4 +1,6 @@ """Support for Tellstick switches using Tellstick Net.""" +from typing import Any + from homeassistant.components import switch from homeassistant.components.switch import SwitchEntity from homeassistant.config_entries import ConfigEntry @@ -37,12 +39,12 @@ class TelldusLiveSwitch(TelldusLiveEntity, SwitchEntity): """Return true if switch is on.""" return self.device.is_on - def turn_on(self, **kwargs): + def turn_on(self, **kwargs: Any) -> None: """Turn the switch on.""" self.device.turn_on() self._update_callback() - def turn_off(self, **kwargs): + def turn_off(self, **kwargs: Any) -> None: """Turn the switch off.""" self.device.turn_off() self._update_callback() diff --git a/homeassistant/components/tellstick/sensor.py b/homeassistant/components/tellstick/sensor.py index e820c46da45..bfd433e1674 100644 --- a/homeassistant/components/tellstick/sensor.py +++ b/homeassistant/components/tellstick/sensor.py @@ -160,6 +160,6 @@ class TellstickSensor(SensorEntity): self._attr_native_unit_of_measurement = sensor_info.unit or None self._attr_name = f"{name} {sensor_info.name}" - def update(self): + def update(self) -> None: """Update tellstick sensor.""" self._attr_native_value = self._tellcore_sensor.value(self._datatype).value diff --git a/homeassistant/components/telnet/switch.py b/homeassistant/components/telnet/switch.py index 9ad295d9ac5..f919834139b 100644 --- a/homeassistant/components/telnet/switch.py +++ b/homeassistant/components/telnet/switch.py @@ -146,14 +146,14 @@ class TelnetSwitch(SwitchEntity): return None self._attr_is_on = rendered == "True" - def turn_on(self, **kwargs) -> None: + def turn_on(self, **kwargs: Any) -> None: """Turn the device on.""" self._telnet_command(self._command_on) if self.assumed_state: self._attr_is_on = True self.schedule_update_ha_state() - def turn_off(self, **kwargs) -> None: + def turn_off(self, **kwargs: Any) -> None: """Turn the device off.""" self._telnet_command(self._command_off) if self.assumed_state: diff --git a/homeassistant/components/temper/sensor.py b/homeassistant/components/temper/sensor.py index b8d3cc38f69..606227ee7f5 100644 --- a/homeassistant/components/temper/sensor.py +++ b/homeassistant/components/temper/sensor.py @@ -91,7 +91,7 @@ class TemperSensor(SensorEntity): # set calibration data self.temper_device.set_calibration_data(scale=self.scale, offset=self.offset) - def update(self): + def update(self) -> None: """Retrieve latest state.""" try: sensor_value = self.temper_device.get_temperature("celsius") diff --git a/homeassistant/components/tfiac/climate.py b/homeassistant/components/tfiac/climate.py index 58f16d1cc99..46163056948 100644 --- a/homeassistant/components/tfiac/climate.py +++ b/homeassistant/components/tfiac/climate.py @@ -4,6 +4,7 @@ from __future__ import annotations from concurrent import futures from datetime import timedelta import logging +from typing import Any from pytfiac import Tfiac import voluptuous as vol @@ -94,7 +95,7 @@ class TfiacClimate(ClimateEntity): """Return if the device is available.""" return self._available - async def async_update(self): + async def async_update(self) -> None: """Update status via socket polling.""" try: await self._client.update() @@ -167,7 +168,7 @@ class TfiacClimate(ClimateEntity): """List of available swing modes.""" return SUPPORT_SWING - async def async_set_temperature(self, **kwargs): + async def async_set_temperature(self, **kwargs: Any) -> None: """Set new target temperature.""" if (temp := kwargs.get(ATTR_TEMPERATURE)) is not None: await self._client.set_state(TARGET_TEMP, temp) @@ -179,18 +180,18 @@ class TfiacClimate(ClimateEntity): else: await self._client.set_state(OPERATION_MODE, HVAC_MAP[hvac_mode]) - async def async_set_fan_mode(self, fan_mode): + async def async_set_fan_mode(self, fan_mode: str) -> None: """Set new fan mode.""" await self._client.set_state(FAN_MODE, fan_mode.capitalize()) - async def async_set_swing_mode(self, swing_mode): + async def async_set_swing_mode(self, swing_mode: str) -> None: """Set new swing mode.""" await self._client.set_swing(swing_mode.capitalize()) - async def async_turn_on(self): + async def async_turn_on(self) -> None: """Turn device on.""" await self._client.set_state(OPERATION_MODE) - async def async_turn_off(self): + async def async_turn_off(self) -> None: """Turn device off.""" await self._client.set_state(ON_MODE, "off") diff --git a/homeassistant/components/thermoworks_smoke/sensor.py b/homeassistant/components/thermoworks_smoke/sensor.py index 72be9a05519..2297883ec6d 100644 --- a/homeassistant/components/thermoworks_smoke/sensor.py +++ b/homeassistant/components/thermoworks_smoke/sensor.py @@ -127,7 +127,7 @@ class ThermoworksSmokeSensor(SensorEntity): else: self._attr_native_unit_of_measurement = self.mgr.units(self.serial, PROBE_1) - def update(self): + def update(self) -> None: """Get the monitored data from firebase.""" try: diff --git a/homeassistant/components/thethingsnetwork/sensor.py b/homeassistant/components/thethingsnetwork/sensor.py index d6a029a3604..e14bd944d36 100644 --- a/homeassistant/components/thethingsnetwork/sensor.py +++ b/homeassistant/components/thethingsnetwork/sensor.py @@ -109,7 +109,7 @@ class TtnDataSensor(SensorEntity): ATTR_TIME: self._state["time"], } - async def async_update(self): + async def async_update(self) -> None: """Get the current state.""" await self._ttn_data_storage.async_update() self._state = self._ttn_data_storage.data diff --git a/homeassistant/components/thinkingcleaner/sensor.py b/homeassistant/components/thinkingcleaner/sensor.py index 3eadffa0a10..8b0d30d13ed 100644 --- a/homeassistant/components/thinkingcleaner/sensor.py +++ b/homeassistant/components/thinkingcleaner/sensor.py @@ -107,7 +107,7 @@ class ThinkingCleanerSensor(SensorEntity): self._attr_name = f"{tc_object.name} {description.name}" - def update(self): + def update(self) -> None: """Update the sensor.""" self._update_devices() diff --git a/homeassistant/components/thinkingcleaner/switch.py b/homeassistant/components/thinkingcleaner/switch.py index 31fb9709e57..66d2ab02e93 100644 --- a/homeassistant/components/thinkingcleaner/switch.py +++ b/homeassistant/components/thinkingcleaner/switch.py @@ -3,6 +3,7 @@ from __future__ import annotations from datetime import timedelta import time +from typing import Any from pythinkingcleaner import Discovery, ThinkingCleaner import voluptuous as vol @@ -130,7 +131,7 @@ class ThinkingCleanerSwitch(SwitchEntity): return False - def turn_on(self, **kwargs): + def turn_on(self, **kwargs: Any) -> None: """Turn the device on.""" sensor_type = self.entity_description.key if sensor_type == "clean": @@ -141,13 +142,13 @@ class ThinkingCleanerSwitch(SwitchEntity): elif sensor_type == "find": self._tc_object.find_me() - def turn_off(self, **kwargs): + def turn_off(self, **kwargs: Any) -> None: """Turn the device off.""" if self.entity_description.key == "clean": self.set_graceful_lock(False) self._tc_object.stop_cleaning() - def update(self): + def update(self) -> None: """Update the switch state (Only for clean).""" if self.entity_description.key == "clean" and not self.is_update_locked(): self._tc_object.update() diff --git a/homeassistant/components/tibber/sensor.py b/homeassistant/components/tibber/sensor.py index 9cfc4ecbb5a..ca0c253590f 100644 --- a/homeassistant/components/tibber/sensor.py +++ b/homeassistant/components/tibber/sensor.py @@ -350,7 +350,7 @@ class TibberSensorElPrice(TibberSensor): self._device_name = self._home_name - async def async_update(self): + async def async_update(self) -> None: """Get the latest data and updates the states.""" now = dt_util.now() if ( @@ -448,7 +448,7 @@ class TibberSensorRT(TibberSensor, CoordinatorEntity["TibberRtDataCoordinator"]) self._attr_native_unit_of_measurement = tibber_home.currency @property - def available(self): + def available(self) -> bool: """Return True if entity is available.""" return self._tibber_home.rt_subscription_running diff --git a/homeassistant/components/tmb/sensor.py b/homeassistant/components/tmb/sensor.py index dafcf909399..8d6db00b2b9 100644 --- a/homeassistant/components/tmb/sensor.py +++ b/homeassistant/components/tmb/sensor.py @@ -119,7 +119,7 @@ class TMBSensor(SensorEntity): } @Throttle(MIN_TIME_BETWEEN_UPDATES) - def update(self): + def update(self) -> None: """Get the next bus information.""" try: self._state = self._ibus_client.get_stop_forecast(self._stop, self._line) diff --git a/homeassistant/components/tod/binary_sensor.py b/homeassistant/components/tod/binary_sensor.py index d287431d712..1c909388b60 100644 --- a/homeassistant/components/tod/binary_sensor.py +++ b/homeassistant/components/tod/binary_sensor.py @@ -225,7 +225,7 @@ class TodSensor(BinarySensorEntity): # Offset is already there self._time_before += timedelta(days=1) - async def async_added_to_hass(self): + async def async_added_to_hass(self) -> None: """Call when entity about to be added to Home Assistant.""" self._calculate_boundary_time() self._calculate_next_update() diff --git a/homeassistant/components/todoist/calendar.py b/homeassistant/components/todoist/calendar.py index f1240f33b1b..30391f90d03 100644 --- a/homeassistant/components/todoist/calendar.py +++ b/homeassistant/components/todoist/calendar.py @@ -308,7 +308,7 @@ class TodoistProjectEntity(CalendarEntity): """Return the name of the entity.""" return self._name - def update(self): + def update(self) -> None: """Update all Todoist Calendars.""" self.data.update() # Set Todoist-specific data that can't easily be grabbed diff --git a/homeassistant/components/toon/climate.py b/homeassistant/components/toon/climate.py index 07e0aed66ac..2d7cf4c04f6 100644 --- a/homeassistant/components/toon/climate.py +++ b/homeassistant/components/toon/climate.py @@ -103,7 +103,7 @@ class ToonThermostatDevice(ToonDisplayDeviceEntity, ClimateEntity): return {"heating_type": self.coordinator.data.agreement.heating_type} @toon_exception_handler - async def async_set_temperature(self, **kwargs) -> None: + async def async_set_temperature(self, **kwargs: Any) -> None: """Change the setpoint of the thermostat.""" temperature = kwargs.get(ATTR_TEMPERATURE) await self.coordinator.toon.set_current_setpoint(temperature) diff --git a/homeassistant/components/totalconnect/binary_sensor.py b/homeassistant/components/totalconnect/binary_sensor.py index e86b54272a0..32e0b3573f5 100644 --- a/homeassistant/components/totalconnect/binary_sensor.py +++ b/homeassistant/components/totalconnect/binary_sensor.py @@ -49,7 +49,7 @@ class TotalConnectBinarySensor(BinarySensorEntity): """Return the name of the device.""" return self._name - def update(self): + def update(self) -> None: """Return the state of the device.""" self._is_tampered = self._zone.is_tampered() self._is_low_battery = self._zone.is_low_battery() diff --git a/homeassistant/components/touchline/climate.py b/homeassistant/components/touchline/climate.py index 78fd00b734c..bd7bdce4efe 100644 --- a/homeassistant/components/touchline/climate.py +++ b/homeassistant/components/touchline/climate.py @@ -1,7 +1,7 @@ """Platform for Roth Touchline floor heating controller.""" from __future__ import annotations -from typing import NamedTuple +from typing import Any, NamedTuple from pytouchline import PyTouchline import voluptuous as vol @@ -75,7 +75,7 @@ class Touchline(ClimateEntity): self._current_operation_mode = None self._preset_mode = None - def update(self): + def update(self) -> None: """Update thermostat attributes.""" self.unit.update() self._name = self.unit.get_name() @@ -120,7 +120,7 @@ class Touchline(ClimateEntity): """Set new target hvac mode.""" self._current_operation_mode = HVACMode.HEAT - def set_temperature(self, **kwargs): + def set_temperature(self, **kwargs: Any) -> None: """Set new target temperature.""" if kwargs.get(ATTR_TEMPERATURE) is not None: self._target_temperature = kwargs.get(ATTR_TEMPERATURE) diff --git a/homeassistant/components/traccar/device_tracker.py b/homeassistant/components/traccar/device_tracker.py index 784e3c70f33..b668d2fff33 100644 --- a/homeassistant/components/traccar/device_tracker.py +++ b/homeassistant/components/traccar/device_tracker.py @@ -411,7 +411,7 @@ class TraccarEntity(TrackerEntity, RestoreEntity): """Return the source type, eg gps or router, of the device.""" return SourceType.GPS - async def async_added_to_hass(self): + async def async_added_to_hass(self) -> None: """Register state update callback.""" await super().async_added_to_hass() self._unsub_dispatcher = async_dispatcher_connect( @@ -445,7 +445,7 @@ class TraccarEntity(TrackerEntity, RestoreEntity): } self._battery = attr.get(ATTR_BATTERY) - async def async_will_remove_from_hass(self): + async def async_will_remove_from_hass(self) -> None: """Clean up after entity before removal.""" await super().async_will_remove_from_hass() self._unsub_dispatcher() diff --git a/homeassistant/components/transmission/sensor.py b/homeassistant/components/transmission/sensor.py index c3f160cb040..0472ce221fb 100644 --- a/homeassistant/components/transmission/sensor.py +++ b/homeassistant/components/transmission/sensor.py @@ -75,11 +75,11 @@ class TransmissionSensor(SensorEntity): return self._state @property - def available(self): + def available(self) -> bool: """Could the device be accessed during the last update call.""" return self._tm_client.api.available - async def async_added_to_hass(self): + async def async_added_to_hass(self) -> None: """Handle entity which will be added.""" @callback @@ -102,7 +102,7 @@ class TransmissionSpeedSensor(TransmissionSensor): """Return the unit of measurement of this entity, if any.""" return DATA_RATE_MEGABYTES_PER_SECOND - def update(self): + def update(self) -> None: """Get the latest data from Transmission and updates the state.""" if data := self._tm_client.api.data: mb_spd = ( @@ -117,7 +117,7 @@ class TransmissionSpeedSensor(TransmissionSensor): class TransmissionStatusSensor(TransmissionSensor): """Representation of a Transmission status sensor.""" - def update(self): + def update(self) -> None: """Get the latest data from Transmission and updates the state.""" if data := self._tm_client.api.data: upload = data.uploadSpeed @@ -163,7 +163,7 @@ class TransmissionTorrentsSensor(TransmissionSensor): STATE_ATTR_TORRENT_INFO: info, } - def update(self): + def update(self) -> None: """Get the latest data from Transmission and updates the state.""" torrents = _filter_torrents( self._tm_client.api.torrents, statuses=self.SUBTYPE_MODES[self._sub_type] diff --git a/homeassistant/components/transmission/switch.py b/homeassistant/components/transmission/switch.py index 63477eecf48..0fd9ffee51e 100644 --- a/homeassistant/components/transmission/switch.py +++ b/homeassistant/components/transmission/switch.py @@ -1,5 +1,6 @@ """Support for setting the Transmission BitTorrent client Turtle Mode.""" import logging +from typing import Any from homeassistant.components.switch import SwitchEntity from homeassistant.config_entries import ConfigEntry @@ -61,11 +62,11 @@ class TransmissionSwitch(SwitchEntity): return self._state == STATE_ON @property - def available(self): + def available(self) -> bool: """Could the device be accessed during the last update call.""" return self._tm_client.api.available - def turn_on(self, **kwargs): + def turn_on(self, **kwargs: Any) -> None: """Turn the device on.""" if self.type == "on_off": _LOGGING.debug("Starting all torrents") @@ -75,7 +76,7 @@ class TransmissionSwitch(SwitchEntity): self._tm_client.api.set_alt_speed_enabled(True) self._tm_client.api.update() - def turn_off(self, **kwargs): + def turn_off(self, **kwargs: Any) -> None: """Turn the device off.""" if self.type == "on_off": _LOGGING.debug("Stopping all torrents") @@ -85,7 +86,7 @@ class TransmissionSwitch(SwitchEntity): self._tm_client.api.set_alt_speed_enabled(False) self._tm_client.api.update() - async def async_added_to_hass(self): + async def async_added_to_hass(self) -> None: """Handle entity which will be added.""" self.unsub_update = async_dispatcher_connect( self.hass, @@ -103,7 +104,7 @@ class TransmissionSwitch(SwitchEntity): self.unsub_update() self.unsub_update = None - def update(self): + def update(self) -> None: """Get the latest data from Transmission and updates the state.""" active = None if self.type == "on_off": diff --git a/homeassistant/components/transport_nsw/sensor.py b/homeassistant/components/transport_nsw/sensor.py index 54d555bacb7..27fd6fd67fd 100644 --- a/homeassistant/components/transport_nsw/sensor.py +++ b/homeassistant/components/transport_nsw/sensor.py @@ -120,7 +120,7 @@ class TransportNSWSensor(SensorEntity): """Icon to use in the frontend, if any.""" return self._icon - def update(self): + def update(self) -> None: """Get the latest data from Transport NSW and update the states.""" self.data.update() self._times = self.data.info diff --git a/homeassistant/components/travisci/sensor.py b/homeassistant/components/travisci/sensor.py index 7b15f5c0dc8..c35391d4573 100644 --- a/homeassistant/components/travisci/sensor.py +++ b/homeassistant/components/travisci/sensor.py @@ -174,7 +174,7 @@ class TravisCISensor(SensorEntity): return attrs - def update(self): + def update(self) -> None: """Get the latest data and updates the states.""" _LOGGER.debug("Updating sensor %s", self.name) diff --git a/homeassistant/components/trend/binary_sensor.py b/homeassistant/components/trend/binary_sensor.py index e3bd4816f44..b98d904cabd 100644 --- a/homeassistant/components/trend/binary_sensor.py +++ b/homeassistant/components/trend/binary_sensor.py @@ -169,7 +169,7 @@ class SensorTrend(BinarySensorEntity): ATTR_SAMPLE_DURATION: self._sample_duration, } - async def async_added_to_hass(self): + async def async_added_to_hass(self) -> None: """Complete device setup after being added to hass.""" @callback @@ -195,7 +195,7 @@ class SensorTrend(BinarySensorEntity): ) ) - async def async_update(self): + async def async_update(self) -> None: """Get the latest data and update the states.""" # Remove outdated samples if self._sample_duration > 0: