diff --git a/README.md b/README.md index 4cd3120..98bed26 100644 --- a/README.md +++ b/README.md @@ -104,6 +104,14 @@ 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. +## 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. + + + +The application will display a 'toast' showing Home Assistant's friendly name of the triggered item. The toast will disappear after a short while if not dismissed by the user. + ## External Device Changes Home Assistant will inevitably change the state of devices you are also controlling via your Garmin. The Garmin application does not maintain a web socket to listen for changes. Instead it must poll the Home Assistant API with your key. Therefore the application is not responsive to changes, instead there will be a delay of about 5 seconds to pick up state changes. The thinking here is that the watch application will only ever be open briefly not persistently, so the delay in picking up state changes won't be observed often for any race condition between two controllers. diff --git a/images/SimTapResponse.png b/images/SimTapResponse.png new file mode 100644 index 0000000..1522ab4 Binary files /dev/null and b/images/SimTapResponse.png differ diff --git a/images/source/SimTapResponse.png b/images/source/SimTapResponse.png new file mode 100644 index 0000000..4b1c99b Binary files /dev/null and b/images/source/SimTapResponse.png differ diff --git a/source/HomeAssistantMenuItem.mc b/source/HomeAssistantMenuItem.mc index a60986b..bf4a06e 100644 --- a/source/HomeAssistantMenuItem.mc +++ b/source/HomeAssistantMenuItem.mc @@ -59,13 +59,10 @@ class HomeAssistantMenuItem extends WatchUi.MenuItem { if (Globals.debug) { System.println("HomeAssistantMenuItem Note - onReturnExecScript(): Correct script executed."); } - new Alert({ - :timeout => Globals.tapTimeout, - :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); + WatchUi.showToast( + (d[i].get("attributes") as Lang.Dictionary).get("friendly_name") as Lang.String, + null + ); } } }