2 Commits

Author SHA1 Message Date
Yurii
2589020428 refactor: optimized polling of unused OT IDs 2024-11-16 22:57:52 +03:00
Yurii
2bb771a4a7 chore: bump pioarduino/platform-espressif32 from 3.1.0 rc2 to 3.1.0 rc3 2024-11-16 22:56:01 +03:00
3 changed files with 22 additions and 22 deletions

View File

@@ -85,7 +85,7 @@ board_build.ldscript = eagle.flash.4m1m.ld
;platform_packages =
; framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.5
; framework-arduinoespressif32-libs @ https://github.com/espressif/esp32-arduino-lib-builder/releases/download/idf-release_v5.1/esp32-arduino-libs-idf-release_v5.1-33fbade6.zip
platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.10-rc2/platform-espressif32.zip
platform = https://github.com/pioarduino/platform-espressif32/releases/download/53.03.10-rc3/platform-espressif32.zip
platform_packages =
board_build.partitions = esp32_partitions.csv
lib_deps =

View File

@@ -462,8 +462,8 @@ protected:
// Update modulation level
if (
Sensors::getAmountByType(Sensors::Type::OT_MODULATION_LEVEL) ||
Sensors::getAmountByType(Sensors::Type::OT_CURRENT_POWER)
Sensors::getAmountByType(Sensors::Type::OT_MODULATION_LEVEL, true) ||
Sensors::getAmountByType(Sensors::Type::OT_CURRENT_POWER, true)
) {
if (vars.slave.flame) {
if (this->updateModulationLevel()) {
@@ -512,7 +512,7 @@ protected:
}
// Update DHW temp
if (settings.opentherm.dhwPresent && Sensors::getAmountByType(Sensors::Type::OT_DHW_TEMP)) {
if (settings.opentherm.dhwPresent && Sensors::getAmountByType(Sensors::Type::OT_DHW_TEMP, true)) {
bool result = this->updateDhwTemp();
if (result) {
@@ -538,7 +538,7 @@ protected:
}
// Update DHW temp 2
if (settings.opentherm.dhwPresent && Sensors::getAmountByType(Sensors::Type::OT_DHW_TEMP2)) {
if (settings.opentherm.dhwPresent && Sensors::getAmountByType(Sensors::Type::OT_DHW_TEMP2, true)) {
if (this->updateDhwTemp2()) {
float convertedDhwTemp2 = convertTemp(
vars.slave.dhw.currentTemp2,
@@ -562,7 +562,7 @@ protected:
}
// Update DHW flow rate
if (settings.opentherm.dhwPresent && Sensors::getAmountByType(Sensors::Type::OT_DHW_FLOW_RATE)) {
if (settings.opentherm.dhwPresent && Sensors::getAmountByType(Sensors::Type::OT_DHW_FLOW_RATE, true)) {
if (this->updateDhwFlowRate()) {
float convertedDhwFlowRate = convertVolume(
vars.slave.dhw.flowRate,
@@ -586,7 +586,7 @@ protected:
}
// Update heating temp
if (Sensors::getAmountByType(Sensors::Type::OT_HEATING_TEMP)) {
if (Sensors::getAmountByType(Sensors::Type::OT_HEATING_TEMP, true)) {
if (this->updateHeatingTemp()) {
float convertedHeatingTemp = convertTemp(
vars.slave.heating.currentTemp,
@@ -610,7 +610,7 @@ protected:
}
// Update heating return temp
if (Sensors::getAmountByType(Sensors::Type::OT_HEATING_RETURN_TEMP)) {
if (Sensors::getAmountByType(Sensors::Type::OT_HEATING_RETURN_TEMP, true)) {
if (this->updateHeatingReturnTemp()) {
float convertedHeatingReturnTemp = convertTemp(
vars.slave.heating.returnTemp,
@@ -634,7 +634,7 @@ protected:
}
// Update CH2 temp
if (Sensors::getAmountByType(Sensors::Type::OT_CH2_TEMP)) {
if (Sensors::getAmountByType(Sensors::Type::OT_CH2_TEMP, true)) {
if (vars.master.ch2.enabled && !settings.opentherm.nativeHeatingControl) {
if (this->updateCh2Temp()) {
float convertedCh2Temp = convertTemp(
@@ -660,7 +660,7 @@ protected:
}
// Update exhaust temp
if (Sensors::getAmountByType(Sensors::Type::OT_EXHAUST_TEMP)) {
if (Sensors::getAmountByType(Sensors::Type::OT_EXHAUST_TEMP, true)) {
if (this->updateExhaustTemp()) {
float convertedExhaustTemp = convertTemp(
vars.slave.exhaust.temp,
@@ -684,7 +684,7 @@ protected:
}
// Update heat exchanger temp
if (Sensors::getAmountByType(Sensors::Type::OT_HEAT_EXCHANGER_TEMP)) {
if (Sensors::getAmountByType(Sensors::Type::OT_HEAT_EXCHANGER_TEMP, true)) {
if (this->updateHeatExchangerTemp()) {
float convertedHeatExchTemp = convertTemp(
vars.slave.heatExchangerTemp,
@@ -708,7 +708,7 @@ protected:
}
// Update outdoor temp
if (Sensors::getAmountByType(Sensors::Type::OT_OUTDOOR_TEMP)) {
if (Sensors::getAmountByType(Sensors::Type::OT_OUTDOOR_TEMP, true)) {
if (this->updateOutdoorTemp()) {
float convertedOutdoorTemp = convertTemp(
vars.slave.heating.outdoorTemp,
@@ -732,7 +732,7 @@ protected:
}
// Update solar storage temp
if (Sensors::getAmountByType(Sensors::Type::OT_SOLAR_STORAGE_TEMP)) {
if (Sensors::getAmountByType(Sensors::Type::OT_SOLAR_STORAGE_TEMP, true)) {
if (this->updateSolarStorageTemp()) {
float convertedSolarStorageTemp = convertTemp(
vars.slave.solar.storage,
@@ -756,7 +756,7 @@ protected:
}
// Update solar collector temp
if (Sensors::getAmountByType(Sensors::Type::OT_SOLAR_COLLECTOR_TEMP)) {
if (Sensors::getAmountByType(Sensors::Type::OT_SOLAR_COLLECTOR_TEMP, true)) {
if (this->updateSolarCollectorTemp()) {
float convertedSolarCollectorTemp = convertTemp(
vars.slave.solar.collector,
@@ -781,8 +781,8 @@ protected:
// Update fan speed
if (
Sensors::getAmountByType(Sensors::Type::OT_FAN_SPEED_SETPOINT) ||
Sensors::getAmountByType(Sensors::Type::OT_FAN_SPEED_CURRENT)
Sensors::getAmountByType(Sensors::Type::OT_FAN_SPEED_SETPOINT, true) ||
Sensors::getAmountByType(Sensors::Type::OT_FAN_SPEED_CURRENT, true)
) {
if (this->updateFanSpeed()) {
Log.snoticeln(
@@ -802,7 +802,7 @@ protected:
}
// Update pressure
if (Sensors::getAmountByType(Sensors::Type::OT_PRESSURE)) {
if (Sensors::getAmountByType(Sensors::Type::OT_PRESSURE, true)) {
if (this->updatePressure()) {
float convertedPressure = convertPressure(
vars.slave.pressure,
@@ -826,7 +826,7 @@ protected:
}
// Update exhaust CO2
if (Sensors::getAmountByType(Sensors::Type::OT_EXHAUST_CO2)) {
if (Sensors::getAmountByType(Sensors::Type::OT_EXHAUST_CO2, true)) {
if (this->updateExhaustCo2()) {
Log.snoticeln(
FPSTR(L_OT), F("Received exhaust CO2: %hu ppm"),
@@ -844,7 +844,7 @@ protected:
}
// Update exhaust fan speed
if (Sensors::getAmountByType(Sensors::Type::OT_EXHAUST_FAN_SPEED)) {
if (Sensors::getAmountByType(Sensors::Type::OT_EXHAUST_FAN_SPEED, true)) {
if (this->updateExhaustFanSpeed()) {
Log.snoticeln(
FPSTR(L_OT), F("Received exhaust fan speed: %hu rpm"),
@@ -862,7 +862,7 @@ protected:
}
// Update supply fan speed
if (Sensors::getAmountByType(Sensors::Type::OT_SUPPLY_FAN_SPEED)) {
if (Sensors::getAmountByType(Sensors::Type::OT_SUPPLY_FAN_SPEED, true)) {
if (this->updateSupplyFanSpeed()) {
Log.snoticeln(
FPSTR(L_OT), F("Received supply fan speed: %hu rpm"),

View File

@@ -122,14 +122,14 @@ public:
return true;
}
static uint8_t getAmountByType(Type type) {
static uint8_t getAmountByType(Type type, bool onlyEnabled = false) {
if (settings == nullptr) {
return 0;
}
uint8_t amount = 0;
for (uint8_t id = 0; id < getMaxSensorId(); id++) {
if (settings[id].type == type) {
if (settings[id].type == type && (!onlyEnabled || settings[id].enabled)) {
amount++;
}
}