device.xml default values

Posted on
Mon Feb 03, 2020 4:14 pm
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

device.xml default values

probably also true for all .cml files.

it looks as if
Code: Select all
         <Field    id="newenableRebootCheck"   type="menu" defaultValue="restartLoop">
            <Label>If rPi encounters an internal problem  /  ping to indigo does not work:</Label>
             <List>
               <Option value="doNothing"            >do nothing (not recommended)</Option>
               <Option value="restartLoop"        >restart progams on rPi(default) </Option>
               <Option value="rebootloop"         >reboot rPi if internal problem</Option>
               <Option value="restartLoop-pingBoot" >restart progams on rPi / reboot if no succesfull ping to indigo for 5 minutes</Option>
               <Option value="rebootloop-pingBoot"  >reboot rPi </Option>
            </List>
         </Field>
does not fill the default field if the default value is found twice, although there is additional text after the menu value in the second case ("restartLoop" vs "restartLoop-pingBoot")
if guess its like a xxx.find(defaultValue) >-1. and that will result in 2 hits.
so the starting string has to be different?
Karl

Posted on
Mon Feb 03, 2020 4:31 pm
matt (support) offline
Site Admin
User avatar
Posts: 21417
Joined: Jan 27, 2003
Location: Texas

Re: device.xml default values

It should work. Are you sure this was for a new object (device/action) that didn't already have a value assigned to newenableRebootCheck?

Image

Posted on
Tue Feb 04, 2020 9:15 am
kw123 offline
User avatar
Posts: 8366
Joined: May 12, 2013
Location: Dallas, TX

Re: device.xml default values

my bad

I had set it wrong in getDeviceConfigUiValues()

sorry for that one.

Karl

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 8 guests