[ANSWERED}: Invalid devices.xml doesn't throw error

Posted on
Thu Dec 31, 2015 5:07 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

[ANSWERED}: Invalid devices.xml doesn't throw error

Hi,

Just spent half an hour wondering why my code as follows wasn't adding a newly defined state to my existing devices:

Code: Select all
for dev in indigo.devices.iter("self"):
          dev.stateListOrDisplayStateIdChanged()


It seems if you incorrectly define the state ValueType as 'Int' then Indigo completely skips over the new state when parsing the xml, instead of reporting an error that the XML is using an invalid tag value.

The docs (http://wiki.indigodomo.com/doku.php?id= ... devicesxml) indicate it should be 'Number' but actually Float works for my other states which ARE float values, whereas this value is only an integer so I presumed Int would work.

Something for fixing in future release?

Peter

Posted on
Thu Dec 31, 2015 5:25 pm
matt (support) offline
Site Admin
User avatar
Posts: 21429
Joined: Jan 27, 2003
Location: Texas

Re: Invalid devices.xml doesn't throw error

Hi Peter,

I just glanced at the code and you are correct – it silently skips value types it doesn't recognize. It should at least log an error, so we'll look into adding that.

Note that you can use "integer" (not abbreviated), along with as you mentioned "number" and "float."

Image

Posted on
Thu Dec 31, 2015 7:37 pm
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: [ANSWERED}: Invalid devices.xml doesn't throw error

Thanks Matt.

I'll change my code to integer for consistency with what I'll look for next time I come to use it. :-)


Sent from my iPhone using Tapatalk

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 4 guests