make states dynamic

Posted on
Mon Dec 10, 2018 11:02 pm
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

make states dynamic

I am looking into making the number of states in a device in a plugin dynamic. ==> Is there an example of a plugin where that is done.

I would like to make the number of RPIs in the piBeacon plugin dynamic. currently it has eg for each iBeacon:
Pi_x_Signal
Pi_x_distance
Pi_x_date
x =0....9 for each possible RPI
Most folks have 2-3 RPi, but I would like to have > 10. In order to do that I would have to add 3 extra states to each iBeacon pointing to RPi#11,12,13
and they are mostly not used and it looks ugly in the device state listing.

So any pointer appreciated.. I know there are some methods that are called by indigo to overwrite the Xml for devices etc. But I am better at learning by looking at some examples.

Thanks in advance

Karl

Posted on
Tue Dec 11, 2018 3:06 am
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: make states dynamic

kw123 wrote:
I am looking into making the number of states in a device in a plugin dynamic. ==> Is there an example of a plugin where that is done.

I would like to make the number of RPIs in the piBeacon plugin dynamic. currently it has eg for each iBeacon:
Pi_x_Signal
Pi_x_distance
Pi_x_date
x =0....9 for each possible RPI
Most folks have 2-3 RPi, but I would like to have > 10. In order to do that I would have to add 3 extra states to each iBeacon pointing to RPi#11,12,13
and they are mostly not used and it looks ugly in the device state listing.

So any pointer appreciated.. I know there are some methods that are called by indigo to overwrite the Xml for devices etc. But I am better at learning by looking at some examples.

Thanks in advance

Karl


Hi

DaveL’s GhostXML does this for all its states - and the code is so nest and tidy lovely to follow!

Glenn

Posted on
Tue Dec 11, 2018 10:51 am
kw123 offline
User avatar
Posts: 8363
Joined: May 12, 2013
Location: Dallas, TX

Re: make states dynamic

Thanks looking at it and I am impressed. Lot to learn.


Sent from my iPhone using Tapatalk

Posted on
Tue Dec 11, 2018 4:57 pm
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: make states dynamic

There are several folks' fingerprints on the GhostXML plugin (Glenn included) and it also relies on a couple of segments of outside code as well. Credit where credit's due! :D

Hopefully, you'll find it helpful Karl.

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Posted on
Tue Dec 11, 2018 10:54 pm
GlennNZ offline
User avatar
Posts: 1562
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: make states dynamic

DaveL17 wrote:
There are several folks' fingerprints on the GhostXML plugin (Glenn included) and it also relies on a couple of segments of outside code as well. Credit where credit's due! :D

Hopefully, you'll find it helpful Karl.


Small fingerprints except yours!

My very limited contribution was more along these lines...

(to be clear I'm the one in the blue!)

Image

& this

Image

Posted on
Wed Dec 12, 2018 6:35 am
DaveL17 offline
User avatar
Posts: 6753
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: make states dynamic

Those are great -- but they don't apply to you!

I came here to drink milk and kick ass....and I've just finished my milk.

[My Plugins] - [My Forums]

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests