def setup_platform(hass, config, add_devices, discovery_info=None):
    from nx584 import client as nx584_client

    host = config.get('host', 'localhost:5007')
    exclude = config.get('exclude_zones', [])
    zone_types = config.get('zone_types', {})

    if not all(isinstance(zone, int) for zone in exclude):
        _LOGGER.error('Invalid excluded zone specified (use zone number)')
        return False

    if not all(isinstance(zone, int) and ztype in SENSOR_CLASSES
               for zone, ztype in zone_types.items()):
        _LOGGER.error('Invalid zone_types entry')
        return False

    try:
        client = nx584_client.Client('http://%s' % host)
        zones = client.list_zones()
    except requests.exceptions.ConnectionError as ex:
        _LOGGER.error('Unable to connect to NX584: %s', str(ex))
        return False

    version = [int(v) for v in client.get_version().split('.')]
    if version < [1, 1]:
        _LOGGER.error('NX584 is too old to use for sensors (>=0.2 required)')
        return False

    zone_sensors = {
        zone['number']: NX584ZoneSensor(
            zone,
            zone_types.get(zone['number'], 'opening'))
        for zone in zones
        if zone['number'] not in exclude}
    if zone_sensors:
        add_devices(zone_sensors.values())
        watcher = NX584Watcher(client, zone_sensors)
        watcher.start()
    else:
        _LOGGER.warning('No zones found on NX584')

    return True
POSTing the delete view should mark the comment as removed
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/binary_sensor/nx584.py/setup_platform--crossover with--dataset/ETHPy150Open dcramer/django-compositepks/tests/regressiontests/comment_tests/tests/moderation_view_tests.py/ApproveViewTests.testApprovePost