def is_on(hass, entity_id):
    return hass.states.is_state(entity_id, STATE_ON)
Test if input_boolean is True.
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/input_boolean.py/is_on