From 659a060c76e7213bbd4c2419df8acd5605e21398 Mon Sep 17 00:00:00 2001 From: Philip Abbey Date: Tue, 8 Jul 2025 22:45:39 +0100 Subject: [PATCH 1/9] Forgotten image used on App home page --- images/Venu2_Glance_good.png | Bin 0 -> 17253 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 images/Venu2_Glance_good.png diff --git a/images/Venu2_Glance_good.png b/images/Venu2_Glance_good.png new file mode 100644 index 0000000000000000000000000000000000000000..733cd9f937a46aa8d57bfed3b002246f2b536868 GIT binary patch literal 17253 zcmeIa1yEdF+a=oFxVyUqw?J@f8V?B;f&_vD0t9!LhBT58BuEGj!3j=~;DI2)gL@Mo zK(NLeYq-t(&UfdZnQ!W!si~T}x9TnEU2xz$`}E#V@3YQY>)CH~wbhC6>G1&o0FkDK ziar1U%)NWzVxy1jO4OO4e}TPHR@T*2R%UhcaJ7Bq^b!Ezc^~{+s>d_V*sMkf((0?9l*hvToS-NAhVVLtUOh zOWl1lEj*(~3dqeZBYZB5AofGX38EOk*HR6y{$wKGbe9Y8e&76_g#A3>{QXYtplhZU zF@clsF*a z2Go6QOy4lW?uL$d=N50!c}^IA#afkk*qqKd1CyW!CZQ7s%?#7yWeg!-=r8W)qMYhS z6O?aNS5WWTc}WPDK*5eKu6x0m3ILOBhYM^eDa>B2YY@QW#(=#qpIj`n;J&{Z%Tp^=EKkk(-pR-xslC&^fRhL26lxl zWhl38LwI{Iyli{9`Sj>Etu~-+yLHjiRsQx$Zc}%+T;PqAh>@uY?Q1J+`k(bNCh45ujb!I{;QAw zEd0NX{8u0US@?e&`MG+C?`=q zUJ=~;=}!nz@5bW1k;FPu=t)RM+2cmP#OM_>(hJ$x2K$w(VeGLWlu_$|fqhXzW%P{Y zaxO6g{oCIj)$Jst&V1>c5d9gl^Z4VH>qz#NF6Z4FojV9xcTkNPO)>&}CfZp6RCKfv zy=;(DxJ!?RKQ8VQ_H*ZqXX_Lb?bzYi2P3(Xw>{i&**Nbtk=C=a3d_Ac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mF9`=uND|1?ba$kFDxNHplJ+yA) zc)=W&7y}N<^@7oLutWXr8m*}u94I-Y=}Mwh3|Iw3MI?@S_g2x z3L#$UlQ^&>whP^}injO+V7XSD?XXuub)_e*#guj%mU+%$9{K}BB|N0;ahH<#4 z>0PaL9-xpD!s2Cld##WwW9-r89w9e!<3RV-ll*J^-rU2VMQBS|QD)Cb__2}(o_ikt z1%r`pP!JKjaBfH`U@%<90bPL`?vSRNB>~{vVVd)ltF~s!Nbgd3eD$$VF7Anh&p>wK z{aTtW$q$`1`p}@K8sJJp)-p#P^Abq8A?p!&HI;!8kZH&7z!{v!5cI++hr;P9OM@!F zqs7Pg!sR@|3g-)AFJtd3W7}_qqZZt!8W~Fzw}#82?Y|BBr7jx_GuKEMkh!ByiX25R z&`;)hfO|TX2qHlvRzp706nwO0AeWPESqD|4jY=^A Date: Tue, 8 Jul 2025 22:48:42 +0100 Subject: [PATCH 2/9] Added two new options to menu items 1. The ability to disable a menu item without deleting it. 2. The option to quit the application on item selection. --- source/HomeAssistantMenuItemFactory.mc | 23 ++++++++++++++--------- source/HomeAssistantTapMenuItem.mc | 10 ++++++++-- source/HomeAssistantToggleMenuItem.mc | 16 +++++++++++----- source/HomeAssistantView.mc | 25 +++++++++++++++++-------- 4 files changed, 50 insertions(+), 24 deletions(-) diff --git a/source/HomeAssistantMenuItemFactory.mc b/source/HomeAssistantMenuItemFactory.mc index bec8239..0563929 100644 --- a/source/HomeAssistantMenuItemFactory.mc +++ b/source/HomeAssistantMenuItemFactory.mc @@ -77,15 +77,17 @@ class HomeAssistantMenuItemFactory { label as Lang.String or Lang.Symbol, entity_id as Lang.String or Null, template as Lang.String or Null, + exit as Lang.Boolean, confirm as Lang.Boolean, pin as Lang.Boolean ) as WatchUi.MenuItem { return new HomeAssistantToggleMenuItem( label, template, + { "entity_id" => entity_id }, + exit, confirm, pin, - { "entity_id" => entity_id }, mMenuItemOptions ); } @@ -101,13 +103,14 @@ class HomeAssistantMenuItemFactory { //! @param data Sourced from the menu JSON, this is the `data` field from the `tap_action` field. // function tap( - label as Lang.String or Lang.Symbol, - entity_id as Lang.String or Null, - template as Lang.String or Null, - service as Lang.String or Null, + label as Lang.String or Lang.Symbol, + entity_id as Lang.String or Null, + template as Lang.String or Null, + service as Lang.String or Null, + data as Lang.Dictionary or Null, + exit as Lang.Boolean, confirm as Lang.Boolean, - pin as Lang.Boolean, - data as Lang.Dictionary or Null + pin as Lang.Boolean ) as WatchUi.MenuItem { if (entity_id != null) { if (data == null) { @@ -121,9 +124,10 @@ class HomeAssistantMenuItemFactory { label, template, service, + data, + exit, confirm, pin, - data, mTapTypeIcon, mMenuItemOptions, mHomeAssistantService @@ -133,9 +137,10 @@ class HomeAssistantMenuItemFactory { label, template, service, + data, + exit, confirm, pin, - data, mInfoTypeIcon, mMenuItemOptions, mHomeAssistantService diff --git a/source/HomeAssistantTapMenuItem.mc b/source/HomeAssistantTapMenuItem.mc index 0f7a2c1..fd79973 100644 --- a/source/HomeAssistantTapMenuItem.mc +++ b/source/HomeAssistantTapMenuItem.mc @@ -23,6 +23,7 @@ class HomeAssistantTapMenuItem extends HomeAssistantMenuItem { private var mHomeAssistantService as HomeAssistantService; private var mService as Lang.String or Null; private var mConfirm as Lang.Boolean; + private var mExit as Lang.Boolean; private var mPin as Lang.Boolean; private var mData as Lang.Dictionary or Null; @@ -43,9 +44,10 @@ class HomeAssistantTapMenuItem extends HomeAssistantMenuItem { label as Lang.String or Lang.Symbol, template as Lang.String, service as Lang.String or Null, + data as Lang.Dictionary or Null, + exit as Lang.Boolean, confirm as Lang.Boolean, pin as Lang.Boolean, - data as Lang.Dictionary or Null, icon as Graphics.BitmapType or WatchUi.Drawable, options as { :alignment as WatchUi.MenuItem.Alignment, @@ -67,9 +69,10 @@ class HomeAssistantTapMenuItem extends HomeAssistantMenuItem { mHomeAssistantService = haService; mService = service; + mData = data; + mExit = exit; mConfirm = confirm; mPin = pin; - mData = data; } //! Call a Home Assistant service only after checks have been done for confirmation or PIN entry. @@ -105,6 +108,9 @@ class HomeAssistantTapMenuItem extends HomeAssistantMenuItem { if (mService != null) { mHomeAssistantService.call(mService, mData); } + if (mExit) { + System.exit(); + } } } diff --git a/source/HomeAssistantToggleMenuItem.mc b/source/HomeAssistantToggleMenuItem.mc index 13cd2d1..443549c 100644 --- a/source/HomeAssistantToggleMenuItem.mc +++ b/source/HomeAssistantToggleMenuItem.mc @@ -22,10 +22,11 @@ using Toybox.Timer; //! Light or switch toggle menu button that calls the API to maintain the up to date state. // class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem { - private var mConfirm as Lang.Boolean; - private var mPin as Lang.Boolean; private var mData as Lang.Dictionary; private var mTemplate as Lang.String; + private var mExit as Lang.Boolean; + private var mConfirm as Lang.Boolean; + private var mPin as Lang.Boolean; private var mHasVibrate as Lang.Boolean = false; //! Class Constructor @@ -40,9 +41,10 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem { function initialize( label as Lang.String or Lang.Symbol, template as Lang.String, + data as Lang.Dictionary or Null, + exit as Lang.Boolean, confirm as Lang.Boolean, pin as Lang.Boolean, - data as Lang.Dictionary or Null, options as { :alignment as WatchUi.MenuItem.Alignment, :icon as Graphics.BitmapType or WatchUi.Drawable or Lang.Symbol @@ -58,10 +60,11 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem { if (Attention has :vibrate) { mHasVibrate = true; } - mConfirm = confirm; - mPin = pin; mData = data; mTemplate = template; + mExit = exit; + mConfirm = confirm; + mPin = pin; } //! Set the state of a toggle menu item. @@ -294,6 +297,9 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem { // function onConfirm(b as Lang.Boolean) as Void { setState(b); + if (mExit) { + System.exit(); + } } } diff --git a/source/HomeAssistantView.mc b/source/HomeAssistantView.mc index 1c1c888..7a29e5f 100644 --- a/source/HomeAssistantView.mc +++ b/source/HomeAssistantView.mc @@ -51,21 +51,30 @@ class HomeAssistantView extends WatchUi.Menu2 { var confirm = false as Lang.Boolean or Null; var pin = false as Lang.Boolean or Null; var data = null as Lang.Dictionary or Null; + var enable = true as Lang.Boolean or Null; + var exit = false as Lang.Boolean or Null; + if (items[i].get("enable") != null) { + enable = items[i].get("enable"); // Optional + } + if (items[i].get("exit") != null) { + exit = items[i].get("exit"); // Optional + } if (tap_action != null) { service = tap_action.get("service"); - confirm = tap_action.get("confirm"); // Optional - pin = tap_action.get("pin"); // Optional - data = tap_action.get("data"); // Optional - if (confirm == null) { - confirm = false; + data = tap_action.get("data"); // Optional + if (tap_action.get("confirm") != null) { + confirm = tap_action.get("confirm"); // Optional + } + if (tap_action.get("pin") != null) { + pin = tap_action.get("pin"); // Optional } } - if (type != null && name != null) { + if (type != null && name != null && enable) { if (type.equals("toggle") && entity != null) { - addItem(HomeAssistantMenuItemFactory.create().toggle(name, entity, content, confirm, pin)); + addItem(HomeAssistantMenuItemFactory.create().toggle(name, entity, content, exit, confirm, pin)); } else if ((type.equals("tap") && service != null) || (type.equals("info") && content != null) || (type.equals("template") && content != null)) { // NB. "template" is deprecated in the schema and remains only for backward compatibility. All menu items can now use templates, so the replacement is "info". - addItem(HomeAssistantMenuItemFactory.create().tap(name, entity, content, service, confirm, pin, data)); + addItem(HomeAssistantMenuItemFactory.create().tap(name, entity, content, service, data, exit, confirm, pin)); } else if (type.equals("group")) { addItem(HomeAssistantMenuItemFactory.create().group(items[i], content)); } From 029a9f373eb6513bc7d5a58f0a319900b92ab417 Mon Sep 17 00:00:00 2001 From: Philip Abbey Date: Wed, 9 Jul 2025 19:57:11 +0100 Subject: [PATCH 3/9] Update config.schema.json Added to boolean options for disable and exit. --- config.schema.json | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/config.schema.json b/config.schema.json index b24affd..e09b6ec 100644 --- a/config.schema.json +++ b/config.schema.json @@ -47,6 +47,12 @@ } }, "additionalProperties": false + }, + "enable": { + "$ref": "#/$defs/enable" + }, + "exit": { + "$ref": "#/$defs/exit" } }, "required": ["entity", "name", "type"], @@ -75,6 +81,12 @@ "deprecated": true, "title": "Schema change:", "description": "Use 'info' or 'tap' instead." + }, + "enable": { + "$ref": "#/$defs/enable" + }, + "exit": { + "$ref": "#/$defs/exit" } }, "required": ["name", "content", "type"], @@ -101,6 +113,12 @@ }, "tap_action": { "$ref": "#/$defs/tap_action" + }, + "enable": { + "$ref": "#/$defs/enable" + }, + "exit": { + "$ref": "#/$defs/exit" } }, "required": ["name", "content", "type", "tap_action"], @@ -120,6 +138,12 @@ "type": { "$ref": "#/$defs/type", "const": "info" + }, + "enable": { + "$ref": "#/$defs/enable" + }, + "exit": { + "$ref": "#/$defs/exit" } }, "required": ["name", "content", "type"], @@ -149,6 +173,12 @@ }, "tap_action": { "$ref": "#/$defs/tap_action" + }, + "enable": { + "$ref": "#/$defs/enable" + }, + "exit": { + "$ref": "#/$defs/exit" } }, "required": ["name", "type"], @@ -181,6 +211,9 @@ }, "items": { "$ref": "#/$defs/items" + }, + "enable": { + "$ref": "#/$defs/enable" } }, "required": ["name", "title", "type", "items"], @@ -293,6 +326,18 @@ "required": ["type"] } ] + }, + "enable": { + "type": "boolean", + "default": true, + "title": "Enable the menu item", + "description": "Typically used to temporarily disable a menu item, e.g. for seasonal variations. Enabled (true) by default." + }, + "exit": { + "type": "boolean", + "default": false, + "title": "Exit on selection", + "description": "Choose to exit the application after this item has been selected. Disabled (false) by default." } } } From b28daacafdc9e7aeeeff5301b3ce10045f5c29b8 Mon Sep 17 00:00:00 2001 From: Philip Abbey Date: Wed, 9 Jul 2025 20:54:28 +0100 Subject: [PATCH 4/9] Update config.schema.json Removed exit from non-actionable menu items. --- config.schema.json | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/config.schema.json b/config.schema.json index e09b6ec..2611f69 100644 --- a/config.schema.json +++ b/config.schema.json @@ -84,9 +84,6 @@ }, "enable": { "$ref": "#/$defs/enable" - }, - "exit": { - "$ref": "#/$defs/exit" } }, "required": ["name", "content", "type"], @@ -141,9 +138,6 @@ }, "enable": { "$ref": "#/$defs/enable" - }, - "exit": { - "$ref": "#/$defs/exit" } }, "required": ["name", "content", "type"], @@ -337,7 +331,7 @@ "type": "boolean", "default": false, "title": "Exit on selection", - "description": "Choose to exit the application after this item has been selected. Disabled (false) by default." + "description": "Choose to exit the application after this item has been selected. Disabled (false) by default. N.B. Only actionable menu items can have this field added." } } } From 6dbcea94cfbff37c71ee7c28cdf1a262c70fca80 Mon Sep 17 00:00:00 2001 From: Philip Abbey Date: Wed, 9 Jul 2025 21:09:33 +0100 Subject: [PATCH 5/9] Update HomeAssistantView.mc Refined more precisely where the exit option can be used and enforced in the code. --- source/HomeAssistantView.mc | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/source/HomeAssistantView.mc b/source/HomeAssistantView.mc index 7a29e5f..c8d5412 100644 --- a/source/HomeAssistantView.mc +++ b/source/HomeAssistantView.mc @@ -72,9 +72,21 @@ class HomeAssistantView extends WatchUi.Menu2 { if (type != null && name != null && enable) { if (type.equals("toggle") && entity != null) { addItem(HomeAssistantMenuItemFactory.create().toggle(name, entity, content, exit, confirm, pin)); - } else if ((type.equals("tap") && service != null) || (type.equals("info") && content != null) || (type.equals("template") && content != null)) { - // NB. "template" is deprecated in the schema and remains only for backward compatibility. All menu items can now use templates, so the replacement is "info". + } else if (type.equals("tap") && service != null) { addItem(HomeAssistantMenuItemFactory.create().tap(name, entity, content, service, data, exit, confirm, pin)); + } else if (type.equals("template") && content != null) { + // NB. "template" is deprecated in the schema and remains only for backward compatibility. All menu items can now use templates, so the replacement is "info". + // The exit option is dependent on the type of template. + if (tap_action == null) { + // No exit from an information only item + addItem(HomeAssistantMenuItemFactory.create().tap(name, entity, content, service, data, false, confirm, pin)); + } else { + // You may exit from template item with a 'tap_action'. + addItem(HomeAssistantMenuItemFactory.create().tap(name, entity, content, service, data, exit, confirm, pin)); + } + } else if (type.equals("info") && content != null) { + // Cannot exit from a non-actionable information only menu item. + addItem(HomeAssistantMenuItemFactory.create().tap(name, entity, content, service, data, false, confirm, pin)); } else if (type.equals("group")) { addItem(HomeAssistantMenuItemFactory.create().group(items[i], content)); } From 8b3e86a00fd3d58679c4cdc14bbc188347f8793a Mon Sep 17 00:00:00 2001 From: Philip Abbey Date: Wed, 9 Jul 2025 21:48:58 +0100 Subject: [PATCH 6/9] Amended documentation for two new menu item options The options are 'enable' and 'exit'. --- examples/Actions.md | 32 ++++++++++++++++++++++++++++++++ examples/Switches.md | 26 ++++++++++++++++++++++++++ examples/Templates.md | 13 +++++++++++++ 3 files changed, 71 insertions(+) diff --git a/examples/Actions.md b/examples/Actions.md index cb2154c..65513dc 100644 --- a/examples/Actions.md +++ b/examples/Actions.md @@ -76,3 +76,35 @@ Note that for notify events, you _must_ not supply an `entity_id` or the API cal > Be careful with the value of the `service` field. Note that the `service` field will need to be a locally custom `script.` as soon as any `data` fields are populated and not something more generic like `script.turn_on`. If the `service` field is wrong, the application will fail with a [`Communications.INVALID_HTTP_BODY_IN_NETWORK_RESPONSE`](https://developer.garmin.com/connect-iq/api-docs/Toybox/Communications.html) error in the response from your Home Assistant and show the error message as _"No JSON returned from HTTP request"_ on your device. In the [web-based editor](https://house-of-abbey.github.io/GarminHomeAssistant/web/) you can use the standard developer tools to observe an `HTTP 400` error which the application does not see. Here we are limited by the [Garmin Connect IQ](https://developer.garmin.com/connect-iq/overview/) software development kit (SDK). We do not have enough information at the point of execution in the application to determine the cause of the error. Nor is there an immediately obvious way of identifying this issue using the JSON schema checks. + +## Exit on Tap + +You can choose individual items that will quit after they have completed their action. + +```json +{ + "entity": "automation.turn_off_stuff", + "name": "Turn off Stuff", + "type": "tap", + "tap_action": { + "service": "automation.trigger" + }, + "exit": true +} +``` + +# Disable Menu Item + +If you would like to temporarily disable an item in your menu, e.g. for seasonal reasons like not needing to turn on the heating in summer, then rather than swapping menu definition files or deleting a section of the menu you can mark the item as 'disabled'. This field applies to all menu items. + +```json +{ + "entity": "automation.turn_off_stuff", + "name": "Turn off Stuff", + "type": "tap", + "tap_action": { + "service": "automation.trigger" + }, + "enabled": false +} +``` diff --git a/examples/Switches.md b/examples/Switches.md index 9b200e1..5e1688e 100644 --- a/examples/Switches.md +++ b/examples/Switches.md @@ -109,3 +109,29 @@ Then you can use the following in your config: "type": "toggle" } ``` + +## Exit On Toggle + +You can choose individual items that will quit after they have completed their action. + +```json +{ + "entity": "light.hall_light", + "name": "Hall Light & Quit", + "type": "toggle", + "exit": true +} +``` + +# Disable Menu Item + +If you would like to temporarily disable an item in your menu, e.g. for seasonal reasons like not needing to turn on Christmas tree lights outside the festive season, then rather than swapping menu definition files or deleting a section of the menu you can mark the item as 'disabled'. This field applies to all menu items. + +```json +{ + "entity": "light.chrissmas_tree", + "name": "Christmas Lights", + "type": "toggle", + "enabled": false +} +``` diff --git a/examples/Templates.md b/examples/Templates.md index d09390b..826379b 100644 --- a/examples/Templates.md +++ b/examples/Templates.md @@ -218,6 +218,19 @@ An example of a dimmer light with 4 brightness settings 0..3. Here our light wor } ``` +# Disable Menu Item + +If you would like to temporarily disable an item in your menu, then rather than swapping menu definition files or deleting a section of the menu you can mark the item as 'disabled'. This field applies to all menu items. + +```json +{ + "name": "Phone", + "type": "info", + "content": "{{ ... }}", + "enabled": false +} +``` + ## Warnings Just remember, on older smaller memory devices **you have the ability to crash the application by creating an excessive menu definition**. Templates can require significant definition for highly customised text. Don't be silly. From 5639ff5c4288da865dd765cb4afaa2dbaefcad40 Mon Sep 17 00:00:00 2001 From: Philip Abbey Date: Wed, 9 Jul 2025 21:51:18 +0100 Subject: [PATCH 7/9] Amended heading levels in docs --- examples/Actions.md | 2 +- examples/Switches.md | 2 +- examples/Templates.md | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/examples/Actions.md b/examples/Actions.md index 65513dc..5ce6b19 100644 --- a/examples/Actions.md +++ b/examples/Actions.md @@ -93,7 +93,7 @@ You can choose individual items that will quit after they have completed their a } ``` -# Disable Menu Item +## Disable Menu Item If you would like to temporarily disable an item in your menu, e.g. for seasonal reasons like not needing to turn on the heating in summer, then rather than swapping menu definition files or deleting a section of the menu you can mark the item as 'disabled'. This field applies to all menu items. diff --git a/examples/Switches.md b/examples/Switches.md index 5e1688e..813c374 100644 --- a/examples/Switches.md +++ b/examples/Switches.md @@ -123,7 +123,7 @@ You can choose individual items that will quit after they have completed their a } ``` -# Disable Menu Item +## Disable Menu Item If you would like to temporarily disable an item in your menu, e.g. for seasonal reasons like not needing to turn on Christmas tree lights outside the festive season, then rather than swapping menu definition files or deleting a section of the menu you can mark the item as 'disabled'. This field applies to all menu items. diff --git a/examples/Templates.md b/examples/Templates.md index 826379b..6fd804e 100644 --- a/examples/Templates.md +++ b/examples/Templates.md @@ -218,7 +218,7 @@ An example of a dimmer light with 4 brightness settings 0..3. Here our light wor } ``` -# Disable Menu Item +## Disable Menu Item If you would like to temporarily disable an item in your menu, then rather than swapping menu definition files or deleting a section of the menu you can mark the item as 'disabled'. This field applies to all menu items. From 842a31a1ccc8f83fcc8bda6a8a508881ad89026d Mon Sep 17 00:00:00 2001 From: Philip Abbey Date: Thu, 10 Jul 2025 18:24:30 +0100 Subject: [PATCH 8/9] Review comment enable => enabled --- config.schema.json | 26 +++++++++++++------------- source/HomeAssistantView.mc | 8 ++++---- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/config.schema.json b/config.schema.json index 2611f69..b69b00a 100644 --- a/config.schema.json +++ b/config.schema.json @@ -48,8 +48,8 @@ }, "additionalProperties": false }, - "enable": { - "$ref": "#/$defs/enable" + "enabled": { + "$ref": "#/$defs/enabled" }, "exit": { "$ref": "#/$defs/exit" @@ -82,8 +82,8 @@ "title": "Schema change:", "description": "Use 'info' or 'tap' instead." }, - "enable": { - "$ref": "#/$defs/enable" + "enabled": { + "$ref": "#/$defs/enabled" } }, "required": ["name", "content", "type"], @@ -111,8 +111,8 @@ "tap_action": { "$ref": "#/$defs/tap_action" }, - "enable": { - "$ref": "#/$defs/enable" + "enabled": { + "$ref": "#/$defs/enabled" }, "exit": { "$ref": "#/$defs/exit" @@ -136,8 +136,8 @@ "$ref": "#/$defs/type", "const": "info" }, - "enable": { - "$ref": "#/$defs/enable" + "enabled": { + "$ref": "#/$defs/enabled" } }, "required": ["name", "content", "type"], @@ -168,8 +168,8 @@ "tap_action": { "$ref": "#/$defs/tap_action" }, - "enable": { - "$ref": "#/$defs/enable" + "enabled": { + "$ref": "#/$defs/enabled" }, "exit": { "$ref": "#/$defs/exit" @@ -206,8 +206,8 @@ "items": { "$ref": "#/$defs/items" }, - "enable": { - "$ref": "#/$defs/enable" + "enabled": { + "$ref": "#/$defs/enabled" } }, "required": ["name", "title", "type", "items"], @@ -321,7 +321,7 @@ } ] }, - "enable": { + "enabled": { "type": "boolean", "default": true, "title": "Enable the menu item", diff --git a/source/HomeAssistantView.mc b/source/HomeAssistantView.mc index c8d5412..7dd2e0d 100644 --- a/source/HomeAssistantView.mc +++ b/source/HomeAssistantView.mc @@ -51,10 +51,10 @@ class HomeAssistantView extends WatchUi.Menu2 { var confirm = false as Lang.Boolean or Null; var pin = false as Lang.Boolean or Null; var data = null as Lang.Dictionary or Null; - var enable = true as Lang.Boolean or Null; + var enabled = true as Lang.Boolean or Null; var exit = false as Lang.Boolean or Null; - if (items[i].get("enable") != null) { - enable = items[i].get("enable"); // Optional + if (items[i].get("enabled") != null) { + enabled = items[i].get("enabled"); // Optional } if (items[i].get("exit") != null) { exit = items[i].get("exit"); // Optional @@ -69,7 +69,7 @@ class HomeAssistantView extends WatchUi.Menu2 { pin = tap_action.get("pin"); // Optional } } - if (type != null && name != null && enable) { + if (type != null && name != null && enabled) { if (type.equals("toggle") && entity != null) { addItem(HomeAssistantMenuItemFactory.create().toggle(name, entity, content, exit, confirm, pin)); } else if (type.equals("tap") && service != null) { From d141c03104d582cd57d34f79663b01b592690717 Mon Sep 17 00:00:00 2001 From: Philip Abbey Date: Thu, 10 Jul 2025 19:46:04 +0100 Subject: [PATCH 9/9] Review comment Moved point of application exit for the menu item option. --- source/HomeAssistantService.mc | 19 ++++++++++++++++--- source/HomeAssistantTapMenuItem.mc | 5 +---- source/HomeAssistantToggleMenuItem.mc | 6 +++--- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/source/HomeAssistantService.mc b/source/HomeAssistantService.mc index 3cfc3b9..104f800 100644 --- a/source/HomeAssistantService.mc +++ b/source/HomeAssistantService.mc @@ -46,7 +46,13 @@ class HomeAssistantService { data as Null or Lang.Dictionary or Lang.String, context as Lang.Object ) as Void { - var entity_id = context as Lang.String or Null; + var c = context as Lang.Dictionary; + var entity_id; + var exit = false; + if (c != null) { + entity_id = c.get(:entity_id) as Lang.String; + exit = c.get(:exit) as Lang.Boolean; + } // System.println("HomeAssistantService onReturnCall() Response Code: " + responseCode); // System.println("HomeAssistantService onReturnCall() Response Data: " + data); @@ -102,6 +108,9 @@ class HomeAssistantService { :bgcolor => Graphics.COLOR_BLACK }).pushView(WatchUi.SLIDE_IMMEDIATE); } + if (exit) { + System.exit(); + } break; default: @@ -117,7 +126,8 @@ class HomeAssistantService { // function call( service as Lang.String, - data as Lang.Dictionary or Null + data as Lang.Dictionary or Null, + exit as Lang.Boolean ) as Void { if (! System.getDeviceSettings().phoneConnected) { // System.println("HomeAssistantService call(): No Phone connection, skipping API call."); @@ -149,7 +159,10 @@ class HomeAssistantService { "Authorization" => "Bearer " + Settings.getApiKey() }, :responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON, - :context => entity_id + :context => { + :entity_id => entity_id, + :exit => exit + } }, method(:onReturnCall) ); diff --git a/source/HomeAssistantTapMenuItem.mc b/source/HomeAssistantTapMenuItem.mc index fd79973..9553f73 100644 --- a/source/HomeAssistantTapMenuItem.mc +++ b/source/HomeAssistantTapMenuItem.mc @@ -106,10 +106,7 @@ class HomeAssistantTapMenuItem extends HomeAssistantMenuItem { // function onConfirm(b as Lang.Boolean) as Void { if (mService != null) { - mHomeAssistantService.call(mService, mData); - } - if (mExit) { - System.exit(); + mHomeAssistantService.call(mService, mData, mExit); } } diff --git a/source/HomeAssistantToggleMenuItem.mc b/source/HomeAssistantToggleMenuItem.mc index 443549c..9ddc347 100644 --- a/source/HomeAssistantToggleMenuItem.mc +++ b/source/HomeAssistantToggleMenuItem.mc @@ -215,6 +215,9 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem { ErrorView.show(WatchUi.loadResource($.Rez.Strings.UnhandledHttpErr) as Lang.String + responseCode); } getApp().setApiStatus(status); + if (mExit) { + System.exit(); + } } //! Set the state of the toggle menu item. @@ -297,9 +300,6 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem { // function onConfirm(b as Lang.Boolean) as Void { setState(b); - if (mExit) { - System.exit(); - } } }