mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-06-17 03:48:32 +00:00
Initial fixes
This commit is contained in:
@ -122,9 +122,12 @@ class HomeAssistantService {
|
||||
// System.println("HomeAssistantService call() URL=" + url);
|
||||
// System.println("HomeAssistantService call() service=" + service);
|
||||
|
||||
var entity_id = data.get("entity_id");
|
||||
if (entity_id == null) {
|
||||
entity_id = "";
|
||||
var entity_id = "";
|
||||
if (data != null) {
|
||||
entity_id = data.get("entity_id");
|
||||
if (entity_id == null) {
|
||||
entity_id = "";
|
||||
}
|
||||
}
|
||||
|
||||
Communications.makeWebRequest(
|
||||
@ -141,7 +144,7 @@ class HomeAssistantService {
|
||||
},
|
||||
method(:onReturnCall)
|
||||
);
|
||||
if (mHasVibrate) {
|
||||
if (mHasVibrate and Settings.getVibrate()) {
|
||||
Attention.vibrate([
|
||||
new Attention.VibeProfile(50, 100), // On for 100ms
|
||||
new Attention.VibeProfile( 0, 100), // Off for 100ms
|
||||
|
@ -34,6 +34,7 @@ class Settings {
|
||||
private static var mConfigUrl as Lang.String = "";
|
||||
private static var mCacheConfig as Lang.Boolean = false;
|
||||
private static var mClearCache as Lang.Boolean = false;
|
||||
private static var mVibrate as Lang.Boolean = false;
|
||||
private static var mAppTimeout as Lang.Number = 0; // seconds
|
||||
private static var mConfirmTimeout as Lang.Number = 3; // seconds
|
||||
private static var mMenuAlignment as Lang.Number = WatchUi.MenuItem.MENU_ITEM_LABEL_ALIGN_LEFT;
|
||||
@ -54,6 +55,7 @@ class Settings {
|
||||
mConfigUrl = Properties.getValue("config_url");
|
||||
mCacheConfig = Properties.getValue("cache_config");
|
||||
mClearCache = Properties.getValue("clear_cache");
|
||||
mVibrate = Properties.getValue("enable_vibration");
|
||||
mAppTimeout = Properties.getValue("app_timeout");
|
||||
mConfirmTimeout = Properties.getValue("confirm_timeout");
|
||||
mMenuAlignment = Properties.getValue("menu_alignment");
|
||||
@ -130,6 +132,10 @@ class Settings {
|
||||
Properties.setValue("clear_cache", mClearCache);
|
||||
}
|
||||
|
||||
static function getVibrate() as Lang.Boolean {
|
||||
return mVibrate;
|
||||
}
|
||||
|
||||
static function getAppTimeout() as Lang.Number {
|
||||
return mAppTimeout * 1000; // Convert to milliseconds
|
||||
}
|
||||
|
Reference in New Issue
Block a user