def _turn_on_light(self):
        set_req = self.gateway.const.SetReq

        if not self._state and set_req.V_LIGHT in self._values:
            self.gateway.set_child_value(
                self.node_id, self.child_id, set_req.V_LIGHT, 1)

        if self.gateway.optimistic:
            # optimistically assume that light has changed state
            self._state = True
            self.update_ha_state()
Turn on light child device.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/light/mysensors.py/MySensorsLight._turn_on_light