mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-06-19 21:08:37 +00:00
Update Settings.mc
Test the phone is connected before attempting WebHook HTTP requests.
This commit is contained in:
@ -70,6 +70,7 @@ class Settings {
|
|||||||
// Manage this inside the application or widget only (not a glance or background service process)
|
// Manage this inside the application or widget only (not a glance or background service process)
|
||||||
if (mIsApp) {
|
if (mIsApp) {
|
||||||
if (mHasService) {
|
if (mHasService) {
|
||||||
|
if (System.getDeviceSettings().phoneConnected) {
|
||||||
mWebhookManager = new WebhookManager();
|
mWebhookManager = new WebhookManager();
|
||||||
if (getWebhookId().equals("")) {
|
if (getWebhookId().equals("")) {
|
||||||
// System.println("Settings update(): Doing full webhook & sensor creation.");
|
// System.println("Settings update(): Doing full webhook & sensor creation.");
|
||||||
@ -107,6 +108,9 @@ class Settings {
|
|||||||
unsetIsSensorsLevelEnabled();
|
unsetIsSensorsLevelEnabled();
|
||||||
unsetWebhookId();
|
unsetWebhookId();
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
ErrorView.show(WatchUi.loadResource($.Rez.Strings.NoPhone) as Lang.String);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
// System.println("Settings update(): getTemporalEventRegisteredTime() = " + Background.getTemporalEventRegisteredTime());
|
// System.println("Settings update(): getTemporalEventRegisteredTime() = " + Background.getTemporalEventRegisteredTime());
|
||||||
// if (Background.getTemporalEventRegisteredTime() != null) {
|
// if (Background.getTemporalEventRegisteredTime() != null) {
|
||||||
|
Reference in New Issue
Block a user