diff --git a/homeassistant/components/plex/const.py b/homeassistant/components/plex/const.py index d5d70219471..b43a1eca135 100644 --- a/homeassistant/components/plex/const.py +++ b/homeassistant/components/plex/const.py @@ -56,7 +56,6 @@ AUTOMATIC_SETUP_STRING = "Obtain a new token from plex.tv" MANUAL_SETUP_STRING = "Configure Plex server manually" SERVICE_REFRESH_LIBRARY = "refresh_library" -SERVICE_SCAN_CLIENTS = "scan_for_clients" PLEX_URI_SCHEME = "plex://" diff --git a/homeassistant/components/plex/icons.json b/homeassistant/components/plex/icons.json index 2d3a7342ad2..21a48fd274e 100644 --- a/homeassistant/components/plex/icons.json +++ b/homeassistant/components/plex/icons.json @@ -9,9 +9,6 @@ "services": { "refresh_library": { "service": "mdi:refresh" - }, - "scan_for_clients": { - "service": "mdi:database-refresh" } } } diff --git a/homeassistant/components/plex/services.py b/homeassistant/components/plex/services.py index c70ddb6ed53..6412a4c3927 100644 --- a/homeassistant/components/plex/services.py +++ b/homeassistant/components/plex/services.py @@ -9,16 +9,8 @@ from yarl import URL from homeassistant.core import HomeAssistant, ServiceCall from homeassistant.exceptions import HomeAssistantError -from homeassistant.helpers.dispatcher import async_dispatcher_send -from .const import ( - DOMAIN, - PLEX_UPDATE_PLATFORMS_SIGNAL, - PLEX_URI_SCHEME, - SERVERS, - SERVICE_REFRESH_LIBRARY, - SERVICE_SCAN_CLIENTS, -) +from .const import DOMAIN, PLEX_URI_SCHEME, SERVERS, SERVICE_REFRESH_LIBRARY from .errors import MediaNotFound from .helpers import get_plex_data from .models import PlexMediaSearchResult @@ -37,24 +29,12 @@ async def async_setup_services(hass: HomeAssistant) -> None: async def async_refresh_library_service(service_call: ServiceCall) -> None: await hass.async_add_executor_job(refresh_library, hass, service_call) - async def async_scan_clients_service(_: ServiceCall) -> None: - _LOGGER.warning( - "This service is deprecated in favor of the scan_clients button entity." - " Service calls will still work for now but the service will be removed in" - " a future release" - ) - for server_id in get_plex_data(hass)[SERVERS]: - async_dispatcher_send(hass, PLEX_UPDATE_PLATFORMS_SIGNAL.format(server_id)) - hass.services.async_register( DOMAIN, SERVICE_REFRESH_LIBRARY, async_refresh_library_service, schema=REFRESH_LIBRARY_SCHEMA, ) - hass.services.async_register( - DOMAIN, SERVICE_SCAN_CLIENTS, async_scan_clients_service - ) def refresh_library(hass: HomeAssistant, service_call: ServiceCall) -> None: diff --git a/homeassistant/components/plex/services.yaml b/homeassistant/components/plex/services.yaml index 5ed655b7d78..ee4a2a234ea 100644 --- a/homeassistant/components/plex/services.yaml +++ b/homeassistant/components/plex/services.yaml @@ -9,5 +9,3 @@ refresh_library: example: "TV Shows" selector: text: - -scan_for_clients: diff --git a/homeassistant/components/plex/strings.json b/homeassistant/components/plex/strings.json index 0c8eae86f73..0eb83a64a5d 100644 --- a/homeassistant/components/plex/strings.json +++ b/homeassistant/components/plex/strings.json @@ -83,10 +83,6 @@ "description": "Name of the Plex library to refresh." } } - }, - "scan_for_clients": { - "name": "Scan for clients", - "description": "Scans for available clients from the Plex server(s), local network, and plex.tv." } } } diff --git a/tests/components/plex/test_services.py b/tests/components/plex/test_services.py index c84322e1c14..8a6dceb1e47 100644 --- a/tests/components/plex/test_services.py +++ b/tests/components/plex/test_services.py @@ -17,7 +17,6 @@ from homeassistant.components.plex.const import ( PLEX_SERVER_CONFIG, PLEX_URI_SCHEME, SERVICE_REFRESH_LIBRARY, - SERVICE_SCAN_CLIENTS, ) from homeassistant.components.plex.services import process_plex_payload from homeassistant.const import CONF_URL @@ -107,15 +106,6 @@ async def test_refresh_library( assert refresh.call_count == 1 -async def test_scan_clients(hass: HomeAssistant, mock_plex_server) -> None: - """Test scan_for_clients service call.""" - await hass.services.async_call( - DOMAIN, - SERVICE_SCAN_CLIENTS, - blocking=True, - ) - - async def test_lookup_media_for_other_integrations( hass: HomeAssistant, entry,