|
|
|
@ -60,6 +60,8 @@ void setup() {
|
|
|
|
|
//========== Pin setup ==========
|
|
|
|
|
|
|
|
|
|
pinMode(RELAY_PIN, OUTPUT);
|
|
|
|
|
pinMode(LED_PIN, OUTPUT);
|
|
|
|
|
digitalWrite(LED_PIN, HIGH);
|
|
|
|
|
|
|
|
|
|
//========== Sensor setup ==========
|
|
|
|
|
|
|
|
|
@ -82,6 +84,7 @@ void setup() {
|
|
|
|
|
if(METRICS_EXPORT || API){
|
|
|
|
|
if(METRICS_EXPORT){
|
|
|
|
|
server.on("/metrics", HTTP_GET, [](AsyncWebServerRequest *request){
|
|
|
|
|
tasker.setTimeout(ledBlink, 10);
|
|
|
|
|
request->send(200, "text/plain; charset=utf-8", metrics);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
@ -182,3 +185,8 @@ void startConversion() {
|
|
|
|
|
// schedule reading the actual temperature in 750 milliseconds
|
|
|
|
|
tasker.setTimeout(readSensor, 750);
|
|
|
|
|
}
|
|
|
|
|
void ledBlink() {
|
|
|
|
|
digitalWrite(LED_PIN, LOW);
|
|
|
|
|
delay(200);
|
|
|
|
|
digitalWrite(LED_PIN, HIGH);
|
|
|
|
|
}
|
|
|
|
|