mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-05-01 21:22:40 +00:00
Merge pull request #12 from house-of-abbey/11-impose-the-requirement-for-a-service-field-for-taps
Tap menu items without a service tag will be ignored.
This commit is contained in:
@ -138,7 +138,7 @@ class HomeAssistantApp extends Application.AppBase {
|
||||
|
||||
function fetchMenuConfig() as Void {
|
||||
var options = {
|
||||
:method => Communications.HTTP_REQUEST_METHOD_GET,
|
||||
:method => Communications.HTTP_REQUEST_METHOD_GET,
|
||||
:responseType => Communications.HTTP_RESPONSE_CONTENT_TYPE_JSON
|
||||
};
|
||||
Communications.makeWebRequest(
|
||||
|
@ -32,11 +32,11 @@ class HomeAssistantMenuItem extends WatchUi.MenuItem {
|
||||
hidden var mService as Lang.String;
|
||||
|
||||
function initialize(
|
||||
label as Lang.String or Lang.Symbol,
|
||||
subLabel as Lang.String or Lang.Symbol or Null,
|
||||
label as Lang.String or Lang.Symbol,
|
||||
subLabel as Lang.String or Lang.Symbol or Null,
|
||||
identifier as Lang.Object or Null,
|
||||
service as Lang.String or Null,
|
||||
options as {
|
||||
service as Lang.String or Null,
|
||||
options as {
|
||||
:alignment as WatchUi.MenuItem.Alignment,
|
||||
:icon as Graphics.BitmapType or WatchUi.Drawable or Lang.Symbol
|
||||
} or Null
|
||||
|
@ -31,16 +31,16 @@ class HomeAssistantToggleMenuItem extends WatchUi.ToggleMenuItem {
|
||||
hidden var strUnhandledHttpErr as Lang.String;
|
||||
|
||||
function initialize(
|
||||
label as Lang.String or Lang.Symbol,
|
||||
label as Lang.String or Lang.Symbol,
|
||||
subLabel as Lang.String or Lang.Symbol or {
|
||||
:enabled as Lang.String or Lang.Symbol or Null,
|
||||
:disabled as Lang.String or Lang.Symbol or Null
|
||||
} or Null,
|
||||
identifier,
|
||||
enabled as Lang.Boolean,
|
||||
options as {
|
||||
enabled as Lang.Boolean,
|
||||
options as {
|
||||
:alignment as WatchUi.MenuItem.Alignment,
|
||||
:icon as Graphics.BitmapType or WatchUi.Drawable or Lang.Symbol
|
||||
:icon as Graphics.BitmapType or WatchUi.Drawable or Lang.Symbol
|
||||
} or Null
|
||||
) {
|
||||
strNoInternet = WatchUi.loadResource($.Rez.Strings.NoInternet);
|
||||
|
@ -68,7 +68,7 @@ class HomeAssistantView extends WatchUi.Menu2 {
|
||||
);
|
||||
addItem(item);
|
||||
mListToggleItems.add(item);
|
||||
} else if (type.equals("tap")) {
|
||||
} else if (type.equals("tap") && service != null) {
|
||||
addItem(
|
||||
new HomeAssistantMenuItem(
|
||||
name,
|
||||
|
Reference in New Issue
Block a user