Fix menu in hassio repair flow (#102162)

This commit is contained in:
Erik Montnemery 2023-10-17 16:43:10 +02:00 committed by GitHub
parent fc09d87c3c
commit 928086a9e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -86,15 +86,21 @@ class SupervisorIssueRepairFlow(RepairsFlow):
)
if len(self.issue.suggestions) > 1:
return await self.async_step_fix_menu()
# Always show a form for one suggestion to explain to user what's happening
return self._async_form_for_suggestion(self.issue.suggestions[0])
async def async_step_fix_menu(self, _: None = None) -> FlowResult:
"""Show the fix menu."""
assert self.issue
return self.async_show_menu(
step_id="fix_menu",
menu_options=[suggestion.key for suggestion in self.issue.suggestions],
description_placeholders=self.description_placeholders,
)
# Always show a form for one suggestion to explain to user what's happening
return self._async_form_for_suggestion(self.issue.suggestions[0])
async def _async_step_apply_suggestion(
self, suggestion: Suggestion, confirmed: bool = False
) -> FlowResult: