Last Updated time in UI not automatically updating

Posted on
Sun Jul 12, 2015 11:17 am
zurich offline
Posts: 103
Joined: Aug 11, 2014

Last Updated time in UI not automatically updating

Greetings,

I have a plugin that has "runConcurrentThread" to sleep every 30 seconds. I have a debug line in the method to check "runConcurrentThread" is running and it is, every 30 seconds. The problem is that the Last Updated time never updates automatically each time "runConcurrentThread" runs. Other plugins work fine in this respect. Is there a setting for this?

Code: Select all
   def runConcurrentThread(self):
      try:
         while True:
            self.errorLog('running concurrent thread')
            self.updateDeviceStates()
            self.sleep(30)
      except self.StopThread:


kind regards,

Z

Posted on
Sun Jul 12, 2015 11:19 am
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Last Updated time in UI not automatically updating

Can you share your code for the method updateDeviceStates?

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Posted on
Sun Jul 12, 2015 11:49 am
jay (support) offline
Site Admin
User avatar
Posts: 18261
Joined: Mar 19, 2008
Location: Austin, Texas

Re: Last Updated time in UI not automatically updating

The last update is updated whenever device states are actually updated (with with changed data I believe) or when any of the built-in actions forces a state change (turnOn, etc). So, Colorado4Wheeler is right, we need to see what that method does.

Jay (Indigo Support)
Twitter | Facebook | LinkedIn

Posted on
Sun Jul 12, 2015 1:15 pm
zurich offline
Posts: 103
Joined: Aug 11, 2014

Re: Last Updated time in UI not automatically updating

Greetings,

Thanks to your for reply. I understand now, the method only checks a calculation and does not make a state change, because there is no state change there is no update.

I can make the method change a state every time it runs so as to trigger the Last Updated. Is there a way to run the Last Updated from the plugin?

kind regards,

Z

Posted on
Sun Jul 12, 2015 1:23 pm
Colorado4Wheeler offline
User avatar
Posts: 2794
Joined: Jul 20, 2009
Location: Colorado

Re: Last Updated time in UI not automatically updating

zurich wrote:
Is there a way to run the Last Updated from the plugin?


I'm not sure what you are asking, but if you want to update the Last Updated you can simply change a state variable or roll your own Last Updated state (I do this so I have consistency in my code and know that the date was changed by ME and not by something else, i.e., a light changing it's on/off/dim state).

You can change a state in your Python code using updateStateOnServer ([key], [new value]) and this should also change the Last Updated as well.

My Modest Contributions to Indigo:

HomeKit Bridge | Device Extensions | Security Manager | LCD Creator | Room-O-Matic | Smart Dimmer | Scene Toggle | Powermiser | Homebridge Buddy

Check Them Out Here

Page 1 of 1

Who is online

Users browsing this forum: No registered users and 3 guests