add comments

This commit is contained in:
proddy
2024-07-16 20:32:31 +02:00
parent 78e1ec483e
commit 2e9e5b69be
2 changed files with 4 additions and 1 deletions

View File

@@ -252,7 +252,7 @@ std::shared_ptr<Thermostat::HeatingCircuit> Thermostat::heating_circuit(const in
// if its a new one, the heating circuit object will be created and also the fetch flags set // if its a new one, the heating circuit object will be created and also the fetch flags set
std::shared_ptr<Thermostat::HeatingCircuit> Thermostat::heating_circuit(std::shared_ptr<const Telegram> telegram) { std::shared_ptr<Thermostat::HeatingCircuit> Thermostat::heating_circuit(std::shared_ptr<const Telegram> telegram) {
// look through the Monitor and Set arrays to see if there is a match // look through the Monitor and Set arrays to see if there is a match
uint8_t hc_num = 0; uint8_t hc_num = 0; // 0 means we haven't found it yet
bool toggle_ = false; bool toggle_ = false;
// search device-id types for remote thermostats first, they have only a single typeid for all hcs // search device-id types for remote thermostats first, they have only a single typeid for all hcs
@@ -269,8 +269,10 @@ std::shared_ptr<Thermostat::HeatingCircuit> Thermostat::heating_circuit(std::sha
toggle_ = true; toggle_ = true;
break; break;
} }
Serial.println();
} }
} }
// not found, search status message/set types // not found, search status message/set types
if (hc_num == 0) { if (hc_num == 0) {
for (uint8_t i = 0; i < set_typeids.size(); i++) { for (uint8_t i = 0; i < set_typeids.size(); i++) {

View File

@@ -109,6 +109,7 @@ class Thermostat : public EMSdevice {
return hc_num_; return hc_num_;
} }
// returns heating circuit number 0..9
uint8_t hc() const { uint8_t hc() const {
return hc_num_ - 1; return hc_num_ - 1;
} }