Skip to content

Commit

Permalink
Merge pull request #12 from house-of-abbey/11-impose-the-requirement-…
Browse files Browse the repository at this point in the history
…for-a-service-field-for-taps

Tap menu items without a service tag will be ignored.
  • Loading branch information
philipabbey authored Nov 17, 2023
2 parents 6b8892a + 4b32008 commit 2742090
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion source/HomeAssistantApp.mc
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
8 changes: 4 additions & 4 deletions source/HomeAssistantMenuItem.mc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions source/HomeAssistantToggleMenuItem.mc
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion source/HomeAssistantView.mc
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 2742090

Please sign in to comment.