diff --git a/homeassistant/components/device_automation/__init__.py b/homeassistant/components/device_automation/__init__.py index 80e64033295..872a4af6cd6 100644 --- a/homeassistant/components/device_automation/__init__.py +++ b/homeassistant/components/device_automation/__init__.py @@ -1,22 +1,21 @@ """Helpers for device automations.""" import asyncio import logging -from typing import Any, List, MutableMapping from types import ModuleType +from typing import Any, List, MutableMapping import voluptuous as vol import voluptuous_serialize -from homeassistant.const import CONF_PLATFORM, CONF_DOMAIN, CONF_DEVICE_ID from homeassistant.components import websocket_api +from homeassistant.const import CONF_DEVICE_ID, CONF_DOMAIN, CONF_PLATFORM from homeassistant.core import HomeAssistant from homeassistant.helpers import config_validation as cv from homeassistant.helpers.entity_registry import async_entries_for_device -from homeassistant.loader import async_get_integration, IntegrationNotFound +from homeassistant.loader import IntegrationNotFound, async_get_integration from .exceptions import InvalidDeviceAutomationConfig - # mypy: allow-untyped-calls, allow-untyped-defs DOMAIN = "device_automation" diff --git a/homeassistant/components/device_automation/toggle_entity.py b/homeassistant/components/device_automation/toggle_entity.py index 5f01f4d9d71..7d84eb921e9 100644 --- a/homeassistant/components/device_automation/toggle_entity.py +++ b/homeassistant/components/device_automation/toggle_entity.py @@ -1,11 +1,11 @@ """Device automation helpers for toggle entity.""" from typing import Any, Dict, List + import voluptuous as vol -from homeassistant.core import Context, HomeAssistant, CALLBACK_TYPE from homeassistant.components.automation import ( - state as state_automation, AutomationActionType, + state as state_automation, ) from homeassistant.components.device_automation.const import ( CONF_IS_OFF, @@ -24,11 +24,12 @@ from homeassistant.const import ( CONF_PLATFORM, CONF_TYPE, ) -from homeassistant.helpers.entity_registry import async_entries_for_device +from homeassistant.core import CALLBACK_TYPE, Context, HomeAssistant from homeassistant.helpers import condition, config_validation as cv +from homeassistant.helpers.entity_registry import async_entries_for_device from homeassistant.helpers.typing import ConfigType, TemplateVarsType -from . import TRIGGER_BASE_SCHEMA +from . import TRIGGER_BASE_SCHEMA # mypy: allow-untyped-calls, allow-untyped-defs diff --git a/tests/components/device_automation/test_init.py b/tests/components/device_automation/test_init.py index bddef3286ac..5d997a485a5 100644 --- a/tests/components/device_automation/test_init.py +++ b/tests/components/device_automation/test_init.py @@ -1,12 +1,11 @@ """The test for light device automation.""" import pytest -from homeassistant.setup import async_setup_component import homeassistant.components.automation as automation from homeassistant.components.websocket_api.const import TYPE_RESULT -from homeassistant.const import STATE_ON, STATE_OFF, CONF_PLATFORM +from homeassistant.const import CONF_PLATFORM, STATE_OFF, STATE_ON from homeassistant.helpers import device_registry - +from homeassistant.setup import async_setup_component from tests.common import ( MockConfigEntry,