mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-09-15 13:31:31 +00:00
Compare commits
2 Commits
v3.2
...
27dc66d005
Author | SHA1 | Date | |
---|---|---|---|
|
27dc66d005 | ||
|
9dbae5a64a |
@@ -143,7 +143,7 @@ class HomeAssistantApp extends Application.AppBase {
|
|||||||
} else {
|
} else {
|
||||||
ret = [new WatchUi.View(), new WatchUi.BehaviorDelegate()];
|
ret = [new WatchUi.View(), new WatchUi.BehaviorDelegate()];
|
||||||
}
|
}
|
||||||
// Separated from Settings.update() in order to call after fetchMenuConfig() and not call it on changes settings.
|
// Separated from Settings.update() in order to call after fetchMenuConfig() and not call it on changed settings.
|
||||||
Settings.webhook();
|
Settings.webhook();
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
@@ -262,16 +262,16 @@ class HomeAssistantApp extends Application.AppBase {
|
|||||||
Settings.unsetClearCache();
|
Settings.unsetClearCache();
|
||||||
}
|
}
|
||||||
if (menu == null) {
|
if (menu == null) {
|
||||||
var phoneConnected = System.getDeviceSettings().phoneConnected;
|
var phoneConnected = System.getDeviceSettings().phoneConnected;
|
||||||
var internetAvailable = System.getDeviceSettings().connectionAvailable;
|
var internetAvailable = System.getDeviceSettings().connectionAvailable;
|
||||||
if (! phoneConnected or ! internetAvailable) {
|
if (! phoneConnected or ! internetAvailable) {
|
||||||
|
// System.println("HomeAssistantApp fetchMenuConfig(): No Phone connection, skipping API call.");
|
||||||
var errorRez = $.Rez.Strings.NoPhone;
|
var errorRez = $.Rez.Strings.NoPhone;
|
||||||
if (Settings.getWifiLteExecutionEnabled()) {
|
if (Settings.getWifiLteExecutionEnabled()) {
|
||||||
errorRez = $.Rez.Strings.NoPhoneNoCache;
|
errorRez = $.Rez.Strings.NoPhoneNoCache;
|
||||||
} else if (! internetAvailable) {
|
} else if (! internetAvailable) {
|
||||||
errorRez = $.Rez.Strings.Unavailable;
|
errorRez = $.Rez.Strings.Unavailable;
|
||||||
}
|
}
|
||||||
// System.println("HomeAssistantApp fetchMenuConfig(): No Phone connection, skipping API call.");
|
|
||||||
if (!mIsApp) {
|
if (!mIsApp) {
|
||||||
WatchUi.requestUpdate();
|
WatchUi.requestUpdate();
|
||||||
} else {
|
} else {
|
||||||
@@ -488,11 +488,11 @@ class HomeAssistantApp extends Application.AppBase {
|
|||||||
"template" => template
|
"template" => template
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
if (item instanceof HomeAssistantToggleMenuItem) {
|
if (item instanceof HomeAssistantToggleMenuItem) {
|
||||||
mTemplates.put(i.toString() + "t", {
|
mTemplates.put(i.toString() + "t", {
|
||||||
"template" => (item as HomeAssistantToggleMenuItem).getToggleTemplate()
|
"template" => (item as HomeAssistantToggleMenuItem).getToggleTemplate()
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// https://developers.home-assistant.io/docs/api/native-app-integration/sending-data/#render-templates
|
// https://developers.home-assistant.io/docs/api/native-app-integration/sending-data/#render-templates
|
||||||
|
@@ -100,10 +100,10 @@ class HomeAssistantTapMenuItem extends HomeAssistantMenuItem {
|
|||||||
WatchUi.pushView(
|
WatchUi.pushView(
|
||||||
dialog,
|
dialog,
|
||||||
new WifiLteExecutionConfirmDelegate({
|
new WifiLteExecutionConfirmDelegate({
|
||||||
:type => "service",
|
:type => "service",
|
||||||
:service => mService,
|
:service => mService,
|
||||||
:data => mData,
|
:data => mData,
|
||||||
:exit => mExit,
|
:exit => mExit,
|
||||||
}, dialog),
|
}, dialog),
|
||||||
WatchUi.SLIDE_LEFT
|
WatchUi.SLIDE_LEFT
|
||||||
);
|
);
|
||||||
@@ -112,9 +112,9 @@ class HomeAssistantTapMenuItem extends HomeAssistantMenuItem {
|
|||||||
WatchUi.pushView(
|
WatchUi.pushView(
|
||||||
view,
|
view,
|
||||||
new HomeAssistantConfirmationDelegate({
|
new HomeAssistantConfirmationDelegate({
|
||||||
:callback => method(:onConfirm),
|
:callback => method(:onConfirm),
|
||||||
:confirmationView => view,
|
:confirmationView => view,
|
||||||
:state => false,
|
:state => false,
|
||||||
}),
|
}),
|
||||||
WatchUi.SLIDE_IMMEDIATE
|
WatchUi.SLIDE_IMMEDIATE
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user