UniFi - Simplify config option of block clients to just a multi select drop down (#34514)
This commit is contained in:
1 parent
a5b98b40ac
commit
193e9bec97
3 files changed
+11
-69
No files matched your search
@@ -5,7 +5,6 @@ from asynctest import patch
|
||||
from homeassistant import data_entry_flow
|
||||
from homeassistant.components import unifi
|
||||
from homeassistant.components.unifi import config_flow
|
||||
from homeassistant.components.unifi.config_flow import CONF_NEW_CLIENT
|
||||
from homeassistant.components.unifi.const import (
|
||||
CONF_ALLOW_BANDWIDTH_SENSORS,
|
||||
CONF_BLOCK_CLIENT,
|
||||
@@ -293,38 +292,9 @@ async def test_option_flow(hass):
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["step_id"] == "client_control"
|
||||
|
||||
clients_to_block = hass.config_entries.options._progress[result["flow_id"]].options[
|
||||
CONF_BLOCK_CLIENT
|
||||
]
|
||||
result = await hass.config_entries.options.async_configure(
|
||||
result["flow_id"],
|
||||
user_input={
|
||||
CONF_BLOCK_CLIENT: clients_to_block,
|
||||
CONF_NEW_CLIENT: "00:00:00:00:00:01",
|
||||
CONF_POE_CLIENTS: False,
|
||||
},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["step_id"] == "client_control"
|
||||
|
||||
result = await hass.config_entries.options.async_configure(
|
||||
result["flow_id"],
|
||||
user_input={
|
||||
CONF_BLOCK_CLIENT: clients_to_block,
|
||||
CONF_NEW_CLIENT: "00:00:00:00:00:02",
|
||||
},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["step_id"] == "client_control"
|
||||
assert result["errors"] == {"base": "unknown_client_mac"}
|
||||
|
||||
clients_to_block = hass.config_entries.options._progress[result["flow_id"]].options[
|
||||
CONF_BLOCK_CLIENT
|
||||
]
|
||||
result = await hass.config_entries.options.async_configure(
|
||||
result["flow_id"], user_input={CONF_BLOCK_CLIENT: clients_to_block},
|
||||
user_input={CONF_BLOCK_CLIENT: [CLIENTS[0]["mac"]], CONF_POE_CLIENTS: False},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
@@ -343,6 +313,6 @@ async def test_option_flow(hass):
|
||||
CONF_DETECTION_TIME: 100,
|
||||
CONF_IGNORE_WIRED_BUG: False,
|
||||
CONF_POE_CLIENTS: False,
|
||||
CONF_BLOCK_CLIENT: ["00:00:00:00:00:01"],
|
||||
CONF_BLOCK_CLIENT: [CLIENTS[0]["mac"]],
|
||||
CONF_ALLOW_BANDWIDTH_SENSORS: True,
|
||||
}
|
||||
Reference in new issue
Block a user