diff --git a/manifest.xml b/manifest.xml index 6c011ed..866e4e4 100644 --- a/manifest.xml +++ b/manifest.xml @@ -9,19 +9,19 @@ 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, 31 October 2023 + 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" + SomeoneOnEarth's Test App id="bf69be91-5833-4d96-92ea-c5f1a9db5dcc" + philipabbey's Test App id="98c36259-498a-4458-9cef-74a273ad2bc3" + Live Application id="40131e87-31ff-454b-a8e2-92276ee399d6" --> - - + @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant على عن مقبض @@ -37,10 +37,13 @@ لم يتم العثور على عنوان URL. خطأ محتمل في عنوان URL للتكوين في الإعدادات. قام طلب HTTP بإرجاع رمز الخطأ = يجب ألا يحتوي عنوان URL لواجهة برمجة التطبيقات على شرطة مائلة لاحقة '/' + جارٍ جلب تكوين القائمة.. + مرّر سريعًا إلى اليمين للخروج\nانقر للبقاء + اضغط على "الرجوع للخروج"\nأدخل للبقاء - مفتاح API لمساعد المنزل. + مفتاح API لـ HomeAssistant. رمز الوصول طويل الأمد. - عنوان URL لواجهة برمجة تطبيقات Home Assistant. + عنوان URL لواجهة برمجة تطبيقات HomeAssistant. عنوان URL لتكوين القائمة (JSON). المهلة بالثواني. قم بالخروج من التطبيق بعد هذه الفترة من عدم النشاط لحفظ بطارية الجهاز. بعد هذا الوقت (بالثواني)، يتم إغلاق مربع حوار تأكيد الإجراء تلقائيًا ويتم إلغاء الإجراء. اضبط على 0 لتعطيل المهلة. diff --git a/resources-bul/strings/strings.xml b/resources-bul/strings/strings.xml index d7fd60f..b7cfdaf 100644 --- a/resources-bul/strings/strings.xml +++ b/resources-bul/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant На Изкл Докоснете @@ -37,10 +37,13 @@ URL не е намерен. Потенциална грешка в URL адреса на конфигурацията в настройките. HTTP заявката върна код на грешка = URL адресът на API не трябва да има наклонена черта '/' в края + Извличане на конфигурацията на менюто.. + Плъзнете надясно, за да излезете\nДокоснете, за да останете + Натиснете Назад, за да излезете\nВлезте, за да останете - API ключ за домашен асистент. + API ключ за HomeAssistant. Токен за дълготраен достъп. - URL адрес за API на Home Assistant. + URL адрес за API на HomeAssistant. URL за конфигурация на менюто (JSON). Изчакване в секунди. Излезте от приложението след този период на неактивност, за да запазите батерията на устройството. След това време (в секунди) диалоговият прозорец за потвърждение за действие се затваря автоматично и действието се отменя. Задайте 0, за да деактивирате изчакването. diff --git a/resources-ces/strings/strings.xml b/resources-ces/strings/strings.xml index 5119953..1a6cda1 100644 --- a/resources-ces/strings/strings.xml +++ b/resources-ces/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Na Vypnuto Klepněte @@ -37,10 +37,13 @@ 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 „/“ + Načítání konfigurace nabídky... + Přejetím prstem doprava ukončíte\nKlepnutím zůstanete + Stisknutím Zpět ukončíte\nVstupte a zůstanete - Klíč API pro domácího asistenta. + Klíč API pro HomeAssistant. Přístupový token s dlouhou životností. - URL pro Home Assistant API. + URL pro HomeAssistant API. Adresa URL pro konfiguraci nabídky (JSON). Časový limit v sekundách. Po této době nečinnosti aplikaci ukončete, abyste šetřili baterii zařízení. Po uplynutí této doby (v sekundách) se dialog pro potvrzení akce automaticky zavře a akce se zruší. Nastavením na 0 deaktivujete časový limit. diff --git a/resources-dan/strings/strings.xml b/resources-dan/strings/strings.xml index 10634a8..354f0d7 100644 --- a/resources-dan/strings/strings.xml +++ b/resources-dan/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Af Tryk på @@ -37,10 +37,13 @@ URL ikke fundet. Potentiel konfigurations-URL-fejl i indstillinger. HTTP-anmodning returnerede fejlkode = API URL må ikke have en efterfølgende skråstreg '/' + Henter menukonfiguration.. + Stryg til højre for at afslutte\nTryk for at blive + Tryk på Tilbage for at afslutte\nEnter for at blive - API-nøgle til Home Assistant. + API-nøgle til HomeAssistant. Adgangstoken med lang levetid. - URL til Home Assistant API. + URL til HomeAssistant API. URL til menukonfiguration (JSON). Timeout i sekunder. Afslut applikationen efter denne periode med inaktivitet for at spare på enhedens batteri. Efter dette tidspunkt (i sekunder) lukkes en bekræftelsesdialog for en handling automatisk, og handlingen annulleres. Indstil til 0 for at deaktivere timeout. diff --git a/resources-deu/strings/corrections.xml b/resources-deu/strings/corrections.xml index 8d8810c..d3f5997 100644 --- a/resources-deu/strings/corrections.xml +++ b/resources-deu/strings/corrections.xml @@ -9,7 +9,7 @@ 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, 14 November 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 14 November 2023 --> @@ -22,4 +22,7 @@ Antippen Menü 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 + Lade Config vom Server ... diff --git a/resources-deu/strings/strings.xml b/resources-deu/strings/strings.xml index 8778ab3..6e8ca99 100644 --- a/resources-deu/strings/strings.xml +++ b/resources-deu/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant An Aus Antippen @@ -37,10 +37,13 @@ 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. + Lade Config vom Server ... + Zum Beenden nach rechts swipen\nZum Bleiben antippen + Drücke „Zurück“, um zu Beenden.\n„Enter“, um zu bleiben - API-Schlüssel für Home Assistant. + API-Schlüssel für HomeAssistant. Langlebiges Zugriffstoken. - URL für die Home Assistant-API. + URL für die HomeAssistant-API. URL zur Menükonfiguration (JSON). Timeout in Sekunden. Beenden Sie die Anwendung nach dieser Zeit der Inaktivität, um den Akku des Geräts zu schonen. Nach dieser Zeit (in Sekunden) wird automatisch ein Bestätigungsdialog für eine Aktion geschlossen und die Aktion abgebrochen. Auf 0 setzen, um das Timeout zu deaktivieren. diff --git a/resources-dut/strings/strings.xml b/resources-dut/strings/strings.xml index 0aabd80..d695c2a 100644 --- a/resources-dut/strings/strings.xml +++ b/resources-dut/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Op Uit Kraan @@ -37,10 +37,13 @@ URL niet gevonden. Mogelijke configuratie-URL-fout in de instellingen. HTTP-verzoek retourneerde foutcode = API-URL mag geen afsluitende slash '/' bevatten + Menuconfiguratie ophalen.. + Veeg naar rechts om af te sluiten\nTik om te blijven + Druk op Terug om af te sluiten\nEnter om te blijven - API-sleutel voor Home Assistant. + API-sleutel voor HomeAssistant. Toegangstoken met lange levensduur. - URL voor Home Assistant-API. + URL voor HomeAssistant API. URL voor menuconfiguratie (JSON). Time-out in seconden. Sluit de applicatie af na deze periode van inactiviteit om de batterij van het apparaat te sparen. Na deze tijd (in seconden) wordt automatisch een bevestigingsvenster voor een actie gesloten en wordt de actie geannuleerd. Stel in op 0 om de time-out uit te schakelen. diff --git a/resources-est/strings/strings.xml b/resources-est/strings/strings.xml index 7124402..ec240b8 100644 --- a/resources-est/strings/strings.xml +++ b/resources-est/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Peal Väljas Puudutage @@ -32,15 +32,18 @@ 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-kõned 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 „/” + Menüü konfiguratsiooni toomine... + Väljumiseks pühkige paremale\nPuudutage, et jääda + Väljumiseks vajutage Tagasi\nSisestage, et jääda - Koduabilise API võti. + API-võti HomeAssistantile. Pikaealine juurdepääsuluba. - Koduabilise API URL. + HomeAssistant API URL. URL menüü konfigureerimiseks (JSON). Aegumine sekundites. Seadme aku säästmiseks sulgege rakendus pärast seda tegevusetusperioodi. Pärast seda aega (sekundites) suletakse automaatselt toimingu kinnitusdialoog ja toiming tühistatakse. Ajalõpu keelamiseks määrake väärtusele 0. diff --git a/resources-fin/strings/strings.xml b/resources-fin/strings/strings.xml index d1d7915..137ae08 100644 --- a/resources-fin/strings/strings.xml +++ b/resources-fin/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Päällä Vinossa Napauta @@ -37,10 +37,13 @@ URL-osoitetta ei löydy. Mahdollinen konfigurointi-URL-virhe asetuksissa. HTTP-pyyntö palautti virhekoodin = API-URL-osoitteessa ei saa olla perässä olevaa kauttaviivaa '/' + Haetaan valikon asetuksia... + Poistu pyyhkäisemällä oikealle\nPysy napauttamalla + Poistu painamalla Takaisin\nSyötä jäädäksesi - API-avain Home Assistantille. + API-avain HomeAssistantille. Pitkäikäinen pääsytunnus. - URL Home Assistant API:lle. + HomeAssistant API:n URL-osoite. URL-osoite valikon määrityksiä varten (JSON). Aikakatkaisu sekunneissa. Poistu sovelluksesta tämän käyttämättömyyden jälkeen säästääksesi laitteen akkua. Tämän ajan kuluttua (sekunneissa) toiminnon vahvistusikkuna suljetaan automaattisesti ja toiminto peruutetaan. Aseta arvoksi 0 poistaaksesi aikakatkaisun käytöstä. diff --git a/resources-fre/strings/corrections.xml b/resources-fre/strings/corrections.xml index b75db29..a9be4eb 100644 --- a/resources-fre/strings/corrections.xml +++ b/resources-fre/strings/corrections.xml @@ -9,7 +9,7 @@ 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, 14 November 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 14 November 2023 --> diff --git a/resources-fre/strings/strings.xml b/resources-fre/strings/strings.xml index a5bc9ed..ae19a88 100644 --- a/resources-fre/strings/strings.xml +++ b/resources-fre/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Activé Désactivé Clic @@ -37,10 +37,13 @@ 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 '/' + Récupération de la configuration du menu. + Balayez vers la droite pour quitter\nAppuyez pour rester + Appuyez sur Retour pour quitter\nEntrez pour rester - Clé API pour Home Assistant. + Clé API pour HomeAssistant. Jeton d'accès de longue durée. - URL de l’API Home Assistant. + URL de l’API HomeAssistant. URL de configuration des menus (JSON). Délai d'expiration en secondes. Quittez l'application après cette période d'inactivité pour économiser la batterie de l'appareil. Passé ce délai (en secondes), une boîte de dialogue de confirmation d'une action se ferme automatiquement et l'action est annulée. Réglez sur 0 pour désactiver le délai d'attente. diff --git a/resources-gre/strings/strings.xml b/resources-gre/strings/strings.xml index 8bd68d0..6a2a2f6 100644 --- a/resources-gre/strings/strings.xml +++ b/resources-gre/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Επί Μακριά από Παρακέντηση @@ -37,10 +37,13 @@ Η διεύθυνση URL δεν βρέθηκε. Πιθανό σφάλμα διεύθυνσης URL διαμόρφωσης στις ρυθμίσεις. Το αίτημα HTTP επέστρεψε κωδικό σφάλματος = Η διεύθυνση URL του API δεν πρέπει να έχει τελική κάθετο "/" + Ανάκτηση παραμέτρων μενού.. + Σύρετε προς τα δεξιά για έξοδο\nΠατήστε για να μείνετε + Πατήστε Επιστροφή για Έξοδος\nEnter για να μείνετε - Κλειδί API για Home Assistant. + Κλειδί API για το HomeAssistant. Διακριτικό πρόσβασης μακράς διαρκείας. - URL για το Home Assistant API. + URL για το HomeAssistant API. URL για τη διαμόρφωση μενού (JSON). Timeout σε δευτερόλεπτα. Κλείστε την εφαρμογή μετά από αυτήν την περίοδο αδράνειας για να εξοικονομήσετε την μπαταρία της συσκευής. Μετά από αυτό το χρονικό διάστημα (σε δευτερόλεπτα), ένα παράθυρο διαλόγου επιβεβαίωσης για μια ενέργεια κλείνει αυτόματα και η ενέργεια ακυρώνεται. Ορίστε στο 0 για να απενεργοποιήσετε το χρονικό όριο. diff --git a/resources-heb/strings/strings.xml b/resources-heb/strings/strings.xml index 2cb1fda..dcae0bf 100644 --- a/resources-heb/strings/strings.xml +++ b/resources-heb/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant עַל כבוי בֶּרֶז @@ -37,10 +37,13 @@ כתובת האתר לא נמצאה. שגיאת כתובת אתר פוטנציאלית של תצורה בהגדרות. בקשת HTTP החזירה קוד שגיאה = כתובת ה-API לא חייבת לכלול לוכסן אחורי '/' + מביא את תצורת התפריט... + החלק ימינה כדי לצאת\nהקש כדי להישאר + לחץ על חזרה ליציאה\nEnter כדי להישאר - מפתח API עבור Home Assistant. + מפתח API עבור HomeAssistant. אסימון גישה ארוך-חיים. - כתובת URL עבור Home Assistant API. + כתובת URL עבור HomeAssistant API. כתובת URL לתצורת תפריט (JSON). פסק זמן בשניות. צא מהאפליקציה לאחר תקופה זו של חוסר פעילות כדי לחסוך בסוללת המכשיר. לאחר זמן זה (בשניות), תיבת דו-שיח לאישור פעולה נסגרת אוטומטית והפעולה מבוטלת. הגדר ל-0 כדי לבטל את הזמן הקצוב. diff --git a/resources-hrv/strings/strings.xml b/resources-hrv/strings/strings.xml index e058aac..12de052 100644 --- a/resources-hrv/strings/strings.xml +++ b/resources-hrv/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Na Isključeno Dodirnite @@ -37,10 +37,13 @@ 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 '/' + Dohvaćanje konfiguracije izbornika.. + Prijeđite prstom udesno za izlaz\nDodirnite za ostanak + Pritisnite Natrag za izlaz\nUnesite za ostanak - API ključ za kućnog pomoćnika. + API ključ za HomeAssistant. Dugotrajni pristupni token. - URL za Home Assistant API. + URL za HomeAssistant API. URL za konfiguraciju izbornika (JSON). Istek u sekundama. Izađite iz aplikacije nakon ovog razdoblja neaktivnosti kako biste uštedjeli bateriju uređaja. Nakon tog vremena (u sekundama), dijaloški okvir za potvrdu radnje automatski se zatvara i radnja se poništava. Postavite na 0 da onemogućite vremensko ograničenje. diff --git a/resources-hun/strings/strings.xml b/resources-hun/strings/strings.xml index 27578a7..49a4cbc 100644 --- a/resources-hun/strings/strings.xml +++ b/resources-hun/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Tovább Ki Koppintson a @@ -37,10 +37,13 @@ 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 „/” + Menükonfiguráció lekérése... + Csúsztassa jobbra a kilépéshez\nKoppintson a Maradáshoz + Nyomja meg a Vissza gombot a kilépéshez\nEnter a Maradáshoz - API kulcs az otthoni asszisztenshez. + API-kulcs a HomeAssistant számára. Hosszú életű hozzáférési token. - A Home Assistant API URL-je. + A HomeAssistant API URL-je. URL a menükonfigurációhoz (JSON). Időtúllépés másodpercben. Az eszköz akkumulátorának kímélése érdekében lépjen ki az alkalmazásból ezen inaktivitási időszak után. Ezen idő letelte után (másodpercben) a művelet megerősítő párbeszédablakja automatikusan bezárul, és a művelet megszakad. Állítsa 0-ra az időtúllépés letiltásához. diff --git a/resources-ind/strings/strings.xml b/resources-ind/strings/strings.xml index afc7aed..440efd6 100644 --- a/resources-ind/strings/strings.xml +++ b/resources-ind/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Pada Mati Mengetuk @@ -37,10 +37,13 @@ URL tidak ditemukan. Potensi kesalahan URL Konfigurasi dalam pengaturan. Permintaan HTTP mengembalikan kode kesalahan = URL API tidak boleh memiliki garis miring '/' + Mengambil Konfigurasi Menu.. + Geser ke Kanan untuk Keluar\nKetuk untuk Tetap + Tekan Kembali untuk Keluar\nMasuk untuk Tetap - Kunci API untuk Asisten Rumah. + Kunci API untuk HomeAssistant. Token Akses Berumur Panjang. - URL untuk API Asisten Rumah. + URL untuk API HomeAssistant. URL untuk konfigurasi menu (JSON). Batas waktu dalam hitungan detik. Keluar dari aplikasi setelah periode tidak aktif ini untuk menghemat baterai perangkat. Setelah waktu ini (dalam detik), dialog konfirmasi untuk suatu tindakan secara otomatis ditutup dan tindakan tersebut dibatalkan. Setel ke 0 untuk menonaktifkan batas waktu. diff --git a/resources-ita/strings/strings.xml b/resources-ita/strings/strings.xml index 995cdff..c42d511 100644 --- a/resources-ita/strings/strings.xml +++ b/resources-ita/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant SU Spento Rubinetto @@ -37,10 +37,13 @@ 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 "/" + Recupero configurazione menu.. + Scorri verso destra per uscire\nTocca per restare + Premi Indietro per uscire\nInvio per restare - Chiave API per Home Assistant. + Chiave API per HomeAssistant. Token di accesso di lunga durata. - URL per l'API Home Assistant. + URL per l'API HomeAssistant. URL per la configurazione del menu (JSON). Timeout in secondi. Uscire dall'applicazione dopo questo periodo di inattività per risparmiare la batteria del dispositivo. Trascorso questo tempo (in secondi), una finestra di dialogo di conferma per un'azione viene chiusa automaticamente e l'azione viene annullata. Impostare su 0 per disabilitare il timeout. diff --git a/resources-jpn/strings/strings.xml b/resources-jpn/strings/strings.xml index ae29f0c..0474907 100644 --- a/resources-jpn/strings/strings.xml +++ b/resources-jpn/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant の上 オフ タップ @@ -37,10 +37,13 @@ URLが見つかりません。設定内の構成 URL エラーの可能性があります。 HTTP リクエストがエラー コードを返しました = API URL の末尾にスラッシュ「/」を含めることはできません + メニュー構成を取得しています。 + 右にスワイプして終了\nタップしてそのまま残ります + 終了するには戻るキーを押してください\n続行するには Enter キーを押してください - ホームアシスタントのAPIキー。 + ホームアシスタントの API キー。 有効期間の長いアクセス トークン。 - ホーム アシスタント API の URL。 + ホームアシスタント API の URL。 メニュー構成の URL (JSON)。 秒単位のタイムアウト。デバイスのバッテリーを節約するために、この期間非アクティブになった後はアプリケーションを終了してください。 この時間 (秒単位) が経過すると、アクションの確認ダイアログが自動的に閉じられ、アクションがキャンセルされます。タイムアウトを無効にするには、0 に設定します。 diff --git a/resources-kor/strings/strings.xml b/resources-kor/strings/strings.xml index 2c8a9e3..6f1b8c5 100644 --- a/resources-kor/strings/strings.xml +++ b/resources-kor/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant ~에 끄다 수도꼭지 @@ -37,10 +37,13 @@ URL을 찾을 수 없습니다. 설정에 잠재적인 구성 URL 오류가 있습니다. HTTP 요청이 오류 코드를 반환했습니다 = API URL에는 후행 슬래시 '/'가 없어야 합니다. + 메뉴 구성을 가져오는 중.. + 종료하려면 오른쪽으로 스와이프하세요.\n계속하려면 탭하세요. + 종료하려면 뒤로 버튼을 누르세요.\n계속하려면 입력하세요. - 홈어시스턴트용 API 키. + HomeAssistant용 API 키. 장기 액세스 토큰. - 홈어시스턴트 API의 URL입니다. + HomeAssistant API의 URL입니다. 메뉴 구성을 위한 URL(JSON)입니다. 시간 초과(초)입니다. 장치 배터리를 절약하려면 이 비활성 기간 후에 애플리케이션을 종료하십시오. 이 시간(초)이 지나면 작업에 대한 확인 대화 상자가 자동으로 닫히고 작업이 취소됩니다. 시간 초과를 비활성화하려면 0으로 설정합니다. diff --git a/resources-launcher-26-26/drawables.xml b/resources-launcher-26-26/drawables.xml index d8b5369..4f18f5a 100644 --- a/resources-launcher-26-26/drawables.xml +++ b/resources-launcher-26-26/drawables.xml @@ -8,7 +8,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> diff --git a/resources-launcher-30-30/drawables.xml b/resources-launcher-30-30/drawables.xml index d8b5369..4f18f5a 100644 --- a/resources-launcher-30-30/drawables.xml +++ b/resources-launcher-30-30/drawables.xml @@ -8,7 +8,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> diff --git a/resources-launcher-35-35/drawables.xml b/resources-launcher-35-35/drawables.xml index d8b5369..4f18f5a 100644 --- a/resources-launcher-35-35/drawables.xml +++ b/resources-launcher-35-35/drawables.xml @@ -8,7 +8,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> diff --git a/resources-launcher-36-36/drawables.xml b/resources-launcher-36-36/drawables.xml index d8b5369..4f18f5a 100644 --- a/resources-launcher-36-36/drawables.xml +++ b/resources-launcher-36-36/drawables.xml @@ -8,7 +8,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> diff --git a/resources-launcher-40-40/drawables.xml b/resources-launcher-40-40/drawables.xml index d8b5369..4f18f5a 100644 --- a/resources-launcher-40-40/drawables.xml +++ b/resources-launcher-40-40/drawables.xml @@ -8,7 +8,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> diff --git a/resources-launcher-54-54/drawables.xml b/resources-launcher-54-54/drawables.xml index d8b5369..4f18f5a 100644 --- a/resources-launcher-54-54/drawables.xml +++ b/resources-launcher-54-54/drawables.xml @@ -8,7 +8,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> diff --git a/resources-launcher-60-60/drawables.xml b/resources-launcher-60-60/drawables.xml index d8b5369..4f18f5a 100644 --- a/resources-launcher-60-60/drawables.xml +++ b/resources-launcher-60-60/drawables.xml @@ -8,7 +8,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> diff --git a/resources-launcher-61-61/drawables.xml b/resources-launcher-61-61/drawables.xml index d8b5369..4f18f5a 100644 --- a/resources-launcher-61-61/drawables.xml +++ b/resources-launcher-61-61/drawables.xml @@ -8,7 +8,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> diff --git a/resources-launcher-62-62/drawables.xml b/resources-launcher-62-62/drawables.xml index d8b5369..4f18f5a 100644 --- a/resources-launcher-62-62/drawables.xml +++ b/resources-launcher-62-62/drawables.xml @@ -8,7 +8,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> diff --git a/resources-launcher-65-65/drawables.xml b/resources-launcher-65-65/drawables.xml index d8b5369..4f18f5a 100644 --- a/resources-launcher-65-65/drawables.xml +++ b/resources-launcher-65-65/drawables.xml @@ -8,7 +8,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> diff --git a/resources-launcher-70-70/drawables.xml b/resources-launcher-70-70/drawables.xml index d8b5369..4f18f5a 100644 --- a/resources-launcher-70-70/drawables.xml +++ b/resources-launcher-70-70/drawables.xml @@ -8,7 +8,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> diff --git a/resources-launcher-80-80/drawables.xml b/resources-launcher-80-80/drawables.xml index d8b5369..4f18f5a 100644 --- a/resources-launcher-80-80/drawables.xml +++ b/resources-launcher-80-80/drawables.xml @@ -8,7 +8,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> diff --git a/resources-lav/strings/strings.xml b/resources-lav/strings/strings.xml index 5669759..35031b8 100644 --- a/resources-lav/strings/strings.xml +++ b/resources-lav/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Ieslēgts Izslēgts Krāns @@ -37,10 +37,13 @@ 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 “/” + Notiek izvēlnes konfigurācijas iegūšana... + Lai izietu, velciet pa labi\nPieskarieties, lai paliktu + Noklikšķiniet uz Atpakaļ, lai izietu.\nIevadiet, lai paliktu - Mājas palīga API atslēga. + API atslēga Home Assistant. Ilgmūžīgs piekļuves marķieris. - Mājas palīga API URL. + HomeAssistant API URL. URL izvēlnes konfigurācijai (JSON). Taimauts sekundēs. Pēc šī neaktivitātes perioda izejiet no lietojumprogrammas, lai taupītu ierīces akumulatoru. Pēc šī laika (sekundēs) tiek automātiski aizvērts darbības apstiprinājuma dialoglodziņš un darbība tiek atcelta. Iestatiet uz 0, lai atspējotu taimautu. diff --git a/resources-lit/strings/strings.xml b/resources-lit/strings/strings.xml index c24bed1..732fb8a 100644 --- a/resources-lit/strings/strings.xml +++ b/resources-lit/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Įjungta Išjungta Bakstelėkite @@ -37,10 +37,13 @@ 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 „/“ + Gaunama meniu konfigūracija... + Norėdami išeiti, braukite į dešinę\nPalieskite, kad pasiliktumėte + Norėdami išeiti, paspauskite „Atgal“.\nĮveskite, kad pasiliktumėte - API raktas, skirtas namų asistentui. + API raktas, skirtas HomeAssistant. Ilgalaikis prieigos raktas. - „Home Assistant“ API URL. + „HomeAssistant“ API URL. Meniu konfigūravimo URL (JSON). Skirtasis laikas sekundėmis. Po šio neveiklumo laikotarpio išeikite iš programos, kad taupytumėte įrenginio akumuliatorių. Praėjus šiam laikui (sekundėmis), veiksmo patvirtinimo dialogo langas automatiškai uždaromas ir veiksmas atšaukiamas. Nustatykite 0, kad išjungtumėte skirtąjį laiką. diff --git a/resources-nob/strings/strings.xml b/resources-nob/strings/strings.xml index 6f1610b..d7b40ed 100644 --- a/resources-nob/strings/strings.xml +++ b/resources-nob/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Av Trykk på @@ -37,10 +37,13 @@ Finner ikke URL. Potensiell konfigurasjons-URL-feil i innstillingene. HTTP-forespørsel returnerte feilkode = API URL må ikke ha en etterfølgende skråstrek '/' + Henter menykonfigurasjon.. + Sveip til høyre for å avslutte\nTrykk for å bli + Trykk Tilbake for å avslutte\nEnter for å bli - API-nøkkel for Home Assistant. + API-nøkkel for HomeAssistant. Langlevd tilgangstoken. - URL for Home Assistant API. + URL for HomeAssistant API. URL for menykonfigurasjon (JSON). Tidsavbrudd i sekunder. Avslutt applikasjonen etter denne perioden med inaktivitet for å spare enhetens batteri. Etter denne tiden (i sekunder), lukkes en bekreftelsesdialog for en handling automatisk og handlingen avbrytes. Sett til 0 for å deaktivere tidsavbruddet. diff --git a/resources-pol/strings/strings.xml b/resources-pol/strings/strings.xml index a3c92c3..c8cf3be 100644 --- a/resources-pol/strings/strings.xml +++ b/resources-pol/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant NA Wyłączony Uzyskiwać @@ -37,10 +37,13 @@ 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 „/” + Pobieranie konfiguracji menu.. + Przesuń w prawo, aby wyjść\nDotknij, aby pozostać + Naciśnij Wstecz, aby wyjść\nEnter, aby pozostać - Klucz API dla Asystenta Domowego. + Klucz API dla HomeAssistant. Długowieczny token dostępu. - Adres URL interfejsu API Home Assistant. + Adres URL interfejsu API HomeAssistant. Adres URL konfiguracji menu (JSON). Limit czasu w sekundach. Wyjdź z aplikacji po tym okresie bezczynności, aby oszczędzać baterię urządzenia. Po tym czasie (w sekundach) okno dialogowe z potwierdzeniem akcji zamyka się automatycznie, a akcja zostaje anulowana. Ustaw na 0, aby wyłączyć limit czasu. diff --git a/resources-por/strings/strings.xml b/resources-por/strings/strings.xml index 7c43b93..9cfa70d 100644 --- a/resources-por/strings/strings.xml +++ b/resources-por/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Sobre Desligado Tocar @@ -37,10 +37,13 @@ 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 '/' + Buscando configuração do menu.. + Deslize para a direita para sair\nToque para permanecer + Volte para sair\nEntre para permanecer - Chave de API para Home Assistant. + Chave de API para HomeAssistant. Token de acesso de longa duração. - URL para API do Home Assistant. + URL para API HomeAssistant. URL para configuração do menu (JSON). Tempo limite em segundos. Saia do aplicativo após esse período de inatividade para economizar bateria do aparelho. Após esse tempo (em segundos), uma caixa de diálogo de confirmação de uma ação é automaticamente fechada e a ação é cancelada. Defina como 0 para desativar o tempo limite. diff --git a/resources-ron/strings/strings.xml b/resources-ron/strings/strings.xml index 4653a74..4dd236b 100644 --- a/resources-ron/strings/strings.xml +++ b/resources-ron/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Pe Oprit Atingeți @@ -37,10 +37,13 @@ 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ă „/” + Se preiau configurarea meniului... + 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 - Cheie API pentru Home Assistant. + Cheie API pentru HomeAssistant. Token de acces cu viață lungă. - Adresa URL pentru Home Assistant API. + Adresa URL pentru API-ul HomeAssistant. URL pentru configurarea meniului (JSON). Timeout în secunde. Ieșiți din aplicație după această perioadă de inactivitate pentru a economisi bateria dispozitivului. După acest timp (în secunde), un dialog de confirmare pentru o acțiune este închis automat și acțiunea este anulată. Setați la 0 pentru a dezactiva timeout-ul. diff --git a/resources-slo/strings/strings.xml b/resources-slo/strings/strings.xml index c992dc1..f725788 100644 --- a/resources-slo/strings/strings.xml +++ b/resources-slo/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Zapnuté Vypnuté Klepnite @@ -37,10 +37,13 @@ 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 „/“ + Načítava sa konfigurácia ponuky... + Ukončite prejdením prstom doprava\nKlepnutím zostanete + Stlačte Späť na ukončenie\nVstúpte a zostaňte - API kľúč pre domáceho asistenta. + Kľúč API pre HomeAssistant. Prístupový token s dlhou životnosťou. - Adresa URL rozhrania Home Assistant API. + URL pre HomeAssistant API. Webová adresa pre konfiguráciu ponuky (JSON). Časový limit v sekundách. Po tejto dobe nečinnosti ukončite aplikáciu, aby ste šetrili batériu zariadenia. Po tomto čase (v sekundách) sa dialógové okno s potvrdením akcie automaticky zatvorí a akcia sa zruší. Ak chcete časový limit deaktivovať, nastavte na 0. diff --git a/resources-slv/strings/strings.xml b/resources-slv/strings/strings.xml index d555463..24e0d43 100644 --- a/resources-slv/strings/strings.xml +++ b/resources-slv/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Vklopljeno Izključeno Tapnite @@ -37,10 +37,13 @@ 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 '/' + Pridobivanje konfiguracije menija.. + Povlecite v desno za izhod\nDotaknite se, da ostanete + Pritisnite Nazaj za izhod\nVstopite, da ostanete - API ključ za domačega pomočnika. + API ključ za HomeAssistant. Dolgoživ dostopni žeton. - URL za API za domačega pomočnika. + URL za HomeAssistant API. URL za konfiguracijo menija (JSON). Časovna omejitev v sekundah. Po tem obdobju nedejavnosti zaprite aplikacijo, da prihranite baterijo naprave. Po tem času (v sekundah) se potrditveno pogovorno okno za dejanje samodejno zapre in dejanje je preklicano. Nastavite na 0, da onemogočite časovno omejitev. diff --git a/resources-spa/strings/strings.xml b/resources-spa/strings/strings.xml index 01544e9..049a6e1 100644 --- a/resources-spa/strings/strings.xml +++ b/resources-spa/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant En Apagado Grifo @@ -37,10 +37,13 @@ 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 '/' + Obteniendo configuración del menú.. + Desliza hacia la derecha para salir\nToca para permanecer + Presione Atrás para salir\nEntrar para permanecer - Clave API para Home Assistant. + Clave API para HomeAssistant. Token de acceso de larga duración. - URL para la API de Home Assistant. + URL para la API de HomeAssistant. URL para configuración del menú (JSON). Tiempo de espera en segundos. Salga de la aplicación después de este período de inactividad para ahorrar batería del dispositivo. Después de este tiempo (en segundos), se cierra automáticamente un cuadro de diálogo de confirmación de una acción y se cancela la acción. Establezca en 0 para desactivar el tiempo de espera. diff --git a/resources-swe/strings/strings.xml b/resources-swe/strings/strings.xml index 8642e62..ec3f904 100644 --- a/resources-swe/strings/strings.xml +++ b/resources-swe/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Av Knacka @@ -37,10 +37,13 @@ Webbadressen hittades inte. Potentiellt konfigurations-URL-fel i inställningarna. HTTP-begäran returnerade felkod = API-URL får inte ha ett snedstreck '/' + Hämtar menykonfiguration.. + 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 - API-nyckel för Home Assistant. + API-nyckel för HomeAssistant. Långlivad åtkomsttoken. - URL för Home Assistant API. + URL för HomeAssistant API. URL för menykonfiguration (JSON). Timeout på sekunder. Avsluta programmet efter denna period av inaktivitet för att spara enhetens batteri. Efter denna tid (i sekunder) stängs en bekräftelsedialog för en åtgärd automatiskt och åtgärden avbryts. Ställ in på 0 för att inaktivera timeout. diff --git a/resources-tha/strings/strings.xml b/resources-tha/strings/strings.xml index 4658ac7..38aeb70 100644 --- a/resources-tha/strings/strings.xml +++ b/resources-tha/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant บน ปิด แตะ @@ -37,10 +37,13 @@ ไม่พบ URL ข้อผิดพลาด URL การกำหนดค่าที่อาจเกิดขึ้นในการตั้งค่า คำขอ HTTP ส่งคืนรหัสข้อผิดพลาด = URL ของ API ต้องไม่มีเครื่องหมายทับต่อท้าย '/' + กำลังดึงข้อมูลการกำหนดค่าเมนู.. + ปัดไปทางขวาเพื่อออก\nแตะเพื่ออยู่ต่อ + กดกลับเพื่อออก\nเข้าไปเพื่ออยู่ต่อ - รหัส API สำหรับผู้ช่วยที่บ้าน + คีย์ API สำหรับ HomeAssistant โทเค็นการเข้าถึงที่มีอายุการใช้งานยาวนาน - URL สำหรับ Home Assistant API + URL สำหรับ HomeAssistant API URL สำหรับการกำหนดค่าเมนู (JSON) หมดเวลาเป็นวินาที ออกจากแอปพลิเคชันหลังจากไม่มีการใช้งานเป็นระยะเวลาหนึ่งเพื่อประหยัดแบตเตอรี่ของอุปกรณ์ หลังจากเวลานี้ (เป็นวินาที) กล่องโต้ตอบการยืนยันสำหรับการดำเนินการจะปิดโดยอัตโนมัติและการดำเนินการจะถูกยกเลิก ตั้งค่าเป็น 0 เพื่อปิดใช้งานการหมดเวลา diff --git a/resources-tur/strings/strings.xml b/resources-tur/strings/strings.xml index b0cb661..f5cbdb7 100644 --- a/resources-tur/strings/strings.xml +++ b/resources-tur/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Açık Kapalı Musluk @@ -37,10 +37,13 @@ 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 + Menü Yapılandırması alınıyor.. + Çı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 - Ev Asistanı için API Anahtarı. + HomeAssistant için API Anahtarı. Uzun Ömürlü Erişim Jetonu. - Ev Asistanı API'sinin URL'si. + HomeAssistant API'sinin URL'si. Menü yapılandırmasının URL'si (JSON). Saniye cinsinden zaman aşımı. Cihazın pilinden tasarruf etmek için bu süre boyunca işlem yapılmadığında uygulamadan çıkın. Bu sürenin sonunda (saniye olarak), bir eyleme ilişkin onay iletişim kutusu otomatik olarak kapatılır ve eylem iptal edilir. Zaman aşımını devre dışı bırakmak için 0'a ayarlayın. diff --git a/resources-ukr/strings/strings.xml b/resources-ukr/strings/strings.xml index cf5d4e6..beee4f1 100644 --- a/resources-ukr/strings/strings.xml +++ b/resources-ukr/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant Увімкнено Вимкнено Торкніться @@ -37,10 +37,13 @@ URL не знайдено. Потенційна помилка URL-адреси конфігурації в налаштуваннях. Запит HTTP повернув код помилки = URL-адреса API не повинна містити косу риску '/' + Отримання конфігурації меню.. + Проведіть праворуч, щоб вийти\nТоркніться, щоб залишитися + Натисніть «Назад», щоб вийти\nВведіть, щоб залишитися - Ключ API для домашнього помічника. + Ключ API для HomeAssistant. Довговічний маркер доступу. - URL для Home Assistant API. + URL для HomeAssistant API. URL-адреса для налаштування меню (JSON). Час очікування в секундах. Вийдіть із програми після цього періоду бездіяльності, щоб заощадити батарею пристрою. Після закінчення цього часу (у секундах) діалогове вікно підтвердження дії автоматично закривається, а дія скасовується. Встановіть 0, щоб вимкнути тайм-аут. diff --git a/resources-vie/strings/strings.xml b/resources-vie/strings/strings.xml index 6a06210..47de53b 100644 --- a/resources-vie/strings/strings.xml +++ b/resources-vie/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant TRÊN Tắt Vỗ nhẹ @@ -37,10 +37,13 @@ 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 '/' + Đang tìm nạp cấu hình menu.. + Vuốt sang phải để thoát\nNhấn để ở lại + Nhấn Quay lại để thoát\nNhập để ở lại - Khóa API cho Trợ lý tại nhà. + Khóa API cho HomeAssistant. Mã thông báo truy cập tồn tại lâu dài. - URL cho API Trợ lý gia đình. + URL cho API HomeAssistant. URL cho cấu hình menu (JSON). Thời gian chờ tính bằng giây. Thoát khỏi ứng dụng sau khoảng thời gian không hoạt động này để tiết kiệm pin cho thiết bị. Sau thời gian này (tính bằng giây), hộp thoại xác nhận cho một hành động sẽ tự động đóng và hành động đó sẽ bị hủy. Đặt thành 0 để tắt thời gian chờ. diff --git a/resources-zhs/strings/strings.xml b/resources-zhs/strings/strings.xml index 83d4dad..3d92fa8 100644 --- a/resources-zhs/strings/strings.xml +++ b/resources-zhs/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant 离开 轻敲 @@ -37,10 +37,13 @@ 找不到网址。设置中可能存在配置 URL 错误。 HTTP请求返回错误码= API URL 不得有尾部斜杠“/” + 正在获取菜单配置.. + 向右滑动即可退出\n点击即可停留 + 按回车键退出\n按回车键继续 - 家庭助理的 API 密钥。 + HomeAssistant 的 API 密钥。 长期访问令牌。 - Home Assistant API 的 URL。 + HomeAssistant API 的 URL。 菜单配置的 URL (JSON)。 超时(以秒为单位)。闲置一段时间后退出应用程序以节省设备电池。 在此时间(以秒为单位)之后,操作的确认对话框将自动关闭并取消该操作。设置为 0 以禁用超时。 diff --git a/resources-zht/strings/strings.xml b/resources-zht/strings/strings.xml index 4efe7de..6f201e4 100644 --- a/resources-zht/strings/strings.xml +++ b/resources-zht/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant 離開 輕敲 @@ -37,10 +37,13 @@ 找不到網址。設定中可能存在配置 URL 錯誤。 HTTP請求回傳錯誤碼= API URL 不得有尾部斜線“/” + 正在取得選單配置.. + 向右滑動即可退出\n點選即可停留 + 按回車鍵退出\n按回車鍵繼續 - 家庭助理的 API 金鑰。 + HomeAssistant 的 API 金鑰。 長期訪問令牌。 - Home Assistant API 的 URL。 + HomeAssistant API 的 URL。 選單配置的 URL (JSON)。 超時(以秒為單位)。閒置一段時間後退出應用程式以節省設備電池。 在此時間(以秒為單位)之後,操作的確認對話方塊將自動關閉並取消該操作。設定為 0 以停用逾時。 diff --git a/resources-zsm/strings/strings.xml b/resources-zsm/strings/strings.xml index 595d80e..b731039 100644 --- a/resources-zsm/strings/strings.xml +++ b/resources-zsm/strings/strings.xml @@ -9,7 +9,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> @@ -19,7 +19,7 @@ --> - HomeAssistant + HomeAssistant hidup Mati Ketik @@ -37,10 +37,13 @@ URL tidak ditemui. Ralat URL Konfigurasi Potensi dalam tetapan. Permintaan HTTP mengembalikan kod ralat = URL API tidak boleh mempunyai garis miring '/' + Mengambil Konfigurasi Menu.. + Leret ke Kanan untuk Keluar\nKetik untuk Kekal + Tekan Kembali untuk Keluar\nMasuk untuk Kekal - Kunci API untuk Pembantu Rumah. + Kunci API untuk HomeAssistant. Token Akses Berumur Panjang. - URL untuk API Pembantu Rumah. + URL untuk API HomeAssistant. URL untuk konfigurasi menu (JSON). Tamat masa dalam beberapa saat. Keluar dari aplikasi selepas tempoh tidak aktif ini untuk menjimatkan bateri peranti. Selepas masa ini (dalam beberapa saat), dialog pengesahan untuk tindakan ditutup secara automatik dan tindakan itu dibatalkan. Tetapkan kepada 0 untuk melumpuhkan tamat masa. diff --git a/resources/settings/properties.xml b/resources/settings/properties.xml index 102efc1..8929de2 100644 --- a/resources/settings/properties.xml +++ b/resources/settings/properties.xml @@ -8,7 +8,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> diff --git a/resources/settings/settings.xml b/resources/settings/settings.xml index affd65b..4403534 100644 --- a/resources/settings/settings.xml +++ b/resources/settings/settings.xml @@ -8,7 +8,7 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> diff --git a/resources/strings/strings.xml b/resources/strings/strings.xml index 173d110..300ad8f 100644 --- a/resources/strings/strings.xml +++ b/resources/strings/strings.xml @@ -8,12 +8,12 @@ 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, 31 October 2023 + P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 --> - HomeAssistant + HomeAssistant On Off Tap @@ -31,6 +31,9 @@ URL not found. Potential Configuration URL error in settings. HTTP request returned error code = API URL must not have a trailing slash '/' + Fetching Menu Config.. + Swipe to Right to Exit\nTap to Stay + Hit Back to Exit\nEnter to Stay API Key for HomeAssistant. @@ -41,5 +44,4 @@ After this time (in seconds), a confirmation dialog for an action is automatically closed and the action is cancelled. Set to 0 to disable the timeout. Representing types with icons (off) or with labels (on). Left (off) or Right (on) Menu Alignment. - diff --git a/source/ErrorView.mc b/source/ErrorView.mc index 5dbadc0..0c5c5c8 100644 --- a/source/ErrorView.mc +++ b/source/ErrorView.mc @@ -18,6 +18,15 @@ // should not happen of course... but they do, so best make sure errors can be // reported. // +// Designed so that a single ErrorView is used for all errors and hence can ensure +// that only the first call to display is honoured until the view is dismissed. +// This compensates for older devices not being able to call WatchUi.getCurrentView() +// due to not supporting API level 3.4.0. +// +// Usage: +// 1) ErrorView.show("Error message"); +// 2) return ErrorView.create("Error message"); // as Lang.Array +// //----------------------------------------------------------------------------------- using Toybox.Graphics; @@ -26,18 +35,22 @@ using Toybox.WatchUi; using Toybox.Communications; class ErrorView extends ScalableView { - private const cSettings as Lang.Dictionary = { + private var mText as Lang.String = ""; + private var mDelegate as ErrorDelegate; + private const cSettings as Lang.Dictionary = { :errorIconMargin => 7f }; // Vertical spacing between the top of the face and the error icon - private var mErrorIconMargin; - private var mText as Lang.String; + private var mErrorIconMargin as Lang.Number; private var mErrorIcon; private var mTextArea; - function initialize(text as Lang.String) { + private static var instance; + private static var mShown as Lang.Boolean = false; + + function initialize() { ScalableView.initialize(); - mText = text; + mDelegate = new ErrorDelegate(self); // Convert the settings from % of screen size to pixels mErrorIconMargin = pixelsForScreen(cSettings.get(:errorIconMargin) as Lang.Float); } @@ -65,25 +78,66 @@ 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); } + function getDelegate() as ErrorDelegate { + return mDelegate; + } + + static function create(text as Lang.String) as Lang.Array { + if (instance == null) { + instance = new ErrorView(); + } + if (!mShown) { + instance.setText(text); + } + return [instance, instance.getDelegate()]; + } + + // Create or reuse an existing ErrorView, and pass on the text. + static function show(text as Lang.String) as Void { + create(text); // Ignore returned values + if (!mShown) { + WatchUi.pushView(instance, instance.getDelegate(), WatchUi.SLIDE_UP); + mShown = true; + } + } + + // Internal show now we're not a static method like 'show()'. + function setText(text as Lang.String) as Void { + mText = text; + if (mTextArea != null) { + mTextArea.setText(text); + requestUpdate(); + } + } + + static function unShow() as Void { + if (mShown) { + mShown = false; + WatchUi.popView(WatchUi.SLIDE_DOWN); + } + } + } class ErrorDelegate extends WatchUi.BehaviorDelegate { - function initialize() { + + function initialize(view as ErrorView) { WatchUi.BehaviorDelegate.initialize(); } + function onBack() { getApp().getQuitTimer().reset(); - WatchUi.popView(WatchUi.SLIDE_DOWN); + ErrorView.unShow(); return true; } -} \ No newline at end of file + +} diff --git a/source/Globals.mc b/source/Globals.mc index 9475c94..bd2ed2d 100644 --- a/source/Globals.mc +++ b/source/Globals.mc @@ -9,7 +9,7 @@ // 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, 31 October 2023 +// P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 // // // Description: diff --git a/source/HomeAssistantApp.mc b/source/HomeAssistantApp.mc index dc1651f..bac4035 100644 --- a/source/HomeAssistantApp.mc +++ b/source/HomeAssistantApp.mc @@ -9,7 +9,7 @@ // 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, 31 October 2023 +// P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 // // // Description: @@ -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,56 +100,43 @@ 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) { if (Globals.scDebug) { System.println("HomeAssistantApp getInitialView(): No API key in the application settings."); } - return [new ErrorView(strNoApiKey + "."), new ErrorDelegate()] as Lang.Array; + return ErrorView.create(strNoApiKey + "."); } else if (api_url.length() == 0) { if (Globals.scDebug) { System.println("HomeAssistantApp getInitialView(): No API URL in the application settings."); } - return [new ErrorView(strNoApiUrl + "."), new ErrorDelegate()] as Lang.Array; + return ErrorView.create(strNoApiUrl + "."); } else if (api_url.substring(-1, api_url.length()).equals("/")) { if (Globals.scDebug) { System.println("HomeAssistantApp getInitialView(): API URL must not have a trailing slash '/'."); } - return [new ErrorView(strTrailingSlashErr + "."), new ErrorDelegate()] as Lang.Array; + return ErrorView.create(strTrailingSlashErr + "."); } else if ((Properties.getValue("config_url") as Lang.String).length() == 0) { if (Globals.scDebug) { System.println("HomeAssistantApp getInitialView(): No configuration URL in the application settings."); } - return [new ErrorView(strNoConfigUrl + "."), new ErrorDelegate()] as Lang.Array; + return ErrorView.create(strNoConfigUrl + "."); } else if (! System.getDeviceSettings().phoneConnected) { if (Globals.scDebug) { System.println("HomeAssistantApp fetchMenuConfig(): No Phone connection, skipping API call."); } - return [new ErrorView(strNoPhone + "."), new ErrorDelegate()] as Lang.Array; + return ErrorView.create(strNoPhone + "."); } else if (! System.getDeviceSettings().connectionAvailable) { if (Globals.scDebug) { System.println("HomeAssistantApp fetchMenuConfig(): No Internet connection, skipping API call."); } - return [new ErrorView(strNoInternet + "."), new ErrorDelegate()] as Lang.Array; + 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; } } @@ -117,28 +151,27 @@ class HomeAssistantApp extends Application.AppBase { if (Globals.scDebug) { System.println("HomeAssistantApp onReturnFetchMenuConfig() Response Code: BLE_HOST_TIMEOUT or BLE_CONNECTION_UNAVAILABLE, Bluetooth connection severed."); } - WatchUi.pushView(new ErrorView(strNoPhone + "."), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strNoPhone + "."); } else if (responseCode == Communications.BLE_QUEUE_FULL) { if (Globals.scDebug) { System.println("HomeAssistantApp onReturnFetchMenuConfig() Response Code: BLE_QUEUE_FULL, API calls too rapid."); } - if (!(WatchUi.getCurrentView()[0] instanceof ErrorView)) { - // Avoid pushing multiple ErrorViews - WatchUi.pushView(new ErrorView(strApiFlood), new ErrorDelegate(), WatchUi.SLIDE_UP); - } + // Don't need to worry about multiple ErrorViews here as the fetch does not happen a second time. + ErrorView.show(strApiFlood); } else if (responseCode == Communications.NETWORK_REQUEST_TIMED_OUT) { if (Globals.scDebug) { System.println("HomeAssistantApp onReturnFetchMenuConfig() Response Code: NETWORK_REQUEST_TIMED_OUT, check Internet connection."); } - WatchUi.pushView(new ErrorView(strNoResponse), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strNoResponse); } else if (responseCode == 404) { if (Globals.scDebug) { System.println("HomeAssistantApp onReturnFetchMenuConfig() Response Code: 404, page not found. Check Configuration URL setting."); } - WatchUi.pushView(new ErrorView(strConfigUrlNotFound), new ErrorDelegate(), WatchUi.SLIDE_UP); + 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. @@ -149,12 +182,12 @@ class HomeAssistantApp extends Application.AppBase { if (Globals.scDebug) { System.println("HomeAssistantApp onReturnFetchMenuConfig(): Network request timeout."); } - WatchUi.pushView(new ErrorView(strNoMenu + ". " + strNoInternet + "?"), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strNoMenu + ". " + strNoInternet + "?"); } else { if (Globals.scDebug) { System.println("HomeAssistantApp onReturnFetchMenuConfig(): Unhandled HTTP response code = " + responseCode); } - WatchUi.pushView(new ErrorView(strUnhandledHttpErr + responseCode ), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strUnhandledHttpErr + responseCode ); } } @@ -171,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 { @@ -180,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/HomeAssistantConfirmation.mc b/source/HomeAssistantConfirmation.mc index 24381a3..951fd1d 100644 --- a/source/HomeAssistantConfirmation.mc +++ b/source/HomeAssistantConfirmation.mc @@ -26,6 +26,7 @@ using Toybox.Timer; using Toybox.Application.Properties; class HomeAssistantConfirmation extends WatchUi.Confirmation { + function initialize() { WatchUi.Confirmation.initialize(WatchUi.loadResource($.Rez.Strings.Confirm)); } @@ -33,32 +34,32 @@ class HomeAssistantConfirmation extends WatchUi.Confirmation { } class HomeAssistantConfirmationDelegate extends WatchUi.ConfirmationDelegate { - private var confirmMethod; - private var timeout; + private var mConfirmMethod; + private var mTimer; function initialize(callback as Method() as Void) { WatchUi.ConfirmationDelegate.initialize(); - confirmMethod = callback; + mConfirmMethod = callback; var timeoutSeconds = Properties.getValue("confirm_timeout") as Lang.Number; if (timeoutSeconds > 0) { - timeout = new Timer.Timer(); - timeout.start(method(:onTimeout), timeoutSeconds * 1000, true); + mTimer = new Timer.Timer(); + mTimer.start(method(:onTimeout), timeoutSeconds * 1000, true); } } function onResponse(response) as Lang.Boolean { getApp().getQuitTimer().reset(); - if (timeout) { - timeout.stop(); + if (mTimer) { + mTimer.stop(); } if (response == WatchUi.CONFIRM_YES) { - confirmMethod.invoke(); + mConfirmMethod.invoke(); } return true; } function onTimeout() as Void { - timeout.stop(); + mTimer.stop(); WatchUi.popView(WatchUi.SLIDE_RIGHT); } } 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/HomeAssistantIconMenuItem.mc b/source/HomeAssistantIconMenuItem.mc index a42055d..80375b1 100644 --- a/source/HomeAssistantIconMenuItem.mc +++ b/source/HomeAssistantIconMenuItem.mc @@ -9,7 +9,7 @@ // 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, 31 October 2023 +// P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 // // // Description: diff --git a/source/HomeAssistantMenuItem.mc b/source/HomeAssistantMenuItem.mc index 8b4166e..d8e0f4c 100644 --- a/source/HomeAssistantMenuItem.mc +++ b/source/HomeAssistantMenuItem.mc @@ -9,7 +9,7 @@ // 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, 31 October 2023 +// P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 // // // Description: diff --git a/source/HomeAssistantService.mc b/source/HomeAssistantService.mc index 2f371a9..c88615c 100644 --- a/source/HomeAssistantService.mc +++ b/source/HomeAssistantService.mc @@ -54,25 +54,23 @@ class HomeAssistantService { if (Globals.scDebug) { System.println("HomeAssistantService onReturnCall() Response Code: BLE_HOST_TIMEOUT or BLE_CONNECTION_UNAVAILABLE, Bluetooth connection severed."); } - WatchUi.pushView(new ErrorView(strNoPhone + "."), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strNoPhone + "."); } else if (responseCode == Communications.BLE_QUEUE_FULL) { if (Globals.scDebug) { System.println("HomeAssistantService onReturnCall() Response Code: BLE_QUEUE_FULL, API calls too rapid."); } - if (!(WatchUi.getCurrentView()[0] instanceof ErrorView)) { - // Avoid pushing multiple ErrorViews - WatchUi.pushView(new ErrorView(strApiFlood), new ErrorDelegate(), WatchUi.SLIDE_UP); - } + // Don't need to worry about multiple ErrorViews here as the call is not on a repeat timer. + ErrorView.show(strApiFlood); } else if (responseCode == Communications.NETWORK_REQUEST_TIMED_OUT) { if (Globals.scDebug) { System.println("HomeAssistantService onReturnCall() Response Code: NETWORK_REQUEST_TIMED_OUT, check Internet connection."); } - WatchUi.pushView(new ErrorView(strNoResponse), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strNoResponse); } else if (responseCode == 404) { if (Globals.scDebug) { System.println("HomeAssistantService onReturnCall() Response Code: 404, page not found. Check API URL setting."); } - WatchUi.pushView(new ErrorView(strApiUrlNotFound), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strApiUrlNotFound); } else if (responseCode == 200) { if (Globals.scDebug) { System.println("HomeAssistantService onReturnCall(): Service executed."); @@ -99,7 +97,7 @@ class HomeAssistantService { if (Globals.scDebug) { System.println("HomeAssistantService onReturnCall(): Unhandled HTTP response code = " + responseCode); } - WatchUi.pushView(new ErrorView(strUnhandledHttpErr + responseCode ), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strUnhandledHttpErr + responseCode ); } } @@ -117,14 +115,15 @@ class HomeAssistantService { if (Globals.scDebug) { System.println("HomeAssistantService call(): No Phone connection, skipping API call."); } - WatchUi.pushView(new ErrorView(strNoPhone + "."), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strNoPhone + "."); } else if (! System.getDeviceSettings().connectionAvailable) { if (Globals.scDebug) { System.println("HomeAssistantService call(): No Internet connection, skipping API call."); } - WatchUi.pushView(new ErrorView(strNoInternet + "."), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strNoInternet + "."); } else { - var url = (Properties.getValue("api_url") as Lang.String) + "/services/" + service.substring(0, service.find(".")) + "/" + service.substring(service.find(".")+1, null); + // Can't use null for substring() parameters due to API version level. + var url = (Properties.getValue("api_url") as Lang.String) + "/services/" + service.substring(0, service.find(".")) + "/" + service.substring(service.find(".")+1, service.length()); if (Globals.scDebug) { System.println("HomeAssistantService call() URL=" + url); System.println("HomeAssistantService call() service=" + service); diff --git a/source/HomeAssistantToggleMenuItem.mc b/source/HomeAssistantToggleMenuItem.mc index 9bbbe89..08b2fbe 100644 --- a/source/HomeAssistantToggleMenuItem.mc +++ b/source/HomeAssistantToggleMenuItem.mc @@ -9,7 +9,7 @@ // 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, 31 October 2023 +// P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 // // // Description: @@ -77,56 +77,68 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem { } // Provide the ability to terminate updating chain of calls for a permanent network error. var keepUpdating = true; - if (responseCode == Communications.BLE_HOST_TIMEOUT || responseCode == Communications.BLE_CONNECTION_UNAVAILABLE) { - if (Globals.scDebug) { - System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Code: BLE_HOST_TIMEOUT or BLE_CONNECTION_UNAVAILABLE, Bluetooth connection severed."); - } - if (!(WatchUi.getCurrentView()[0] instanceof ErrorView)) { - // Avoid pushing multiple ErrorViews - WatchUi.pushView(new ErrorView(strNoPhone + "."), new ErrorDelegate(), WatchUi.SLIDE_UP); - } - } else if (responseCode == Communications.BLE_QUEUE_FULL) { - if (Globals.scDebug) { - System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Code: BLE_QUEUE_FULL, API calls too rapid."); - } - if (!(WatchUi.getCurrentView()[0] instanceof ErrorView)) { - // Avoid pushing multiple ErrorViews - WatchUi.pushView(new ErrorView(strApiFlood), new ErrorDelegate(), WatchUi.SLIDE_UP); - } - } else if (responseCode == Communications.NETWORK_REQUEST_TIMED_OUT) { - if (Globals.scDebug) { - System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Code: NETWORK_REQUEST_TIMED_OUT, check Internet connection."); - } - if (!(WatchUi.getCurrentView()[0] instanceof ErrorView)) { - // Avoid pushing multiple ErrorViews - WatchUi.pushView(new ErrorView(strNoResponse), new ErrorDelegate(), WatchUi.SLIDE_UP); - } - } else if (responseCode == 404) { - if (Globals.scDebug) { - System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Code: 404, page not found. Check API URL setting."); - } - if (!(WatchUi.getCurrentView()[0] instanceof ErrorView)) { - // Avoid pushing multiple ErrorViews - WatchUi.pushView(new ErrorView(strApiUrlNotFound), new ErrorDelegate(), WatchUi.SLIDE_UP); - } - keepUpdating = false; - } else if (responseCode == 200) { - var state = data.get("state") as Lang.String; - if (Globals.scDebug) { - System.println((data.get("attributes") as Lang.Dictionary).get("friendly_name") + " State=" + state); - } - if (getLabel().equals("...")) { - setLabel((data.get("attributes") as Lang.Dictionary).get("friendly_name") as Lang.String); - } - setUiToggle(state); - } else { - if (Globals.scDebug) { - System.println("HomeAssistantToggleMenuItem onReturnGetState(): Unhandled HTTP response code = " + responseCode); - } - if (!(WatchUi.getCurrentView()[0] instanceof ErrorView)) { - // Avoid pushing multiple ErrorViews - WatchUi.pushView(new ErrorView(strUnhandledHttpErr + responseCode ), new ErrorDelegate(), WatchUi.SLIDE_UP); - } + switch (responseCode) { + case Communications.BLE_HOST_TIMEOUT: + case Communications.BLE_CONNECTION_UNAVAILABLE: + if (Globals.scDebug) { + System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Code: BLE_HOST_TIMEOUT or BLE_CONNECTION_UNAVAILABLE, Bluetooth connection severed."); + } + ErrorView.show(strNoPhone + "."); + break; + case Communications.BLE_QUEUE_FULL: + if (Globals.scDebug) { + System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Code: BLE_QUEUE_FULL, API calls too rapid."); + } + ErrorView.show(strApiFlood); + break; + case Communications.NETWORK_REQUEST_TIMED_OUT: + if (Globals.scDebug) { + System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Code: NETWORK_REQUEST_TIMED_OUT, check Internet connection."); + } + ErrorView.show(strNoResponse); + break; + case 404: + var msg = null; + if (data != null) { + msg = data.get("message"); + } + if (msg != null) { + // Should be an HTTP 405 according to curl queries + if (Globals.scDebug) { + System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Code: 404. " + mIdentifier + " " + msg); + } + ErrorView.show("HTTP 405, " + mIdentifier + ". " + data.get("message")); + } else { + if (Globals.scDebug) { + System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Code: 404, page not found. Check API URL setting."); + } + ErrorView.show(strApiUrlNotFound); + } + keepUpdating = false; + break; + case 405: + if (Globals.scDebug) { + System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Code: 405. " + mIdentifier + " " + data.get("message")); + } + ErrorView.show("HTTP 405, " + mIdentifier + ". " + data.get("message")); + keepUpdating = false; + break; + case 200: + var state = data.get("state") as Lang.String; + if (Globals.scDebug) { + System.println((data.get("attributes") as Lang.Dictionary).get("friendly_name") + " State=" + state); + } + if (getLabel().equals("...")) { + setLabel((data.get("attributes") as Lang.Dictionary).get("friendly_name") as Lang.String); + } + setUiToggle(state); + ErrorView.unShow(); + break; + default: + if (Globals.scDebug) { + System.println("HomeAssistantToggleMenuItem onReturnGetState(): Unhandled HTTP response code = " + responseCode); + } + ErrorView.show(strUnhandledHttpErr + responseCode); } if (keepUpdating) { // Now this feels very "closely coupled" to the application, but it is the most reliable method instead of using a timer. @@ -147,18 +159,12 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem { if (Globals.scDebug) { System.println("HomeAssistantToggleMenuItem getState(): No Phone connection, skipping API call."); } - if (!(WatchUi.getCurrentView()[0] instanceof ErrorView)) { - // Avoid pushing multiple ErrorViews - WatchUi.pushView(new ErrorView(strNoPhone + "."), new ErrorDelegate(), WatchUi.SLIDE_UP); - } + ErrorView.show(strNoPhone + "."); } else if (! System.getDeviceSettings().connectionAvailable) { if (Globals.scDebug) { System.println("HomeAssistantToggleMenuItem getState(): No Internet connection, skipping API call."); } - if (!(WatchUi.getCurrentView()[0] instanceof ErrorView)) { - // Avoid pushing multiple ErrorViews - WatchUi.pushView(new ErrorView(strNoInternet + "."), new ErrorDelegate(), WatchUi.SLIDE_UP); - } + ErrorView.show(strNoInternet + "."); } else { var url = Properties.getValue("api_url") + "/states/" + mIdentifier; if (Globals.scDebug) { @@ -180,7 +186,9 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem { var myTimer = new Timer.Timer(); // Now this feels very "closely coupled" to the application, but it is the most reliable method instead of using a timer. myTimer.start(getApp().method(:updateNextMenuItem), 500, false); - System.println("HomeAssistantToggleMenuItem getState(): Updated failed " + mIdentifier); + if (Globals.scDebug) { + System.println("HomeAssistantToggleMenuItem getState(): Updated failed " + mIdentifier); + } } } @@ -195,22 +203,22 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem { if (Globals.scDebug) { System.println("HomeAssistantToggleMenuItem onReturnSetState() Response Code: BLE_HOST_TIMEOUT or BLE_CONNECTION_UNAVAILABLE, Bluetooth connection severed."); } - WatchUi.pushView(new ErrorView(strNoPhone + "."), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strNoPhone + "."); } else if (responseCode == Communications.BLE_QUEUE_FULL) { if (Globals.scDebug) { System.println("HomeAssistantToggleMenuItem onReturnSetState() Response Code: BLE_QUEUE_FULL, API calls too rapid."); } - WatchUi.pushView(new ErrorView(strApiFlood), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strApiFlood); } else if (responseCode == Communications.NETWORK_REQUEST_TIMED_OUT) { if (Globals.scDebug) { System.println("HomeAssistantToggleMenuItem onReturnSetState() Response Code: NETWORK_REQUEST_TIMED_OUT, check Internet connection."); } - WatchUi.pushView(new ErrorView(strNoResponse), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strNoResponse); } else if (responseCode == 404) { if (Globals.scDebug) { System.println("HomeAssistantToggleMenuItem onReturnSetState() Response Code: 404, page not found. Check API URL setting."); } - WatchUi.pushView(new ErrorView(strApiUrlNotFound), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strApiUrlNotFound); } else if (responseCode == 200) { var state; var d = data as Lang.Array; @@ -227,7 +235,7 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem { if (Globals.scDebug) { System.println("HomeAssistantToggleMenuItem onReturnSetState(): Unhandled HTTP response code = " + responseCode); } - WatchUi.pushView(new ErrorView(strUnhandledHttpErr + responseCode ), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strUnhandledHttpErr + responseCode ); } } @@ -246,14 +254,14 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem { } // Toggle the UI back setEnabled(!isEnabled()); - WatchUi.pushView(new ErrorView(strNoPhone + "."), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strNoPhone + "."); } else if (! System.getDeviceSettings().connectionAvailable) { if (Globals.scDebug) { System.println("HomeAssistantToggleMenuItem getState(): No Internet connection, skipping API call."); } // Toggle the UI back setEnabled(!isEnabled()); - WatchUi.pushView(new ErrorView(strNoInternet + "."), new ErrorDelegate(), WatchUi.SLIDE_UP); + ErrorView.show(strNoInternet + "."); } else { // Updated SDK and got a new error // ERROR: venu: Cannot find symbol ':substring' on type 'PolyType'. diff --git a/source/HomeAssistantView.mc b/source/HomeAssistantView.mc index 366dcac..3e2f6d0 100644 --- a/source/HomeAssistantView.mc +++ b/source/HomeAssistantView.mc @@ -9,7 +9,7 @@ // 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, 31 October 2023 +// P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 // // // Description: @@ -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/HomeAssistantViewMenuItem.mc b/source/HomeAssistantViewMenuItem.mc index c430b4b..81fd141 100644 --- a/source/HomeAssistantViewMenuItem.mc +++ b/source/HomeAssistantViewMenuItem.mc @@ -9,7 +9,7 @@ // 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, 31 October 2023 +// P A Abbey & J D Abbey & SomeoneOnEarth, 31 October 2023 // // // Description: diff --git a/source/RootView.mc b/source/RootView.mc new file mode 100644 index 0000000..fcd5d00 --- /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; + } +}