Merge pull request #631 from balloob/gen-requirements_all
Allow generating requirements_all.txt
This commit is contained in:
commit
d25f58e650
18 changed files with 298 additions and 209 deletions
|
@ -1,4 +1,4 @@
|
||||||
include README.md
|
include README.rst
|
||||||
include LICENSE
|
include LICENSE
|
||||||
graft homeassistant
|
graft homeassistant
|
||||||
prune homeassistant/components/frontend/www_static/home-assistant-polymer
|
prune homeassistant/components/frontend/www_static/home-assistant-polymer
|
||||||
|
|
|
@ -8,9 +8,7 @@ https://home-assistant.io/components/light.blinksticklight/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
from blinkstick import blinkstick
|
from homeassistant.components.light import Light, ATTR_RGB_COLOR
|
||||||
|
|
||||||
from homeassistant.components.light import (Light, ATTR_RGB_COLOR)
|
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
@ -22,6 +20,8 @@ DEPENDENCIES = []
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
""" Add device specified by serial number. """
|
""" Add device specified by serial number. """
|
||||||
|
from blinkstick import blinkstick
|
||||||
|
|
||||||
stick = blinkstick.find_by_serial(config['serial'])
|
stick = blinkstick.find_by_serial(config['serial'])
|
||||||
|
|
||||||
add_devices_callback([BlinkStickLight(stick, config['name'])])
|
add_devices_callback([BlinkStickLight(stick, config['name'])])
|
||||||
|
|
|
@ -8,7 +8,6 @@ https://home-assistant.io/components/light.rfxtrx/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import homeassistant.components.rfxtrx as rfxtrx
|
import homeassistant.components.rfxtrx as rfxtrx
|
||||||
import RFXtrx as rfxtrxmod
|
|
||||||
|
|
||||||
from homeassistant.components.light import Light
|
from homeassistant.components.light import Light
|
||||||
from homeassistant.util import slugify
|
from homeassistant.util import slugify
|
||||||
|
@ -20,6 +19,8 @@ _LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
""" Setup the RFXtrx platform. """
|
""" Setup the RFXtrx platform. """
|
||||||
|
import RFXtrx as rfxtrxmod
|
||||||
|
|
||||||
lights = []
|
lights = []
|
||||||
devices = config.get('devices', None)
|
devices = config.get('devices', None)
|
||||||
if devices:
|
if devices:
|
||||||
|
|
|
@ -6,13 +6,9 @@ Support for Tellstick lights.
|
||||||
For more details about this platform, please refer to the documentation at
|
For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/light.tellstick/
|
https://home-assistant.io/components/light.tellstick/
|
||||||
"""
|
"""
|
||||||
import logging
|
|
||||||
# pylint: disable=no-name-in-module, import-error
|
|
||||||
from homeassistant.components.light import Light, ATTR_BRIGHTNESS
|
from homeassistant.components.light import Light, ATTR_BRIGHTNESS
|
||||||
from homeassistant.const import (EVENT_HOMEASSISTANT_STOP,
|
from homeassistant.const import (EVENT_HOMEASSISTANT_STOP,
|
||||||
ATTR_FRIENDLY_NAME)
|
ATTR_FRIENDLY_NAME)
|
||||||
import tellcore.constants as tellcore_constants
|
|
||||||
from tellcore.library import DirectCallbackDispatcher
|
|
||||||
REQUIREMENTS = ['tellcore-py==1.1.2']
|
REQUIREMENTS = ['tellcore-py==1.1.2']
|
||||||
|
|
||||||
|
|
||||||
|
@ -20,12 +16,9 @@ REQUIREMENTS = ['tellcore-py==1.1.2']
|
||||||
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
""" Find and return Tellstick lights. """
|
""" Find and return Tellstick lights. """
|
||||||
|
|
||||||
try:
|
|
||||||
import tellcore.telldus as telldus
|
import tellcore.telldus as telldus
|
||||||
except ImportError:
|
from tellcore.library import DirectCallbackDispatcher
|
||||||
logging.getLogger(__name__).exception(
|
import tellcore.constants as tellcore_constants
|
||||||
"Failed to import tellcore")
|
|
||||||
return []
|
|
||||||
|
|
||||||
core = telldus.TelldusCore(callback_dispatcher=DirectCallbackDispatcher())
|
core = telldus.TelldusCore(callback_dispatcher=DirectCallbackDispatcher())
|
||||||
|
|
||||||
|
@ -58,17 +51,20 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
|
|
||||||
class TellstickLight(Light):
|
class TellstickLight(Light):
|
||||||
""" Represents a Tellstick light. """
|
""" Represents a Tellstick light. """
|
||||||
last_sent_command_mask = (tellcore_constants.TELLSTICK_TURNON |
|
|
||||||
|
def __init__(self, tellstick_device):
|
||||||
|
import tellcore.constants as tellcore_constants
|
||||||
|
|
||||||
|
self.tellstick_device = tellstick_device
|
||||||
|
self.state_attr = {ATTR_FRIENDLY_NAME: tellstick_device.name}
|
||||||
|
self._brightness = 0
|
||||||
|
|
||||||
|
self.last_sent_command_mask = (tellcore_constants.TELLSTICK_TURNON |
|
||||||
tellcore_constants.TELLSTICK_TURNOFF |
|
tellcore_constants.TELLSTICK_TURNOFF |
|
||||||
tellcore_constants.TELLSTICK_DIM |
|
tellcore_constants.TELLSTICK_DIM |
|
||||||
tellcore_constants.TELLSTICK_UP |
|
tellcore_constants.TELLSTICK_UP |
|
||||||
tellcore_constants.TELLSTICK_DOWN)
|
tellcore_constants.TELLSTICK_DOWN)
|
||||||
|
|
||||||
def __init__(self, tellstick_device):
|
|
||||||
self.tellstick_device = tellstick_device
|
|
||||||
self.state_attr = {ATTR_FRIENDLY_NAME: tellstick_device.name}
|
|
||||||
self._brightness = 0
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def name(self):
|
def name(self):
|
||||||
""" Returns the name of the switch if any. """
|
""" Returns the name of the switch if any. """
|
||||||
|
@ -104,6 +100,8 @@ class TellstickLight(Light):
|
||||||
|
|
||||||
def update(self):
|
def update(self):
|
||||||
""" Update state of the light. """
|
""" Update state of the light. """
|
||||||
|
import tellcore.constants as tellcore_constants
|
||||||
|
|
||||||
last_command = self.tellstick_device.last_sent_command(
|
last_command = self.tellstick_device.last_sent_command(
|
||||||
self.last_sent_command_mask)
|
self.last_sent_command_mask)
|
||||||
|
|
||||||
|
|
|
@ -7,9 +7,6 @@ For more details about this platform, please refer to the documentation at
|
||||||
https://home-assistant.io/components/light.zwave/
|
https://home-assistant.io/components/light.zwave/
|
||||||
"""
|
"""
|
||||||
# pylint: disable=import-error
|
# pylint: disable=import-error
|
||||||
from openzwave.network import ZWaveNetwork
|
|
||||||
from pydispatch import dispatcher
|
|
||||||
|
|
||||||
import homeassistant.components.zwave as zwave
|
import homeassistant.components.zwave as zwave
|
||||||
|
|
||||||
from homeassistant.const import STATE_ON, STATE_OFF
|
from homeassistant.const import STATE_ON, STATE_OFF
|
||||||
|
@ -51,6 +48,9 @@ class ZwaveDimmer(Light):
|
||||||
""" Provides a Z-Wave dimmer. """
|
""" Provides a Z-Wave dimmer. """
|
||||||
# pylint: disable=too-many-arguments
|
# pylint: disable=too-many-arguments
|
||||||
def __init__(self, value):
|
def __init__(self, value):
|
||||||
|
from openzwave.network import ZWaveNetwork
|
||||||
|
from pydispatch import dispatcher
|
||||||
|
|
||||||
self._value = value
|
self._value = value
|
||||||
self._node = value.node
|
self._node = value.node
|
||||||
|
|
||||||
|
|
|
@ -11,7 +11,6 @@ from collections import OrderedDict
|
||||||
|
|
||||||
from homeassistant.const import (TEMP_CELCIUS)
|
from homeassistant.const import (TEMP_CELCIUS)
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
from RFXtrx import SensorEvent
|
|
||||||
import homeassistant.components.rfxtrx as rfxtrx
|
import homeassistant.components.rfxtrx as rfxtrx
|
||||||
from homeassistant.util import slugify
|
from homeassistant.util import slugify
|
||||||
|
|
||||||
|
@ -28,6 +27,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
""" Setup the RFXtrx platform. """
|
""" Setup the RFXtrx platform. """
|
||||||
|
from RFXtrx import SensorEvent
|
||||||
|
|
||||||
def sensor_update(event):
|
def sensor_update(event):
|
||||||
""" Callback for sensor updates from the RFXtrx gateway. """
|
""" Callback for sensor updates from the RFXtrx gateway. """
|
||||||
|
|
|
@ -9,9 +9,6 @@ https://home-assistant.io/components/sensor.tellstick/
|
||||||
import logging
|
import logging
|
||||||
from collections import namedtuple
|
from collections import namedtuple
|
||||||
|
|
||||||
import tellcore.telldus as telldus
|
|
||||||
import tellcore.constants as tellcore_constants
|
|
||||||
|
|
||||||
from homeassistant.const import TEMP_CELCIUS
|
from homeassistant.const import TEMP_CELCIUS
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
import homeassistant.util as util
|
import homeassistant.util as util
|
||||||
|
@ -24,6 +21,9 @@ REQUIREMENTS = ['tellcore-py==1.1.2']
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
""" Sets up Tellstick sensors. """
|
""" Sets up Tellstick sensors. """
|
||||||
|
import tellcore.telldus as telldus
|
||||||
|
import tellcore.constants as tellcore_constants
|
||||||
|
|
||||||
sensor_value_descriptions = {
|
sensor_value_descriptions = {
|
||||||
tellcore_constants.TELLSTICK_TEMPERATURE:
|
tellcore_constants.TELLSTICK_TEMPERATURE:
|
||||||
DatatypeDescription(
|
DatatypeDescription(
|
||||||
|
|
|
@ -11,10 +11,6 @@ from datetime import timedelta
|
||||||
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
||||||
|
|
||||||
from homeassistant.helpers.entity import Entity
|
from homeassistant.helpers.entity import Entity
|
||||||
# pylint: disable=no-name-in-module, import-error
|
|
||||||
import transmissionrpc
|
|
||||||
|
|
||||||
from transmissionrpc.error import TransmissionError
|
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
|
@ -33,6 +29,9 @@ _THROTTLED_REFRESH = None
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
def setup_platform(hass, config, add_devices, discovery_info=None):
|
def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
""" Sets up the Transmission sensors. """
|
""" Sets up the Transmission sensors. """
|
||||||
|
import transmissionrpc
|
||||||
|
from transmissionrpc.error import TransmissionError
|
||||||
|
|
||||||
host = config.get(CONF_HOST)
|
host = config.get(CONF_HOST)
|
||||||
username = config.get(CONF_USERNAME, None)
|
username = config.get(CONF_USERNAME, None)
|
||||||
password = config.get(CONF_PASSWORD, None)
|
password = config.get(CONF_PASSWORD, None)
|
||||||
|
@ -97,6 +96,8 @@ class TransmissionSensor(Entity):
|
||||||
|
|
||||||
def refresh_transmission_data(self):
|
def refresh_transmission_data(self):
|
||||||
""" Calls the throttled Transmission refresh method. """
|
""" Calls the throttled Transmission refresh method. """
|
||||||
|
from transmissionrpc.error import TransmissionError
|
||||||
|
|
||||||
if _THROTTLED_REFRESH is not None:
|
if _THROTTLED_REFRESH is not None:
|
||||||
try:
|
try:
|
||||||
_THROTTLED_REFRESH()
|
_THROTTLED_REFRESH()
|
||||||
|
|
|
@ -15,9 +15,9 @@ from homeassistant.const import (
|
||||||
ATTR_BATTERY_LEVEL, ATTR_TRIPPED, ATTR_ARMED, ATTR_LAST_TRIP_TIME,
|
ATTR_BATTERY_LEVEL, ATTR_TRIPPED, ATTR_ARMED, ATTR_LAST_TRIP_TIME,
|
||||||
TEMP_CELCIUS, TEMP_FAHRENHEIT)
|
TEMP_CELCIUS, TEMP_FAHRENHEIT)
|
||||||
|
|
||||||
REQUIREMENTS = ['https://github.com/balloob/home-assistant-vera-api/archive/'
|
REQUIREMENTS = ['https://github.com/pavoni/home-assistant-vera-api/archive/'
|
||||||
'a8f823066ead6c7da6fb5e7abaf16fef62e63364.zip'
|
'efdba4e63d58a30bc9b36d9e01e69858af9130b8.zip'
|
||||||
'#python-vera==0.1']
|
'#python-vera==0.1.1']
|
||||||
|
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
|
@ -8,8 +8,6 @@ at https://home-assistant.io/components/zwave/
|
||||||
"""
|
"""
|
||||||
# pylint: disable=import-error
|
# pylint: disable=import-error
|
||||||
from homeassistant.helpers.event import track_point_in_time
|
from homeassistant.helpers.event import track_point_in_time
|
||||||
from openzwave.network import ZWaveNetwork
|
|
||||||
from pydispatch import dispatcher
|
|
||||||
import datetime
|
import datetime
|
||||||
import homeassistant.util.dt as dt_util
|
import homeassistant.util.dt as dt_util
|
||||||
import homeassistant.components.zwave as zwave
|
import homeassistant.components.zwave as zwave
|
||||||
|
@ -79,6 +77,9 @@ class ZWaveSensor(Entity):
|
||||||
""" Represents a Z-Wave sensor. """
|
""" Represents a Z-Wave sensor. """
|
||||||
|
|
||||||
def __init__(self, sensor_value):
|
def __init__(self, sensor_value):
|
||||||
|
from openzwave.network import ZWaveNetwork
|
||||||
|
from pydispatch import dispatcher
|
||||||
|
|
||||||
self._value = sensor_value
|
self._value = sensor_value
|
||||||
self._node = sensor_value.node
|
self._node = sensor_value.node
|
||||||
|
|
||||||
|
|
|
@ -11,12 +11,6 @@ from homeassistant.const import STATE_ON, STATE_OFF
|
||||||
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
try:
|
|
||||||
import hikvision.api
|
|
||||||
from hikvision.error import HikvisionError, MissingParamError
|
|
||||||
except ImportError:
|
|
||||||
hikvision.api = None
|
|
||||||
|
|
||||||
_LOGGING = logging.getLogger(__name__)
|
_LOGGING = logging.getLogger(__name__)
|
||||||
REQUIREMENTS = ['hikvision==0.4']
|
REQUIREMENTS = ['hikvision==0.4']
|
||||||
# pylint: disable=too-many-arguments
|
# pylint: disable=too-many-arguments
|
||||||
|
@ -25,6 +19,8 @@ REQUIREMENTS = ['hikvision==0.4']
|
||||||
|
|
||||||
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
""" Setup Hikvision camera. """
|
""" Setup Hikvision camera. """
|
||||||
|
import hikvision.api
|
||||||
|
from hikvision.error import HikvisionError, MissingParamError
|
||||||
|
|
||||||
host = config.get(CONF_HOST, None)
|
host = config.get(CONF_HOST, None)
|
||||||
port = config.get('port', "80")
|
port = config.get('port', "80")
|
||||||
|
@ -32,13 +28,6 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
username = config.get(CONF_USERNAME, "admin")
|
username = config.get(CONF_USERNAME, "admin")
|
||||||
password = config.get(CONF_PASSWORD, "12345")
|
password = config.get(CONF_PASSWORD, "12345")
|
||||||
|
|
||||||
if hikvision.api is None:
|
|
||||||
_LOGGING.error((
|
|
||||||
"Failed to import hikvision. Did you maybe not install the "
|
|
||||||
"'hikvision' dependency?"))
|
|
||||||
|
|
||||||
return False
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
hikvision_cam = hikvision.api.CreateDevice(
|
hikvision_cam = hikvision.api.CreateDevice(
|
||||||
host, port=port, username=username,
|
host, port=port, username=username,
|
||||||
|
|
|
@ -10,8 +10,6 @@ import logging
|
||||||
|
|
||||||
from homeassistant.components.switch import SwitchDevice
|
from homeassistant.components.switch import SwitchDevice
|
||||||
|
|
||||||
from orvibo.s20 import S20, S20Exception
|
|
||||||
|
|
||||||
DEFAULT_NAME = "Orvibo S20 Switch"
|
DEFAULT_NAME = "Orvibo S20 Switch"
|
||||||
REQUIREMENTS = ['orvibo==1.0.0']
|
REQUIREMENTS = ['orvibo==1.0.0']
|
||||||
_LOGGER = logging.getLogger(__name__)
|
_LOGGER = logging.getLogger(__name__)
|
||||||
|
@ -20,6 +18,8 @@ _LOGGER = logging.getLogger(__name__)
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
""" Find and return S20 switches. """
|
""" Find and return S20 switches. """
|
||||||
|
from orvibo.s20 import S20, S20Exception
|
||||||
|
|
||||||
if config.get('host') is None:
|
if config.get('host') is None:
|
||||||
_LOGGER.error("Missing required variable: host")
|
_LOGGER.error("Missing required variable: host")
|
||||||
return
|
return
|
||||||
|
@ -34,9 +34,12 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
class S20Switch(SwitchDevice):
|
class S20Switch(SwitchDevice):
|
||||||
""" Represents an S20 switch. """
|
""" Represents an S20 switch. """
|
||||||
def __init__(self, name, s20):
|
def __init__(self, name, s20):
|
||||||
|
from orvibo.s20 import S20Exception
|
||||||
|
|
||||||
self._name = name
|
self._name = name
|
||||||
self._s20 = s20
|
self._s20 = s20
|
||||||
self._state = False
|
self._state = False
|
||||||
|
self._exc = S20Exception
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def should_poll(self):
|
def should_poll(self):
|
||||||
|
@ -57,19 +60,19 @@ class S20Switch(SwitchDevice):
|
||||||
""" Update device state. """
|
""" Update device state. """
|
||||||
try:
|
try:
|
||||||
self._state = self._s20.on
|
self._state = self._s20.on
|
||||||
except S20Exception:
|
except self._exc:
|
||||||
_LOGGER.exception("Error while fetching S20 state")
|
_LOGGER.exception("Error while fetching S20 state")
|
||||||
|
|
||||||
def turn_on(self, **kwargs):
|
def turn_on(self, **kwargs):
|
||||||
""" Turn the device on. """
|
""" Turn the device on. """
|
||||||
try:
|
try:
|
||||||
self._s20.on = True
|
self._s20.on = True
|
||||||
except S20Exception:
|
except self._exc:
|
||||||
_LOGGER.exception("Error while turning on S20")
|
_LOGGER.exception("Error while turning on S20")
|
||||||
|
|
||||||
def turn_off(self, **kwargs):
|
def turn_off(self, **kwargs):
|
||||||
""" Turn the device off. """
|
""" Turn the device off. """
|
||||||
try:
|
try:
|
||||||
self._s20.on = False
|
self._s20.on = False
|
||||||
except S20Exception:
|
except self._exc:
|
||||||
_LOGGER.exception("Error while turning off S20")
|
_LOGGER.exception("Error while turning off S20")
|
||||||
|
|
|
@ -8,7 +8,6 @@ https://home-assistant.io/components/switch.rfxtrx/
|
||||||
"""
|
"""
|
||||||
import logging
|
import logging
|
||||||
import homeassistant.components.rfxtrx as rfxtrx
|
import homeassistant.components.rfxtrx as rfxtrx
|
||||||
from RFXtrx import LightingDevice
|
|
||||||
|
|
||||||
from homeassistant.components.switch import SwitchDevice
|
from homeassistant.components.switch import SwitchDevice
|
||||||
from homeassistant.util import slugify
|
from homeassistant.util import slugify
|
||||||
|
@ -20,6 +19,7 @@ _LOGGER = logging.getLogger(__name__)
|
||||||
|
|
||||||
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
""" Setup the RFXtrx platform. """
|
""" Setup the RFXtrx platform. """
|
||||||
|
from RFXtrx import LightingDevice
|
||||||
|
|
||||||
# Add switch from config file
|
# Add switch from config file
|
||||||
switchs = []
|
switchs = []
|
||||||
|
|
|
@ -11,8 +11,6 @@ import logging
|
||||||
from homeassistant.const import (EVENT_HOMEASSISTANT_STOP,
|
from homeassistant.const import (EVENT_HOMEASSISTANT_STOP,
|
||||||
ATTR_FRIENDLY_NAME)
|
ATTR_FRIENDLY_NAME)
|
||||||
from homeassistant.helpers.entity import ToggleEntity
|
from homeassistant.helpers.entity import ToggleEntity
|
||||||
import tellcore.constants as tellcore_constants
|
|
||||||
from tellcore.library import DirectCallbackDispatcher
|
|
||||||
|
|
||||||
SIGNAL_REPETITIONS = 1
|
SIGNAL_REPETITIONS = 1
|
||||||
REQUIREMENTS = ['tellcore-py==1.1.2']
|
REQUIREMENTS = ['tellcore-py==1.1.2']
|
||||||
|
@ -22,11 +20,9 @@ _LOGGER = logging.getLogger(__name__)
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
""" Find and return Tellstick switches. """
|
""" Find and return Tellstick switches. """
|
||||||
try:
|
|
||||||
import tellcore.telldus as telldus
|
import tellcore.telldus as telldus
|
||||||
except ImportError:
|
import tellcore.constants as tellcore_constants
|
||||||
_LOGGER.exception("Failed to import tellcore")
|
from tellcore.library import DirectCallbackDispatcher
|
||||||
return
|
|
||||||
|
|
||||||
core = telldus.TelldusCore(callback_dispatcher=DirectCallbackDispatcher())
|
core = telldus.TelldusCore(callback_dispatcher=DirectCallbackDispatcher())
|
||||||
|
|
||||||
|
@ -62,14 +58,17 @@ def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
|
|
||||||
class TellstickSwitchDevice(ToggleEntity):
|
class TellstickSwitchDevice(ToggleEntity):
|
||||||
""" Represents a Tellstick switch. """
|
""" Represents a Tellstick switch. """
|
||||||
last_sent_command_mask = (tellcore_constants.TELLSTICK_TURNON |
|
|
||||||
tellcore_constants.TELLSTICK_TURNOFF)
|
|
||||||
|
|
||||||
def __init__(self, tellstick_device, signal_repetitions):
|
def __init__(self, tellstick_device, signal_repetitions):
|
||||||
|
import tellcore.constants as tellcore_constants
|
||||||
|
|
||||||
self.tellstick_device = tellstick_device
|
self.tellstick_device = tellstick_device
|
||||||
self.state_attr = {ATTR_FRIENDLY_NAME: tellstick_device.name}
|
self.state_attr = {ATTR_FRIENDLY_NAME: tellstick_device.name}
|
||||||
self.signal_repetitions = signal_repetitions
|
self.signal_repetitions = signal_repetitions
|
||||||
|
|
||||||
|
self.last_sent_command_mask = (tellcore_constants.TELLSTICK_TURNON |
|
||||||
|
tellcore_constants.TELLSTICK_TURNOFF)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def should_poll(self):
|
def should_poll(self):
|
||||||
""" Tells Home Assistant not to poll this entity. """
|
""" Tells Home Assistant not to poll this entity. """
|
||||||
|
@ -88,6 +87,8 @@ class TellstickSwitchDevice(ToggleEntity):
|
||||||
@property
|
@property
|
||||||
def is_on(self):
|
def is_on(self):
|
||||||
""" True if switch is on. """
|
""" True if switch is on. """
|
||||||
|
import tellcore.constants as tellcore_constants
|
||||||
|
|
||||||
last_command = self.tellstick_device.last_sent_command(
|
last_command = self.tellstick_device.last_sent_command(
|
||||||
self.last_sent_command_mask)
|
self.last_sent_command_mask)
|
||||||
|
|
||||||
|
|
|
@ -10,9 +10,6 @@ from homeassistant.const import CONF_HOST, CONF_USERNAME, CONF_PASSWORD
|
||||||
from homeassistant.const import STATE_ON, STATE_OFF
|
from homeassistant.const import STATE_ON, STATE_OFF
|
||||||
|
|
||||||
from homeassistant.helpers.entity import ToggleEntity
|
from homeassistant.helpers.entity import ToggleEntity
|
||||||
# pylint: disable=no-name-in-module, import-error
|
|
||||||
import transmissionrpc
|
|
||||||
from transmissionrpc.error import TransmissionError
|
|
||||||
import logging
|
import logging
|
||||||
|
|
||||||
_LOGGING = logging.getLogger(__name__)
|
_LOGGING = logging.getLogger(__name__)
|
||||||
|
@ -22,6 +19,9 @@ REQUIREMENTS = ['transmissionrpc==0.11']
|
||||||
# pylint: disable=unused-argument
|
# pylint: disable=unused-argument
|
||||||
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
def setup_platform(hass, config, add_devices_callback, discovery_info=None):
|
||||||
""" Sets up the transmission sensor. """
|
""" Sets up the transmission sensor. """
|
||||||
|
import transmissionrpc
|
||||||
|
from transmissionrpc.error import TransmissionError
|
||||||
|
|
||||||
host = config.get(CONF_HOST)
|
host = config.get(CONF_HOST)
|
||||||
username = config.get(CONF_USERNAME, None)
|
username = config.get(CONF_USERNAME, None)
|
||||||
password = config.get(CONF_PASSWORD, None)
|
password = config.get(CONF_PASSWORD, None)
|
||||||
|
|
|
@ -5,8 +5,6 @@ homeassistant.components.switch.zwave
|
||||||
Zwave platform that handles simple binary switches.
|
Zwave platform that handles simple binary switches.
|
||||||
"""
|
"""
|
||||||
# pylint: disable=import-error
|
# pylint: disable=import-error
|
||||||
from openzwave.network import ZWaveNetwork
|
|
||||||
from pydispatch import dispatcher
|
|
||||||
|
|
||||||
import homeassistant.components.zwave as zwave
|
import homeassistant.components.zwave as zwave
|
||||||
|
|
||||||
|
@ -36,11 +34,13 @@ def setup_platform(hass, config, add_devices, discovery_info=None):
|
||||||
class ZwaveSwitch(SwitchDevice):
|
class ZwaveSwitch(SwitchDevice):
|
||||||
""" Provides a zwave switch. """
|
""" Provides a zwave switch. """
|
||||||
def __init__(self, value):
|
def __init__(self, value):
|
||||||
|
from openzwave.network import ZWaveNetwork
|
||||||
|
from pydispatch import dispatcher
|
||||||
|
|
||||||
self._value = value
|
self._value = value
|
||||||
self._node = value.node
|
self._node = value.node
|
||||||
|
|
||||||
self._state = value.data
|
self._state = value.data
|
||||||
|
|
||||||
dispatcher.connect(
|
dispatcher.connect(
|
||||||
self._value_changed, ZWaveNetwork.SIGNAL_VALUE_CHANGED)
|
self._value_changed, ZWaveNetwork.SIGNAL_VALUE_CHANGED)
|
||||||
|
|
||||||
|
|
|
@ -1,161 +1,166 @@
|
||||||
# Required for Home Assistant core
|
# Home Assistant core
|
||||||
requests>=2,<3
|
requests>=2,<3
|
||||||
pyyaml>=3.11,<4
|
pyyaml>=3.11,<4
|
||||||
pytz>=2015.4
|
pytz>=2015.4
|
||||||
pip>=7.0.0
|
pip>=7.0.0
|
||||||
vincenty==0.1.3
|
vincenty==0.1.3
|
||||||
|
|
||||||
# Optional, needed for specific components
|
# homeassistant.components.arduino
|
||||||
|
|
||||||
# Sun (sun)
|
|
||||||
astral==0.8.1
|
|
||||||
|
|
||||||
# Philips Hue (lights.hue)
|
|
||||||
phue==0.8
|
|
||||||
|
|
||||||
# Limitlessled/Easybulb/Milight (lights.limitlessled)
|
|
||||||
ledcontroller==1.1.0
|
|
||||||
|
|
||||||
# Chromecast (media_player.cast)
|
|
||||||
pychromecast==0.6.12
|
|
||||||
|
|
||||||
# Keyboard (keyboard)
|
|
||||||
pyuserinput==0.1.9
|
|
||||||
|
|
||||||
# Tellstick (*.tellstick)
|
|
||||||
tellcore-py==1.1.2
|
|
||||||
|
|
||||||
# Nmap (device_tracker.nmap)
|
|
||||||
python-nmap==0.4.3
|
|
||||||
|
|
||||||
# PushBullet (notify.pushbullet)
|
|
||||||
pushbullet.py==0.9.0
|
|
||||||
|
|
||||||
# Nest Thermostat (thermostat.nest)
|
|
||||||
python-nest==2.6.0
|
|
||||||
|
|
||||||
# Z-Wave (*.zwave)
|
|
||||||
pydispatcher==2.0.5
|
|
||||||
|
|
||||||
# ISY994 (isy994)
|
|
||||||
PyISY==1.0.5
|
|
||||||
|
|
||||||
# PSutil (sensor.systemmonitor)
|
|
||||||
psutil==3.2.2
|
|
||||||
|
|
||||||
# Pushover (notify.pushover)
|
|
||||||
python-pushover==0.2
|
|
||||||
|
|
||||||
# Transmission Torrent Client (*.transmission)
|
|
||||||
transmissionrpc==0.11
|
|
||||||
|
|
||||||
# OpenWeatherMap (sensor.openweathermap)
|
|
||||||
pyowm==2.2.1
|
|
||||||
|
|
||||||
# XMPP (notify.xmpp)
|
|
||||||
sleekxmpp==1.3.1
|
|
||||||
dnspython3==1.12.0
|
|
||||||
|
|
||||||
# Blockchain (sensor.bitcoin)
|
|
||||||
blockchain==1.1.2
|
|
||||||
|
|
||||||
# Music Player Daemon (media_player.mpd)
|
|
||||||
python-mpd2==0.5.4
|
|
||||||
|
|
||||||
# Hikvision (switch.hikvisioncam)
|
|
||||||
hikvision==0.4
|
|
||||||
|
|
||||||
# Console log coloring
|
|
||||||
colorlog==2.6.0
|
|
||||||
|
|
||||||
# JSON-RPC interface (media_player.kodi)
|
|
||||||
jsonrpc-requests==0.1
|
|
||||||
|
|
||||||
# Forecast.io (sensor.forecast)
|
|
||||||
python-forecastio==1.3.3
|
|
||||||
|
|
||||||
# Firmata (*.arduino)
|
|
||||||
PyMata==2.07a
|
PyMata==2.07a
|
||||||
|
|
||||||
# Rfxtrx (rfxtrx)
|
# homeassistant.components.device_tracker.netgear
|
||||||
https://github.com/Danielhiversen/pyRFXtrx/archive/ec7a1aaddf8270db6e5da1c13d58c1547effd7cf.zip#RFXtrx==0.15
|
|
||||||
|
|
||||||
# Mysensors (sensor.mysensors)
|
|
||||||
https://github.com/theolind/pymysensors/archive/d4b809c2167650691058d1e29bfd2c4b1792b4b0.zip#pymysensors==0.3
|
|
||||||
|
|
||||||
# Netgear (device_tracker.netgear)
|
|
||||||
pynetgear==0.3
|
pynetgear==0.3
|
||||||
|
|
||||||
# Netdisco (discovery)
|
# homeassistant.components.device_tracker.nmap_tracker
|
||||||
netdisco==0.5.1
|
python-nmap==0.4.3
|
||||||
|
|
||||||
# Wemo (switch.wemo)
|
# homeassistant.components.device_tracker.snmp
|
||||||
pywemo==0.3.2
|
|
||||||
|
|
||||||
# Wink (*.wink)
|
|
||||||
https://github.com/balloob/python-wink/archive/9eb39eaba0717922815e673ad1114c685839d890.zip#python-wink==0.1.1
|
|
||||||
|
|
||||||
# Slack notifier (notify.slack)
|
|
||||||
slacker==0.6.8
|
|
||||||
|
|
||||||
# Temper sensors (sensor.temper)
|
|
||||||
https://github.com/rkabadi/temper-python/archive/3dbdaf2d87b8db9a3cd6e5585fc704537dd2d09b.zip#temperusb==1.2.3
|
|
||||||
|
|
||||||
# PyEdimax (switch.edimax)
|
|
||||||
https://github.com/rkabadi/pyedimax/archive/365301ce3ff26129a7910c501ead09ea625f3700.zip#pyedimax==0.1
|
|
||||||
|
|
||||||
# RPI-GPIO platform (*.rpi_gpio)
|
|
||||||
# Uncomment for Raspberry Pi
|
|
||||||
# RPi.GPIO==0.5.11
|
|
||||||
|
|
||||||
# Adafruit temperature/humidity sensor (sensor.dht)
|
|
||||||
# Uncomment on a Raspberry Pi / Beaglebone
|
|
||||||
# http://github.com/mala-zaba/Adafruit_Python_DHT/archive/4101340de8d2457dd194bca1e8d11cbfc237e919.zip#Adafruit_DHT==1.1.0
|
|
||||||
|
|
||||||
# PAHO MQTT (mqtt)
|
|
||||||
paho-mqtt==1.1
|
|
||||||
|
|
||||||
# PyModbus (modbus)
|
|
||||||
https://github.com/bashwork/pymodbus/archive/d7fc4f1cc975631e0a9011390e8017f64b612661.zip#pymodbus==1.2.0
|
|
||||||
|
|
||||||
# Verisure (verisure)
|
|
||||||
https://github.com/persandstrom/python-verisure/archive/9873c4527f01b1ba1f72ae60f7f35854390d59be.zip#python-verisure==0.2.6
|
|
||||||
|
|
||||||
# IFTTT Maker Channel (ifttt)
|
|
||||||
pyfttt==0.3
|
|
||||||
|
|
||||||
# SABnzbd (sensor.sabnzbd)
|
|
||||||
https://github.com/balloob/home-assistant-nzb-clients/archive/616cad59154092599278661af17e2a9f2cf5e2a9.zip#python-sabnzbd==0.1
|
|
||||||
|
|
||||||
# Vera (*.vera)
|
|
||||||
https://github.com/pavoni/home-assistant-vera-api/archive/efdba4e63d58a30bc9b36d9e01e69858af9130b8.zip#python-vera==0.1.1
|
|
||||||
|
|
||||||
# Sonos (media_player.sonos)
|
|
||||||
SoCo==0.11.1
|
|
||||||
|
|
||||||
# PlexAPI (media_player.plex)
|
|
||||||
plexapi==1.1.0
|
|
||||||
|
|
||||||
# SNMP (device_tracker.snmp)
|
|
||||||
pysnmp==4.2.5
|
pysnmp==4.2.5
|
||||||
|
|
||||||
# Blinkstick (light.blinksticklight)
|
# homeassistant.components.discovery
|
||||||
|
netdisco==0.5.1
|
||||||
|
|
||||||
|
# homeassistant.components.ifttt
|
||||||
|
pyfttt==0.3
|
||||||
|
|
||||||
|
# homeassistant.components.isy994
|
||||||
|
PyISY==1.0.5
|
||||||
|
|
||||||
|
# homeassistant.components.keyboard
|
||||||
|
pyuserinput==0.1.9
|
||||||
|
|
||||||
|
# homeassistant.components.light.blinksticklight
|
||||||
blinkstick==1.1.7
|
blinkstick==1.1.7
|
||||||
|
|
||||||
# Telegram (notify.telegram)
|
# homeassistant.components.light.hue
|
||||||
python-telegram-bot==2.8.7
|
phue==0.8
|
||||||
|
|
||||||
# CPUinfo (sensor.cpuinfo)
|
# homeassistant.components.light.limitlessled
|
||||||
py-cpuinfo==0.1.6
|
ledcontroller==1.1.0
|
||||||
|
|
||||||
# Radio Thermostat (thermostat.radiotherm)
|
# homeassistant.components.light.tellstick
|
||||||
radiotherm==1.2
|
# homeassistant.components.sensor.tellstick
|
||||||
|
# homeassistant.components.switch.tellstick
|
||||||
|
tellcore-py==1.1.2
|
||||||
|
|
||||||
# Honeywell Evo Home Client (thermostat.honeywell)
|
# homeassistant.components.light.vera
|
||||||
evohomeclient==0.2.3
|
# homeassistant.components.sensor.vera
|
||||||
|
# homeassistant.components.switch.vera
|
||||||
|
https://github.com/pavoni/home-assistant-vera-api/archive/efdba4e63d58a30bc9b36d9e01e69858af9130b8.zip#python-vera==0.1.1
|
||||||
|
|
||||||
# Pushetta (notify.pushetta)
|
# homeassistant.components.wink
|
||||||
|
# homeassistant.components.light.wink
|
||||||
|
# homeassistant.components.sensor.wink
|
||||||
|
# homeassistant.components.switch.wink
|
||||||
|
https://github.com/balloob/python-wink/archive/9eb39eaba0717922815e673ad1114c685839d890.zip#python-wink==0.1.1
|
||||||
|
|
||||||
|
# homeassistant.components.media_player.cast
|
||||||
|
pychromecast==0.6.12
|
||||||
|
|
||||||
|
# homeassistant.components.media_player.kodi
|
||||||
|
jsonrpc-requests==0.1
|
||||||
|
|
||||||
|
# homeassistant.components.media_player.mpd
|
||||||
|
python-mpd2==0.5.4
|
||||||
|
|
||||||
|
# homeassistant.components.media_player.plex
|
||||||
|
plexapi==1.1.0
|
||||||
|
|
||||||
|
# homeassistant.components.media_player.sonos
|
||||||
|
SoCo==0.11.1
|
||||||
|
|
||||||
|
# homeassistant.components.modbus
|
||||||
|
https://github.com/bashwork/pymodbus/archive/d7fc4f1cc975631e0a9011390e8017f64b612661.zip#pymodbus==1.2.0
|
||||||
|
|
||||||
|
# homeassistant.components.mqtt
|
||||||
|
paho-mqtt==1.1
|
||||||
|
|
||||||
|
# homeassistant.components.notify.pushbullet
|
||||||
|
pushbullet.py==0.9.0
|
||||||
|
|
||||||
|
# homeassistant.components.notify.pushetta
|
||||||
pushetta==1.0.15
|
pushetta==1.0.15
|
||||||
|
|
||||||
# Orvibo S10
|
# homeassistant.components.notify.pushover
|
||||||
|
python-pushover==0.2
|
||||||
|
|
||||||
|
# homeassistant.components.notify.slack
|
||||||
|
slacker==0.6.8
|
||||||
|
|
||||||
|
# homeassistant.components.notify.telegram
|
||||||
|
python-telegram-bot==2.8.7
|
||||||
|
|
||||||
|
# homeassistant.components.notify.xmpp
|
||||||
|
sleekxmpp==1.3.1
|
||||||
|
|
||||||
|
# homeassistant.components.notify.xmpp
|
||||||
|
dnspython3==1.12.0
|
||||||
|
|
||||||
|
# homeassistant.components.rfxtrx
|
||||||
|
https://github.com/Danielhiversen/pyRFXtrx/archive/0.2.zip#RFXtrx==0.2
|
||||||
|
|
||||||
|
# homeassistant.components.sensor.bitcoin
|
||||||
|
blockchain==1.1.2
|
||||||
|
|
||||||
|
# homeassistant.components.sensor.cpuspeed
|
||||||
|
py-cpuinfo==0.1.6
|
||||||
|
|
||||||
|
# homeassistant.components.sensor.dht
|
||||||
|
# http://github.com/mala-zaba/Adafruit_Python_DHT/archive/4101340de8d2457dd194bca1e8d11cbfc237e919.zip#Adafruit_DHT==1.1.0
|
||||||
|
|
||||||
|
# homeassistant.components.sensor.forecast
|
||||||
|
python-forecastio==1.3.3
|
||||||
|
|
||||||
|
# homeassistant.components.sensor.mysensors
|
||||||
|
https://github.com/theolind/pymysensors/archive/d4b809c2167650691058d1e29bfd2c4b1792b4b0.zip#pymysensors==0.3
|
||||||
|
|
||||||
|
# homeassistant.components.sensor.openweathermap
|
||||||
|
pyowm==2.2.1
|
||||||
|
|
||||||
|
# homeassistant.components.sensor.rpi_gpio
|
||||||
|
# homeassistant.components.switch.rpi_gpio
|
||||||
|
# RPi.GPIO==0.5.11
|
||||||
|
|
||||||
|
# homeassistant.components.sensor.sabnzbd
|
||||||
|
https://github.com/jamespcole/home-assistant-nzb-clients/archive/616cad59154092599278661af17e2a9f2cf5e2a9.zip#python-sabnzbd==0.1
|
||||||
|
|
||||||
|
# homeassistant.components.sensor.systemmonitor
|
||||||
|
psutil==3.2.2
|
||||||
|
|
||||||
|
# homeassistant.components.sensor.temper
|
||||||
|
https://github.com/rkabadi/temper-python/archive/3dbdaf2d87b8db9a3cd6e5585fc704537dd2d09b.zip#temperusb==1.2.3
|
||||||
|
|
||||||
|
# homeassistant.components.sensor.transmission
|
||||||
|
# homeassistant.components.switch.transmission
|
||||||
|
transmissionrpc==0.11
|
||||||
|
|
||||||
|
# homeassistant.components.sun
|
||||||
|
astral==0.8.1
|
||||||
|
|
||||||
|
# homeassistant.components.switch.edimax
|
||||||
|
https://github.com/rkabadi/pyedimax/archive/365301ce3ff26129a7910c501ead09ea625f3700.zip#pyedimax==0.1
|
||||||
|
|
||||||
|
# homeassistant.components.switch.hikvisioncam
|
||||||
|
hikvision==0.4
|
||||||
|
|
||||||
|
# homeassistant.components.switch.orvibo
|
||||||
orvibo==1.0.0
|
orvibo==1.0.0
|
||||||
|
|
||||||
|
# homeassistant.components.switch.wemo
|
||||||
|
pywemo==0.3.2
|
||||||
|
|
||||||
|
# homeassistant.components.thermostat.honeywell
|
||||||
|
evohomeclient==0.2.3
|
||||||
|
|
||||||
|
# homeassistant.components.thermostat.nest
|
||||||
|
python-nest==2.6.0
|
||||||
|
|
||||||
|
# homeassistant.components.thermostat.radiotherm
|
||||||
|
radiotherm==1.2
|
||||||
|
|
||||||
|
# homeassistant.components.verisure
|
||||||
|
https://github.com/persandstrom/python-verisure/archive/9873c4527f01b1ba1f72ae60f7f35854390d59be.zip#python-verisure==0.2.6
|
||||||
|
|
||||||
|
# homeassistant.components.zwave
|
||||||
|
pydispatcher==2.0.5
|
||||||
|
|
||||||
|
|
90
script/gen_requirements_all.py
Executable file
90
script/gen_requirements_all.py
Executable file
|
@ -0,0 +1,90 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
"""
|
||||||
|
Generate an updated requirements_all.txt
|
||||||
|
"""
|
||||||
|
|
||||||
|
from collections import OrderedDict
|
||||||
|
import importlib
|
||||||
|
import os
|
||||||
|
import pkgutil
|
||||||
|
import re
|
||||||
|
|
||||||
|
COMMENT_REQUIREMENTS = [
|
||||||
|
'RPi.GPIO',
|
||||||
|
'Adafruit_Python_DHT'
|
||||||
|
]
|
||||||
|
|
||||||
|
|
||||||
|
def explore_module(package, explore_children):
|
||||||
|
module = importlib.import_module(package)
|
||||||
|
|
||||||
|
found = []
|
||||||
|
|
||||||
|
if not hasattr(module, '__path__'):
|
||||||
|
return found
|
||||||
|
|
||||||
|
for _, name, ispkg in pkgutil.iter_modules(module.__path__, package + '.'):
|
||||||
|
found.append(name)
|
||||||
|
|
||||||
|
if explore_children:
|
||||||
|
found.extend(explore_module(name, False))
|
||||||
|
|
||||||
|
return found
|
||||||
|
|
||||||
|
|
||||||
|
def core_requirements():
|
||||||
|
with open('setup.py') as inp:
|
||||||
|
reqs_raw = re.search(
|
||||||
|
r'REQUIRES = \[(.*?)\]', inp.read(), re.S).group(1)
|
||||||
|
|
||||||
|
return re.findall(r"'(.*?)'", reqs_raw)
|
||||||
|
|
||||||
|
|
||||||
|
def comment_requirement(req):
|
||||||
|
""" Some requirements don't install on all systems. """
|
||||||
|
return any(ign in req for ign in COMMENT_REQUIREMENTS)
|
||||||
|
|
||||||
|
|
||||||
|
def main():
|
||||||
|
if not os.path.isfile('requirements_all.txt'):
|
||||||
|
print('Run this from HA root dir')
|
||||||
|
return
|
||||||
|
|
||||||
|
reqs = OrderedDict()
|
||||||
|
|
||||||
|
errors = []
|
||||||
|
for package in sorted(explore_module('homeassistant.components', True)):
|
||||||
|
try:
|
||||||
|
module = importlib.import_module(package)
|
||||||
|
except ImportError:
|
||||||
|
errors.append(package)
|
||||||
|
continue
|
||||||
|
|
||||||
|
if not getattr(module, 'REQUIREMENTS', None):
|
||||||
|
continue
|
||||||
|
|
||||||
|
for req in module.REQUIREMENTS:
|
||||||
|
reqs.setdefault(req, []).append(package)
|
||||||
|
|
||||||
|
if errors:
|
||||||
|
print("Found errors")
|
||||||
|
print('\n'.join(errors))
|
||||||
|
return
|
||||||
|
|
||||||
|
print('# Home Assistant core')
|
||||||
|
print('\n'.join(core_requirements()))
|
||||||
|
print()
|
||||||
|
|
||||||
|
for pkg, requirements in reqs.items():
|
||||||
|
for req in sorted(requirements,
|
||||||
|
key=lambda name: (len(name.split('.')), name)):
|
||||||
|
print('#', req)
|
||||||
|
|
||||||
|
if comment_requirement(pkg):
|
||||||
|
print('#', pkg)
|
||||||
|
else:
|
||||||
|
print(pkg)
|
||||||
|
print()
|
||||||
|
|
||||||
|
if __name__ == '__main__':
|
||||||
|
main()
|
Loading…
Add table
Add a link
Reference in a new issue