Returns the current LED state by querying the remote controller.
517609
def state(self):
    """"""
    ev = self._query_waiters.request(self.__do_query_state)
    ev.wait(1.0)
    return self._state
1215449
private synchronized void remoteStatus(final String anode,
            final boolean up, final Object info) {
        if (handler == null) {
            return;
        }
        try {
            handler.remoteStatus(anode, up, info);
        } catch (final Exception e) {
        }
    }
1349160
def _query(lamp_id, state, action='', method='GET'):
    '''
    
    '''
    # Because salt.utils.query is that dreadful... :(

    err = None
    url = "{0}/lights{1}".format(CONFIG['uri'],
                                 lamp_id and '/{0}'.format(lamp_id) or '') \
          + (action and "/{0}".format(action) or '')
    conn = http_client.HTTPConnection(CONFIG['host'])
    if method == 'PUT':
        conn.request(method, url, salt.utils.json.dumps(state))
    else:
        conn.request(method, url)
    resp = conn.getresponse()

    if resp.status == http_client.OK:
        res = salt.utils.json.loads(resp.read())
    else:
        err = "HTTP error: {0}, {1}".format(resp.status, resp.reason)
    conn.close()
    if err:
        raise CommandExecutionError(err)

    return res
928896
def led_rgb(self):
        """"""
        return (int(self._settings_json.get(CONST.SETTINGS_LED_R)),
                int(self._settings_json.get(CONST.SETTINGS_LED_G)),
                int(self._settings_json.get(CONST.SETTINGS_LED_B)))
240679
function () {
        if (this.state == 'zombie') {
            this.expireController();  // Toss anything that might have happened

            RemoteObjectTemplate.enableSendMessage(true, this.sendMessage); // Re-enable sending

            this.state = 'live';
            this.rootId = null;  // Cancel forcing our controller on server
            this.refreshSession();

            console.log('Getting live again - fetching state from server');
        }

        this.setCookie('session' + this.app, this.session, 0);
    }
1257974
def set_led(self, state):        
        """"""
        if self.connected:            
            reports = self.device.find_output_reports()
            for report in reports:
                if self.led_usage in report:
                    report[self.led_usage] = state
                    report.send()
368509
def set_power_state(self, is_on, bulb=ALL_BULBS, timeout=None):
        
        with _blocking(self.lock, self.power_state, self.light_state_event,
                       timeout):
            self.send(REQ_SET_POWER_STATE,
                      bulb, '2s', '\x00\x01' if is_on else '\x00\x00')
            self.send(REQ_GET_LIGHT_STATE, ALL_BULBS, '')
        return self.power_state
1342217
def set_light_state_raw(self, hue, saturation, brightness, kelvin,
                            bulb=ALL_BULBS, timeout=None):
        
        with _blocking(self.lock, self.light_state, self.light_state_event,
                       timeout):
            self.send(REQ_SET_LIGHT_STATE, bulb, 'xHHHHI',
                      hue, saturation, brightness, kelvin, 0)
            self.send(REQ_GET_LIGHT_STATE, ALL_BULBS, '')
        return self.light_state
1187070
def lights(self):
        """"""
        return [Light(self._device, i) for i in range(len(self.raw))]
1368229
def _current_state(self):
        
        ret = self._grab_raw_image()
        # max-pooled over the last screen
        ret = np.maximum(ret, self.last_raw_screen)
        if self.viz:
            if isinstance(self.viz, float):
                cv2.imshow(self.windowname, ret)
                cv2.waitKey(int(self.viz * 1000))
        ret = ret.astype('float32')
        # 0.299,0.587.0.114. same as rgb2y in torch/image
        ret = cv2.cvtColor(ret, cv2.COLOR_RGB2GRAY)[:, :]
        return ret.astype('uint8')
1148005
def _set_LED(self, status):
        
        # DIO pin 1 (LED), active low
        self.hw.remote_at(
            dest_addr=self.remote_addr,
            command='D1',
            parameter='\x04' if status else '\x05')
707124
ServerStatus getState() {
        final InternalState requiredState = this.requiredState;
        final InternalState state = internalState;
        if(requiredState == InternalState.FAILED) {
            return ServerStatus.FAILED;
        }
        switch (state) {
            case STOPPED:
                return ServerStatus.STOPPED;
            case SERVER_STARTED:
                return  ServerStatus.STARTED;
            default: {
                if(requiredState == InternalState.SERVER_STARTED) {
                    return ServerStatus.STARTING;
                } else {
                    return ServerStatus.STOPPING;
                }
            }
        }
    }
614495
def get_pwm(self, led_num):
        """"""
        self.__check_range('led_number', led_num)
        register_low = self.calc_led_register(led_num)
        return self.__get_led_value(register_low)
834103
def current(self):
        # type: () -> Hub
        """"""
        rv = _local.get(None)
        if rv is None:
            rv = Hub(GLOBAL_HUB)
            _local.set(rv)
        return rv
1162722
def current_view(self):
        ''''''
        state = self.state
        return (state.lat, state.lon, state.width, state.height,
                state.ground_width, state.mt.tiles_pending())
1225606
def get_night_light_state(self):
        """"""
        if not self.camera_extended_properties:
            return None

        night_light = self.camera_extended_properties.get('nightLight')
        if not night_light:
            return None

        if night_light.get('enabled'):
            return 'on'

        return 'off'
658786
def register_led_updates(self, callback, button):
        """"""
        button_callbacks = self._button_observer_callbacks.get(button)
        if not button_callbacks:
            self._button_observer_callbacks[button] = []
        _LOGGER.debug('New callback for button %d', button)
        self._button_observer_callbacks[button].append(callback)