mirror of
https://github.com/elisspace/core.git
synced 2026-09-29 22:09:55 +00:00
Allow loading UniFi entities on config options change (#88762)
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
This commit is contained in:
co-authored by
Franck Nijhof
parent
ee6f969c2a
commit
9ff45ca013
@@ -635,6 +635,15 @@ async def test_option_track_devices(
|
||||
assert hass.states.get("device_tracker.client")
|
||||
assert not hass.states.get("device_tracker.device")
|
||||
|
||||
hass.config_entries.async_update_entry(
|
||||
config_entry,
|
||||
options={CONF_TRACK_DEVICES: True},
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert hass.states.get("device_tracker.client")
|
||||
assert hass.states.get("device_tracker.device")
|
||||
|
||||
|
||||
async def test_option_ssid_filter(
|
||||
hass: HomeAssistant,
|
||||
@@ -1041,7 +1050,7 @@ async def test_dont_track_devices(
|
||||
"version": "4.0.42.10433",
|
||||
}
|
||||
|
||||
await setup_unifi_integration(
|
||||
config_entry = await setup_unifi_integration(
|
||||
hass,
|
||||
aioclient_mock,
|
||||
options={CONF_TRACK_DEVICES: False},
|
||||
@@ -1053,6 +1062,16 @@ async def test_dont_track_devices(
|
||||
assert hass.states.get("device_tracker.client")
|
||||
assert not hass.states.get("device_tracker.device")
|
||||
|
||||
hass.config_entries.async_update_entry(
|
||||
config_entry,
|
||||
options={CONF_TRACK_DEVICES: True},
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert len(hass.states.async_entity_ids(TRACKER_DOMAIN)) == 2
|
||||
assert hass.states.get("device_tracker.client")
|
||||
assert hass.states.get("device_tracker.device")
|
||||
|
||||
|
||||
async def test_dont_track_wired_clients(
|
||||
hass: HomeAssistant, aioclient_mock: AiohttpClientMocker, mock_device_registry
|
||||
|
||||
Reference in New Issue
Block a user