www-thermferm/getstate.php

changeset 522
4d9ed666431d
parent 397
00ca08f5a6f8
child 529
00b45f2aaac3
equal deleted inserted replaced
521:28d1f5188c1d 522:4d9ed666431d
1 <?php 1 <?php
2 /***************************************************************************** 2 /*****************************************************************************
3 * Copyright (C) 2014 3 * Copyright (C) 2014-2017
4 * 4 *
5 * Michiel Broek <mbroek at mbse dot eu> 5 * Michiel Broek <mbroek at mbse dot eu>
6 * 6 *
7 * This file is part of ThermFerm 7 * This file is part of ThermFerm
8 * 8 *
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 $chiller_temperature = "NA";
39 $chiller_state = "NA";
38 $target_temperature_lo = "NA"; 40 $target_temperature_lo = "NA";
39 $target_temperature_hi = "NA"; 41 $target_temperature_hi = "NA";
40 $led1 = $led2 = $led3 = $sw1 = $sw2 = $sw3 = ""; 42 $led1 = $led2 = $led3 = $sw1 = $sw2 = $sw3 = "";
41 $fridge_set = "NA"; 43 $fridge_set = "NA";
42 $beer_set = "NA"; 44 $beer_set = "NA";
43 $heater = $cooler = $fan = $psu = $door = "no"; 45 $heater = $cooler = $chiller = $fan = $psu = $door = "no";
44 $prof_state = "OFF"; 46 $prof_state = "OFF";
45 $mode = "NA"; 47 $mode = "NA";
46 $cooler_state = "NA"; 48 $cooler_state = "NA";
47 $heater_state = "NA"; 49 $heater_state = "NA";
48 $fan_state = "NA"; 50 $fan_state = "NA";
61 $air_temperature = $f[1]; 63 $air_temperature = $f[1];
62 if ($f[0] == "BEER_STATE") 64 if ($f[0] == "BEER_STATE")
63 $beer_state = $f[1]; 65 $beer_state = $f[1];
64 if (($f[0] == "BEER_TEMPERATURE") && ($beer_state == "OK")) 66 if (($f[0] == "BEER_TEMPERATURE") && ($beer_state == "OK"))
65 $beer_temperature = $f[1]; 67 $beer_temperature = $f[1];
68 if ($f[0] == "CHILLER_STATE")
69 $chiller_state = $f[1];
70 if (($f[0] == "CHILLER_TEMPERATURE") && ($chiller_state == "OK"))
71 $chiller_temperature = $f[1];
66 if ($f[0] == "MODE") 72 if ($f[0] == "MODE")
67 $mode = $f[1]; 73 $mode = $f[1];
68 if (($f[0] == "COOLER_ADDRESS") && (strcmp($f[1], "(null)"))) 74 if (($f[0] == "COOLER_ADDRESS") && (strcmp($f[1], "(null)")))
69 $cooler = "yes"; 75 $cooler = "yes";
70 if ($f[0] == "COOLER_STATE") { 76 if ($f[0] == "COOLER_STATE") {
142 148
143 149
144 $reply = array ( 150 $reply = array (
145 'air_temperature' => $air_temperature, 151 'air_temperature' => $air_temperature,
146 'beer_temperature' => $beer_temperature, 152 'beer_temperature' => $beer_temperature,
153 'chiller_temperature' => $chiller_temperature,
147 'target_temperature_lo' => $target_temperature_lo, 154 'target_temperature_lo' => $target_temperature_lo,
148 'target_temperature_hi' => $target_temperature_hi, 155 'target_temperature_hi' => $target_temperature_hi,
149 'mode' => $modestr, 156 'mode' => $modestr,
150 'led1' => $led1, 157 'led1' => $led1,
151 'led2' => $led2, 158 'led2' => $led2,

mercurial