mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-08 16:59:50 +03:00
merge PR #923 - fixes and the tested heatpump/heatsource entities by mvdp
This commit is contained in:
@@ -496,6 +496,7 @@ void EMSdevice::add_device_value(uint8_t tag,
|
||||
std::string custom_fullname = std::string(""); // custom fullname
|
||||
auto short_name = name[0]; // entity name
|
||||
bool has_cmd = (f != nullptr); // is it a command?
|
||||
bool ignore = false; // ignore this entity?
|
||||
|
||||
// get fullname, getting translation if it exists
|
||||
const char * const * fullname;
|
||||
@@ -532,7 +533,8 @@ void EMSdevice::add_device_value(uint8_t tag,
|
||||
if (shortname == entity) {
|
||||
// get Mask
|
||||
uint8_t mask = Helpers::hextoint(entity_id.substr(0, 2).c_str());
|
||||
state = mask << 4; // set state high bits to flag, turn off active and ha flags
|
||||
state = mask << 4; // set state high bits to flag, turn off active and ha flags
|
||||
ignore = (mask & 0x80) == 0x80; // do not register
|
||||
// see if there is a custom name in the entity string
|
||||
if (has_custom_name) {
|
||||
custom_fullname = entity_id.substr(custom_name_pos + 1);
|
||||
@@ -544,6 +546,10 @@ void EMSdevice::add_device_value(uint8_t tag,
|
||||
}
|
||||
});
|
||||
|
||||
if (ignore) {
|
||||
return;
|
||||
}
|
||||
|
||||
// add the device entity
|
||||
devicevalues_.emplace_back(
|
||||
device_type_, tag, value_p, type, options, options_single, numeric_operator, short_name, fullname, custom_fullname, uom, has_cmd, min, max, state);
|
||||
|
||||
Reference in New Issue
Block a user