Добрый день.
Если речь про input поле в веб интерфейсе, то значение можно менять только с шагом 1. Для того, чтобы менять с шагом 0.5 — можно добавить пару контролов типа “pushbutton” и менять значение используя их. Вот пример:
defineVirtualDevice("thermostat", {
title: "Thermostat",
cells: {
setpoint: {
title: "Setpoint",
type: "temperature",
value: 20.0,
readonly: true,
order: 1
},
inc: {
title: "+",
type: "pushbutton",
order: 2
},
dec: {
title: "-",
type: "pushbutton",
order: 3
}
}
});
var max_temp = 45;
var min_temp = 15;
defineRule("increment", {
whenChanged: "thermostat/inc",
then: function() {
if (dev["thermostat/setpoint"] != max_temp) {
dev["thermostat/setpoint"] += 0.5;
}
}
});
defineRule("decrement", {
whenChanged: "thermostat/dec",
then: function() {
if (dev["thermostat/setpoint"] != min_temp) {
dev["thermostat/setpoint"] -= 0.5;
}
}
});