restore temp_today from KVS at startup
This commit is contained in:
		
							
								
								
									
										13
									
								
								pool.js
									
									
									
									
									
								
							
							
						
						
									
										13
									
								
								pool.js
									
									
									
									
									
								
							@@ -278,7 +278,7 @@ function update_temp(temp) {
 | 
			
		||||
  status.lock_update = false;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
// Set initial yesterday temp from KVS
 | 
			
		||||
// Set initial temps from KVS
 | 
			
		||||
Shelly.call (
 | 
			
		||||
  "KVS.Get",
 | 
			
		||||
  { key: "pool.temp_yesterday" },
 | 
			
		||||
@@ -290,6 +290,17 @@ Shelly.call (
 | 
			
		||||
  }
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
Shelly.call (
 | 
			
		||||
  "KVS.Get",
 | 
			
		||||
  { key: "pool.temp_today" },
 | 
			
		||||
  function (result) {
 | 
			
		||||
    if (result) {
 | 
			
		||||
      status.temp_today = result.value;
 | 
			
		||||
      print("[POOL] Restore from KVS: temp_today:", status.temp_today);
 | 
			
		||||
    }
 | 
			
		||||
  }
 | 
			
		||||
)
 | 
			
		||||
 | 
			
		||||
// receives update from Pool Sensor
 | 
			
		||||
// - trigger all temperature and pump updates
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user