def string(value):
    if value is not None:
        return str(value)
    raise vol.Invalid('string value is None')
Coerce value to string, except for None.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/helpers/config_validation.py/string