request thermostat mode on boot - see inline comments

This commit is contained in:
proddy
2021-03-07 22:40:06 +01:00
parent f15ca61cba
commit 9d5bd11d26

View File

@@ -174,6 +174,12 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i
for (uint8_t i = 0; i < monitor_typeids.size(); i++) {
EMSESP::send_read_request(monitor_typeids[i], device_id);
}
// HA will report an error in the climate component if it doesn't have the setpoint temp, current temperatures and the mode (e.g. auto)
// The mode always comes later (1 minute) so we force a read request to suppress HA errors.
// I remember having this in before, but we removed it and can't remember why?
for (uint8_t i = 0; i < set_typeids.size(); i++) {
EMSESP::send_read_request(set_typeids[i], device_id);
}
EMSESP::send_read_request(0x12, device_id); // read last error (only published on errors)
}
@@ -229,7 +235,6 @@ std::shared_ptr<Thermostat::HeatingCircuit> Thermostat::heating_circuit(const ui
// returns pointer to the HeatingCircuit or nullptr if it can't be found
// if its a new one, the object will be created and also the fetch flags set
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
uint8_t hc_num = 0;
bool toggle_ = false;