Skip to content

Commit

Permalink
remove deprecated services
Browse files Browse the repository at this point in the history
  • Loading branch information
mib1185 committed May 25, 2024
1 parent 131c180 commit 39deeb6
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 102 deletions.
4 changes: 2 additions & 2 deletions homeassistant/components/fritz/button.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
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,
Expand All @@ -30,7 +30,7 @@
class FritzButtonDescription(ButtonEntityDescription):
"""Class to describe a Button entity."""

press_action: Callable
press_action: Callable[[AvmWrapper], Any]


BUTTONS: Final = [
Expand Down
3 changes: 0 additions & 3 deletions homeassistant/components/fritz/const.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,6 @@ class MeshRoles(StrEnum):
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"
Expand Down
27 changes: 0 additions & 27 deletions homeassistant/components/fritz/coordinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@
DEFAULT_USERNAME,
DOMAIN,
FRITZ_EXCEPTIONS,
SERVICE_CLEANUP,
SERVICE_REBOOT,
SERVICE_RECONNECT,
SERVICE_SET_GUEST_WIFI_PW,
MeshRoles,
)
Expand Down Expand Up @@ -730,30 +727,6 @@ async def service_fritzbox(
)

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"),
Expand Down
12 changes: 1 addition & 11 deletions homeassistant/components/fritz/services.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,7 @@
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__)
Expand All @@ -32,9 +25,6 @@
)

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),
]

Expand Down
28 changes: 0 additions & 28 deletions homeassistant/components/fritz/services.yaml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
32 changes: 1 addition & 31 deletions homeassistant/components/fritz/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down

0 comments on commit 39deeb6

Please sign in to comment.