 
   autoOffClicked: () ->
     console.log "Cancel button clicked"
-    #Tp.devices.projector.trigger "autoOffCancel"
     Tp.projectorPane.trigger "autoOffCancel"

    #Tp.devices.projector.bind "autoOffCancel", @autoOffCancel
    this.bind "autoOffCancel", @autoOffCancel

    @warningTimer = null
    @offTimer = null

  render: () ->
    ($.tmpl "projector-pane-template", {


  autoOff: (state) ->
    if state == "on"
      #timer callbacks
      shutOff = ->
        Tp.devices.projector.state_set 'power', false
      warning = ->
        $('#auto-off').show()
        Tp.room.offTimer = setTimeout shutOff, 60000
      
      Tp.room.warningTimer = setTimeout warning, 10740000
    else if state == "off"
      if Tp.room.warningTimer then clearTimeout(Tp.room.warningTimer)
      if Tp.room.offTimer then clearTimeout(Tp.room.offTimer)
      $('#auto-off').hide()

  autoOffCancel: () ->
    console.log "This thing should work.. Cancelling shutoff"
    clearTimeout(Tp.room.warningTimer)
    clearTimeout(Tp.room.offTimer)
    $('#auto-off').hide()
    Tp.projectorPane.autoOff("on")

