Fixe compilation error with no DEBUG_THERMOSTAT

This commit is contained in:
Charles 2021-11-11 17:12:58 +01:00
parent be6fbefb46
commit d352277c8e
1 changed files with 22 additions and 22 deletions

View File

@ -1253,6 +1253,7 @@ void ThermostatTimerDisarm(uint8_t ctr_output)
}
#ifdef DEBUG_THERMOSTAT
void ThermostatVirtualSwitch(uint8_t ctr_output)
{
char domoticz_in_topic[] = DOMOTICZ_IN_TOPIC;
@ -1269,28 +1270,6 @@ void ThermostatVirtualSwitchCtrState(uint8_t ctr_output)
MqttPublish(domoticz_in_topic);
}
uint8_t ThermostatGetDutyCycle(uint8_t ctr_output)
{
uint8_t value = 0;
if ( (Thermostat[ctr_output].status.controller_mode == CTR_PI)
|| ((Thermostat[ctr_output].status.controller_mode == CTR_HYBRID)
&&(Thermostat[ctr_output].status.phase_hybrid_ctr == CTR_HYBRID_PI))) {
value = Thermostat[ctr_output].time_total_pi / Thermostat[ctr_output].time_pi_cycle;
}
else if ( (Thermostat[ctr_output].status.controller_mode == CTR_RAMP_UP)
|| ((Thermostat[ctr_output].status.controller_mode == CTR_HYBRID)
&&(Thermostat[ctr_output].status.phase_hybrid_ctr == CTR_HYBRID_RAMP_UP))) {
if (Thermostat[ctr_output].status.status_output == IFACE_ON) {
value = 100;
}
else {
value = 0;
}
}
return value;
}
void ThermostatDebug(uint8_t ctr_output)
{
char result_chr[FLOATSZ];
@ -1349,6 +1328,27 @@ void ThermostatDebug(uint8_t ctr_output)
}
#endif // DEBUG_THERMOSTAT
uint8_t ThermostatGetDutyCycle(uint8_t ctr_output)
{
uint8_t value = 0;
if ( (Thermostat[ctr_output].status.controller_mode == CTR_PI)
|| ((Thermostat[ctr_output].status.controller_mode == CTR_HYBRID)
&&(Thermostat[ctr_output].status.phase_hybrid_ctr == CTR_HYBRID_PI))) {
value = Thermostat[ctr_output].time_total_pi / Thermostat[ctr_output].time_pi_cycle;
}
else if ( (Thermostat[ctr_output].status.controller_mode == CTR_RAMP_UP)
|| ((Thermostat[ctr_output].status.controller_mode == CTR_HYBRID)
&&(Thermostat[ctr_output].status.phase_hybrid_ctr == CTR_HYBRID_RAMP_UP))) {
if (Thermostat[ctr_output].status.status_output == IFACE_ON) {
value = 100;
}
else {
value = 0;
}
}
return value;
}
void ThermostatGetLocalSensor(uint8_t ctr_output) {
String buf = ResponseData(); // copy the string into a new buffer that will be modified
JsonParser parser((char*)buf.c_str());