Enforce namespace import in core (#118235)
This commit is contained in:
parent
9828a50dca
commit
97f6b578c8
10 changed files with 47 additions and 55 deletions
|
@ -8,7 +8,7 @@ import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.components import websocket_api
|
from homeassistant.components import websocket_api
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.area_registry import async_get
|
from homeassistant.helpers import area_registry as ar
|
||||||
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
|
@ -29,7 +29,7 @@ def websocket_list_areas(
|
||||||
msg: dict[str, Any],
|
msg: dict[str, Any],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Handle list areas command."""
|
"""Handle list areas command."""
|
||||||
registry = async_get(hass)
|
registry = ar.async_get(hass)
|
||||||
connection.send_result(
|
connection.send_result(
|
||||||
msg["id"],
|
msg["id"],
|
||||||
[entry.json_fragment for entry in registry.async_list_areas()],
|
[entry.json_fragment for entry in registry.async_list_areas()],
|
||||||
|
@ -55,7 +55,7 @@ def websocket_create_area(
|
||||||
msg: dict[str, Any],
|
msg: dict[str, Any],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Create area command."""
|
"""Create area command."""
|
||||||
registry = async_get(hass)
|
registry = ar.async_get(hass)
|
||||||
|
|
||||||
data = dict(msg)
|
data = dict(msg)
|
||||||
data.pop("type")
|
data.pop("type")
|
||||||
|
@ -91,7 +91,7 @@ def websocket_delete_area(
|
||||||
msg: dict[str, Any],
|
msg: dict[str, Any],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Delete area command."""
|
"""Delete area command."""
|
||||||
registry = async_get(hass)
|
registry = ar.async_get(hass)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
registry.async_delete(msg["area_id"])
|
registry.async_delete(msg["area_id"])
|
||||||
|
@ -121,7 +121,7 @@ def websocket_update_area(
|
||||||
msg: dict[str, Any],
|
msg: dict[str, Any],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Handle update area websocket command."""
|
"""Handle update area websocket command."""
|
||||||
registry = async_get(hass)
|
registry = ar.async_get(hass)
|
||||||
|
|
||||||
data = dict(msg)
|
data = dict(msg)
|
||||||
data.pop("type")
|
data.pop("type")
|
||||||
|
|
|
@ -11,11 +11,8 @@ from homeassistant.components import websocket_api
|
||||||
from homeassistant.components.websocket_api.decorators import require_admin
|
from homeassistant.components.websocket_api.decorators import require_admin
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
from homeassistant.helpers.device_registry import (
|
from homeassistant.helpers import device_registry as dr
|
||||||
DeviceEntry,
|
from homeassistant.helpers.device_registry import DeviceEntry, DeviceEntryDisabler
|
||||||
DeviceEntryDisabler,
|
|
||||||
async_get,
|
|
||||||
)
|
|
||||||
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
|
@ -42,7 +39,7 @@ def websocket_list_devices(
|
||||||
msg: dict[str, Any],
|
msg: dict[str, Any],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Handle list devices command."""
|
"""Handle list devices command."""
|
||||||
registry = async_get(hass)
|
registry = dr.async_get(hass)
|
||||||
# Build start of response message
|
# Build start of response message
|
||||||
msg_json_prefix = (
|
msg_json_prefix = (
|
||||||
f'{{"id":{msg["id"]},"type": "{websocket_api.const.TYPE_RESULT}",'
|
f'{{"id":{msg["id"]},"type": "{websocket_api.const.TYPE_RESULT}",'
|
||||||
|
@ -80,7 +77,7 @@ def websocket_update_device(
|
||||||
msg: dict[str, Any],
|
msg: dict[str, Any],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Handle update device websocket command."""
|
"""Handle update device websocket command."""
|
||||||
registry = async_get(hass)
|
registry = dr.async_get(hass)
|
||||||
|
|
||||||
msg.pop("type")
|
msg.pop("type")
|
||||||
msg_id = msg.pop("id")
|
msg_id = msg.pop("id")
|
||||||
|
@ -112,7 +109,7 @@ async def websocket_remove_config_entry_from_device(
|
||||||
msg: dict[str, Any],
|
msg: dict[str, Any],
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Remove config entry from a device."""
|
"""Remove config entry from a device."""
|
||||||
registry = async_get(hass)
|
registry = dr.async_get(hass)
|
||||||
config_entry_id = msg["config_entry_id"]
|
config_entry_id = msg["config_entry_id"]
|
||||||
device_id = msg["device_id"]
|
device_id = msg["device_id"]
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,8 @@ import voluptuous as vol
|
||||||
from homeassistant.components import websocket_api
|
from homeassistant.components import websocket_api
|
||||||
from homeassistant.components.websocket_api.connection import ActiveConnection
|
from homeassistant.components.websocket_api.connection import ActiveConnection
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers.floor_registry import FloorEntry, async_get
|
from homeassistant.helpers import floor_registry as fr
|
||||||
|
from homeassistant.helpers.floor_registry import FloorEntry
|
||||||
|
|
||||||
|
|
||||||
@callback
|
@callback
|
||||||
|
@ -30,7 +31,7 @@ def websocket_list_floors(
|
||||||
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Handle list floors command."""
|
"""Handle list floors command."""
|
||||||
registry = async_get(hass)
|
registry = fr.async_get(hass)
|
||||||
connection.send_result(
|
connection.send_result(
|
||||||
msg["id"],
|
msg["id"],
|
||||||
[_entry_dict(entry) for entry in registry.async_list_floors()],
|
[_entry_dict(entry) for entry in registry.async_list_floors()],
|
||||||
|
@ -52,7 +53,7 @@ def websocket_create_floor(
|
||||||
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Create floor command."""
|
"""Create floor command."""
|
||||||
registry = async_get(hass)
|
registry = fr.async_get(hass)
|
||||||
|
|
||||||
data = dict(msg)
|
data = dict(msg)
|
||||||
data.pop("type")
|
data.pop("type")
|
||||||
|
@ -82,7 +83,7 @@ def websocket_delete_floor(
|
||||||
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Delete floor command."""
|
"""Delete floor command."""
|
||||||
registry = async_get(hass)
|
registry = fr.async_get(hass)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
registry.async_delete(msg["floor_id"])
|
registry.async_delete(msg["floor_id"])
|
||||||
|
@ -108,7 +109,7 @@ def websocket_update_floor(
|
||||||
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Handle update floor websocket command."""
|
"""Handle update floor websocket command."""
|
||||||
registry = async_get(hass)
|
registry = fr.async_get(hass)
|
||||||
|
|
||||||
data = dict(msg)
|
data = dict(msg)
|
||||||
data.pop("type")
|
data.pop("type")
|
||||||
|
|
|
@ -7,8 +7,8 @@ import voluptuous as vol
|
||||||
from homeassistant.components import websocket_api
|
from homeassistant.components import websocket_api
|
||||||
from homeassistant.components.websocket_api.connection import ActiveConnection
|
from homeassistant.components.websocket_api.connection import ActiveConnection
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers import config_validation as cv
|
from homeassistant.helpers import config_validation as cv, label_registry as lr
|
||||||
from homeassistant.helpers.label_registry import LabelEntry, async_get
|
from homeassistant.helpers.label_registry import LabelEntry
|
||||||
|
|
||||||
SUPPORTED_LABEL_THEME_COLORS = {
|
SUPPORTED_LABEL_THEME_COLORS = {
|
||||||
"primary",
|
"primary",
|
||||||
|
@ -60,7 +60,7 @@ def websocket_list_labels(
|
||||||
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Handle list labels command."""
|
"""Handle list labels command."""
|
||||||
registry = async_get(hass)
|
registry = lr.async_get(hass)
|
||||||
connection.send_result(
|
connection.send_result(
|
||||||
msg["id"],
|
msg["id"],
|
||||||
[_entry_dict(entry) for entry in registry.async_list_labels()],
|
[_entry_dict(entry) for entry in registry.async_list_labels()],
|
||||||
|
@ -84,7 +84,7 @@ def websocket_create_label(
|
||||||
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Create label command."""
|
"""Create label command."""
|
||||||
registry = async_get(hass)
|
registry = lr.async_get(hass)
|
||||||
|
|
||||||
data = dict(msg)
|
data = dict(msg)
|
||||||
data.pop("type")
|
data.pop("type")
|
||||||
|
@ -110,7 +110,7 @@ def websocket_delete_label(
|
||||||
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Delete label command."""
|
"""Delete label command."""
|
||||||
registry = async_get(hass)
|
registry = lr.async_get(hass)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
registry.async_delete(msg["label_id"])
|
registry.async_delete(msg["label_id"])
|
||||||
|
@ -138,7 +138,7 @@ def websocket_update_label(
|
||||||
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
hass: HomeAssistant, connection: ActiveConnection, msg: dict[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Handle update label websocket command."""
|
"""Handle update label websocket command."""
|
||||||
registry = async_get(hass)
|
registry = lr.async_get(hass)
|
||||||
|
|
||||||
data = dict(msg)
|
data = dict(msg)
|
||||||
data.pop("type")
|
data.pop("type")
|
||||||
|
|
|
@ -45,13 +45,12 @@ from homeassistant.core import (
|
||||||
callback,
|
callback,
|
||||||
)
|
)
|
||||||
from homeassistant.data_entry_flow import BaseServiceInfo
|
from homeassistant.data_entry_flow import BaseServiceInfo
|
||||||
from homeassistant.helpers import config_validation as cv, discovery_flow
|
from homeassistant.helpers import (
|
||||||
from homeassistant.helpers.device_registry import (
|
config_validation as cv,
|
||||||
CONNECTION_NETWORK_MAC,
|
device_registry as dr,
|
||||||
DeviceRegistry,
|
discovery_flow,
|
||||||
async_get,
|
|
||||||
format_mac,
|
|
||||||
)
|
)
|
||||||
|
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC, format_mac
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
from homeassistant.helpers.event import (
|
from homeassistant.helpers.event import (
|
||||||
async_track_state_added_domain,
|
async_track_state_added_domain,
|
||||||
|
@ -243,7 +242,7 @@ class WatcherBase:
|
||||||
matchers = self._integration_matchers
|
matchers = self._integration_matchers
|
||||||
registered_devices_domains = matchers.registered_devices_domains
|
registered_devices_domains = matchers.registered_devices_domains
|
||||||
|
|
||||||
dev_reg: DeviceRegistry = async_get(self.hass)
|
dev_reg = dr.async_get(self.hass)
|
||||||
if device := dev_reg.async_get_device(
|
if device := dev_reg.async_get_device(
|
||||||
connections={(CONNECTION_NETWORK_MAC, formatted_mac)}
|
connections={(CONNECTION_NETWORK_MAC, formatted_mac)}
|
||||||
):
|
):
|
||||||
|
|
|
@ -15,8 +15,12 @@ import voluptuous as vol
|
||||||
from homeassistant.components import http, websocket_api
|
from homeassistant.components import http, websocket_api
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.helpers import config_validation as cv, integration_platform
|
from homeassistant.helpers import (
|
||||||
from homeassistant.helpers.device_registry import DeviceEntry, async_get
|
config_validation as cv,
|
||||||
|
device_registry as dr,
|
||||||
|
integration_platform,
|
||||||
|
)
|
||||||
|
from homeassistant.helpers.device_registry import DeviceEntry
|
||||||
from homeassistant.helpers.json import (
|
from homeassistant.helpers.json import (
|
||||||
ExtendedJSONEncoder,
|
ExtendedJSONEncoder,
|
||||||
find_paths_unserializable_data,
|
find_paths_unserializable_data,
|
||||||
|
@ -280,7 +284,7 @@ class DownloadDiagnosticsView(http.HomeAssistantView):
|
||||||
)
|
)
|
||||||
|
|
||||||
# Device diagnostics
|
# Device diagnostics
|
||||||
dev_reg = async_get(hass)
|
dev_reg = dr.async_get(hass)
|
||||||
if sub_id is None:
|
if sub_id is None:
|
||||||
return web.Response(status=HTTPStatus.BAD_REQUEST)
|
return web.Response(status=HTTPStatus.BAD_REQUEST)
|
||||||
|
|
||||||
|
|
|
@ -24,15 +24,12 @@ from homeassistant.helpers import (
|
||||||
config_validation as cv,
|
config_validation as cv,
|
||||||
entity_registry as er,
|
entity_registry as er,
|
||||||
event as ev,
|
event as ev,
|
||||||
|
issue_registry as ir,
|
||||||
template,
|
template,
|
||||||
)
|
)
|
||||||
from homeassistant.helpers.device_registry import DeviceEntry
|
from homeassistant.helpers.device_registry import DeviceEntry
|
||||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||||
from homeassistant.helpers.entity_platform import async_get_platforms
|
from homeassistant.helpers.entity_platform import async_get_platforms
|
||||||
from homeassistant.helpers.issue_registry import (
|
|
||||||
async_delete_issue,
|
|
||||||
async_get as async_get_issue_registry,
|
|
||||||
)
|
|
||||||
from homeassistant.helpers.reload import async_integration_yaml_config
|
from homeassistant.helpers.reload import async_integration_yaml_config
|
||||||
from homeassistant.helpers.service import async_register_admin_service
|
from homeassistant.helpers.service import async_register_admin_service
|
||||||
from homeassistant.helpers.typing import ConfigType
|
from homeassistant.helpers.typing import ConfigType
|
||||||
|
@ -186,14 +183,14 @@ async def _async_config_entry_updated(hass: HomeAssistant, entry: ConfigEntry) -
|
||||||
@callback
|
@callback
|
||||||
def _async_remove_mqtt_issues(hass: HomeAssistant, mqtt_data: MqttData) -> None:
|
def _async_remove_mqtt_issues(hass: HomeAssistant, mqtt_data: MqttData) -> None:
|
||||||
"""Unregister open config issues."""
|
"""Unregister open config issues."""
|
||||||
issue_registry = async_get_issue_registry(hass)
|
issue_registry = ir.async_get(hass)
|
||||||
open_issues = [
|
open_issues = [
|
||||||
issue_id
|
issue_id
|
||||||
for (domain, issue_id), issue_entry in issue_registry.issues.items()
|
for (domain, issue_id), issue_entry in issue_registry.issues.items()
|
||||||
if domain == DOMAIN and issue_entry.translation_key == "invalid_platform_config"
|
if domain == DOMAIN and issue_entry.translation_key == "invalid_platform_config"
|
||||||
]
|
]
|
||||||
for issue in open_issues:
|
for issue in open_issues:
|
||||||
async_delete_issue(hass, DOMAIN, issue)
|
ir.async_delete_issue(hass, DOMAIN, issue)
|
||||||
|
|
||||||
|
|
||||||
async def async_check_config_schema(
|
async def async_check_config_schema(
|
||||||
|
|
|
@ -9,13 +9,10 @@ import voluptuous as vol
|
||||||
from homeassistant import data_entry_flow
|
from homeassistant import data_entry_flow
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
|
from homeassistant.helpers import issue_registry as ir
|
||||||
from homeassistant.helpers.integration_platform import (
|
from homeassistant.helpers.integration_platform import (
|
||||||
async_process_integration_platforms,
|
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 .const import DOMAIN
|
||||||
from .models import RepairsFlow, RepairsProtocol
|
from .models import RepairsFlow, RepairsProtocol
|
||||||
|
@ -37,7 +34,7 @@ class ConfirmRepairFlow(RepairsFlow):
|
||||||
if user_input is not None:
|
if user_input is not None:
|
||||||
return self.async_create_entry(data={})
|
return self.async_create_entry(data={})
|
||||||
|
|
||||||
issue_registry = async_get_issue_registry(self.hass)
|
issue_registry = ir.async_get(self.hass)
|
||||||
description_placeholders = None
|
description_placeholders = None
|
||||||
if issue := issue_registry.async_get_issue(self.handler, self.issue_id):
|
if issue := issue_registry.async_get_issue(self.handler, self.issue_id):
|
||||||
description_placeholders = issue.translation_placeholders
|
description_placeholders = issue.translation_placeholders
|
||||||
|
@ -63,7 +60,7 @@ class RepairsFlowManager(data_entry_flow.FlowManager):
|
||||||
assert data and "issue_id" in data
|
assert data and "issue_id" in data
|
||||||
issue_id = data["issue_id"]
|
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)
|
issue = issue_registry.async_get_issue(handler_key, issue_id)
|
||||||
if issue is None or not issue.is_fixable:
|
if issue is None or not issue.is_fixable:
|
||||||
raise data_entry_flow.UnknownStep
|
raise data_entry_flow.UnknownStep
|
||||||
|
@ -87,7 +84,7 @@ class RepairsFlowManager(data_entry_flow.FlowManager):
|
||||||
) -> data_entry_flow.FlowResult:
|
) -> data_entry_flow.FlowResult:
|
||||||
"""Complete a fix flow."""
|
"""Complete a fix flow."""
|
||||||
if result.get("type") != data_entry_flow.FlowResultType.ABORT:
|
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:
|
if "result" not in result:
|
||||||
result["result"] = None
|
result["result"] = None
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -15,14 +15,11 @@ from homeassistant.components.http.data_validator import RequestDataValidator
|
||||||
from homeassistant.components.http.decorators import require_admin
|
from homeassistant.components.http.decorators import require_admin
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
from homeassistant.exceptions import Unauthorized
|
from homeassistant.exceptions import Unauthorized
|
||||||
|
from homeassistant.helpers import issue_registry as ir
|
||||||
from homeassistant.helpers.data_entry_flow import (
|
from homeassistant.helpers.data_entry_flow import (
|
||||||
FlowManagerIndexView,
|
FlowManagerIndexView,
|
||||||
FlowManagerResourceView,
|
FlowManagerResourceView,
|
||||||
)
|
)
|
||||||
from homeassistant.helpers.issue_registry import (
|
|
||||||
async_get as async_get_issue_registry,
|
|
||||||
async_ignore_issue,
|
|
||||||
)
|
|
||||||
|
|
||||||
from .const import DOMAIN
|
from .const import DOMAIN
|
||||||
|
|
||||||
|
@ -50,7 +47,7 @@ def ws_get_issue_data(
|
||||||
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]
|
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Fix an issue."""
|
"""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"])):
|
if not (issue := issue_registry.async_get_issue(msg["domain"], msg["issue_id"])):
|
||||||
connection.send_error(
|
connection.send_error(
|
||||||
msg["id"],
|
msg["id"],
|
||||||
|
@ -74,7 +71,7 @@ def ws_ignore_issue(
|
||||||
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]
|
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Fix an issue."""
|
"""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"])
|
connection.send_result(msg["id"])
|
||||||
|
|
||||||
|
@ -89,7 +86,7 @@ def ws_list_issues(
|
||||||
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]
|
hass: HomeAssistant, connection: websocket_api.ActiveConnection, msg: dict[str, Any]
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Return a list of issues."""
|
"""Return a list of issues."""
|
||||||
issue_registry = async_get_issue_registry(hass)
|
issue_registry = ir.async_get(hass)
|
||||||
issues = [
|
issues = [
|
||||||
{
|
{
|
||||||
"breaks_in_ha_version": issue.breaks_in_ha_version,
|
"breaks_in_ha_version": issue.breaks_in_ha_version,
|
||||||
|
|
|
@ -1290,7 +1290,7 @@ async def test_reload_after_invalid_config(
|
||||||
) -> None:
|
) -> None:
|
||||||
"""Test reloading yaml config fails."""
|
"""Test reloading yaml config fails."""
|
||||||
with patch(
|
with patch(
|
||||||
"homeassistant.components.mqtt.async_delete_issue"
|
"homeassistant.components.mqtt.ir.async_delete_issue"
|
||||||
) as mock_async_remove_issue:
|
) as mock_async_remove_issue:
|
||||||
assert await mqtt_mock_entry()
|
assert await mqtt_mock_entry()
|
||||||
assert hass.states.get("alarm_control_panel.test") is None
|
assert hass.states.get("alarm_control_panel.test") is None
|
||||||
|
|
Loading…
Add table
Reference in a new issue