Configurable Menu

Uses a JSON file served by a URL.
This commit is contained in:
Philip Abbey
2023-10-31 20:49:38 +00:00
parent 8a4f514e6b
commit 7dd3ccc670
14 changed files with 550 additions and 137 deletions

View File

@ -1,3 +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_icon.png" />
</drawables>

View File

@ -1,6 +0,0 @@
<layout id="MainLayout">
<label x="center" y="5" text="@Strings.prompt" color="Graphics.COLOR_BLACK" justification="Graphics.TEXT_JUSTIFY_CENTER" />
<!--
<bitmap id="id_monkey" x="center" y="30" filename="../drawables/monkey.png" />
-->
</layout>

View File

@ -1,4 +0,0 @@
<menu id="MainMenu">
<menu-item id="item_1" label="@Strings.menu_label_1" />
<menu-item id="item_2" label="@Strings.menu_label_2" />
</menu>

View File

@ -1,3 +1,26 @@
<!--
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
-->
<properties>
<property id="api_key" type="string"></property>
<property id="api_key" type="string">eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiI1OTEzODI3NzhiNDI0MzU5OGVmYzY4ZmM2YzZiZTU3ZCIsImlhdCI6MTY5ODU3MDg0MywiZXhwIjoyMDEzOTMwODQzfQ.vskr0ERbnEXjB51vVHwlXosy3JK3v1znHzv8Hiej8zA</property>
<!--
Internal URL "https://homeassistant.local/api"
External URL "https://<dynamic DNS>/api"
-->
<property id="api_url" type="string">https://home.abbey1.org.uk/api</property>
<!-- Best be a public URL in order to work away from your home LAN and have a trusted HTTPS certificate -->
<property id="config_url" type="string">https://home.abbey1.org.uk/local/garmin/philip.json</property>
</properties>

View File

@ -1,3 +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
-->
<settings>
<setting
propertyKey="@Properties.api_key"
@ -8,4 +22,24 @@
type="alphaNumeric"
/>
</setting>
<setting
propertyKey="@Properties.api_url"
title="URL for Home Assistant API"
prompt="https://homeassistant.local/api"
>
<settingConfig
type="alphaNumeric"
/>
</setting>
<setting
propertyKey="@Properties.config_url"
title="URL for menu configuration (JSON)"
prompt="https://homeassistant.local/local/garmin/menu.json"
>
<settingConfig
type="alphaNumeric"
/>
</setting>
</settings>

View File

@ -1,8 +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
-->
<strings>
<string id="AppName">HomeAssistant</string>
<string id="prompt">Click the menu button</string>
<string id="menu_label_1">Item 1</string>
<string id="menu_label_2">Item 2</string>
</strings>