Initial Solution

This commit is contained in:
Philip Abbey
2024-01-19 19:26:02 +00:00
parent 1325f8c382
commit 44ec2e2eb1
11 changed files with 123 additions and 134 deletions

View File

@ -64,21 +64,26 @@ class HomeAssistantMenuItemFactory {
return instance;
}
function toggle(label as Lang.String or Lang.Symbol, entity_id as Lang.String or Null) as WatchUi.MenuItem {
function toggle(
label as Lang.String or Lang.Symbol,
entity_id as Lang.String or Null,
confirm as Lang.Boolean
) as WatchUi.MenuItem {
return new HomeAssistantToggleMenuItem(
label,
confirm,
{ "entity_id" => entity_id },
mMenuItemOptions
);
}
function template_tap(
label as Lang.String or Lang.Symbol,
entity as Lang.String or Null,
template as Lang.String or Null,
service as Lang.String or Null,
confirm as Lang.Boolean,
data as Lang.Dictionary or Null
label as Lang.String or Lang.Symbol,
entity as Lang.String or Null,
template as Lang.String or Null,
service as Lang.String or Null,
confirm as Lang.Boolean,
data as Lang.Dictionary or Null
) as WatchUi.MenuItem {
if (entity != null) {
if (data == null) {
@ -116,11 +121,11 @@ class HomeAssistantMenuItemFactory {
}
function tap(
label as Lang.String or Lang.Symbol,
entity as Lang.String or Null,
service as Lang.String or Null,
confirm as Lang.Boolean,
data as Lang.Dictionary or Null
label as Lang.String or Lang.Symbol,
entity as Lang.String or Null,
service as Lang.String or Null,
confirm as Lang.Boolean,
data as Lang.Dictionary or Null
) as WatchUi.MenuItem {
if (entity != null) {
if (data == null) {