Skip to content

Commit

Permalink
Make unique_id more explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
Kane610 committed Aug 12, 2023
1 parent 55a1f0c commit 388b2ea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion homeassistant/components/unifi/switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ class UnifiSwitchEntityDescription(
object_fn=lambda api, obj_id: api.port_forwarding[obj_id],
should_poll=False,
supported_fn=lambda controller, obj_id: True,
unique_id_fn=lambda controller, obj_id: obj_id,
unique_id_fn=lambda controller, obj_id: f"port_forward-{obj_id}",
),
UnifiSwitchEntityDescription[Ports, Port](
key="PoE port control",
Expand Down
2 changes: 1 addition & 1 deletion tests/components/unifi/test_switch.py
Original file line number Diff line number Diff line change
Expand Up @@ -1362,7 +1362,7 @@ async def test_port_forwarding_switches(

ent_reg = er.async_get(hass)
ent_reg_entry = ent_reg.async_get("switch.unifi_network_plex")
assert ent_reg_entry.unique_id == "5a32aa4ee4b0412345678911"
assert ent_reg_entry.unique_id == "port_forward-5a32aa4ee4b0412345678911"
assert ent_reg_entry.entity_category is EntityCategory.CONFIG

# Validate state object
Expand Down

0 comments on commit 388b2ea

Please sign in to comment.