1
0
mirror of https://github.com/home-assistant/core.git synced 2025-12-25 05:26:47 +00:00

Store Axis device with entry_id key rather than unique_id (#85673)

* Store Axis device with entry_id key rather than unique_id

* Fix review comments
This commit is contained in:
Robert Svensson
2023-01-13 22:21:40 +01:00
committed by GitHub
parent c191daedc3
commit be899b6ab6
12 changed files with 27 additions and 33 deletions

View File

@@ -41,7 +41,7 @@ async def test_no_switches(hass):
async def test_switches_with_port_cgi(hass, mock_rtsp_event):
"""Test that switches are loaded properly using port.cgi."""
config_entry = await setup_axis_integration(hass)
device = hass.data[AXIS_DOMAIN][config_entry.unique_id]
device = hass.data[AXIS_DOMAIN][config_entry.entry_id]
device.api.vapix.ports = {"0": AsyncMock(), "1": AsyncMock()}
device.api.vapix.ports["0"].name = "Doorbell"
@@ -103,7 +103,7 @@ async def test_switches_with_port_management(
with patch.dict(API_DISCOVERY_RESPONSE, api_discovery):
config_entry = await setup_axis_integration(hass)
device = hass.data[AXIS_DOMAIN][config_entry.unique_id]
device = hass.data[AXIS_DOMAIN][config_entry.entry_id]
device.api.vapix.ports = {"0": AsyncMock(), "1": AsyncMock()}
device.api.vapix.ports["0"].name = "Doorbell"