diff options
-rw-r--r-- | scarecrow.rb | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/scarecrow.rb b/scarecrow.rb index b4fadf9..defc135 100644 --- a/scarecrow.rb +++ b/scarecrow.rb @@ -66,7 +66,14 @@ def handle_temp_message(msg) end get '/' do - send_file File.join(settings.public_folder, 'index.html') + # send_file File.join(settings.public_folder, 'index.html') + temp_val = Temperature.last[:value] + humidity_val = Humidity.last[:value] + temp_time = Temperature.last[:timestamp] + humidity_time = Humidity.last[:timestamp] + time_formatted = temp_time.strftime("%A, %d %b %Y %l:%M %p") + + return "#{temp_val}°C and #{humidity_val}% humidity at #{time_formatted}" end get '/temperature' do @@ -75,8 +82,8 @@ get '/temperature' do end get '/humidity' do - temp = Humidity.last[:value] - "#{temp}" + humidity = Humidity.last[:value] + "#{humidity}" end init |