Compare commits

..

9 Commits
v1.0 ... v1.2

Author SHA1 Message Date
3bd5361ad2 API Level reduced
Reduced minimum API Level required from 3.3.0 to 3.1.0 to allow more device “part numbers” to be satisfied.
Fixed an issue with one device's icon size.
2023-11-12 17:36:19 +00:00
d540fb576a Bugfixes
Do not crash on zero items to update
Report unreachable URLs
Verify API URL does not have a trailing slash '/'
Increased HTTP response diagnosis
2023-11-12 16:24:56 +00:00
765d7f7f50 Removed timer based update mechanism
Instead chaining calls from the previous update is a slightly close coupled way that might need to be refined.
2023-11-11 20:00:26 +00:00
fde270ff34 Renamed class variables
There's a Monkey C convention to have class variable names start with 'm', then be camel case. 'm' for 'member' according to https://developer.garmin.com/connect-iq/reference-guides/monkey-c-reference/.
2023-11-11 13:58:35 +00:00
e7c4411dd2 Fix for the update rate
Now perform a "round robin" of all toggle menu items. The delay is currently 100 ms to avoid Communications.BLE_QUEUE_FULL errors.
2023-11-11 13:36:08 +00:00
b7ed8607fb Additional changes for the previous merge. 2023-11-11 07:49:15 +00:00
80e56e5969 Merge branch 'main' of ssh://github.com/house-of-abbey/GarminHomeAssistant 2023-11-11 07:46:40 +00:00
1653569e8f Added 54 devices
Added vibrate knowledgement
Fall back to a home made alert if no toast or vibrate
Support for 80 devices, 54 new ones added
2023-11-10 18:22:14 +00:00
5afb08d096 Service call for tap item 2023-11-09 21:13:09 +00:00
69 changed files with 1095 additions and 246 deletions

6
.vscode/settings.json vendored Normal file
View File

@ -0,0 +1,6 @@
{
"cSpell.words": [
"usbs",
"Venu"
]
}

View File

@ -0,0 +1,12 @@
{
"folders": [
{
"path": "."
},
{
"name": "abc",
"path": "../blah/abc"
}
],
"settings": {}
}

View File

