mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-11 18:54:28 +05:00
refactor: some changes
This commit is contained in:
@@ -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() {
|
||||||
|
|||||||
@@ -171,26 +171,31 @@ public:
|
|||||||
auto& rSensor = results[sensorId];
|
auto& rSensor = results[sensorId];
|
||||||
|
|
||||||
float compensatedValue = value;
|
float compensatedValue = value;
|
||||||
if (valueType == ValueType::PRIMARY) {
|
if (sSensor.type == Type::HEATING_SETPOINT_TEMP || sSensor.type == Type::MANUAL) {
|
||||||
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;
|
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) {
|
if (updateActivityTime) {
|
||||||
|
|||||||
Reference in New Issue
Block a user