mirror of
				https://github.com/beestat/app.git
				synced 2025-11-03 18:37:01 -05:00 
			
		
		
		
	Fixed #365 - IAQ values above 255 don't get stored
Also did database alter and copy to new table.
This commit is contained in:
		
							parent
							
								
									90271706ee
								
							
						
					
					
						commit
						c579cc9a38
					
				@ -815,25 +815,13 @@ class runtime extends cora\api {
 | 
			
		||||
                    $datas[$sensor['sensor_id']]['air_pressure'] = $value;
 | 
			
		||||
                  break;
 | 
			
		||||
                  case 'airQuality':
 | 
			
		||||
                    // Apparently this value can get larger than 255. Temporary
 | 
			
		||||
                    // fix until I can rebuild this table. Max I saw: 256
 | 
			
		||||
                    if($value > 255) {
 | 
			
		||||
                      $datas[$sensor['sensor_id']]['air_quality'] = null;
 | 
			
		||||
                    } else {
 | 
			
		||||
                    $datas[$sensor['sensor_id']]['air_quality'] = $value;
 | 
			
		||||
                    }
 | 
			
		||||
                  break;
 | 
			
		||||
                  case 'airQualityAccuracy':
 | 
			
		||||
                    $datas[$sensor['sensor_id']]['air_quality_accuracy'] = $value;
 | 
			
		||||
                  break;
 | 
			
		||||
                  case 'vocPPM':
 | 
			
		||||
                    // Apparently this value can get larger than 65535. Temporary
 | 
			
		||||
                    // fix until I can rebuild this table. Max I saw: 120071
 | 
			
		||||
                    if($value > 65535) {
 | 
			
		||||
                      $datas[$sensor['sensor_id']]['voc_concentration'] = null;
 | 
			
		||||
                    } else {
 | 
			
		||||
                    $datas[$sensor['sensor_id']]['voc_concentration'] = $value;
 | 
			
		||||
                    }
 | 
			
		||||
                  break;
 | 
			
		||||
                  case 'co2PPM':
 | 
			
		||||
                    $datas[$sensor['sensor_id']]['co2_concentration'] = $value;
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user