mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-09 09:19:51 +03:00
Merge pull request #2515 from MichaelDvP/dev
FB100 controls hc1, fixes #2510
This commit is contained in:
@@ -18,6 +18,7 @@ For more details go to [docs.emsesp.org](https://docs.emsesp.org/).
|
||||
- update link buttons [#2497](https://github.com/emsesp/EMS-ESP32/issues/2497)
|
||||
- refresh scheduler states [#2502](https://github.com/emsesp/EMS-ESP32/discussions/2502)
|
||||
- also rebuild HA config on mqtt connect for scheduler, custom and shower
|
||||
- FB100 controls the hc, not the master [#2510](https://github.com/emsesp/EMS-ESP32/issues/2510)
|
||||
|
||||
## Changed
|
||||
|
||||
|
||||
@@ -393,7 +393,7 @@ bool EMSdevice::has_tags(const int8_t tag) const {
|
||||
// check if the device has a command with this tag.
|
||||
bool EMSdevice::has_cmd(const char * cmd, const int8_t id) const {
|
||||
for (const auto & dv : devicevalues_) {
|
||||
if ((id < 1 || dv.tag == id) && dv.has_cmd && strcmp(dv.short_name, cmd) == 0) {
|
||||
if ((id < 1 || dv.tag == id) && dv.has_cmd && strcmp(dv.short_name, cmd) == 0 && (dv.hasValue() || dv.type == DeviceValueType::CMD)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
@@ -1675,7 +1675,7 @@ void EMSdevice::get_value_json(JsonObject json, DeviceValue & dv) {
|
||||
// add uom, state class and device class
|
||||
Mqtt::add_ha_uom(json, dv.type, dv.uom, dv.short_name, false); // no icon
|
||||
|
||||
json["readable"] = !dv.has_state(DeviceValueState::DV_API_MQTT_EXCLUDE);
|
||||
json["readable"] = dv.type != DeviceValueType::CMD && !dv.has_state(DeviceValueState::DV_API_MQTT_EXCLUDE);
|
||||
json["writeable"] = dv.has_cmd && !dv.has_state(DeviceValueState::DV_READONLY);
|
||||
json["visible"] = !dv.has_state(DeviceValueState::DV_WEB_EXCLUDE);
|
||||
}
|
||||
|
||||
@@ -237,6 +237,7 @@ void Shower::set_shower_state(bool state, bool force) {
|
||||
//
|
||||
// shower timestamp
|
||||
//
|
||||
/* commented out as the publish of timestamp
|
||||
doc.clear();
|
||||
|
||||
snprintf(str, sizeof(str), "%s_shower_timestamp", Mqtt::basename().c_str());
|
||||
@@ -255,6 +256,7 @@ void Shower::set_shower_state(bool state, bool force) {
|
||||
|
||||
snprintf(topic, sizeof(topic), "sensor/%s/shower_timestamp/config", Mqtt::basename().c_str());
|
||||
Mqtt::queue_ha(topic, doc.as<JsonObject>()); // publish the config payload with retain flag
|
||||
*/
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -201,8 +201,8 @@ Thermostat::Thermostat(uint8_t device_type, uint8_t device_id, uint8_t product_i
|
||||
} else if (model == EMSdevice::EMS_DEVICE_FLAG_JUNKERS) {
|
||||
if (device_id >= 0x18 && device_id <= 0x1B) { // remote hc1-hc4
|
||||
register_telegram_type(0x123, "JunkersRemote", false, MAKE_PF_CB(process_JunkersRemoteMonitor));
|
||||
register_device_values(); // register device values for common values (not heating circuit)
|
||||
return; // no values to add
|
||||
// register_device_values(); // register device values for common values (not heating circuit)
|
||||
// return; // no values to add
|
||||
}
|
||||
|
||||
monitor_typeids = {0x016F, 0x0170, 0x0171, 0x0172};
|
||||
@@ -272,6 +272,10 @@ std::shared_ptr<Thermostat::HeatingCircuit> Thermostat::heating_circuit(const in
|
||||
// returns pointer to the HeatingCircuit or nullptr if it can't be found
|
||||
// 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) {
|
||||
// do not create a hc on empty messages
|
||||
if (telegram->message_length == 0) {
|
||||
return nullptr;
|
||||
}
|
||||
// look through the Monitor and Set arrays to see if there is a match
|
||||
uint8_t hc_num = 0; // 0 means we haven't found it yet
|
||||
bool toggle_ = false;
|
||||
|
||||
Reference in New Issue
Block a user