mirror of
https://github.com/home-assistant/core.git
synced 2025-04-28 19:27:51 +00:00
Fix exception import locations (#63454)
This commit is contained in:
parent
c384596899
commit
40262c4763
@ -40,8 +40,9 @@ from homeassistant.exceptions import (
|
|||||||
ConditionErrorContainer,
|
ConditionErrorContainer,
|
||||||
ConditionErrorIndex,
|
ConditionErrorIndex,
|
||||||
HomeAssistantError,
|
HomeAssistantError,
|
||||||
|
TemplateError,
|
||||||
)
|
)
|
||||||
from homeassistant.helpers import condition, extract_domain_configs, template
|
from homeassistant.helpers import condition, extract_domain_configs
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.entity import ToggleEntity
|
from homeassistant.helpers.entity import ToggleEntity
|
||||||
from homeassistant.helpers.entity_component import EntityComponent
|
from homeassistant.helpers.entity_component import EntityComponent
|
||||||
@ -457,7 +458,7 @@ class AutomationEntity(ToggleEntity, RestoreEntity):
|
|||||||
if self._variables:
|
if self._variables:
|
||||||
try:
|
try:
|
||||||
variables = self._variables.async_render(self.hass, variables)
|
variables = self._variables.async_render(self.hass, variables)
|
||||||
except template.TemplateError as err:
|
except TemplateError as err:
|
||||||
self._logger.error("Error rendering variables: %s", err)
|
self._logger.error("Error rendering variables: %s", err)
|
||||||
automation_trace.set_error(err)
|
automation_trace.set_error(err)
|
||||||
return
|
return
|
||||||
@ -589,7 +590,7 @@ class AutomationEntity(ToggleEntity, RestoreEntity):
|
|||||||
variables,
|
variables,
|
||||||
limited=True,
|
limited=True,
|
||||||
)
|
)
|
||||||
except template.TemplateError as err:
|
except TemplateError as err:
|
||||||
self._logger.error("Error rendering trigger variables: %s", err)
|
self._logger.error("Error rendering trigger variables: %s", err)
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
@ -13,9 +13,10 @@ from azure.eventhub.aio import EventHubProducerClient
|
|||||||
from azure.eventhub.exceptions import EventHubError
|
from azure.eventhub.exceptions import EventHubError
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry, ConfigEntryNotReady
|
from homeassistant.config_entries import SOURCE_IMPORT, ConfigEntry
|
||||||
from homeassistant.const import MATCH_ALL
|
from homeassistant.const import MATCH_ALL
|
||||||
from homeassistant.core import Event, HomeAssistant, State
|
from homeassistant.core import Event, HomeAssistant, State
|
||||||
|
from homeassistant.exceptions import ConfigEntryNotReady
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.entityfilter import FILTER_SCHEMA
|
from homeassistant.helpers.entityfilter import FILTER_SCHEMA
|
||||||
from homeassistant.helpers.event import async_call_later
|
from homeassistant.helpers.event import async_call_later
|
||||||
|
@ -20,16 +20,12 @@ from homeassistant.components.air_quality import DOMAIN as AIR_QUALITY_PLATFORM
|
|||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME, Platform
|
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME, Platform
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
|
from homeassistant.exceptions import ConfigEntryAuthFailed, ConfigEntryNotReady
|
||||||
from homeassistant.helpers import entity_registry
|
from homeassistant.helpers import entity_registry
|
||||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||||
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
|
from homeassistant.helpers.device_registry import CONNECTION_NETWORK_MAC
|
||||||
from homeassistant.helpers.entity import DeviceInfo
|
from homeassistant.helpers.entity import DeviceInfo
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||||
ConfigEntryAuthFailed,
|
|
||||||
ConfigEntryNotReady,
|
|
||||||
DataUpdateCoordinator,
|
|
||||||
UpdateFailed,
|
|
||||||
)
|
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
ATTR_SDS011,
|
ATTR_SDS011,
|
||||||
|
@ -9,7 +9,7 @@ import getmac
|
|||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
from homeassistant.config_entries import ConfigEntry, ConfigEntryNotReady
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_HOST,
|
CONF_HOST,
|
||||||
CONF_MAC,
|
CONF_MAC,
|
||||||
@ -21,6 +21,7 @@ from homeassistant.const import (
|
|||||||
Platform,
|
Platform,
|
||||||
)
|
)
|
||||||
from homeassistant.core import Event, HomeAssistant, callback
|
from homeassistant.core import Event, HomeAssistant, callback
|
||||||
|
from homeassistant.exceptions import ConfigEntryNotReady
|
||||||
import homeassistant.helpers.config_validation as cv
|
import homeassistant.helpers.config_validation as cv
|
||||||
from homeassistant.helpers.typing import ConfigType
|
from homeassistant.helpers.typing import ConfigType
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ from kasa.discover import Discover
|
|||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
from homeassistant.components import network
|
from homeassistant.components import network
|
||||||
from homeassistant.config_entries import ConfigEntry, ConfigEntryNotReady
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
CONF_HOST,
|
CONF_HOST,
|
||||||
CONF_MAC,
|
CONF_MAC,
|
||||||
@ -18,6 +18,7 @@ from homeassistant.const import (
|
|||||||
EVENT_HOMEASSISTANT_STARTED,
|
EVENT_HOMEASSISTANT_STARTED,
|
||||||
)
|
)
|
||||||
from homeassistant.core import HomeAssistant, callback
|
from homeassistant.core import HomeAssistant, callback
|
||||||
|
from homeassistant.exceptions import ConfigEntryNotReady
|
||||||
from homeassistant.helpers import device_registry as dr
|
from homeassistant.helpers import device_registry as dr
|
||||||
from homeassistant.helpers.event import async_track_time_interval
|
from homeassistant.helpers.event import async_track_time_interval
|
||||||
from homeassistant.helpers.typing import ConfigType
|
from homeassistant.helpers.typing import ConfigType
|
||||||
|
@ -9,11 +9,8 @@ from yalesmartalarmclient.client import AuthenticationError, YaleSmartAlarmClien
|
|||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME
|
||||||
from homeassistant.core import HomeAssistant
|
from homeassistant.core import HomeAssistant
|
||||||
from homeassistant.helpers.update_coordinator import (
|
from homeassistant.exceptions import ConfigEntryAuthFailed
|
||||||
ConfigEntryAuthFailed,
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator, UpdateFailed
|
||||||
DataUpdateCoordinator,
|
|
||||||
UpdateFailed,
|
|
||||||
)
|
|
||||||
|
|
||||||
from .const import DEFAULT_SCAN_INTERVAL, DOMAIN, LOGGER
|
from .const import DEFAULT_SCAN_INTERVAL, DOMAIN, LOGGER
|
||||||
|
|
||||||
|
@ -1216,7 +1216,7 @@ class Script:
|
|||||||
self._hass,
|
self._hass,
|
||||||
run_variables,
|
run_variables,
|
||||||
)
|
)
|
||||||
except template.TemplateError as err:
|
except exceptions.TemplateError as err:
|
||||||
self._log("Error rendering variables: %s", err, level=logging.ERROR)
|
self._log("Error rendering variables: %s", err, level=logging.ERROR)
|
||||||
raise
|
raise
|
||||||
elif run_variables:
|
elif run_variables:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user