response error messages

This commit is contained in:
MichaelDvP
2023-07-29 16:39:37 +02:00
parent bb39e8bd4c
commit 52de833b19
2 changed files with 8 additions and 3 deletions

View File

@@ -1505,6 +1505,10 @@ bool EMSdevice::get_value_info(JsonObject & output, const char * cmd, const int8
output["api_data"] = data;
return true;
} else {
char error[100];
snprintf(error, sizeof(error), "cannot find attribute %s in entity %s", attribute_s, command_s);
output.clear();
output["message"] = error;
return false;
}
}
@@ -1513,6 +1517,9 @@ bool EMSdevice::get_value_info(JsonObject & output, const char * cmd, const int8
}
}
char error[100];
snprintf(error, sizeof(error), "cannot find values for entity '%s'", cmd);
json["message"] = error;
return false;
}