refactor: some changes

This commit is contained in:
Yurii
2024-11-12 15:26:28 +03:00
parent b205f14bae
commit b087e6e6d3
2 changed files with 30 additions and 31 deletions

View File

@@ -106,21 +106,15 @@ protected:
} }
inline float getHeatingMinSetpointTemp() { inline float getHeatingMinSetpointTemp() {
if (settings.opentherm.nativeHeatingControl) { return settings.opentherm.nativeHeatingControl
return vars.master.heating.minTemp; ? vars.master.heating.minTemp
: settings.heating.minTemp;
} else {
return settings.heating.minTemp;
}
} }
inline float getHeatingMaxSetpointTemp() { inline float getHeatingMaxSetpointTemp() {
if (settings.opentherm.nativeHeatingControl) { return settings.opentherm.nativeHeatingControl
return vars.master.heating.maxTemp; ? vars.master.heating.maxTemp
: settings.heating.maxTemp;
} else {
return settings.heating.maxTemp;
}
} }
float getHeatingSetpointTemp() { float getHeatingSetpointTemp() {

View File

@@ -171,6 +171,10 @@ public:
auto& rSensor = results[sensorId]; auto& rSensor = results[sensorId];
float compensatedValue = value; float compensatedValue = value;
if (sSensor.type == Type::HEATING_SETPOINT_TEMP || sSensor.type == Type::MANUAL) {
rSensor.values[valueId] = compensatedValue;
} else {
if (valueType == ValueType::PRIMARY) { if (valueType == ValueType::PRIMARY) {
if (fabsf(sSensor.factor) > 0.001f) { if (fabsf(sSensor.factor) > 0.001f) {
compensatedValue *= sSensor.factor; compensatedValue *= sSensor.factor;
@@ -192,6 +196,7 @@ public:
} else { } else {
rSensor.values[valueId] = compensatedValue; rSensor.values[valueId] = compensatedValue;
} }
}
if (updateActivityTime) { if (updateActivityTime) {
rSensor.activityTime = millis(); rSensor.activityTime = millis();