use custom states from a ghost xml device

Posted on
Sat Jul 17, 2021 5:03 pm
Monstergerm offline
Posts: 188
Joined: Sep 01, 2009

Re: use custom states from a ghost xml device

Hi Dave,
so here is something weird. If I refresh my stock quote ghostxml device using a python script it takes about 2 seconds for the device "Last update date" to change.

If I however add a delay of 10 seconds in the python script AFTER the device refresh code line, the device "Last update date" does not change for 10 seconds but then shows again a date that is 2 seconds after I ran the script. Hope this is clear. So it looks like the Indigo interface does not update the date for 10 seconds and if I grab the "Last update date" during this time it still shows the old date. Only after the script finishes, everything gets properly updated with the correct times.

Now, I am not even sure anymore that adding a delay will help me getting updated data for my variables.

Posted on
Sat Jul 17, 2021 5:59 pm
FlyingDiver offline
User avatar
Posts: 5411
Joined: Jun 07, 2014
Location: Southwest Florida, USA

Re: use custom states from a ghost xml device

If you're doing a sleep() call in the middle of an embedded Python script, you're locking up the entire Indigo server until after the script ends. So the variables can't be updated during the script.

Just do the initial GhostXML call in the script, then do the rest in a trigger on the device state changing.

joe (aka FlyingDiver)
my plugins: http://forums.indigodomo.com/viewforum.php?f=177

Posted on
Sat Jul 17, 2021 6:08 pm
DaveL17 offline
User avatar
Posts: 5943
Joined: Aug 20, 2013
Location: Chicago, IL, USA

Re: use custom states from a ghost xml device

That's not necessarily strange in so far as Indigo may just be waiting to update the UI with the latest information.

I think Joe's suggestion might be the safest bet. Fire an update on your time table and then trigger on when the device Last Update value changes.

EDIT: Jinx. Buy me a Coke.

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

[My Plugins] - [My Forums]

Who is online

Users browsing this forum: No registered users and 1 guest