Skip to content

Commit e14cf8a

Browse files
authored
Remove deprecated service in plex (home-assistant#146608)
* Remove deprecated service in plex * Update json/yaml
1 parent 30dbd5a commit e14cf8a

File tree

6 files changed

+2
-42
lines changed

6 files changed

+2
-42
lines changed

homeassistant/components/plex/const.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
MANUAL_SETUP_STRING = "Configure Plex server manually"
5757

5858
SERVICE_REFRESH_LIBRARY = "refresh_library"
59-
SERVICE_SCAN_CLIENTS = "scan_for_clients"
6059

6160
PLEX_URI_SCHEME = "plex://"
6261

homeassistant/components/plex/icons.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,6 @@
99
"services": {
1010
"refresh_library": {
1111
"service": "mdi:refresh"
12-
},
13-
"scan_for_clients": {
14-
"service": "mdi:database-refresh"
1512
}
1613
}
1714
}

homeassistant/components/plex/services.py

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,8 @@
99

1010
from homeassistant.core import HomeAssistant, ServiceCall
1111
from homeassistant.exceptions import HomeAssistantError
12-
from homeassistant.helpers.dispatcher import async_dispatcher_send
13-
14-
from .const import (
15-
DOMAIN,
16-
PLEX_UPDATE_PLATFORMS_SIGNAL,
17-
PLEX_URI_SCHEME,
18-
SERVERS,
19-
SERVICE_REFRESH_LIBRARY,
20-
SERVICE_SCAN_CLIENTS,
21-
)
12+
13+
from .const import DOMAIN, PLEX_URI_SCHEME, SERVERS, SERVICE_REFRESH_LIBRARY
2214
from .errors import MediaNotFound
2315
from .helpers import get_plex_data
2416
from .models import PlexMediaSearchResult
@@ -37,24 +29,12 @@ async def async_setup_services(hass: HomeAssistant) -> None:
3729
async def async_refresh_library_service(service_call: ServiceCall) -> None:
3830
await hass.async_add_executor_job(refresh_library, hass, service_call)
3931

40-
async def async_scan_clients_service(_: ServiceCall) -> None:
41-
_LOGGER.warning(
42-
"This service is deprecated in favor of the scan_clients button entity."
43-
" Service calls will still work for now but the service will be removed in"
44-
" a future release"
45-
)
46-
for server_id in get_plex_data(hass)[SERVERS]:
47-
async_dispatcher_send(hass, PLEX_UPDATE_PLATFORMS_SIGNAL.format(server_id))
48-
4932
hass.services.async_register(
5033
DOMAIN,
5134
SERVICE_REFRESH_LIBRARY,
5235
async_refresh_library_service,
5336
schema=REFRESH_LIBRARY_SCHEMA,
5437
)
55-
hass.services.async_register(
56-
DOMAIN, SERVICE_SCAN_CLIENTS, async_scan_clients_service
57-
)
5838

5939

6040
def refresh_library(hass: HomeAssistant, service_call: ServiceCall) -> None:

homeassistant/components/plex/services.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,3 @@ refresh_library:
99
example: "TV Shows"
1010
selector:
1111
text:
12-
13-
scan_for_clients:

homeassistant/components/plex/strings.json

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -83,10 +83,6 @@
8383
"description": "Name of the Plex library to refresh."
8484
}
8585
}
86-
},
87-
"scan_for_clients": {
88-
"name": "Scan for clients",
89-
"description": "Scans for available clients from the Plex server(s), local network, and plex.tv."
9086
}
9187
}
9288
}

tests/components/plex/test_services.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
PLEX_SERVER_CONFIG,
1818
PLEX_URI_SCHEME,
1919
SERVICE_REFRESH_LIBRARY,
20-
SERVICE_SCAN_CLIENTS,
2120
)
2221
from homeassistant.components.plex.services import process_plex_payload
2322
from homeassistant.const import CONF_URL
@@ -107,15 +106,6 @@ async def test_refresh_library(
107106
assert refresh.call_count == 1
108107

109108

110-
async def test_scan_clients(hass: HomeAssistant, mock_plex_server) -> None:
111-
"""Test scan_for_clients service call."""
112-
await hass.services.async_call(
113-
DOMAIN,
114-
SERVICE_SCAN_CLIENTS,
115-
blocking=True,
116-
)
117-
118-
119109
async def test_lookup_media_for_other_integrations(
120110
hass: HomeAssistant,
121111
entry,

0 commit comments

Comments
 (0)