From 641b1d36736a4136e68d06822a56e464026985ba Mon Sep 17 00:00:00 2001 From: TheYOSH Date: Mon, 21 May 2018 22:19:33 +0200 Subject: [PATCH] Quick fix sprayer info --- static/js/terrariumpi.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/static/js/terrariumpi.js b/static/js/terrariumpi.js index c66d907bf..b288f8ded 100644 --- a/static/js/terrariumpi.js +++ b/static/js/terrariumpi.js @@ -408,7 +408,7 @@ function websocket_init(reconnect) { break; case 'environment': - $.each(['heater','humidity','light','cooler','watertank','moisture','ph','light'], function(index, value) { + $.each(['heater','sprayer','light','cooler','watertank','moisture','ph','light'], function(index, value) { update_dashboard_environment(value, data.data[value]); }); break; @@ -679,7 +679,7 @@ function process_form() { function prepare_form_data(form) { var formdata = []; var form_type = form.attr('action').split('/').pop(); - var re = /(sensor|switch|webcam|light|humidity|watertank|moisture|heater|cooler|ph|door|profile|playlist)(_\d+)?_(.*)/i; + var re = /(sensor|switch|webcam|light|sprayer|watertank|moisture|heater|cooler|ph|door|profile|playlist)(_\d+)?_(.*)/i; var matches = null; var objectdata = {}; var prev_nr = -1; @@ -1095,6 +1095,7 @@ function history_graph(name, data, type) { break; case 'humidity': + case 'sprayer': case 'average_humidity': case 'moisture': val = formatNumber(val) + ' %'; @@ -1133,6 +1134,7 @@ function history_graph(name, data, type) { }; switch (type) { + case 'sprayer': case 'humidity': case 'temperature': case 'distance': @@ -1530,6 +1532,7 @@ function update_dashboard_environment(name, data) { case 'heater': enabledColor = 'red'; break; + case 'sprayer': case 'humidity': case 'moisture': indicator = '%';