mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-08-02 09:58:39 +00:00
Deprecate template
type
This commit is contained in:
@ -79,55 +79,13 @@ class HomeAssistantMenuItemFactory {
|
||||
);
|
||||
}
|
||||
|
||||
function template_tap(
|
||||
function 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
|
||||
) as WatchUi.MenuItem {
|
||||
if (entity != null) {
|
||||
if (data == null) {
|
||||
data = { "entity_id" => entity };
|
||||
} else {
|
||||
data.put("entity_id", entity);
|
||||
}
|
||||
}
|
||||
return new HomeAssistantTemplateMenuItem(
|
||||
label,
|
||||
template,
|
||||
service,
|
||||
confirm,
|
||||
data,
|
||||
mTapTypeIcon,
|
||||
mMenuItemOptions,
|
||||
mHomeAssistantService
|
||||
);
|
||||
}
|
||||
|
||||
function template_notap(
|
||||
label as Lang.String or Lang.Symbol,
|
||||
template as Lang.String or Null
|
||||
) as WatchUi.MenuItem {
|
||||
return new HomeAssistantTemplateMenuItem(
|
||||
label,
|
||||
template,
|
||||
null,
|
||||
false,
|
||||
null,
|
||||
mInfoTypeIcon,
|
||||
mMenuItemOptions,
|
||||
mHomeAssistantService
|
||||
);
|
||||
}
|
||||
|
||||
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
|
||||
) as WatchUi.MenuItem {
|
||||
if (entity != null) {
|
||||
if (data == null) {
|
||||
@ -138,6 +96,7 @@ class HomeAssistantMenuItemFactory {
|
||||
}
|
||||
return new HomeAssistantTapMenuItem(
|
||||
label,
|
||||
template,
|
||||
service,
|
||||
confirm,
|
||||
data,
|
||||
|
Reference in New Issue
Block a user