Removal of menu identifiers as not actually required

Toggle menu is now consistent with the use of data objects in tap and template. HA 'notify' actions now work.

Co-Authored-By: Joseph Abbey <me@josephabbey.dev>
This commit is contained in:
Philip Abbey
2024-01-19 18:04:55 +00:00
parent 67a5f0a14e
commit 2be255bb71
7 changed files with 60 additions and 72 deletions

View File

@ -30,8 +30,6 @@ class HomeAssistantTapMenuItem extends WatchUi.IconMenuItem {
function initialize(
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,
confirm as Lang.Boolean,
data as Lang.Dictionary or Null,
@ -43,8 +41,8 @@ class HomeAssistantTapMenuItem extends WatchUi.IconMenuItem {
) {
WatchUi.IconMenuItem.initialize(
label,
subLabel,
identifier,
null,
null,
icon,
options
);
@ -53,11 +51,6 @@ class HomeAssistantTapMenuItem extends WatchUi.IconMenuItem {
mService = service;
mConfirm = confirm;
mData = data;
if (mData == null) {
mData = {"entity_id" => identifier};
} else {
mData.put("entity_id", identifier);
}
}
function callService() as Void {
@ -73,7 +66,7 @@ class HomeAssistantTapMenuItem extends WatchUi.IconMenuItem {
}
function onConfirm() as Void {
mHomeAssistantService.call(mIdentifier as Lang.String, mService, mData);
mHomeAssistantService.call(mService, mData);
}
}