mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2026-03-14 05:36:34 +03:00
fix standalone test
This commit is contained in:
@@ -355,13 +355,10 @@ bool WebCustomEntityService::get_value_info(JsonObject output, const char * cmd)
|
|||||||
|
|
||||||
// build the json for specific entity
|
// build the json for specific entity
|
||||||
void WebCustomEntityService::get_value_json(JsonObject output, CustomEntityItem const & entity) {
|
void WebCustomEntityService::get_value_json(JsonObject output, CustomEntityItem const & entity) {
|
||||||
output["name"] = (const char *)entity.name;
|
output["name"] = (const char *)entity.name;
|
||||||
output["fullname"] = (const char *)entity.name;
|
output["fullname"] = (const char *)entity.name;
|
||||||
output["storage"] = entity.ram == 1 ? "ram" : entity.ram == 2 ? "nvs" : "ems";
|
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["type"] = entity.value_type == DeviceValueType::BOOL ? "boolean" : entity.value_type == DeviceValueType::STRING ? "string" : F_(number);
|
||||||
if (entity.uom) {
|
|
||||||
output["uom"] = EMSdevice::uom_to_string(entity.uom);
|
|
||||||
}
|
|
||||||
output["readable"] = true;
|
output["readable"] = true;
|
||||||
output["writeable"] = entity.writeable;
|
output["writeable"] = entity.writeable;
|
||||||
output["visible"] = true;
|
output["visible"] = true;
|
||||||
|
|||||||
Reference in New Issue
Block a user