by Corey Hillesheim
This flow controls when your device is locked. You must manually set the lock timeout in your system settings to the maximum value. If a home WiFi or Bluetooth device is connected the device will remain unlocked until the lock timeout is reached. Once the lock timeout is reached the device will lock regardless of the connected devices.
Added occasional automatic restart in case device count gets off which seems to happen from time to time.