'Process new events from panel.'

def update(self):

    try:
        part = self._alarm.list_partitions()[0]
        zones = self._alarm.list_zones()
    except requests.exceptions.ConnectionError as ex:
        _LOGGER.error('Unable    to    connect    to    %(host)s:    %(reason)s', dict(host=self._url, reason=ex))
        self._state = STATE_UNKNOWN
        zones = []
    except IndexError:
        _LOGGER.error('nx584    reports    no    partitions')
        self._state = STATE_UNKNOWN
        zones = []
    bypassed = False
    for zone in zones:
        if zone['bypassed']:
            _LOGGER.debug('Zone    %(zone)s    is    bypassed,    assuming    HOME', dict(zone=zone['number']))
            bypassed = True
            break
    if (not part['armed']):
        self._state = STATE_ALARM_DISARMED
    elif bypassed:
        self._state = STATE_ALARM_ARMED_HOME
    else:
        self._state = STATE_ALARM_ARMED_AWAY
