UniFi - Change handling of updated options (#31762)
* Change handling of updated options * Add tests
This commit is contained in:
1 parent
e0a035ce35
commit
4cac0443e2
5 files changed
+320
-98
No files matched your search
@@ -99,3 +99,27 @@ async def test_sensors(hass):
|
||||
|
||||
wireless_client_tx = hass.states.get("sensor.wireless_client_name_tx")
|
||||
assert wireless_client_tx.state == "6789.0"
|
||||
|
||||
hass.config_entries.async_update_entry(
|
||||
controller.config_entry,
|
||||
options={unifi.const.CONF_ALLOW_BANDWIDTH_SENSORS: False},
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
wireless_client_rx = hass.states.get("sensor.wireless_client_name_rx")
|
||||
assert wireless_client_rx is None
|
||||
|
||||
wireless_client_tx = hass.states.get("sensor.wireless_client_name_tx")
|
||||
assert wireless_client_tx is None
|
||||
|
||||
hass.config_entries.async_update_entry(
|
||||
controller.config_entry,
|
||||
options={unifi.const.CONF_ALLOW_BANDWIDTH_SENSORS: True},
|
||||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
wireless_client_rx = hass.states.get("sensor.wireless_client_name_rx")
|
||||
assert wireless_client_rx.state == "2345.0"
|
||||
|
||||
wireless_client_tx = hass.states.get("sensor.wireless_client_name_tx")
|
||||
assert wireless_client_tx.state == "6789.0"
|
||||
Reference in new issue
Block a user