@@ -200,6 +200,9 @@ def run(self, current_time, points):
200200 if key .startswith (self .zone_temp_name ) and value is not None :
201201 zone_temp_data .append (value )
202202
203+ if len (zone_temp_data ) == 0 :
204+ return diagnostic_result
205+
203206 zonetemp = (sum (zone_temp_data ) / len (zone_temp_data ))
204207 fanstat = None
205208 if len (fan_stat_data )> 0 :
@@ -412,17 +415,18 @@ def get_output_obj(self, datetime, rec_type=type_data,
412415
413416 def on_new_data (self , timestamp , fanstat , zonetemp , diagnostic_result ):
414417 self .inconsistent_data_flag = 0
415- fanstat_value = int (fanstat )
418+ fanstat_value = None
419+ if fanstat is not None :
420+ fanstat_value = int (fanstat )
416421 zonetemp_val = float (zonetemp )
417422 #Insert raw data for plotting
418423 row = self .get_output_obj (timestamp , type_data ,
419424 FanStatus = fanstat_value , ZoneTemp = zonetemp_val )
420425 diagnostic_result .insert_table_row ('SetpointDetector' , row )
421426 #Dx
422- if not fanstat_value :
423- diagnostic_result .log ('Supply fan is off. Data for {} '
424- 'will not used' .format (str (timestamp )), logging .DEBUG )
425- return diagnostic_result
427+ if fanstat_value is None :
428+ diagnostic_result .log ('Supply fan is off. {}' .format (str (timestamp )), logging .DEBUG )
429+ #return diagnostic_result
426430
427431 diagnostic_result = self .detect_stpt_main (zonetemp_val , timestamp , diagnostic_result )
428432 return diagnostic_result
@@ -443,7 +447,7 @@ def detect_stpt_main(self, zone_temp, current_time, diagnostic_result):
443447 peak_array , valley_array = align_pv (filtered_timeseries , peaks , valleys , self .timestamp_array )
444448 if (np .prod (peak_array .shape ) < self .minimum_data_count or
445449 np .prod (valley_array .shape ) < self .minimum_data_count ):
446- diagnostic_result .debug ('Set point detection is inconclusive. Not enough data.' , logging .DEBUG )
450+ diagnostic_result .log ('Set point detection is inconclusive. Not enough data.' , logging .DEBUG )
447451 self .initialize ()
448452 return diagnostic_result
449453
0 commit comments