SiriProxy plugin for controlling an Ecobee thermostat
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

use confirm for turning the system off

+8 -18
+8 -18
lib/siriproxy-ecobee.rb
··· 97 97 98 98 # turn the heat off - require confirmation on this, getting it wrong can suck 99 99 listen_for /turn the (heat|air( conditioning)?) off/i do 100 - say "Are you sure you want to turn the #{match_data[1]} off?" 101 - set_state :turn_sys_off 102 - 103 - request_completed 104 - end 105 - listen_for /#{CONFIRM_REGEX}/i, :within_state => :turn_sys_off do 106 - set_state nil 107 - tstat_info = @thermostat.tstat_info 108 - 109 - @thermostat.turn_hvac_off! 110 - 111 - say "Okay, the " + (tstat_info[:hvac_mode] == "heat" ? "heat" : 112 - "air conditioning") + " has been turned off." 100 + if confirm "Are you sure you want to turn the #{match_data[1]} off?" 101 + tstat_info = @thermostat.tstat_info 113 102 114 - request_completed 115 - end 116 - listen_for /#{DENY_REGEX}/i, :within_state => :turn_sys_off do 117 - set_state nil 103 + @thermostat.turn_hvac_off! 118 104 119 - say "Okay." 105 + say "Okay, the " + (tstat_info[:hvac_mode] == "heat" ? "heat" : 106 + "air conditioning") + " has been turned off." 107 + else 108 + say "Okay." 109 + end 120 110 121 111 request_completed 122 112 end