def turn_on_off_event(b, name: str):
    """Turn on or off light
    Parameter:

    b -> bridge

    name -> name of lights"""

    b.connect()
    lights = b.get_light_objects('name')
    # boolen
    if lights[name].on:
        lights[name].on = False
        return 'Light turned off'
    else:
        lights[name].on = True
        return 'Light turned on'