I’m trying to use a script action (with a pin code) for a button click, but I can’t seem to get the value to increment.
Here’s my script code:
var promptResult = prompt("Please enter the pin number (1234):");
var currentValue = App.GetDeviceAttribute("OfficeHallwayTargetTemperatureLow.HSValue");
if (promptResult == "1234") {
App.SetDeviceAttribute("OfficeHallwayTargetTemperatureLow.HSValue", currentValue += 1);
}
else {
alert("You've entered the wrong pin");
}