Search/replace RESULT_TYPE_* by FlowResultType enum (#74642)
This commit is contained in:
parent
68ccb96089
commit
7cd68381f1
237 changed files with 2284 additions and 2280 deletions
|
@ -56,7 +56,7 @@ async def test_setup_in_bridge_mode(hass, mock_get_source_ip):
|
|||
result["flow_id"],
|
||||
{"include_domains": ["light"]},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "pairing"
|
||||
|
||||
with patch(
|
||||
|
@ -74,7 +74,7 @@ async def test_setup_in_bridge_mode(hass, mock_get_source_ip):
|
|||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
bridge_name = (result3["title"].split(":"))[0]
|
||||
assert bridge_name == SHORT_BRIDGE_NAME
|
||||
assert result3["data"] == {
|
||||
|
@ -112,7 +112,7 @@ async def test_setup_in_bridge_mode_name_taken(hass, mock_get_source_ip):
|
|||
result["flow_id"],
|
||||
{"include_domains": ["light"]},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "pairing"
|
||||
|
||||
with patch(
|
||||
|
@ -130,7 +130,7 @@ async def test_setup_in_bridge_mode_name_taken(hass, mock_get_source_ip):
|
|||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert result3["title"] != SHORT_BRIDGE_NAME
|
||||
assert result3["title"].startswith(SHORT_BRIDGE_NAME)
|
||||
bridge_name = (result3["title"].split(":"))[0]
|
||||
|
@ -194,7 +194,7 @@ async def test_setup_creates_entries_for_accessory_mode_devices(
|
|||
result["flow_id"],
|
||||
{"include_domains": ["camera", "media_player", "light", "lock", "remote"]},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "pairing"
|
||||
|
||||
with patch(
|
||||
|
@ -212,7 +212,7 @@ async def test_setup_creates_entries_for_accessory_mode_devices(
|
|||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert result3["title"][:11] == "HASS Bridge"
|
||||
bridge_name = (result3["title"].split(":"))[0]
|
||||
assert result3["data"] == {
|
||||
|
@ -257,7 +257,7 @@ async def test_import(hass, mock_get_source_ip):
|
|||
context={"source": config_entries.SOURCE_IMPORT},
|
||||
data={CONF_NAME: "mock_name", CONF_PORT: 12345},
|
||||
)
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
|
||||
assert result["type"] == data_entry_flow.FlowResultType.ABORT
|
||||
assert result["reason"] == "port_name_in_use"
|
||||
|
||||
with patch(
|
||||
|
@ -273,7 +273,7 @@ async def test_import(hass, mock_get_source_ip):
|
|||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert result2["title"] == "othername:56789"
|
||||
assert result2["data"] == {
|
||||
"name": "othername",
|
||||
|
@ -296,7 +296,7 @@ async def test_options_flow_exclude_mode_advanced(hass, mock_get_source_ip):
|
|||
config_entry.entry_id, context={"show_advanced_options": True}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
|
||||
result = await hass.config_entries.options.async_configure(
|
||||
|
@ -307,14 +307,14 @@ async def test_options_flow_exclude_mode_advanced(hass, mock_get_source_ip):
|
|||
},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "exclude"
|
||||
|
||||
result2 = await hass.config_entries.options.async_configure(
|
||||
result["flow_id"],
|
||||
user_input={"entities": ["climate.old"]},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "advanced"
|
||||
|
||||
with patch("homeassistant.components.homekit.async_setup_entry", return_value=True):
|
||||
|
@ -323,7 +323,7 @@ async def test_options_flow_exclude_mode_advanced(hass, mock_get_source_ip):
|
|||
user_input={},
|
||||
)
|
||||
|
||||
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"devices": [],
|
||||
"mode": "bridge",
|
||||
|
@ -351,7 +351,7 @@ async def test_options_flow_exclude_mode_basic(hass, mock_get_source_ip):
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
|
||||
result = await hass.config_entries.options.async_configure(
|
||||
|
@ -362,7 +362,7 @@ async def test_options_flow_exclude_mode_basic(hass, mock_get_source_ip):
|
|||
},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "exclude"
|
||||
entities = result["data_schema"]({})["entities"]
|
||||
assert entities == ["climate.front_gate"]
|
||||
|
@ -375,7 +375,7 @@ async def test_options_flow_exclude_mode_basic(hass, mock_get_source_ip):
|
|||
result["flow_id"],
|
||||
user_input={"entities": ["climate.old"]},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"mode": "bridge",
|
||||
"filter": {
|
||||
|
@ -430,7 +430,7 @@ async def test_options_flow_devices(
|
|||
config_entry.entry_id, context={"show_advanced_options": True}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
|
||||
result = await hass.config_entries.options.async_configure(
|
||||
|
@ -441,7 +441,7 @@ async def test_options_flow_devices(
|
|||
},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "exclude"
|
||||
|
||||
entry = entity_reg.async_get("light.ceiling_lights")
|
||||
|
@ -461,7 +461,7 @@ async def test_options_flow_devices(
|
|||
user_input={"devices": [device_id]},
|
||||
)
|
||||
|
||||
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"devices": [device_id],
|
||||
"mode": "bridge",
|
||||
|
@ -510,7 +510,7 @@ async def test_options_flow_devices_preserved_when_advanced_off(
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
|
||||
result = await hass.config_entries.options.async_configure(
|
||||
|
@ -521,7 +521,7 @@ async def test_options_flow_devices_preserved_when_advanced_off(
|
|||
},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "exclude"
|
||||
|
||||
result2 = await hass.config_entries.options.async_configure(
|
||||
|
@ -531,7 +531,7 @@ async def test_options_flow_devices_preserved_when_advanced_off(
|
|||
},
|
||||
)
|
||||
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"devices": ["1fabcabcabcabcabcabcabcabcabc"],
|
||||
"mode": "bridge",
|
||||
|
@ -567,7 +567,7 @@ async def test_options_flow_include_mode_with_non_existant_entity(
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
|
||||
result = await hass.config_entries.options.async_configure(
|
||||
|
@ -578,7 +578,7 @@ async def test_options_flow_include_mode_with_non_existant_entity(
|
|||
},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "include"
|
||||
|
||||
entities = result["data_schema"]({})["entities"]
|
||||
|
@ -590,7 +590,7 @@ async def test_options_flow_include_mode_with_non_existant_entity(
|
|||
"entities": ["climate.new", "climate.front_gate"],
|
||||
},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"mode": "bridge",
|
||||
"filter": {
|
||||
|
@ -626,7 +626,7 @@ async def test_options_flow_exclude_mode_with_non_existant_entity(
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
|
||||
result = await hass.config_entries.options.async_configure(
|
||||
|
@ -637,7 +637,7 @@ async def test_options_flow_exclude_mode_with_non_existant_entity(
|
|||
},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "exclude"
|
||||
|
||||
entities = result["data_schema"]({})["entities"]
|
||||
|
@ -649,7 +649,7 @@ async def test_options_flow_exclude_mode_with_non_existant_entity(
|
|||
"entities": ["climate.new", "climate.front_gate"],
|
||||
},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"mode": "bridge",
|
||||
"filter": {
|
||||
|
@ -676,7 +676,7 @@ async def test_options_flow_include_mode_basic(hass, mock_get_source_ip):
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
|
||||
result = await hass.config_entries.options.async_configure(
|
||||
|
@ -687,14 +687,14 @@ async def test_options_flow_include_mode_basic(hass, mock_get_source_ip):
|
|||
},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "include"
|
||||
|
||||
result2 = await hass.config_entries.options.async_configure(
|
||||
result["flow_id"],
|
||||
user_input={"entities": ["climate.new"]},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"mode": "bridge",
|
||||
"filter": {
|
||||
|
@ -723,7 +723,7 @@ async def test_options_flow_exclude_mode_with_cameras(hass, mock_get_source_ip):
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
|
||||
result = await hass.config_entries.options.async_configure(
|
||||
|
@ -734,7 +734,7 @@ async def test_options_flow_exclude_mode_with_cameras(hass, mock_get_source_ip):
|
|||
},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "exclude"
|
||||
|
||||
result2 = await hass.config_entries.options.async_configure(
|
||||
|
@ -743,7 +743,7 @@ async def test_options_flow_exclude_mode_with_cameras(hass, mock_get_source_ip):
|
|||
"entities": ["climate.old", "camera.excluded"],
|
||||
},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "cameras"
|
||||
|
||||
result3 = await hass.config_entries.options.async_configure(
|
||||
|
@ -751,7 +751,7 @@ async def test_options_flow_exclude_mode_with_cameras(hass, mock_get_source_ip):
|
|||
user_input={"camera_copy": ["camera.native_h264"]},
|
||||
)
|
||||
|
||||
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"mode": "bridge",
|
||||
"filter": {
|
||||
|
@ -769,7 +769,7 @@ async def test_options_flow_exclude_mode_with_cameras(hass, mock_get_source_ip):
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
|
||||
result = await hass.config_entries.options.async_configure(
|
||||
|
@ -780,7 +780,7 @@ async def test_options_flow_exclude_mode_with_cameras(hass, mock_get_source_ip):
|
|||
},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "exclude"
|
||||
|
||||
result2 = await hass.config_entries.options.async_configure(
|
||||
|
@ -789,7 +789,7 @@ async def test_options_flow_exclude_mode_with_cameras(hass, mock_get_source_ip):
|
|||
"entities": ["climate.old", "camera.excluded"],
|
||||
},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "cameras"
|
||||
|
||||
result3 = await hass.config_entries.options.async_configure(
|
||||
|
@ -797,7 +797,7 @@ async def test_options_flow_exclude_mode_with_cameras(hass, mock_get_source_ip):
|
|||
user_input={"camera_copy": ["camera.native_h264"]},
|
||||
)
|
||||
|
||||
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
|
||||
assert config_entry.options == {
|
||||
"mode": "bridge",
|
||||
|
@ -828,7 +828,7 @@ async def test_options_flow_include_mode_with_cameras(hass, mock_get_source_ip):
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
|
||||
result = await hass.config_entries.options.async_configure(
|
||||
|
@ -839,7 +839,7 @@ async def test_options_flow_include_mode_with_cameras(hass, mock_get_source_ip):
|
|||
},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "include"
|
||||
|
||||
result2 = await hass.config_entries.options.async_configure(
|
||||
|
@ -848,7 +848,7 @@ async def test_options_flow_include_mode_with_cameras(hass, mock_get_source_ip):
|
|||
"entities": ["camera.native_h264", "camera.transcode_h264"],
|
||||
},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "cameras"
|
||||
|
||||
result3 = await hass.config_entries.options.async_configure(
|
||||
|
@ -856,7 +856,7 @@ async def test_options_flow_include_mode_with_cameras(hass, mock_get_source_ip):
|
|||
user_input={"camera_copy": ["camera.native_h264"]},
|
||||
)
|
||||
|
||||
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"mode": "bridge",
|
||||
"filter": {
|
||||
|
@ -874,7 +874,7 @@ async def test_options_flow_include_mode_with_cameras(hass, mock_get_source_ip):
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
assert result["data_schema"]({}) == {
|
||||
"domains": ["fan", "vacuum", "climate", "camera"],
|
||||
|
@ -899,7 +899,7 @@ async def test_options_flow_include_mode_with_cameras(hass, mock_get_source_ip):
|
|||
},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "exclude"
|
||||
assert result["data_schema"]({}) == {
|
||||
"entities": ["camera.native_h264", "camera.transcode_h264"],
|
||||
|
@ -916,7 +916,7 @@ async def test_options_flow_include_mode_with_cameras(hass, mock_get_source_ip):
|
|||
"entities": ["climate.old", "camera.excluded"],
|
||||
},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "cameras"
|
||||
assert result2["data_schema"]({}) == {
|
||||
"camera_copy": ["camera.native_h264"],
|
||||
|
@ -930,7 +930,7 @@ async def test_options_flow_include_mode_with_cameras(hass, mock_get_source_ip):
|
|||
user_input={"camera_copy": []},
|
||||
)
|
||||
|
||||
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"entity_config": {"camera.native_h264": {}},
|
||||
"filter": {
|
||||
|
@ -960,7 +960,7 @@ async def test_options_flow_with_camera_audio(hass, mock_get_source_ip):
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
|
||||
result = await hass.config_entries.options.async_configure(
|
||||
|
@ -971,7 +971,7 @@ async def test_options_flow_with_camera_audio(hass, mock_get_source_ip):
|
|||
},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "include"
|
||||
|
||||
result2 = await hass.config_entries.options.async_configure(
|
||||
|
@ -980,7 +980,7 @@ async def test_options_flow_with_camera_audio(hass, mock_get_source_ip):
|
|||
"entities": ["camera.audio", "camera.no_audio"],
|
||||
},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "cameras"
|
||||
|
||||
result3 = await hass.config_entries.options.async_configure(
|
||||
|
@ -988,7 +988,7 @@ async def test_options_flow_with_camera_audio(hass, mock_get_source_ip):
|
|||
user_input={"camera_audio": ["camera.audio"]},
|
||||
)
|
||||
|
||||
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"mode": "bridge",
|
||||
"filter": {
|
||||
|
@ -1006,7 +1006,7 @@ async def test_options_flow_with_camera_audio(hass, mock_get_source_ip):
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
assert result["data_schema"]({}) == {
|
||||
"domains": ["fan", "vacuum", "climate", "camera"],
|
||||
|
@ -1031,7 +1031,7 @@ async def test_options_flow_with_camera_audio(hass, mock_get_source_ip):
|
|||
},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "exclude"
|
||||
assert result["data_schema"]({}) == {
|
||||
"entities": ["camera.audio", "camera.no_audio"],
|
||||
|
@ -1048,7 +1048,7 @@ async def test_options_flow_with_camera_audio(hass, mock_get_source_ip):
|
|||
"entities": ["climate.old", "camera.excluded"],
|
||||
},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "cameras"
|
||||
assert result2["data_schema"]({}) == {
|
||||
"camera_copy": [],
|
||||
|
@ -1062,7 +1062,7 @@ async def test_options_flow_with_camera_audio(hass, mock_get_source_ip):
|
|||
user_input={"camera_audio": []},
|
||||
)
|
||||
|
||||
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"entity_config": {"camera.audio": {}},
|
||||
"filter": {
|
||||
|
@ -1103,7 +1103,7 @@ async def test_options_flow_blocked_when_from_yaml(hass, mock_get_source_ip):
|
|||
|
||||
result = await hass.config_entries.options.async_init(config_entry.entry_id)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "yaml"
|
||||
|
||||
with patch("homeassistant.components.homekit.async_setup_entry", return_value=True):
|
||||
|
@ -1111,7 +1111,7 @@ async def test_options_flow_blocked_when_from_yaml(hass, mock_get_source_ip):
|
|||
result["flow_id"],
|
||||
user_input={},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
|
||||
|
||||
@patch(f"{PATH_HOMEKIT}.async_port_is_available", return_value=True)
|
||||
|
@ -1131,7 +1131,7 @@ async def test_options_flow_include_mode_basic_accessory(
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
assert result["data_schema"]({}) == {
|
||||
"domains": [
|
||||
|
@ -1151,7 +1151,7 @@ async def test_options_flow_include_mode_basic_accessory(
|
|||
user_input={"domains": ["media_player"], "mode": "accessory"},
|
||||
)
|
||||
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "accessory"
|
||||
assert _get_schema_default(result2["data_schema"].schema, "entities") is None
|
||||
|
||||
|
@ -1159,7 +1159,7 @@ async def test_options_flow_include_mode_basic_accessory(
|
|||
result2["flow_id"],
|
||||
user_input={"entities": "media_player.tv"},
|
||||
)
|
||||
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"mode": "accessory",
|
||||
"filter": {
|
||||
|
@ -1177,7 +1177,7 @@ async def test_options_flow_include_mode_basic_accessory(
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
assert result["data_schema"]({}) == {
|
||||
"domains": ["media_player"],
|
||||
|
@ -1190,7 +1190,7 @@ async def test_options_flow_include_mode_basic_accessory(
|
|||
user_input={"domains": ["media_player"], "mode": "accessory"},
|
||||
)
|
||||
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "accessory"
|
||||
assert (
|
||||
_get_schema_default(result2["data_schema"].schema, "entities")
|
||||
|
@ -1201,7 +1201,7 @@ async def test_options_flow_include_mode_basic_accessory(
|
|||
result2["flow_id"],
|
||||
user_input={"entities": "media_player.tv"},
|
||||
)
|
||||
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"mode": "accessory",
|
||||
"filter": {
|
||||
|
@ -1226,7 +1226,7 @@ async def test_converting_bridge_to_accessory_mode(hass, hk_driver, mock_get_sou
|
|||
result["flow_id"],
|
||||
{"include_domains": ["light"]},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "pairing"
|
||||
|
||||
# We need to actually setup the config entry or the data
|
||||
|
@ -1244,7 +1244,7 @@ async def test_converting_bridge_to_accessory_mode(hass, hk_driver, mock_get_sou
|
|||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert result3["title"][:11] == "HASS Bridge"
|
||||
bridge_name = (result3["title"].split(":"))[0]
|
||||
assert result3["data"] == {
|
||||
|
@ -1272,7 +1272,7 @@ async def test_converting_bridge_to_accessory_mode(hass, hk_driver, mock_get_sou
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
schema = result["data_schema"].schema
|
||||
assert _get_schema_default(schema, "mode") == "bridge"
|
||||
|
@ -1283,14 +1283,14 @@ async def test_converting_bridge_to_accessory_mode(hass, hk_driver, mock_get_sou
|
|||
user_input={"domains": ["camera"], "mode": "accessory"},
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "accessory"
|
||||
|
||||
result2 = await hass.config_entries.options.async_configure(
|
||||
result["flow_id"],
|
||||
user_input={"entities": "camera.tv"},
|
||||
)
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "cameras"
|
||||
|
||||
with patch(
|
||||
|
@ -1305,7 +1305,7 @@ async def test_converting_bridge_to_accessory_mode(hass, hk_driver, mock_get_sou
|
|||
)
|
||||
await hass.async_block_till_done()
|
||||
|
||||
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"entity_config": {"camera.tv": {"video_codec": "copy"}},
|
||||
"mode": "accessory",
|
||||
|
@ -1363,7 +1363,7 @@ async def test_options_flow_exclude_mode_skips_category_entities(
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
assert result["data_schema"]({}) == {
|
||||
"domains": [
|
||||
|
@ -1387,7 +1387,7 @@ async def test_options_flow_exclude_mode_skips_category_entities(
|
|||
},
|
||||
)
|
||||
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "exclude"
|
||||
assert _get_schema_default(result2["data_schema"].schema, "entities") == []
|
||||
|
||||
|
@ -1409,7 +1409,7 @@ async def test_options_flow_exclude_mode_skips_category_entities(
|
|||
]
|
||||
},
|
||||
)
|
||||
assert result4["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result4["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"mode": "bridge",
|
||||
"filter": {
|
||||
|
@ -1451,7 +1451,7 @@ async def test_options_flow_exclude_mode_skips_hidden_entities(
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
assert result["data_schema"]({}) == {
|
||||
"domains": [
|
||||
|
@ -1475,7 +1475,7 @@ async def test_options_flow_exclude_mode_skips_hidden_entities(
|
|||
},
|
||||
)
|
||||
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "exclude"
|
||||
assert _get_schema_default(result2["data_schema"].schema, "entities") == []
|
||||
|
||||
|
@ -1491,7 +1491,7 @@ async def test_options_flow_exclude_mode_skips_hidden_entities(
|
|||
result2["flow_id"],
|
||||
user_input={"entities": ["media_player.tv", "switch.other"]},
|
||||
)
|
||||
assert result4["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result4["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"mode": "bridge",
|
||||
"filter": {
|
||||
|
@ -1529,7 +1529,7 @@ async def test_options_flow_include_mode_allows_hidden_entities(
|
|||
config_entry.entry_id, context={"show_advanced_options": False}
|
||||
)
|
||||
|
||||
assert result["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result["step_id"] == "init"
|
||||
assert result["data_schema"]({}) == {
|
||||
"domains": [
|
||||
|
@ -1553,7 +1553,7 @@ async def test_options_flow_include_mode_allows_hidden_entities(
|
|||
},
|
||||
)
|
||||
|
||||
assert result2["type"] == data_entry_flow.RESULT_TYPE_FORM
|
||||
assert result2["type"] == data_entry_flow.FlowResultType.FORM
|
||||
assert result2["step_id"] == "include"
|
||||
assert _get_schema_default(result2["data_schema"].schema, "entities") == []
|
||||
|
||||
|
@ -1569,7 +1569,7 @@ async def test_options_flow_include_mode_allows_hidden_entities(
|
|||
]
|
||||
},
|
||||
)
|
||||
assert result3["type"] == data_entry_flow.RESULT_TYPE_CREATE_ENTRY
|
||||
assert result3["type"] == data_entry_flow.FlowResultType.CREATE_ENTRY
|
||||
assert config_entry.options == {
|
||||
"mode": "bridge",
|
||||
"filter": {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue