mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-07 00:09:51 +03:00
add comment
This commit is contained in:
@@ -701,7 +701,6 @@ void EMSdevice::publish_value(void * value_p) const {
|
|||||||
|
|
||||||
// looks up the UOM for a given key from the device value table
|
// looks up the UOM for a given key from the device value table
|
||||||
// key is the fullname
|
// key is the fullname
|
||||||
// TODO really should be using the shortname as the identifier
|
|
||||||
std::string EMSdevice::get_value_uom(const char * key) const {
|
std::string EMSdevice::get_value_uom(const char * key) const {
|
||||||
// the key may have a TAG string prefixed at the beginning. If so, remove it
|
// the key may have a TAG string prefixed at the beginning. If so, remove it
|
||||||
char new_key[80];
|
char new_key[80];
|
||||||
@@ -711,8 +710,8 @@ std::string EMSdevice::get_value_uom(const char * key) const {
|
|||||||
for (uint8_t i = 0; i < DeviceValue::tag_count; i++) {
|
for (uint8_t i = 0; i < DeviceValue::tag_count; i++) {
|
||||||
auto tag = (DeviceValue::DeviceValueTAG_s[i]);
|
auto tag = (DeviceValue::DeviceValueTAG_s[i]);
|
||||||
if (tag) {
|
if (tag) {
|
||||||
std::string key2 = key; // copy char to a std::string
|
std::string key2 = key; // copy string to a std::string so we can use the find function
|
||||||
auto length = strlen(tag); // TODO check if this still works
|
uint8_t length = strlen(tag);
|
||||||
if ((key2.find(tag) != std::string::npos) && (key[length] == ' ')) {
|
if ((key2.find(tag) != std::string::npos) && (key[length] == ' ')) {
|
||||||
key_p += length + 1; // remove the tag
|
key_p += length + 1; // remove the tag
|
||||||
break;
|
break;
|
||||||
|
|||||||
Reference in New Issue
Block a user