diff --git a/homeassistant/components/light/ads.py b/homeassistant/components/light/ads.py index 0d97efa16a2..10df4c0bf72 100644 --- a/homeassistant/components/light/ads.py +++ b/homeassistant/components/light/ads.py @@ -63,15 +63,16 @@ class AdsLight(Light): self._brightness = value self.schedule_update_ha_state() - self.hass.async_add_job( + self.hass.async_add_executor_job( self._ads_hub.add_device_notification, self.ads_var_enable, self._ads_hub.PLCTYPE_BOOL, update_on_state ) - self.hass.async_add_job( - self._ads_hub.add_device_notification, - self.ads_var_brightness, self._ads_hub.PLCTYPE_INT, - update_brightness - ) + if self.ads_var_brightness is not None: + self.hass.async_add_executor_job( + self._ads_hub.add_device_notification, + self.ads_var_brightness, self._ads_hub.PLCTYPE_INT, + update_brightness + ) @property def name(self): @@ -96,8 +97,10 @@ class AdsLight(Light): @property def supported_features(self): """Flag supported features.""" + support = 0 if self.ads_var_brightness is not None: - return SUPPORT_BRIGHTNESS + support = SUPPORT_BRIGHTNESS + return support def turn_on(self, **kwargs): """Turn the light on or set a specific dimmer value."""