On some devices it looks like removing the System.println() statements from inside an 'if' clause whose condition is a constant (static constant Globals.scDebug) makes a memory saving. This would suggest the compiler does not propagate constants and prune unreachable code. However in the device of greatest interest debug removal has made no difference to the memory usage. Here the conditional clauses have been turned into comments that can be removed on a case-by-case basis otherwise the debug printing is too voluminous anyway.
Toggle menu is now consistent with the use of data objects in tap and template. HA 'notify' actions now work.
Co-Authored-By: Joseph Abbey <me@josephabbey.dev>
Also amended a bit of README that was missed and added a memory usage in the RootView for widgets here memory is limited, to serve as a warning to users who are likely to complain.
Added a background service to send the watch battery level to Home Assistant.
Changed the Glance View as requested by a user.
Updated to new HA icon using SVG in stead of PNG.
1) Removed WatchUi.getCurrentView() API call in favour of a new method of ensuring only one ErrorView is pushed at a time.
2) Any error view will be cancelled when responses start working again, e.g. watch gets in Bluetooth range of the phone again.
3) Added error message decoding for misspelled entities.
Co-Authored-By: Joseph Abbey <me@josephabbey.dev>
1. Amended code for a single HomeAssistantService for all 'tap's
2. Removed now redundant GET request for taps without a service now that having a service is enforced.
3. Determined that migrating API code from 'toggle's to the HomeAssistantService is awkward due to the close coupling with other methods in the class.