Support for Vivoactive 6 device (#230)

This required an update to the SDK to version 8.1.0. The new SDK found
some new code warnings for unreachable code previously known to be
reached based on stricter type checking, so fixed in this commit too.
This commit is contained in:
__JosephAbbey
2025-04-25 07:59:58 +01:00
committed by GitHub
6 changed files with 50 additions and 43 deletions

View File

@ -40,3 +40,4 @@
| 2.25 | 2 Bug fixes. First time startup issues caused by v2.24 change and a fix for pure numbers in returned templates. |
| 2.26 | Retry responsive menu fix failed in v2.24. Cosmetic internal class changes. |
| 2.27 | Trivial bug fix for the glance view to prevent the "Unconfigured" result being erroneously displayed because the settings were not yet pulled from persistent storage. |
| 2.28 | Added support for Vivoactive 6 device which also required an SDK update to 8.1.0. |

View File

@ -29,22 +29,24 @@ rem Assume we can create and use this directory
set DEST=export
set IQ=HomeAssistant-app.iq
rem C:\>java -jar %SDK_PATH%\monkeybrains.jar -h
rem usage: monkeyc [-a <arg>] [-b <arg>] [--build-stats <arg>] [-c <arg>] [-d <arg>]
rem [--debug-log-level <arg>] [--debug-log-output <arg>] [-e]
rem usage: monkeyc [-a <arg>] [-b <arg>] [--build-stats <arg>] [-d <arg>]
rem [--debug-log-level <arg>] [--debug-log-output <arg>]
rem [--disable-api-has-check-removal] [--disable-v2-opcodes] [-e]
rem [--Eno-invalid-symbol] [-f <arg>] [-g] [-h] [-i <arg>] [-k] [-l <arg>]
rem [-m <arg>] [--no-gen-styles] [-o <arg>] [-O <arg>] [-p <arg>] [-r] [-s
rem <arg>] [-t] [-u <arg>] [-v] [-w] [-x <arg>] [-y <arg>] [-z <arg>]
rem [-m <arg>] [--no-gen-styles] [-o <arg>] [-O <arg>] [-p <arg>] [-r] [-t]
rem [-u <arg>] [-v] [-w] [-x <arg>] [-y <arg>] [-z <arg>]
rem -a,--apidb <arg> API import file
rem -b,--apimir <arg> API MIR file
rem --build-stats <arg> Print build stats [0=basic]
rem -c,--api-level <arg> API Level to target
rem -d,--device <arg> Target device
rem --debug-log-level <arg> Debug logging verbosity [0=errors, 1=basic,
rem 2=intermediate, 3=verbose]
rem --debug-log-output <arg> Output log zip file
rem --disable-api-has-check-removalDo not optimize out API has checks
rem --disable-v2-opcodes Do not use the v2 opcodes
rem -e,--package-app Create an application package.
rem --Eno-invalid-symbol Do not error when a symbol is found to be invalid
rem --Eno-invalid-symbol Do not error when a symbol is found to be
rem invalid
rem -f,--jungles <arg> Jungle files
rem -g,--debug Print debug output
rem -h,--help Prints help information
@ -56,16 +58,18 @@ rem -m,--manifest <arg> Manifest file (deprecated)
rem --no-gen-styles Do not generate Rez.Styles module
rem -o,--output <arg> Output file to create
rem -O,--optimization <arg> Optimization level [0=none, 1=basic, 2=fast
rem optimizations, 3=slow optimizations] [p=optimize
rem performance, z=optimize code space]
rem optimizations, 3=slow optimizations]
rem [p=optimize performance, z=optimize code
rem space]
rem -p,--project-info <arg> projectInfo.xml file to use when compiling
rem -r,--release Strip debug information
rem -s,--sdk-version <arg> SDK version to target (deprecated, use -c
rem -t,--unit-test Enables compilation of unit tests
rem -u,--devices <arg> devices.xml file to use when compiling (deprecated)
rem -u,--devices <arg> devices.xml file to use when compiling
rem (deprecated)
rem -v,--version Prints the compiler version
rem -w,--warn Show compiler warnings
rem -x,--excludes <arg> Add annotations to the exclude list (deprecated)
rem -x,--excludes <arg> Add annotations to the exclude list
rem (deprecated)
rem -y,--private-key <arg> Private key to sign builds with
rem -z,--rez <arg> Resource files (deprecated)
@ -96,7 +100,6 @@ echo.
-Dfile.encoding=UTF-8 ^
-Dapple.awt.UIElement=true ^
-jar %SDK_PATH%\monkeybrains.jar ^
--api-level 3.1.0 ^
--output %IQ% ^
--jungles %SRC%\monkey.jungle ^
--private-key %SRC%\..\developer_key ^

View File

@ -159,6 +159,7 @@
<iq:product id="vivoactive4"/>
<iq:product id="vivoactive4s"/>
<iq:product id="vivoactive5"/>
<iq:product id="vivoactive6"/>
</iq:products>
<!--
Use "Monkey C: Edit Permissions" from the Visual Studio Code command

View File

@ -241,5 +241,7 @@ vivoactive3mlte.resourcePath = $(vivoactive3mlte.resourcePath);resources-launche
vivoactive4.resourcePath = $(vivoactive4.resourcePath);resources-launcher-35-35;resources-icons-30
# Screen Size 218x218 launcher icon size 30x30
vivoactive4s.resourcePath = $(vivoactive4s.resourcePath);resources-launcher-30-30;resources-icons-26
# Screen Size 390x390 launcher icon size 70x70
vivoactive5.resourcePath = $(vivoactive5.resourcePath);resources-launcher-70-70;resources-icons-46
# Screen Size 390x390 launcher icon size 56x56
vivoactive5.resourcePath = $(vivoactive5.resourcePath);resources-launcher-56-56;resources-icons-46
# Screen Size 390x390 launcher icon size 54x54
vivoactive6.resourcePath = $(vivoactive6.resourcePath);resources-launcher-54-54;resources-icons-46

View File

@ -51,7 +51,7 @@ class HomeAssistantMenuItem extends WatchUi.IconMenuItem {
return mTemplate;
}
function updateState(data as Lang.String or Lang.Dictionary or Null) as Void {
function updateState(data as Lang.String or Lang.Dictionary or Lang.Number or Lang.Float or Null) as Void {
if (data == null) {
setSubLabel($.Rez.Strings.Empty);
} else if(data instanceof Lang.String) {

View File

@ -75,7 +75,7 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem {
return "{{states('" + mData.get("entity_id") + "')}}";
}
function updateState(data as Lang.String or Lang.Dictionary or Null) as Void {
function updateState(data as Lang.String or Lang.Dictionary or Lang.Number or Lang.Float or Null) as Void {
if (data == null) {
setSubLabel(null);
} else if(data instanceof Lang.String) {