www-thermferm/getstate.php

changeset 397
00ca08f5a6f8
parent 371
44665f154ead
child 522
4d9ed666431d
equal deleted inserted replaced
396:66d4e137b99d 397:00ca08f5a6f8
33 33
34 $air_temperature = "NA"; 34 $air_temperature = "NA";
35 $air_state = "NA"; 35 $air_state = "NA";
36 $beer_temperature = "NA"; 36 $beer_temperature = "NA";
37 $beer_state = "NA"; 37 $beer_state = "NA";
38 $target_temperature = "NA"; 38 $target_temperature_lo = "NA";
39 $target_temperature_hi = "NA";
39 $led1 = $led2 = $led3 = $sw1 = $sw2 = $sw3 = ""; 40 $led1 = $led2 = $led3 = $sw1 = $sw2 = $sw3 = "";
40 $fridge_set = "NA"; 41 $fridge_set = "NA";
41 $beer_set = "NA"; 42 $beer_set = "NA";
42 $heater = $cooler = $fan = $psu = $door = "no"; 43 $heater = $cooler = $fan = $psu = $door = "no";
43 $prof_state = "OFF"; 44 $prof_state = "OFF";
85 if (($f[0] == "PSU_ADDRESS") && (strcmp($f[1], "(null)"))) 86 if (($f[0] == "PSU_ADDRESS") && (strcmp($f[1], "(null)")))
86 $psu = "yes"; 87 $psu = "yes";
87 if (($f[0] == "DOOR_ADDRESS") && (strcmp($f[1], "(null)"))) 88 if (($f[0] == "DOOR_ADDRESS") && (strcmp($f[1], "(null)")))
88 $door = "yes"; 89 $door = "yes";
89 if (($f[0] == "BEER_SET") && ($mode == "BEER")) 90 if (($f[0] == "BEER_SET") && ($mode == "BEER"))
90 $target_temperature = $f[1]; 91 $target_temperature_lo = $target_temperature_hi = $f[1];
91 if (($f[0] == "FRIDGE_SET") && ($mode == "FRIDGE")) 92 if (($f[0] == "FRIDGE_SET") && ($mode == "FRIDGE"))
92 $target_temperature = $f[1]; 93 $target_temperature_lo = $target_temperature_hi = $f[1];
93 if (($f[0] == "PROF_TARGET") && ($mode == "PROFILE")) 94 if (($f[0] == "PROF_TARGET_LO") && ($mode == "PROFILE"))
94 $target_temperature = $f[1]; 95 $target_temperature_lo = $f[1];
96 if (($f[0] == "PROF_TARGET_HI") && ($mode == "PROFILE"))
97 $target_temperature_hi = $f[1];
95 if (($f[0] == "PROF_STATE") && ($mode == "PROFILE")) 98 if (($f[0] == "PROF_STATE") && ($mode == "PROFILE"))
96 $prof_state = 'State: '.$f[1]; 99 $prof_state = 'State: '.$f[1];
97 $j++; 100 $j++;
98 } 101 }
99 } 102 }
137 $sw3 .= ' <input type="radio" name="FanState" onchange="this.form.submit()" value="100"'.$dis.$ch.'>On'.PHP_EOL; 140 $sw3 .= ' <input type="radio" name="FanState" onchange="this.form.submit()" value="100"'.$dis.$ch.'>On'.PHP_EOL;
138 141
139 142
140 143
141 $reply = array ( 144 $reply = array (
142 'air_temperature' => $air_temperature, 145 'air_temperature' => $air_temperature,
143 'beer_temperature' => $beer_temperature, 146 'beer_temperature' => $beer_temperature,
144 'target_temperature' => $target_temperature, 147 'target_temperature_lo' => $target_temperature_lo,
145 'mode' => $modestr, 148 'target_temperature_hi' => $target_temperature_hi,
146 'led1' => $led1, 149 'mode' => $modestr,
147 'led2' => $led2, 150 'led1' => $led1,
148 'led3' => $led3, 151 'led2' => $led2,
149 'sw1' => $sw1, 152 'led3' => $led3,
150 'sw2' => $sw2, 153 'sw1' => $sw1,
151 'sw3' => $sw3, 154 'sw2' => $sw2,
152 'profile_state' => $prof_state 155 'sw3' => $sw3,
156 'profile_state' => $prof_state
153 ); 157 );
154 158
155 159
156 echo json_encode($reply); 160 echo json_encode($reply);
157 ?> 161 ?>

mercurial