Bump aiounifi to v66 (#104336)

This commit is contained in:
Robert Svensson 2023-11-22 07:02:13 +01:00 committed by GitHub
parent 464270d849
commit f1fd8a0d2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 23 additions and 18 deletions

View File

@ -8,7 +8,7 @@
"iot_class": "local_push",
"loggers": ["aiounifi"],
"quality_scale": "platinum",
"requirements": ["aiounifi==65"],
"requirements": ["aiounifi==66"],
"ssdp": [
{
"manufacturer": "Ubiquiti Networks",

View File

@ -374,7 +374,7 @@ aiosyncthing==0.5.1
aiotractive==0.5.6
# homeassistant.components.unifi
aiounifi==65
aiounifi==66
# homeassistant.components.vlc_telnet
aiovlc==0.1.0

View File

@ -347,7 +347,7 @@ aiosyncthing==0.5.1
aiotractive==0.5.6
# homeassistant.components.unifi
aiounifi==65
aiounifi==66
# homeassistant.components.vlc_telnet
aiovlc==0.1.0

View File

@ -167,6 +167,11 @@ def mock_default_unifi_requests(
json={"data": wlans_response or [], "meta": {"rc": "ok"}},
headers={"content-type": CONTENT_TYPE_JSON},
)
aioclient_mock.get(
f"https://{host}:1234/v2/api/site/{site_id}/trafficroutes",
json=[{}],
headers={"content-type": CONTENT_TYPE_JSON},
)
aioclient_mock.get(
f"https://{host}:1234/v2/api/site/{site_id}/trafficrules",
json=[{}],

View File

@ -771,7 +771,6 @@ async def test_no_clients(
},
)
assert aioclient_mock.call_count == 12
assert len(hass.states.async_entity_ids(SWITCH_DOMAIN)) == 0
@ -852,7 +851,7 @@ async def test_switches(
assert ent_reg.async_get(entry_id).entity_category is EntityCategory.CONFIG
# Block and unblock client
aioclient_mock.clear_requests()
aioclient_mock.post(
f"https://{controller.host}:1234/api/s/{controller.site}/cmd/stamgr",
)
@ -860,8 +859,8 @@ async def test_switches(
await hass.services.async_call(
SWITCH_DOMAIN, "turn_off", {"entity_id": "switch.block_client_1"}, blocking=True
)
assert aioclient_mock.call_count == 13
assert aioclient_mock.mock_calls[12][2] == {
assert aioclient_mock.call_count == 1
assert aioclient_mock.mock_calls[0][2] == {
"mac": "00:00:00:00:01:01",
"cmd": "block-sta",
}
@ -869,14 +868,14 @@ async def test_switches(
await hass.services.async_call(
SWITCH_DOMAIN, "turn_on", {"entity_id": "switch.block_client_1"}, blocking=True
)
assert aioclient_mock.call_count == 14
assert aioclient_mock.mock_calls[13][2] == {
assert aioclient_mock.call_count == 2
assert aioclient_mock.mock_calls[1][2] == {
"mac": "00:00:00:00:01:01",
"cmd": "unblock-sta",
}
# Enable and disable DPI
aioclient_mock.clear_requests()
aioclient_mock.put(
f"https://{controller.host}:1234/api/s/{controller.site}/rest/dpiapp/5f976f62e3c58f018ec7e17d",
)
@ -887,8 +886,8 @@ async def test_switches(
{"entity_id": "switch.block_media_streaming"},
blocking=True,
)
assert aioclient_mock.call_count == 15
assert aioclient_mock.mock_calls[14][2] == {"enabled": False}
assert aioclient_mock.call_count == 1
assert aioclient_mock.mock_calls[0][2] == {"enabled": False}
await hass.services.async_call(
SWITCH_DOMAIN,
@ -896,8 +895,8 @@ async def test_switches(
{"entity_id": "switch.block_media_streaming"},
blocking=True,
)
assert aioclient_mock.call_count == 16
assert aioclient_mock.mock_calls[15][2] == {"enabled": True}
assert aioclient_mock.call_count == 2
assert aioclient_mock.mock_calls[1][2] == {"enabled": True}
async def test_remove_switches(
@ -976,6 +975,7 @@ async def test_block_switches(
assert blocked is not None
assert blocked.state == "off"
aioclient_mock.clear_requests()
aioclient_mock.post(
f"https://{controller.host}:1234/api/s/{controller.site}/cmd/stamgr",
)
@ -983,8 +983,8 @@ async def test_block_switches(
await hass.services.async_call(
SWITCH_DOMAIN, "turn_off", {"entity_id": "switch.block_client_1"}, blocking=True
)
assert aioclient_mock.call_count == 13
assert aioclient_mock.mock_calls[12][2] == {
assert aioclient_mock.call_count == 1
assert aioclient_mock.mock_calls[0][2] == {
"mac": "00:00:00:00:01:01",
"cmd": "block-sta",
}
@ -992,8 +992,8 @@ async def test_block_switches(
await hass.services.async_call(
SWITCH_DOMAIN, "turn_on", {"entity_id": "switch.block_client_1"}, blocking=True
)
assert aioclient_mock.call_count == 14
assert aioclient_mock.mock_calls[13][2] == {
assert aioclient_mock.call_count == 2
assert aioclient_mock.mock_calls[1][2] == {
"mac": "00:00:00:00:01:01",
"cmd": "unblock-sta",
}