Enforce namespace import in core (#118235)
This commit is contained in:
parent
9828a50dca
commit
97f6b578c8
10 changed files with 47 additions and 55 deletions
|
@ -9,13 +9,10 @@ import voluptuous as vol
|
|||
from homeassistant import data_entry_flow
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers import issue_registry as ir
|
||||
from homeassistant.helpers.integration_platform import (
|
||||
async_process_integration_platforms,
|
||||
)
|
||||
from homeassistant.helpers.issue_registry import (
|
||||
async_delete_issue,
|
||||
async_get as async_get_issue_registry,
|
||||
)
|
||||
|
||||
from .const import DOMAIN
|
||||
from .models import RepairsFlow, RepairsProtocol
|
||||
|
@ -37,7 +34,7 @@ class ConfirmRepairFlow(RepairsFlow):
|
|||
if user_input is not None:
|
||||
return self.async_create_entry(data={})
|
||||
|
||||
issue_registry = async_get_issue_registry(self.hass)
|
||||
issue_registry = ir.async_get(self.hass)
|
||||
description_placeholders = None
|
||||
if issue := issue_registry.async_get_issue(self.handler, self.issue_id):
|
||||
description_placeholders = issue.translation_placeholders
|
||||
|
@ -63,7 +60,7 @@ class RepairsFlowManager(data_entry_flow.FlowManager):
|
|||
assert data and "issue_id" in data
|
||||
issue_id = data["issue_id"]
|
||||
|
||||
issue_registry = async_get_issue_registry(self.hass)
|
||||
issue_registry = ir.async_get(self.hass)
|
||||
issue = issue_registry.async_get_issue(handler_key, issue_id)
|
||||
if issue is None or not issue.is_fixable:
|
||||
raise data_entry_flow.UnknownStep
|
||||
|
@ -87,7 +84,7 @@ class RepairsFlowManager(data_entry_flow.FlowManager):
|
|||
) -> data_entry_flow.FlowResult:
|
||||
"""Complete a fix flow."""
|
||||
if result.get("type") != data_entry_flow.FlowResultType.ABORT:
|
||||
async_delete_issue(self.hass, flow.handler, flow.init_data["issue_id"])
|
||||
ir.async_delete_issue(self.hass, flow.handler, flow.init_data["issue_id"])
|
||||
if "result" not in result:
|
||||
result["result"] = None
|
||||
return result
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue