###################################
##  Press an [Amazon Dash Buttons](http://amzn.to/2dPKZhM) and then stuff happens.
###################################

- alias: 'Toggle Office Light on/off'
  trigger:
    - platform: event
      event_type: office_lamp_dash

  action:
    # Disable this automation
    - service: automation.turn_off
      entity_id: automation.toggle_office_light_onoff
    - service: light.toggle
      entity_id: light.office_lamp
    - service: input_boolean.turn_on
      entity_id: input_boolean.daylight_override
    - delay:
        minutes: 1
    # enable this automation - This prevents duplicate pushes.
    - service: automation.turn_on
      entity_id: automation.toggle_office_light_onoff
