Update connectivity status (online|offline)
430779
private function updateLastConnect()
    {
        $status = $this->deliveryExecution->getState()->getUri();
        /** @var TestSessionConnectivityStatusService $testSessionConnectivityStatusService */
        $testSessionConnectivityStatusService = $this->getServiceLocator()->get(TestSessionConnectivityStatusService::SERVICE_ID);

        if ($testSessionConnectivityStatusService->hasOnlineMode() && ProctoredDeliveryExecution::STATE_ACTIVE == $status) {
            $lastConnectivity = $testSessionConnectivityStatusService->getLastOnline($this->deliveryExecution->getIdentifier());
        }else{
            // to ensure that during sorting by connectivity all similar statuses grouped together
            $lastConnectivity = (~PHP_INT_MAX) + substr(abs(crc32($status)), 0, 3);
        }

        $this->addValue(DeliveryMonitoringService::CONNECTIVITY, $lastConnectivity, true);
    }
258794
def device_status(self):
        """"""
        return {
            'active': self.device['active'],
            'offline': self.device['offline'],
            'last_update': self.last_update,
            'battery_level': self.battery_level,
        }
820691
def wifi_status(self):
        """"""
        return self._info_json.get(CONST.STATUS, {}).get(CONST.WIFI_LINK)
996375
def _update_port_status_cache(self, device, device_bound=True):
        """"""
        with self._cache_lock:
            if device_bound:
                self._bound_ports.add(device)
                self._unbound_ports.discard(device)
            else:
                self._bound_ports.discard(device)
                self._unbound_ports.add(device)
590705
def set_status(self, status):
        

        text = ""
        colour = "#FFFFFF"
        if status == 0:
            text = "OFFLINE"
            colour = "#EF9A9A"
        elif status == 1:
            text = "STARTING"
            colour = "#FFE082"
        elif status == 2:
            text = "ONLINE"
            colour = "#A5D6A7"

        self.status.set(text)
        self.statusbar.config(background=colour)
471538
def go_offline(self, comment=None):
        
        self.make_request(
            NodeCommandFailed,
            method='update',
            resource='go_offline',
            params={'comment': comment})
616854
def update(self, ip):
        """"""
        timeout = 60
        LOG.debug("Updating '%s' to '%s' at service '%s'", self.hostname, ip, self._updateurl)
        params = {"myip": ip, "hostname": self.hostname}
        req = requests.get(self._updateurl, params=params, headers=constants.REQUEST_HEADERS_DEFAULT,
                           auth=(self.__userid, self.__password), timeout=timeout)
        LOG.debug("status %i, %s", req.status_code, req.text)
        if req.status_code == 200:
            # responses can also be "nohost", "abuse", "911", "notfqdn"
            if req.text.startswith("good ") or req.text.startswith("nochg"):
                return ip
            return req.text
        return "invalid http status code: %s" % req.status_code
616846
def update(self):
        """"""

        if self.device_time_check():

            if not self.in_process:
                outlets, switches, fans = self.get_devices()

                self.outlets = helpers.resolve_updates(self.outlets, outlets)
                self.switches = helpers.resolve_updates(
                    self.switches, switches)
                self.fans = helpers.resolve_updates(self.fans, fans)

                self.last_update_ts = time.time()
452046
private function updateStatus()
    {
        $status = $this->deliveryExecution->getState()->getUri();
        $this->addValue(DeliveryMonitoringService::STATUS, $status, true);
        if ($status == ProctoredDeliveryExecution::STATE_PAUSED) {
            $this->addValue(DeliveryMonitoringService::LAST_PAUSE_TIMESTAMP, microtime(true), true);
        }
    }
