0589379de5462567ba3f8b7edd31d22a5f08f41b,homeassistant/components/homekit/type_lights.py,Light,set_brightness,#Light#Any#,89

Before Change


        Set brightness if call came from HomeKit.
        _LOGGER.debug("%s: Set brightness to %d", self.entity_id, value)
        self._flag[CHAR_BRIGHTNESS] = True
        if value != 0:
            self.hass.components.light.turn_on(
                self.entity_id, brightness_pct=value)
        else:
            self.hass.components.light.turn_off(self.entity_id)

    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)
        self._flag[CHAR_COLOR_TEMPERATURE] = True

After Change


        if value == 0:
            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)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 12

Instances


Project Name: home-assistant/home-assistant
Commit Name: 0589379de5462567ba3f8b7edd31d22a5f08f41b
Time: 2018-05-20
Author: 30130371+cdce8p@users.noreply.github.com
File Name: homeassistant/components/homekit/type_lights.py
Class Name: Light
Method Name: set_brightness


Project Name: home-assistant/home-assistant
Commit Name: 2f8865d6cb64b252254874589a722cb886c405b8
Time: 2018-05-21
Author: 30130371+cdce8p@users.noreply.github.com
File Name: homeassistant/components/homekit/type_lights.py
Class Name: Light
Method Name: set_brightness


Project Name: home-assistant/home-assistant
Commit Name: 0589379de5462567ba3f8b7edd31d22a5f08f41b
Time: 2018-05-20
Author: 30130371+cdce8p@users.noreply.github.com
File Name: homeassistant/components/homekit/type_lights.py
Class Name: Light
Method Name: set_state


Project Name: home-assistant/home-assistant
Commit Name: 2f8865d6cb64b252254874589a722cb886c405b8
Time: 2018-05-21
Author: 30130371+cdce8p@users.noreply.github.com
File Name: homeassistant/components/homekit/type_lights.py
Class Name: Light
Method Name: set_state