Use common Strings for Acmeda Config Flow (#41092)
This commit is contained in:
parent
38d132addd
commit
ed171a885b
3 changed files with 5 additions and 5 deletions
|
@ -45,7 +45,7 @@ class AcmedaFlowHandler(config_entries.ConfigFlow, domain=DOMAIN):
|
||||||
pass
|
pass
|
||||||
|
|
||||||
if len(hubs) == 0:
|
if len(hubs) == 0:
|
||||||
return self.async_abort(reason="all_configured")
|
return self.async_abort(reason="no_devices_found")
|
||||||
|
|
||||||
if len(hubs) == 1:
|
if len(hubs) == 1:
|
||||||
return await self.async_create(hubs[0])
|
return await self.async_create(hubs[0])
|
||||||
|
|
|
@ -10,7 +10,7 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"abort": {
|
"abort": {
|
||||||
"all_configured": "No new Pulse hubs discovered."
|
"no_devices_found": "[%key:common::config_flow::abort::no_devices_found%]"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -47,7 +47,7 @@ async def test_show_form_no_hubs(hass, mock_hub_discover):
|
||||||
)
|
)
|
||||||
|
|
||||||
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
|
assert result["type"] == data_entry_flow.RESULT_TYPE_ABORT
|
||||||
assert result["reason"] == "all_configured"
|
assert result["reason"] == "no_devices_found"
|
||||||
|
|
||||||
# Check we performed the discovery
|
# Check we performed the discovery
|
||||||
assert len(mock_hub_discover.mock_calls) == 1
|
assert len(mock_hub_discover.mock_calls) == 1
|
||||||
|
@ -140,4 +140,4 @@ async def test_already_configured(hass, mock_hub_discover):
|
||||||
)
|
)
|
||||||
|
|
||||||
assert result["type"] == "abort"
|
assert result["type"] == "abort"
|
||||||
assert result["reason"] == "all_configured"
|
assert result["reason"] == "no_devices_found"
|
||||||
|
|
Loading…
Add table
Reference in a new issue