self.set_state(0) // Turn off light
return
params = {ATTR_ENTITY_ID: self.entity_id, ATTR_BRIGHTNESS_PCT: value}
self.hass.services.call(DOMAIN, SERVICE_TURN_ON, params)
def set_color_temperature(self, value):
Set color temperature if call came from HomeKit.
_LOGGER.debug("%s: Set color temp to %s", self.entity_id, value)
After Change
self.set_state(0) // Turn off light
return
params = {ATTR_ENTITY_ID: self.entity_id, ATTR_BRIGHTNESS_PCT: value}
self.call_service(DOMAIN, SERVICE_TURN_ON, params,
"brightness at {}%".format(value))
def set_color_temperature(self, value):
Set color temperature if call came from HomeKit.
_LOGGER.debug("%s: Set color temp to %s", self.entity_id, value)