fix webEntity commands

This commit is contained in:
MichaelDvP
2023-06-25 08:54:11 +02:00
parent f4cae5027e
commit 31220b3fde
5 changed files with 80 additions and 22 deletions

View File

@@ -94,12 +94,12 @@ const DashboarDevicesDialog = ({
}
let helperText = '<';
if (dv.u !== DeviceValueUOM.NONE) {
if (dv.s) {
helperText += 'n';
if (dv.m && dv.x) {
if (dv.m !== undefined && dv.x !== undefined) {
helperText += ' between ' + dv.m + ' and ' + dv.x;
}
if (dv.s) {
} else {
helperText += ' , step ' + dv.s;
}
} else {
@@ -144,7 +144,7 @@ const DashboarDevicesDialog = ({
</MenuItem>
))}
</TextField>
) : editItem.u !== DeviceValueUOM.NONE ? (
) : editItem.s || editItem.u !== DeviceValueUOM.NONE ? (
<ValidatedTextField
fieldErrors={fieldErrors}
name="v"
@@ -155,7 +155,7 @@ const DashboarDevicesDialog = ({
type="number"
sx={{ width: '30ch' }}
onChange={updateFormValue}
inputProps={editItem.u ? { min: editItem.m, max: editItem.x, step: editItem.s } : {}}
inputProps={editItem.s ? { min: editItem.m, max: editItem.x, step: editItem.s } : {}}
InputProps={{
startAdornment: <InputAdornment position="start">{setUom(editItem.u)}</InputAdornment>
}}