mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-08-03 18:38:35 +00:00
Fix naming
This commit is contained in:
@ -83,7 +83,7 @@ class Settings {
|
|||||||
if ((System has :ServiceDelegate) and (Background.getTemporalEventRegisteredTime() != null)) {
|
if ((System has :ServiceDelegate) and (Background.getTemporalEventRegisteredTime() != null)) {
|
||||||
Background.deleteTemporalEvent();
|
Background.deleteTemporalEvent();
|
||||||
}
|
}
|
||||||
removeWebhookId();
|
unsetWebhookId();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (Globals.scDebug) {
|
if (Globals.scDebug) {
|
||||||
@ -109,7 +109,7 @@ class Settings {
|
|||||||
Properties.setValue("webhook_id", mWebhookId);
|
Properties.setValue("webhook_id", mWebhookId);
|
||||||
}
|
}
|
||||||
|
|
||||||
static function removeWebhookId() {
|
static function unsetWebhookId() {
|
||||||
mWebhookId = "";
|
mWebhookId = "";
|
||||||
Properties.setValue("webhook_id", mWebhookId);
|
Properties.setValue("webhook_id", mWebhookId);
|
||||||
}
|
}
|
||||||
@ -155,7 +155,7 @@ class Settings {
|
|||||||
return mIsWidgetStartNoTap;
|
return mIsWidgetStartNoTap;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function disableBatteryLevel() {
|
static function unsetIsBatteryLevelEnabled() {
|
||||||
mIsBatteryLevelEnabled = false;
|
mIsBatteryLevelEnabled = false;
|
||||||
Properties.setValue("enable_battery_level", mIsBatteryLevelEnabled);
|
Properties.setValue("enable_battery_level", mIsBatteryLevelEnabled);
|
||||||
if ((System has :ServiceDelegate) and (Background.getTemporalEventRegisteredTime() != null)) {
|
if ((System has :ServiceDelegate) and (Background.getTemporalEventRegisteredTime() != null)) {
|
||||||
|
@ -38,7 +38,7 @@ class WebhookManager {
|
|||||||
if (Globals.scDebug) {
|
if (Globals.scDebug) {
|
||||||
System.println("WebhookManager onReturnRequestWebhookId() Response Code: INVALID_HTTP_BODY_IN_NETWORK_RESPONSE, check JSON is returned.");
|
System.println("WebhookManager onReturnRequestWebhookId() Response Code: INVALID_HTTP_BODY_IN_NETWORK_RESPONSE, check JSON is returned.");
|
||||||
}
|
}
|
||||||
Settings.disableBatteryLevel();
|
Settings.unsetIsBatteryLevelEnabled();
|
||||||
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getNoJson());
|
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getNoJson());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -46,7 +46,7 @@ class WebhookManager {
|
|||||||
if (Globals.scDebug) {
|
if (Globals.scDebug) {
|
||||||
System.println("WebhookManager onReturnRequestWebhookId() Response Code: 404, page not found. Check API URL setting.");
|
System.println("WebhookManager onReturnRequestWebhookId() Response Code: 404, page not found. Check API URL setting.");
|
||||||
}
|
}
|
||||||
Settings.disableBatteryLevel();
|
Settings.unsetIsBatteryLevelEnabled();
|
||||||
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getApiUrlNotFound());
|
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getApiUrlNotFound());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -78,7 +78,7 @@ class WebhookManager {
|
|||||||
if (Globals.scDebug) {
|
if (Globals.scDebug) {
|
||||||
System.println("WebhookManager onReturnRequestWebhookId(): No webhook id in response data.");
|
System.println("WebhookManager onReturnRequestWebhookId(): No webhook id in response data.");
|
||||||
}
|
}
|
||||||
Settings.disableBatteryLevel();
|
Settings.unsetIsBatteryLevelEnabled();
|
||||||
ErrorView.show(RezStrings.getWebhookFailed());
|
ErrorView.show(RezStrings.getWebhookFailed());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -87,7 +87,7 @@ class WebhookManager {
|
|||||||
if (Globals.scDebug) {
|
if (Globals.scDebug) {
|
||||||
System.println("WebhookManager onReturnRequestWebhookId(): Unhandled HTTP response code = " + responseCode);
|
System.println("WebhookManager onReturnRequestWebhookId(): Unhandled HTTP response code = " + responseCode);
|
||||||
}
|
}
|
||||||
Settings.disableBatteryLevel();
|
Settings.unsetIsBatteryLevelEnabled();
|
||||||
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getUnhandledHttpErr() + responseCode);
|
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getUnhandledHttpErr() + responseCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -130,7 +130,7 @@ class WebhookManager {
|
|||||||
if (Globals.scDebug) {
|
if (Globals.scDebug) {
|
||||||
System.println("WebhookManager onReturnRegisterWebhookSensor() Response Code: BLE_HOST_TIMEOUT or BLE_CONNECTION_UNAVAILABLE, Bluetooth connection severed.");
|
System.println("WebhookManager onReturnRegisterWebhookSensor() Response Code: BLE_HOST_TIMEOUT or BLE_CONNECTION_UNAVAILABLE, Bluetooth connection severed.");
|
||||||
}
|
}
|
||||||
Settings.removeWebhookId();
|
Settings.unsetWebhookId();
|
||||||
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getNoPhone() + ".");
|
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getNoPhone() + ".");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -138,7 +138,7 @@ class WebhookManager {
|
|||||||
if (Globals.scDebug) {
|
if (Globals.scDebug) {
|
||||||
System.println("WebhookManager onReturnRegisterWebhookSensor() Response Code: BLE_QUEUE_FULL, API calls too rapid.");
|
System.println("WebhookManager onReturnRegisterWebhookSensor() Response Code: BLE_QUEUE_FULL, API calls too rapid.");
|
||||||
}
|
}
|
||||||
Settings.removeWebhookId();
|
Settings.unsetWebhookId();
|
||||||
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getApiFlood());
|
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getApiFlood());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -146,7 +146,7 @@ class WebhookManager {
|
|||||||
if (Globals.scDebug) {
|
if (Globals.scDebug) {
|
||||||
System.println("WebhookManager onReturnRegisterWebhookSensor() Response Code: NETWORK_REQUEST_TIMED_OUT, check Internet connection.");
|
System.println("WebhookManager onReturnRegisterWebhookSensor() Response Code: NETWORK_REQUEST_TIMED_OUT, check Internet connection.");
|
||||||
}
|
}
|
||||||
Settings.removeWebhookId();
|
Settings.unsetWebhookId();
|
||||||
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getNoResponse());
|
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getNoResponse());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -154,15 +154,15 @@ class WebhookManager {
|
|||||||
if (Globals.scDebug) {
|
if (Globals.scDebug) {
|
||||||
System.println("WebhookManager onReturnRegisterWebhookSensor() Response Code: NETWORK_RESPONSE_OUT_OF_MEMORY, are we going too fast?");
|
System.println("WebhookManager onReturnRegisterWebhookSensor() Response Code: NETWORK_RESPONSE_OUT_OF_MEMORY, are we going too fast?");
|
||||||
}
|
}
|
||||||
Settings.removeWebhookId();
|
Settings.unsetWebhookId();
|
||||||
// Ignore and see if we can carry on
|
// Ignore and see if we can carry on
|
||||||
break;
|
break;
|
||||||
case Communications.INVALID_HTTP_BODY_IN_NETWORK_RESPONSE:
|
case Communications.INVALID_HTTP_BODY_IN_NETWORK_RESPONSE:
|
||||||
if (Globals.scDebug) {
|
if (Globals.scDebug) {
|
||||||
System.println("WebhookManager onReturnRegisterWebhookSensor() Response Code: INVALID_HTTP_BODY_IN_NETWORK_RESPONSE, check JSON is returned.");
|
System.println("WebhookManager onReturnRegisterWebhookSensor() Response Code: INVALID_HTTP_BODY_IN_NETWORK_RESPONSE, check JSON is returned.");
|
||||||
}
|
}
|
||||||
Settings.removeWebhookId();
|
Settings.unsetWebhookId();
|
||||||
Settings.disableBatteryLevel();
|
Settings.unsetIsBatteryLevelEnabled();
|
||||||
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getNoJson());
|
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getNoJson());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -170,8 +170,8 @@ class WebhookManager {
|
|||||||
if (Globals.scDebug) {
|
if (Globals.scDebug) {
|
||||||
System.println("WebhookManager onReturnRequestWebhookId() Response Code: 404, page not found. Check API URL setting.");
|
System.println("WebhookManager onReturnRequestWebhookId() Response Code: 404, page not found. Check API URL setting.");
|
||||||
}
|
}
|
||||||
Settings.removeWebhookId();
|
Settings.unsetWebhookId();
|
||||||
Settings.disableBatteryLevel();
|
Settings.unsetIsBatteryLevelEnabled();
|
||||||
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getApiUrlNotFound());
|
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getApiUrlNotFound());
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -184,8 +184,8 @@ class WebhookManager {
|
|||||||
if (Globals.scDebug) {
|
if (Globals.scDebug) {
|
||||||
System.println("WebhookManager onReturnRegisterWebhookSensor(): Failure");
|
System.println("WebhookManager onReturnRegisterWebhookSensor(): Failure");
|
||||||
}
|
}
|
||||||
Settings.removeWebhookId();
|
Settings.unsetWebhookId();
|
||||||
Settings.disableBatteryLevel();
|
Settings.unsetIsBatteryLevelEnabled();
|
||||||
ErrorView.show(RezStrings.getWebhookFailed());
|
ErrorView.show(RezStrings.getWebhookFailed());
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -194,8 +194,8 @@ class WebhookManager {
|
|||||||
if (Globals.scDebug) {
|
if (Globals.scDebug) {
|
||||||
System.println("WebhookManager onReturnRequestWebhookId(): Unhandled HTTP response code = " + responseCode);
|
System.println("WebhookManager onReturnRequestWebhookId(): Unhandled HTTP response code = " + responseCode);
|
||||||
}
|
}
|
||||||
Settings.removeWebhookId();
|
Settings.unsetWebhookId();
|
||||||
Settings.disableBatteryLevel();
|
Settings.unsetIsBatteryLevelEnabled();
|
||||||
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getUnhandledHttpErr() + responseCode);
|
ErrorView.show(RezStrings.getWebhookFailed() + "\n" + RezStrings.getUnhandledHttpErr() + responseCode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user