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>
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.
Glance now updates the status.
Fix for quitting the application when persistently displaying an ErrorView.
Added option for Widget RootView to immediately start HomeAssistant without waiting for a tap as requested by a user.
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.
Separation of phone connectivity and Internet access tests for finer grained feedback to the user.
Updates no longer stop on absence of Internet connectivity.
Copied two methods from GarminThermoNest to translate languages and manage different sized icons for the various sizes of watch. Also copied ErrorView for smaller wrapped text for error messages.