use isort to sort imports according to PEP8 for demo (#29630)
This commit is contained in:
1 parent
a3b605bb7d
commit
e4e9cdce73
25 files changed
+54
-55
No files matched your search
@@ -4,8 +4,8 @@ import logging
|
||||
import time
|
||||
|
||||
from homeassistant import bootstrap, config_entries
|
||||
import homeassistant.core as ha
|
||||
from homeassistant.const import ATTR_ENTITY_ID, EVENT_HOMEASSISTANT_START
|
||||
import homeassistant.core as ha
|
||||
|
||||
DOMAIN = "demo"
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
"""Demo platform that has two fake binary sensors."""
|
||||
from homeassistant.components.binary_sensor import BinarySensorDevice
|
||||
|
||||
from . import DOMAIN
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,8 @@
|
||||
"""Demo platform that has two fake binary sensors."""
|
||||
import copy
|
||||
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
from homeassistant.components.calendar import CalendarEventDevice, get_date
|
||||
import homeassistant.util.dt as dt_util
|
||||
|
||||
|
||||
def setup_platform(hass, config, add_entities, discovery_info=None):
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
"""Demo platform that offers a fake climate device."""
|
||||
import logging
|
||||
|
||||
from homeassistant.components.climate import ClimateDevice
|
||||
from homeassistant.components.climate.const import (
|
||||
ATTR_TARGET_TEMP_HIGH,
|
||||
ATTR_TARGET_TEMP_LOW,
|
||||
CURRENT_HVAC_COOL,
|
||||
CURRENT_HVAC_HEAT,
|
||||
HVAC_MODE_AUTO,
|
||||
HVAC_MODE_COOL,
|
||||
HVAC_MODE_HEAT,
|
||||
HVAC_MODE_HEAT_COOL,
|
||||
@@ -18,9 +20,9 @@ from homeassistant.components.climate.const import (
|
||||
SUPPORT_TARGET_HUMIDITY,
|
||||
SUPPORT_TARGET_TEMPERATURE,
|
||||
SUPPORT_TARGET_TEMPERATURE_RANGE,
|
||||
HVAC_MODE_AUTO,
|
||||
)
|
||||
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT
|
||||
|
||||
from . import DOMAIN
|
||||
|
||||
SUPPORT_FLAGS = 0
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""Demo platform for the cover component."""
|
||||
from homeassistant.helpers.event import track_utc_time_change
|
||||
|
||||
from homeassistant.components.cover import (
|
||||
ATTR_POSITION,
|
||||
ATTR_TILT_POSITION,
|
||||
@@ -8,6 +6,8 @@ from homeassistant.components.cover import (
|
||||
SUPPORT_OPEN,
|
||||
CoverDevice,
|
||||
)
|
||||
from homeassistant.helpers.event import track_utc_time_change
|
||||
|
||||
from . import DOMAIN
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,4 @@
|
||||
"""Demo fan platform that has a fake fan."""
|
||||
from homeassistant.const import STATE_OFF
|
||||
|
||||
from homeassistant.components.fan import (
|
||||
SPEED_HIGH,
|
||||
SPEED_LOW,
|
||||
@@ -10,6 +8,7 @@ from homeassistant.components.fan import (
|
||||
SUPPORT_SET_SPEED,
|
||||
FanEntity,
|
||||
)
|
||||
from homeassistant.const import STATE_OFF
|
||||
|
||||
FULL_SUPPORT = SUPPORT_SET_SPEED | SUPPORT_OSCILLATE | SUPPORT_DIRECTION
|
||||
LIMITED_SUPPORT = SUPPORT_SET_SPEED
|
||||
|
||||
@@ -5,9 +5,8 @@ from math import cos, pi, radians, sin
|
||||
import random
|
||||
from typing import Optional
|
||||
|
||||
from homeassistant.helpers.event import track_time_interval
|
||||
|
||||
from homeassistant.components.geo_location import GeolocationEvent
|
||||
from homeassistant.helpers.event import track_time_interval
|
||||
|
||||
_LOGGER = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
"""Support for the demo image processing."""
|
||||
from homeassistant.components.image_processing import (
|
||||
ImageProcessingFaceEntity,
|
||||
ATTR_CONFIDENCE,
|
||||
ATTR_NAME,
|
||||
ATTR_AGE,
|
||||
ATTR_CONFIDENCE,
|
||||
ATTR_GENDER,
|
||||
ATTR_NAME,
|
||||
ImageProcessingFaceEntity,
|
||||
)
|
||||
from homeassistant.components.openalpr_local.image_processing import (
|
||||
ImageProcessingAlprEntity,
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
"""Demo lock platform that has two fake locks."""
|
||||
from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED
|
||||
|
||||
from homeassistant.components.lock import SUPPORT_OPEN, LockDevice
|
||||
from homeassistant.const import STATE_LOCKED, STATE_UNLOCKED
|
||||
|
||||
|
||||
async def async_setup_platform(hass, config, async_add_entities, discovery_info=None):
|
||||
|
||||
@@ -1,11 +1,12 @@
|
||||
"""Demo platform that has a couple of fake sensors."""
|
||||
from homeassistant.const import (
|
||||
ATTR_BATTERY_LEVEL,
|
||||
TEMP_CELSIUS,
|
||||
DEVICE_CLASS_HUMIDITY,
|
||||
DEVICE_CLASS_TEMPERATURE,
|
||||
TEMP_CELSIUS,
|
||||
)
|
||||
from homeassistant.helpers.entity import Entity
|
||||
|
||||
from . import DOMAIN
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
"""Demo platform that has two fake switches."""
|
||||
from homeassistant.components.switch import SwitchDevice
|
||||
from homeassistant.const import DEVICE_DEFAULT_NAME
|
||||
|
||||
from . import DOMAIN
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +1,11 @@
|
||||
"""Demo platform that offers a fake water heater device."""
|
||||
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT
|
||||
|
||||
from homeassistant.components.water_heater import (
|
||||
SUPPORT_AWAY_MODE,
|
||||
SUPPORT_OPERATION_MODE,
|
||||
SUPPORT_TARGET_TEMPERATURE,
|
||||
WaterHeaterDevice,
|
||||
)
|
||||
from homeassistant.const import ATTR_TEMPERATURE, TEMP_CELSIUS, TEMP_FAHRENHEIT
|
||||
|
||||
SUPPORT_FLAGS_HEATER = (
|
||||
SUPPORT_TARGET_TEMPERATURE | SUPPORT_OPERATION_MODE | SUPPORT_AWAY_MODE
|
||||
|
||||
Reference in new issue
Block a user