diff --git a/README.md b/README.md
index cc98965..6afbf56 100644
--- a/README.md
+++ b/README.md
@@ -223,3 +223,4 @@ When you change the JSON file defining your dashboard, you must exit the applica
| 1.4 | New lean user Interface with thanks to [SomeoneOnEarth](https://github.com/Someone0nEarth) for their contribution which is now the default. If you prefer the old style you can still select it in the settings. The provision of a 'service' tag is now not just heavily suggested by the JSON schema, it is enforced in code. With apologies to anyone suffering a breakage as a result. |
| 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. |
diff --git a/manifest.xml b/manifest.xml
index 531d78b..a4fac20 100644
--- a/manifest.xml
+++ b/manifest.xml
@@ -11,17 +11,17 @@
P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023
- Test Application id="98c36259-498a-4458-9cef-74a273ad2bc3"
- Live Application id="40131e87-31ff-454b-a8e2-92276ee399d6"
+ Widget/Glance App id="bf69be91-5833-4d96-92ea-c5f1a9db5dcc"
+ Test Application id="98c36259-498a-4458-9cef-74a273ad2bc3"
+ Live Application id="40131e87-31ff-454b-a8e2-92276ee399d6"
-->
-
-
+
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
لم يتم العثور على عنوان URL. خطأ محتمل في عنوان URL للتكوين في الإعدادات.
قام طلب HTTP بإرجاع رمز الخطأ =
يجب ألا يحتوي عنوان URL لواجهة برمجة التطبيقات على شرطة مائلة لاحقة '/'
+
+ مرّر سريعًا إلى اليمين للخروج\nانقر للبقاء
+ اضغط على "الرجوع للخروج"\nأدخل للبقاء
\ No newline at end of file
diff --git a/resources-bul/strings/strings.xml b/resources-bul/strings/strings.xml
index 326db8c..36c6be5 100644
--- a/resources-bul/strings/strings.xml
+++ b/resources-bul/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
URL не е намерен. Потенциална грешка в URL адреса на конфигурацията в настройките.
HTTP заявката върна код на грешка =
URL адресът на API не трябва да има наклонена черта '/' в края
+
+ Плъзнете надясно, за да излезете\nДокоснете, за да останете
+ Натиснете Назад, за да излезете\nВлезте, за да останете
\ No newline at end of file
diff --git a/resources-ces/strings/strings.xml b/resources-ces/strings/strings.xml
index 9f98571..644f73c 100644
--- a/resources-ces/strings/strings.xml
+++ b/resources-ces/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -33,8 +33,11 @@
V nastavení aplikace není žádná adresa URL API
V nastavení aplikace není žádná konfigurační URL
Příliš rychlá volání API. Zpomalte prosím své požadavky.
- Adresa URL nenalezena. Potenciální chyba URL API v nastavení.
+ Adresa URL nenalezena. Potenciální chyba adresy URL rozhraní API v nastavení.
Adresa URL nenalezena. Potenciální chyba konfigurační adresy URL v nastavení.
Požadavek HTTP vrátil kód chyby =
Adresa URL rozhraní API nesmí mít koncové lomítko „/“
+
+ Přejetím prstem doprava ukončíte\nKlepnutím zůstanete
+ Stisknutím Zpět ukončíte\nVstupte a zůstanete
\ No newline at end of file
diff --git a/resources-dan/strings/strings.xml b/resources-dan/strings/strings.xml
index b05641d..d6d56b1 100644
--- a/resources-dan/strings/strings.xml
+++ b/resources-dan/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
URL ikke fundet. Potentiel konfigurations-URL-fejl i indstillinger.
HTTP-anmodning returnerede fejlkode =
API URL må ikke have en efterfølgende skråstreg '/'
+
+ Stryg til højre for at afslutte\nTryk for at blive
+ Tryk på Tilbage for at afslutte\nEnter for at blive
\ No newline at end of file
diff --git a/resources-deu/strings/corrections.xml b/resources-deu/strings/corrections.xml
index ed0cdd1..d3f5997 100644
--- a/resources-deu/strings/corrections.xml
+++ b/resources-deu/strings/corrections.xml
@@ -22,4 +22,7 @@
Die HTTP-Anfrage gab folgenden Fehlercode zurück =
+ Zum Beenden nach rechts swipen\nZum Bleiben antippen
+ Drücke „Zurück“, um zu Beenden.\n„Enter“, um zu bleiben
+
diff --git a/resources-deu/strings/strings.xml b/resources-deu/strings/strings.xml
index 3095b6c..a2d436c 100644
--- a/resources-deu/strings/strings.xml
+++ b/resources-deu/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
URL nicht gefunden. Möglicher Konfigurations-URL-Fehler in den Einstellungen.
Die HTTP-Anfrage gab folgenden Fehlercode zurück =
Die API-URL darf keinen abschließenden Schrägstrich „/“ enthalten.
+
+ Zum Beenden nach rechts swipen\nZum Bleiben antippen
+ Drücke „Zurück“, um zu Beenden.\n„Enter“, um zu bleiben
\ No newline at end of file
diff --git a/resources-dut/strings/strings.xml b/resources-dut/strings/strings.xml
index d319311..ef9d823 100644
--- a/resources-dut/strings/strings.xml
+++ b/resources-dut/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
URL niet gevonden. Mogelijke configuratie-URL-fout in de instellingen.
HTTP-verzoek retourneerde foutcode =
API-URL mag geen afsluitende slash '/' bevatten
+
+ Veeg naar rechts om af te sluiten\nTik om te blijven
+ Druk op Terug om af te sluiten\nEnter om te blijven
\ No newline at end of file
diff --git a/resources-est/strings/strings.xml b/resources-est/strings/strings.xml
index 94ae153..7983e88 100644
--- a/resources-est/strings/strings.xml
+++ b/resources-est/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -32,9 +32,12 @@
Rakenduse seadetes pole API-võtit
Rakenduse seadetes pole API URL-i
Rakenduse seadetes pole konfiguratsiooni URL-i
- API-kutsed liiga kiired. Palun aeglustage oma taotlusi.
+ API-kutsed liiga kiired. Palun aeglustage taotluste esitamist.
URL-i ei leitud. Võimalik API URL-i viga seadetes.
URL-i ei leitud. Võimalik konfiguratsiooni URL-i viga seadetes.
HTTP päring tagastas veakoodi =
API URL-i lõpus ei tohi olla kaldkriipsu „/”
+
+ Väljumiseks pühkige paremale\nPuudutage, et jääda
+ Väljumiseks vajutage Tagasi\nSisestage, et jääda
\ No newline at end of file
diff --git a/resources-fin/strings/strings.xml b/resources-fin/strings/strings.xml
index 12143a4..c27f006 100644
--- a/resources-fin/strings/strings.xml
+++ b/resources-fin/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
URL-osoitetta ei löydy. Mahdollinen konfigurointi-URL-virhe asetuksissa.
HTTP-pyyntö palautti virhekoodin =
API-URL-osoitteessa ei saa olla perässä olevaa kauttaviivaa '/'
+
+ Poistu pyyhkäisemällä oikealle\nPysy napauttamalla
+ Poistu painamalla Takaisin\nSyötä jäädäksesi
\ No newline at end of file
diff --git a/resources-fre/strings/strings.xml b/resources-fre/strings/strings.xml
index be42a29..fddae9b 100644
--- a/resources-fre/strings/strings.xml
+++ b/resources-fre/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
URL introuvable. Erreur potentielle d'URL de configuration dans les paramètres.
La requête HTTP a renvoyé un code d'erreur =
L'URL de l'API ne doit pas comporter de barre oblique finale '/'
+
+ Balayez vers la droite pour quitter\nAppuyez pour rester
+ Appuyez sur Retour pour quitter\nEntrez pour rester
\ No newline at end of file
diff --git a/resources-gre/strings/strings.xml b/resources-gre/strings/strings.xml
index 5f7413f..8a9c4ac 100644
--- a/resources-gre/strings/strings.xml
+++ b/resources-gre/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
Η διεύθυνση URL δεν βρέθηκε. Πιθανό σφάλμα διεύθυνσης URL διαμόρφωσης στις ρυθμίσεις.
Το αίτημα HTTP επέστρεψε κωδικό σφάλματος =
Η διεύθυνση URL του API δεν πρέπει να έχει τελική κάθετο "/"
+
+ Σύρετε προς τα δεξιά για έξοδο\nΠατήστε για να μείνετε
+ Πατήστε Επιστροφή για Έξοδος\nEnter για να μείνετε
\ No newline at end of file
diff --git a/resources-heb/strings/strings.xml b/resources-heb/strings/strings.xml
index 0af6cf6..a1342dc 100644
--- a/resources-heb/strings/strings.xml
+++ b/resources-heb/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
כתובת האתר לא נמצאה. שגיאת כתובת אתר פוטנציאלית של תצורה בהגדרות.
בקשת HTTP החזירה קוד שגיאה =
כתובת ה-API לא חייבת לכלול לוכסן אחורי '/'
+
+ החלק ימינה כדי לצאת\nהקש כדי להישאר
+ לחץ על חזרה ליציאה\nEnter כדי להישאר
\ No newline at end of file
diff --git a/resources-hrv/strings/strings.xml b/resources-hrv/strings/strings.xml
index d252106..8a25dc3 100644
--- a/resources-hrv/strings/strings.xml
+++ b/resources-hrv/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
URL nije pronađen. Potencijalna pogreška URL-a konfiguracije u postavkama.
HTTP zahtjev vratio je kod greške =
API URL ne smije imati kosu crtu na kraju '/'
+
+ Prijeđite prstom udesno za izlaz\nDodirnite za ostanak
+ Pritisnite Natrag za izlaz\nUnesite za ostanak
\ No newline at end of file
diff --git a/resources-hun/strings/strings.xml b/resources-hun/strings/strings.xml
index 03dbc06..2b4ad46 100644
--- a/resources-hun/strings/strings.xml
+++ b/resources-hun/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
Az URL nem található. Lehetséges konfigurációs URL hiba a beállításokban.
A HTTP-kérés = hibakódot adott vissza
Az API URL-ben nem lehet perjel a „/”
+
+ Csúsztassa jobbra a kilépéshez.\nKoppintson a Maradáshoz
+ Nyomja meg a Vissza gombot a kilépéshez\nEnter a Maradáshoz
\ No newline at end of file
diff --git a/resources-ind/strings/strings.xml b/resources-ind/strings/strings.xml
index 777f06c..108a97a 100644
--- a/resources-ind/strings/strings.xml
+++ b/resources-ind/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -31,10 +31,13 @@
Tidak ada kunci API di pengaturan aplikasi
Tidak ada URL API di pengaturan aplikasi
- Tidak ada URL konfigurasi dalam pengaturan aplikasi
+ Tidak ada URL konfigurasi di pengaturan aplikasi
Panggilan API terlalu cepat. Harap memperlambat permintaan Anda.
URL tidak ditemukan. Potensi kesalahan URL API dalam pengaturan.
URL tidak ditemukan. Potensi kesalahan URL Konfigurasi dalam pengaturan.
Permintaan HTTP mengembalikan kode kesalahan =
URL API tidak boleh memiliki garis miring '/'
+
+ Geser ke Kanan untuk Keluar\nKetuk untuk Tetap
+ Tekan Kembali untuk Keluar\nMasuk untuk Tetap
\ No newline at end of file
diff --git a/resources-ita/strings/strings.xml b/resources-ita/strings/strings.xml
index 7155eea..1c1a8be 100644
--- a/resources-ita/strings/strings.xml
+++ b/resources-ita/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
URL non trovato. Potenziale errore dell'URL di configurazione nelle impostazioni.
La richiesta HTTP ha restituito il codice di errore =
L'URL dell'API non deve avere una barra finale "/"
+
+ Scorri verso destra per uscire\nTocca per restare
+ Premi Indietro per uscire\nInvio per restare
\ No newline at end of file
diff --git a/resources-jpn/strings/strings.xml b/resources-jpn/strings/strings.xml
index 3f52116..4ddccc4 100644
--- a/resources-jpn/strings/strings.xml
+++ b/resources-jpn/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
URLが見つかりません。設定内の構成 URL エラーの可能性があります。
HTTP リクエストがエラー コードを返しました =
API URL の末尾にスラッシュ「/」を含めることはできません
+
+ 右にスワイプして終了\nタップしてそのまま残ります
+ 終了するには戻るキーを押してください\n続行するには Enter キーを押してください
\ No newline at end of file
diff --git a/resources-kor/strings/strings.xml b/resources-kor/strings/strings.xml
index b9e0fd2..33ec523 100644
--- a/resources-kor/strings/strings.xml
+++ b/resources-kor/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -36,5 +36,8 @@
URL을 찾을 수 없습니다. 설정에 잠재적인 API URL 오류가 있습니다.
URL을 찾을 수 없습니다. 설정에 잠재적인 구성 URL 오류가 있습니다.
HTTP 요청이 오류 코드를 반환했습니다 =
- API URL에는 후행 슬래시 '/'가 없어야 합니다.
+ API URL에는 후행 슬래시 '/'가 있어서는 안 됩니다.
+
+ 종료하려면 오른쪽으로 스와이프하세요.\n계속 유지하려면 탭하세요.
+ 종료하려면 뒤로 버튼을 누르세요.\n계속하려면 입력하세요.
\ No newline at end of file
diff --git a/resources-lav/strings/strings.xml b/resources-lav/strings/strings.xml
index 57fdaa4..0564220 100644
--- a/resources-lav/strings/strings.xml
+++ b/resources-lav/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
URL nav atrasts. Iespējama konfigurācijas URL kļūda iestatījumos.
HTTP pieprasījums atgrieza kļūdas kodu =
API URL beigās nedrīkst būt slīpsvītra “/”
+
+ Lai izietu, velciet pa labi\nPieskarieties, lai paliktu
+ Noklikšķiniet uz Atpakaļ, lai izietu.\nIevadiet, lai paliktu
\ No newline at end of file
diff --git a/resources-lit/strings/strings.xml b/resources-lit/strings/strings.xml
index ad70541..5cf3bd0 100644
--- a/resources-lit/strings/strings.xml
+++ b/resources-lit/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
URL nerastas. Galima konfigūracijos URL klaida nustatymuose.
HTTP užklausa grąžino klaidos kodą =
API URL pabaigoje negali būti pasvirojo brūkšnio „/“
+
+ Norėdami išeiti, braukite į dešinę\nPalieskite, kad pasiliktumėte
+ Norėdami išeiti, paspauskite „Atgal“\nĮveskite, kad pasiliktumėte
\ No newline at end of file
diff --git a/resources-nob/strings/strings.xml b/resources-nob/strings/strings.xml
index 844a7b0..7341591 100644
--- a/resources-nob/strings/strings.xml
+++ b/resources-nob/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
Finner ikke URL. Potensiell konfigurasjons-URL-feil i innstillingene.
HTTP-forespørsel returnerte feilkode =
API URL må ikke ha en etterfølgende skråstrek '/'
+
+ Sveip til høyre for å avslutte\nTrykk for å bli
+ Trykk Tilbake for å avslutte\nEnter for å bli
\ No newline at end of file
diff --git a/resources-pol/strings/strings.xml b/resources-pol/strings/strings.xml
index ddf55d5..c785d8b 100644
--- a/resources-pol/strings/strings.xml
+++ b/resources-pol/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
Nie znaleziono adresu URL. Potencjalny błąd adresu URL konfiguracji w ustawieniach.
Żądanie HTTP zwróciło kod błędu =
Adres URL interfejsu API nie może zawierać końcowego ukośnika „/”
+
+ Przesuń w prawo, aby wyjść\nDotknij, aby pozostać
+ Naciśnij Wstecz, aby wyjść\nEnter, aby pozostać
\ No newline at end of file
diff --git a/resources-por/strings/strings.xml b/resources-por/strings/strings.xml
index 5aec7eb..11783fe 100644
--- a/resources-por/strings/strings.xml
+++ b/resources-por/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -32,9 +32,12 @@
Nenhuma chave de API nas configurações do aplicativo
Nenhum URL de API nas configurações do aplicativo
Nenhum URL de configuração nas configurações do aplicativo
- Chamadas de API muito rápidas. Por favor, desacelere seus pedidos.
+ Chamadas de API muito rápidas. Por favor, diminua a velocidade de seus pedidos.
URL não encontrado. Possível erro de URL da API nas configurações.
URL não encontrado. Possível erro de URL de configuração nas configurações.
Solicitação HTTP retornou código de erro =
O URL da API não deve ter uma barra final '/'
+
+ Deslize para a direita para sair\nToque para permanecer
+ Volte para sair\nEntre para ficar
\ No newline at end of file
diff --git a/resources-ron/strings/strings.xml b/resources-ron/strings/strings.xml
index e5cad0e..2a8382c 100644
--- a/resources-ron/strings/strings.xml
+++ b/resources-ron/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -32,9 +32,12 @@
Nicio cheie API în setările aplicației
Nicio adresă URL API în setările aplicației
Nicio adresă URL de configurare în setările aplicației
- Apeluri API prea rapide. Vă rugăm să vă încetiniți solicitările.
+ Apeluri API prea rapide. Vă rugăm să încetiniți cererile dvs.
Adresa URL nu a fost găsită. Potențială eroare URL API în setări.
Adresa URL nu a fost găsită. Potențială eroare URL de configurare în setări.
Solicitarea HTTP a returnat codul de eroare =
Adresa URL API nu trebuie să aibă o bară oblică „/”
+
+ Glisați spre dreapta pentru a ieși\nAtingeți pentru a rămâne
+ Apăsați Înapoi pentru a ieși\nIntră pentru a rămâne
\ No newline at end of file
diff --git a/resources-slo/strings/strings.xml b/resources-slo/strings/strings.xml
index 3ca1a0c..cca39a4 100644
--- a/resources-slo/strings/strings.xml
+++ b/resources-slo/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
Adresa URL sa nenašla. Potenciálna chyba konfiguračnej adresy URL v nastaveniach.
Požiadavka HTTP vrátila kód chyby =
Adresa URL rozhrania API nesmie obsahovať koncovú lomku „/“
+
+ Ukončite prejdením prstom doprava\nKlepnutím zostanete
+ Stlačte Späť na ukončenie\nVstúpte a zostaňte
\ No newline at end of file
diff --git a/resources-slv/strings/strings.xml b/resources-slv/strings/strings.xml
index 1e4e0de..3a74e54 100644
--- a/resources-slv/strings/strings.xml
+++ b/resources-slv/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
URL-ja ni bilo mogoče najti. Morebitna napaka URL-ja konfiguracije v nastavitvah.
Zahteva HTTP je vrnila kodo napake =
URL API-ja ne sme imeti končne poševnice '/'
+
+ Povlecite v desno za izhod\nDotaknite se, da ostanete
+ Pritisnite Nazaj za izhod\nVstopite, da ostanete
\ No newline at end of file
diff --git a/resources-spa/strings/strings.xml b/resources-spa/strings/strings.xml
index 85b9600..ed15a39 100644
--- a/resources-spa/strings/strings.xml
+++ b/resources-spa/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
URL no encontrada. Posible error de URL de configuración en la configuración.
La solicitud HTTP devolvió el código de error =
La URL de API no debe tener una barra diagonal '/'
+
+ Desliza hacia la derecha para salir\nToca para permanecer
+ Presione Atrás para salir\nEntrar para permanecer
\ No newline at end of file
diff --git a/resources-swe/strings/strings.xml b/resources-swe/strings/strings.xml
index b4adbb2..4d45a43 100644
--- a/resources-swe/strings/strings.xml
+++ b/resources-swe/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
Webbadressen hittades inte. Potentiellt konfigurations-URL-fel i inställningarna.
HTTP-begäran returnerade felkod =
API-URL får inte ha ett snedstreck '/'
+
+ Svep åt höger för att avsluta\nKnacka för att stanna
+ Tryck på Tillbaka för att avsluta\nEnter för att stanna
\ No newline at end of file
diff --git a/resources-tha/strings/strings.xml b/resources-tha/strings/strings.xml
index f98b391..fb13797 100644
--- a/resources-tha/strings/strings.xml
+++ b/resources-tha/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
ไม่พบ URL ข้อผิดพลาด URL การกำหนดค่าที่อาจเกิดขึ้นในการตั้งค่า
คำขอ HTTP ส่งคืนรหัสข้อผิดพลาด =
URL ของ API ต้องไม่มีเครื่องหมายทับต่อท้าย '/'
+
+ ปัดไปทางขวาเพื่อออก\nแตะเพื่ออยู่ต่อ
+ กดกลับเพื่อออก\nเข้าไปเพื่ออยู่ต่อ
\ No newline at end of file
diff --git a/resources-tur/strings/strings.xml b/resources-tur/strings/strings.xml
index de46b52..6b2ba9d 100644
--- a/resources-tur/strings/strings.xml
+++ b/resources-tur/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -36,5 +36,8 @@
URL bulunamadı. Ayarlarda olası API URL hatası.
URL bulunamadı. Ayarlarda Olası Yapılandırma URL'si hatası.
HTTP isteği hata kodunu döndürdü =
- API URL'sinin sonunda eğik çizgi '/' olmamalıdır
+ API URL'sinin sonunda '/' eğik çizgi olmamalıdır
+
+ Çıkmak için Sağa Kaydırın\nKalmak için Dokunun
+ Çıkış için Geri tuşuna basın\nKalmak için Enter'a basın
\ No newline at end of file
diff --git a/resources-ukr/strings/strings.xml b/resources-ukr/strings/strings.xml
index f94e84f..ea9c99c 100644
--- a/resources-ukr/strings/strings.xml
+++ b/resources-ukr/strings/strings.xml
@@ -15,11 +15,11 @@
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
URL не знайдено. Потенційна помилка URL-адреси конфігурації в налаштуваннях.
Запит HTTP повернув код помилки =
URL-адреса API не повинна містити косу риску '/'
+
+ Проведіть праворуч, щоб вийти\nТоркніться, щоб залишитися
+ Натисніть «Назад», щоб вийти\nВведіть, щоб залишитися
\ No newline at end of file
diff --git a/resources-vie/strings/strings.xml b/resources-vie/strings/strings.xml
index 58fde47..68950bd 100644
--- a/resources-vie/strings/strings.xml
+++ b/resources-vie/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
Không tìm thấy URL. Lỗi URL cấu hình tiềm ẩn trong cài đặt.
Yêu cầu HTTP trả về mã lỗi =
URL API không được có dấu gạch chéo ở cuối '/'
+
+ Vuốt sang phải để thoát\nNhấn để ở lại
+ Nhấn Quay lại để thoát\nNhập để ở lại
\ No newline at end of file
diff --git a/resources-zhs/strings/strings.xml b/resources-zhs/strings/strings.xml
index 84d3e93..aa05016 100644
--- a/resources-zhs/strings/strings.xml
+++ b/resources-zhs/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
找不到网址。设置中可能存在配置 URL 错误。
HTTP请求返回错误码=
API URL 不得有尾部斜杠“/”
+
+ 向右滑动即可退出\n点击即可停留
+ 按回车键退出\n按回车键继续
\ No newline at end of file
diff --git a/resources-zht/strings/strings.xml b/resources-zht/strings/strings.xml
index 5db31af..daf676d 100644
--- a/resources-zht/strings/strings.xml
+++ b/resources-zht/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
找不到網址。設定中可能存在配置 URL 錯誤。
HTTP請求回傳錯誤碼=
API URL 不得有尾部斜線“/”
+
+ 向右滑動即可退出\n點選即可停留
+ 按回車鍵退出\n按回車鍵繼續
\ No newline at end of file
diff --git a/resources-zsm/strings/strings.xml b/resources-zsm/strings/strings.xml
index f06133f..7d229d2 100644
--- a/resources-zsm/strings/strings.xml
+++ b/resources-zsm/strings/strings.xml
@@ -19,7 +19,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -37,4 +37,7 @@
URL tidak ditemui. Ralat URL Konfigurasi Potensi dalam tetapan.
Permintaan HTTP mengembalikan kod ralat =
URL API tidak boleh mempunyai garis miring '/'
+
+ Leret ke Kanan untuk Keluar\nKetik untuk Kekal
+ Tekan Kembali untuk Keluar\nMasuk untuk Kekal
\ No newline at end of file
diff --git a/resources/strings/strings.xml b/resources/strings/strings.xml
index 3d2ce56..de6e0fc 100644
--- a/resources/strings/strings.xml
+++ b/resources/strings/strings.xml
@@ -13,7 +13,7 @@
-->
- HomeAssistant
+ HomeAssistant
@@ -31,4 +31,7 @@
URL not found. Potential Configuration URL error in settings.
HTTP request returned error code =
API URL must not have a trailing slash '/'
+
+ Swipe to Right to Exit\nTap to Stay
+ Hit Back to Exit\nEnter to Stay
diff --git a/source/ErrorView.mc b/source/ErrorView.mc
index ce42c36..ff44ba3 100644
--- a/source/ErrorView.mc
+++ b/source/ErrorView.mc
@@ -78,11 +78,10 @@ class ErrorView extends ScalableView {
function onUpdate(dc as Graphics.Dc) as Void {
var w = dc.getWidth();
var hw = w/2;
- var bg = 0x3B444C;
if(dc has :setAntiAlias) {
dc.setAntiAlias(true);
}
- dc.setColor(Graphics.COLOR_WHITE, bg);
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_BLUE);
dc.clear();
dc.drawBitmap(hw - mErrorIcon.getWidth()/2, mErrorIconMargin, mErrorIcon);
mTextArea.draw(dc);
@@ -143,4 +142,4 @@ class ErrorDelegate extends WatchUi.BehaviorDelegate {
return true;
}
-}
\ No newline at end of file
+}
diff --git a/source/HomeAssistantApp.mc b/source/HomeAssistantApp.mc
index f7dd0c0..41b54b3 100644
--- a/source/HomeAssistantApp.mc
+++ b/source/HomeAssistantApp.mc
@@ -24,24 +24,71 @@ using Toybox.WatchUi;
using Toybox.Application.Properties;
class HomeAssistantApp extends Application.AppBase {
- private var mHaMenu;
- private var quitTimer as QuitTimer;
- private var strNoApiKey as Lang.String;
- private var strNoApiUrl as Lang.String;
- private var strNoConfigUrl as Lang.String;
- private var strNoPhone as Lang.String;
- private var strNoInternet as Lang.String;
- private var strNoResponse as Lang.String;
- private var strNoMenu as Lang.String;
- private var strApiFlood as Lang.String;
- private var strConfigUrlNotFound as Lang.String;
- private var strUnhandledHttpErr as Lang.String;
- private var strTrailingSlashErr as Lang.String;
+ private var mHaMenu as HomeAssistantView or Null;
+ private var mQuitTimer as QuitTimer or Null;
+ private var strNoApiKey as Lang.String or Null;
+ private var strNoApiUrl as Lang.String or Null;
+ private var strNoConfigUrl as Lang.String or Null;
+ private var strNoPhone as Lang.String or Null;
+ private var strNoInternet as Lang.String or Null;
+ private var strNoResponse as Lang.String or Null;
+ private var strNoMenu as Lang.String or Null;
+ private var strApiFlood as Lang.String or Null;
+ private var strConfigUrlNotFound as Lang.String or Null;
+ private var strUnhandledHttpErr as Lang.String or Null;
+ private var strTrailingSlashErr as Lang.String or Null;
private var mItemsToUpdate; // Array initialised by onReturnFetchMenuConfig()
private var mNextItemToUpdate = 0; // Index into the above array
function initialize() {
AppBase.initialize();
+
+ // ATTENTION when adding stuff into this block:
+ // Because of the >>GlanceView<<, it should contain only
+ // code, which is used as well for the glance:
+ // - https://developer.garmin.com/connect-iq/core-topics/glances/
+ //
+ // Also dealing with resources "Rez" needs attention, too. See
+ // "Resource Scopes":
+ // - https://developer.garmin.com/connect-iq/core-topics/resources/
+ //
+ // Classes which are used for the glance view, needed to be tagged
+ // with "(:glance)".
+ }
+
+ // onStart() is called on application start up
+ function onStart(state as Lang.Dictionary?) as Void {
+ // ATTENTION when adding stuff into this block:
+ // Because of the >>GlanceView<<, it should contain only
+ // code, which is used as well for the glance:
+ // - https://developer.garmin.com/connect-iq/core-topics/glances/
+ //
+ // Also dealing with resources "Rez" needs attention, too. See
+ // "Resource Scopes":
+ // - https://developer.garmin.com/connect-iq/core-topics/resources/
+ //
+ // Classes which are used for the glance view, needed to be tagged
+ // with "(:glance)".
+ }
+
+ // onStop() is called when your application is exiting
+ function onStop(state as Lang.Dictionary?) as Void {
+ // ATTENTION when adding stuff into this block:
+ // Because of the >>GlanceView<<, it should contain only
+ // code, which is used as well for the glance:
+ // - https://developer.garmin.com/connect-iq/core-topics/glances/
+ //
+ // Also dealing with resources "Rez" needs attention, too. See
+ // "Resource Scopes":
+ // - https://developer.garmin.com/connect-iq/core-topics/resources/
+ //
+ // Classes which are used for the glance view, needed to be tagged
+ // with "(:glance)".
+ }
+
+ // Return the initial view of your application here
+ function getInitialView() as Lang.Array? {
+
strNoApiKey = WatchUi.loadResource($.Rez.Strings.NoAPIKey);
strNoApiUrl = WatchUi.loadResource($.Rez.Strings.NoApiUrl);
strNoConfigUrl = WatchUi.loadResource($.Rez.Strings.NoConfigUrl);
@@ -53,21 +100,8 @@ class HomeAssistantApp extends Application.AppBase {
strConfigUrlNotFound = WatchUi.loadResource($.Rez.Strings.ConfigUrlNotFound);
strUnhandledHttpErr = WatchUi.loadResource($.Rez.Strings.UnhandledHttpErr);
strTrailingSlashErr = WatchUi.loadResource($.Rez.Strings.TrailingSlashErr);
- quitTimer = new QuitTimer();
- }
+ mQuitTimer = new QuitTimer();
- // onStart() is called on application start up
- function onStart(state as Lang.Dictionary?) as Void {
- quitTimer.begin();
- }
-
- // onStop() is called when your application is exiting
- function onStop(state as Lang.Dictionary?) as Void {
- quitTimer.stop();
- }
-
- // Return the initial view of your application here
- function getInitialView() as Lang.Array? {
var api_url = Properties.getValue("api_url") as Lang.String;
if ((Properties.getValue("api_key") as Lang.String).length() == 0) {
@@ -102,7 +136,7 @@ class HomeAssistantApp extends Application.AppBase {
return ErrorView.create(strNoInternet + ".");
} else {
fetchMenuConfig();
- return [new WatchUi.View(), new WatchUi.BehaviorDelegate()] as Lang.Array;
+ return [new RootView(self), new RootViewDelegate(self)] as Lang.Array;
}
}
@@ -136,7 +170,8 @@ class HomeAssistantApp extends Application.AppBase {
ErrorView.show(strConfigUrlNotFound);
} else if (responseCode == 200) {
mHaMenu = new HomeAssistantView(data, null);
- WatchUi.switchToView(mHaMenu, new HomeAssistantViewDelegate(), WatchUi.SLIDE_IMMEDIATE);
+ mQuitTimer.begin();
+ pushHomeAssistantMenuView();
mItemsToUpdate = mHaMenu.getItemsToUpdate();
// Start the continuous update process that continues for as long as the application is running.
// The chain of functions from 'updateNextMenuItem()' calls 'updateNextMenuItem()' on completion.
@@ -169,6 +204,14 @@ class HomeAssistantApp extends Application.AppBase {
);
}
+ function homeAssistantMenuIsLoaded() as Lang.Boolean{
+ return mHaMenu!=null;
+ }
+
+ function pushHomeAssistantMenuView() as Void{
+ WatchUi.pushView(mHaMenu, new HomeAssistantViewDelegate(true), WatchUi.SLIDE_IMMEDIATE);
+ }
+
// We need to spread out the API calls so as not to overload the results queue and cause Communications.BLE_QUEUE_FULL (-101) error.
// This function is called by a timer every Globals.menuItemUpdateInterval ms.
function updateNextMenuItem() as Void {
@@ -178,9 +221,13 @@ class HomeAssistantApp extends Application.AppBase {
}
function getQuitTimer() as QuitTimer{
- return quitTimer;
+ return mQuitTimer;
}
+ (:glance)
+ function getGlanceView() {
+ return [new HomeAssistantGlanceView()];
+ }
}
function getApp() as HomeAssistantApp {
diff --git a/source/HomeAssistantGlanceView.mc b/source/HomeAssistantGlanceView.mc
new file mode 100644
index 0000000..efa828f
--- /dev/null
+++ b/source/HomeAssistantGlanceView.mc
@@ -0,0 +1,42 @@
+//-----------------------------------------------------------------------------------
+//
+// Distributed under MIT Licence
+// See https://github.com/house-of-abbey/GarminHomeAssistant/blob/main/LICENSE.
+//
+//-----------------------------------------------------------------------------------
+//
+// GarminHomeAssistant is a Garmin IQ application written in Monkey C and routinely
+// tested on a Venu 2 device. The source code is provided at:
+// https://github.com/house-of-abbey/GarminHomeAssistant.
+//
+// P A Abbey & J D Abbey & SomeoneOnEarth, 23 November 2023
+//
+//
+// Description:
+//
+// Glance view for GarminHomeAssistant
+//
+//-----------------------------------------------------------------------------------
+
+using Toybox.Lang;
+using Toybox.WatchUi;
+using Toybox.Graphics;
+
+(:glance)
+class HomeAssistantGlanceView extends WatchUi.GlanceView {
+
+ private var mText as Lang.String;
+
+ function initialize() {
+ GlanceView.initialize();
+
+ mText = WatchUi.loadResource($.Rez.Strings.AppName);
+ }
+
+ function onUpdate(dc) as Void {
+ GlanceView.onUpdate(dc);
+
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_BLACK);
+ dc.drawText(0, dc.getHeight() / 2, Graphics.FONT_TINY, mText, Graphics.TEXT_JUSTIFY_LEFT | Graphics.TEXT_JUSTIFY_VCENTER);
+ }
+}
diff --git a/source/HomeAssistantView.mc b/source/HomeAssistantView.mc
index 5136290..3e2f6d0 100644
--- a/source/HomeAssistantView.mc
+++ b/source/HomeAssistantView.mc
@@ -21,6 +21,7 @@
using Toybox.Application;
using Toybox.Lang;
using Toybox.Graphics;
+using Toybox.System;
using Toybox.WatchUi;
class HomeAssistantView extends WatchUi.Menu2 {
@@ -103,12 +104,23 @@ class HomeAssistantView extends WatchUi.Menu2 {
//
class HomeAssistantViewDelegate extends WatchUi.Menu2InputDelegate {
- function initialize() {
+ private var mIsRootMenuView = false;
+
+ function initialize(isRootMenuView as Lang.Boolean) {
Menu2InputDelegate.initialize();
+ mIsRootMenuView = isRootMenuView;
}
function onBack() {
getApp().getQuitTimer().reset();
+
+ if (mIsRootMenuView){
+ // If its started from glance or as an activity, directly exit the widget/app
+ // (on widgets without glance, this exit() won`t do anything,
+ // so the base view will be shown instead, through the popView below this "if body")
+ System.exit();
+ }
+
WatchUi.popView(WatchUi.SLIDE_RIGHT);
}
@@ -147,15 +159,13 @@ class HomeAssistantViewDelegate extends WatchUi.Menu2InputDelegate {
if (Globals.scDebug) {
System.println("Menu: " + haMenuItem.getLabel() + " " + haMenuItem.getId());
}
- // No delegate state to be amended, so re-use 'self'.
- WatchUi.pushView(haMenuItem.getMenuView(), self, WatchUi.SLIDE_LEFT);
+ WatchUi.pushView(haMenuItem.getMenuView(), new HomeAssistantViewDelegate(false), WatchUi.SLIDE_LEFT);
} else if (item instanceof HomeAssistantViewIconMenuItem) {
var haMenuItem = item as HomeAssistantViewIconMenuItem;
if (Globals.scDebug) {
System.println("IconMenu: " + haMenuItem.getLabel() + " " + haMenuItem.getId());
}
- // No delegate state to be amended, so re-use 'self'.
- WatchUi.pushView(haMenuItem.getMenuView(), self, WatchUi.SLIDE_LEFT);
+ WatchUi.pushView(haMenuItem.getMenuView(), new HomeAssistantViewDelegate(false), WatchUi.SLIDE_LEFT);
} else {
if (Globals.scDebug) {
System.println(item.getLabel() + " " + item.getId());
diff --git a/source/RootView.mc b/source/RootView.mc
new file mode 100644
index 0000000..e1e5aae
--- /dev/null
+++ b/source/RootView.mc
@@ -0,0 +1,129 @@
+//-----------------------------------------------------------------------------------
+//
+// Distributed under MIT Licence
+// See https://github.com/house-of-abbey/GarminHomeAssistant/blob/main/LICENSE.
+//
+//-----------------------------------------------------------------------------------
+//
+// GarminHomeAssistant is a Garmin IQ application written in Monkey C and routinely
+// tested on a Venu 2 device. The source code is provided at:
+// https://github.com/house-of-abbey/GarminHomeAssistant.
+//
+// P A Abbey & J D Abbey & SomeoneOnEarth, 5 December 2023
+//
+//
+// Description:
+//
+// Application root view for GarminHomeAssistant
+//
+//-----------------------------------------------------------------------------------
+
+using Toybox.Graphics;
+using Toybox.Lang;
+using Toybox.WatchUi;
+
+class RootView extends ScalableView {
+
+ // ATTENTION when the app is running as a "widget" (that means, it runs on devices
+ // without glance view support), the input events in this view are limited, as
+ // described under "Base View and the Widget Carousel" on:
+ //
+ // https://developer.garmin.com/connect-iq/connect-iq-basics/app-types/
+ //
+ // Also the view type of the base view is limited too (for example "WatchUi.Menu2"
+ // is not possible)).
+ //
+ // Also System.exit() is not working/do nothing when running as a widget: A widget will be
+ // terminated automatically by OS after some time or can be quit manually, when on the base
+ // view a swipe to left / "back button" press is done.
+
+ private var mApp as HomeAssistantApp;
+ private var strFetchingMenuConfig as Lang.String;
+ private var strExit as Lang.String;
+ private var mTextAreaExit as WatchUi.TextArea or Null;
+ private var mTextAreaFetching as WatchUi.TextArea or Null;
+
+ function initialize(app as HomeAssistantApp) {
+ ScalableView.initialize();
+ mApp=app;
+
+ strFetchingMenuConfig = WatchUi.loadResource($.Rez.Strings.FetchingMenuConfig);
+
+ if (System.getDeviceSettings().isTouchScreen){
+ strExit = WatchUi.loadResource($.Rez.Strings.ExitViewTouch);
+ } else {
+ strExit = WatchUi.loadResource($.Rez.Strings.ExitViewButtons);
+ }
+ }
+
+ function onLayout(dc as Graphics.Dc) as Void {
+ var w = dc.getWidth();
+ var h = dc.getHeight();
+
+ mTextAreaExit = new WatchUi.TextArea({
+ :text => strExit,
+ :color => Graphics.COLOR_WHITE,
+ :font => Graphics.FONT_XTINY,
+ :justification => Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER,
+ :locX => 0,
+ :locY => 83,
+ :width => w,
+ :height => h - 166
+ });
+
+ mTextAreaFetching = new WatchUi.TextArea({
+ :text => strFetchingMenuConfig,
+ :color => Graphics.COLOR_WHITE,
+ :font => Graphics.FONT_XTINY,
+ :justification => Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER,
+ :locX => 0,
+ :locY => 83,
+ :width => w,
+ :height => h - 166
+ });
+ }
+
+ function onUpdate(dc as Graphics.Dc) as Void {
+ if(dc has :setAntiAlias) {
+ dc.setAntiAlias(true);
+ }
+ dc.setColor(Graphics.COLOR_WHITE, Graphics.COLOR_BLACK);
+ dc.clear();
+
+ if(mApp.homeAssistantMenuIsLoaded()) {
+ mTextAreaExit.draw(dc);
+ } else {
+ mTextAreaFetching.draw(dc);
+ }
+ }
+}
+
+class RootViewDelegate extends WatchUi.BehaviorDelegate {
+
+ var mApp as HomeAssistantApp;
+
+ function initialize(app as HomeAssistantApp ) {
+ BehaviorDelegate.initialize();
+ mApp=app;
+ }
+
+ function onTap(evt as WatchUi.ClickEvent) as Lang.Boolean {
+ return backToMainMenu();
+ }
+
+ function onSelect() as Lang.Boolean {
+ return backToMainMenu();
+ }
+
+ function onMenu() as Lang.Boolean{
+ return backToMainMenu();
+ }
+
+ private function backToMainMenu() as Lang.Boolean{
+ if(mApp.homeAssistantMenuIsLoaded()){
+ mApp.pushHomeAssistantMenuView();
+ return true;
+ }
+ return false;
+ }
+}