mirror of
https://github.com/home-assistant/core.git
synced 2025-07-17 10:17:09 +00:00
Move imports in device_tracker component (#27676)
* moved imports to top level * sorted imports using isort
This commit is contained in:
parent
c8f6484095
commit
5a35e52adf
@ -1,11 +1,12 @@
|
|||||||
"""Legacy device tracker classes."""
|
"""Legacy device tracker classes."""
|
||||||
import asyncio
|
import asyncio
|
||||||
from datetime import timedelta
|
from datetime import timedelta
|
||||||
|
import hashlib
|
||||||
from typing import Any, List, Sequence
|
from typing import Any, List, Sequence
|
||||||
|
|
||||||
import voluptuous as vol
|
import voluptuous as vol
|
||||||
|
|
||||||
from homeassistant.core import callback
|
from homeassistant import util
|
||||||
from homeassistant.components import zone
|
from homeassistant.components import zone
|
||||||
from homeassistant.components.group import (
|
from homeassistant.components.group import (
|
||||||
ATTR_ADD_ENTITIES,
|
ATTR_ADD_ENTITIES,
|
||||||
@ -16,16 +17,7 @@ from homeassistant.components.group import (
|
|||||||
SERVICE_SET,
|
SERVICE_SET,
|
||||||
)
|
)
|
||||||
from homeassistant.components.zone import async_active_zone
|
from homeassistant.components.zone import async_active_zone
|
||||||
from homeassistant.config import load_yaml_config_file, async_log_exception
|
from homeassistant.config import async_log_exception, load_yaml_config_file
|
||||||
from homeassistant.exceptions import HomeAssistantError
|
|
||||||
import homeassistant.helpers.config_validation as cv
|
|
||||||
from homeassistant.helpers.entity_registry import async_get_registry
|
|
||||||
from homeassistant.helpers.restore_state import RestoreEntity
|
|
||||||
from homeassistant.helpers.typing import GPSType, HomeAssistantType
|
|
||||||
from homeassistant import util
|
|
||||||
import homeassistant.util.dt as dt_util
|
|
||||||
from homeassistant.util.yaml import dump
|
|
||||||
|
|
||||||
from homeassistant.const import (
|
from homeassistant.const import (
|
||||||
ATTR_ENTITY_ID,
|
ATTR_ENTITY_ID,
|
||||||
ATTR_GPS_ACCURACY,
|
ATTR_GPS_ACCURACY,
|
||||||
@ -37,9 +29,17 @@ from homeassistant.const import (
|
|||||||
CONF_MAC,
|
CONF_MAC,
|
||||||
CONF_NAME,
|
CONF_NAME,
|
||||||
DEVICE_DEFAULT_NAME,
|
DEVICE_DEFAULT_NAME,
|
||||||
STATE_NOT_HOME,
|
|
||||||
STATE_HOME,
|
STATE_HOME,
|
||||||
|
STATE_NOT_HOME,
|
||||||
)
|
)
|
||||||
|
from homeassistant.core import callback
|
||||||
|
from homeassistant.exceptions import HomeAssistantError
|
||||||
|
import homeassistant.helpers.config_validation as cv
|
||||||
|
from homeassistant.helpers.entity_registry import async_get_registry
|
||||||
|
from homeassistant.helpers.restore_state import RestoreEntity
|
||||||
|
from homeassistant.helpers.typing import GPSType, HomeAssistantType
|
||||||
|
import homeassistant.util.dt as dt_util
|
||||||
|
from homeassistant.util.yaml import dump
|
||||||
|
|
||||||
from .const import (
|
from .const import (
|
||||||
ATTR_BATTERY,
|
ATTR_BATTERY,
|
||||||
@ -635,7 +635,6 @@ def get_gravatar_for_email(email: str):
|
|||||||
|
|
||||||
Async friendly.
|
Async friendly.
|
||||||
"""
|
"""
|
||||||
import hashlib
|
|
||||||
|
|
||||||
url = "https://www.gravatar.com/avatar/{}.jpg?s=80&d=wavatar"
|
url = "https://www.gravatar.com/avatar/{}.jpg?s=80&d=wavatar"
|
||||||
return url.format(hashlib.md5(email.encode("utf-8").lower()).hexdigest())
|
return url.format(hashlib.md5(email.encode("utf-8").lower()).hexdigest())
|
||||||
|
Loading…
x
Reference in New Issue
Block a user