I take a different approach to initialization. I make two, almost identical Home Activities. After a program reload or reboot, the first Home Activity initializes everything. No testing is required because you are guaranteed that this Activity has not been executed and will not be executed again. (Regular user pages, never reference this special Home Activity.) Page down on this initial Home Activity leads to a diagnostic Page where I have access to controlled device setup and any diagnostic buttons that I might want to provide for my use. Regular users will not notice anything different about this initial Home Activity, even if they reboot the Pronto.
Assume that, at some point, a user will manually turn something ON or OFF and your program will be out of sync with one or more devices. Since cable boxes are the largest pain in the neck in this respect, I don’t include any cable box power commands. The cable box stays ON and I instruct users to avoid the cable box power button. Mostly, I use devices that have discrete ON/OFF commands. A master “System Off” button will set all of the device flags to “Off”.