Switch switchbot to use no_devices_found (#88268)

pull/88281/head
J. Nick Koston 2023-02-16 15:51:27 -06:00 committed by GitHub
parent b2a1df19a0
commit ffa7cac38e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 4 deletions

View File

@ -272,7 +272,7 @@ class SwitchbotConfigFlow(ConfigFlow, domain=DOMAIN):
self._discovered_advs[address] = parsed
if not self._discovered_advs:
raise AbortFlow("no_unconfigured_devices")
raise AbortFlow("no_devices_found")
async def _async_set_device(self, discovery: SwitchBotAdvertisement) -> None:
"""Set the device to work with."""

View File

@ -44,7 +44,7 @@
},
"abort": {
"already_configured_device": "[%key:common::config_flow::abort::already_configured_device%]",
"no_unconfigured_devices": "No unconfigured devices found.",
"no_devices_found": "[%key:common::config_flow::abort::no_devices_found%]",
"unknown": "[%key:common::config_flow::error::unknown%]",
"cannot_connect": "[%key:common::config_flow::error::cannot_connect%]",
"switchbot_unsupported_type": "Unsupported Switchbot Type."

View File

@ -249,7 +249,7 @@ async def test_user_setup_wohand_already_configured(hass: HomeAssistant) -> None
DOMAIN, context={"source": SOURCE_USER}
)
assert result["type"] == FlowResultType.ABORT
assert result["reason"] == "no_unconfigured_devices"
assert result["reason"] == "no_devices_found"
async def test_user_setup_wocurtain(hass: HomeAssistant) -> None:
@ -662,7 +662,7 @@ async def test_user_no_devices(hass: HomeAssistant) -> None:
DOMAIN, context={"source": SOURCE_USER}
)
assert result["type"] == FlowResultType.ABORT
assert result["reason"] == "no_unconfigured_devices"
assert result["reason"] == "no_devices_found"
async def test_async_step_user_takes_precedence_over_discovery(