mirror of
https://github.com/house-of-abbey/GarminHomeAssistant.git
synced 2025-06-18 12:28:41 +00:00
Added templates to group items
This commit is contained in:
@ -14,27 +14,29 @@
|
||||
//
|
||||
// Description:
|
||||
//
|
||||
// Menu button with an icon that opens a sub-menu, i.e. group.
|
||||
// Menu button with an icon that opens a sub-menu, i.e. group, and optionally renders
|
||||
// a Home Assistant Template.
|
||||
//
|
||||
//-----------------------------------------------------------------------------------
|
||||
|
||||
using Toybox.Lang;
|
||||
using Toybox.WatchUi;
|
||||
|
||||
class HomeAssistantGroupMenuItem extends WatchUi.IconMenuItem {
|
||||
class HomeAssistantGroupMenuItem extends TemplateMenuItem {
|
||||
private var mMenu as HomeAssistantView;
|
||||
|
||||
function initialize(
|
||||
definition as Lang.Dictionary,
|
||||
template as Lang.String,
|
||||
icon as WatchUi.Drawable,
|
||||
options as {
|
||||
:alignment as WatchUi.MenuItem.Alignment
|
||||
} or Null) {
|
||||
} or Null
|
||||
) {
|
||||
|
||||
WatchUi.IconMenuItem.initialize(
|
||||
TemplateMenuItem.initialize(
|
||||
definition.get("name") as Lang.String,
|
||||
null,
|
||||
null,
|
||||
template,
|
||||
icon,
|
||||
options
|
||||
);
|
||||
|
Reference in New Issue
Block a user