diff --git a/.gitignore b/.gitignore index 3605b50..dbd8c63 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,3 @@ bin/ export/ **/Thumbs.db settings.txt -export.cmd diff --git a/README.md b/README.md index f17aaab..fffd1e5 100644 --- a/README.md +++ b/README.md @@ -190,6 +190,15 @@ Having created that token, before you dismiss the dialogue box with the value yo You should now have a working application on your watch and be able to operate your Home Assistant devices for as long as your watch is within Bluetooth range of your phone. +The first toggle option selects between two menu presentations as follows: + +| Menu Type | Image | Description | +|-----------------|------------------------------------------------------------------------|-------------| +| Icons (default) | | "Lean User Interface" version removing the second row of text in favour of icons. Tap icons are blue with a pointing finger, menu items has three dots as favours by many graphical user interfaces. | +| Labels | | Initial version that had a second row of text. This extra text has yet to add much value. Menu and Tap actions are distinguished by text, and the toggle status is duplicated by text. A future version could possibly offer the means to customise the toggle menu item text, hence this option has not been deprecated yet. | + +The second toggle setting is for "text alignment" and provides finer adjustment for right-to-left languages. Perhaps this could be made automatic based on device language. + ## Tap Item Response Its obvious that a toggle menu item has been triggered as the visible switch changes position and colour. Less obvious is that you have successfully triggered a tap operation. @@ -243,3 +252,4 @@ The `id` attribute values are taken from the same names used in [`strings.xml`]( | 1.5 | Added an optional confirmation dialogue view to prevent accidental execution of actions on mistaken tap. This also brings a change in the JSON schema to allow an optional field to specify that the confirmation should be used for a menu item. As we are now maturing and adding features we have decided to mitigate breaking changes to the JSON schema by being more careful to adopt the Home Assistant schema (noting there is a 1:1 mapping between YAML and JSON). This change does deprecate the top level `service` tag in favour of `tag_action` containing multiple fields including `service` & `confirm`. Users should migrate to the new format for the new functionality, but the timescale for actual deprecation are long and undecided. | | 1.6 | Added a user configurable 'timeout' in seconds so that when no action is taken the application automatically closes, stopping the continuous polling for changes of status and hence saving the drain on the battery. This can be disabled with timeout=0. | | 1.7 | Added timeout to confirmation views so that when used for security devices it does not linger when left unconfirmed. Thanks to [Jan Schneider](https://github.com/j-a-n) for the contribution. Known bug for devices not supporting [`WatchUi.getCurrentView()`](https://developer.garmin.com/connect-iq/api-docs/Toybox/WatchUi.html#getCurrentView-instance_function) API call which is only available on API Level 3.4.0, e.g. Vivoactive 4S. | +| 2.0 | A significant code base change to enable both a 'widget' version for older devices, e.g. Venu (1), and an application with a glance, e.g. Venu2. These two versions must now be distributed under separate application IDs, but they have the same code base. A further 20 more devices are now supported, and the settings have been internationalised. | diff --git a/export.cmd b/export.cmd new file mode 100644 index 0000000..08e9da7 --- /dev/null +++ b/export.cmd @@ -0,0 +1,125 @@ +@echo off +rem ----------------------------------------------------------------------------------- +rem +rem Distributed under MIT Licence +rem See https://github.com/house-of-abbey/GarminHomeAssistant/blob/main/LICENSE. +rem +rem ----------------------------------------------------------------------------------- +rem +rem GarminHomeAssistant is a Garmin IQ application written in Monkey C and routinely +rem tested on a Venu 2 device. The source code is provided at: +rem https://github.com/house-of-abbey/GarminHomeAssistant. +rem +rem J D Abbey & P A Abbey, 28 December 2022 +rem +rem Reference: +rem * Using Monkey C from the Command Line +rem * https://developer.garmin.com/connect-iq/reference-guides/monkey-c-command-line-setup/ +rem +rem ----------------------------------------------------------------------------------- + +rem Check this path is correct for your Java installation +set JAVA_PATH="C:\Program Files (x86)\Common Files\Oracle\Java\javapath" +rem SDK_PATH should work for all users +set /p SDK_PATH=<"%USERPROFILE%\AppData\Roaming\Garmin\ConnectIQ\current-sdk.cfg" +set SDK_PATH=%SDK_PATH:~0,-1%\bin + +rem C:\>java -jar %SDK_PATH%\monkeybrains.jar -h +rem usage: monkeyc [-a ] [-b ] [--build-stats ] [-c ] [-d ] +rem [--debug-log-level ] [--debug-log-output ] [-e] +rem [--Eno-invalid-symbol] [-f ] [-g] [-h] [-i ] [-k] [-l ] +rem [-m ] [--no-gen-styles] [-o ] [-O ] [-p ] [-r] [-s +rem ] [-t] [-u ] [-v] [-w] [-x ] [-y ] [-z ] +rem -a,--apidb API import file +rem -b,--apimir API MIR file +rem --build-stats Print build stats [0=basic] +rem -c,--api-level API Level to target +rem -d,--device Target device +rem --debug-log-level Debug logging verbosity [0=errors, 1=basic, +rem 2=intermediate, 3=verbose] +rem --debug-log-output Output log zip file +rem -e,--package-app Create an application package. +rem --Eno-invalid-symbol Do not error when a symbol is found to be invalid +rem -f,--jungles Jungle files +rem -g,--debug Print debug output +rem -h,--help Prints help information +rem -i,--import-dbg Import api.debug.xml +rem -k,--profile Enable profiling support +rem -l,--typecheck Type check [0=off, 1=gradual, 2=informative, +rem 3=strict] +rem -m,--manifest Manifest file (deprecated) +rem --no-gen-styles Do not generate Rez.Styles module +rem -o,--output Output file to create +rem -O,--optimization Optimization level [0=none, 1=basic, 2=fast +rem optimizations, 3=slow optimizations] [p=optimize +rem performance, z=optimize code space] +rem -p,--project-info projectInfo.xml file to use when compiling +rem -r,--release Strip debug information +rem -s,--sdk-version SDK version to target (deprecated, use -c +rem -t,--unit-test Enables compilation of unit tests +rem -u,--devices devices.xml file to use when compiling (deprecated) +rem -v,--version Prints the compiler version +rem -w,--warn Show compiler warnings +rem -x,--excludes Add annotations to the exclude list (deprecated) +rem -y,--private-key Private key to sign builds with +rem -z,--rez Resource files (deprecated) + +rem Batch file's directory where the source code is +set SRC=%~dp0 +rem drop last character '\' +set SRC=%SRC:~0,-1% + +del /f /q %SRC%\export\HomeAssistant*.iq + +echo. +echo Starting export of HomeAssistant Application +echo. + +"%JAVA_PATH%\java.exe" ^ + -Xms1g ^ + -Dfile.encoding=UTF-8 ^ + -Dapple.awt.UIElement=true ^ + -jar %SDK_PATH%\monkeybrains.jar ^ + --api-level 3.1.0 ^ + --output %SRC%\export\HomeAssistant-app.iq ^ + --jungles %SRC%\monkey.jungle ^ + --private-key %SRC%\..\developer_key ^ + --package-app ^ + --release +rem --warn + +echo. +echo Starting export of HomeAssistant Widget +echo. + +"%JAVA_PATH%\java.exe" ^ + -Xms1g ^ + -Dfile.encoding=UTF-8 ^ + -Dapple.awt.UIElement=true ^ + -jar %SDK_PATH%\monkeybrains.jar ^ + --api-level 3.1.0 ^6 + --output %SRC%\export\HomeAssistant-widget.iq ^ + --jungles %SRC%\monkey-widget.jungle ^ + --private-key %SRC%\..\developer_key ^ + --package-app ^ + --release +rem --warn + +echo. +echo Finished exporting HomeAssistant +dir %SRC%\export\HomeAssistant*.iq + +pause +exit /b + +rem Compile PRG for a single device for side loading +"%JAVA_PATH%\java.exe" ^ + -Xms1g ^ + -Dfile.encoding=UTF-8 ^ + -Dapple.awt.UIElement=true ^ + -jar %SDK_PATH%\monkeybrains.jar ^ + --output %SRC%\bin\HomeAssistant.prg ^ + --jungles %SRC%\monkey.jungle ^ + --private-key %SRC%\..\developer_key ^ + --device venu2_sim ^ + --warn diff --git a/images/Actual_Venu2_LeanUI.jpg b/images/Actual_Venu2_LeanUI.jpg new file mode 100644 index 0000000..0318d38 Binary files /dev/null and b/images/Actual_Venu2_LeanUI.jpg differ diff --git a/images/Actual_Venu2_Theme.jpg b/images/Actual_Venu2_Theme.jpg index 1cba712..559429e 100644 Binary files a/images/Actual_Venu2_Theme.jpg and b/images/Actual_Venu2_Theme.jpg differ diff --git a/images/GarminHomeAssistantSettings.png b/images/GarminHomeAssistantSettings.png index 81947c4..15b1d5f 100644 Binary files a/images/GarminHomeAssistantSettings.png and b/images/GarminHomeAssistantSettings.png differ diff --git a/manifest-widget.xml b/manifest-widget.xml new file mode 100644 index 0000000..6fdc41b --- /dev/null +++ b/manifest-widget.xml @@ -0,0 +1,194 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ara + bul + zhs + zht + hrv + ces + dan + dut + deu + gre + eng + est + fin + fre + heb + hun + ind + ita + jpn + kor + lav + lit + zsm + nob + pol + por + slo + ron + + slv + spa + swe + tha + tur + ukr + vie + + + + + \ No newline at end of file diff --git a/manifest.xml b/manifest.xml index e099b04..d3c1211 100644 --- a/manifest.xml +++ b/manifest.xml @@ -11,7 +11,10 @@ P A Abbey & J D Abbey & Someone0nEarth, 31 October 2023 - Someone0nEarth's Test App id="bf69be91-5833-4d96-92ea-c5f1a9db5dcc" type="widget" + Device Information & References: + * https://developer.garmin.com/connect-iq/compatible-devices/ + * https://developer.garmin.com/connect-iq/reference-guides/devices-reference/ + philipabbey's Test App id="98c36259-498a-4458-9cef-74a273ad2bc3" type="watch-app" Live Application id="40131e87-31ff-454b-a8e2-92276ee399d6" type="watch-app" @@ -21,7 +24,7 @@ Use "Monkey C: Edit Application" from the Visual Studio Code command palette to update the application attributes. --> - + - - - - - - - - - - - + - + + + - + + + - - + + - + - - - - - + + + - - - - - - - - - - + - - - - - + + + - - - + - - - - - - - + + @@ -142,31 +115,23 @@ - - - - + - - - + + + - - - - - - - + + + + - - + + + + diff --git a/resources-launcher-33-33/launcher.png b/resources-launcher-33-33/launcher.png new file mode 100644 index 0000000..8dfd712 Binary files /dev/null and b/resources-launcher-33-33/launcher.png differ