Standardize util imports (#136723)
parent
22e72953e5
commit
a05ac6255c
|
@ -50,8 +50,7 @@ from homeassistant.const import (
|
|||
UnitOfVolume,
|
||||
)
|
||||
from homeassistant.core import HomeAssistant, State
|
||||
import homeassistant.util.color as color_util
|
||||
import homeassistant.util.dt as dt_util
|
||||
from homeassistant.util import color as color_util, dt as dt_util
|
||||
|
||||
from .const import (
|
||||
API_TEMP_UNITS,
|
||||
|
|
|
@ -16,7 +16,7 @@ from homeassistant.core import HomeAssistant
|
|||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
|
||||
def setup_platform(
|
||||
|
|
|
@ -17,10 +17,10 @@ from homeassistant.components.light import (
|
|||
)
|
||||
from homeassistant.const import CONF_NAME
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
CONF_SERIAL = "serial"
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ from homeassistant.components.light import (
|
|||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
EUFYHOME_MAX_KELVIN = 6500
|
||||
EUFYHOME_MIN_KELVIN = 2700
|
||||
|
|
|
@ -21,11 +21,11 @@ from homeassistant.components.light import (
|
|||
from homeassistant.const import CONF_HOSTS
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import PlatformNotReady
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ from homeassistant.components.light import (
|
|||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from . import refresh_system
|
||||
from .const import ATTR_MODE, DOMAIN
|
||||
|
|
|
@ -18,7 +18,7 @@ from homeassistant.components.light import (
|
|||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from . import HomeConnectConfigEntry, get_dict_from_home_connect_error
|
||||
from .api import HomeConnectDevice
|
||||
|
|
|
@ -21,7 +21,7 @@ from homeassistant.config_entries import ConfigEntry
|
|||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from . import KNOWN_DEVICES
|
||||
from .connection import HKDevice
|
||||
|
|
|
@ -26,7 +26,7 @@ from homeassistant.helpers.dispatcher import (
|
|||
async_dispatcher_send,
|
||||
)
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from . import (
|
||||
get_hyperion_device_id,
|
||||
|
|
|
@ -20,10 +20,10 @@ from homeassistant.components.light import (
|
|||
)
|
||||
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
DEFAULT_NAME = "iGlo Light"
|
||||
DEFAULT_PORT = 8080
|
||||
|
|
|
@ -26,7 +26,7 @@ from homeassistant.helpers.entity_platform import (
|
|||
async_get_current_platform,
|
||||
)
|
||||
from homeassistant.helpers.typing import ConfigType
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from . import KNXModule
|
||||
from .const import CONF_SYNC_STATE, DOMAIN, KNX_ADDRESS, KNX_MODULE_KEY, ColorTempModes
|
||||
|
|
|
@ -24,7 +24,7 @@ from homeassistant.components.light import (
|
|||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers import device_registry as dr
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from .const import (
|
||||
_ATTR_COLOR_TEMP,
|
||||
|
|
|
@ -35,7 +35,7 @@ from homeassistant.helpers.entity_component import EntityComponent
|
|||
from homeassistant.helpers.frame import ReportBehavior, report_usage
|
||||
from homeassistant.helpers.typing import ConfigType, VolDictType
|
||||
from homeassistant.loader import bind_hass
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from .const import ( # noqa: F401
|
||||
COLOR_MODES_BRIGHTNESS,
|
||||
|
|
|
@ -9,7 +9,7 @@ import voluptuous as vol
|
|||
from homeassistant.const import SERVICE_TURN_ON
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers import config_validation as cv, intent
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from . import ATTR_BRIGHTNESS_PCT, ATTR_COLOR_TEMP_KELVIN, ATTR_RGB_COLOR
|
||||
from .const import DOMAIN
|
||||
|
|
|
@ -20,10 +20,10 @@ from homeassistant.components.light import (
|
|||
)
|
||||
from homeassistant.const import CONF_HOST, CONF_NAME, CONF_PORT
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -42,11 +42,11 @@ from homeassistant.const import (
|
|||
STATE_ON,
|
||||
)
|
||||
from homeassistant.core import callback
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.restore_state import RestoreEntity
|
||||
from homeassistant.helpers.service_info.mqtt import ReceivePayloadType
|
||||
from homeassistant.helpers.typing import ConfigType, VolSchemaType
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from .. import subscription
|
||||
from ..config import MQTT_RW_SCHEMA
|
||||
|
|
|
@ -49,12 +49,12 @@ from homeassistant.const import (
|
|||
STATE_ON,
|
||||
)
|
||||
from homeassistant.core import async_get_hass, callback
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.issue_registry import IssueSeverity, async_create_issue
|
||||
from homeassistant.helpers.json import json_dumps
|
||||
from homeassistant.helpers.restore_state import RestoreEntity
|
||||
from homeassistant.helpers.typing import ConfigType, VolSchemaType
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
from homeassistant.util.json import json_loads_object
|
||||
from homeassistant.util.yaml import dump as yaml_dump
|
||||
|
||||
|
|
|
@ -31,11 +31,11 @@ from homeassistant.const import (
|
|||
STATE_ON,
|
||||
)
|
||||
from homeassistant.core import callback
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.restore_state import RestoreEntity
|
||||
from homeassistant.helpers.service_info.mqtt import ReceivePayloadType
|
||||
from homeassistant.helpers.typing import ConfigType, TemplateVarsType, VolSchemaType
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from .. import subscription
|
||||
from ..config import MQTT_RW_SCHEMA
|
||||
|
|
|
@ -24,10 +24,10 @@ from homeassistant.components.light import (
|
|||
)
|
||||
from homeassistant.const import CONF_HOST
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ from homeassistant.core import HomeAssistant
|
|||
from homeassistant.helpers.aiohttp_client import async_get_clientsession
|
||||
from homeassistant.helpers.device_registry import DeviceInfo
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from .const import DOMAIN
|
||||
|
||||
|
|
|
@ -17,10 +17,10 @@ from homeassistant.components.light import (
|
|||
)
|
||||
from homeassistant.const import CONF_DEVICES, CONF_NAME, CONF_PASSWORD
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -15,9 +15,8 @@ from homeassistant.helpers.trace import (
|
|||
trace_id_set,
|
||||
trace_set_child_id,
|
||||
)
|
||||
import homeassistant.util.dt as dt_util
|
||||
from homeassistant.util import dt as dt_util, uuid as uuid_util
|
||||
from homeassistant.util.limited_size_dict import LimitedSizeDict
|
||||
import homeassistant.util.uuid as uuid_util
|
||||
|
||||
type TraceData = dict[str, LimitedSizeDict[str, BaseTrace]]
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ from homeassistant.components.light import (
|
|||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from .const import CONF_GATEWAY_ID, COORDINATOR, COORDINATOR_LIST, DOMAIN, KEY_API
|
||||
from .coordinator import TradfriDeviceDataUpdateCoordinator
|
||||
|
|
|
@ -17,7 +17,7 @@ from homeassistant.config_entries import ConfigEntry
|
|||
from homeassistant.const import Platform
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from .common import ControllerData, get_controller_data
|
||||
from .entity import VeraEntity
|
||||
|
|
|
@ -21,7 +21,7 @@ from homeassistant.config_entries import ConfigEntry
|
|||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.device_registry import CONNECTION_ZIGBEE, DeviceInfo
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from . import async_wemo_dispatcher_connect
|
||||
from .const import DOMAIN as WEMO_DOMAIN
|
||||
|
|
|
@ -14,7 +14,7 @@ from homeassistant.components.light import (
|
|||
from homeassistant.config_entries import ConfigEntry
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from .const import DOMAIN, GATEWAYS_KEY
|
||||
from .entity import XiaomiDevice
|
||||
|
|
|
@ -32,13 +32,12 @@ from homeassistant.config_entries import ConfigEntry
|
|||
from homeassistant.const import ATTR_ENTITY_ID, ATTR_MODE, CONF_NAME
|
||||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.helpers import entity_platform
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers import config_validation as cv, entity_platform
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.event import async_call_later
|
||||
from homeassistant.helpers.typing import VolDictType
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from . import YEELIGHT_FLOW_TRANSITION_SCHEMA
|
||||
from .const import (
|
||||
|
|
|
@ -17,10 +17,10 @@ from homeassistant.components.light import (
|
|||
)
|
||||
from homeassistant.const import CONF_HOST
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -18,10 +18,10 @@ from homeassistant.components.light import (
|
|||
)
|
||||
from homeassistant.const import CONF_DEVICES, CONF_NAME
|
||||
from homeassistant.core import HomeAssistant
|
||||
import homeassistant.helpers.config_validation as cv
|
||||
from homeassistant.helpers import config_validation as cv
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.typing import ConfigType, DiscoveryInfoType
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ from homeassistant.core import Event, HomeAssistant
|
|||
from homeassistant.helpers.device_registry import DeviceInfo
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
from homeassistant.helpers.event import async_track_time_interval
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from .const import DATA_ADDRESSES, DATA_DISCOVERY_SUBSCRIPTION, DOMAIN
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ from homeassistant.config_entries import ConfigEntry
|
|||
from homeassistant.core import HomeAssistant, callback
|
||||
from homeassistant.helpers.dispatcher import async_dispatcher_connect
|
||||
from homeassistant.helpers.entity_platform import AddEntitiesCallback
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from .const import DATA_CLIENT, DOMAIN
|
||||
from .discovery import ZwaveDiscoveryInfo
|
||||
|
|
|
@ -29,7 +29,7 @@ from homeassistant.requirements import (
|
|||
async_clear_install_history,
|
||||
async_get_integration_with_requirements,
|
||||
)
|
||||
import homeassistant.util.yaml.loader as yaml_loader
|
||||
from homeassistant.util.yaml import loader as yaml_loader
|
||||
|
||||
from . import config_validation as cv
|
||||
from .typing import ConfigType
|
||||
|
|
|
@ -24,11 +24,11 @@ from homeassistant.core import (
|
|||
)
|
||||
from homeassistant.exceptions import HomeAssistantError
|
||||
from homeassistant.loader import async_suggest_report_issue
|
||||
from homeassistant.util import uuid as uuid_util
|
||||
from homeassistant.util.dt import utc_from_timestamp, utcnow
|
||||
from homeassistant.util.event_type import EventType
|
||||
from homeassistant.util.hass_dict import HassKey
|
||||
from homeassistant.util.json import format_unserializable_data
|
||||
import homeassistant.util.uuid as uuid_util
|
||||
|
||||
from . import storage, translation
|
||||
from .debounce import Debouncer
|
||||
|
|
|
@ -23,8 +23,7 @@ from homeassistant.helpers import (
|
|||
issue_registry as ir,
|
||||
)
|
||||
from homeassistant.helpers.check_config import async_check_ha_config_file
|
||||
from homeassistant.util.yaml import Secrets
|
||||
import homeassistant.util.yaml.loader as yaml_loader
|
||||
from homeassistant.util.yaml import Secrets, loader as yaml_loader
|
||||
|
||||
# mypy: allow-untyped-calls, allow-untyped-defs
|
||||
|
||||
|
|
|
@ -25,7 +25,7 @@ from homeassistant.components.light import (
|
|||
from homeassistant.const import ATTR_ENTITY_ID, STATE_OFF, STATE_ON
|
||||
from homeassistant.core import HomeAssistant
|
||||
from homeassistant.setup import async_setup_component
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from tests.common import load_fixture
|
||||
from tests.test_util.aiohttp import AiohttpClientMocker
|
||||
|
|
|
@ -23,7 +23,7 @@ from homeassistant.core import HomeAssistant
|
|||
from homeassistant.exceptions import HomeAssistantError, Unauthorized
|
||||
from homeassistant.helpers import frame
|
||||
from homeassistant.setup import async_setup_component
|
||||
import homeassistant.util.color as color_util
|
||||
from homeassistant.util import color as color_util
|
||||
|
||||
from .common import MockLight
|
||||
|
||||
|
|
Loading…
Reference in New Issue