Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abort config flow on failed auto configuration #36

Merged
merged 1 commit into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions custom_components/midea_ac/config_flow.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ async def async_step_discover(
return await self._create_entry_from_device(device)
else:
# Indicate a connection could not be made
errors["base"] = "cannot_connect"
return self.async_abort(reason="cannot_connect")

data_schema = vol.Schema({
vol.Optional(CONF_HOST, default=""): str
Expand Down Expand Up @@ -97,7 +97,7 @@ async def async_step_pick_device(
return await self._create_entry_from_device(device)
else:
# Indicate a connection could not be made
errors["base"] = "cannot_connect"
return self.async_abort(reason="cannot_connect")

# Create a set of already configured devices by ID
configured_devices = {
Expand Down
1 change: 1 addition & 0 deletions custom_components/midea_ac/strings.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
},
"abort": {
"already_configured": "The device has already been configured.",
"cannot_connect": "A connection could not be made.",
"no_devices_found": "No supported devices found on the network."
},
"error": {
Expand Down
1 change: 1 addition & 0 deletions custom_components/midea_ac/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
},
"abort": {
"already_configured": "The device has already been configured.",
"cannot_connect": "A connection could not be made.",
"no_devices_found": "No supported devices found on the network."
},
"error": {
Expand Down