'Update values from API.'

def update(self):

    try:
        part = self._alarm.list_partitions()[0]
    except requests.exceptions.ConnectionError as ex:
        _LOGGER.error('Unable    to    connect    to    %(host)s:    %(reason)s', dict(host=self._url, reason=ex))
        newstate = STATE_UNKNOWN
    except IndexError:
        _LOGGER.error('Concord232    reports    no    partitions')
        newstate = STATE_UNKNOWN
    if (part['arming_level'] == 'Off'):
        newstate = STATE_ALARM_DISARMED
    elif ('Home' in part['arming_level']):
        newstate = STATE_ALARM_ARMED_HOME
    else:
        newstate = STATE_ALARM_ARMED_AWAY
    if (not (newstate == self._state)):
        _LOGGER.info('State    Chnage    from    %s    to    %s', self._state, newstate)
        self._state = newstate
    return self._state
