def setup_platform(hass, config, add_devices, discovery_info=None):
    """Setup the Time and Date sensor."""
    if hass.config.time_zone is None:
        _LOGGER.error("Timezone is not set in Home Assistant config")
        return False

    dev = []
    for variable in config['display_options']:
        if variable not in OPTION_TYPES:
            _LOGGER.error('Option type: "%s" does not exist', variable)
        else:
            dev.append(TimeDateSensor(variable))

    add_devices(dev)


# pylint: disable=too-few-public-methods
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/sensor/time_date.py/setup_platform/original