@ -4,10 +4,9 @@
A Garmin application to provide a "dashboard" to control your devices via [Home Assistant](https://www.home-assistant.io/). The application will never be as fully fledged as a Home Assistant dashboard, so it is designed to be good enough for the simple and essential things. Those things that can be activated via an on/off toggle or a tap. That should cover lights, switches, and anything requiring a single press such as an automation. For anything more complicated, e.g. thermostat, it would always be quicker and simpler to reach for your phone or tablet... or the device's own remote control!
The application is designed around a simple scrollable menu where menu items have been extended to interface with the [Home Assistant API](https://developers.home-assistant.io/docs/api/rest/), e.g. to get the status of switches or lights for display on the toggle menu item. It is possible to nest menus, so there is a menu item to open a sub-menu. This can be
arbitrarily deep and nested in the format of a tree of items, although you need to consider if reaching for your phone becomes quicker to select the device what you want to control.
The application is designed around a simple scrollable menu where menu items have been extended to interface with the [Home Assistant API](https://developers.home-assistant.io/docs/api/rest/), e.g. to get the status of switches or lights for display on the toggle menu item. It is possible to nest menus, so there is a menu item to open a sub-menu. This can be arbitrarily deep and nested in the format of a tree of items, although you need to consider if reaching for your phone becomes quicker to select the device what you want to control.
It is important to note that your homeassistant instance will need to be accessible via HTTPS with public SSL or all requests from the Garmin will not work. This cannot be a self-signed certificate, it must be a public certificate (You can get one for free from Let's Encrypt or you can pay for homeassistant cloud).
It is important to note that your Home Assistant instance will need to be accessible via HTTPS with public SSL or all requests from the Garmin will not work. This cannot be a self-signed certificate, it must be a public certificate (You can get one for free from [Let's Encrypt](https://letsencrypt.org/) or you can pay for [Home Assistant cloud](https://www.nabucasa.com/)).
## Application Installation
@ -15,7 +14,7 @@ Head over to the [GarminHomeAssistant](https://apps.garmin.com/en-US/apps/61c91d
## Dashboard Definition
Setup for this menu is more complicated than the Connect IQ settings menu really allows you to specify. In order to make the dashboard easily configurable and easy to change, we have provided an external mechanism for specifying the menu layout, a JSON file you write, retrieved from a URL you specify. JSON was chosen over YAML because Garmin can parse JSON HTTP GET responses into its own internal dictionary, it cannot parse YAML, hence a choice of one really. We recommend you take advantage of [Home Assistant's own web server](https://www.home-assistant.io/integrations/http/#hosting-files) to provide the JSON definition. The advantage here are:
Setup for this menu is more complicated than the Connect IQ settings menu really allows you to specify. In order to make the dashboard easily configurable and easy to change, we have provided an external mechanism for specifying the menu layout, a JSON file you write, retrieved from a URL you specify. JSON was chosen over YAML because Garmin can parse JSON HTTP GET responses into its own internal dictionary, it cannot parse YAML, hence a choice of one really. Note that JSON and YAML are essentially a 1:1 format mapping except JSON does not have comments. We recommend you take advantage of [Home Assistant's own web server](https://www.home-assistant.io/integrations/http/#hosting-files) to provide the JSON definition. The advantage here are:
1. the file is as public as you make your Home Assistant,
2. the file is editable within Home Assistant via "Studio Code Server", and
@ -76,9 +75,15 @@ Example schema as shown in the images:
"type": "toggle"
},
{
"entity": "switch.crnr_tbl_usbs",
"name": "Corner Table USBs",
"entity": "automation.garage_door_check",
"name": "Garage Door Check",
"type": "toggle"
},
{
"entity": "scene.tv_light",
"name": "TV Lights Scene",
"type": "tap",
"service": "scene.turn_on"
}
]
}
@ -86,6 +91,16 @@ Example schema as shown in the images:
NB. Entity names are not real in case anyone's a hacker.
The example above illustrates how to configure:
* Light or switch toggles
* Automation enable toggles
* Script invocation (tap)
* Service invocation, e.g. Scene setting, (tap)
* A sub-menu to open (tap)
Possible future extensions might include specifying the alternative texts to use instead of "On" and "Off", e.g. "Locked" and "Unlocked" (but wouldn't having locks operated from your watch be a security concern ;-))
The [schema](https://raw.githubusercontent.com/house-of-abbey/GarminHomeAssistant/main/config.schema.json) is checked by using a URL directly back to this GitHub source repository, so you do not need to install that file. You can just copy & paste your entity names from the YAML configuration files used to configure Home Assistant. With a submenu, there's a difference between "title" and "name". The "name" goes on the menu item, and the "title" at the head of the submenu. If your dashboard definition fails to meet the schema, the application will simply drop items with the wrong field names without warning.
## API Key Creation
@ -101,7 +116,7 @@ Having created that token, before you dismiss the dialogue box with the value yo
<img src="images/GarminHomeAssistantSettings.png" width="400" title="Application Settings"/>
1. Paste your API key you've just created into the top field.
2. Add the URL for your Home Assistant API, e.g. `https://<homeassistant>/api/`.
2. Add the URL for your Home Assistant API, e.g. `https://<homeassistant>/api`. (No trailing slash `/`` character as one gets appended when creating the URL and you do not want two.)
3. Add the URL of your JSON file, e.g. `https://<homeassistant>/local/garmin/<something>.json`.
You should now have a working application on your watch and be able to operate your Home Assistant devices for as long as your watch is within Bluetooth range of your phone.
@ -116,8 +131,22 @@ The application will display a 'toast' showing Home Assistant's friendly name of
## External Device Changes
Home Assistant will inevitably change the state of devices you are also controlling via your Garmin. The Garmin application does not maintain a web socket to listen for changes. Instead it must poll the Home Assistant API with your key. Therefore the application is not responsive to changes, instead there will be a delay of about 5 seconds to pick up state changes. The thinking here is that the watch application will only ever be open briefly not persistently, so the delay in picking up state changes won't be observed often for any race condition between two controllers.
Home Assistant will inevitably change the state of devices you are also controlling via your Garmin. The Garmin application does not maintain a web socket to listen for changes. Instead it must poll the Home Assistant API with your key. Therefore the application is not that responsive to changes. Instead there will be a delay of multiples of 100 ms per item whose status needs to be checked and amended.
The per toggle item delay is caused by a queue of responses to web requests filling up a queue and giving a [Communications](https://developer.garmin.com/connect-iq/api-docs/Toybox/Communications.html).`BLE_QUEUE_FULL` response code. For a Venu 2 Garmin watch an API call delay of 600 ms was found to be sustainable (500 ms was still too fast). The code now chains a sequence of updates, so as one finishes it invokes the next item's update. The more items requiring a status update that you pack into your dashboard, the slower each individual item will be updated!
The thinking here is that the watch application will only ever be open briefly not persistently, so the delay in picking up state changes won't be observed often for any race condition between two controllers.
As a consequence of this update mechanism, if you request changes too quickly you will be notified that your device cannot keep up with the rate of API responses and you will have to dismiss the error in order to continue. The is a _feature not a bug_!
## Changes to the (JSON) Dashboard Definition
When you change the JSON file defining your dashboard, you must exit the application and the reopen it. It only takes a matter of a few seconds to pick up the new definition, but it is not automatic.
## Version History
| Version | Comment |
|:-------:|---------|
| 1.0 | Initial release for 26 devices. |
| 1.1 | Updated for 54 more devices, 80 in total. Scene support. Added vibrate acknowledgement for tap-based menu items. Falls back to a custom visual confirmation in the absence of 'toast' and vibrate support. Bug fix for large menus needing status updates. |
| 1.2 | Do not crash on zero items to update. Report unreachable URLs. Verify API URL does not have a trailing slash '/'. Increased HTTP response diagnosis. Reduced minimum API Level required from 3.3.0 to 3.1.0 to allow more device "part numbers" to be satisfied. |

View File

@ -8,12 +8,23 @@
"additionalProperties": false
},
"$defs": {
"item": {
"toggle": {
"type": "object",
"properties": {
"entity": { "$ref": "#/$defs/entity" },
"name": { "type": "string" },
"type": { "enum": ["toggle", "tap"] }
"type": { "const": "toggle" }
},
"required": ["entity", "name", "type"],
"additionalProperties": false
},
"tap": {
"type": "object",
"properties": {
"entity": { "$ref": "#/$defs/entity" },
"name": { "type": "string" },
"type": { "const": "tap" },
"service": { "$ref": "#/$defs/entity" }
},
"required": ["entity", "name", "type"],
"additionalProperties": false
@ -33,7 +44,11 @@
"items": {
"type": "array",
"items": {
"oneOf": [{ "$ref": "#/$defs/item" }, { "$ref": "#/$defs/menu" }]
"oneOf": [
{ "$ref": "#/$defs/toggle" },
{ "$ref": "#/$defs/tap" },
{ "$ref": "#/$defs/menu" }
]
}
},
"entity": {

View File

@ -48,14 +48,18 @@ original = (96, 48, 24)
lookup = {
# Doub Sing Half
# 0 1 2
# 416: (96, 48, 24),
390: (90, 46, 23),
360: (84, 42, 21),
320: (74, 38, 19),
280: (64, 32, 16),
260: (60, 30, 15),
240: (56, 28, 14),
218: (50, 26, 13),
454: (106, 53, 27),
# 416: ( 96, 48, 24),
390: ( 90, 46, 23),
360: ( 84, 42, 21),
320: ( 74, 38, 19),
280: ( 64, 32, 16),
260: ( 60, 30, 15),
240: ( 56, 28, 14),
218: ( 50, 26, 13),
208: ( 48, 24, 12),
176: ( 42, 21, 11),
156: ( 36, 18, 9)
}
# Delete all but the original 48x48 icon directories
@ -67,6 +71,8 @@ for entry in os.listdir("."):
for screen_size, icon_sizes in lookup.items():
output_dir = output_dir_prefix + str(icon_sizes[Sing])
print("\nCreate directory:", output_dir)
if os.path.exists(output_dir) and os.path.isdir(output_dir):
shutil.rmtree(output_dir)
os.makedirs(output_dir)
for entry in os.listdir(input_dir):
if entry.endswith(".svg"):

View File

@ -21,7 +21,7 @@
Use "Monkey C: Edit Application" from the Visual Studio Code command palette
to update the application attributes.
-->
<iq:application id="98c36259-498a-4458-9cef-74a273ad2bc3" type="watch-app" name="@Strings.AppName" entry="HomeAssistantApp" launcherIcon="@Drawables.LauncherIcon" minApiLevel="3.3.0">
<iq:application id="40131e87-31ff-454b-a8e2-92276ee399d6" type="watch-app" name="@Strings.AppName" entry="HomeAssistantApp" launcherIcon="@Drawables.LauncherIcon" minApiLevel="3.1.0">
<!--
Use the following from the Visual Studio Code comand palette to edit
the build targets:
@ -30,19 +30,102 @@
"Monkey C: Edit Products" - Lets you add or remove any product
-->
<iq:products>
<!--
Device Information & References:
* https://developer.garmin.com/connect-iq/compatible-devices/
* https://developer.garmin.com/connect-iq/reference-guides/devices-reference/
-->
<!-- Screen Size 390x390 launcher icon size 70x70 -->
<iq:product id="approachs7042mm"/>
<!-- Screen Size 454x454 launcher icon size 80x80 -->
<iq:product id="approachs7047mm"/>
<!-- Screen Size 176x176 launcher icon size 62x62 -->
<iq:product id="descentg1"/>
<!-- Screen Size 280x280 launcher icon size 40x40 -->
<iq:product id="descentmk2"/>
<!-- Screen Size 240x240 launcher icon size 40x40 -->
<iq:product id="descentmk2s"/>
<!-- Screen Size 416x416 launcher icon size 70x70 -->
<iq:product id="d2airx10"/>
<!-- Screen Size 416x416 launcher icon size 60x60 -->
<iq:product id="d2mach1"/>
<!-- Screen Size 282x470 launcher icon size 36x36 -->
<iq:product id="edge1030"/>
<iq:product id="edge1030bontrager"/>
<iq:product id="edge1030plus"/>
<!-- Screen Size 282x470 launcher icon size 40x40 -->
<iq:product id="edge1040"/>
<!-- Screen Size 246x322 launcher icon size 35x35 -->
<iq:product id="edge530"/>
<iq:product id="edge830"/>
<!-- Screen Size 240x400 launcher icon size 36x36 -->
<iq:product id="edgeexplore2"/>
<!-- Screen Size 280x280 launcher icon size 40x40 -->
<iq:product id="enduro"/>
<!-- Screen Size 416x416 launcher icon size 60x60 -->
<iq:product id="epix2"/>
<!-- Screen Size 390x390 launcher icon size 60x60 -->
<iq:product id="epix2pro42mm"/>
<iq:product id="epix2pro47mm"/>
<!-- Screen Size 454x454 launcher icon size 60x60 -->
<iq:product id="epix2pro51mm"/>
<!-- Screen Size 240x240 launcher icon size 40x40 -->
<iq:product id="fenix5plus"/>
<iq:product id="fenix5splus"/>
<iq:product id="fenix5xplus"/>
<!-- Screen Size 260x260 launcher icon size 40x40 -->
<iq:product id="fenix6"/>
<iq:product id="fenix6pro"/>
<!-- Screen Size 240x240 launcher icon size 40x40 -->
<iq:product id="fenix6s"/>
<iq:product id="fenix6spro"/>
<!-- Screen Size 280x280 launcher icon size 40x40 -->
<iq:product id="fenix6xpro"/>
<!-- Screen Size 260x260 launcher icon size 40x40 -->
<iq:product id="fenix7"/>
<!-- Screen Size 260x260 launcher icon size 40x40 -->
<iq:product id="fenix7pro"/>
<iq:product id="fenix7pronowifi"/>
<!-- Screen Size 240x240 launcher icon size 40x40 -->
<iq:product id="fenix7s"/>
<!-- Screen Size 240x240 launcher icon size 40x40 -->
<iq:product id="fenix7spro"/>
<!-- Screen Size 280x280 launcher icon size 40x40 -->
<iq:product id="fenix7x"/>
<!-- Screen Size 280x280 launcher icon size 40x40 -->
<iq:product id="fenix7xpro"/>
<iq:product id="fenix7xpronowifi"/>
<!-- Screen Size 240x240 launcher icon size 40x40 -->
<iq:product id="fr245"/>
<iq:product id="fr245m"/>
<!-- Screen Size 260x260 launcher icon size 40x40 -->
<iq:product id="fr255"/>
<iq:product id="fr255m"/>
<!-- Screen Size 218x218 launcher icon size 40x40 -->
<iq:product id="fr255s"/>
<iq:product id="fr255sm"/>
<!-- Screen Size 416x416 launcher icon size 60x60 -->
<iq:product id="fr265"/>
<iq:product id="fr265s"/>
<!-- Screen Size 208x208 launcher icon size 35x35 -->
<iq:product id="fr55"/>
<!-- Screen Size 240x240 launcher icon size 40x40 -->
<iq:product id="fr745"/>
<iq:product id="fr945"/>
<iq:product id="fr945lte"/>
<!-- Screen Size 260x260 launcher icon size 40x40 -->
<iq:product id="fr955"/>
<!-- Screen Size 454x454 launcher icon size 65x65 -->
<iq:product id="fr965"/>
<!-- Screen Size 176x176 launcher icon size 62x62 -->
<iq:product id="instinct2"/>
<!-- Screen Size 163x156 launcher icon size 54x54 -->
<iq:product id="instinct2s"/>
<!-- Screen Size 176x176 launcher icon size 62x62 -->
<iq:product id="instinct2x"/>
<!-- Screen Size 176x176 launcher icon size 26x26 -->
<iq:product id="instinctcrossover"/>
<!-- Screen Size 218x218 launcher icon size 30x30 -->
<iq:product id="legacyherocaptainmarvel"/>
<!-- Screen Size 260x260 launcher icon size 35x35 -->
@ -50,6 +133,15 @@
<iq:product id="legacysagadarthvader"/>
<!-- Screen Size 218x218 launcher icon size 30x30 -->
<iq:product id="legacysagarey"/>
<!-- Screen Size 240x240 launcher icon size 40x40 -->
<iq:product id="marqadventurer"/>
<iq:product id="marqathlete"/>
<iq:product id="marqaviator"/>
<iq:product id="marqcaptain"/>
<iq:product id="marqcommander"/>
<iq:product id="marqdriver"/>
<iq:product id="marqexpedition"/>
<iq:product id="marqgolfer"/>
<!-- Screen Size 390x390 launcher icon size 60x60 -->
<iq:product id="marq2"/>
<iq:product id="marq2aviator"/>
@ -66,10 +158,16 @@
<!-- Screen Size 320x360 launcher icon size 40x40 -->
<iq:product id="venusq2"/>
<iq:product id="venusq2m"/>
<!-- Screen Size 454x454 launcher icon size 70x70 -->
<iq:product id="venu3"/>
<!-- Screen Size 390x390 launcher icon size 70x70 -->
<iq:product id="venu3s"/>
<!-- Screen Size 260x260 launcher icon size 35x35 -->
<iq:product id="vivoactive4"/>
<!-- Screen Size 218x218 launcher icon size 30x30 -->
<iq:product id="vivoactive4s"/>
<!-- Screen Size 390x390 launcher icon size 70x70 -->
<iq:product id="vivoactive5"/>
</iq:products>
<!--
Use "Monkey C: Edit Permissions" from the Visual Studio Code command

View File

@ -18,31 +18,112 @@
project.manifest = manifest.xml
# Device References
# * https://developer.garmin.com/connect-iq/compatible-devices/
# * https://developer.garmin.com/connect-iq/reference-guides/devices-reference/
#
# Widget launcher icon, multiple resolutions
# https://forums.garmin.com/developer/connect-iq/f/discussion/255433/widget-launcher-icon-multiple-resolutions/1563305
#
# Use the online SVG converter to write out PNGs from "resources\drawables\launcher.svg" by changing
# the 'width' and 'height' attributes of the SVG.
# https://svgtopng.com/
#
# The icons need to scale as a ratio of screen size 48:416 pixels
#
# Icon 48 45 42 37 32 30 28 25
# Screen 416 390 360 320 280 260 240 218
# Icon 53 48 46 42 37 32 30 28 26 24 21 18
# Screen 454 416 390 360 320 280 260 240 218 208 176 156
# Screen Size 390x390 launcher icon size 70x70
approachs7042mm.resourcePath = $(approachs7042mm.resourcePath);resources-launcher-70-70;resources-icons-46
# Screen Size 454x454 launcher icon size 80x80
approachs7047mm.resourcePath = $(approachs7047mm.resourcePath);resources-launcher-80-80;resources-icons-53
# Screen Size 176x176 launcher icon size 62x62
descentg1.resourcePath = $(descentg1.resourcePath);resources-launcher-62-62;resources-icons-21
# Screen Size 280x280 launcher icon size 40x40
descentmk2.resourcePath = $(descentmk2.resourcePath);resources-launcher-40-40;resources-icons-32
# Screen Size 240x240 launcher icon size 40x40
descentmk2s.resourcePath = $(descentmk2s.resourcePath);resources-launcher-40-40;resources-icons-28
# Screen Size 282x470 launcher icon size 36x36
edge1030.resourcePath = $(descentmk2s.resourcePath);resources-launcher-36-36;resources-icons-32
edge1030bontrager.resourcePath = $(edge1030bontrager.resourcePath);resources-launcher-36-36;resources-icons-32
edge1030plus.resourcePath = $(edge1030plus.resourcePath);resources-launcher-36-36;resources-icons-32
# Screen Size 282x470 launcher icon size 40x40
edge1040.resourcePath = $(edge1040.resourcePath);resources-launcher-40-40;resources-icons-32
# Screen Size 246x322 launcher icon size 35x35
edge530.resourcePath = $(edge530.resourcePath);resources-launcher-35-35;resources-icons-28
edge830.resourcePath = $(edge830.resourcePath);resources-launcher-35-35;resources-icons-28
# Screen Size 240x400 launcher icon size 36x36
edgeexplore2.resourcePath = $(edgeexplore2.resourcePath);resources-launcher-36-36;resources-icons-28
# Screen Size 280x280 launcher icon size 40x40
enduro.resourcePath = $(enduro.resourcePath);resources-launcher-40-40;resources-icons-32
# Screen Size 416x416 launcher icon size 70x70
d2airx10.resourcePath = $(d2airx10.resourcePath);resources-launcher-70-70;resources-icons-48
# Screen Size 416x416 launcher icon size 60x60
d2mach1.resourcePath = $(d2mach1.resourcePath);resources-launcher-60-60;resources-icons-48
# Screen Size 416x416 launcher icon size 60x60
epix2.resourcePath = $(epix2.resourcePath);resources-launcher-60-60;resources-icons-48
# Screen Size 390x390 launcher icon size 60x60
epix2pro42mm.resourcePath = $(epix2pro42mm.resourcePath);resources-launcher-60-60;resources-icons-46
epix2pro47mm.resourcePath = $(epix2pro47mm.resourcePath);resources-launcher-60-60;resources-icons-46
# Screen Size 454x454 launcher icon size 60x60
epix2pro51mm.resourcePath = $(epix2pro51mm.resourcePath);resources-launcher-60-60;resources-icons-53
# Screen Size 240x240 launcher icon size 40x40
fenix5plus.resourcePath = $(fenix5plus.resourcePath);resources-launcher-40-40;resources-icons-28
fenix5splus.resourcePath = $(fenix5splus.resourcePath);resources-launcher-40-40;resources-icons-28
fenix5xplus.resourcePath = $(fenix5xplus.resourcePath);resources-launcher-40-40;resources-icons-28
# Screen Size 260x260 launcher icon size 40x40
fenix6.resourcePath = $(fenix6.resourcePath);resources-launcher-40-40;resources-icons-30
fenix6pro.resourcePath = $(fenix6pro.resourcePath);resources-launcher-40-40;resources-icons-30
# Screen Size 240x240 launcher icon size 40x40
fenix6s.resourcePath = $(fenix6s.resourcePath);resources-launcher-40-40;resources-icons-28
fenix6spro.resourcePath = $(fenix6spro.resourcePath);resources-launcher-40-40;resources-icons-28
# Screen Size 280x280 launcher icon size 40x40
fenix6xpro.resourcePath = $(fenix6xpro.resourcePath);resources-launcher-40-40;resources-icons-32
# Screen Size 260x260 launcher icon size 40x40
fenix7.resourcePath = $(fenix7.resourcePath);resources-launcher-40-40;resources-icons-30
# Screen Size 260x260 launcher icon size 40x40
fenix7pro.resourcePath = $(fenix7pro.resourcePath);resources-launcher-40-40;resources-icons-30
fenix7pronowifi.resourcePath = $(fenix7pronowifi.resourcePath);resources-launcher-40-40;resources-icons-30
# Screen Size 240x240 launcher icon size 40x40
fenix7s.resourcePath = $(fenix7s.resourcePath);resources-launcher-40-40;resources-icons-28
# Screen Size 240x240 launcher icon size 40x40
fenix7spro.resourcePath = $(fenix7spro.resourcePath);resources-launcher-40-40;resources-icons-28
# Screen Size 280x280 launcher icon size 40x40
fenix7x.resourcePath = $(fenix7x.resourcePath);resources-launcher-40-40;resources-icons-32
# Screen Size 280x280 launcher icon size 40x40
fenix7xpro.resourcePath = $(fenix7xpro.resourcePath);resources-launcher-40-40;resources-icons-32
fenix7xpronowifi.resourcePath = $(fenix7xpronowifi.resourcePath);resources-launcher-40-40;resources-icons-32
# Screen Size 240x240 launcher icon size 40x40
fr245.resourcePath = $(fr245.resourcePath);resources-launcher-40-40;resources-icons-28
fr245m.resourcePath = $(fr245m.resourcePath);resources-launcher-40-40;resources-icons-28
# Screen Size 260x260 launcher icon size 40x40
fr255.resourcePath = $(fr255.resourcePath);resources-launcher-40-40;resources-icons-30
fr255m.resourcePath = $(fr255m.resourcePath);resources-launcher-40-40;resources-icons-30
# Screen Size 218x218 launcher icon size 40x40
fr255s.resourcePath = $(fr255s.resourcePath);resources-launcher-40-40;resources-icons-26
fr255sm.resourcePath = $(fr255sm.resourcePath);resources-launcher-40-40;resources-icons-26
# Screen Size 416x416 launcher icon size 60x60
fr265.resourcePath = $(fr265.resourcePath);resources-launcher-60-60;resources-icons-48
fr265s.resourcePath = $(fr265s.resourcePath);resources-launcher-60-60;resources-icons-48
# Screen Size 208x208 launcher icon size 35x35
fr55.resourcePath = $(fr55.resourcePath);resources-launcher-35-35;resources-icons-24
# Screen Size 240x240 launcher icon size 40x40
fr745.resourcePath = $(fr745.resourcePath);resources-launcher-40-40;resources-icons-28
fr945.resourcePath = $(fr945.resourcePath);resources-launcher-40-40;resources-icons-28
fr945lte.resourcePath = $(fr945lte.resourcePath);resources-launcher-40-40;resources-icons-28
# Screen Size 260x260 launcher icon size 40x40
fr955.resourcePath = $(fr955.resourcePath);resources-launcher-40-40;resources-icons-30
# Screen Size 454x454 launcher icon size 65x65
fr965.resourcePath = $(fr965.resourcePath);resources-launcher-65-65;resources-icons-53
# Screen Size 176x176 launcher icon size 62x62
instinct2.resourcePath = $(instinct2.resourcePath);resources-launcher-62-62;resources-icons-21
# Screen Size 163x156 launcher icon size 54x54
instinct2s.resourcePath = $(instinct2s.resourcePath);resources-launcher-54-54;resources-icons-18
# Screen Size 176x176 launcher icon size 62x62
instinct2x.resourcePath = $(instinct2x.resourcePath);resources-launcher-62-62;resources-icons-21
# Screen Size 176x176 launcher icon size 26x26
instinctcrossover.resourcePath = $(instinctcrossover.resourcePath);resources-launcher-26-26;resources-icons-21
# Screen Size 218x218 launcher icon size 30x30
legacyherocaptainmarvel.resourcePath = $(legacyherocaptainmarvel.resourcePath);resources-launcher-30-30;resources-icons-26
# Screen Size 260x260 launcher icon size 35x35
@ -50,6 +131,15 @@ legacyherofirstavenger.resourcePath = $(legacyherofirstavenger.resourcePath);res
legacysagadarthvader.resourcePath = $(legacysagadarthvader.resourcePath);resources-launcher-35-35;resources-icons-30
# Screen Size 218x218 launcher icon size 30x30
legacysagarey.resourcePath = $(legacysagarey.resourcePath);resources-launcher-30-30;resources-icons-26
# Screen Size 240x240 launcher icon size 40x40
marqadventurer.resourcePath = $(marqadventurer.resourcePath);resources-launcher-40-40;resources-icons-28
marqathlete.resourcePath = $(marqathlete.resourcePath);resources-launcher-40-40;resources-icons-28
marqaviator.resourcePath = $(marqaviator.resourcePath);resources-launcher-40-40;resources-icons-28
marqcaptain.resourcePath = $(marqcaptain.resourcePath);resources-launcher-40-40;resources-icons-28
marqcommander.resourcePath = $(marqcommander.resourcePath);resources-launcher-40-40;resources-icons-28
marqdriver.resourcePath = $(marqdriver.resourcePath);resources-launcher-40-40;resources-icons-28
marqexpedition.resourcePath = $(marqexpedition.resourcePath);resources-launcher-40-40;resources-icons-28
marqgolfer.resourcePath = $(marqgolfer.resourcePath);resources-launcher-40-40;resources-icons-28
# Screen Size 390x390 launcher icon size 60x60
marq2.resourcePath = $(marq2.resourcePath);resources-launcher-60-60;resources-icons-46
marq2aviator.resourcePath = $(marq2aviator.resourcePath);resources-launcher-60-60;resources-icons-46
@ -66,7 +156,13 @@ venusqm.resourcePath = $(venusqm.resourcePath);resources-launcher-36-36;resource
# Screen Size 320x360 launcher icon size 40x40
venusq2.resourcePath = $(venusq2.resourcePath);resources-launcher-40-40;resources-icons-38
venusq2m.resourcePath = $(venusq2m.resourcePath);resources-launcher-40-40;resources-icons-38
# Screen Size 454x454 launcher icon size 70x70
venu3.resourcePath = $(venu3.resourcePath);resources-launcher-70-70;resources-icons-53
# Screen Size 390x390 launcher icon size 70x70
venu3s.resourcePath = $(venu3s.resourcePath);resources-launcher-70-70;resources-icons-46
# Screen Size 260x260 launcher icon size 35x35
vivoactive4.resourcePath = $(vivoactive4.resourcePath);resources-launcher-35-35;resources-icons-30
# Screen Size 218x218 launcher icon size 30x30
vivoactive4s.resourcePath = $(vivoactive4s.resourcePath);resources-launcher-30-30;resources-icons-26
# Screen Size 390x390 launcher icon size 70x70
vivoactive5.resourcePath = $(vivoactive5.resourcePath);resources-launcher-70-70;resources-icons-46

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">قائمة طعام</string>
<string id="NoInternet">لا يوجد اتصال بالإنترنت</string>
<string id="NoMenu">خطأ في إحضار القائمة</string>
<string id="NoAPIKey">لا يوجد مفتاح API في إعدادات التطبيق</string>
<string id="NoApiUrl">لا يوجد عنوان URL لواجهة برمجة التطبيقات في إعدادات التطبيق</string>
<string id="NoConfigUrl">لا يوجد عنوان URL للتكوين في إعدادات التطبيق</string>
<string id="ApiFlood">مكالمات API سريعة جدًا. يرجى إبطاء طلباتك.</string>
<string id="ApiUrlNotFound">لم يتم العثور على عنوان URL. خطأ محتمل في عنوان URL لواجهة برمجة التطبيقات في الإعدادات.</string>
<string id="ConfigUrlNotFound">لم يتم العثور على عنوان URL. خطأ محتمل في عنوان URL للتكوين في الإعدادات.</string>
<string id="UnhandledHttpErr">قام طلب HTTP بإرجاع رمز الخطأ =</string>
<string id="TrailingSlashErr">يجب ألا يحتوي عنوان URL لواجهة برمجة التطبيقات على شرطة مائلة لاحقة '/'</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Меню</string>
<string id="NoInternet">Няма интернет връзка</string>
<string id="NoMenu">Грешка при извличане на менюто</string>
<string id="NoAPIKey">Няма API ключ в настройките на приложението</string>
<string id="NoApiUrl">Няма URL адрес на API в настройките на приложението</string>
<string id="NoConfigUrl">Няма конфигурационен URL адрес в настройките на приложението</string>
<string id="ApiFlood">Извикванията на API са твърде бързи. Моля, забавете вашите заявки.</string>
<string id="ApiUrlNotFound">URL не е намерен. Потенциална грешка в URL адреса на API в настройките.</string>
<string id="ConfigUrlNotFound">URL не е намерен. Потенциална грешка в URL адреса на конфигурацията в настройките.</string>
<string id="UnhandledHttpErr">HTTP заявката върна код на грешка =</string>
<string id="TrailingSlashErr">URL адресът на API не трябва да има наклонена черта '/' в края</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Jídelní lístek</string>
<string id="NoInternet">Žádné internetové připojení</string>
<string id="NoMenu">Chyba načítání nabídky</string>
<string id="NoAPIKey">V nastavení aplikace není žádný klíč API</string>
<string id="NoApiUrl">V nastavení aplikace není žádná adresa URL API</string>
<string id="NoConfigUrl">V nastavení aplikace není žádná konfigurační URL</string>
<string id="ApiFlood">Příliš rychlá volání API. Zpomalte prosím své požadavky.</string>
<string id="ApiUrlNotFound">Adresa URL nenalezena. Potenciální chyba adresy URL rozhraní API v nastavení.</string>
<string id="ConfigUrlNotFound">Adresa URL nenalezena. Potenciální chyba konfigurační adresy URL v nastavení.</string>
<string id="UnhandledHttpErr">Požadavek HTTP vrátil kód chyby =</string>
<string id="TrailingSlashErr">Adresa URL rozhraní API nesmí mít koncové lomítko „/“</string>
</strings>

View File

@ -25,5 +25,13 @@
<string id="MenuItemTap">Tryk på</string>
<string id="MenuItemMenu">Menu</string>
<string id="NoInternet">Ingen internetforbindelse</string>
<string id="NoMenu">Fejl ved menuhentning</string>
<string id="NoMenu">Menuhentningsfejl</string>
<string id="NoAPIKey">Ingen API-nøgle i applikationsindstillingerne</string>
<string id="NoApiUrl">Ingen API-URL i applikationsindstillingerne</string>
<string id="NoConfigUrl">Ingen konfigurations-URL i applikationsindstillingerne</string>
<string id="ApiFlood">API-kald for hurtigt. Sænk venligst dine anmodninger.</string>
<string id="ApiUrlNotFound">URL ikke fundet. Potentiel API URL-fejl i indstillinger.</string>
<string id="ConfigUrlNotFound">URL ikke fundet. Potentiel konfigurations-URL-fejl i indstillinger.</string>
<string id="UnhandledHttpErr">HTTP-anmodning returnerede fejlkode =</string>
<string id="TrailingSlashErr">API URL må ikke have en efterfølgende skråstreg '/'</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Speisekarte</string>
<string id="NoInternet">Keine Internetverbindung</string>
<string id="NoMenu">Fehler beim Abrufen des Menüs</string>
<string id="NoAPIKey">Kein API-Schlüssel in den Anwendungseinstellungen</string>
<string id="NoApiUrl">Keine API-URL in den Anwendungseinstellungen</string>
<string id="NoConfigUrl">Keine Konfigurations-URL in den Anwendungseinstellungen</string>
<string id="ApiFlood">API-Aufrufe zu schnell. Bitte verlangsamen Sie Ihre Anfragen.</string>
<string id="ApiUrlNotFound">URL nicht gefunden. Möglicher API-URL-Fehler in den Einstellungen.</string>
<string id="ConfigUrlNotFound">URL nicht gefunden. Möglicher Konfigurations-URL-Fehler in den Einstellungen.</string>
<string id="UnhandledHttpErr">Die HTTP-Anfrage hat den Fehlercode = zurückgegeben</string>
<string id="TrailingSlashErr">Die API-URL darf keinen abschließenden Schrägstrich „/“ enthalten.</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Menu</string>
<string id="NoInternet">Geen internet verbinding</string>
<string id="NoMenu">Fout bij ophalen van menu</string>
<string id="NoAPIKey">Geen API-sleutel in de applicatie-instellingen</string>
<string id="NoApiUrl">Geen API-URL in de applicatie-instellingen</string>
<string id="NoConfigUrl">Geen configuratie-URL in de applicatie-instellingen</string>
<string id="ApiFlood">API-aanroepen te snel. Vertraag uw verzoeken.</string>
<string id="ApiUrlNotFound">URL niet gevonden. Mogelijke API-URL-fout in instellingen.</string>
<string id="ConfigUrlNotFound">URL niet gevonden. Mogelijke configuratie-URL-fout in de instellingen.</string>
<string id="UnhandledHttpErr">HTTP-verzoek retourneerde foutcode =</string>
<string id="TrailingSlashErr">API-URL mag geen afsluitende slash '/' bevatten</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Menüü</string>
<string id="NoInternet">Interneti-ühendus puudub</string>
<string id="NoMenu">Menüü toomise viga</string>
<string id="NoAPIKey">Rakenduse seadetes pole API-võtit</string>
<string id="NoApiUrl">Rakenduse seadetes pole API URL-i</string>
<string id="NoConfigUrl">Rakenduse seadetes pole konfiguratsiooni URL-i</string>
<string id="ApiFlood">API-kutsed liiga kiired. Palun aeglustage taotluste esitamist.</string>
<string id="ApiUrlNotFound">URL-i ei leitud. Võimalik API URL-i viga seadetes.</string>
<string id="ConfigUrlNotFound">URL-i ei leitud. Võimalik konfiguratsiooni URL-i viga seadetes.</string>
<string id="UnhandledHttpErr">HTTP päring tagastas veakoodi =</string>
<string id="TrailingSlashErr">API URL-i lõpus ei tohi olla kaldkriipsu „/”</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Valikko</string>
<string id="NoInternet">Ei Internet-yhteyttä</string>
<string id="NoMenu">Valikkohakuvirhe</string>
<string id="NoAPIKey">Sovellusasetuksissa ei ole API-avainta</string>
<string id="NoApiUrl">Sovellusasetuksissa ei ole API URL-osoitetta</string>
<string id="NoConfigUrl">Sovelluksen asetuksissa ei ole konfigurointi-URL-osoitetta</string>
<string id="ApiFlood">API-kutsut liian nopeita. Hidasta pyyntöjäsi.</string>
<string id="ApiUrlNotFound">URL-osoitetta ei löydy. Mahdollinen API URL -virhe asetuksissa.</string>
<string id="ConfigUrlNotFound">URL-osoitetta ei löydy. Mahdollinen konfigurointi-URL-virhe asetuksissa.</string>
<string id="UnhandledHttpErr">HTTP-pyyntö palautti virhekoodin =</string>
<string id="TrailingSlashErr">API-URL-osoitteessa ei saa olla perässä olevaa kauttaviivaa '/'</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Menu</string>
<string id="NoInternet">Pas de connexion Internet</string>
<string id="NoMenu">Erreur de récupération du menu</string>
<string id="NoAPIKey">Pas de clé API dans les paramètres de l'application</string>
<string id="NoApiUrl">Aucune URL API dans les paramètres de l'application</string>
<string id="NoConfigUrl">Aucune URL de configuration dans les paramètres de l'application</string>
<string id="ApiFlood">Appels API trop rapides. Veuillez ralentir vos demandes.</string>
<string id="ApiUrlNotFound">URL introuvable. Erreur potentielle d'URL d'API dans les paramètres.</string>
<string id="ConfigUrlNotFound">URL introuvable. Erreur potentielle d'URL de configuration dans les paramètres.</string>
<string id="UnhandledHttpErr">La requête HTTP a renvoyé un code d'erreur =</string>
<string id="TrailingSlashErr">L'URL de l'API ne doit pas comporter de barre oblique finale '/'</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Μενού</string>
<string id="NoInternet">Δεν υπάρχει σύνδεση στο διαδίκτυο</string>
<string id="NoMenu">Σφάλμα ανάκτησης μενού</string>
<string id="NoAPIKey">Δεν υπάρχει κλειδί API στις ρυθμίσεις της εφαρμογής</string>
<string id="NoApiUrl">Δεν υπάρχει URL API στις ρυθμίσεις της εφαρμογής</string>
<string id="NoConfigUrl">Δεν υπάρχει διεύθυνση URL διαμόρφωσης στις ρυθμίσεις της εφαρμογής</string>
<string id="ApiFlood">Κλήσεις API πολύ γρήγορες. Παρακαλώ επιβραδύνετε τα αιτήματά σας.</string>
<string id="ApiUrlNotFound">Η διεύθυνση URL δεν βρέθηκε. Πιθανό σφάλμα διεύθυνσης URL API στις ρυθμίσεις.</string>
<string id="ConfigUrlNotFound">Η διεύθυνση URL δεν βρέθηκε. Πιθανό σφάλμα διεύθυνσης URL διαμόρφωσης στις ρυθμίσεις.</string>
<string id="UnhandledHttpErr">Το αίτημα HTTP επέστρεψε κωδικό σφάλματος =</string>
<string id="TrailingSlashErr">Η διεύθυνση URL του API δεν πρέπει να έχει τελική κάθετο "/"</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">תַפרִיט</string>
<string id="NoInternet">אין חיבור אינטרנט</string>
<string id="NoMenu">שגיאת אחזור תפריט</string>
<string id="NoAPIKey">אין מפתח API בהגדרות האפליקציה</string>
<string id="NoApiUrl">אין כתובת API בהגדרות האפליקציה</string>
<string id="NoConfigUrl">אין כתובת אתר תצורה בהגדרות האפליקציה</string>
<string id="ApiFlood">קריאות API מהירות מדי. נא להאט את הבקשות שלך.</string>
<string id="ApiUrlNotFound">כתובת האתר לא נמצאה. שגיאה פוטנציאלית של כתובת ה-API בהגדרות.</string>
<string id="ConfigUrlNotFound">כתובת האתר לא נמצאה. שגיאת כתובת אתר פוטנציאלית של תצורה בהגדרות.</string>
<string id="UnhandledHttpErr">בקשת HTTP החזירה קוד שגיאה =</string>
<string id="TrailingSlashErr">כתובת ה-API לא חייבת לכלול לוכסן אחורי '/'</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Jelovnik</string>
<string id="NoInternet">Nema internetske veze</string>
<string id="NoMenu">Pogreška dohvaćanja izbornika</string>
<string id="NoAPIKey">Nema API ključa u postavkama aplikacije</string>
<string id="NoApiUrl">Nema API URL-a u postavkama aplikacije</string>
<string id="NoConfigUrl">Nema konfiguracijskog URL-a u postavkama aplikacije</string>
<string id="ApiFlood">API pozivi su prebrzi. Molimo usporite svoje zahtjeve.</string>
<string id="ApiUrlNotFound">URL nije pronađen. Potencijalna pogreška API URL-a u postavkama.</string>
<string id="ConfigUrlNotFound">URL nije pronađen. Potencijalna pogreška URL-a konfiguracije u postavkama.</string>
<string id="UnhandledHttpErr">HTTP zahtjev vratio je kod greške =</string>
<string id="TrailingSlashErr">API URL ne smije imati kosu crtu na kraju '/'</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Menü</string>
<string id="NoInternet">Nincs internetkapcsolat</string>
<string id="NoMenu">Menü Lekérési hiba</string>
<string id="NoAPIKey">Nincs API kulcs az alkalmazás beállításaiban</string>
<string id="NoApiUrl">Nincs API URL az alkalmazás beállításai között</string>
<string id="NoConfigUrl">Nincs konfigurációs URL az alkalmazás beállításai között</string>
<string id="ApiFlood">Az API-hívások túl gyorsak. Kérjük, lassítsa a kérések teljesítését.</string>
<string id="ApiUrlNotFound">Az URL nem található. Lehetséges API URL hiba a beállításokban.</string>
<string id="ConfigUrlNotFound">Az URL nem található. Lehetséges konfigurációs URL hiba a beállításokban.</string>
<string id="UnhandledHttpErr">A HTTP-kérés = hibakódot adott vissza</string>
<string id="TrailingSlashErr">Az API URL-ben nem lehet perjel a „/”</string>
</strings>

View File

@ -0,0 +1,20 @@
<!--
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.
J D Abbey & P A Abbey, 28 December 2022
References:
* https://fonts.google.com/icons
-->
<drawables>
<bitmap id="ErrorIcon" filename="error.svg"/>
</drawables>

View File

@ -0,0 +1 @@
<svg height="18" viewBox="0 0 48 48" width="18" xmlns="http://www.w3.org/2000/svg"><path d="M24 34q.7 0 1.175-.475.475-.475.475-1.175 0-.7-.475-1.175Q24.7 30.7 24 30.7q-.7 0-1.175.475-.475.475-.475 1.175 0 .7.475 1.175Q23.3 34 24 34Zm-1.35-7.65h3V13.7h-3ZM24 44q-4.1 0-7.75-1.575-3.65-1.575-6.375-4.3-2.725-2.725-4.3-6.375Q4 28.1 4 23.95q0-4.1 1.575-7.75 1.575-3.65 4.3-6.35 2.725-2.7 6.375-4.275Q19.9 4 24.05 4q4.1 0 7.75 1.575 3.65 1.575 6.35 4.275 2.7 2.7 4.275 6.35Q44 19.85 44 24q0 4.1-1.575 7.75-1.575 3.65-4.275 6.375t-6.35 4.3Q28.15 44 24 44Zm.05-3q7.05 0 12-4.975T41 23.95q0-7.05-4.95-12T24 7q-7.05 0-12.025 4.95Q7 16.9 7 24q0 7.05 4.975 12.025Q16.95 41 24.05 41ZM24 24Z" fill="red" stroke="red"/></svg>

After

Width:  |  Height:  |  Size: 712 B

View File

@ -0,0 +1,20 @@
<!--
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.
J D Abbey & P A Abbey, 28 December 2022
References:
* https://fonts.google.com/icons
-->
<drawables>
<bitmap id="ErrorIcon" filename="error.svg"/>
</drawables>

View File

@ -0,0 +1 @@
<svg height="21" viewBox="0 0 48 48" width="21" xmlns="http://www.w3.org/2000/svg"><path d="M24 34q.7 0 1.175-.475.475-.475.475-1.175 0-.7-.475-1.175Q24.7 30.7 24 30.7q-.7 0-1.175.475-.475.475-.475 1.175 0 .7.475 1.175Q23.3 34 24 34Zm-1.35-7.65h3V13.7h-3ZM24 44q-4.1 0-7.75-1.575-3.65-1.575-6.375-4.3-2.725-2.725-4.3-6.375Q4 28.1 4 23.95q0-4.1 1.575-7.75 1.575-3.65 4.3-6.35 2.725-2.7 6.375-4.275Q19.9 4 24.05 4q4.1 0 7.75 1.575 3.65 1.575 6.35 4.275 2.7 2.7 4.275 6.35Q44 19.85 44 24q0 4.1-1.575 7.75-1.575 3.65-4.275 6.375t-6.35 4.3Q28.15 44 24 44Zm.05-3q7.05 0 12-4.975T41 23.95q0-7.05-4.95-12T24 7q-7.05 0-12.025 4.95Q7 16.9 7 24q0 7.05 4.975 12.025Q16.95 41 24.05 41ZM24 24Z" fill="red" stroke="red"/></svg>

After

Width:  |  Height:  |  Size: 712 B

View File

@ -0,0 +1,20 @@
<!--
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.
J D Abbey & P A Abbey, 28 December 2022
References:
* https://fonts.google.com/icons
-->
<drawables>
<bitmap id="ErrorIcon" filename="error.svg"/>
</drawables>

View File

@ -0,0 +1 @@
<svg height="24" viewBox="0 0 48 48" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M24 34q.7 0 1.175-.475.475-.475.475-1.175 0-.7-.475-1.175Q24.7 30.7 24 30.7q-.7 0-1.175.475-.475.475-.475 1.175 0 .7.475 1.175Q23.3 34 24 34Zm-1.35-7.65h3V13.7h-3ZM24 44q-4.1 0-7.75-1.575-3.65-1.575-6.375-4.3-2.725-2.725-4.3-6.375Q4 28.1 4 23.95q0-4.1 1.575-7.75 1.575-3.65 4.3-6.35 2.725-2.7 6.375-4.275Q19.9 4 24.05 4q4.1 0 7.75 1.575 3.65 1.575 6.35 4.275 2.7 2.7 4.275 6.35Q44 19.85 44 24q0 4.1-1.575 7.75-1.575 3.65-4.275 6.375t-6.35 4.3Q28.15 44 24 44Zm.05-3q7.05 0 12-4.975T41 23.95q0-7.05-4.95-12T24 7q-7.05 0-12.025 4.95Q7 16.9 7 24q0 7.05 4.975 12.025Q16.95 41 24.05 41ZM24 24Z" fill="red" stroke="red"/></svg>

After

Width:  |  Height:  |  Size: 712 B

View File

@ -0,0 +1,20 @@
<!--
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.
J D Abbey & P A Abbey, 28 December 2022
References:
* https://fonts.google.com/icons
-->
<drawables>
<bitmap id="ErrorIcon" filename="error.svg"/>
</drawables>

View File

@ -0,0 +1 @@
<svg height="53" viewBox="0 0 48 48" width="53" xmlns="http://www.w3.org/2000/svg"><path d="M24 34q.7 0 1.175-.475.475-.475.475-1.175 0-.7-.475-1.175Q24.7 30.7 24 30.7q-.7 0-1.175.475-.475.475-.475 1.175 0 .7.475 1.175Q23.3 34 24 34Zm-1.35-7.65h3V13.7h-3ZM24 44q-4.1 0-7.75-1.575-3.65-1.575-6.375-4.3-2.725-2.725-4.3-6.375Q4 28.1 4 23.95q0-4.1 1.575-7.75 1.575-3.65 4.3-6.35 2.725-2.7 6.375-4.275Q19.9 4 24.05 4q4.1 0 7.75 1.575 3.65 1.575 6.35 4.275 2.7 2.7 4.275 6.35Q44 19.85 44 24q0 4.1-1.575 7.75-1.575 3.65-4.275 6.375t-6.35 4.3Q28.15 44 24 44Zm.05-3q7.05 0 12-4.975T41 23.95q0-7.05-4.95-12T24 7q-7.05 0-12.025 4.95Q7 16.9 7 24q0 7.05 4.975 12.025Q16.95 41 24.05 41ZM24 24Z" fill="red" stroke="red"/></svg>

After

Width:  |  Height:  |  Size: 712 B

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Menu</string>
<string id="NoInternet">Tidak ada koneksi internet</string>
<string id="NoMenu">Kesalahan Pengambilan Menu</string>
<string id="NoAPIKey">Tidak ada kunci API di pengaturan aplikasi</string>
<string id="NoApiUrl">Tidak ada URL API di pengaturan aplikasi</string>
<string id="NoConfigUrl">Tidak ada URL konfigurasi di pengaturan aplikasi</string>
<string id="ApiFlood">Panggilan API terlalu cepat. Harap memperlambat permintaan Anda.</string>
<string id="ApiUrlNotFound">URL tidak ditemukan. Potensi kesalahan URL API dalam pengaturan.</string>
<string id="ConfigUrlNotFound">URL tidak ditemukan. Potensi kesalahan URL Konfigurasi dalam pengaturan.</string>
<string id="UnhandledHttpErr">Permintaan HTTP mengembalikan kode kesalahan =</string>
<string id="TrailingSlashErr">URL API tidak boleh memiliki garis miring '/'</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Menù</string>
<string id="NoInternet">Nessuna connessione internet</string>
<string id="NoMenu">Errore di recupero del menu</string>
<string id="NoAPIKey">Nessuna chiave API nelle impostazioni dell'applicazione</string>
<string id="NoApiUrl">Nessun URL API nelle impostazioni dell'applicazione</string>
<string id="NoConfigUrl">Nessun URL di configurazione nelle impostazioni dell'applicazione</string>
<string id="ApiFlood">Chiamate API troppo rapide. Per favore rallenta le tue richieste.</string>
<string id="ApiUrlNotFound">URL non trovato. Potenziale errore URL API nelle impostazioni.</string>
<string id="ConfigUrlNotFound">URL non trovato. Potenziale errore dell'URL di configurazione nelle impostazioni.</string>
<string id="UnhandledHttpErr">La richiesta HTTP ha restituito il codice di errore =</string>
<string id="TrailingSlashErr">L'URL dell'API non deve avere una barra finale "/"</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">メニュー</string>
<string id="NoInternet">インターネット接続なし</string>
<string id="NoMenu">メニューフェッチエラー</string>
<string id="NoAPIKey">アプリケーション設定に API キーがありません</string>
<string id="NoApiUrl">アプリケーション設定に API URL がありません</string>
<string id="NoConfigUrl">アプリケーション設定に構成 URL がありません</string>
<string id="ApiFlood">API 呼び出しが速すぎます。リクエストは遅くしてください。</string>
<string id="ApiUrlNotFound">URLが見つかりません。設定における API URL エラーの可能性があります。</string>
<string id="ConfigUrlNotFound">URLが見つかりません。設定内の構成 URL エラーの可能性があります。</string>
<string id="UnhandledHttpErr">HTTP リクエストがエラー コードを返しました =</string>
<string id="TrailingSlashErr">API URL の末尾にスラッシュ「/」を含めることはできません</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">메뉴</string>
<string id="NoInternet">인터넷에 연결되지 않음</string>
<string id="NoMenu">메뉴 가져오기 오류</string>
<string id="NoAPIKey">애플리케이션 설정에 API 키가 없습니다.</string>
<string id="NoApiUrl">애플리케이션 설정에 API URL이 없습니다.</string>
<string id="NoConfigUrl">애플리케이션 설정에 구성 URL이 없습니다.</string>
<string id="ApiFlood">API 호출이 너무 빠릅니다. 요청 속도를 늦추시기 바랍니다.</string>
<string id="ApiUrlNotFound">URL을 찾을 수 없습니다. 설정에 잠재적인 API URL 오류가 있습니다.</string>
<string id="ConfigUrlNotFound">URL을 찾을 수 없습니다. 설정에 잠재적인 구성 URL 오류가 있습니다.</string>
<string id="UnhandledHttpErr">HTTP 요청이 오류 코드를 반환했습니다 =</string>
<string id="TrailingSlashErr">API URL에는 후행 슬래시 '/'가 있어서는 안 됩니다.</string>
</strings>

View File

@ -0,0 +1,17 @@
<!--
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, 31 October 2023
-->
<drawables>
<bitmap id="LauncherIcon" filename="launcher.png" />
</drawables>

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.8 KiB

View File

@ -0,0 +1,17 @@
<!--
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, 31 October 2023
-->
<drawables>
<bitmap id="LauncherIcon" filename="launcher.png" />
</drawables>

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB

View File

@ -0,0 +1,17 @@
<!--
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, 31 October 2023
-->
<drawables>
<bitmap id="LauncherIcon" filename="launcher.png" />
</drawables>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

@ -0,0 +1,17 @@
<!--
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, 31 October 2023
-->
<drawables>
<bitmap id="LauncherIcon" filename="launcher.png" />
</drawables>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.2 KiB

View File

@ -0,0 +1,17 @@
<!--
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, 31 October 2023
-->
<drawables>
<bitmap id="LauncherIcon" filename="launcher.png" />
</drawables>

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.7 KiB

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Izvēlne</string>
<string id="NoInternet">Nav interneta savienojuma</string>
<string id="NoMenu">Izvēlnes ielādes kļūda</string>
<string id="NoAPIKey">Lietojumprogrammas iestatījumos nav API atslēgas</string>
<string id="NoApiUrl">Lietojumprogrammas iestatījumos nav API URL</string>
<string id="NoConfigUrl">Lietojumprogrammas iestatījumos nav konfigurācijas URL</string>
<string id="ApiFlood">API izsaukumi ir pārāk ātri. Lūdzu, palēniniet pieprasījumu izpildi.</string>
<string id="ApiUrlNotFound">URL nav atrasts. Iespējama API URL kļūda iestatījumos.</string>
<string id="ConfigUrlNotFound">URL nav atrasts. Iespējama konfigurācijas URL kļūda iestatījumos.</string>
<string id="UnhandledHttpErr">HTTP pieprasījums atgrieza kļūdas kodu =</string>
<string id="TrailingSlashErr">API URL beigās nedrīkst būt slīpsvītra “/”</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Meniu</string>
<string id="NoInternet">Nėra interneto ryšio</string>
<string id="NoMenu">Meniu gavimo klaida</string>
<string id="NoAPIKey">Programos nustatymuose nėra API rakto</string>
<string id="NoApiUrl">Programos nustatymuose nėra API URL</string>
<string id="NoConfigUrl">Programos nustatymuose nėra konfigūracijos URL</string>
<string id="ApiFlood">API skambučiai per greiti. Sulėtinkite prašymų vykdymą.</string>
<string id="ApiUrlNotFound">URL nerastas. Galima API URL klaida nustatymuose.</string>
<string id="ConfigUrlNotFound">URL nerastas. Galima konfigūracijos URL klaida nustatymuose.</string>
<string id="UnhandledHttpErr">HTTP užklausa grąžino klaidos kodą =</string>
<string id="TrailingSlashErr">API URL pabaigoje negali būti pasvirojo brūkšnio „/“</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Meny</string>
<string id="NoInternet">Ingen Internett-tilkobling</string>
<string id="NoMenu">Menyhentingsfeil</string>
<string id="NoAPIKey">Ingen API-nøkkel i applikasjonsinnstillingene</string>
<string id="NoApiUrl">Ingen API-URL i applikasjonsinnstillingene</string>
<string id="NoConfigUrl">Ingen konfigurasjons-URL i applikasjonsinnstillingene</string>
<string id="ApiFlood">API-kall for raske. Vennligst senke forespørslene dine.</string>
<string id="ApiUrlNotFound">Finner ikke URL. Potensiell API URL-feil i innstillingene.</string>
<string id="ConfigUrlNotFound">Finner ikke URL. Potensiell konfigurasjons-URL-feil i innstillingene.</string>
<string id="UnhandledHttpErr">HTTP-forespørsel returnerte feilkode =</string>
<string id="TrailingSlashErr">API URL må ikke ha en etterfølgende skråstrek '/'</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Menu</string>
<string id="NoInternet">Brak połączenia z internetem</string>
<string id="NoMenu">Błąd pobierania menu</string>
<string id="NoAPIKey">Brak klucza API w ustawieniach aplikacji</string>
<string id="NoApiUrl">Brak adresu API w ustawieniach aplikacji</string>
<string id="NoConfigUrl">Brak adresu URL konfiguracji w ustawieniach aplikacji</string>
<string id="ApiFlood">Wywołania API są zbyt szybkie. Proszę spowolnić swoje żądania.</string>
<string id="ApiUrlNotFound">Nie znaleziono adresu URL. Potencjalny błąd adresu URL interfejsu API w ustawieniach.</string>
<string id="ConfigUrlNotFound">Nie znaleziono adresu URL. Potencjalny błąd adresu URL konfiguracji w ustawieniach.</string>
<string id="UnhandledHttpErr">Żądanie HTTP zwróciło kod błędu =</string>
<string id="TrailingSlashErr">Adres URL interfejsu API nie może zawierać końcowego ukośnika „/”</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Cardápio</string>
<string id="NoInternet">Sem conexão com a Internet</string>
<string id="NoMenu">Erro ao buscar menu</string>
<string id="NoAPIKey">Nenhuma chave de API nas configurações do aplicativo</string>
<string id="NoApiUrl">Nenhum URL de API nas configurações do aplicativo</string>
<string id="NoConfigUrl">Nenhum URL de configuração nas configurações do aplicativo</string>
<string id="ApiFlood">Chamadas de API muito rápidas. Por favor, diminua a velocidade de seus pedidos.</string>
<string id="ApiUrlNotFound">URL não encontrado. Possível erro de URL da API nas configurações.</string>
<string id="ConfigUrlNotFound">URL não encontrado. Possível erro de URL de configuração nas configurações.</string>
<string id="UnhandledHttpErr">Solicitação HTTP retornou código de erro =</string>
<string id="TrailingSlashErr">O URL da API não deve ter uma barra final '/'</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Meniul</string>
<string id="NoInternet">Fără conexiune internet</string>
<string id="NoMenu">Eroare de preluare a meniului</string>
<string id="NoAPIKey">Nicio cheie API în setările aplicației</string>
<string id="NoApiUrl">Nicio adresă URL API în setările aplicației</string>
<string id="NoConfigUrl">Nicio adresă URL de configurare în setările aplicației</string>
<string id="ApiFlood">Apeluri API prea rapide. Vă rugăm să vă încetiniți solicitările.</string>
<string id="ApiUrlNotFound">Adresa URL nu a fost găsită. Potențială eroare URL API în setări.</string>
<string id="ConfigUrlNotFound">Adresa URL nu a fost găsită. Potențială eroare URL de configurare în setări.</string>
<string id="UnhandledHttpErr">Solicitarea HTTP a returnat codul de eroare =</string>
<string id="TrailingSlashErr">Adresa URL API nu trebuie să aibă o bară oblică „/”</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Ponuka</string>
<string id="NoInternet">Žiadne internetové pripojenie</string>
<string id="NoMenu">Chyba načítania ponuky</string>
<string id="NoAPIKey">V nastaveniach aplikácie nie je žiadny kľúč API</string>
<string id="NoApiUrl">V nastaveniach aplikácie nie je žiadna adresa URL rozhrania API</string>
<string id="NoConfigUrl">V nastaveniach aplikácie nie je žiadna konfiguračná URL</string>
<string id="ApiFlood">Volania API sú príliš rýchle. Spomaľte svoje požiadavky.</string>
<string id="ApiUrlNotFound">Adresa URL sa nenašla. Potenciálna chyba webovej adresy rozhrania API v nastaveniach.</string>
<string id="ConfigUrlNotFound">Adresa URL sa nenašla. Potenciálna chyba konfiguračnej adresy URL v nastaveniach.</string>
<string id="UnhandledHttpErr">Požiadavka HTTP vrátila kód chyby =</string>
<string id="TrailingSlashErr">Adresa URL rozhrania API nesmie obsahovať koncovú lomku „/“</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">meni</string>
<string id="NoInternet">Ni internetne povezave</string>
<string id="NoMenu">Napaka pri pridobivanju menija</string>
<string id="NoAPIKey">V nastavitvah aplikacije ni ključa API</string>
<string id="NoApiUrl">V nastavitvah aplikacije ni URL-ja API-ja</string>
<string id="NoConfigUrl">V nastavitvah aplikacije ni konfiguracijskega URL-ja</string>
<string id="ApiFlood">API klici so prehitri. Prosim, upočasnite svoje zahteve.</string>
<string id="ApiUrlNotFound">URL-ja ni bilo mogoče najti. Morebitna napaka URL-ja API-ja v nastavitvah.</string>
<string id="ConfigUrlNotFound">URL-ja ni bilo mogoče najti. Morebitna napaka URL-ja konfiguracije v nastavitvah.</string>
<string id="UnhandledHttpErr">Zahteva HTTP je vrnila kodo napake =</string>
<string id="TrailingSlashErr">URL API-ja ne sme imeti končne poševnice '/'</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Menú</string>
<string id="NoInternet">Sin conexión a Internet</string>
<string id="NoMenu">Error de recuperación del menú</string>
<string id="NoAPIKey">Sin clave API en la configuración de la aplicación</string>
<string id="NoApiUrl">No hay URL de API en la configuración de la aplicación</string>
<string id="NoConfigUrl">No hay URL de configuración en la configuración de la aplicación.</string>
<string id="ApiFlood">Llamadas API demasiado rápidas. Por favor, ralentice sus solicitudes.</string>
<string id="ApiUrlNotFound">URL no encontrada. Posible error de URL de API en la configuración.</string>
<string id="ConfigUrlNotFound">URL no encontrada. Posible error de URL de configuración en la configuración.</string>
<string id="UnhandledHttpErr">La solicitud HTTP devolvió el código de error =</string>
<string id="TrailingSlashErr">La URL de API no debe tener una barra diagonal '/'</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Meny</string>
<string id="NoInternet">Ingen internetanslutning</string>
<string id="NoMenu">Menyhämtningsfel</string>
<string id="NoAPIKey">Ingen API-nyckel i applikationsinställningarna</string>
<string id="NoApiUrl">Ingen API-URL i programinställningarna</string>
<string id="NoConfigUrl">Ingen konfigurations-URL i programinställningarna</string>
<string id="ApiFlood">API-anrop för snabba. Vänligen sakta ner dina förfrågningar.</string>
<string id="ApiUrlNotFound">Webbadressen hittades inte. Potentiellt API-URL-fel i inställningarna.</string>
<string id="ConfigUrlNotFound">Webbadressen hittades inte. Potentiellt konfigurations-URL-fel i inställningarna.</string>
<string id="UnhandledHttpErr">HTTP-begäran returnerade felkod =</string>
<string id="TrailingSlashErr">API-URL får inte ha ett snedstreck '/'</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">เมนู</string>
<string id="NoInternet">ไม่มีการเชื่อมต่ออินเทอร์เน็ต</string>
<string id="NoMenu">เมนูดึงข้อมูลผิดพลาด</string>
<string id="NoAPIKey">ไม่มีคีย์ API ในการตั้งค่าแอปพลิเคชัน</string>
<string id="NoApiUrl">ไม่มี URL API ในการตั้งค่าแอปพลิเคชัน</string>
<string id="NoConfigUrl">ไม่มี URL การกำหนดค่าในการตั้งค่าแอปพลิเคชัน</string>
<string id="ApiFlood">การเรียก API เร็วเกินไป กรุณาชะลอคำขอของคุณ</string>
<string id="ApiUrlNotFound">ไม่พบ URL ข้อผิดพลาด URL API ที่อาจเกิดขึ้นในการตั้งค่า</string>
<string id="ConfigUrlNotFound">ไม่พบ URL ข้อผิดพลาด URL การกำหนดค่าที่อาจเกิดขึ้นในการตั้งค่า</string>
<string id="UnhandledHttpErr">คำขอ HTTP ส่งคืนรหัสข้อผิดพลาด =</string>
<string id="TrailingSlashErr">URL ของ API ต้องไม่มีเครื่องหมายทับต่อท้าย '/'</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Menü</string>
<string id="NoInternet">İnternet bağlantısı yok</string>
<string id="NoMenu">Menü Alma Hatası</string>
<string id="NoAPIKey">Uygulama ayarlarında API anahtarı yok</string>
<string id="NoApiUrl">Uygulama ayarlarında API URL'si yok</string>
<string id="NoConfigUrl">Uygulama ayarlarında yapılandırma URL'si yok</string>
<string id="ApiFlood">API çağrıları çok hızlı. Lütfen isteklerinizi yavaşlatın.</string>
<string id="ApiUrlNotFound">URL bulunamadı. Ayarlarda olası API URL hatası.</string>
<string id="ConfigUrlNotFound">URL bulunamadı. Ayarlarda Olası Yapılandırma URL'si hatası.</string>
<string id="UnhandledHttpErr">HTTP isteği hata kodunu döndürdü =</string>
<string id="TrailingSlashErr">API URL'sinin sonunda '/' eğik çizgi olmamalıdır</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Меню</string>
<string id="NoInternet">Немає підключення до Інтернету</string>
<string id="NoMenu">Помилка вибірки меню</string>
<string id="NoAPIKey">У налаштуваннях програми немає ключа API</string>
<string id="NoApiUrl">У налаштуваннях програми немає URL-адреси API</string>
<string id="NoConfigUrl">У налаштуваннях програми немає URL-адреси конфігурації</string>
<string id="ApiFlood">Надто швидкі виклики API. Будь ласка, сповільніть свої запити.</string>
<string id="ApiUrlNotFound">URL не знайдено. Потенційна помилка URL-адреси API в налаштуваннях.</string>
<string id="ConfigUrlNotFound">URL не знайдено. Потенційна помилка URL-адреси конфігурації в налаштуваннях.</string>
<string id="UnhandledHttpErr">Запит HTTP повернув код помилки =</string>
<string id="TrailingSlashErr">URL-адреса API не повинна містити косу риску '/'</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Thực đơn</string>
<string id="NoInternet">Không có kết nối Internet</string>
<string id="NoMenu">Lỗi tìm nạp menu</string>
<string id="NoAPIKey">Không có khóa API trong cài đặt ứng dụng</string>
<string id="NoApiUrl">Không có URL API trong cài đặt ứng dụng</string>
<string id="NoConfigUrl">Không có URL cấu hình trong cài đặt ứng dụng</string>
<string id="ApiFlood">Cuộc gọi API quá nhanh. Hãy làm chậm yêu cầu của bạn.</string>
<string id="ApiUrlNotFound">Không tìm thấy URL. Lỗi URL API tiềm ẩn trong cài đặt.</string>
<string id="ConfigUrlNotFound">Không tìm thấy URL. Lỗi URL cấu hình tiềm ẩn trong cài đặt.</string>
<string id="UnhandledHttpErr">Yêu cầu HTTP trả về mã lỗi =</string>
<string id="TrailingSlashErr">URL API không được có dấu gạch chéo ở cuối '/'</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">菜单</string>
<string id="NoInternet">没有网络连接</string>
<string id="NoMenu">菜单获取错误</string>
<string id="NoAPIKey">应用程序设置中没有 API 密钥</string>
<string id="NoApiUrl">应用程序设置中没有 API URL</string>
<string id="NoConfigUrl">应用程序设置中没有配置 URL</string>
<string id="ApiFlood">API 调用速度太快。请放慢您的请求。</string>
<string id="ApiUrlNotFound">找不到网址。设置中可能存在 API URL 错误。</string>
<string id="ConfigUrlNotFound">找不到网址。设置中可能存在配置 URL 错误。</string>
<string id="UnhandledHttpErr">HTTP请求返回错误码=</string>
<string id="TrailingSlashErr">API URL 不得有尾部斜杠“/”</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">選單</string>
<string id="NoInternet">沒有網路連線</string>
<string id="NoMenu">選單取得錯誤</string>
<string id="NoAPIKey">應用程式設定中沒有 API 金鑰</string>
<string id="NoApiUrl">應用程式設定中沒有 API URL</string>
<string id="NoConfigUrl">應用程式設定中沒有配置 URL</string>
<string id="ApiFlood">API 呼叫速度太快。請放慢您的請求。</string>
<string id="ApiUrlNotFound">找不到網址。設定中可能存在 API URL 錯誤。</string>
<string id="ConfigUrlNotFound">找不到網址。設定中可能存在配置 URL 錯誤。</string>
<string id="UnhandledHttpErr">HTTP請求回傳錯誤碼=</string>
<string id="TrailingSlashErr">API URL 不得有尾部斜線“/”</string>
</strings>

View File

@ -26,4 +26,12 @@
<string id="MenuItemMenu">Menu</string>
<string id="NoInternet">Tiada sambungan internet</string>
<string id="NoMenu">Ralat Pengambilan Menu</string>
<string id="NoAPIKey">Tiada kunci API dalam tetapan aplikasi</string>
<string id="NoApiUrl">Tiada URL API dalam tetapan aplikasi</string>
<string id="NoConfigUrl">Tiada URL konfigurasi dalam tetapan aplikasi</string>
<string id="ApiFlood">Panggilan API terlalu pantas. Sila perlahankan permintaan anda.</string>
<string id="ApiUrlNotFound">URL tidak ditemui. Ralat URL API yang berpotensi dalam tetapan.</string>
<string id="ConfigUrlNotFound">URL tidak ditemui. Ralat URL Konfigurasi Potensi dalam tetapan.</string>
<string id="UnhandledHttpErr">Permintaan HTTP mengembalikan kod ralat =</string>
<string id="TrailingSlashErr">URL API tidak boleh mempunyai garis miring '/'</string>
</strings>

View File

@ -20,4 +20,12 @@
<string id="MenuItemMenu">Menu</string>
<string id="NoInternet">No Internet connection</string>
<string id="NoMenu">Menu Fetch Error</string>
<string id="NoAPIKey">No API key in the application settings</string>
<string id="NoApiUrl">No API URL in the application settings</string>
<string id="NoConfigUrl">No configuration URL in the application settings</string>
<string id="ApiFlood">API calls too rapid. Please slow down your requests.</string>
<string id="ApiUrlNotFound">URL not found. Potential API URL error in settings.</string>
<string id="ConfigUrlNotFound">URL not found. Potential Configuration URL error in settings.</string>
<string id="UnhandledHttpErr">HTTP request returned error code = </string>
<string id="TrailingSlashErr">API URL must not have a trailing slash '/'</string>
</strings>

View File

@ -30,55 +30,55 @@ using Toybox.Timer;
const bRadius = 10;
class Alert extends WatchUi.View {
hidden var timer;
hidden var timeout;
hidden var text;
hidden var font;
hidden var fgcolor;
hidden var bgcolor;
hidden var mTimer;
hidden var mTimeout;
hidden var mText;
hidden var mFont;
hidden var mFgcolor;
hidden var mBgcolor;
function initialize(params as Lang.Dictionary) {
View.initialize();
text = params.get(:text);
if (text == null) {
text = "Alert";
mText = params.get(:text);
if (mText == null) {
mText = "Alert";
}
font = params.get(:font);
if (font == null) {
font = Graphics.FONT_MEDIUM;
mFont = params.get(:font);
if (mFont == null) {
mFont = Graphics.FONT_MEDIUM;
}
fgcolor = params.get(:fgcolor);
if (fgcolor == null) {
fgcolor = Graphics.COLOR_BLACK;
mFgcolor = params.get(:fgcolor);
if (mFgcolor == null) {
mFgcolor = Graphics.COLOR_BLACK;
}
bgcolor = params.get(:bgcolor);
if (bgcolor == null) {
bgcolor = Graphics.COLOR_WHITE;
mBgcolor = params.get(:bgcolor);
if (mBgcolor == null) {
mBgcolor = Graphics.COLOR_WHITE;
}
timeout = params.get(:timeout);
if (timeout == null) {
timeout = 2000;
mTimeout = params.get(:timeout);
if (mTimeout == null) {
mTimeout = 2000;
}
timer = new Timer.Timer();
mTimer = new Timer.Timer();
}
function onShow() {
timer.start(method(:dismiss), timeout, false);
mTimer.start(method(:dismiss), mTimeout, false);
}
function onHide() {
timer.stop();
mTimer.stop();
}
function onUpdate(dc) {
var tWidth = dc.getTextWidthInPixels(text, font);
var tHeight = dc.getFontHeight(font);
var tWidth = dc.getTextWidthInPixels(mText, mFont);
var tHeight = dc.getFontHeight(mFont);
var bWidth = tWidth + 20;
var bHeight = tHeight + 15;
var bX = (dc.getWidth() - bWidth) / 2;
@ -93,10 +93,10 @@ class Alert extends WatchUi.View {
Graphics.COLOR_TRANSPARENT
);
dc.clear();
dc.setColor(bgcolor, bgcolor);
dc.setColor(mBgcolor, mBgcolor);
dc.fillRoundedRectangle(bX, bY, bWidth, bHeight, bRadius);
dc.setColor(fgcolor, bgcolor);
dc.setColor(mFgcolor, mBgcolor);
for (var i = 0; i < 3; ++i) {
bX += i;
bY += i;
@ -107,8 +107,8 @@ class Alert extends WatchUi.View {
var tX = dc.getWidth() / 2;
var tY = bY + bHeight / 2;
dc.setColor(fgcolor, bgcolor);
dc.drawText(tX, tY, font, text, Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER);
dc.setColor(mFgcolor, mBgcolor);
dc.drawText(tX, tY, mFont, mText, Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER);
}
// Remove the alert from view, usually on user input, but that is defined by the calling function.

View File

@ -26,31 +26,31 @@ using Toybox.WatchUi;
using Toybox.Communications;
class ErrorView extends ScalableView {
hidden const settings as Lang.Dictionary = {
hidden const cSettings as Lang.Dictionary = {
:errorIconMargin => 7f
};
// Vertical spacing between the top of the face and the error icon
hidden var errorIconMargin;
hidden var text as Lang.String;
hidden var errorIcon;
hidden var textArea;
hidden var mErrorIconMargin;
hidden var mText as Lang.String;
hidden var mErrorIcon;
hidden var mTextArea;
function initialize(text as Lang.String) {
ScalableView.initialize();
self.text = text;
mText = text;
// Convert the settings from % of screen size to pixels
errorIconMargin = pixelsForScreen(settings.get(:errorIconMargin) as Lang.Float);
mErrorIconMargin = pixelsForScreen(cSettings.get(:errorIconMargin) as Lang.Float);
}
// Load your resources here
function onLayout(dc as Graphics.Dc) as Void {
errorIcon = Application.loadResource(Rez.Drawables.ErrorIcon) as Graphics.BitmapResource;
mErrorIcon = Application.loadResource(Rez.Drawables.ErrorIcon) as Graphics.BitmapResource;
var w = dc.getWidth();
var h = dc.getHeight();
textArea = new WatchUi.TextArea({
:text => text,
mTextArea = new WatchUi.TextArea({
:text => mText,
:color => Graphics.COLOR_WHITE,
:font => Graphics.FONT_XTINY,
:justification => Graphics.TEXT_JUSTIFY_CENTER | Graphics.TEXT_JUSTIFY_VCENTER,
@ -71,8 +71,8 @@ class ErrorView extends ScalableView {
}
dc.setColor(Graphics.COLOR_WHITE, bg);
dc.clear();
dc.drawBitmap(hw - errorIcon.getWidth()/2, errorIconMargin, errorIcon);
textArea.draw(dc);
dc.drawBitmap(hw - mErrorIcon.getWidth()/2, mErrorIconMargin, mErrorIcon);
mTextArea.draw(dc);
}
}

View File

@ -23,8 +23,7 @@ using Toybox.Lang;
class Globals {
// Enable printing of messages to the debug console (don't make this a Property
// as the messages can't be read from a watch!)
static const debug = false;
static const updateInterval = 5; // seconds
static const alertTimeout = 2000; // ms
static const tapTimeout = 1000; // ms
static const scDebug = false;
static const scAlertTimeout = 2000; // ms
static const scTapTimeout = 1000; // ms
}

View File

@ -14,7 +14,7 @@
//
// Description:
//
// Application root for GarminHomeAssistant.
// Application root for GarminHomeAssistant
//
//-----------------------------------------------------------------------------------
@ -25,60 +25,114 @@ using Toybox.Application.Properties;
using Toybox.Timer;
class HomeAssistantApp extends Application.AppBase {
hidden var haMenu;
hidden var strNoInternet as Lang.String;
hidden var strNoMenu as Lang.String;
hidden var timer as Timer.Timer;
hidden var mHaMenu;
hidden var strNoApiKey as Lang.String;
hidden var strNoApiUrl as Lang.String;
hidden var strNoConfigUrl as Lang.String;
hidden var strNoInternet as Lang.String;
hidden var strNoMenu as Lang.String;
hidden var strApiFlood as Lang.String;
hidden var strConfigUrlNotFound as Lang.String;
hidden var strUnhandledHttpErr as Lang.String;
hidden var strTrailingSlashErr as Lang.String;
hidden var mItemsToUpdate; // Array initialised by onReturnFetchMenuConfig()
hidden var mNextItemToUpdate = 0; // Index into the above array
function initialize() {
AppBase.initialize();
strNoInternet = WatchUi.loadResource($.Rez.Strings.NoInternet);
strNoMenu = WatchUi.loadResource($.Rez.Strings.NoMenu);
timer = new Timer.Timer();
strNoApiKey = WatchUi.loadResource($.Rez.Strings.NoAPIKey);
strNoApiUrl = WatchUi.loadResource($.Rez.Strings.NoApiUrl);
strNoConfigUrl = WatchUi.loadResource($.Rez.Strings.NoConfigUrl);
strNoInternet = WatchUi.loadResource($.Rez.Strings.NoInternet);
strNoMenu = WatchUi.loadResource($.Rez.Strings.NoMenu);
strApiFlood = WatchUi.loadResource($.Rez.Strings.ApiFlood);
strConfigUrlNotFound = WatchUi.loadResource($.Rez.Strings.ConfigUrlNotFound);
strUnhandledHttpErr = WatchUi.loadResource($.Rez.Strings.UnhandledHttpErr);
strTrailingSlashErr = WatchUi.loadResource($.Rez.Strings.TrailingSlashErr);
}
// onStart() is called on application start up
function onStart(state as Lang.Dictionary?) as Void {
fetchMenuConfig();
}
// onStop() is called when your application is exiting
function onStop(state as Lang.Dictionary?) as Void {
if (timer != null) {
timer.stop();
}
}
function onStop(state as Lang.Dictionary?) as Void {}
// Return the initial view of your application here
function getInitialView() as Lang.Array<WatchUi.Views or WatchUi.InputDelegates>? {
return [new WatchUi.View(), new WatchUi.BehaviorDelegate()] as Lang.Array<WatchUi.Views or WatchUi.InputDelegates>;
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("HomeAssistantMenuItem execScript(): No API key in the application settings.");
}
return [new ErrorView(strNoApiKey + "."), new ErrorDelegate()] as Lang.Array<WatchUi.Views or WatchUi.InputDelegates>;
} else if (api_url.length() == 0) {
if (Globals.scDebug) {
System.println("HomeAssistantMenuItem execScript(): No API URL in the application settings.");
}
return [new ErrorView(strNoApiUrl + "."), new ErrorDelegate()] as Lang.Array<WatchUi.Views or WatchUi.InputDelegates>;
} else if (api_url.substring(-1, api_url.length()).equals("/")) {
if (Globals.scDebug) {
System.println("HomeAssistantMenuItem execScript(): API URL must not have a trailing slash '/'.");
}
return [new ErrorView(strTrailingSlashErr + "."), new ErrorDelegate()] as Lang.Array<WatchUi.Views or WatchUi.InputDelegates>;
} else if ((Properties.getValue("config_url") as Lang.String).length() == 0) {
if (Globals.scDebug) {
System.println("HomeAssistantMenuItem execScript(): No configuration URL in the application settings.");
}
return [new ErrorView(strNoConfigUrl + "."), new ErrorDelegate()] as Lang.Array<WatchUi.Views or WatchUi.InputDelegates>;
} else if (System.getDeviceSettings().phoneConnected && System.getDeviceSettings().connectionAvailable) {
fetchMenuConfig();
return [new WatchUi.View(), new WatchUi.BehaviorDelegate()] as Lang.Array<WatchUi.Views or WatchUi.InputDelegates>;
} else {
if (Globals.scDebug) {
System.println("HomeAssistantApp fetchMenuConfig(): No Internet connection, skipping API call.");
}
return [new ErrorView(strNoInternet + "."), new ErrorDelegate()] as Lang.Array<WatchUi.Views or WatchUi.InputDelegates>;
}
}
// Callback function after completing the GET request to fetch the configuration menu.
//
function onReturnFetchMenuConfig(responseCode as Lang.Number, data as Null or Lang.Dictionary or Lang.String) as Void {
if (Globals.debug) {
if (Globals.scDebug) {
System.println("HomeAssistantApp onReturnFetchMenuConfig() Response Code: " + responseCode);
System.println("HomeAssistantApp onReturnFetchMenuConfig() Response Data: " + data);
}
if (responseCode == 200) {
haMenu = new HomeAssistantView(data, null);
timer.start(
haMenu.method(:stateUpdate),
Globals.updateInterval * 1000,
true
);
WatchUi.switchToView(haMenu, new HomeAssistantViewDelegate(), WatchUi.SLIDE_IMMEDIATE);
} else if (responseCode == -300) {
if (Globals.debug) {
System.println("HomeAssistantApp Note - onReturnFetchMenuConfig(): Network request timeout.");
if (responseCode == Communications.BLE_QUEUE_FULL) {
if (Globals.scDebug) {
System.println("HomeAssistantApp onReturnFetchMenuConfig() Response Code: BLE_QUEUE_FULL, API calls too rapid.");
}
var cw = WatchUi.getCurrentView();
if (!(cw[0] instanceof ErrorView)) {
// Avoid pushing multiple ErrorViews
WatchUi.pushView(new ErrorView(strApiFlood), new ErrorDelegate(), WatchUi.SLIDE_UP);
}
} 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);
} else if (responseCode == 200) {
mHaMenu = new HomeAssistantView(data, null);
WatchUi.switchToView(mHaMenu, new HomeAssistantViewDelegate(), WatchUi.SLIDE_IMMEDIATE);
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.
if (mItemsToUpdate.size() > 0) {
updateNextMenuItem();
}
} else if (responseCode == Communications.NETWORK_REQUEST_TIMED_OUT) {
if (Globals.scDebug) {
System.println("HomeAssistantApp onReturnFetchMenuConfig(): Network request timeout.");
}
WatchUi.pushView(new ErrorView(strNoMenu + ". " + strNoInternet + "?"), new ErrorDelegate(), WatchUi.SLIDE_UP);
} else {
if (Globals.debug) {
System.println("HomeAssistantApp Note - onReturnFetchMenuConfig(): Configuration not found or potential validation issue.");
if (Globals.scDebug) {
System.println("HomeAssistantApp onReturnFetchMenuConfig(): Unhandled HTTP response code = " + responseCode);
}
WatchUi.pushView(new ErrorView(strNoMenu + " code=" + responseCode ), new ErrorDelegate(), WatchUi.SLIDE_UP);
WatchUi.pushView(new ErrorView(strUnhandledHttpErr + responseCode ), new ErrorDelegate(), WatchUi.SLIDE_UP);
}
}
@ -87,25 +141,20 @@ class HomeAssistantApp extends Application.AppBase {
:method => Communications.HTTP_REQUEST_METHOD_GET,
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
};
if (System.getDeviceSettings().phoneConnected && System.getDeviceSettings().connectionAvailable) {
Communications.makeWebRequest(
Properties.getValue("config_url"),
null,
options,
method(:onReturnFetchMenuConfig)
);
} else {
if (Globals.debug) {
System.println("HomeAssistantApp Note - fetchMenuConfig(): No Internet connection, skipping API call.");
}
new Alert({
:timeout => Globals.alertTimeout,
:font => Graphics.FONT_SYSTEM_TINY,
:text => strNoInternet,
:fgcolor => Graphics.COLOR_RED,
:bgcolor => Graphics.COLOR_BLACK
}).pushView(WatchUi.SLIDE_IMMEDIATE);
}
Communications.makeWebRequest(
Properties.getValue("config_url"),
null,
options,
method(:onReturnFetchMenuConfig)
);
}
// 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 {
var itu = mItemsToUpdate as Lang.Array<HomeAssistantToggleMenuItem>;
itu[mNextItemToUpdate].getState();
mNextItemToUpdate = (mNextItemToUpdate + 1) % itu.size();
}
}

View File

@ -14,7 +14,7 @@
//
// Description:
//
// Menu button that triggers a script.
// Menu button that triggers a service.
//
//-----------------------------------------------------------------------------------
@ -24,19 +24,29 @@ using Toybox.Graphics;
using Toybox.Application.Properties;
class HomeAssistantMenuItem extends WatchUi.MenuItem {
hidden var api_key = Properties.getValue("api_key");
hidden var strNoInternet as Lang.String;
hidden var mApiKey as Lang.String;
hidden var strNoInternet as Lang.String;
hidden var strApiFlood as Lang.String;
hidden var strApiUrlNotFound as Lang.String;
hidden var strUnhandledHttpErr as Lang.String;
hidden var mService as Lang.String;
function initialize(
label as Lang.String or Lang.Symbol,
subLabel as Lang.String or Lang.Symbol or Null,
identifier as Lang.Object or Null,
service as Lang.String or Null,
options as {
:alignment as WatchUi.MenuItem.Alignment,
:icon as Graphics.BitmapType or WatchUi.Drawable or Lang.Symbol
} or Null
) {
strNoInternet = WatchUi.loadResource($.Rez.Strings.NoInternet);
strNoInternet = WatchUi.loadResource($.Rez.Strings.NoInternet);
strApiFlood = WatchUi.loadResource($.Rez.Strings.ApiFlood);
strApiUrlNotFound = WatchUi.loadResource($.Rez.Strings.ApiUrlNotFound);
strUnhandledHttpErr = WatchUi.loadResource($.Rez.Strings.UnhandledHttpErr);
mApiKey = Properties.getValue("api_key");
mService = service;
WatchUi.MenuItem.initialize(
label,
subLabel,
@ -48,23 +58,60 @@ class HomeAssistantMenuItem extends WatchUi.MenuItem {
// Callback function after completing the POST request to call a script.
//
function onReturnExecScript(responseCode as Lang.Number, data as Null or Lang.Dictionary or Lang.String) as Void {
if (Globals.debug) {
System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Code: " + responseCode);
System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Data: " + data);
if (Globals.scDebug) {
System.println("HomeAssistantMenuItem onReturnExecScript() Response Code: " + responseCode);
System.println("HomeAssistantMenuItem onReturnExecScript() Response Data: " + data);
}
if (responseCode == 200) {
if (responseCode == Communications.BLE_QUEUE_FULL) {
if (Globals.scDebug) {
System.println("HomeAssistantMenuItem onReturnExecScript() Response Code: BLE_QUEUE_FULL, API calls too rapid.");
}
var cw = WatchUi.getCurrentView();
if (!(cw[0] instanceof ErrorView)) {
// Avoid pushing multiple ErrorViews
WatchUi.pushView(new ErrorView(strApiFlood), new ErrorDelegate(), WatchUi.SLIDE_UP);
}
} else if (responseCode == 404) {
if (Globals.scDebug) {
System.println("HomeAssistantMenuItem onReturnExecScript() Response Code: 404, page not found. Check API URL setting.");
}
WatchUi.pushView(new ErrorView(strApiUrlNotFound), new ErrorDelegate(), WatchUi.SLIDE_UP);
} else if (responseCode == 200) {
var d = data as Lang.Array;
for(var i = 0; i < d.size(); i++) {
if ((d[i].get("entity_id") as Lang.String).equals(mIdentifier)) {
if (Globals.debug) {
System.println("HomeAssistantMenuItem Note - onReturnExecScript(): Correct script executed.");
if (Globals.scDebug) {
System.println("HomeAssistantMenuItem onReturnExecScript(): Correct script executed.");
}
if (WatchUi has :showToast) {
WatchUi.showToast(
(d[i].get("attributes") as Lang.Dictionary).get("friendly_name") as Lang.String,
null
);
}
if (Attention has :vibrate) {
Attention.vibrate([
new Attention.VibeProfile(50, 100), // On for 100ms
new Attention.VibeProfile( 0, 100), // Off for 100ms
new Attention.VibeProfile(50, 100) // On for 100ms
]);
}
if (!(WatchUi has :showToast) && !(Attention has :vibrate)) {
new Alert({
:timeout => Globals.scAlertTimeout,
:font => Graphics.FONT_MEDIUM,
:text => (d[i].get("attributes") as Lang.Dictionary).get("friendly_name") as Lang.String,
:fgcolor => Graphics.COLOR_WHITE,
:bgcolor => Graphics.COLOR_BLACK
}).pushView(WatchUi.SLIDE_IMMEDIATE);
}
WatchUi.showToast(
(d[i].get("attributes") as Lang.Dictionary).get("friendly_name") as Lang.String,
null
);
}
}
} else {
if (Globals.scDebug) {
System.println("HomeAssistantMenuItem onReturnExecScript(): Unhandled HTTP response code = " + responseCode);
}
WatchUi.pushView(new ErrorView(strUnhandledHttpErr + responseCode ), new ErrorDelegate(), WatchUi.SLIDE_UP);
}
}
@ -72,33 +119,47 @@ class HomeAssistantMenuItem extends WatchUi.MenuItem {
var options = {
:method => Communications.HTTP_REQUEST_METHOD_POST,
:headers => {
"Authorization" => "Bearer " + api_key
"Content-Type" => Communications.REQUEST_CONTENT_TYPE_JSON,
"Authorization" => "Bearer " + mApiKey
},
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
};
if (System.getDeviceSettings().phoneConnected && System.getDeviceSettings().connectionAvailable) {
var url = Properties.getValue("api_url") + "/services/" + mIdentifier.substring(0, mIdentifier.find(".")) + "/" + mIdentifier.substring(mIdentifier.find(".")+1, null);
if (Globals.debug) {
System.println("URL=" + url);
System.println("mIdentifier=" + mIdentifier);
// Updated SDK and got a new error
// ERROR: venu: Cannot find symbol ':substring' on type 'PolyType<Null or $.Toybox.Lang.Object>'.
var id = mIdentifier as Lang.String;
if (mService == null) {
var url = (Properties.getValue("api_url") as Lang.String) + "/services/" + id.substring(0, id.find(".")) + "/" + id.substring(id.find(".")+1, id.length());
if (Globals.scDebug) {
System.println("HomeAssistantMenuItem execScript() URL=" + url);
System.println("HomeAssistantMenuItem execScript() mIdentifier=" + mIdentifier);
}
Communications.makeWebRequest(
url,
null,
options,
method(:onReturnExecScript)
);
} else {
var url = (Properties.getValue("api_url") as Lang.String) + "/services/" + mService.substring(0, mService.find(".")) + "/" + mService.substring(mService.find(".")+1, null);
if (Globals.scDebug) {
System.println("HomeAssistantMenuItem execScript() URL=" + url);
System.println("HomeAssistantMenuItem execScript() mIdentifier=" + mIdentifier);
}
Communications.makeWebRequest(
url,
{
"entity_id" => id
},
options,
method(:onReturnExecScript)
);
}
Communications.makeWebRequest(
url,
null,
options,
method(:onReturnExecScript)
);
} else {
if (Globals.debug) {
System.println("HomeAssistantMenuItem Note - executeScript(): No Internet connection, skipping API call.");
if (Globals.scDebug) {
System.println("HomeAssistantMenuItem execScript(): No Internet connection, skipping API call.");
}
new Alert({
:timeout => Globals.alertTimeout,
:font => Graphics.FONT_SYSTEM_TINY,
:text => strNoInternet,
:fgcolor => Graphics.COLOR_RED,
:bgcolor => Graphics.COLOR_BLACK
}).pushView(WatchUi.SLIDE_IMMEDIATE);
WatchUi.pushView(new ErrorView(strNoInternet + "."), new ErrorDelegate(), WatchUi.SLIDE_UP);
}
}

View File

@ -24,8 +24,11 @@ using Toybox.Graphics;
using Toybox.Application.Properties;
class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem {
hidden var api_key = Properties.getValue("api_key");
hidden var strNoInternet as Lang.String;
hidden var mApiKey as Lang.String;
hidden var strNoInternet as Lang.String;
hidden var strApiFlood as Lang.String;
hidden var strApiUrlNotFound as Lang.String;
hidden var strUnhandledHttpErr as Lang.String;
function initialize(
label as Lang.String or Lang.Symbol,
@ -40,9 +43,12 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem {
:icon as Graphics.BitmapType or WatchUi.Drawable or Lang.Symbol
} or Null
) {
strNoInternet = WatchUi.loadResource($.Rez.Strings.NoInternet);
strNoInternet = WatchUi.loadResource($.Rez.Strings.NoInternet);
strApiFlood = WatchUi.loadResource($.Rez.Strings.ApiFlood);
strApiUrlNotFound = WatchUi.loadResource($.Rez.Strings.ApiUrlNotFound);
strUnhandledHttpErr = WatchUi.loadResource($.Rez.Strings.UnhandledHttpErr);
mApiKey = Properties.getValue("api_key");
WatchUi.ToggleMenuItem.initialize(label, subLabel, identifier, enabled, options);
api_key = Properties.getValue("api_key");
}
private function setUiToggle(state as Null or Lang.String) as Void {
@ -60,19 +66,46 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem {
// Callback function after completing the GET request to fetch the status.
//
function onReturnGetState(responseCode as Lang.Number, data as Null or Lang.Dictionary or Lang.String) as Void {
if (Globals.debug) {
if (Globals.scDebug) {
System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Code: " + responseCode);
System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Data: " + data);
}
if (responseCode == 200) {
if (responseCode == Communications.BLE_QUEUE_FULL) {
if (Globals.scDebug) {
System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Code: BLE_QUEUE_FULL, API calls too rapid.");
}
var cw = WatchUi.getCurrentView();
if (!(cw[0] instanceof ErrorView)) {
// Avoid pushing multiple ErrorViews
WatchUi.pushView(new ErrorView(strApiFlood), new ErrorDelegate(), WatchUi.SLIDE_UP);
}
// Now this feels very "closely coupled" to the application, but it is the most reliable method instead of using a timer.
getApp().updateNextMenuItem();
} else if (responseCode == 404) {
if (Globals.scDebug) {
System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Code: 404, page not found. Check API URL setting.");
}
var cw = WatchUi.getCurrentView();
if (!(cw[0] instanceof ErrorView)) {
// Avoid pushing multiple ErrorViews
WatchUi.pushView(new ErrorView(strApiUrlNotFound), new ErrorDelegate(), WatchUi.SLIDE_UP);
}
} else if (responseCode == 200) {
var state = data.get("state") as Lang.String;
if (Globals.debug) {
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);
// Now this feels very "closely coupled" to the application, but it is the most reliable method instead of using a timer.
getApp().updateNextMenuItem();
} else {
if (Globals.scDebug) {
System.println("HomeAssistantToggleMenuItem onReturnGetState(): Unhandled HTTP response code = " + responseCode);
}
WatchUi.pushView(new ErrorView(strUnhandledHttpErr + responseCode ), new ErrorDelegate(), WatchUi.SLIDE_UP);
}
}
@ -80,14 +113,14 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem {
var options = {
:method => Communications.HTTP_REQUEST_METHOD_GET,
:headers => {
"Authorization" => "Bearer " + api_key
"Authorization" => "Bearer " + mApiKey
},
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
};
if (System.getDeviceSettings().phoneConnected && System.getDeviceSettings().connectionAvailable) {
var url = Properties.getValue("api_url") + "/states/" + mIdentifier;
if (Globals.debug) {
System.println("URL=" + url);
if (Globals.scDebug) {
System.println("HomeAssistantToggleMenuItem getState() URL=" + url);
}
Communications.makeWebRequest(
url,
@ -96,38 +129,51 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem {
method(:onReturnGetState)
);
} else {
if (Globals.debug) {
System.println("HomeAssistantToggleMenuItem Note - getState(): No Internet connection, skipping API call.");
if (Globals.scDebug) {
System.println("HomeAssistantToggleMenuItem getState(): No Internet connection, skipping API call.");
}
new Alert({
:timeout => Globals.alertTimeout,
:font => Graphics.FONT_SYSTEM_TINY,
:text => strNoInternet,
:fgcolor => Graphics.COLOR_RED,
:bgcolor => Graphics.COLOR_BLACK
}).pushView(WatchUi.SLIDE_IMMEDIATE);
WatchUi.pushView(new ErrorView(strNoInternet + "."), new ErrorDelegate(), WatchUi.SLIDE_UP);
}
}
// Callback function after completing the POST request to set the status.
//
function onReturnSetState(responseCode as Lang.Number, data as Null or Lang.Dictionary or Lang.String) as Void {
if (Globals.debug) {
System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Code: " + responseCode);
System.println("HomeAssistantToggleMenuItem onReturnGetState() Response Data: " + data);
if (Globals.scDebug) {
System.println("HomeAssistantToggleMenuItem onReturnSetState() Response Code: " + responseCode);
System.println("HomeAssistantToggleMenuItem onReturnSetState() Response Data: " + data);
}
if (responseCode == 200) {
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);
} else if (responseCode == 404) {
if (Globals.scDebug) {
System.println("HomeAssistantToggleMenuItem onReturnSetState() Response Code: 404, page not found. Check API URL setting.");
}
var cw = WatchUi.getCurrentView();
if (!(cw[0] instanceof ErrorView)) {
// Avoid pushing multiple ErrorViews
WatchUi.pushView(new ErrorView(strApiUrlNotFound), new ErrorDelegate(), WatchUi.SLIDE_UP);
}
} else if (responseCode == 200) {
var state;
var d = data as Lang.Array;
for(var i = 0; i < d.size(); i++) {
if ((d[i].get("entity_id") as Lang.String).equals(mIdentifier)) {
state = d[i].get("state") as Lang.String;
if (Globals.debug) {
if (Globals.scDebug) {
System.println((d[i].get("attributes") as Lang.Dictionary).get("friendly_name") + " State=" + state);
}
setUiToggle(state);
}
}
} else {
if (Globals.scDebug) {
System.println("HomeAssistantToggleMenuItem onReturnSetState(): Unhandled HTTP response code = " + responseCode);
}
WatchUi.pushView(new ErrorView(strUnhandledHttpErr + responseCode ), new ErrorDelegate(), WatchUi.SLIDE_UP);
}
}
@ -136,20 +182,23 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem {
:method => Communications.HTTP_REQUEST_METHOD_POST,
:headers => {
"Content-Type" => Communications.REQUEST_CONTENT_TYPE_JSON,
"Authorization" => "Bearer " + api_key
"Authorization" => "Bearer " + mApiKey
},
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
};
if (System.getDeviceSettings().phoneConnected && System.getDeviceSettings().connectionAvailable) {
// Updated SDK and got a new error
// ERROR: venu: Cannot find symbol ':substring' on type 'PolyType<Null or $.Toybox.Lang.Object>'.
var id = mIdentifier as Lang.String;
var url;
if (s) {
url = Properties.getValue("api_url") + "/services/" + mIdentifier.substring(0, mIdentifier.find(".")) + "/turn_on";
url = Properties.getValue("api_url") + "/services/" + id.substring(0, id.find(".")) + "/turn_on";
} else {
url = Properties.getValue("api_url") + "/services/" + mIdentifier.substring(0, mIdentifier.find(".")) + "/turn_off";
url = Properties.getValue("api_url") + "/services/" + id.substring(0, id.find(".")) + "/turn_off";
}
if (Globals.debug) {
System.println("URL=" + url);
System.println("mIdentifier=" + mIdentifier);
if (Globals.scDebug) {
System.println("HomeAssistantToggleMenuItem setState() URL=" + url);
System.println("HomeAssistantToggleMenuItem setState() mIdentifier=" + mIdentifier);
}
Communications.makeWebRequest(
url,
@ -160,16 +209,10 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem {
method(:onReturnSetState)
);
} else {
if (Globals.debug) {
System.println("HomeAssistantToggleMenuItem Note - setState(): No Internet connection, skipping API call.");
if (Globals.scDebug) {
System.println("HomeAssistantToggleMenuItem setState(): No Internet connection, skipping API call.");
}
new Alert({
:timeout => Globals.alertTimeout,
:font => Graphics.FONT_SYSTEM_TINY,
:text => strNoInternet,
:fgcolor => Graphics.COLOR_RED,
:bgcolor => Graphics.COLOR_BLACK
}).pushView(WatchUi.SLIDE_IMMEDIATE);
WatchUi.pushView(new ErrorView(strNoInternet + "."), new ErrorDelegate(), WatchUi.SLIDE_UP);
}
}

View File

@ -24,6 +24,9 @@ using Toybox.WatchUi;
class HomeAssistantView extends WatchUi.Menu2 {
hidden var strMenuItemTap as Lang.String;
// List of items that need to have their status updated periodically
hidden var mListToggleItems = [];
hidden var mListMenuItems = [];
function initialize(
definition as Lang.Dictionary,
@ -50,70 +53,53 @@ class HomeAssistantView extends WatchUi.Menu2 {
var items = definition.get("items") as Lang.Dictionary;
for(var i = 0; i < items.size(); i++) {
var type = items[i].get("type") as Lang.String or Null;
var name = items[i].get("name") as Lang.String or Null;
var entity = items[i].get("entity") as Lang.String or Null;
var type = items[i].get("type") as Lang.String or Null;
var name = items[i].get("name") as Lang.String or Null;
var entity = items[i].get("entity") as Lang.String or Null;
var service = items[i].get("service") as Lang.String or Null;
if (type != null && name != null && entity != null) {
if (type.equals("toggle")) {
addItem(
new HomeAssistantToggleMenuItem(
name,
toggle_obj,
entity,
false,
null
)
var item = new HomeAssistantToggleMenuItem(
name,
toggle_obj,
entity,
false,
null
);
addItem(item);
mListToggleItems.add(item);
} else if (type.equals("tap")) {
addItem(
new HomeAssistantMenuItem(
name,
strMenuItemTap,
entity,
service,
null
)
);
} else if (type.equals("group")) {
addItem(
new HomeAssistantViewMenuItem(items[i])
);
var item = new HomeAssistantViewMenuItem(items[i]);
addItem(item);
mListMenuItems.add(item);
}
}
}
}
function getItemsToUpdate() as Lang.Array<HomeAssistantToggleMenuItem> {
var fullList = [];
var lmi = mListMenuItems as Lang.Array<HomeAssistantViewMenuItem>;
for(var i = 0; i < lmi.size(); i++) {
fullList.addAll(lmi[i].getMenuView().getItemsToUpdate());
}
return fullList.addAll(mListToggleItems);
}
// Called when this View is brought to the foreground. Restore
// the state of this View and prepare it to be shown. This includes
// loading resources into memory.
function onShow() as Void {
for(var i = 0; i < mItems.size(); i++) {
if (mItems[i] instanceof HomeAssistantToggleMenuItem) {
var toggleItem = mItems[i] as HomeAssistantToggleMenuItem;
toggleItem.getState();
if (Globals.debug) {
System.println("HomeAssistantView Note: " + toggleItem.getLabel() + " ID=" + toggleItem.getId() + " Enabled=" + toggleItem.isEnabled());
}
}
}
}
function stateUpdate() as Void {
for(var i = 0; i < mItems.size(); i++) {
if (mItems[i] instanceof HomeAssistantToggleMenuItem) {
var toggleItem = mItems[i] as HomeAssistantToggleMenuItem;
toggleItem.getState();
if (Globals.debug) {
System.println("HomeAssistantView Toggle stateUpdate: " + toggleItem.getLabel() + " ID=" + toggleItem.getId() + " Enabled=" + toggleItem.isEnabled());
}
} else if (mItems[i] instanceof HomeAssistantViewMenuItem) {
var menu = mItems[i] as HomeAssistantViewMenuItem;
if (Globals.debug) {
System.println("HomeAssistantView Menu stateUpdate: " + menu.getLabel() + " ID=" + menu.getId());
}
menu.getMenuView().stateUpdate();
}
}
}
function onShow() as Void {}
}
@ -129,25 +115,25 @@ class HomeAssistantViewDelegate extends WatchUi.Menu2InputDelegate {
function onSelect(item as WatchUi.MenuItem) as Void {
if (item instanceof HomeAssistantToggleMenuItem) {
var haToggleItem = item as HomeAssistantToggleMenuItem;
if (Globals.debug) {
if (Globals.scDebug) {
System.println(haToggleItem.getLabel() + " " + haToggleItem.getId() + " " + haToggleItem.isEnabled());
}
haToggleItem.setState(haToggleItem.isEnabled());
} else if (item instanceof HomeAssistantMenuItem) {
var haItem = item as HomeAssistantMenuItem;
if (Globals.debug) {
if (Globals.scDebug) {
System.println(haItem.getLabel() + " " + haItem.getId());
}
haItem.execScript();
} else if (item instanceof HomeAssistantViewMenuItem) {
var haMenuItem = item as HomeAssistantViewMenuItem;
if (Globals.debug) {
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);
} else {
if (Globals.debug) {
if (Globals.scDebug) {
System.println(item.getLabel() + " " + item.getId());
}
}

View File

@ -22,7 +22,7 @@ using Toybox.Lang;
using Toybox.WatchUi;
class HomeAssistantViewMenuItem extends WatchUi.MenuItem {
hidden var menu as HomeAssistantView;
hidden var mMenu as HomeAssistantView;
function initialize(definition as Lang.Dictionary) {
// definitions.get(...) are Strings here as they have been checked by HomeAssistantView first
@ -33,11 +33,11 @@ class HomeAssistantViewMenuItem extends WatchUi.MenuItem {
null
);
menu = new HomeAssistantView(definition, null);
mMenu = new HomeAssistantView(definition, null);
}
function getMenuView() as HomeAssistantView {
return menu;
return mMenu;
}
}

View File

@ -23,7 +23,7 @@ using Toybox.WatchUi;
using Toybox.Math;
class ScalableView extends WatchUi.View {
hidden var screenWidth;
hidden var mScreenWidth;
function initialize() {
View.initialize();
@ -40,9 +40,9 @@ class ScalableView extends WatchUi.View {
// height > width.
//
function pixelsForScreen(pc as Lang.Float) as Lang.Number {
if (screenWidth == null) {
screenWidth = System.getDeviceSettings().screenWidth;
if (mScreenWidth == null) {
mScreenWidth = System.getDeviceSettings().screenWidth;
}
return Math.round(pc * screenWidth) / 100;
return Math.round(pc * mScreenWidth) / 100;
}
}