···97979898 # turn the heat off - require confirmation on this, getting it wrong can suck
9999 listen_for /turn the (heat|air( conditioning)?) off/i do
100100- say "Are you sure you want to turn the #{match_data[1]} off?"
101101- set_state :turn_sys_off
102102-103103- request_completed
104104- end
105105- listen_for /#{CONFIRM_REGEX}/i, :within_state => :turn_sys_off do
106106- set_state nil
107107- tstat_info = @thermostat.tstat_info
108108-109109- @thermostat.turn_hvac_off!
110110-111111- say "Okay, the " + (tstat_info[:hvac_mode] == "heat" ? "heat" :
112112- "air conditioning") + " has been turned off."
100100+ if confirm "Are you sure you want to turn the #{match_data[1]} off?"
101101+ tstat_info = @thermostat.tstat_info
113102114114- request_completed
115115- end
116116- listen_for /#{DENY_REGEX}/i, :within_state => :turn_sys_off do
117117- set_state nil
103103+ @thermostat.turn_hvac_off!
118104119119- say "Okay."
105105+ say "Okay, the " + (tstat_info[:hvac_mode] == "heat" ? "heat" :
106106+ "air conditioning") + " has been turned off."
107107+ else
108108+ say "Okay."
109109+ end
120110121111 request_completed
122112 end