Adjust homekit controller pairing errors back to a single step

This commit is contained in:
J. Nick Koston
2020-08-10 23:57:22 +00:00
parent 844b3f8d23
commit e5ed89bbbb
3 changed files with 8 additions and 23 deletions

View File

@@ -307,15 +307,8 @@ class HomekitControllerFlowHandler(config_entries.ConfigFlow):
self.finish_pairing = None self.finish_pairing = None
errors["pairing_code"] = "pairing_failed" errors["pairing_code"] = "pairing_failed"
if errors and "base" in errors:
return self.async_show_form(step_id="try_pair_later", errors=errors)
return self._async_step_pair_show_form(errors) return self._async_step_pair_show_form(errors)
async def async_step_try_pair_later(self, pair_info=None):
"""Retry pairing after the accessory is busy or unavailable."""
return await self.async_step_pair(pair_info)
@callback @callback
def _async_step_pair_show_form(self, errors=None): def _async_step_pair_show_form(self, errors=None):
return self.async_show_form( return self.async_show_form(

View File

@@ -16,20 +16,16 @@
"data": { "data": {
"pairing_code": "Pairing Code" "pairing_code": "Pairing Code"
} }
}, }
"try_pair_later": {
"title": "Pairing Unavailable",
"description": "Ensure the device is in pairing mode or try restarting the device, then continue to re-start pairing."
}
}, },
"error": { "error": {
"unable_to_pair": "Unable to pair, please try again.", "unable_to_pair": "Unable to pair, please try again.",
"unknown_error": "Device reported an unknown error. Pairing failed.", "unknown_error": "Device reported an unknown error. Pairing failed.",
"protocol_error": "Error communicating with the accessory. Device may not be in pairing mode and may require a physical or virtual button press.", "protocol_error": "Error communicating with the accessory. The device may not be in pairing mode and may require a physical or virtual button press. Ensure the device is in pairing mode or try restarting the device, then continue to resume pairing.",
"authentication_error": "Incorrect HomeKit code. Please check it and try again.", "authentication_error": "Incorrect HomeKit code. Please check it and try again.",
"max_peers_error": "Device refused to add pairing as it has no free pairing storage.", "max_peers_error": "Device refused to add pairing as it has no free pairing storage.",
"busy_error": "Device refused to add pairing as it is already pairing with another controller.", "busy_error": "The device refused to add pairing as it is already pairing with another controller. Abort pairing on all controllers, or try restarting the device, then continue to resume pairing.",
"max_tries_error": "Device refused to add pairing as it has received more than 100 unsuccessful authentication attempts.", "max_tries_error": "The device refused to add pairing as it has received more than 100 unsuccessful authentication attempts. Try restarting the device, then continue to resume pairing.",
"pairing_failed": "An unhandled error occurred while attempting to pair with this device. This may be a temporary failure or your device may not be supported currently." "pairing_failed": "An unhandled error occurred while attempting to pair with this device. This may be a temporary failure or your device may not be supported currently."
}, },
"abort": { "abort": {

View File

@@ -16,20 +16,16 @@
"data": { "data": {
"pairing_code": "Pairing Code" "pairing_code": "Pairing Code"
} }
}, }
"try_pair_later": {
"title": "Pairing Unavailable",
"description": "Ensure the device is in pairing mode or try restarting the device, then continue to re-start pairing."
}
}, },
"error": { "error": {
"unable_to_pair": "Unable to pair, please try again.", "unable_to_pair": "Unable to pair, please try again.",
"unknown_error": "Device reported an unknown error. Pairing failed.", "unknown_error": "Device reported an unknown error. Pairing failed.",
"protocol_error": "Error communicating with the accessory. Device may not be in pairing mode and may require a physical or virtual button press.", "protocol_error": "Error communicating with the accessory. The device may not be in pairing mode and may require a physical or virtual button press. Ensure the device is in pairing mode or try restarting the device, then continue to resume pairing.",
"authentication_error": "Incorrect HomeKit code. Please check it and try again.", "authentication_error": "Incorrect HomeKit code. Please check it and try again.",
"max_peers_error": "Device refused to add pairing as it has no free pairing storage.", "max_peers_error": "Device refused to add pairing as it has no free pairing storage.",
"busy_error": "Device refused to add pairing as it is already pairing with another controller.", "busy_error": "The device refused to add pairing as it is already pairing with another controller. Abort pairing on all controllers, or try restarting the device, then continue to resume pairing.",
"max_tries_error": "Device refused to add pairing as it has received more than 100 unsuccessful authentication attempts.", "max_tries_error": "The device refused to add pairing as it has received more than 100 unsuccessful authentication attempts. Try restarting the device, then continue to resume pairing.",
"pairing_failed": "An unhandled error occurred while attempting to pair with this device. This may be a temporary failure or your device may not be supported currently." "pairing_failed": "An unhandled error occurred while attempting to pair with this device. This may be a temporary failure or your device may not be supported currently."
}, },
"abort": { "abort": {