I am currently working on my first plugin. I am starting from the Indigo 7.0.0 version of the 'Example Device - Relay and Dimmer' plugin. I am integrating with Osram Lightify bulbs, using native tcp calls for controlling the light features. I've made progress with turning the bulbs on/off as well as brightness, and now I am trying to set the color/temp settings for the bulbs.
I am testing using the new method in the dimmer python class - indigo.dimmer.setColorLevels(device, ..) . In the actionControlDevice method of plugin.py, I added some debug info as if any of the 'channelKeys' for supporting RGB, Color, White, etc were being set. I was able to see that 'ownerProps' and 'metaProps' dict objects were properly updated with the configuration from my Devices.xml .. However, the core properties on the root device didn't seem to have the settings... Below is sample log info from outputting the whole device dimmer object:
***
greenLevel : None
id : 570176344
lastChanged : 2017-03-14 20:55:20
lastSuccessfulComm : 2017-03-14 20:55:20
ledStates : []
model : Osram Lightify Group
name : Great Room Lightify
onBrightensToDefaultToggle : False
onBrightensToLast : False
onState : False
------ BW - These ownerProps are properly setup from Devices.xml ---
ownerProps : com.woodsmachine.lights.OsramLightify : (dict)
- SupportsRGB : true (bool)
- SupportsTwoWhiteLevels : false (bool)
- SupportsWhite : true (bool)
- SupportsWhiteTemperature : true (bool)
- groupName : Great Room (string)
pluginId : com.woodsmachine.lights.OsramLightify
pluginProps : emptyDict : (dict)
protocol : Plugin
redLevel : None
remoteDisplay : True
states : States : (dict)
brightnessLevel : 0 (integer)
groupBrightness : 11 (integer)
groupColor : (255, 255, 255) (string)
groupColorTemp : 2702 (integer)
groupOnState : 1 (integer)
onOffState : off (on/off bool)
subModel :
------ BW - These root properties dont have the correct values ?? ---
supportsAllLightsOnOff : False
supportsAllOff : False
supportsColor : False
supportsRGB : False
supportsRGBandWhiteSimultaneously : False
supportsStatusRequest : True
supportsTwoWhiteLevels : False
supportsTwoWhiteLevelsSimultaneously : False
supportsWhite : False
supportsWhiteTemperature : False
version : None
whiteLevel : None
whiteLevel2 : None
whiteTemperature : None
***
I believe the sample plugin.py 'actionControlDevice' method is looking in the root properties for the device.. You can see that all of these properties for Color/RGB/etc are False, whereas the 'ownerProps' and 'metaProps' have the proper info from my Devices.xml. See the bolded items in the log output above
I am new to plugin development and these concepts. However, I am guessing I should try to properly set these root device properties in order to have support for other stuff in the future (i.e. the Config UI, Control Pages, etc)
Any suggestions are appreciated.