mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-11 02:34:29 +05:00
refactor: some changes
This commit is contained in:
@@ -106,21 +106,15 @@ protected:
|
||||
}
|
||||
|
||||
inline float getHeatingMinSetpointTemp() {
|
||||
if (settings.opentherm.nativeHeatingControl) {
|
||||
return vars.master.heating.minTemp;
|
||||
|
||||
} else {
|
||||
return settings.heating.minTemp;
|
||||
}
|
||||
return settings.opentherm.nativeHeatingControl
|
||||
? vars.master.heating.minTemp
|
||||
: settings.heating.minTemp;
|
||||
}
|
||||
|
||||
inline float getHeatingMaxSetpointTemp() {
|
||||
if (settings.opentherm.nativeHeatingControl) {
|
||||
return vars.master.heating.maxTemp;
|
||||
|
||||
} else {
|
||||
return settings.heating.maxTemp;
|
||||
}
|
||||
return settings.opentherm.nativeHeatingControl
|
||||
? vars.master.heating.maxTemp
|
||||
: settings.heating.maxTemp;
|
||||
}
|
||||
|
||||
float getHeatingSetpointTemp() {
|
||||
|
||||
@@ -171,26 +171,31 @@ public:
|
||||
auto& rSensor = results[sensorId];
|
||||
|
||||
float compensatedValue = value;
|
||||
if (valueType == ValueType::PRIMARY) {
|
||||
if (fabsf(sSensor.factor) > 0.001f) {
|
||||
compensatedValue *= sSensor.factor;
|
||||
}
|
||||
|
||||
if (fabsf(sSensor.offset) > 0.001f) {
|
||||
compensatedValue += sSensor.offset;
|
||||
}
|
||||
|
||||
} else if (valueType == ValueType::RSSI) {
|
||||
if (sSensor.type == Type::BLUETOOTH) {
|
||||
rSensor.signalQuality = Sensors::bluetoothRssiToQuality(value);
|
||||
}
|
||||
}
|
||||
|
||||
if (sSensor.filtering && fabs(rSensor.values[valueId]) >= 0.1f) {
|
||||
rSensor.values[valueId] += (compensatedValue - rSensor.values[valueId]) * sSensor.filteringFactor;
|
||||
|
||||
} else {
|
||||
if (sSensor.type == Type::HEATING_SETPOINT_TEMP || sSensor.type == Type::MANUAL) {
|
||||
rSensor.values[valueId] = compensatedValue;
|
||||
|
||||
} else {
|
||||
if (valueType == ValueType::PRIMARY) {
|
||||
if (fabsf(sSensor.factor) > 0.001f) {
|
||||
compensatedValue *= sSensor.factor;
|
||||
}
|
||||
|
||||
if (fabsf(sSensor.offset) > 0.001f) {
|
||||
compensatedValue += sSensor.offset;
|
||||
}
|
||||
|
||||
} else if (valueType == ValueType::RSSI) {
|
||||
if (sSensor.type == Type::BLUETOOTH) {
|
||||
rSensor.signalQuality = Sensors::bluetoothRssiToQuality(value);
|
||||
}
|
||||
}
|
||||
|
||||
if (sSensor.filtering && fabs(rSensor.values[valueId]) >= 0.1f) {
|
||||
rSensor.values[valueId] += (compensatedValue - rSensor.values[valueId]) * sSensor.filteringFactor;
|
||||
|
||||
} else {
|
||||
rSensor.values[valueId] = compensatedValue;
|
||||
}
|
||||
}
|
||||
|
||||
if (updateActivityTime) {
|
||||
|
||||
Reference in New Issue
Block a user