Skip to content

Commit

Permalink
Merge pull request #320 from MichaelDvP/dev
Browse files Browse the repository at this point in the history
helptext for string commands
  • Loading branch information
proddy committed Jan 24, 2022
2 parents ab34f7c + cd2ea1d commit 4569ee5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
4 changes: 4 additions & 0 deletions interface/src/project/DashboardData.tsx
Expand Up @@ -14,6 +14,7 @@ import {
DialogActions,
MenuItem,
InputAdornment,
FormHelperText,
IconButton,
List,
ListItem,
Expand Down Expand Up @@ -248,6 +249,9 @@ const DashboardData: FC = () => {
}}
/>
)}
{deviceValue.h && (
<FormHelperText>{deviceValue.h}</FormHelperText>
)}
</DialogContent>
<DialogActions>
<Button
Expand Down
1 change: 1 addition & 0 deletions interface/src/project/types.ts
Expand Up @@ -131,6 +131,7 @@ export interface DeviceValue {
n: string; // name
c: string; // command
l: string[]; // list
h?: string; // help text
}

export interface DeviceData {
Expand Down
4 changes: 2 additions & 2 deletions src/emsdevice.cpp
Expand Up @@ -737,9 +737,9 @@ void EMSdevice::generate_values_web(JsonObject & output) {
l.add("off");
l.add("on");
}
// add command template
// add command help template
if ((dv.type == DeviceValueType::STRING || dv.type == DeviceValueType::CMD) && dv.options_size == 1) {
obj["o"] = dv.options[0];
obj["h"] = dv.options[0];
}
}
}
Expand Down

0 comments on commit 4569ee5

Please sign in to comment.