Remove manual configuration support (#32699)
This commit is contained in:
1 parent
40fc72aac2
commit
374a8157e7
6 files changed
+9
-152
No files matched your search
@@ -189,32 +189,6 @@ async def test_controller_mac(hass):
|
||||
assert controller.mac == "10:00:00:00:00:01"
|
||||
|
||||
|
||||
async def test_controller_import_config(hass):
|
||||
"""Test that import configuration.yaml instructions work."""
|
||||
controllers = [
|
||||
{
|
||||
CONF_HOST: "1.2.3.4",
|
||||
CONF_SITE_ID: "Site name",
|
||||
unifi.CONF_BLOCK_CLIENT: ["random mac"],
|
||||
unifi.CONF_DONT_TRACK_CLIENTS: True,
|
||||
unifi.CONF_DONT_TRACK_DEVICES: True,
|
||||
unifi.CONF_DONT_TRACK_WIRED_CLIENTS: True,
|
||||
unifi.CONF_DETECTION_TIME: 150,
|
||||
unifi.CONF_SSID_FILTER: ["SSID"],
|
||||
}
|
||||
]
|
||||
|
||||
controller = await setup_unifi_integration(hass, controllers=controllers)
|
||||
|
||||
assert controller.option_allow_bandwidth_sensors is False
|
||||
assert controller.option_block_clients == ["random mac"]
|
||||
assert controller.option_track_clients is False
|
||||
assert controller.option_track_devices is False
|
||||
assert controller.option_track_wired_clients is False
|
||||
assert controller.option_detection_time == timedelta(seconds=150)
|
||||
assert controller.option_ssid_filter == ["SSID"]
|
||||
|
||||
|
||||
async def test_controller_not_accessible(hass):
|
||||
"""Retry to login gets scheduled when connection fails."""
|
||||
with patch.object(
|
||||
|
||||
@@ -10,6 +10,7 @@ from homeassistant import config_entries
|
||||
from homeassistant.components import unifi
|
||||
import homeassistant.components.device_tracker as device_tracker
|
||||
from homeassistant.components.unifi.const import (
|
||||
CONF_BLOCK_CLIENT,
|
||||
CONF_SSID_FILTER,
|
||||
CONF_TRACK_CLIENTS,
|
||||
CONF_TRACK_DEVICES,
|
||||
@@ -456,7 +457,7 @@ async def test_restoring_client(hass):
|
||||
|
||||
await setup_unifi_integration(
|
||||
hass,
|
||||
options={unifi.CONF_BLOCK_CLIENT: True},
|
||||
options={CONF_BLOCK_CLIENT: True},
|
||||
clients_response=[CLIENT_2],
|
||||
clients_all_response=[CLIENT_1],
|
||||
)
|
||||
|
||||
@@ -13,33 +13,6 @@ async def test_setup_with_no_config(hass):
|
||||
"""Test that we do not discover anything or try to set up a bridge."""
|
||||
assert await async_setup_component(hass, unifi.DOMAIN, {}) is True
|
||||
assert unifi.DOMAIN not in hass.data
|
||||
assert hass.data[unifi.UNIFI_CONFIG] == []
|
||||
|
||||
|
||||
async def test_setup_with_config(hass):
|
||||
"""Test that we do not discover anything or try to set up a bridge."""
|
||||
config = {
|
||||
unifi.DOMAIN: {
|
||||
unifi.CONF_CONTROLLERS: {
|
||||
unifi.CONF_HOST: "1.2.3.4",
|
||||
unifi.CONF_SITE_ID: "My site",
|
||||
unifi.CONF_BLOCK_CLIENT: ["12:34:56:78:90:AB"],
|
||||
unifi.CONF_DETECTION_TIME: 3,
|
||||
unifi.CONF_SSID_FILTER: ["ssid"],
|
||||
}
|
||||
}
|
||||
}
|
||||
assert await async_setup_component(hass, unifi.DOMAIN, config) is True
|
||||
assert unifi.DOMAIN not in hass.data
|
||||
assert hass.data[unifi.UNIFI_CONFIG] == [
|
||||
{
|
||||
unifi.CONF_HOST: "1.2.3.4",
|
||||
unifi.CONF_SITE_ID: "My site",
|
||||
unifi.CONF_BLOCK_CLIENT: ["12:34:56:78:90:AB"],
|
||||
unifi.CONF_DETECTION_TIME: 3,
|
||||
unifi.CONF_SSID_FILTER: ["ssid"],
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
async def test_successful_config_entry(hass):
|
||||
|
||||
Reference in new issue
Block a user