Axis - Streamline setup and teardown of integration (#35675)
* Streamline setup and teardown of integration * Dont remove integration twice
This commit is contained in:
1 parent
890013cecf
commit
714047f789
4 files changed
+42
-51
No files matched your search
@@ -110,7 +110,7 @@ async def setup_axis_integration(
|
||||
await hass.config_entries.async_setup(config_entry.entry_id)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
return hass.data[AXIS_DOMAIN].get(config[CONF_MAC])
|
||||
return hass.data[AXIS_DOMAIN].get(config_entry.unique_id)
|
||||
|
||||
|
||||
async def test_device_setup(hass):
|
||||
@@ -124,8 +124,8 @@ async def test_device_setup(hass):
|
||||
entry = device.config_entry
|
||||
|
||||
assert len(forward_entry_setup.mock_calls) == 3
|
||||
assert forward_entry_setup.mock_calls[0][1] == (entry, "camera")
|
||||
assert forward_entry_setup.mock_calls[1][1] == (entry, "binary_sensor")
|
||||
assert forward_entry_setup.mock_calls[0][1] == (entry, "binary_sensor")
|
||||
assert forward_entry_setup.mock_calls[1][1] == (entry, "camera")
|
||||
assert forward_entry_setup.mock_calls[2][1] == (entry, "switch")
|
||||
|
||||
assert device.host == ENTRY_CONFIG[CONF_HOST]
|
||||
|
||||
Reference in new issue
Block a user