diff --git a/homeassistant/components/fritz/button.py b/homeassistant/components/fritz/button.py index a0cbd54eaac..263521d23f4 100644 --- a/homeassistant/components/fritz/button.py +++ b/homeassistant/components/fritz/button.py @@ -5,7 +5,7 @@ from __future__ import annotations from collections.abc import Callable from dataclasses import dataclass import logging -from typing import Final +from typing import Any, Final from homeassistant.components.button import ( ButtonDeviceClass, @@ -30,7 +30,7 @@ _LOGGER = logging.getLogger(__name__) class FritzButtonDescription(ButtonEntityDescription): """Class to describe a Button entity.""" - press_action: Callable + press_action: Callable[[AvmWrapper], Any] BUTTONS: Final = [ diff --git a/homeassistant/components/fritz/const.py b/homeassistant/components/fritz/const.py index 3794a83dd7f..9a266507c25 100644 --- a/homeassistant/components/fritz/const.py +++ b/homeassistant/components/fritz/const.py @@ -57,9 +57,6 @@ ERROR_UPNP_NOT_CONFIGURED = "upnp_not_configured" ERROR_UNKNOWN = "unknown_error" FRITZ_SERVICES = "fritz_services" -SERVICE_REBOOT = "reboot" -SERVICE_RECONNECT = "reconnect" -SERVICE_CLEANUP = "cleanup" SERVICE_SET_GUEST_WIFI_PW = "set_guest_wifi_password" SWITCH_TYPE_DEFLECTION = "CallDeflection" diff --git a/homeassistant/components/fritz/coordinator.py b/homeassistant/components/fritz/coordinator.py index 7256085b93a..299679e642a 100644 --- a/homeassistant/components/fritz/coordinator.py +++ b/homeassistant/components/fritz/coordinator.py @@ -46,9 +46,6 @@ from .const import ( DEFAULT_USERNAME, DOMAIN, FRITZ_EXCEPTIONS, - SERVICE_CLEANUP, - SERVICE_REBOOT, - SERVICE_RECONNECT, SERVICE_SET_GUEST_WIFI_PW, MeshRoles, ) @@ -730,30 +727,6 @@ class FritzBoxTools(DataUpdateCoordinator[UpdateCoordinatorDataType]): ) try: - if service_call.service == SERVICE_REBOOT: - _LOGGER.warning( - 'Service "fritz.reboot" is deprecated, please use the corresponding' - " button entity instead" - ) - await self.async_trigger_reboot() - return - - if service_call.service == SERVICE_RECONNECT: - _LOGGER.warning( - 'Service "fritz.reconnect" is deprecated, please use the' - " corresponding button entity instead" - ) - await self.async_trigger_reconnect() - return - - if service_call.service == SERVICE_CLEANUP: - _LOGGER.warning( - 'Service "fritz.cleanup" is deprecated, please use the' - " corresponding button entity instead" - ) - await self.async_trigger_cleanup(config_entry) - return - if service_call.service == SERVICE_SET_GUEST_WIFI_PW: await self.async_trigger_set_guest_password( service_call.data.get("password"), diff --git a/homeassistant/components/fritz/services.py b/homeassistant/components/fritz/services.py index bd1f3136b01..bace7480ba5 100644 --- a/homeassistant/components/fritz/services.py +++ b/homeassistant/components/fritz/services.py @@ -11,14 +11,7 @@ from homeassistant.core import HomeAssistant, ServiceCall from homeassistant.exceptions import HomeAssistantError from homeassistant.helpers.service import async_extract_config_entry_ids -from .const import ( - DOMAIN, - FRITZ_SERVICES, - SERVICE_CLEANUP, - SERVICE_REBOOT, - SERVICE_RECONNECT, - SERVICE_SET_GUEST_WIFI_PW, -) +from .const import DOMAIN, FRITZ_SERVICES, SERVICE_SET_GUEST_WIFI_PW from .coordinator import AvmWrapper _LOGGER = logging.getLogger(__name__) @@ -32,9 +25,6 @@ SERVICE_SCHEMA_SET_GUEST_WIFI_PW = vol.Schema( ) SERVICE_LIST: list[tuple[str, vol.Schema | None]] = [ - (SERVICE_CLEANUP, None), - (SERVICE_REBOOT, None), - (SERVICE_RECONNECT, None), (SERVICE_SET_GUEST_WIFI_PW, SERVICE_SCHEMA_SET_GUEST_WIFI_PW), ] diff --git a/homeassistant/components/fritz/services.yaml b/homeassistant/components/fritz/services.yaml index b9828280aa2..0ac7ca20c3d 100644 --- a/homeassistant/components/fritz/services.yaml +++ b/homeassistant/components/fritz/services.yaml @@ -1,31 +1,3 @@ -reconnect: - fields: - device_id: - required: true - selector: - device: - integration: fritz - entity: - device_class: connectivity -reboot: - fields: - device_id: - required: true - selector: - device: - integration: fritz - entity: - device_class: connectivity - -cleanup: - fields: - device_id: - required: true - selector: - device: - integration: fritz - entity: - device_class: connectivity set_guest_wifi_password: fields: device_id: diff --git a/homeassistant/components/fritz/strings.json b/homeassistant/components/fritz/strings.json index 30603ca9032..eb47f76f27e 100644 --- a/homeassistant/components/fritz/strings.json +++ b/homeassistant/components/fritz/strings.json @@ -144,42 +144,12 @@ } }, "services": { - "reconnect": { - "name": "[%key:component::fritz::entity::button::reconnect::name%]", - "description": "Reconnects your FRITZ!Box internet connection.", - "fields": { - "device_id": { - "name": "Fritz!Box Device", - "description": "Select the Fritz!Box to reconnect." - } - } - }, - "reboot": { - "name": "Reboot", - "description": "Reboots your FRITZ!Box.", - "fields": { - "device_id": { - "name": "[%key:component::fritz::services::reconnect::fields::device_id::name%]", - "description": "Select the Fritz!Box to reboot." - } - } - }, - "cleanup": { - "name": "Remove stale device tracker entities", - "description": "Remove FRITZ!Box stale device_tracker entities.", - "fields": { - "device_id": { - "name": "[%key:component::fritz::services::reconnect::fields::device_id::name%]", - "description": "Select the Fritz!Box to check." - } - } - }, "set_guest_wifi_password": { "name": "Set guest Wi-Fi password", "description": "Sets a new password for the guest Wi-Fi. The password must be between 8 and 63 characters long. If no additional parameter is set, the password will be auto-generated with a length of 12 characters.", "fields": { "device_id": { - "name": "[%key:component::fritz::services::reconnect::fields::device_id::name%]", + "name": "Fritz!Box Device", "description": "Select the Fritz!Box to configure." }, "password": {