Turn the device ON Fast.
356103
def open_fast(self):
        """"""
        open_command = StandardSend(self._address,
                                    COMMAND_LIGHT_ON_FAST_0X12_NONE, cmd2=0xff)
        self._send_method(open_command, self._open_message_received)
912373
def start(self):
        """"""
        self.publish_properties()
        self.subscribe_topics()
        gc.collect()

        self.set_state("ready")

        while True:
            try:
                if not utils.wlan.isconnected():
                    utils.wifi_connect()

                # publish device data
                self.publish_data()

                # check for new mqtt messages
                self.mqtt.check_msg()

                idle()
                sleep(1)
            except KeyboardInterrupt:
                self.set_state("disconnected")
                self.mqtt.disconnect()
280464
async def power(dev: Device, cmd, target, value):
    
    async def try_turn(cmd):
        state = True if cmd == "on" else False
        try:
            return await dev.set_power(state)
        except SongpalException as ex:
            if ex.code == 3:
                err("The device is already %s." % cmd)
            else:
                raise ex

    if cmd == "on" or cmd == "off":
        click.echo(await try_turn(cmd))
    elif cmd == "settings":
        settings = await dev.get_power_settings()
        print_settings(settings)
    elif cmd == "set" and target and value:
        click.echo(await dev.set_power_settings(target, value))
    else:
        power = await dev.get_power()
        click.echo(click.style(str(power), bold=power))
705483
def run(self):
        
        LOGGER.info('%s v%s started', self.APPNAME, self.VERSION)
        self.setup()
        while not any([self.is_stopping, self.is_stopped]):
            self.set_state(self.STATE_SLEEPING)
            try:
                signum = self.pending_signals.get(True, self.wake_interval)
            except queue.Empty:
                pass
            else:
                self.process_signal(signum)
                if any([self.is_stopping, self.is_stopped]):
                    break
            self.set_state(self.STATE_ACTIVE)
            self.process()
698598
def start_scan(self, active):
        
        try:
            self.bable.start_scan(self._on_device_found, active_scan=active, sync=True)
        except bable_interface.BaBLEException as err:
            # If we are already scanning, raise an error only we tried to change the active scan param
            if self._active_scan != active:
                raise err

        self._active_scan = active
        self.scanning = True
1162800
private function turn_on() {
            $this->_logger->entrance();

            if ( $this->is_on() || ! isset( $this->_storage->connectivity_test['is_active'] ) ) {
                return false;
            }

            $updated_connectivity              = $this->_storage->connectivity_test;
            $updated_connectivity['is_active'] = true;
            $updated_connectivity['timestamp'] = WP_FS__SCRIPT_START_TIME;
            $this->_storage->connectivity_test = $updated_connectivity;

            $this->_is_on = true;

            return true;
        }
1177298
def start_charge(self):
        """"""
        if not self.__charger_state:
            data = self._controller.command(self._id, 'charge_start',
                                            wake_if_asleep=True)
            if data and data['response']['result']:
                self.__charger_state = True
            self.__manual_update_time = time.time()
332758
def start(self):
        """"""
        self.zap_socket = self.context.socket(zmq.REP)
        self.zap_socket.linger = 1
        zapLoc = 'inproc://zeromq.zap.{}'.format(MultiZapAuthenticator.count)
        self.zap_socket.bind(zapLoc)
        self.log.debug('Starting ZAP at {}'.format(zapLoc))
438494
def on(self):
        
        for device in self:
            if isinstance(device, (OutputDevice, CompositeOutputDevice)):
                device.on()
8380
def start(self):
        """"""
        super().start()
        self.__poller = zmq.asyncio.Poller()
        self.__poller.register(self.zap_socket, zmq.POLLIN)
        self.__task = asyncio.ensure_future(self.__handle_zap())
222547
def start(self):
        """"""
        if self._properties.get("startMs") is None:
            return None
        return _helpers._datetime_from_microseconds(
            int(self._properties.get("startMs")) * 1000.0
        )
74499
def run(self):
        

        self.__timer = QTimer()
        self.__timer.moveToThread(self)
        self.__timer.start(Constants.default_timer_cycle * self.__timer_cycle_multiplier)

        self.__timer.timeout.connect(self.__watch_file_system, Qt.DirectConnection)

        self.exec_()
