def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the DHT sensor."""
    # pylint: disable=import-error
    import Adafruit_DHT

    SENSOR_TYPES['temperature'][1] = hass.config.temperature_unit
    unit = hass.config.temperature_unit
    available_sensors = {
        "DHT11": Adafruit_DHT.DHT11,
        "DHT22": Adafruit_DHT.DHT22,
        "AM2302": Adafruit_DHT.AM2302
    }
    sensor = available_sensors[config['sensor']]

    pin = config['pin']

    if not sensor or not pin:
        _LOGGER.error(
            "Config error "
            "Please check your settings for DHT, sensor not supported.")
        return None

    data = DHTClient(Adafruit_DHT, sensor, pin)
    dev = []
    name = config.get('name', DEFAULT_NAME)

    try:
        for variable in config['monitored_conditions']:
            if SENSOR_TYPES not in variable:
                _LOGGER.error('Sensor type: "%s" does not exist', variable)
            else:
                dev.append(DHTSensor(data, variable, unit, name))
    except KeyError:
        pass

    add_devices(dev)


# pylint: disable=too-few-public-methods
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/sensor/dht.py/setup_platform/swapped operands of `not in`