original_docstring:  Checks how long AC has been running and shuts it off after max is reached.
      :param minutes: How many minutes to let the AC run continuously.
      :return:
      
docstring: Checks how long AC has been running and shuts it off after max is reached.
docstring_tokens: Checks how long AC has been running and shuts it off after max is reached .
code: def monitor_ac_usage(minutes=30):
      """ Checks how long AC has been running and shuts it off after max is reached.
      :param minutes: How many minutes to let the AC run continuously.
      :return:
      """
      with app.app_context():
          event = Event.last_event()
          if event and event.event != EventType.off:
              off_time = event.timestamp.replace(minutes=+minutes)
              now = arrow.utcnow()
  
              if off_time < now:
                  if arduino.turn_off():
                      Event.create_event(EventType.off, "AutoOff Timer")
code_tokens: def monitor_ac_usage ( minutes = 30 ) : with app . app_context ( ) : event = Event . last_event ( ) if event and event . event != EventType . off : off_time = event . timestamp . replace ( minutes = + minutes ) now = arrow . utcnow ( ) if off_time < now : if arduino . turn_off ( ) : Event . create_event ( EventType . off , "AutoOff Timer" )
short_docstring: Checks how long AC has been running and shuts it off after max is reached.
short_docstring_tokens: Checks how long AC has been running and shuts it off after max is reached .
comment: """ Checks how long AC has been running and shuts it off after max is reached.
      :param minutes: How many minutes to let the AC run continuously.
      :return:
      """