[ANSWERED]: indigo.device.create

Posted on
Thu Mar 17, 2016 11:33 am
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

[ANSWERED]: indigo.device.create

I have an extended thermostat device type and have set some field values (like NumHumidityInputs) in the Devices.xml file. I notice that when I programmatically create a device, these field settings are not respected. If I create a device through the menu, all works as expected.

Thoughts?

Posted on
Thu Mar 17, 2016 1:28 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: indigo.device.create

The Devices.xml default field values are only used when the UI is shown, so you are correct. But the device.create() method takes an option argument, props, that is a dict that can be used to also specify the default values you want to set (like NumHumidityInputs).

Image

Posted on
Thu Mar 17, 2016 1:54 pm
nlagaros offline
Posts: 1646
Joined: Dec 20, 2010

Re: [ANSWERED]: indigo.device.create

Perfect. Thank you.

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 5 guests