From d81fa1abcdf5dded2e39bffa873143027051e4e0 Mon Sep 17 00:00:00 2001 From: Philip Abbey Date: Wed, 1 Nov 2023 19:46:28 +0000 Subject: [PATCH] Added confirmation of tap event and amended delegate decoding of actions. --- source/HomeAssistantMenuItem.mc | 7 +++++++ source/HomeAssistantView.mc | 14 +++----------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/source/HomeAssistantMenuItem.mc b/source/HomeAssistantMenuItem.mc index 5ca2485..91b64c4 100644 --- a/source/HomeAssistantMenuItem.mc +++ b/source/HomeAssistantMenuItem.mc @@ -57,6 +57,13 @@ class HomeAssistantMenuItem extends WatchUi.MenuItem { if (Globals.debug) { System.println("HomeAssistantMenuItem Note - onReturnExecScript(): Correct script executed."); } + new Alert({ + :timeout => Globals.alertTimeout, + :font => Graphics.FONT_SYSTEM_MEDIUM, + :text => (d[i].get("attributes") as Lang.Dictionary).get("friendly_name"), + :fgcolor => Graphics.COLOR_WHITE, + :bgcolor => Graphics.COLOR_BLACK + }).pushView(WatchUi.SLIDE_IMMEDIATE); } } } diff --git a/source/HomeAssistantView.mc b/source/HomeAssistantView.mc index a84a04f..d63d49e 100644 --- a/source/HomeAssistantView.mc +++ b/source/HomeAssistantView.mc @@ -148,16 +148,8 @@ class HomeAssistantViewDelegate extends WatchUi.Menu2InputDelegate { } } - function onSwipe(swipeEvent) as Lang.Boolean { - switch (swipeEvent.getDirection()) { - case WatchUi.SWIPE_RIGHT: - WatchUi.popView(WatchUi.SLIDE_RIGHT); - break; - - default: - // Do nothing - break; - } - return true; + function onBack() { + WatchUi.popView(WatchUi.SLIDE_RIGHT); } + } \ No newline at end of file