mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 16:29:51 +03:00
Test for fixing #1378
This commit is contained in:
@@ -237,15 +237,23 @@ std::shared_ptr<Thermostat::HeatingCircuit> Thermostat::heating_circuit(std::sha
|
||||
// look through the Monitor and Set arrays to see if there is a match
|
||||
uint8_t hc_num = 0;
|
||||
bool toggle_ = false;
|
||||
// search monitor message types
|
||||
for (uint8_t i = 0; i < monitor_typeids.size(); i++) {
|
||||
if (monitor_typeids[i] == telegram->type_id) {
|
||||
hc_num = i + 1;
|
||||
toggle_ = true;
|
||||
break;
|
||||
}
|
||||
|
||||
// search device-id types for remote thermostats first, they have only a single typeid for all hcs
|
||||
if (telegram->src >= 0x18 && telegram->src <= 0x1F) {
|
||||
hc_num = telegram->src - 0x17;
|
||||
toggle_ = true;
|
||||
}
|
||||
|
||||
// not found, search monitor message types
|
||||
if (hc_num == 0) {
|
||||
for (uint8_t i = 0; i < monitor_typeids.size(); i++) {
|
||||
if (monitor_typeids[i] == telegram->type_id) {
|
||||
hc_num = i + 1;
|
||||
toggle_ = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// not found, search status message/set types
|
||||
if (hc_num == 0) {
|
||||
for (uint8_t i = 0; i < set_typeids.size(); i++) {
|
||||
@@ -335,12 +343,6 @@ std::shared_ptr<Thermostat::HeatingCircuit> Thermostat::heating_circuit(std::sha
|
||||
}
|
||||
}
|
||||
|
||||
// not found, search device-id types for remote thermostats
|
||||
if (hc_num == 0 && telegram->src >= 0x18 && telegram->src <= 0x1F) {
|
||||
hc_num = telegram->src - 0x17;
|
||||
toggle_ = true;
|
||||
}
|
||||
|
||||
// not found, search device-id types for remote thermostats
|
||||
if (hc_num == 0 && telegram->dest >= 0x20 && telegram->dest <= 0x27) {
|
||||
hc_num = telegram->dest - 0x20;
|
||||
@@ -4223,13 +4225,8 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
MAKE_CF_CB(set_tempautotemp),
|
||||
-1,
|
||||
30);
|
||||
register_device_value(tag,
|
||||
&hc->remoteseltemp,
|
||||
DeviceValueType::INT,
|
||||
DeviceValueNumOp::DV_NUMOP_DIV2,
|
||||
FL_(remoteseltemp),
|
||||
DeviceValueUOM::DEGREES);
|
||||
// a command is only accepted from the remote device, not from ems-esp.
|
||||
register_device_value(tag, &hc->remoteseltemp, DeviceValueType::INT, DeviceValueNumOp::DV_NUMOP_DIV2, FL_(remoteseltemp), DeviceValueUOM::DEGREES);
|
||||
// a command is only accepted from the remote device, not from ems-esp.
|
||||
register_device_value(tag, &hc->fastHeatup, DeviceValueType::UINT, FL_(fastheatup), DeviceValueUOM::PERCENT, MAKE_CF_CB(set_fastheatup));
|
||||
register_device_value(tag,
|
||||
&hc->switchonoptimization,
|
||||
@@ -4258,14 +4255,7 @@ void Thermostat::register_device_values_hc(std::shared_ptr<Thermostat::HeatingCi
|
||||
MAKE_CF_CB(set_remotetemp),
|
||||
-1,
|
||||
101);
|
||||
register_device_value(tag,
|
||||
&hc->remotehum,
|
||||
DeviceValueType::UINT,
|
||||
FL_(remotehum),
|
||||
DeviceValueUOM::PERCENT,
|
||||
MAKE_CF_CB(set_remotehum),
|
||||
-1,
|
||||
101);
|
||||
register_device_value(tag, &hc->remotehum, DeviceValueType::UINT, FL_(remotehum), DeviceValueUOM::PERCENT, MAKE_CF_CB(set_remotehum), -1, 101);
|
||||
|
||||
break;
|
||||
case EMS_DEVICE_FLAG_CRF:
|
||||
|
||||
Reference in New Issue
Block a user