Comments & Dictionaries

Reformatted comments to work in VSCode and converted `dict.get(:key)` to `dict[:key]` syntax as its nicer.
This commit is contained in:
Philip Abbey
2025-07-24 18:54:27 +01:00
parent 70f05e8912
commit 8868f2152c
18 changed files with 207 additions and 184 deletions

View File

@ -20,7 +20,7 @@ using Toybox.Graphics;
//! Generic menu button with an icon that optionally renders a Home Assistant Template.
//
class HomeAssistantMenuItem extends WatchUi.IconMenuItem {
private var mTemplate as Lang.String or Null;
private var mTemplate as Lang.String?;
//! Class Constructor
//!
@ -34,13 +34,13 @@ class HomeAssistantMenuItem extends WatchUi.IconMenuItem {
options as {
:alignment as WatchUi.MenuItem.Alignment,
:icon as Graphics.BitmapType or WatchUi.Drawable or Lang.Symbol
} or Null
}?
) {
WatchUi.IconMenuItem.initialize(
label,
null,
null,
options.get(:icon),
options[:icon],
options
);
mTemplate = template;
@ -56,9 +56,9 @@ class HomeAssistantMenuItem extends WatchUi.IconMenuItem {
//! Return the menu item's template.
//!
//! @return A string with the menu item's template definition.
//! @return A string with the menu item's template definition (or null).
//
function getTemplate() as Lang.String or Null {
function getTemplate() as Lang.String? {
return mTemplate;
}