HomeGenie Forum

Automation Program Plugins and Wizard Scripting => Help => Topic started by: kevin1 on August 28, 2015, 02:53:40 PM

Title: Change icon dynamically from program code?
Post by: kevin1 on August 28, 2015, 02:53:40 PM
Can I change the widget icon dynamically from my app/program program code (not in the webpage/javascript)?  Something like this, which doesn't seem to work:
Code: [Select]
if(GarageDoorClosed){
 Program.Parameter("Widget.DisplayIcon").Value = "http://cdn.device-icons.smartthings.com/doors/garage/garage-closed.png";
}esle{
 Program.Parameter("Widget.DisplayIcon").Value = "http://cdn.device-icons.smartthings.com/doors/garage/garage-open.png";
}
Title: Re: Change icon dynamically from program code?
Post by: dani on August 31, 2015, 02:16:34 PM
A time I have made one modification in the widget icon gestion.
If the icon name (Widget.DisplayIcon) contains _off it's replace automatically replace by _on when the widget receives level change to 1. So only you have to put the 2 icons in the same folder and specify the off icon in the parameter