mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2026-07-08 11:53:32 +00:00
Compare commits
6 Commits
a97440b997
...
e1a2ca7c2c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e1a2ca7c2c | ||
|
|
02a9472ac1 | ||
|
|
e0b5978406 | ||
|
|
c48d74138a | ||
|
|
3404c7f679 | ||
|
|
8c5bdbc1f8 |
@@ -59,3 +59,4 @@
|
||||
| 3.11 | <img src="images/Venu2_glance_default.png" width="200" title="Default Glance"/><br/>Better handling of menus larger than the Glance view can handle. As a result the Glance can no longer verify the availability of the JSON menu as fetching it might cause an _"Error: Out Of Memory Error"_. Provide two user supplied HTTP Headers. Bug fix for the numeric picker. |
|
||||
| 3.12 | Amended GPS accuracy values used by the background service. |
|
||||
| 3.13 | Added support for new devices: `d2mach2pro`, `fr170`, `fr170m`, `fr70`. |
|
||||
| 3.14 | Numeric items now support `tap_action.data` fields so service call options like `transition` are catered for. See the documentation on [Additional Action Data](https://github.com/house-of-abbey/GarminHomeAssistant/blob/main/examples/Numeric.md#additional-action-data). This features has been provided by [@StumblingGamer](https://github.com/StumblingGamer). Now prevent PIN enabled menu items from being enabled on non-touch screen devices. The PIN must be removed for the menu item to function. Fix for initialising numeric pickers with no user defined template. |
|
||||
@@ -251,7 +251,8 @@
|
||||
"$ref": "#/$defs/content"
|
||||
},
|
||||
"tap_action": {
|
||||
"$ref": "#/$defs/tap_action",
|
||||
"title": "Tap Action",
|
||||
"description": "Numeric tap action definition to include the number picker. 'confirm', 'pin' and 'exit' fields are optional.",
|
||||
"properties": {
|
||||
"action": {
|
||||
"$ref": "#/$defs/action"
|
||||
@@ -294,13 +295,24 @@
|
||||
"max",
|
||||
"step",
|
||||
"data_attribute"
|
||||
]
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"confirm": {
|
||||
"$ref": "#/$defs/confirm"
|
||||
},
|
||||
"pin": {
|
||||
"$ref": "#/$defs/pin"
|
||||
},
|
||||
"exit": {
|
||||
"$ref": "#/$defs/exit"
|
||||
}
|
||||
},
|
||||
"required": [
|
||||
"action",
|
||||
"picker"
|
||||
]
|
||||
],
|
||||
"additionalProperties": false
|
||||
},
|
||||
"enabled": {
|
||||
"$ref": "#/$defs/enabled"
|
||||
@@ -987,7 +999,7 @@
|
||||
"tap_action": {
|
||||
"type": "object",
|
||||
"title": "Tap Action",
|
||||
"description": "'confirm' and 'pin' fields are optional.",
|
||||
"description": "'confirm', 'pin' and 'exit' fields are optional.",
|
||||
"properties": {
|
||||
"confirm": {
|
||||
"$ref": "#/$defs/confirm"
|
||||
|
||||
@@ -133,6 +133,8 @@ class HomeAssistantView extends WatchUi.Menu2 {
|
||||
));
|
||||
}
|
||||
} else if (type.equals("numeric") && action != null) {
|
||||
if (System.getDeviceSettings().isTouchScreen) {
|
||||
// Numeric items are only actionable on touch screen devices.
|
||||
if (tap_action != null) {
|
||||
var picker = tap_action.get("picker") as Lang.Dictionary?;
|
||||
if (picker != null) {
|
||||
@@ -151,6 +153,20 @@ class HomeAssistantView extends WatchUi.Menu2 {
|
||||
));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
addItem(HomeAssistantMenuItemFactory.create().tap(
|
||||
"PIN requires Touchscreen",
|
||||
null,
|
||||
null,
|
||||
null,
|
||||
data,
|
||||
{
|
||||
:exit => false,
|
||||
:confirm => false,
|
||||
:pin => false
|
||||
}
|
||||
));
|
||||
}
|
||||
} else if (type.equals("info") && content != null) {
|
||||
// Cannot exit from a non-actionable information only menu item.
|
||||
addItem(HomeAssistantMenuItemFactory.create().tap(
|
||||
@@ -193,11 +209,9 @@ class HomeAssistantView extends WatchUi.Menu2 {
|
||||
}
|
||||
fullList.addAll(item.getMenuView().getItemsToUpdate());
|
||||
} else if (item instanceof HomeAssistantNumericMenuItem) {
|
||||
// Numeric items can have an optional template to evaluate
|
||||
var nmi = item as HomeAssistantNumericMenuItem;
|
||||
if (nmi.hasTemplate()) {
|
||||
// Numeric items can have an optional template to evaluate, but they must always be included in order
|
||||
// to initialise the numeric picker's value.
|
||||
fullList.add(item);
|
||||
}
|
||||
} else if (item instanceof HomeAssistantToggleMenuItem) {
|
||||
fullList.add(item);
|
||||
} else if (item instanceof HomeAssistantTapMenuItem) {
|
||||
|
||||
Reference in New Issue
Block a user