From ae2e6f9d2a30508b729ba595c7f08d911bbf3715 Mon Sep 17 00:00:00 2001 From: shred86 <32663154+shred86@users.noreply.github.com> Date: Sat, 7 Mar 2020 07:13:39 -0800 Subject: [PATCH] Fix unnecessary method call (#32549) --- homeassistant/components/abode/light.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/homeassistant/components/abode/light.py b/homeassistant/components/abode/light.py index 7602768a6e3..f15c10fc410 100644 --- a/homeassistant/components/abode/light.py +++ b/homeassistant/components/abode/light.py @@ -42,16 +42,19 @@ class AbodeLight(AbodeDevice, Light): self._device.set_color_temp( int(color_temperature_mired_to_kelvin(kwargs[ATTR_COLOR_TEMP])) ) + return if ATTR_HS_COLOR in kwargs and self._device.is_color_capable: self._device.set_color(kwargs[ATTR_HS_COLOR]) + return if ATTR_BRIGHTNESS in kwargs and self._device.is_dimmable: # Convert Home Assistant brightness (0-255) to Abode brightness (0-99) # If 100 is sent to Abode, response is 99 causing an error self._device.set_level(ceil(kwargs[ATTR_BRIGHTNESS] * 99 / 255.0)) - else: - self._device.switch_on() + return + + self._device.switch_on() def turn_off(self, **kwargs): """Turn off the light."""