901880
async def start(self):
        """"""

        self._command_task.start()

        try:
            await self._cleanup_old_connections()
        except Exception:
            await self.stop()
            raise

        #FIXME: This is a temporary hack, get the actual device we are serving.
        iotile_id = next(iter(self.adapter.devices))
        self.device = self.adapter.devices[iotile_id]

        self._logger.info("Serving device 0x%04X over BLED112", iotile_id)
        await self._update_advertisement()

        self.setup_client(self.CLIENT_ID, scan=False, broadcast=True)
1211061
def set_state(self, state, speed=None):
        
        desired_state = {"powered": state}
        if state:
            brightness = self._to_brightness.get(speed or self.current_fan_speed(), 0.33)
            desired_state.update({'brightness': brightness})

        response = self.api_interface.set_device_state(self, {
            "desired_state": desired_state
        })

        self._update_state_from_response(response)
1346910
def activate(self, timeout=None, **options):
        """"""

        if timeout is None:
            timeout = 1.0
        gbt = options.get('gbt', '')[0:47]
        lrt = min(max(0, options.get('lrt', 3)), 3)
        rwt = min(max(0, options.get('rwt', 8)), 14)

        pp = (lrt << 4) | (bool(gbt) << 1) | int(bool(self.nad))
        nfcid3t = bytearray.fromhex("01FE") + os.urandom(6) + "ST"
        atr_res = ATR_RES(nfcid3t, 0, 0, 0, rwt, pp, gbt)
        atr_res = atr_res.encode()

        target = nfc.clf.LocalTarget(atr_res=atr_res)
        target.sens_res = bytearray.fromhex("0101")
        target.sdd_res = bytearray.fromhex("08") + os.urandom(3)
        target.sel_res = bytearray.fromhex("40")
        target.sensf_res = bytearray.fromhex("01") + nfcid3t[0:8]
        target.sensf_res += bytearray.fromhex("00000000 00000000 FFFF")

        target = self.clf.listen(target, timeout)

        if target and target.atr_req and target.dep_req:
            log.debug("activated as " + str(target))

            atr_req = ATR_REQ.decode(target.atr_req)
            self.lrt = lrt
            self.gbt = gbt
            self.gbi = atr_req.gb
            self.miu = atr_req.lr - 3
            self.rwt = 4096/13.56E6 * pow(2, rwt)
            self.did = atr_req.did if atr_req.did > 0 else None
            self.acm = not (target.sens_res or target.sensf_res)
            self.cmd = chr(len(target.dep_req)+1) + target.dep_req
            if target.brty == "106A":
                self.cmd = b"\xF0" + self.cmd
            self.target = target

            self.pcnt.rcvd["ATR"] += 1
            self.pcnt.sent["ATR"] += 1
            log.info("running as " + str(self))

            return self.gbi
1288850
def run(self):
        """"""
        self.state = True
        if self.capture:
            self.display2.screen().root.grab_keyboard(X.KeyPressMask | X.KeyReleaseMask, X.GrabModeAsync, X.GrabModeAsync, X.CurrentTime)

        self.display2.record_enable_context(self.ctx, self.handler)
        self.display2.record_free_context(self.ctx)
350547
def run(self):
        """"""
        self.socket = self.bluez.hci_open_dev(self.bt_device_id)

        filtr = self.bluez.hci_filter_new()
        self.bluez.hci_filter_all_events(filtr)
        self.bluez.hci_filter_set_ptype(filtr, self.bluez.HCI_EVENT_PKT)
        self.socket.setsockopt(self.bluez.SOL_HCI, self.bluez.HCI_FILTER, filtr)

        self.set_scan_parameters()
        self.toggle_scan(True)

        while self.keep_going:
            pkt = self.socket.recv(255)
            event = to_int(pkt[1])
            subevent = to_int(pkt[3])
            if event == LE_META_EVENT and subevent == EVT_LE_ADVERTISING_REPORT:
                # we have an BLE advertisement
                self.process_packet(pkt)
        self.socket.close()