Fix 3rd party imports (#63455)
This commit is contained in:
parent
6873b02858
commit
945b67c5c5
4 changed files with 12 additions and 5 deletions
|
@ -3,6 +3,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import cast
|
||||
|
||||
from goalzero import Yeti
|
||||
|
||||
from homeassistant.components.binary_sensor import (
|
||||
BinarySensorDeviceClass,
|
||||
BinarySensorEntity,
|
||||
|
@ -15,7 +17,7 @@ from homeassistant.helpers.entity import EntityCategory
|
|||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||
|
||||
from . import Yeti, YetiEntity
|
||||
from . import YetiEntity
|
||||
from .const import DATA_KEY_API, DATA_KEY_COORDINATOR, DOMAIN
|
||||
|
||||
PARALLEL_UPDATES = 0
|
||||
|
|
|
@ -3,6 +3,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import cast
|
||||
|
||||
from goalzero import Yeti
|
||||
|
||||
from homeassistant.components.sensor import (
|
||||
SensorDeviceClass,
|
||||
SensorEntity,
|
||||
|
@ -28,7 +30,7 @@ from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
|||
from homeassistant.helpers.typing import StateType
|
||||
from homeassistant.helpers.update_coordinator import DataUpdateCoordinator
|
||||
|
||||
from . import Yeti, YetiEntity
|
||||
from . import YetiEntity
|
||||
from .const import DATA_KEY_API, DATA_KEY_COORDINATOR, DOMAIN
|
||||
|
||||
SENSOR_TYPES: tuple[SensorEntityDescription, ...] = (
|
||||
|
|
|
@ -3,6 +3,8 @@ from __future__ import annotations
|
|||
|
||||
from typing import Any, cast
|
||||
|
||||
from goalzero import Yeti
|
||||
|
||||
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
|
||||
from homeassistant.config_entries import ConfigEntry
|
||||
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.update_coordinator import DataUpdateCoordinator
|
||||
|
||||
from . import Yeti, YetiEntity
|
||||
from . import YetiEntity
|
||||
from .const import DATA_KEY_API, DATA_KEY_COORDINATOR, DOMAIN
|
||||
|
||||
SWITCH_TYPES: tuple[SwitchEntityDescription, ...] = (
|
||||
|
|
|
@ -17,6 +17,7 @@ import uuid
|
|||
|
||||
import attr
|
||||
import certifi
|
||||
import jinja2
|
||||
import voluptuous as vol
|
||||
|
||||
from homeassistant import config_entries
|
||||
|
@ -665,7 +666,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
msg_topic_template, hass
|
||||
).async_render(parse_result=False)
|
||||
msg_topic = valid_publish_topic(rendered_topic)
|
||||
except (template.jinja2.TemplateError, TemplateError) as exc:
|
||||
except (jinja2.TemplateError, TemplateError) as exc:
|
||||
_LOGGER.error(
|
||||
"Unable to publish: rendering topic template of %s "
|
||||
"failed because %s",
|
||||
|
@ -688,7 +689,7 @@ async def async_setup_entry(hass: HomeAssistant, entry: ConfigEntry) -> bool:
|
|||
payload = MqttCommandTemplate(
|
||||
template.Template(payload_template), hass=hass
|
||||
).async_render()
|
||||
except (template.jinja2.TemplateError, TemplateError) as exc:
|
||||
except (jinja2.TemplateError, TemplateError) as exc:
|
||||
_LOGGER.error(
|
||||
"Unable to publish to %s: rendering payload template of "
|
||||
"%s failed because %s",
|
||||
|
|
Loading…
Add table
Reference in a new issue