diff --git a/lib_standalone/Preferences.h b/lib_standalone/Preferences.h index 914c9b769..900ac09fe 100644 --- a/lib_standalone/Preferences.h +++ b/lib_standalone/Preferences.h @@ -42,7 +42,7 @@ class Preferences { } double getDouble(const char * key, double defaultValue = NAN) { - return NAN; + return 0; } size_t putString(const char * key, const char * value) { diff --git a/src/devices/extension.h b/src/devices/extension.h index ae592bd66..617456bdc 100644 --- a/src/devices/extension.h +++ b/src/devices/extension.h @@ -43,10 +43,10 @@ class Extension : public EMSdevice { int16_t headerTemp_; // T0 uint8_t input_; // IO1 - uint8_t errorState_; // OE1 - uint8_t errorPump_; // IE0 - uint8_t outPower_; // IO1 - uint8_t setPower_; // request + // uint8_t errorState_; // OE1 + // uint8_t errorPump_; // IE0 + uint8_t outPower_; // IO1 + uint8_t setPower_; // request uint8_t setPoint_; uint8_t dip_; // dip switch uint8_t minV_; diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index 127469928..08ccb9b3f 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -827,7 +827,7 @@ std::string EMSdevice::get_value_uom(const std::string & shortname) const { return std::string{}; // not found } -bool EMSdevice::export_values(uint8_t unique_id, JsonObject & output, const int8_t id, const uint8_t output_target) { +bool EMSdevice::export_values(uint8_t device_type, JsonObject & output, const int8_t id, const uint8_t output_target) { bool has_value = false; uint8_t tag; if (id >= 1 && id <= (1 + DeviceValueTAG::TAG_HS16 - DeviceValueTAG::TAG_HC1)) { @@ -840,7 +840,7 @@ bool EMSdevice::export_values(uint8_t unique_id, JsonObject & output, const int8 if (id > 0 || output_target == EMSdevice::OUTPUT_TARGET::API_VERBOSE) { for (const auto & emsdevice : EMSESP::emsdevices) { - if (emsdevice->unique_id() == unique_id) { + if (emsdevice && (emsdevice->device_type() == device_type)) { has_value |= emsdevice->generate_values(output, tag, (id < 1), output_target); // use nested for id -1 and 0 } } @@ -852,7 +852,7 @@ bool EMSdevice::export_values(uint8_t unique_id, JsonObject & output, const int8 JsonObject output_hc = output; bool nest_created = false; for (const auto & emsdevice : EMSESP::emsdevices) { - if (emsdevice->unique_id() == unique_id) { + if (emsdevice && (emsdevice->device_type() == device_type)) { if (!nest_created && emsdevice->has_tags(tag)) { output_hc = output.createNestedObject(EMSdevice::tag_to_mqtt(tag)); nest_created = true; diff --git a/src/roomcontrol.cpp b/src/roomcontrol.cpp index f3faece46..92472b8aa 100644 --- a/src/roomcontrol.cpp +++ b/src/roomcontrol.cpp @@ -51,7 +51,7 @@ void Roomctrl::set_remotehum(const uint8_t type, const uint8_t hc, const int8_t return; } type_ = type; - if (remotehum_[hc] != EMS_VALUE_UINT_NOTSET && hum == EMS_VALUE_UINT_NOTSET) { + if (remotehum_[hc] != EMS_VALUE_UINT_NOTSET && (uint8_t)hum == EMS_VALUE_UINT_NOTSET) { switch_off_[hc] = true; } if (remotehum_[hc] != hum) { diff --git a/src/system.cpp b/src/system.cpp index f6191e336..398efccaf 100644 --- a/src/system.cpp +++ b/src/system.cpp @@ -115,7 +115,7 @@ bool System::command_allvalues(const char * value, const int8_t id, JsonObject & for (const auto & emsdevice : EMSESP::emsdevices) { std::string title = emsdevice->device_type_2_device_name_translated() + std::string(" ") + emsdevice->to_string(); device_output = output.createNestedObject(title); - emsesp::EMSdevice::export_values(emsdevice->unique_id(), device_output, id, EMSdevice::OUTPUT_TARGET::API_VERBOSE); + emsdevice->generate_values(device_output, DeviceValueTAG::TAG_NONE, true, EMSdevice::OUTPUT_TARGET::API_VERBOSE); // use nested for id -1 and 0 } // Custom entities