def entity_ids(value):
    if isinstance(value, str):
        value = [ent_id.strip() for ent_id in value.split(',')]

    return [entity_id(ent_id) for ent_id in value]
Validate Entity IDs.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/helpers/config_validation.py/entity_ids