Skip to content

Commit

Permalink
add type to device info, so we know if its a Ram variable or not
Browse files Browse the repository at this point in the history
  • Loading branch information
proddy committed Feb 4, 2024
1 parent ae7f044 commit c98e1a6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/web/WebCustomEntityService.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,10 +293,11 @@ bool WebCustomEntityService::get_value_info(JsonObject output, const char * cmd)
for (const auto & entity : *customEntityItems) {
if (Helpers::toLower(entity.name) == Helpers::toLower(command_s)) {
output["name"] = entity.name;
output["ram"] = entity.ram;
output["type"] = entity.value_type == DeviceValueType::BOOL ? "boolean" : entity.value_type == DeviceValueType::STRING ? "string" : F_(number);
if (entity.uom > 0) {
output["uom"] = EMSdevice::uom_to_string(entity.uom);
}
output["type"] = entity.value_type == DeviceValueType::BOOL ? "boolean" : entity.value_type == DeviceValueType::STRING ? "string" : F_(number);
output["readable"] = true;
output["writeable"] = entity.writeable;
output["visible"] = true;
Expand All @@ -311,6 +312,7 @@ bool WebCustomEntityService::get_value_info(JsonObject output, const char * cmd)
}
}
render_value(output, entity, true);

if (attribute_s) {
if (output.containsKey(attribute_s)) {
String data = output[attribute_s].as<String>();
Expand Down

0 comments on commit c98e1a6

Please sign in to comment.