diff --git a/homeassistant/components/august/button.py b/homeassistant/components/august/button.py index 5f4032153a2f..c96db61ca1a7 100644 --- a/homeassistant/components/august/button.py +++ b/homeassistant/components/august/button.py @@ -30,7 +30,7 @@ class AugustWakeLockButton(AugustEntityMixin, ButtonEntity): self._attr_name = f"{device.device_name} Wake" self._attr_unique_id = f"{self._device_id}_wake" - async def async_press(self, **kwargs): + async def async_press(self) -> None: """Wake the device.""" await self._data.async_status_async(self._device_id, self._hyper_bridge) diff --git a/homeassistant/components/bond/button.py b/homeassistant/components/bond/button.py index 2c6ffc69693e..9a82309e347b 100644 --- a/homeassistant/components/bond/button.py +++ b/homeassistant/components/bond/button.py @@ -2,7 +2,6 @@ from __future__ import annotations from dataclasses import dataclass -from typing import Any from bond_async import Action, BPUPSubscriptions @@ -290,7 +289,7 @@ class BondButtonEntity(BondEntity, ButtonEntity): hub, device, bpup_subs, description.name, description.key.lower() ) - async def async_press(self, **kwargs: Any) -> None: + async def async_press(self) -> None: """Press the button.""" if self.entity_description.argument: action = Action( diff --git a/homeassistant/components/esphome/button.py b/homeassistant/components/esphome/button.py index 5b6f2c153c8e..3f610c8bbfa9 100644 --- a/homeassistant/components/esphome/button.py +++ b/homeassistant/components/esphome/button.py @@ -2,7 +2,6 @@ from __future__ import annotations from contextlib import suppress -from typing import Any from aioesphomeapi import ButtonInfo, EntityState @@ -46,6 +45,6 @@ class EsphomeButton(EsphomeEntity[ButtonInfo, EntityState], ButtonEntity): # never gets a state update. self._on_state_update() - async def async_press(self, **kwargs: Any) -> None: + async def async_press(self) -> None: """Press the button.""" await self._client.button_command(self._static_info.key) diff --git a/homeassistant/components/mqtt/button.py b/homeassistant/components/mqtt/button.py index 370243c35794..0374727bf7d8 100644 --- a/homeassistant/components/mqtt/button.py +++ b/homeassistant/components/mqtt/button.py @@ -130,7 +130,7 @@ class MqttButton(MqttEntity, ButtonEntity): """Return the device class of the sensor.""" return self._config.get(CONF_DEVICE_CLASS) - async def async_press(self, **kwargs): + async def async_press(self) -> None: """Turn the device on. This method is a coroutine. diff --git a/homeassistant/components/octoprint/button.py b/homeassistant/components/octoprint/button.py index e16f123a73a3..0d403c3ec879 100644 --- a/homeassistant/components/octoprint/button.py +++ b/homeassistant/components/octoprint/button.py @@ -5,6 +5,7 @@ from homeassistant.components.button import ButtonEntity from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.exceptions import HomeAssistantError +from homeassistant.helpers.entity import DeviceInfo from homeassistant.helpers.entity_platform import AddEntitiesCallback from homeassistant.helpers.update_coordinator import CoordinatorEntity @@ -54,7 +55,7 @@ class OctoprintButton(CoordinatorEntity[OctoprintDataUpdateCoordinator], ButtonE self._attr_unique_id = f"{button_type}-{device_id}" @property - def device_info(self): + def device_info(self) -> DeviceInfo: """Device info.""" return self.coordinator.device_info diff --git a/homeassistant/components/tuya/button.py b/homeassistant/components/tuya/button.py index 3b4a2883266d..26014e53b741 100644 --- a/homeassistant/components/tuya/button.py +++ b/homeassistant/components/tuya/button.py @@ -1,8 +1,6 @@ """Support for Tuya buttons.""" from __future__ import annotations -from typing import Any - from tuya_iot import TuyaDevice, TuyaDeviceManager from homeassistant.components.button import ButtonEntity, ButtonEntityDescription @@ -109,6 +107,6 @@ class TuyaButtonEntity(TuyaEntity, ButtonEntity): self.entity_description = description self._attr_unique_id = f"{super().unique_id}{description.key}" - def press(self, **kwargs: Any) -> None: + def press(self) -> None: """Press the button.""" self._send_command([{"code": self.entity_description.key, "value": True}]) diff --git a/homeassistant/components/xiaomi_miio/button.py b/homeassistant/components/xiaomi_miio/button.py index 6a69289f7efa..0f5b59a262d5 100644 --- a/homeassistant/components/xiaomi_miio/button.py +++ b/homeassistant/components/xiaomi_miio/button.py @@ -2,7 +2,6 @@ from __future__ import annotations from dataclasses import dataclass -from typing import Any from homeassistant.components.button import ( ButtonDeviceClass, @@ -111,7 +110,7 @@ class XiaomiGenericCoordinatedButton(XiaomiCoordinatedMiioEntity, ButtonEntity): super().__init__(name, device, entry, unique_id, coordinator) self.entity_description = description - async def async_press(self, **kwargs: Any) -> None: + async def async_press(self) -> None: """Press the button.""" method = getattr(self._device, self.entity_description.method_press) await self._try_command( diff --git a/homeassistant/components/yale_smart_alarm/button.py b/homeassistant/components/yale_smart_alarm/button.py index 081c25c43427..cd312e79ceb8 100644 --- a/homeassistant/components/yale_smart_alarm/button.py +++ b/homeassistant/components/yale_smart_alarm/button.py @@ -1,7 +1,7 @@ """Support for Yale Smart Alarm button.""" from __future__ import annotations -from typing import TYPE_CHECKING, Any +from typing import TYPE_CHECKING from homeassistant.components.button import ButtonEntity, ButtonEntityDescription from homeassistant.config_entries import ConfigEntry @@ -50,7 +50,7 @@ class YalePanicButton(YaleAlarmEntity, ButtonEntity): self._attr_name = f"{coordinator.entry.data[CONF_NAME]} {description.name}" self._attr_unique_id = f"yale_smart_alarm-{description.key}" - async def async_press(self, **kwargs: Any) -> None: + async def async_press(self) -> None: """Press the button.""" if TYPE_CHECKING: assert self.coordinator.yale, "Connection to API is missing" diff --git a/homeassistant/components/zwave_me/button.py b/homeassistant/components/zwave_me/button.py index 69354daad435..7e0b4f02728c 100644 --- a/homeassistant/components/zwave_me/button.py +++ b/homeassistant/components/zwave_me/button.py @@ -1,6 +1,4 @@ """Representation of a toggleButton.""" -from typing import Any - from homeassistant.components.button import ButtonEntity from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant, callback @@ -41,6 +39,6 @@ async def async_setup_entry( class ZWaveMeButton(ZWaveMeEntity, ButtonEntity): """Representation of a ZWaveMe button.""" - def press(self, **kwargs: Any) -> None: + def press(self) -> None: """Turn the entity on.""" self.controller.zwave_api.send_command(self.device.id, "on")