Fix imports (using isort)

This commit is contained in:
Paulus Schoutsen committed 2016-02-18 21:27:50 -08:00
1 parent 233a2a2878
commit e80309c03c
214 files changed
+644 -718

No files matched your search

+1 -1
View File
@@ -8,9 +8,9 @@ https://home-assistant.io/components/sensor.apcupsd/
"""
import logging
from homeassistant.components import apcupsd
from homeassistant.const import TEMP_CELCIUS
from homeassistant.helpers.entity import Entity
from homeassistant.components import apcupsd
DEPENDENCIES = [apcupsd.DOMAIN]
DEFAULT_NAME = "UPS Status"
+1 -1
View File
@@ -10,8 +10,8 @@ https://home-assistant.io/components/sensor.arduino/
import logging
import homeassistant.components.arduino as arduino
from homeassistant.helpers.entity import Entity
from homeassistant.const import DEVICE_DEFAULT_NAME
from homeassistant.helpers.entity import Entity
DEPENDENCIES = ['arduino']
+4 -4
View File
@@ -6,16 +6,16 @@ The arest sensor will consume an exposed aREST API of a device.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.arest/
"""
from datetime import timedelta
import logging
from datetime import timedelta
import requests
from homeassistant.const import (ATTR_UNIT_OF_MEASUREMENT, CONF_VALUE_TEMPLATE,
DEVICE_DEFAULT_NAME)
from homeassistant.const import (
ATTR_UNIT_OF_MEASUREMENT, CONF_VALUE_TEMPLATE, DEVICE_DEFAULT_NAME)
from homeassistant.exceptions import TemplateError
from homeassistant.helpers.entity import Entity
from homeassistant.util import template, Throttle
from homeassistant.util import Throttle, template
_LOGGER = logging.getLogger(__name__)
+1 -2
View File
@@ -9,9 +9,8 @@ https://home-assistant.io/components/sensor.bitcoin/
import logging
from datetime import timedelta
from homeassistant.util import Throttle
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
REQUIREMENTS = ['blockchain==1.2.1']
_LOGGER = logging.getLogger(__name__)
+2 -1
View File
@@ -7,8 +7,9 @@ For more details about this component, please refer to the documentation at
https://home-assistant.io/components/sensor.bloomsky/
"""
import logging
from homeassistant.loader import get_component
from homeassistant.helpers.entity import Entity
from homeassistant.loader import get_component
DEPENDENCIES = ["bloomsky"]
@@ -12,7 +12,7 @@ from datetime import timedelta
from homeassistant.const import CONF_VALUE_TEMPLATE
from homeassistant.helpers.entity import Entity
from homeassistant.util import template, Throttle
from homeassistant.util import Throttle, template
_LOGGER = logging.getLogger(__name__)
+1 -1
View File
@@ -3,8 +3,8 @@ homeassistant.components.sensor.demo
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Demo platform that has a couple of fake sensors.
"""
from homeassistant.const import ATTR_BATTERY_LEVEL, TEMP_CELCIUS
from homeassistant.helpers.entity import Entity
from homeassistant.const import TEMP_CELCIUS, ATTR_BATTERY_LEVEL
# pylint: disable=unused-argument
+1 -1
View File
@@ -9,9 +9,9 @@ https://home-assistant.io/components/sensor.dht/
import logging
from datetime import timedelta
from homeassistant.util import Throttle
from homeassistant.const import TEMP_FAHRENHEIT
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
# update this requirement to upstream as soon as it supports python3
REQUIREMENTS = ['http://github.com/mala-zaba/Adafruit_Python_DHT/archive/'
+4 -5
View File
@@ -6,14 +6,13 @@ Displays values from Dweet.io.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.dweet/
"""
from datetime import timedelta
import logging
import json
import logging
from datetime import timedelta
from homeassistant.util import Throttle
from homeassistant.util import template
from homeassistant.const import CONF_VALUE_TEMPLATE, STATE_UNKNOWN
from homeassistant.helpers.entity import Entity
from homeassistant.const import (STATE_UNKNOWN, CONF_VALUE_TEMPLATE)
from homeassistant.util import Throttle, template
_LOGGER = logging.getLogger(__name__)
REQUIREMENTS = ['dweepy==0.2.0']
+1 -1
View File
@@ -8,9 +8,9 @@ https://home-assistant.io/components/sensor.ecobee/
"""
import logging
from homeassistant.helpers.entity import Entity
from homeassistant.components import ecobee
from homeassistant.const import TEMP_FAHRENHEIT
from homeassistant.helpers.entity import Entity
DEPENDENCIES = ['ecobee']
SENSOR_TYPES = {
+2 -1
View File
@@ -8,7 +8,8 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.efergy/
"""
import logging
from requests import get, RequestException
from requests import RequestException, get
from homeassistant.helpers.entity import Entity
@@ -8,8 +8,9 @@ https://home-assistant.io/components/sensor.eliqonline/
"""
import logging
from urllib.error import URLError
from homeassistant.const import CONF_ACCESS_TOKEN, CONF_NAME, STATE_UNKNOWN
from homeassistant.helpers.entity import Entity
from homeassistant.const import (STATE_UNKNOWN, CONF_ACCESS_TOKEN, CONF_NAME)
_LOGGER = logging.getLogger(__name__)
+2 -2
View File
@@ -9,9 +9,9 @@ https://home-assistant.io/components/sensor.forecast/
import logging
from datetime import timedelta
from homeassistant.util import Throttle
from homeassistant.const import (CONF_API_KEY, TEMP_CELCIUS)
from homeassistant.const import CONF_API_KEY, TEMP_CELCIUS
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
REQUIREMENTS = ['python-forecastio==1.3.3']
_LOGGER = logging.getLogger(__name__)
+3 -3
View File
@@ -6,14 +6,14 @@ Gathers system information of hosts which running glances.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.glances/
"""
from datetime import timedelta
import logging
from datetime import timedelta
import requests
from homeassistant.util import Throttle
from homeassistant.helpers.entity import Entity
from homeassistant.const import STATE_UNKNOWN
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
_LOGGER = logging.getLogger(__name__)
+4 -4
View File
@@ -8,10 +8,10 @@ https://home-assistant.io/components/isy994/
"""
import logging
from homeassistant.components.isy994 import (ISY, ISYDeviceABC, SENSOR_STRING,
HIDDEN_STRING)
from homeassistant.const import (STATE_OPEN, STATE_CLOSED, STATE_HOME,
STATE_NOT_HOME, STATE_ON, STATE_OFF)
from homeassistant.components.isy994 import (
HIDDEN_STRING, ISY, SENSOR_STRING, ISYDeviceABC)
from homeassistant.const import (
STATE_CLOSED, STATE_HOME, STATE_NOT_HOME, STATE_OFF, STATE_ON, STATE_OPEN)
DEFAULT_HIDDEN_WEATHER = ['Temperature_High', 'Temperature_Low', 'Feels_Like',
'Temperature_Average', 'Pressure', 'Dew_Point',
+2 -3
View File
@@ -8,11 +8,10 @@ https://home-assistant.io/components/sensor.mfi/
"""
import logging
from homeassistant.const import (CONF_USERNAME, CONF_PASSWORD,
TEMP_CELCIUS)
from homeassistant.components.sensor import DOMAIN
from homeassistant.helpers.entity import Entity
from homeassistant.const import CONF_PASSWORD, CONF_USERNAME, TEMP_CELCIUS
from homeassistant.helpers import validate_config
from homeassistant.helpers.entity import Entity
REQUIREMENTS = ['mficlient==0.2.2']
+2 -3
View File
@@ -9,10 +9,9 @@ https://home-assistant.io/components/sensor.modbus/
import logging
import homeassistant.components.modbus as modbus
from homeassistant.helpers.entity import Entity
from homeassistant.const import (
TEMP_CELCIUS, TEMP_FAHRENHEIT,
STATE_ON, STATE_OFF)
STATE_OFF, STATE_ON, TEMP_CELCIUS, TEMP_FAHRENHEIT)
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = ['modbus']
+2 -1
View File
@@ -7,10 +7,11 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.mqtt/
"""
import logging
import homeassistant.components.mqtt as mqtt
from homeassistant.const import CONF_VALUE_TEMPLATE, STATE_UNKNOWN
from homeassistant.helpers.entity import Entity
from homeassistant.util import template
import homeassistant.components.mqtt as mqtt
_LOGGER = logging.getLogger(__name__)
+3 -7
View File
@@ -6,14 +6,10 @@ https://home-assistant.io/components/sensor.mysensors/
"""
import logging
from homeassistant.helpers.entity import Entity
from homeassistant.const import (
ATTR_BATTERY_LEVEL,
TEMP_CELCIUS,
STATE_ON, STATE_OFF)
import homeassistant.components.mysensors as mysensors
from homeassistant.const import (
ATTR_BATTERY_LEVEL, STATE_OFF, STATE_ON, TEMP_CELCIUS)
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
DEPENDENCIES = []
+2 -2
View File
@@ -8,10 +8,10 @@ https://home-assistant.io/components/sensor.nest/
"""
import logging
import socket
import homeassistant.components.nest as nest
from homeassistant.helpers.entity import Entity
import homeassistant.components.nest as nest
from homeassistant.const import TEMP_CELCIUS
from homeassistant.helpers.entity import Entity
DEPENDENCIES = ['nest']
SENSOR_TYPES = ['humidity',
+4 -3
View File
@@ -8,11 +8,12 @@ https://home-assistant.io/components/sensor.netatmo/
"""
import logging
from datetime import timedelta
from homeassistant.components.sensor import DOMAIN
from homeassistant.const import (CONF_API_KEY, CONF_USERNAME, CONF_PASSWORD,
TEMP_CELCIUS)
from homeassistant.helpers.entity import Entity
from homeassistant.const import (
CONF_API_KEY, CONF_PASSWORD, CONF_USERNAME, TEMP_CELCIUS)
from homeassistant.helpers import validate_config
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
REQUIREMENTS = [
@@ -6,6 +6,7 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.neurio_energy/
"""
import logging
import requests.exceptions
from homeassistant.helpers.entity import Entity
+3 -2
View File
@@ -6,11 +6,12 @@ Support for DS18B20 One Wire Sensors.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.onewire/
"""
from glob import glob
import logging
import os
import time
from homeassistant.const import TEMP_CELCIUS, STATE_UNKNOWN
from glob import glob
from homeassistant.const import STATE_UNKNOWN, TEMP_CELCIUS
from homeassistant.helpers.entity import Entity
BASE_DIR = '/sys/bus/w1/devices/'
@@ -9,9 +9,9 @@ https://home-assistant.io/components/sensor.openweathermap/
import logging
from datetime import timedelta
from homeassistant.util import Throttle
from homeassistant.const import (CONF_API_KEY, TEMP_CELCIUS, TEMP_FAHRENHEIT)
from homeassistant.const import CONF_API_KEY, TEMP_CELCIUS, TEMP_FAHRENHEIT
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
REQUIREMENTS = ['pyowm==2.3.0']
_LOGGER = logging.getLogger(__name__)
+4 -3
View File
@@ -6,13 +6,14 @@ The rest sensor will consume responses sent by an exposed REST API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.rest/
"""
from datetime import timedelta
import logging
from datetime import timedelta
import requests
from homeassistant.const import (CONF_VALUE_TEMPLATE, STATE_UNKNOWN)
from homeassistant.util import template, Throttle
from homeassistant.const import CONF_VALUE_TEMPLATE, STATE_UNKNOWN
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle, template
_LOGGER = logging.getLogger(__name__)
+2 -2
View File
@@ -9,9 +9,9 @@ https://home-assistant.io/components/sensor.rfxtrx/
import logging
from collections import OrderedDict
from homeassistant.const import (TEMP_CELCIUS)
from homeassistant.helpers.entity import Entity
import homeassistant.components.rfxtrx as rfxtrx
from homeassistant.const import TEMP_CELCIUS
from homeassistant.helpers.entity import Entity
from homeassistant.util import slugify
DEPENDENCIES = ['rfxtrx']
+1 -1
View File
@@ -6,8 +6,8 @@ Monitors SABnzbd NZB client API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.sabnzbd/
"""
from datetime import timedelta
import logging
from datetime import timedelta
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
+5 -4
View File
@@ -7,15 +7,16 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.speedtest/
"""
import logging
import sys
import re
import sys
from datetime import timedelta
from subprocess import check_output
from homeassistant.util import Throttle
import homeassistant.util.dt as dt_util
from homeassistant.components.sensor import DOMAIN
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.event import track_time_change
from homeassistant.components.sensor import DOMAIN
import homeassistant.util.dt as dt_util
from homeassistant.util import Throttle
REQUIREMENTS = ['speedtest-cli==0.3.4']
_LOGGER = logging.getLogger(__name__)
@@ -9,11 +9,12 @@ https://home-assistant.io/components/sensor.swiss_public_transport/
"""
import logging
from datetime import timedelta
import requests
from homeassistant.util import Throttle
import homeassistant.util.dt as dt_util
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
_LOGGER = logging.getLogger(__name__)
_RESOURCE = 'http://transport.opendata.ch/v1/'
@@ -9,8 +9,8 @@ https://home-assistant.io/components/sensor.systemmonitor/
import logging
import homeassistant.util.dt as dt_util
from homeassistant.const import STATE_OFF, STATE_ON
from homeassistant.helpers.entity import Entity
from homeassistant.const import STATE_ON, STATE_OFF
REQUIREMENTS = ['psutil==3.4.2']
SENSOR_TYPES = {
@@ -8,14 +8,12 @@ https://home-assistant.io/components/sensor.tellduslive/
"""
import logging
from datetime import datetime
from homeassistant.const import (TEMP_CELCIUS,
ATTR_BATTERY_LEVEL,
DEVICE_DEFAULT_NAME)
from homeassistant.helpers.entity import Entity
from homeassistant.components import tellduslive
from homeassistant.const import (
ATTR_BATTERY_LEVEL, DEVICE_DEFAULT_NAME, TEMP_CELCIUS)
from homeassistant.helpers.entity import Entity
ATTR_LAST_UPDATED = "time_last_updated"
+1 -1
View File
@@ -9,9 +9,9 @@ https://home-assistant.io/components/sensor.tellstick/
import logging
from collections import namedtuple
import homeassistant.util as util
from homeassistant.const import TEMP_CELCIUS
from homeassistant.helpers.entity import Entity
import homeassistant.util as util
DatatypeDescription = namedtuple("DatatypeDescription", ['name', 'unit'])
+2 -1
View File
@@ -7,8 +7,9 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.temper/
"""
import logging
from homeassistant.helpers.entity import Entity
from homeassistant.const import CONF_NAME, DEVICE_DEFAULT_NAME
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
+6 -10
View File
@@ -9,17 +9,13 @@ https://home-assistant.io/components/sensor.template/
"""
import logging
from homeassistant.helpers.entity import Entity, generate_entity_id
from homeassistant.core import EVENT_STATE_CHANGED
from homeassistant.const import (
ATTR_FRIENDLY_NAME,
CONF_VALUE_TEMPLATE,
ATTR_UNIT_OF_MEASUREMENT)
from homeassistant.util import template, slugify
from homeassistant.exceptions import TemplateError
from homeassistant.components.sensor import DOMAIN
from homeassistant.const import (
ATTR_FRIENDLY_NAME, ATTR_UNIT_OF_MEASUREMENT, CONF_VALUE_TEMPLATE)
from homeassistant.core import EVENT_STATE_CHANGED
from homeassistant.exceptions import TemplateError
from homeassistant.helpers.entity import Entity, generate_entity_id
from homeassistant.util import slugify, template
ENTITY_ID_FORMAT = DOMAIN + '.{}'
+1 -1
View File
@@ -8,10 +8,10 @@ https://home-assistant.io/components/sensor.torque/
"""
import re
from homeassistant.const import HTTP_OK
from homeassistant.helpers.entity import Entity
DOMAIN = 'torque'
DEPENDENCIES = ['http']
SENSOR_EMAIL_FIELD = 'eml'
@@ -6,12 +6,12 @@ Monitors Transmission BitTorrent client API.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.transmission/
"""
from datetime import timedelta
import logging
from datetime import timedelta
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
from homeassistant.util import Throttle
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
from homeassistant.helpers.entity import Entity
from homeassistant.util import Throttle
REQUIREMENTS = ['transmissionrpc==0.11']
SENSOR_TYPES = {
+1 -1
View File
@@ -6,8 +6,8 @@ A sensor for the Twitch stream status.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.twitch/
"""
from homeassistant.helpers.entity import Entity
from homeassistant.const import ATTR_ENTITY_PICTURE
from homeassistant.helpers.entity import Entity
STATE_STREAMING = 'streaming'
STATE_OFFLINE = 'offline'
+6 -5
View File
@@ -7,13 +7,14 @@ For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/sensor.vera/
"""
import logging
from requests.exceptions import RequestException
import homeassistant.util.dt as dt_util
from homeassistant.helpers.entity import Entity
from requests.exceptions import RequestException
import homeassistant.util.dt as dt_util
from homeassistant.const import (
ATTR_BATTERY_LEVEL, ATTR_TRIPPED, ATTR_ARMED, ATTR_LAST_TRIP_TIME,
TEMP_CELCIUS, TEMP_FAHRENHEIT, EVENT_HOMEASSISTANT_STOP)
ATTR_ARMED, ATTR_BATTERY_LEVEL, ATTR_LAST_TRIP_TIME, ATTR_TRIPPED,
EVENT_HOMEASSISTANT_STOP, TEMP_CELCIUS, TEMP_FAHRENHEIT)
from homeassistant.helpers.entity import Entity
REQUIREMENTS = ['pyvera==0.2.8']
+1 -2
View File
@@ -9,9 +9,8 @@ documentation at https://home-assistant.io/components/verisure/
import logging
import homeassistant.components.verisure as verisure
from homeassistant.helpers.entity import Entity
from homeassistant.const import TEMP_CELCIUS
from homeassistant.helpers.entity import Entity
_LOGGER = logging.getLogger(__name__)
+1 -1
View File
@@ -8,8 +8,8 @@ at https://home-assistant.io/components/sensor.wink/
"""
import logging
from homeassistant.const import CONF_ACCESS_TOKEN, STATE_CLOSED, STATE_OPEN
from homeassistant.helpers.entity import Entity
from homeassistant.const import CONF_ACCESS_TOKEN, STATE_OPEN, STATE_CLOSED
REQUIREMENTS = ['python-wink==0.6.0']
+4 -4
View File
@@ -10,11 +10,11 @@ import logging
import requests
from homeassistant.const import (ATTR_ENTITY_PICTURE,
CONF_LATITUDE,
CONF_LONGITUDE)
from homeassistant.const import (
ATTR_ENTITY_PICTURE, CONF_LATITUDE, CONF_LONGITUDE)
from homeassistant.helpers.entity import Entity
from homeassistant.util import location, dt as dt_util
from homeassistant.util import dt as dt_util
from homeassistant.util import location
_LOGGER = logging.getLogger(__name__)
+3 -4
View File
@@ -10,11 +10,10 @@ https://home-assistant.io/components/sensor.zigbee/
import logging
from binascii import hexlify
from homeassistant.core import JobPriority
from homeassistant.const import TEMP_CELCIUS
from homeassistant.helpers.entity import Entity
from homeassistant.components import zigbee
from homeassistant.const import TEMP_CELCIUS
from homeassistant.core import JobPriority
from homeassistant.helpers.entity import Entity
DEPENDENCIES = ["zigbee"]
_LOGGER = logging.getLogger(__name__)
+6 -7
View File
@@ -10,17 +10,16 @@ at https://home-assistant.io/components/zwave/
# pylint: disable=import-error
import datetime
from homeassistant.helpers.event import track_point_in_time
import homeassistant.util.dt as dt_util
from homeassistant.components.sensor import DOMAIN
from homeassistant.helpers.entity import Entity
from homeassistant.components.zwave import (
NETWORK, ATTR_NODE_ID, ATTR_VALUE_ID, COMMAND_CLASS_SENSOR_BINARY,
COMMAND_CLASS_SENSOR_MULTILEVEL, COMMAND_CLASS_METER, TYPE_DECIMAL,
COMMAND_CLASS_ALARM, ZWaveDeviceEntity, get_config_value)
ATTR_NODE_ID, ATTR_VALUE_ID, COMMAND_CLASS_ALARM, COMMAND_CLASS_METER,
COMMAND_CLASS_SENSOR_BINARY, COMMAND_CLASS_SENSOR_MULTILEVEL, NETWORK,
TYPE_DECIMAL, ZWaveDeviceEntity, get_config_value)
from homeassistant.const import (
STATE_ON, STATE_OFF, TEMP_CELCIUS, TEMP_FAHRENHEIT)
STATE_OFF, STATE_ON, TEMP_CELCIUS, TEMP_FAHRENHEIT)
from homeassistant.helpers.entity import Entity
from homeassistant.helpers.event import track_point_in_time
PHILIO = '0x013c'
PHILIO_SLIM_SENSOR = '0x0002'