mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
include description in the command
This commit is contained in:
@@ -477,6 +477,7 @@ void EMSdevice::register_device_value(uint8_t tag,
|
|||||||
devicevalues_.emplace_back(device_type_, tag, value_p, type, options, options_size, short_name, full_name, uom, 0, has_cmd, min, max);
|
devicevalues_.emplace_back(device_type_, tag, value_p, type, options, options_size, short_name, full_name, uom, 0, has_cmd, min, max);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function with min and max values
|
||||||
void EMSdevice::register_device_value(uint8_t tag,
|
void EMSdevice::register_device_value(uint8_t tag,
|
||||||
void * value_p,
|
void * value_p,
|
||||||
uint8_t type,
|
uint8_t type,
|
||||||
@@ -489,13 +490,14 @@ void EMSdevice::register_device_value(uint8_t tag,
|
|||||||
register_device_value(tag, value_p, type, options, name[0], name[1], uom, (f != nullptr), min, max);
|
register_device_value(tag, value_p, type, options, name[0], name[1], uom, (f != nullptr), min, max);
|
||||||
if (f != nullptr) {
|
if (f != nullptr) {
|
||||||
if (tag >= TAG_HC1 && tag <= TAG_HC4) {
|
if (tag >= TAG_HC1 && tag <= TAG_HC4) {
|
||||||
Command::add(device_type_, name[0], f, FLAG_HC);
|
Command::add(device_type_, name[0], f, name[1], FLAG_HC);
|
||||||
} else {
|
} else {
|
||||||
Command::add(device_type_, name[0], f, 0);
|
Command::add(device_type_, name[0], f, name[1], 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// function with no min and max values
|
||||||
void EMSdevice::register_device_value(uint8_t tag,
|
void EMSdevice::register_device_value(uint8_t tag,
|
||||||
void * value_p,
|
void * value_p,
|
||||||
uint8_t type,
|
uint8_t type,
|
||||||
@@ -506,10 +508,7 @@ void EMSdevice::register_device_value(uint8_t tag,
|
|||||||
register_device_value(tag, value_p, type, options, name, uom, f, 0, 0);
|
register_device_value(tag, value_p, type, options, name, uom, f, 0, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
// void EMSdevice::register_device_value(uint8_t tag, void * value_p, uint8_t type, const __FlashStringHelper * const * options, const __FlashStringHelper * const * name, uint8_t uom, int32_t min, uint32_t max) {
|
// no command function
|
||||||
// register_device_value(tag, value_p, type, options, name, uom, nullptr, min, max);
|
|
||||||
// }
|
|
||||||
|
|
||||||
void EMSdevice::register_device_value(uint8_t tag,
|
void EMSdevice::register_device_value(uint8_t tag,
|
||||||
void * value_p,
|
void * value_p,
|
||||||
uint8_t type,
|
uint8_t type,
|
||||||
@@ -841,7 +840,7 @@ bool EMSdevice::generate_values_json(JsonObject & root, const uint8_t tag_filter
|
|||||||
bool has_value = false;
|
bool has_value = false;
|
||||||
// only show if tag is either empty (TAG_NONE) or matches a value
|
// only show if tag is either empty (TAG_NONE) or matches a value
|
||||||
// and don't show if full_name is empty unless we're outputing for mqtt payloads
|
// and don't show if full_name is empty unless we're outputing for mqtt payloads
|
||||||
// for nested we use all values, dont show command only (have_cmd and no fulname)
|
// for nested we use all values, dont show command only (have_cmd and no fullname)
|
||||||
if (((nested) || tag_filter == DeviceValueTAG::TAG_NONE || (tag_filter == dv.tag)) && (dv.full_name != nullptr || !console)
|
if (((nested) || tag_filter == DeviceValueTAG::TAG_NONE || (tag_filter == dv.tag)) && (dv.full_name != nullptr || !console)
|
||||||
&& !(dv.full_name == nullptr && dv.has_cmd)) {
|
&& !(dv.full_name == nullptr && dv.has_cmd)) {
|
||||||
// we have a tag if it matches the filter given, and that the tag name is not empty/""
|
// we have a tag if it matches the filter given, and that the tag name is not empty/""
|
||||||
|
|||||||
Reference in New Issue
Block a user