Skip to content

Commit fcb4c35

Browse files
committed
agriculture: change the rain symbol depending on the rain difference instead of the rain accumulated
Signed-off-by: Victor Coman <victor.coman@digi.com>
1 parent 4a20395 commit fcb4c35

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

agriculture/static/js/dashboard.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ var stationValves = {};
137137
var controllerWind = null;
138138
var controllerWindDir = null;
139139
var controllerRain = null;
140+
var controllerRainDiff = null;
140141
var controllerRadiation = null;
141142
var controllerLuminosity = null;
142143
var controllerTemperature = null;
@@ -550,6 +551,7 @@ function updateWeatherStation(response) {
550551
controllerWindDirInfowElement.innerText = weatherStationStatus[ID_WIND_DIR];
551552

552553
// Update the rain value.
554+
controllerRainDiff = weatherStationStatus[ID_RAIN];
553555
controllerRain = weatherStationStatus[ID_RAIN_ACC];
554556
let controllerRainElement = document.getElementById(ID_RAIN_ACC);
555557
if (controllerRainElement != null)
@@ -956,7 +958,8 @@ function updateCurrentWeather() {
956958
currentWeatherIcon = SUN_GREEN;
957959
currentWeatherStatus = "sunny";
958960

959-
rain = document.getElementById("rain_acc").innerText;
961+
//rain = document.getElementById("rain_acc").innerText;
962+
rain = controllerRainDiff
960963
rain = parseInt(rain)
961964
luminosity = document.getElementById("luminosity").innerText;
962965
luminosity = parseInt(luminosity)

0 commit comments

Comments
 (0)