[RELEASE] Auto_Off - Another choice to automatically turn off devices after set amount of time on

MFornander made the case that a Parent/Child App would be more complex here

As mentioned above, for this 'style' of Parent, it doesn't run except to create a new Child or display a list of Child apps.

The Child App itself is the original app that subscribes to the target switch, causing the App to run. Therefore, in that sense, the two are identical. However, I didn't leave that app alone. The switchHandler() method went from 5 lines to 13. Three of those are to limit check the # of minutes (1hr) but one line is a call to update the Status 'Hint' seen in green next to the app name. That's the 'expensive part' at 53 lines that didn't exist in the original. So yes, I would say my version of the Child is 'more expensive' than the original. Not due to the Parent/Child aspect, but due to the 'status hint'.

I also chose to replace Polling every minute with an explicit timer. IF you set the Off time to be 1 minute, there's virtually no difference in execution. However, delays greater than 1 minute gains because the App doesn't run just to find out there's nothing to do. So a 7 minute delay means there's 6x gain of whatever minuscule time was spent polling. A 15min delay is a 14x gain, and so on.

I suspect all of my changes might total to be so small as to not be discernible, and certainly not to the human eye.

To summarize, the functional differences are:

  • Status Hints beside the App name.
  • Polling replaced.
  • Version Check was swapped to 'my' method
5 Likes