From 710533ae8a51a789ec131ee3944f67e8c1d9cf99 Mon Sep 17 00:00:00 2001 From: William Scanlon Date: Tue, 15 May 2018 01:53:12 -0400 Subject: [PATCH] Minor Wink fixes (#14468) * Updated Wink light supported feature to reflect what features a given light support. * Fix typo in wink climate --- homeassistant/components/climate/wink.py | 2 +- homeassistant/components/light/wink.py | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/homeassistant/components/climate/wink.py b/homeassistant/components/climate/wink.py index 8c66567a4aa..c67e032c149 100644 --- a/homeassistant/components/climate/wink.py +++ b/homeassistant/components/climate/wink.py @@ -190,7 +190,7 @@ class WinkThermostat(WinkDevice, ClimateDevice): @property def cool_on(self): """Return whether or not the heat is actually heating.""" - return self.wink.heat_on() + return self.wink.cool_on() @property def current_operation(self): diff --git a/homeassistant/components/light/wink.py b/homeassistant/components/light/wink.py index 04e9c34b0f6..a2cc4fd7aeb 100644 --- a/homeassistant/components/light/wink.py +++ b/homeassistant/components/light/wink.py @@ -16,8 +16,6 @@ from homeassistant.util.color import \ DEPENDENCIES = ['wink'] -SUPPORT_WINK = SUPPORT_BRIGHTNESS | SUPPORT_COLOR_TEMP | SUPPORT_COLOR - def setup_platform(hass, config, add_devices, discovery_info=None): """Set up the Wink lights.""" @@ -78,7 +76,14 @@ class WinkLight(WinkDevice, Light): @property def supported_features(self): """Flag supported features.""" - return SUPPORT_WINK + supports = SUPPORT_BRIGHTNESS + if self.wink.supports_temperature(): + supports = supports | SUPPORT_COLOR_TEMP + if self.wink.supports_xy_color(): + supports = supports | SUPPORT_COLOR + elif self.wink.supports_hue_saturation(): + supports = supports | SUPPORT_COLOR + return supports def turn_on(self, **kwargs): """Turn the switch on."""