Added function to connect to sensor hosts and collect/send data

pull/2/head
Aaron Johnson 6 years ago
parent e8f44866c3
commit 6ec2ecb4d3

@ -1,4 +1,7 @@
def process_callback_zone(message)
host = message.data.split("|")[1]
send_message(message.message.chat.id, "You have selected #{host}!")
tdata = `ssh #{host} heatbot_gettemp`
zone = @probes[host].values.first
puts "Selected: #{zone}"
send_message(message.message.chat.id, "#{zone}: #{tdata}°#{@tunit}")
end

Loading…
Cancel
Save