mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-13 03:34:28 +05:00
feat: added diagnostic code polling via opentherm, added hex value for fault code and diag code
This commit is contained in:
@@ -347,6 +347,14 @@ protected:
|
||||
vars.sensors.faultCode = 0;
|
||||
}
|
||||
|
||||
// Get diagnostic code (if necessary)
|
||||
if (vars.states.fault || vars.states.diagnostic) {
|
||||
updateDiagCode();
|
||||
|
||||
} else if (vars.sensors.diagnosticCode != 0) {
|
||||
vars.sensors.diagnosticCode = 0;
|
||||
}
|
||||
|
||||
updatePressure();
|
||||
|
||||
this->prevUpdateNonEssentialVars = millis();
|
||||
@@ -933,6 +941,7 @@ protected:
|
||||
));
|
||||
|
||||
if (!CustomOpenTherm::isValidResponse(response)) {
|
||||
vars.sensors.faultCode = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -940,6 +949,22 @@ protected:
|
||||
return true;
|
||||
}
|
||||
|
||||
bool updateDiagCode() {
|
||||
unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest(
|
||||
OpenThermRequestType::READ_DATA,
|
||||
OpenThermMessageID::OEMDiagnosticCode,
|
||||
0
|
||||
));
|
||||
|
||||
if (!CustomOpenTherm::isValidResponse(response)) {
|
||||
vars.sensors.diagnosticCode = 0;
|
||||
return false;
|
||||
}
|
||||
|
||||
vars.sensors.diagnosticCode = CustomOpenTherm::getUInt(response);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool updateModulationLevel() {
|
||||
unsigned long response = this->instance->sendRequest(CustomOpenTherm::buildRequest(
|
||||
OpenThermRequestType::READ_DATA,
|
||||
|
||||
Reference in New Issue
Block a user