def icon(value):
    value = str(value)

    if value.startswith('mdi:'):
        return value

    raise vol.Invalid('Icons should start with prefix "mdi:"')
Validate icon.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/helpers/config_validation.py/icon