mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 07:49:52 +03:00
helptext for string commands
This commit is contained in:
@@ -14,6 +14,7 @@ import {
|
|||||||
DialogActions,
|
DialogActions,
|
||||||
MenuItem,
|
MenuItem,
|
||||||
InputAdornment,
|
InputAdornment,
|
||||||
|
FormHelperText,
|
||||||
IconButton,
|
IconButton,
|
||||||
List,
|
List,
|
||||||
ListItem,
|
ListItem,
|
||||||
@@ -248,6 +249,9 @@ const DashboardData: FC = () => {
|
|||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
|
{deviceValue.h && (
|
||||||
|
<FormHelperText>{deviceValue.h}</FormHelperText>
|
||||||
|
)}
|
||||||
</DialogContent>
|
</DialogContent>
|
||||||
<DialogActions>
|
<DialogActions>
|
||||||
<Button
|
<Button
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ export interface DeviceValue {
|
|||||||
n: string; // name
|
n: string; // name
|
||||||
c: string; // command
|
c: string; // command
|
||||||
l: string[]; // list
|
l: string[]; // list
|
||||||
|
h?: string; // help text
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface DeviceData {
|
export interface DeviceData {
|
||||||
|
|||||||
@@ -737,9 +737,9 @@ void EMSdevice::generate_values_web(JsonObject & output) {
|
|||||||
l.add("off");
|
l.add("off");
|
||||||
l.add("on");
|
l.add("on");
|
||||||
}
|
}
|
||||||
// add command template
|
// add command help template
|
||||||
if ((dv.type == DeviceValueType::STRING || dv.type == DeviceValueType::CMD) && dv.options_size == 1) {
|
if ((dv.type == DeviceValueType::STRING || dv.type == DeviceValueType::CMD) && dv.options_size == 1) {
|
||||||
obj["o"] = dv.options[0];
|
obj["h"] = dv.options[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user