def turn_on(hass, entity_id=None):
    data = {ATTR_ENTITY_ID: entity_id} if entity_id else None
    hass.services.call(DOMAIN, SERVICE_TURN_ON, data)
Turn all or specified switch on.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/switch/__init__.py/turn_on