mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-07-28 17:42:45 +00:00
attributes for all entities
This commit is contained in:
@@ -372,11 +372,11 @@ std::string WebCommandService::get_metrics_prometheus() {
|
||||
}
|
||||
|
||||
void WebCommandService::get_value_json(JsonObject output, const CommandItem & ci) {
|
||||
output["name"] = (const char *)ci.name;
|
||||
// output["fullname"] = (const char *)ci.name;
|
||||
output["type"] = "command";
|
||||
output["command"] = ci.cmd;
|
||||
output["value"] = ci.value;
|
||||
output["name"] = (const char *)ci.name;
|
||||
output["fullname"] = (const char *)ci.name;
|
||||
output["type"] = "string";
|
||||
output["command"] = ci.cmd;
|
||||
output["value"] = ci.value;
|
||||
output["readable"] = true;
|
||||
output["writeable"] = true;
|
||||
output["visible"] = true;
|
||||
|
||||
@@ -421,9 +421,9 @@ void WebCustomEntityService::get_value_json(JsonObject output, CustomEntityItem
|
||||
output["fullname"] = (const char *)entity.name;
|
||||
output["storage"] = entity.ram == 1 ? "ram" : entity.ram == 2 ? "nvs" : "ems";
|
||||
output["type"] = entity.value_type == DeviceValueType::BOOL ? "boolean" : entity.value_type == DeviceValueType::STRING ? "string" : F_(number);
|
||||
// output["readable"] = true;
|
||||
output["readable"] = true;
|
||||
output["writeable"] = entity.writeable;
|
||||
// output["visible"] = true;
|
||||
output["visible"] = true;
|
||||
|
||||
if (entity.ram == 0) {
|
||||
output["device_id"] = Helpers::hextoa(entity.device_id);
|
||||
|
||||
@@ -214,10 +214,9 @@ void WebSchedulerService::get_value_json(JsonObject output, const ScheduleItem &
|
||||
output["time"] = scheduleItem.time;
|
||||
}
|
||||
output["cmd_name"] = scheduleItem.cmd_name;
|
||||
// bool hasName = scheduleItem.name[0] != '\0';
|
||||
// output["readable"] = hasName;
|
||||
// output["writeable"] = hasName;
|
||||
// output["visible"] = hasName;
|
||||
output["readable"] = true;
|
||||
output["writeable"] = true;
|
||||
output["visible"] = true;
|
||||
}
|
||||
|
||||
// publish single value
|
||||
|
||||
Reference in New Issue
Block a user