Updates the position and values of the battery bar.
975696
def updateBatteryBar(self):
        ''''''
        # Bar
        self.batOutRec.set_xy((self.rightPos-(1.3+self.rOffset)*self.batWidth,1.0-(0.1+1.0+(2*0.075))*self.batHeight))
        self.batInRec.set_xy((self.rightPos-(self.rOffset+1+0.15)*self.batWidth,1.0-(0.1+1+0.075)*self.batHeight))
        self.batPerText.set_position((self.rightPos - (self.rOffset+0.65)*self.batWidth,1-(0.1+1+(0.075+0.15))*self.batHeight))
        self.batPerText.set_fontsize(self.fontSize)
        self.voltsText.set_text('%.1f V' % self.voltage)
        self.ampsText.set_text('%.1f A' % self.current)
        self.voltsText.set_position((self.rightPos-(self.rOffset+1.3+0.2)*self.batWidth,1-(0.1+0.05)*self.batHeight))
        self.ampsText.set_position((self.rightPos-(self.rOffset+1.3+0.2)*self.batWidth,1-self.vertSize-(0.1+0.05+0.1)*self.batHeight))
        self.voltsText.set_fontsize(self.fontSize)
        self.ampsText.set_fontsize(self.fontSize)
        if self.batRemain >= 0:
            self.batPerText.set_text(int(self.batRemain))
            self.batInRec.set_height(self.batRemain*self.batHeight/100.0)
            if self.batRemain/100.0 > 0.5:
                self.batInRec.set_facecolor('lawngreen')
            elif self.batRemain/100.0 <= 0.5 and self.batRemain/100.0 > 0.2:
                self.batInRec.set_facecolor('yellow')
            elif self.batRemain/100.0 <= 0.2 and self.batRemain >= 0.0:
                self.batInRec.set_facecolor('r')
        elif self.batRemain == -1:
            self.batInRec.set_height(self.batHeight)
            self.batInRec.set_facecolor('k')
378411
def update(self, config, force_cache=False, **kwargs):
        """"""
        # force = kwargs.pop('force', False)
        self.name = config['name']
        self.camera_id = str(config['id'])
        self.network_id = str(config['network_id'])
        self.serial = config['serial']
        self.motion_enabled = config['enabled']
        self.battery_voltage = config['battery_voltage']
        self.battery_state = config['battery_state']
        self.temperature = config['temperature']
        self.wifi_strength = config['wifi_strength']

        # Retrieve calibrated temperature from special endpoint
        resp = api.request_camera_sensors(self.sync.blink,
                                          self.network_id,
                                          self.camera_id)
        try:
            self.temperature_calibrated = resp['temp']
        except KeyError:
            self.temperature_calibrated = self.temperature
            _LOGGER.warning("Could not retrieve calibrated temperature.")

        # Check if thumbnail exists in config, if not try to
        # get it from the homescreen info in teh sync module
        # otherwise set it to None and log an error
        new_thumbnail = None
        if config['thumbnail']:
            thumb_addr = config['thumbnail']
        else:
            thumb_addr = self.get_thumb_from_homescreen()

        if thumb_addr is not None:
            new_thumbnail = "{}{}.jpg".format(self.sync.urls.base_url,
                                              thumb_addr)

        try:
            self.motion_detected = self.sync.motion[self.name]
        except KeyError:
            self.motion_detected = False

        clip_addr = None
        if self.name in self.sync.last_record:
            clip_addr = self.sync.last_record[self.name]['clip']
            self.last_record = self.sync.last_record[self.name]['time']
            self.clip = "{}{}".format(self.sync.urls.base_url,
                                      clip_addr)

        # If the thumbnail or clip have changed, update the cache
        update_cached_image = False
        if new_thumbnail != self.thumbnail or self._cached_image is None:
            update_cached_image = True
        self.thumbnail = new_thumbnail

        update_cached_video = False
        if self._cached_video is None or self.motion_detected:
            update_cached_video = True

        if new_thumbnail is not None and (update_cached_image or force_cache):
            self._cached_image = api.http_get(self.sync.blink,
                                              url=self.thumbnail,
                                              stream=True,
                                              json=False)
        if clip_addr is not None and (update_cached_video or force_cache):
            self._cached_video = api.http_get(self.sync.blink,
                                              url=self.clip,
                                              stream=True,
                                              json=False)
1291046
public synchronized void update() {
    SYSTEM_POWER_STATUS status = new SYSTEM_POWER_STATUS();
    Kernel32.INSTANCE.GetSystemPowerStatus(status);

    switch (status.ACLineStatus) {
    case 0: // battery
      allow(!requireAC
          && (status.BatteryLifePercent < 0 || status.BatteryLifePercent >= minBatteryLifePercent));
      break;

    case 1:  // A/C
    default:
      allow((status.BatteryFlag & 0x8) == 0 // not charging
          || (status.BatteryLifePercent < 0 || status.BatteryLifePercent >= minBatteryLifePercentWhileCharging));
      break;

    }
  }
