add TemplateMenuItem

This commit is contained in:
Joseph Abbey
2024-01-14 08:00:49 +00:00
parent cec10bb89a
commit 31b30788b1
8 changed files with 269 additions and 9 deletions

View File

@ -46,6 +46,7 @@ class HomeAssistantMenuItemFactory {
:locX => WatchUi.LAYOUT_HALIGN_CENTER,
:locY => WatchUi.LAYOUT_VALIGN_CENTER
});
mHomeAssistantService = new HomeAssistantService();
}
@ -66,6 +67,24 @@ class HomeAssistantMenuItemFactory {
);
}
function template(
label as Lang.String or Lang.Symbol,
identifier as Lang.Object or Null,
template as Lang.String or Null,
service as Lang.String or Null,
confirm as Lang.Boolean
) as WatchUi.MenuItem {
return new HomeAssistantTemplateMenuItem(
label,
identifier,
template,
service,
confirm,
mMenuItemOptions,
mHomeAssistantService
);
}
function tap(
label as Lang.String or Lang.Symbol,
identifier as Lang.Object or Null,