'Get updated status from API.'

def update(self):

    try:
        status = self._get_status()
        if (self._name is None):
            if (status['name'] is not None):
                self._name = status['name']
        state = STATES_MAP.get(status.get('door'), STATE_UNKNOWN)
        if (self._state_before_move is not None):
            if (self._state_before_move != state):
                self._state = state
                self._state_before_move = None
        else:
            self._state = state
        _LOGGER.debug('%s    status:    %s', self._name, self._state)
        self.signal = status.get('rssi')
        self.dist = status.get('dist')
        self._available = True
    except requests.exceptions.RequestException as ex:
        _LOGGER.error('Unable    to    connect    to    OpenGarage    device:    %(reason)s', dict(reason=ex))
        self._state = STATE_OFFLINE