299231
def update_location(self, text=''):
        """"""
        self.text_project_name.setEnabled(self.radio_new_dir.isChecked())
        name = self.text_project_name.text().strip()

        if name and self.radio_new_dir.isChecked():
            path = osp.join(self.location, name)
            self.button_create.setDisabled(os.path.isdir(path))
        elif self.radio_from_dir.isChecked():
            self.button_create.setEnabled(True)
            path = self.location
        else:
            self.button_create.setEnabled(False)
            path = self.location
        
        self.text_location.setText(path)
791978
def update(self, value):
        
        self.update_internal(value)
        self.emit('changed', self.get_widget_value())
1349254
protected void updateStatusBar() {
		if (statusBar != null) {
			int all = getBaseEventList().size();
			int showing = getFinalEventList().size();
			String msg;
			if (all == showing) {
				String[] keys = new String[] {
						modelId + "." + SHOWINGALL_MSG_KEY, SHOWINGALL_MSG_KEY };
				msg = getApplicationConfig().messageResolver().getMessage(
						keys,
						new Object[] {
								"" + all,
								(all != 1) ? objectPluralName
										: objectSingularName });
			} else {
				String[] keys = new String[] {
						modelId + "." + SHOWINGN_MSG_KEY, SHOWINGN_MSG_KEY };

				msg = getApplicationConfig().messageResolver().getMessage(
						keys,
						new Object[] {
								"" + showing,
								(showing != 1) ? objectPluralName
										: objectSingularName, "" + all });
			}
			// Now add the selection info
			int nselected = getTable().getSelectedRowCount();
			if (nselected > 0) {
				String[] keys = new String[] {
						modelId + "." + SELECTEDN_MSG_KEY, SELECTEDN_MSG_KEY };

				msg += getApplicationConfig().messageResolver().getMessage(keys,
						new Object[] { "" + nselected });
			}
			statusBar.setMessage(msg.toString());
		}
	}
405824
def update_position(self, loc):
        """"""
        # This ensures that the new value of the location is set before
        # any other updates take place.
        self._loc = loc
        super(SkewXTick, self).update_position(loc)
767325
def update(self, pos):
        
        self.pos = pos
        self.now = time.time()
605937
private void updateValue(Point location) {
        CellPosition oldValue = value;
        if (location == null) {
            value = null;
        } else {
            int row = table.rowAtPoint(location);
            int column = table.columnAtPoint(location);
            value = new CellPosition(row, column);
        }
        maybeNotifyListeners(oldValue, value);
    }
472395
def update(self):
        """"""
        node = self._fritz.get_device_element(self.ain)
        self._update_from_node(node)
948795
def update(self):
        """"""
        self._controller.update(self._id, wake_if_asleep=False)
        data = self._controller.get_charging_params(self._id)
        if data and (time.time() - self.__manual_update_time > 60):
            self.__maxrange_state = data['charge_to_max_range']
577791
def _update_xyz(self, change):
        
        self.x,self.y,self.z = self.position.X(),self.position.Y(),self.position.Z()
624908
def _update_state(self, value: str) -> None:
        """"""
        attribute = next(attr for attr in self._device['device_info'].get(
            'Attributes', []) if attr.get(
                'AttributeDisplayName') == 'doorstate')
        if attribute is not None:
            attribute['Value'] = value
1232858
private void updateSlaves(MO masterOutputValue) {
        // Transform value
        SI slaveInputValue = transformer.transform(masterOutputValue);

        // Notify slave(s)
        slave.setValue(slaveInputValue);
    }
217034
protected final void update() {
		BufferedImage image=getImageViewer()==null ? null : getImageViewer().getImage();
		if (image==null || model.isInvalid() || model.getX()>=image.getWidth() || model.getY()>=image.getHeight())
			updateLabelNoData();
		else
			updateLabel(image, model.getX(), model.getY(), statusBar.getWidth()-statusBarInsets.left-statusBarInsets.right);
	}
404983
def update(self, redraw=True):
        """"""
        # get the main urwid.Frame widget
        mainframe = self.root_widget.original_widget

        # body
        if self.current_buffer:
            mainframe.set_body(self.current_buffer)

        # footer
        lines = []
        if self._notificationbar:  # .get_text()[0] != ' ':
            lines.append(self._notificationbar)
        if self._show_statusbar:
            lines.append(self.build_statusbar())

        if lines:
            mainframe.set_footer(urwid.Pile(lines))
        else:
            mainframe.set_footer(None)
        # force a screen redraw
        if self.mainloop.screen.started and redraw:
            self.mainloop.draw_screen()
499475
def update_positions(tree, positions):
    """"""

    for step, pos in zip(tree.findall('step'), positions):
        for key in sorted(pos):
            value = pos.get(key)
            if key.endswith("-rel"):
                abs_key = key[:key.index("-rel")]
                if value is not None:
                    els = tree.findall(".//*[@id='" + value + "']")
                    for el in els :
                        pos[abs_key] = num(el.get(abs_key)) + pos.get(abs_key)
                        step.attrib[abs_key] = str(pos.get(abs_key))
            else:
                step.attrib[key] = str(pos[key])

        if 'hovercraft-path' in step.attrib:
            del step.attrib['hovercraft-path']