Move lovelace function and exception out of const.py

This commit is contained in:
epenet 2025-01-23 07:00:08 +00:00
parent 8dba4affa9
commit 59e36e0294
4 changed files with 10 additions and 7 deletions

View File

@ -25,7 +25,8 @@ from homeassistant.core import HomeAssistant, callback
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers.network import NoURLAvailableError, get_url
from .const import DOMAIN, LOVELACE_DATA, ConfigNotFound
from .const import DOMAIN, LOVELACE_DATA
from .util import ConfigNotFound
DEFAULT_DASHBOARD = "_default_"

View File

@ -13,7 +13,6 @@ from homeassistant.const import (
CONF_URL,
EVENT_LOVELACE_UPDATED, # noqa: F401
)
from homeassistant.exceptions import HomeAssistantError
from homeassistant.helpers import config_validation as cv
from homeassistant.helpers.typing import VolDictType
from homeassistant.util.hass_dict import HassKey
@ -88,7 +87,3 @@ STORAGE_DASHBOARD_CREATE_FIELDS: VolDictType = {
}
STORAGE_DASHBOARD_UPDATE_FIELDS = DASHBOARD_BASE_UPDATE_FIELDS
class ConfigNotFound(HomeAssistantError):
"""When no config available."""

View File

@ -32,8 +32,8 @@ from .const import (
MODE_YAML,
STORAGE_DASHBOARD_CREATE_FIELDS,
STORAGE_DASHBOARD_UPDATE_FIELDS,
ConfigNotFound,
)
from .util import ConfigNotFound
CONFIG_STORAGE_KEY_DEFAULT = DOMAIN
CONFIG_STORAGE_KEY = "lovelace.{}"

View File

@ -0,0 +1,7 @@
"""Utils for Lovelace."""
from homeassistant.exceptions import HomeAssistantError
class ConfigNotFound(HomeAssistantError):
"""When no config available."""