@property
    def state(self):
        """Return the state of the device."""
        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._host, reason=ex))
            return STATE_UNKNOWN
        except __HOLE__:
            _LOGGER.error('nx584 reports no partitions')
            return STATE_UNKNOWN

        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']:
            return STATE_ALARM_DISARMED
        elif bypassed:
            return STATE_ALARM_ARMED_HOME
        else:
            return STATE_ALARM_ARMED_AWAY
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/alarm_control_panel/nx584.py/NX584Alarm.state