rename service to action

This commit is contained in:
Joseph Abbey
2025-10-20 09:24:12 +01:00
parent 4fbe4135b1
commit e697f75ce3
14 changed files with 169 additions and 140 deletions

View File

@@ -99,7 +99,7 @@ class HomeAssistantMenuItemFactory {
//! @param label Menu item label.
//! @param entity_id Home Assistant Entity ID (optional)
//! @param template Template for Home Assistant to render (optional)
//! @param service Template for Home Assistant to render (optional)
//! @param action Action to run on Home Assistant (optional)
//! @param data Sourced from the menu JSON, this is the `data` field from the `tap_action` field.
//! @param options Menu item options to be passed on, including both SDK and menu options, e.g. exit, confirm & pin.
//
@@ -107,7 +107,7 @@ class HomeAssistantMenuItemFactory {
label as Lang.String or Lang.Symbol,
entity_id as Lang.String?,
template as Lang.String?,
service as Lang.String?,
action as Lang.String?,
data as Lang.Dictionary?,
options as {
:exit as Lang.Boolean,
@@ -126,12 +126,12 @@ class HomeAssistantMenuItemFactory {
for (var i = 0; i < keys.size(); i++) {
options.put(keys[i], mMenuItemOptions.get(keys[i]));
}
if (service != null) {
if (action != null) {
options.put(:icon, mTapTypeIcon);
return new HomeAssistantTapMenuItem(
label,
template,
service,
action,
data,
options,
mHomeAssistantService
@@ -157,7 +157,7 @@ class HomeAssistantMenuItemFactory {
label as Lang.String or Lang.Symbol,
entity_id as Lang.String?,
template as Lang.String?,
service as Lang.String?,
action as Lang.String?,
data as Lang.Dictionary?,
options as {
:exit as Lang.Boolean,
@@ -183,7 +183,7 @@ class HomeAssistantMenuItemFactory {
return new HomeAssistantNumericMenuItem(
label,
template,
service,
action,
data,
options,
mHomeAssistantService