Fix homekit locks not being created from when setup from the UI (#53301)

This commit is contained in:
J. Nick Koston
2021-07-21 19:22:06 -10:00
committed by GitHub
parent 596179d180
commit e78a62c802
5 changed files with 16 additions and 9 deletions

View File

@@ -144,6 +144,7 @@ async def test_setup_creates_entries_for_accessory_mode_devices(hass):
"""Test we can setup a new instance and we create entries for accessory mode devices."""
hass.states.async_set("camera.one", "on")
hass.states.async_set("camera.existing", "on")
hass.states.async_set("lock.new", "on")
hass.states.async_set("media_player.two", "on", {"device_class": "tv"})
hass.states.async_set("remote.standard", "on")
hass.states.async_set("remote.activity", "on", {"supported_features": 4})
@@ -180,7 +181,7 @@ async def test_setup_creates_entries_for_accessory_mode_devices(hass):
result2 = await hass.config_entries.flow.async_configure(
result["flow_id"],
{"include_domains": ["camera", "media_player", "light", "remote"]},
{"include_domains": ["camera", "media_player", "light", "lock", "remote"]},
)
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
assert result2["step_id"] == "pairing"
@@ -207,7 +208,7 @@ async def test_setup_creates_entries_for_accessory_mode_devices(hass):
"filter": {
"exclude_domains": [],
"exclude_entities": [],
"include_domains": ["media_player", "light", "remote"],
"include_domains": ["media_player", "light", "lock", "remote"],
"include_entities": [],
},
"exclude_accessory_mode": True,
@@ -225,7 +226,8 @@ async def test_setup_creates_entries_for_accessory_mode_devices(hass):
# 4 - camera.one in accessory mode
# 5 - media_player.two in accessory mode
# 6 - remote.activity in accessory mode
assert len(mock_setup_entry.mock_calls) == 6
# 7 - lock.new in accessory mode
assert len(mock_setup_entry.mock_calls) == 7
async def test_import(hass):