From f7380dc9272605fb62c3ac41cde71af007df93b8 Mon Sep 17 00:00:00 2001 From: Pascal Vizeli Date: Thu, 30 Nov 2017 21:13:18 +0100 Subject: [PATCH] tellstick fix DEPENDENCIES and update tellcore-net (#10859) * Update requirements_all.txt * Update tellstick.py * Fix DEPENDENCIES * Update requirements_all.txt * fix format * fix lint * fix lint * Update tellstick.py * update tellcore-net * update tellcore-net * besser validate --- homeassistant/components/sensor/tellstick.py | 2 +- homeassistant/components/tellstick.py | 12 +++++++----- requirements_all.txt | 3 +-- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/sensor/tellstick.py b/homeassistant/components/sensor/tellstick.py index c9f922207e5..8355add47e9 100644 --- a/homeassistant/components/sensor/tellstick.py +++ b/homeassistant/components/sensor/tellstick.py @@ -14,7 +14,7 @@ from homeassistant.const import TEMP_CELSIUS from homeassistant.helpers.entity import Entity import homeassistant.helpers.config_validation as cv -REQUIREMENTS = ['tellcore-py==1.1.2'] +DEPENDENCIES = ['tellstick'] _LOGGER = logging.getLogger(__name__) diff --git a/homeassistant/components/tellstick.py b/homeassistant/components/tellstick.py index 91a7c0c69e5..bcef0d3fb85 100644 --- a/homeassistant/components/tellstick.py +++ b/homeassistant/components/tellstick.py @@ -17,7 +17,7 @@ from homeassistant.const import ( from homeassistant.helpers.entity import Entity import homeassistant.helpers.config_validation as cv -REQUIREMENTS = ['tellcore-py==1.1.2', 'tellcore-net==0.1'] +REQUIREMENTS = ['tellcore-py==1.1.2', 'tellcore-net==0.3'] _LOGGER = logging.getLogger(__name__) @@ -42,7 +42,8 @@ TELLCORE_REGISTRY = None CONFIG_SCHEMA = vol.Schema({ DOMAIN: vol.Schema({ vol.Inclusive(CONF_HOST, 'tellcore-net'): cv.string, - vol.Inclusive(CONF_PORT, 'tellcore-net'): cv.port, + vol.Inclusive(CONF_PORT, 'tellcore-net'): + vol.All(cv.ensure_list, [cv.port], vol.Length(min=2, max=2)), vol.Optional(CONF_SIGNAL_REPETITIONS, default=DEFAULT_SIGNAL_REPETITIONS): vol.Coerce(int), }), @@ -73,11 +74,12 @@ def setup(hass, config): conf = config.get(DOMAIN, {}) net_host = conf.get(CONF_HOST) - net_port = conf.get(CONF_PORT) + net_ports = conf.get(CONF_PORT) # Initialize remote tellcore client - if net_host and net_port: - net_client = TellCoreClient(net_host, net_port) + if net_host: + net_client = TellCoreClient( + host=net_host, port_client=net_ports[0], port_events=net_ports[1]) net_client.start() def stop_tellcore_net(event): diff --git a/requirements_all.txt b/requirements_all.txt index 35235df3b53..abc175279e2 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -1057,10 +1057,9 @@ tank_utility==1.4.0 tapsaff==0.1.3 # homeassistant.components.tellstick -tellcore-net==0.1 +tellcore-net==0.3 # homeassistant.components.tellstick -# homeassistant.components.sensor.tellstick tellcore-py==1.1.2 # homeassistant.components.tellduslive