03423cc3a9f2fc4cb1a5ba00c0d2cc042fc3b649,homeassistant/components/light/mysensors.py,MySensorsLight,turn_off,#MySensorsLight#,163

Before Change


        value = 0
        if set_req.V_LIGHT in self._values:
            self._values[set_req.V_LIGHT] = STATE_OFF
        elif set_req.V_DIMMER in self._values:
            v_type = set_req.V_DIMMER
        elif float(self.gateway.version) >= 1.5:
            if set_req.V_RGB in self._values:
                v_type = set_req.V_RGB
                value = "000000"

After Change


        Turn the device off.
        value_type = kwargs.get("value_type")
        value = kwargs.get("value")
        if value_type is not None and value is not None:
            self.gateway.set_child_value(
                self.node_id, self.child_id, value_type, value)
        else:
            _LOGGER.warning(
                "%s: value_type %s, value = %s, "
                "None is not valid argument when setting child value"
                "", self._name, value_type, value)
        if self.gateway.optimistic:
            // optimistically assume that light has changed state
            self._state = False
            self.update_ha_state()
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: home-assistant/home-assistant
Commit Name: 03423cc3a9f2fc4cb1a5ba00c0d2cc042fc3b649
Time: 2016-02-17
Author: marhje52@kth.se
File Name: homeassistant/components/light/mysensors.py
Class Name: MySensorsLight
Method Name: turn_off


Project Name: open-mmlab/mmcv
Commit Name: 2d52809cdbdb54e5c60ae7939fdd4120795c2b3c
Time: 2020-10-31
Author: yhcao6@gmail.com
File Name: mmcv/runner/hooks/optimizer.py
Class Name: Fp16OptimizerHook
Method Name: after_train_iter


Project Name: pfnet/optuna
Commit Name: 35d9988b7584db6d481c30116d37f5f89bf443a2
Time: 2019-09-19
Author: suehiro619@gmail.com
File Name: optuna/visualization.py
Class Name:
Method Name: _get_optimization_history_plot