1131036
protected void updatePageStatus() {
		final boolean ok;
		if (Strings.isEmpty(this.titleField.getText())) {
			ok = false;
			setMessage(Messages.IssueInformationPage_5, IMessageProvider.ERROR);
		} else if (Strings.isEmpty(this.trackerLogin.getText())) {
			ok = false;
			setMessage(Messages.IssueInformationPage_6, IMessageProvider.ERROR);
		} else if (Strings.isEmpty(this.trackerPassword.getText())) {
			ok = false;
			setMessage(Messages.IssueInformationPage_7, IMessageProvider.ERROR);
		} else {
			ok = true;
			if (Strings.isEmpty(this.descriptionField.getText())) {
				setMessage(Messages.IssueInformationPage_8, IMessageProvider.WARNING);
			} else {
				setMessage(null, IMessageProvider.NONE);
			}
		}
		setPageComplete(ok);
	}
169600
def update(self, status=values.unset):
        
        return self._proxy.update(status=status, )
1339037
def refresh(self):
        """"""
        # Update core device data
        new_device_json = self._device_request()
        _LOGGER.debug("Device Refresh Response: %s", new_device_json)

        # Update avatar url
        new_avatar_json = self._avatar_request()
        _LOGGER.debug("Avatar Refresh Response: %s", new_avatar_json)

        # Update device detail info
        new_info_json = self._info_request()
        _LOGGER.debug("Device Info Refresh Response: %s", new_info_json)

        # Update device setting details
        new_settings_json = self._settings_request()
        _LOGGER.debug("Device Settings Refresh Response: %s",
                      new_settings_json)

        # Update the stored data
        self.update(new_device_json, new_info_json, new_settings_json,
                    new_avatar_json)

        # Update the activities
        self._update_activities()
494132
def update_status(self, id_number, new_value):
        
        data = {
            'id': id_number,
            'new_value': new_value
        }

        return self.post('updateStatus', data)
479397
public void updateStatus() {

    String hostaddr = null;
    try {
      hostaddr = InetAddress.getByName(ip).getHostAddress();
    } catch (UnknownHostException e) {
      online = false;
      latency = Long.MAX_VALUE;
      return;
    }

    int total = 0;
    long totalPing = 0;

    // test ping 4 times
    int times = 4;

    while (total < times) {
      total++;
      long start = System.currentTimeMillis();

      SocketAddress sockaddr = new InetSocketAddress(hostaddr, port);
      try (Socket socket = new Socket()) {
        socket.connect(sockaddr, 1000);
      } catch (Exception e) {
        online = false;
        return;
      }

      totalPing += (System.currentTimeMillis() - start);
    }

    online = true;
    latency = totalPing / total;
  }
663376
protected void updatePageStatus() {
		if (this.status.isOK()) {
			setMessage(null, IMessageProvider.NONE);
		} else {
			switch (this.status.getSeverity()) {
			case IStatus.ERROR:
				setMessage(this.status.getMessage(), IMessageProvider.ERROR);
				break;
			case IStatus.INFO:
				setMessage(this.status.getMessage(), IMessageProvider.INFORMATION);
				break;
			case IStatus.WARNING:
				setMessage(this.status.getMessage(), IMessageProvider.WARNING);
				break;
			default:
				break;
			}
		}
		setPageComplete(this.status.isOK() || this.status.getSeverity() == IStatus.INFO);
	}
1250043
def update(self):
        """"""
        with self._lock:
            devices = self._request_devices(MINUT_DEVICES_URL, 'devices')

            if devices:
                self._state = {
                    device['device_id']: device
                    for device in devices
                }
                _LOGGER.debug("Found devices: %s", list(self._state.keys()))
                # _LOGGER.debug("Device status: %s", devices)
            homes = self._request_devices(MINUT_HOMES_URL, 'homes')
            if homes:
                self._homes = homes
            return self.devices
1209008
def update_from_devices(self):
        """"""
        # _LOGGER.warning("update from devices")
        try:
            rest = requests.get(URL_DEVICES.format(self._url))
            if rest.status_code != 200:
                _LOGGER.error("Devices returned %s", rest.status_code)
                return False
            self.devices.update_devices(rest.json())
            return True
        except requests.exceptions.ConnectionError as conn_err:
            _LOGGER.error("Could not connect: %s", conn_err)
        except Exception as err:  # pylint: disable=broad-except
            _LOGGER.error(err)