[
MODERATOR NOTE] started a new thread for this post rather than adding it to an existing post.
Untested, but pretty close:
- Code: Select all
# set Hum to round ((value of variable "Kitchen_Hum") as integer) + 0
kitchen_hum_var = indigo.variables[ID_OF_Kitchen_Hum]
hum = int(round(kitchen_hum_var.value)) # not sure why the +0, doesn't seem to do anything
# if kitchen_hum > 100 then
# set value of variable "Kitchen_Hum" to 100
# else
# set value of variable "Kitchen_Hum" to Hum
# end if
if hum > 100:
indigo.variable.updateValue(kitchen_hum_var, value=str(100))
else:
indigo.variable.updateValue(kitchen_hum_var, value=str(hum))
# set lum to round ((value of variable "Kitchen_Lum") as integer)
kitchen_lum_var = indigo.variables[ID_OF_Kitchen_Lum]
lum = int(round(kitchen_lum_var.value)) # not sure why the +0, doesn't seem to do anything
#set value of variable "Kitchen_Lum" to lum
indigo.variable.updateValue(kitchen_lum_var, value=str(lum))
# set temp to round ((((value of variable "Kitchen_Temp") as integer) - 32) * 5 / 9)
kitchen_temp_var = indigo.variables[ID_OF_Kitchen_Temp]
temp = (int(kitchen_hum_var.value) - 32) * 5 / 9
# set value of variable "Kitchen_Temp" to temp
indigo.variable.updateValue(kitchen_temp_var, value=str(temp))
I left the old AS code in there so you could see how each line converts. Also, not sure why you have the +0 on the first line, doesn't seem like that does anything so I left it out.