XML Template for Device UI Icon Selection  (Miscellaneous)

Contributed by: Dave Lehrer

Overview

An XML template for selecting custom device UI icons within a plugin.

Installation

Select the More Information link to download the template from GitHub.

Using Config UI Templates

Usage

Within Devices.xml

<Template file="template_icon_selector.xml"/>

Within plugin.py

def set_icon(dev):
    icon_name = dev.pluginProps.get('icon', 'SensorOff')
    icon = getattr(indigo.kStateImageSel, icon_name)
    dev.updateStateImageOnServer(icon)