Skip to content

Commit 4d7de2f

Browse files
authored
Bump tplink-omada-api to 1.5.3 (home-assistant#156645)
1 parent 779590c commit 4d7de2f

File tree

5 files changed

+21
-10
lines changed

5 files changed

+21
-10
lines changed

homeassistant/components/tplink_omada/manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,5 @@
66
"documentation": "https://www.home-assistant.io/integrations/tplink_omada",
77
"integration_type": "hub",
88
"iot_class": "local_polling",
9-
"requirements": ["tplink-omada-client==1.4.4"]
9+
"requirements": ["tplink-omada-client==1.5.3"]
1010
}

homeassistant/components/tplink_omada/switch.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,12 @@
77
from functools import partial
88
from typing import Any, Generic, TypeVar
99

10-
from tplink_omada_client import OmadaSiteClient, SwitchPortOverrides
10+
from tplink_omada_client import (
11+
GatewayPortSettings,
12+
OmadaSiteClient,
13+
PortProfileOverrides,
14+
SwitchPortSettings,
15+
)
1116
from tplink_omada_client.definitions import GatewayPortMode, PoEMode, PortType
1217
from tplink_omada_client.devices import (
1318
OmadaDevice,
@@ -17,7 +22,6 @@
1722
OmadaSwitch,
1823
OmadaSwitchPortDetails,
1924
)
20-
from tplink_omada_client.omadasiteclient import GatewayPortSettings
2125

2226
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
2327
from homeassistant.const import EntityCategory
@@ -184,7 +188,12 @@ async def _wan_connect_disconnect(
184188
),
185189
set_func=(
186190
lambda client, device, port, enable: client.update_switch_port(
187-
device, port, overrides=SwitchPortOverrides(enable_poe=enable)
191+
device,
192+
port,
193+
settings=SwitchPortSettings(
194+
profile_override_enabled=True,
195+
profile_overrides=PortProfileOverrides(enable_poe=enable),
196+
),
188197
)
189198
),
190199
update_func=lambda p: p.poe_mode != PoEMode.DISABLED,

requirements_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

requirements_test_all.txt

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/components/tplink_omada/test_switch.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from unittest.mock import AsyncMock, MagicMock
66

77
from syrupy.assertion import SnapshotAssertion
8-
from tplink_omada_client import SwitchPortOverrides
8+
from tplink_omada_client import SwitchPortSettings
99
from tplink_omada_client.definitions import PoEMode
1010
from tplink_omada_client.devices import (
1111
OmadaGateway,
@@ -249,14 +249,16 @@ def assert_update_switch_port(
249249
device: OmadaSwitch,
250250
switch_port_details: OmadaSwitchPortDetails,
251251
poe_enabled: bool,
252-
overrides: SwitchPortOverrides = None,
252+
settings: SwitchPortSettings,
253253
) -> None:
254254
assert device
255255
assert device.mac == network_switch_mac
256256
assert switch_port_details
257257
assert switch_port_details.port == port_num
258-
assert overrides
259-
assert overrides.enable_poe == poe_enabled
258+
assert settings
259+
assert settings.profile_override_enabled
260+
assert settings.profile_overrides
261+
assert settings.profile_overrides.enable_poe == poe_enabled
260262

261263
entity = hass.states.get(entity_id)
262264
assert entity == snapshot

0 commit comments

Comments
 (0)