mirror of
https://github.com/letscontrolit/ESPEasy.git
synced 2026-07-27 19:57:38 +00:00
[Bugfix] Include PLUGIN_FORMAT_USERVAR values for json updates
This commit is contained in:
@@ -519,6 +519,28 @@ void handle_json()
|
||||
#endif // if FEATURE_STRING_VARIABLES
|
||||
uom);
|
||||
}
|
||||
|
||||
if (Device[DeviceIndex].HasFormatUserVar) {
|
||||
struct EventStruct TempEvent(TaskIndex);
|
||||
|
||||
for (uint8_t x = 0; x < valueCount; x++)
|
||||
{
|
||||
String value;
|
||||
TempEvent.idx = x;
|
||||
PluginCall(PLUGIN_FORMAT_USERVAR, &TempEvent, value);
|
||||
|
||||
if (!value.isEmpty()) {
|
||||
handle_json_stream_task_value_data(taskValueWriter.get(),
|
||||
VARS_PER_TASK + x + 1,
|
||||
Cache.getTaskDeviceValueName(TaskIndex, x),
|
||||
255,
|
||||
value,
|
||||
EMPTY_STRING,
|
||||
EMPTY_STRING);
|
||||
}
|
||||
}
|
||||
// FIXME tonhuisman: HasFormatUserVar is not really compatible with Derived Values...
|
||||
}
|
||||
#if FEATURE_STRING_VARIABLES
|
||||
|
||||
if (Settings.ShowDerivedTaskValues(TaskIndex)) {
|
||||
|
||||
Reference in New Issue
Block a user