Add Plex scan_clients button, enable autoscan (#67055)

Co-authored-by: Robert Svensson <Kane610@users.noreply.github.com>
This commit is contained in:
jjlawren 2022-02-22 18:34:48 -06:00 committed by GitHub
parent d5a2381f07
commit 1658d530e1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 129 additions and 2 deletions

View file

@ -276,3 +276,20 @@ async def test_bad_token_with_tokenless_server(
# Ensure updates that rely on account return nothing
trigger_plex_update(mock_websocket)
await hass.async_block_till_done()
async def test_scan_clients_schedule(hass, setup_plex_server):
"""Test scan_clients scheduled update."""
with patch(
"homeassistant.components.plex.server.PlexServer._async_update_platforms"
) as mock_scan_clients:
await setup_plex_server()
mock_scan_clients.reset_mock()
async_fire_time_changed(
hass,
dt_util.utcnow() + const.CLIENT_SCAN_INTERVAL,
)
await hass.async_block_till_done()
assert mock_scan_clients.called