Adjust device registry for Matter devices (#86108)

* adjust device registry

* ignore test unique id

* update test

* ditch uniqueid + prefix serial

* adjust test

* add tests

* fix switch test

* prefix all identifiers

* Update homeassistant/components/matter/adapter.py

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>

* no underscore in id

* fix test

Co-authored-by: Martin Hjelmare <marhje52@gmail.com>
This commit is contained in:
Marcel van der Veldt 2023-01-18 17:17:33 +01:00 committed by GitHub
parent 5e6ba594aa
commit 4bebf00598
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 57 additions and 21 deletions

View file

@ -30,7 +30,7 @@ async def test_turn_on(
switch_node: MatterNode,
) -> None:
"""Test turning on a switch."""
state = hass.states.get("switch.mock_onoff_plugin_unit")
state = hass.states.get("switch.mock_onoffpluginunit_powerplug_switch")
assert state
assert state.state == "off"
@ -38,7 +38,7 @@ async def test_turn_on(
"switch",
"turn_on",
{
"entity_id": "switch.mock_onoff_plugin_unit",
"entity_id": "switch.mock_onoffpluginunit_powerplug_switch",
},
blocking=True,
)
@ -53,7 +53,7 @@ async def test_turn_on(
set_node_attribute(switch_node, 1, 6, 0, True)
await trigger_subscription_callback(hass, matter_client)
state = hass.states.get("switch.mock_onoff_plugin_unit")
state = hass.states.get("switch.mock_onoffpluginunit_powerplug_switch")
assert state
assert state.state == "on"
@ -64,7 +64,7 @@ async def test_turn_off(
switch_node: MatterNode,
) -> None:
"""Test turning off a switch."""
state = hass.states.get("switch.mock_onoff_plugin_unit")
state = hass.states.get("switch.mock_onoffpluginunit_powerplug_switch")
assert state
assert state.state == "off"
@ -72,7 +72,7 @@ async def test_turn_off(
"switch",
"turn_off",
{
"entity_id": "switch.mock_onoff_plugin_unit",
"entity_id": "switch.mock_onoffpluginunit_powerplug_switch",
},
blocking=True,
)