'Get the latest data from aREST device.'

@Throttle(MIN_TIME_BETWEEN_UPDATES)
def update(self):

    try:
        if (self._pin is None):
            response = requests.get(self._resource, timeout=10)
            self.data = response.json()['variables']
        else:
            try:
                if (str(self._pin[0]) == 'A'):
                    response = requests.get('{}/analog/{}'.format(self._resource, self._pin[1:]), timeout=10)
                    self.data = {'value': response.json()['return_value']}
            except TypeError:
                response = requests.get('{}/digital/{}'.format(self._resource, self._pin), timeout=10)
                self.data = {'value': response.json()['return_value']}
        self.available = True
    except requests.exceptions.ConnectionError:
        _LOGGER.error('No    route    to    device    %s', self._resource)
        self.available = False
