From 63d673461248d573730954851783f35166f5ff81 Mon Sep 17 00:00:00 2001 From: William Scanlon Date: Wed, 6 Dec 2017 01:07:59 -0500 Subject: [PATCH] Allow chime to work for wink siren/chime (#10961) * Allow Wink siren/chimes to work * Updated requirements_all.txt --- homeassistant/components/wink/__init__.py | 16 +++++++++------- requirements_all.txt | 2 +- 2 files changed, 10 insertions(+), 8 deletions(-) diff --git a/homeassistant/components/wink/__init__.py b/homeassistant/components/wink/__init__.py index 426893ec306..18e14b2e912 100644 --- a/homeassistant/components/wink/__init__.py +++ b/homeassistant/components/wink/__init__.py @@ -28,7 +28,7 @@ import homeassistant.helpers.config_validation as cv from homeassistant.config import load_yaml_config_file from homeassistant.util.json import load_json, save_json -REQUIREMENTS = ['python-wink==1.7.0', 'pubnubsub-handler==1.0.2'] +REQUIREMENTS = ['python-wink==1.7.1', 'pubnubsub-handler==1.0.2'] _LOGGER = logging.getLogger(__name__) @@ -460,10 +460,11 @@ def setup(hass, config): sirens_to_set.append(siren) for siren in sirens_to_set: + _man = siren.wink.device_manufacturer() if (service.service != SERVICE_SET_AUTO_SHUTOFF and service.service != SERVICE_ENABLE_SIREN and - siren.wink.device_manufacturer() != 'dome'): - _LOGGER.error("Service only valid for Dome sirens.") + (_man != 'dome' and _man != 'wink')): + _LOGGER.error("Service only valid for Dome or Wink sirens.") return if service.service == SERVICE_ENABLE_SIREN: @@ -494,10 +495,11 @@ def setup(hass, config): component = EntityComponent(_LOGGER, DOMAIN, hass) sirens = [] - has_dome_siren = False + has_dome_or_wink_siren = False for siren in pywink.get_sirens(): - if siren.device_manufacturer() == "dome": - has_dome_siren = True + _man = siren.device_manufacturer() + if _man == "dome" or _man == "wink": + has_dome_or_wink_siren = True _id = siren.object_id() + siren.name() if _id not in hass.data[DOMAIN]['unique_ids']: sirens.append(WinkSirenDevice(siren, hass)) @@ -514,7 +516,7 @@ def setup(hass, config): descriptions.get(SERVICE_ENABLE_SIREN), schema=ENABLED_SIREN_SCHEMA) - if has_dome_siren: + if has_dome_or_wink_siren: hass.services.register(DOMAIN, SERVICE_SET_SIREN_TONE, service_handle, diff --git a/requirements_all.txt b/requirements_all.txt index 3385c1f662a..8b78f254bd8 100644 --- a/requirements_all.txt +++ b/requirements_all.txt @@ -883,7 +883,7 @@ python-velbus==2.0.11 python-vlc==1.1.2 # homeassistant.components.wink -python-wink==1.7.0 +python-wink==1.7.1 # homeassistant.components.sensor.swiss_public_transport python_opendata_transport==0.0.3