Allow generating requirements_all.txt
This commit is contained in:
parent
8be53af78f
commit
377d2c6e5a
17 changed files with 283 additions and 206 deletions
|
@ -11,7 +11,6 @@ from collections import OrderedDict
|
|||
|
||||
from homeassistant.const import (TEMP_CELCIUS)
|
||||
from homeassistant.helpers.entity import Entity
|
||||
from RFXtrx import SensorEvent
|
||||
import homeassistant.components.rfxtrx as rfxtrx
|
||||
from homeassistant.util import slugify
|
||||
|
||||
|
@ -28,6 +27,7 @@ _LOGGER = logging.getLogger(__name__)
|
|||
|
||||
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||
""" Setup the RFXtrx platform. """
|
||||
from RFXtrx import SensorEvent
|
||||
|
||||
def sensor_update(event):
|
||||
""" Callback for sensor updates from the RFXtrx gateway. """
|
||||
|
|
|
@ -9,9 +9,6 @@ https://home-assistant.io/components/sensor.tellstick/
|
|||
import logging
|
||||
from collections import namedtuple
|
||||
|
||||
import tellcore.telldus as telldus
|
||||
import tellcore.constants as tellcore_constants
|
||||
|
||||
from homeassistant.const import TEMP_CELCIUS
|
||||
from homeassistant.helpers.entity import Entity
|
||||
import homeassistant.util as util
|
||||
|
@ -24,6 +21,9 @@ REQUIREMENTS = ['tellcore-py==1.1.2']
|
|||
# pylint: disable=unused-argument
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
""" Sets up Tellstick sensors. """
|
||||
import tellcore.telldus as telldus
|
||||
import tellcore.constants as tellcore_constants
|
||||
|
||||
sensor_value_descriptions = {
|
||||
tellcore_constants.TELLSTICK_TEMPERATURE:
|
||||
DatatypeDescription(
|
||||
|
|
|
@ -11,10 +11,6 @@ from datetime import timedelta
|
|||
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
||||
|
||||
from homeassistant.helpers.entity import Entity
|
||||
# pylint: disable=no-name-in-module, import-error
|
||||
import transmissionrpc
|
||||
|
||||
from transmissionrpc.error import TransmissionError
|
||||
|
||||
import logging
|
||||
|
||||
|
@ -33,6 +29,9 @@ _THROTTLED_REFRESH = None
|
|||
# pylint: disable=unused-argument
|
||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||
""" Sets up the Transmission sensors. """
|
||||
import transmissionrpc
|
||||
from transmissionrpc.error import TransmissionError
|
||||
|
||||
host = config.get(CONF_HOST)
|
||||
username = config.get(CONF_USERNAME, None)
|
||||
password = config.get(CONF_PASSWORD, None)
|
||||
|
@ -97,6 +96,8 @@ class TransmissionSensor(Entity):
|
|||
|
||||
def refresh_transmission_data(self):
|
||||
""" Calls the throttled Transmission refresh method. """
|
||||
from transmissionrpc.error import TransmissionError
|
||||
|
||||
if _THROTTLED_REFRESH is not None:
|
||||
try:
|
||||
_THROTTLED_REFRESH()
|
||||
|
|
|
@ -8,8 +8,6 @@ at https://home-assistant.io/components/zwave/
|
|||
"""
|
||||
# pylint: disable=import-error
|
||||
from homeassistant.helpers.event import track_point_in_time
|
||||
from openzwave.network import ZWaveNetwork
|
||||
from pydispatch import dispatcher
|
||||
import datetime
|
||||
import homeassistant.util.dt as dt_util
|
||||
import homeassistant.components.zwave as zwave
|
||||
|
@ -79,6 +77,9 @@ class ZWaveSensor(Entity):
|
|||
""" Represents a Z-Wave sensor. """
|
||||
|
||||
def __init__(self, sensor_value):
|
||||
from openzwave.network import ZWaveNetwork
|
||||
from pydispatch import dispatcher
|
||||
|
||||
self._value = sensor_value
|
||||
self._node = sensor_value.node
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue