Does Refresh() really exist?

At the bottom of this post are the typical "autoRun" methods as I understand them (very shaky understanding). i.e. methods that are run by some activity of the system.

The "Refresh()" I see in some example drivers does not seem to be connected to any specific system action like the methods listed below.

Is this correct? Is "Refresh()" simply a common name authors use for a specific action and is not automatically run by the OS?

Thanks


per JustinHudson 2019, Smartthings Community

“Unfortunately, we currently do not have refresh capability available in Smartthings platform.”


Methods with some automatic function that I am aware of:

  • installed() - runs when driver (or perhaps device??) is installed, via pair or virtual
  • configure() - runs when driver is installed, after installed is run. if capability Configuration ex-ists, a Configure command tile is added to the device page.
  • initialize() - runs first time driver loads, ie system startup when capability Initialize exists, a Initialize command tile is added to the device page.
  • updated() - runs when save is clicked in the preferences section

In hubitat, we have refresh as a capability, which then expects implementation of a command method refresh()
And in some cases we have a custom command "refresh" declared (sans refresh as a capability), which again, expects a method refresh() to be declared.
Unlike the others that you posted, refresh is not part of any built in hub and or device events, meaning it does not run automatically within a driver or from the hub unless a driver or application specifically schedules it.

2 Likes

Thank you for clearing that up for me :slight_smile:

My vThermostat app needs the refresh() declared because the Thermostat Controller app does call it and was throwing errors in the log.

So yes it is being called from other apps at some point.

A good example would be a driver for a cloud-based device that has to poll for status. Refresh could force a poll for status update.

Thanks nclark and 672southmain,

My question was more to the point that refresh() is not "automatically" run by the system unlike the others listed. So in that light it is no more than a descriptive method name authors use to refresh some information.

2 Likes

+1

Could be spelled any number of alternative ways :slight_smile: I've seen "Poll" used similarly, and then all the HubConnect drivers have "Sync", which is the same thing, but the opposite direction. Not a refresh of a device.. but a refresh of a connected hub. :smiley:

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.