'Update state of sensor.'

def update(self):

    try:
        self.api.update()
    except requests.exceptions.ConnectionError:
        return
    if (self.api.status is None):
        _LOGGER.debug('Update    of    %s    requested,    but    no    status    is    available', self._name)
        return
    value = self.api.status.get(self.type)
    if (value is None):
        _LOGGER.warning('Unable    to    locate    value    for    %s', self.type)
        return
    if (('DownloadRate' in self.type) and (value > 0)):
        self._state = round((value / (2 ** 20)), 2)
    elif (('UpTimeSec' in self.type) and (value > 0)):
        self._state = round((value / 60), 2)
    else:
        self._state = value
