Enforce namespace import in core (#118235)

This commit is contained in:
epenet 2024-05-27 14:03:00 +02:00 committed by GitHub
parent 9828a50dca
commit 97f6b578c8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 47 additions and 55 deletions

View file

@ -15,14 +15,11 @@ from homeassistant.components.http.data_validator import RequestDataValidator
from homeassistant.components.http.decorators import require_admin
from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import Unauthorized
from homeassistant.helpers import issue_registry as ir
from homeassistant.helpers.data_entry_flow import (
FlowManagerIndexView,
FlowManagerResourceView,
)
from homeassistant.helpers.issue_registry import (
async_get as async_get_issue_registry,
async_ignore_issue,
)
from .const import DOMAIN
@ -50,7 +47,7 @@ def ws_get_issue_data(
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]
) -> None:
"""Fix an issue."""
issue_registry = async_get_issue_registry(hass)
issue_registry = ir.async_get(hass)
if not (issue := issue_registry.async_get_issue(msg["domain"], msg["issue_id"])):
connection.send_error(
msg["id"],
@ -74,7 +71,7 @@ def ws_ignore_issue(
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]
) -> None:
"""Fix an issue."""
async_ignore_issue(hass, msg["domain"], msg["issue_id"], msg["ignore"])
ir.async_ignore_issue(hass, msg["domain"], msg["issue_id"], msg["ignore"])
connection.send_result(msg["id"])
@ -89,7 +86,7 @@ def ws_list_issues(
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]
) -> None:
"""Return a list of issues."""
issue_registry = async_get_issue_registry(hass)
issue_registry = ir.async_get(hass)
issues = [
{
"breaks_in_ha_version": issue.breaks_in_ha_version,