Compare commits

..

No commits in common. '33e0c1e26a115a725d722e4828e0ceaebe3fa892' and 'e8f284b2910ee21726e836ac900d33bebb442c33' have entirely different histories.

@ -24,7 +24,6 @@ DallasTemperature sensor(&oneWire);
float temperature;
String metrics;
bool heating;
float reqTemp = 21.5;
float offset = 0.25;
@ -128,13 +127,13 @@ void setup() {
String repply;
if(request->hasParam("temp")) {
repply = String(temperature);
repply = temperature;
}else if(request->hasParam("relay")){
repply = String(heating);
repply = !digitalRead(RELAY_PIN);
}else if(THERMOSTAT && request->hasParam("reqtemp")){
repply = String(reqTemp);
repply = reqTemp;
}else if(THERMOSTAT && request->hasParam("offset")) {
repply = String(offset);
repply = offset;
}else{
repply = "unknown parameter";
}
@ -166,11 +165,9 @@ void notFound(AsyncWebServerRequest *request) {
void thermostatCheck(){
if(temperature < (reqTemp - offset)){
heating = 1;
digitalWrite(RELAY_PIN, !heating);
digitalWrite(RELAY_PIN, false);
}else if(temperature > (reqTemp + offset)){
heating = 0;
digitalWrite(RELAY_PIN, !heating);
digitalWrite(RELAY_PIN, true);
}
}
@ -184,15 +181,6 @@ void readSensor() {
}
metrics = "temp ";
metrics += temperature;
metrics += "\nraw_temp ";
metrics += tempC;
metrics += "\nheating ";
metrics += heating;
metrics += "\nreqTemp ";
metrics += reqTemp;
metrics += "\noffset ";
metrics += offset;
}
void startConversion() {