Add perform action with to translations (#25781)

pull/25668/head^2
Simon Lamon 2025-06-15 16:15:08 +02:00 committed by GitHub
parent 05035a281b
commit 159c4d100a
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 13 additions and 4 deletions

View File

@ -468,9 +468,17 @@ const tryDescribeAction = <T extends ActionType>(
return localized;
}
const stateObj = hass.states[config.entity_id];
return `${config.type || "Perform action with"} ${
stateObj ? computeStateName(stateObj) : config.entity_id
}`;
if (config.type) {
return `${config.type} ${
stateObj ? computeStateName(stateObj) : config.entity_id
}`;
}
return hass.localize(
`${actionTranslationBaseKey}.device_id.description.perform_device_action`,
{
device: stateObj ? computeStateName(stateObj) : config.entity_id,
}
);
}
if (actionType === "sequence") {

View File

@ -4286,7 +4286,8 @@
"action": "Action",
"description": {
"picker": "Do something on a device. Great way to start.",
"no_device": "Device action"
"no_device": "Device action",
"perform_device_action": "Perform action with {device}"
}
},
"repeat": {