Use common Strings for Acmeda Config Flow (#41092)

This commit is contained in:
Spartan-II-117 2020-10-03 12:29:30 -07:00 committed by GitHub
parent 38d132addd
commit ed171a885b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 5 deletions

View file

@ -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])

View file

@ -10,7 +10,7 @@
} }
}, },
"abort": { "abort": {
"all_configured": "No new Pulse hubs discovered." "no_devices_found": "[%key:common::config_flow::abort::no_devices_found%]"
} }
} }
} }

View file

@ -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"