mirror of
https://github.com/home-assistant/core
synced 2024-08-02 23:40:32 +02:00
Fix 3rd party imports (#63455)
This commit is contained in:
parent
6873b02858
commit
945b67c5c5
@ -3,6 +3,8 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
|
||||||
|
from goalzero import Yeti
|
||||||
|
|
||||||
from homeassistant.components.binary_sensor import (
|
from homeassistant.components.binary_sensor import (
|
||||||
BinarySensorDeviceClass,
|
BinarySensorDeviceClass,
|
||||||
BinarySensorEntity,
|
BinarySensorEntity,
|
||||||
@ -15,7 +17,7 @@ from homeassistant.helpers.entity import EntityCategory
|
|||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||||
|
|
||||||
from . import Yeti, YetiEntity
|
from . import YetiEntity
|
||||||
from .const import DATA_KEY_API, DATA_KEY_COORDINATOR, DOMAIN
|
from .const import DATA_KEY_API, DATA_KEY_COORDINATOR, DOMAIN
|
||||||
|
|
||||||
PARALLEL_UPDATES = 0
|
PARALLEL_UPDATES = 0
|
||||||
|
@ -3,6 +3,8 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from typing import cast
|
from typing import cast
|
||||||
|
|
||||||
|
from goalzero import Yeti
|
||||||
|
|
||||||
from homeassistant.components.sensor import (
|
from homeassistant.components.sensor import (
|
||||||
SensorDeviceClass,
|
SensorDeviceClass,
|
||||||
SensorEntity,
|
SensorEntity,
|
||||||
@ -28,7 +30,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
|||||||
from homeassistant.helpers.typing import StateType
|
from homeassistant.helpers.typing import StateType
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||||
|
|
||||||
from . import Yeti, YetiEntity
|
from . import YetiEntity
|
||||||
from .const import DATA_KEY_API, DATA_KEY_COORDINATOR, DOMAIN
|
from .const import DATA_KEY_API, DATA_KEY_COORDINATOR, DOMAIN
|
||||||
|
|
||||||
SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||||
|
@ -3,6 +3,8 @@ from __future__ import annotations
|
|||||||
|
|
||||||
from typing import Any, cast
|
from typing import Any, cast
|
||||||
|
|
||||||
|
from goalzero import Yeti
|
||||||
|
|
||||||
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
|
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
|
||||||
from homeassistant.config_entries import ConfigEntry
|
from homeassistant.config_entries import ConfigEntry
|
||||||
from homeassistant.const import CONF_NAME
|
from homeassistant.const import CONF_NAME
|
||||||
@ -10,7 +12,7 @@ from homeassistant.core import HomeAssistant
|
|||||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||||
|
|
||||||
from . import Yeti, YetiEntity
|
from . import YetiEntity
|
||||||
from .const import DATA_KEY_API, DATA_KEY_COORDINATOR, DOMAIN
|
from .const import DATA_KEY_API, DATA_KEY_COORDINATOR, DOMAIN
|
||||||
|
|
||||||
SWITCH_TYPES: tuple[SwitchEntityDescription, ...] = (
|
SWITCH_TYPES: tuple[SwitchEntityDescription, ...] = (
|
||||||
|
@ -17,6 +17,7 @@ import uuid
|
|||||||
|
|
||||||
import attr
|
import attr
|
||||||
import certifi
|
import certifi
|
||||||
|
import jinja2
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant import config_entries
|
from homeassistant import config_entries
|
||||||
@ -665,7 +666,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
msg_topic_template, hass
|
msg_topic_template, hass
|
||||||
).async_render(parse_result=False)
|
).async_render(parse_result=False)
|
||||||
msg_topic = valid_publish_topic(rendered_topic)
|
msg_topic = valid_publish_topic(rendered_topic)
|
||||||
except (template.jinja2.TemplateError, TemplateError) as exc:
|
except (jinja2.TemplateError, TemplateError) as exc:
|
||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
"Unable to publish: rendering topic template of %s "
|
"Unable to publish: rendering topic template of %s "
|
||||||
"failed because %s",
|
"failed because %s",
|
||||||
@ -688,7 +689,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||||||
payload = MqttCommandTemplate(
|
payload = MqttCommandTemplate(
|
||||||
template.Template(payload_template), hass=hass
|
template.Template(payload_template), hass=hass
|
||||||
).async_render()
|
).async_render()
|
||||||
except (template.jinja2.TemplateError, TemplateError) as exc:
|
except (jinja2.TemplateError, TemplateError) as exc:
|
||||||
_LOGGER.error(
|
_LOGGER.error(
|
||||||
"Unable to publish to %s: rendering payload template of "
|
"Unable to publish to %s: rendering payload template of "
|
||||||
"%s failed because %s",
|
"%s failed because %s",
|
||||||
|
Loading…
Reference in New Issue
Block a user