From 370af1120035eb17db56810d1f95cd5f53d16e00 Mon Sep 17 00:00:00 2001 From: proddy Date: Sun, 9 May 2021 10:59:16 +0200 Subject: [PATCH] include description in the command --- src/emsdevice.cpp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/emsdevice.cpp b/src/emsdevice.cpp index dd558e15a..7abc3ce7c 100644 --- a/src/emsdevice.cpp +++ b/src/emsdevice.cpp @@ -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); } +// function with min and max values void EMSdevice::register_device_value(uint8_t tag, void * value_p, 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); if (f != nullptr) { 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 { - 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 * value_p, 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); } -// 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) { -// register_device_value(tag, value_p, type, options, name, uom, nullptr, min, max); -// } - +// no command function void EMSdevice::register_device_value(uint8_t tag, void * value_p, uint8_t type, @@ -841,7 +840,7 @@ bool EMSdevice::generate_values_json(JsonObject & root, const uint8_t tag_filter bool has_value = false; // 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 - // 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) && !(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/""