Compare commits

...

6 Commits

Author SHA1 Message Date
Philip Abbey
ca854cab75 Create Venu2_Glance_good.png
Actually a replacement for the one deleted that is used in the App Store.
2026-03-01 15:22:07 +00:00
Philip Abbey
68e7761684 Merge branch 'main' into 343-glance-text-not-visible-on-venu-33s-works-on-one-out-8f-3-devices 2026-03-01 08:39:01 +00:00
Philip Abbey
8893e596ec Update HomeAssistantNumericPicker.mc
Code tidy
2026-03-01 08:29:39 +00:00
Philip Abbey
e9bce71748 Refactor HomeAssistantNumericPicker for improved value parsing (#345)
ref
https://github.com/house-of-abbey/GarminHomeAssistant/issues/238#issuecomment-3941469731

fix numberpicker issue
refactored with Amazon Q
tested on Vivoactive 5 (simulator and device)
tested on Venu2 (simulator only)
2026-03-01 08:24:58 +00:00
poaudet
adc04ea9a2 Refactor HomeAssistantNumericPicker to improve value parsing and initialization 2026-02-28 16:50:28 -05:00
poaudet
7daa07f52f first commit 2026-02-28 14:15:09 -05:00
3 changed files with 15 additions and 11 deletions

1
.gitignore vendored
View File

@@ -7,3 +7,4 @@ Thumbs.db
source/ClientId.mc source/ClientId.mc
# Gemini API key for automated translations # Gemini API key for automated translations
gemini_api_key.txt gemini_api_key.txt
developer_key

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

View File

@@ -30,17 +30,20 @@ class HomeAssistantNumericPicker extends WatchUi.Picker {
factory as HomeAssistantNumericFactory, factory as HomeAssistantNumericFactory,
haItem as HomeAssistantNumericMenuItem haItem as HomeAssistantNumericMenuItem
) { ) {
mItem = haItem; mItem = haItem;
var picker = mItem.getPicker(); var picker = mItem.getPicker();
var min = (picker.get("min") as Lang.String).toFloat(); var minStr = picker.get("min");
var step = (picker.get("step") as Lang.String).toFloat(); var stepStr = picker.get("step");
var val = haItem.getValue(); var val = haItem.getValue();
if (min == null) { var min = 0.0;
min = 0.0; var step = 1.0;
if (minStr != null) {
min = (minStr as Lang.String).toFloat();
} }
if (step == null) { if (stepStr != null) {
step = 1.0; step = (stepStr as Lang.String).toFloat();
} }
WatchUi.Picker.initialize({ WatchUi.Picker.initialize({
@@ -95,4 +98,4 @@ class HomeAssistantNumericPickerDelegate extends WatchUi.PickerDelegate {
mPicker.onConfirm(values[0]); mPicker.onConfirm(values[0]);
return true; return true;
} }
} }