mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-10 18:24:27 +05:00
refactor: improved work with opentherm on esp32
This commit is contained in:
@@ -138,7 +138,12 @@ protected:
|
||||
return;
|
||||
|
||||
} else if (this->instance->status == OpenThermStatus::NOT_INITIALIZED) {
|
||||
this->instance->begin();
|
||||
if (!this->instance->begin()) {
|
||||
Log.swarningln(FPSTR(L_OT), F("Failed begin"));
|
||||
|
||||
this->delay(5000);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// RX LED GPIO setup
|
||||
@@ -212,6 +217,20 @@ protected:
|
||||
F("Failed receive boiler status: %s"),
|
||||
CustomOpenTherm::statusToString(this->instance->getLastResponseStatus())
|
||||
);
|
||||
|
||||
} else {
|
||||
vars.slave.heating.active = CustomOpenTherm::isCentralHeatingActive(response);
|
||||
vars.slave.dhw.active = settings.opentherm.options.dhwSupport ? CustomOpenTherm::isHotWaterActive(response) : false;
|
||||
vars.slave.flame = CustomOpenTherm::isFlameOn(response);
|
||||
vars.slave.cooling = CustomOpenTherm::isCoolingActive(response);
|
||||
vars.slave.fault.active = CustomOpenTherm::isFault(response);
|
||||
vars.slave.diag.active = CustomOpenTherm::isDiagnostic(response);
|
||||
|
||||
Log.snoticeln(
|
||||
FPSTR(L_OT), F("Received boiler status. Heating: %hhu; DHW: %hhu; flame: %hhu; cooling: %hhu; fault: %hhu; diag: %hhu"),
|
||||
vars.slave.heating.active, vars.slave.dhw.active,
|
||||
vars.slave.flame, vars.slave.cooling, vars.slave.fault.active, vars.slave.diag.active
|
||||
);
|
||||
}
|
||||
|
||||
// 5 request retries
|
||||
@@ -310,19 +329,6 @@ protected:
|
||||
Log.sinfoln(FPSTR(L_OT_DHW), vars.master.dhw.enabled ? F("Enabled") : F("Disabled"));
|
||||
}
|
||||
|
||||
vars.slave.heating.active = CustomOpenTherm::isCentralHeatingActive(response);
|
||||
vars.slave.dhw.active = settings.opentherm.options.dhwSupport ? CustomOpenTherm::isHotWaterActive(response) : false;
|
||||
vars.slave.flame = CustomOpenTherm::isFlameOn(response);
|
||||
vars.slave.cooling = CustomOpenTherm::isCoolingActive(response);
|
||||
vars.slave.fault.active = CustomOpenTherm::isFault(response);
|
||||
vars.slave.diag.active = CustomOpenTherm::isDiagnostic(response);
|
||||
|
||||
Log.snoticeln(
|
||||
FPSTR(L_OT), F("Received boiler status. Heating: %hhu; DHW: %hhu; flame: %hhu; cooling: %hhu; fault: %hhu; diag: %hhu"),
|
||||
vars.slave.heating.active, vars.slave.dhw.active,
|
||||
vars.slave.flame, vars.slave.cooling, vars.slave.fault.active, vars.slave.diag.active
|
||||
);
|
||||
|
||||
// These parameters will be updated every minute
|
||||
if (millis() - this->prevUpdateNonEssentialVars > 60000) {
|
||||
if (this->updateMinModulationLevel()) {
|
||||
|
||||
Reference in New Issue
Block a user