986873834aa8e11832e0816fdd243d00478cffdf,homeassistant/components/light/mysensors.py,MySensorsLight,_turn_on_rgb_and_w,#MySensorsLight#Any#,136

Before Change


                kwargs[ATTR_WHITE_VALUE] != self._white:
            white = kwargs[ATTR_WHITE_VALUE]

        if ATTR_RGB_COLOR in kwargs and \
                kwargs[ATTR_RGB_COLOR] != self._rgb:
            rgb = list(kwargs[ATTR_RGB_COLOR])
            if white is not None and hex_template == "%02x%02x%02x%02x":
                rgb.append(white)
            hex_color = hex_template % tuple(rgb)
            self.gateway.set_child_value(
                self.node_id, self.child_id, self.value_type, hex_color)

        if self.gateway.optimistic:
            // optimistically assume that light has changed state
            self._rgb = rgb
            self._white = white

After Change


        new_rgb = kwargs.get(ATTR_RGB_COLOR)
        new_white = kwargs.get(ATTR_WHITE_VALUE)

        if new_rgb is None and new_white is None:
            return
        if new_rgb is not None:
            rgb = list(new_rgb)
        if rgb is None:
            return
        if new_white is not None and hex_template == "%02x%02x%02x%02x":
            rgb.append(new_white)
        hex_color = hex_template % tuple(rgb)
        if len(rgb) > 3:
            white = rgb.pop()
        self.gateway.set_child_value(
            self.node_id, self.child_id, self.value_type, hex_color)

        if self.gateway.optimistic:
            // optimistically assume that light has changed state
            self._rgb = rgb
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: home-assistant/home-assistant
Commit Name: 986873834aa8e11832e0816fdd243d00478cffdf
Time: 2016-09-24
Author: marhje52@kth.se
File Name: homeassistant/components/light/mysensors.py
Class Name: MySensorsLight
Method Name: _turn_on_rgb_and_w


Project Name: home-assistant/home-assistant
Commit Name: 138205a0199d00455ddd30d180ae22831d3924cc
Time: 2016-09-20
Author: mail@marcpabst.de
File Name: homeassistant/components/light/mysensors.py
Class Name: MySensorsLight
Method Name: _turn_on_dimmer


Project Name: home-assistant/home-assistant
Commit Name: 138205a0199d00455ddd30d180ae22831d3924cc
Time: 2016-09-20
Author: mail@marcpabst.de
File Name: homeassistant/components/light/mysensors.py
Class Name: MySensorsLight
Method Name: _turn_on_light