Skip to content

Commit

Permalink
Bumo aiounifi to v50
Browse files Browse the repository at this point in the history
Id key of wlans have changed so need to adapt config flow
  • Loading branch information
Kane610 committed Jul 24, 2023
1 parent 827655f commit 1229945
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/unifi/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ async def async_step_device_tracker(
return await self.async_step_client_control()

ssids = (
set(self.controller.api.wlans)
{wlan.name for wlan in self.controller.api.wlans.values()}
| {
f"{wlan.name}{wlan.name_combine_suffix}"
for wlan in self.controller.api.wlans.values()
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/unifi/image.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ class UnifiImageEntityDescription(
name_fn=lambda _: "QR Code",
object_fn=lambda api, obj_id: api.wlans[obj_id],
supported_fn=lambda controller, obj_id: True,
unique_id_fn=lambda controller, obj_id: f"qr_code-{controller.api.wlans[obj_id].id}",
unique_id_fn=lambda controller, obj_id: f"qr_code-{obj_id}",
image_fn=async_wlan_qr_code_image_fn,
value_fn=lambda obj: obj.x_passphrase,
),
Expand Down
2 changes: 1 addition & 1 deletion homeassistant/components/unifi/manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"iot_class": "local_push",
"loggers": ["aiounifi"],
"quality_scale": "platinum",
"requirements": ["aiounifi==49"],
"requirements": ["aiounifi==50"],
"ssdp": [
{
"manufacturer": "Ubiquiti Networks",
Expand Down
2 changes: 1 addition & 1 deletion requirements_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ aiosyncthing==0.5.1
aiotractive==0.5.5

# homeassistant.components.unifi
aiounifi==49
aiounifi==50

# homeassistant.components.vlc_telnet
aiovlc==0.1.0
Expand Down
2 changes: 1 addition & 1 deletion requirements_test_all.txt
Original file line number Diff line number Diff line change
Expand Up @@ -332,7 +332,7 @@ aiosyncthing==0.5.1
aiotractive==0.5.5

# homeassistant.components.unifi
aiounifi==49
aiounifi==50

# homeassistant.components.vlc_telnet
aiovlc==0.1.0
Expand Down
11 changes: 8 additions & 3 deletions tests/components/unifi/test_config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,14 @@
]

WLANS = [
{"name": "SSID 1"},
{"name": "SSID 2", "name_combine_enabled": False, "name_combine_suffix": "_IOT"},
{"name": "SSID 4", "name_combine_enabled": False},
{"_id": "1", "name": "SSID 1"},
{
"_id": "2",
"name": "SSID 2",
"name_combine_enabled": False,
"name_combine_suffix": "_IOT",
},
{"_id": "3", "name": "SSID 4", "name_combine_enabled": False},
]

DPI_GROUPS = [
Expand Down

0 comments on commit 1229945

Please sign in to comment.