mirror of
https://github.com/Laxilef/OTGateway.git
synced 2025-12-12 03:04:27 +05:00
refactoring
This commit is contained in:
105
src/MqttTask.h
105
src/MqttTask.h
@@ -394,69 +394,79 @@ protected:
|
|||||||
|
|
||||||
void publishHaEntities() {
|
void publishHaEntities() {
|
||||||
// main
|
// main
|
||||||
haHelper.publishSelectOutdoorSensorType(); yield();
|
haHelper.publishSelectOutdoorSensorType();
|
||||||
haHelper.publishSelectIndoorSensorType(); yield();
|
haHelper.publishSelectIndoorSensorType();
|
||||||
haHelper.publishNumberOutdoorSensorOffset(false); yield();
|
haHelper.publishNumberOutdoorSensorOffset(false);
|
||||||
haHelper.publishNumberIndoorSensorOffset(false); yield();
|
haHelper.publishNumberIndoorSensorOffset(false);
|
||||||
haHelper.publishSwitchDebug(false); yield();
|
haHelper.publishSwitchDebug(false);
|
||||||
|
yield();
|
||||||
|
|
||||||
// emergency
|
// emergency
|
||||||
haHelper.publishSwitchEmergency(); yield();
|
haHelper.publishSwitchEmergency();
|
||||||
haHelper.publishNumberEmergencyTarget(); yield();
|
haHelper.publishNumberEmergencyTarget();
|
||||||
haHelper.publishSwitchEmergencyUseEquitherm(); yield();
|
haHelper.publishSwitchEmergencyUseEquitherm();
|
||||||
|
yield();
|
||||||
|
|
||||||
// heating
|
// heating
|
||||||
haHelper.publishSwitchHeating(false); yield();
|
haHelper.publishSwitchHeating(false);
|
||||||
haHelper.publishSwitchHeatingTurbo(); yield();
|
haHelper.publishSwitchHeatingTurbo();
|
||||||
haHelper.publishNumberHeatingHysteresis(); yield();
|
haHelper.publishNumberHeatingHysteresis();
|
||||||
haHelper.publishSensorHeatingSetpoint(false); yield();
|
haHelper.publishSensorHeatingSetpoint(false);
|
||||||
haHelper.publishSensorCurrentHeatingMinTemp(false); yield();
|
haHelper.publishSensorCurrentHeatingMinTemp(false);
|
||||||
haHelper.publishSensorCurrentHeatingMaxTemp(false); yield();
|
yield();
|
||||||
haHelper.publishNumberHeatingMinTemp(false); yield();
|
haHelper.publishSensorCurrentHeatingMaxTemp(false);
|
||||||
haHelper.publishNumberHeatingMaxTemp(false); yield();
|
haHelper.publishNumberHeatingMinTemp(false);
|
||||||
haHelper.publishNumberHeatingMaxModulation(false); yield();
|
haHelper.publishNumberHeatingMaxTemp(false);
|
||||||
|
haHelper.publishNumberHeatingMaxModulation(false);
|
||||||
|
yield();
|
||||||
|
|
||||||
// pid
|
// pid
|
||||||
haHelper.publishSwitchPID(); yield();
|
haHelper.publishSwitchPID();
|
||||||
haHelper.publishNumberPIDFactorP(); yield();
|
haHelper.publishNumberPIDFactorP();
|
||||||
haHelper.publishNumberPIDFactorI(); yield();
|
haHelper.publishNumberPIDFactorI();
|
||||||
haHelper.publishNumberPIDFactorD(); yield();
|
haHelper.publishNumberPIDFactorD();
|
||||||
haHelper.publishNumberPIDMinTemp(false); yield();
|
haHelper.publishNumberPIDMinTemp(false);
|
||||||
haHelper.publishNumberPIDMaxTemp(false); yield();
|
haHelper.publishNumberPIDMaxTemp(false);
|
||||||
|
yield();
|
||||||
|
|
||||||
// equitherm
|
// equitherm
|
||||||
haHelper.publishSwitchEquitherm(); yield();
|
haHelper.publishSwitchEquitherm();
|
||||||
haHelper.publishNumberEquithermFactorN(); yield();
|
haHelper.publishNumberEquithermFactorN();
|
||||||
haHelper.publishNumberEquithermFactorK(); yield();
|
haHelper.publishNumberEquithermFactorK();
|
||||||
haHelper.publishNumberEquithermFactorT(); yield();
|
haHelper.publishNumberEquithermFactorT();
|
||||||
|
yield();
|
||||||
|
|
||||||
// tuning
|
// tuning
|
||||||
haHelper.publishSwitchTuning(); yield();
|
haHelper.publishSwitchTuning();
|
||||||
haHelper.publishSelectTuningRegulator(); yield();
|
haHelper.publishSelectTuningRegulator();
|
||||||
|
yield();
|
||||||
|
|
||||||
// states
|
// states
|
||||||
haHelper.publishBinSensorStatus(); yield();
|
haHelper.publishBinSensorStatus();
|
||||||
haHelper.publishBinSensorOtStatus(); yield();
|
haHelper.publishBinSensorOtStatus();
|
||||||
haHelper.publishBinSensorHeating(); yield();
|
haHelper.publishBinSensorHeating();
|
||||||
haHelper.publishBinSensorFlame(); yield();
|
haHelper.publishBinSensorFlame();
|
||||||
haHelper.publishBinSensorFault(); yield();
|
haHelper.publishBinSensorFault();
|
||||||
haHelper.publishBinSensorDiagnostic(); yield();
|
haHelper.publishBinSensorDiagnostic();
|
||||||
|
yield();
|
||||||
|
|
||||||
// sensors
|
// sensors
|
||||||
haHelper.publishSensorModulation(false); yield();
|
haHelper.publishSensorModulation(false);
|
||||||
haHelper.publishSensorPressure(false); yield();
|
haHelper.publishSensorPressure(false);
|
||||||
haHelper.publishSensorFaultCode(); yield();
|
haHelper.publishSensorFaultCode();
|
||||||
haHelper.publishSensorRssi(false); yield();
|
haHelper.publishSensorRssi(false);
|
||||||
haHelper.publishSensorUptime(false); yield();
|
haHelper.publishSensorUptime(false);
|
||||||
|
yield();
|
||||||
|
|
||||||
// temperatures
|
// temperatures
|
||||||
haHelper.publishNumberIndoorTemp(); yield();
|
haHelper.publishNumberIndoorTemp();
|
||||||
haHelper.publishSensorHeatingTemp(); yield();
|
haHelper.publishSensorHeatingTemp();
|
||||||
|
yield();
|
||||||
|
|
||||||
// buttons
|
// buttons
|
||||||
haHelper.publishButtonRestart(false); yield();
|
haHelper.publishButtonRestart(false);
|
||||||
haHelper.publishButtonResetFault(); yield();
|
haHelper.publishButtonResetFault();
|
||||||
haHelper.publishButtonResetDiagnostic(); yield();
|
haHelper.publishButtonResetDiagnostic();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool publishNonStaticHaEntities(bool force = false) {
|
bool publishNonStaticHaEntities(bool force = false) {
|
||||||
@@ -497,6 +507,7 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
published = true;
|
published = true;
|
||||||
|
yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (force || _heatingMinTemp != heatingMinTemp || _heatingMaxTemp != heatingMaxTemp) {
|
if (force || _heatingMinTemp != heatingMinTemp || _heatingMaxTemp != heatingMaxTemp) {
|
||||||
@@ -512,12 +523,14 @@ protected:
|
|||||||
haHelper.publishClimateHeating(heatingMinTemp, heatingMaxTemp, isStupidMode ? HaHelper::TEMP_SOURCE_HEATING : HaHelper::TEMP_SOURCE_INDOOR);
|
haHelper.publishClimateHeating(heatingMinTemp, heatingMaxTemp, isStupidMode ? HaHelper::TEMP_SOURCE_HEATING : HaHelper::TEMP_SOURCE_INDOOR);
|
||||||
|
|
||||||
published = true;
|
published = true;
|
||||||
|
yield();
|
||||||
|
|
||||||
} else if (_isStupidMode != isStupidMode) {
|
} else if (_isStupidMode != isStupidMode) {
|
||||||
_isStupidMode = isStupidMode;
|
_isStupidMode = isStupidMode;
|
||||||
haHelper.publishClimateHeating(heatingMinTemp, heatingMaxTemp, isStupidMode ? HaHelper::TEMP_SOURCE_HEATING : HaHelper::TEMP_SOURCE_INDOOR);
|
haHelper.publishClimateHeating(heatingMinTemp, heatingMaxTemp, isStupidMode ? HaHelper::TEMP_SOURCE_HEATING : HaHelper::TEMP_SOURCE_INDOOR);
|
||||||
|
|
||||||
published = true;
|
published = true;
|
||||||
|
yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_dhwPresent && (force || _dhwMinTemp != settings.dhw.minTemp || _dhwMaxTemp != settings.dhw.maxTemp)) {
|
if (_dhwPresent && (force || _dhwMinTemp != settings.dhw.minTemp || _dhwMaxTemp != settings.dhw.maxTemp)) {
|
||||||
@@ -528,6 +541,7 @@ protected:
|
|||||||
haHelper.publishClimateDhw(settings.dhw.minTemp, settings.dhw.maxTemp);
|
haHelper.publishClimateDhw(settings.dhw.minTemp, settings.dhw.maxTemp);
|
||||||
|
|
||||||
published = true;
|
published = true;
|
||||||
|
yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (force || _editableOutdoorTemp != editableOutdoorTemp) {
|
if (force || _editableOutdoorTemp != editableOutdoorTemp) {
|
||||||
@@ -542,6 +556,7 @@ protected:
|
|||||||
}
|
}
|
||||||
|
|
||||||
published = true;
|
published = true;
|
||||||
|
yield();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (force || _editableIndoorTemp != editableIndoorTemp) {
|
if (force || _editableIndoorTemp != editableIndoorTemp) {
|
||||||
|
|||||||
Reference in New Issue
Block a user