mirror of
https://github.com/home-assistant/frontend.git
synced 2025-07-16 13:56:35 +00:00
Fix automation translations + gallery (#17166)
This commit is contained in:
parent
44aca9688d
commit
8bd09edec0
@ -162,6 +162,7 @@ export class DemoAutomationDescribeAction extends LitElement {
|
||||
super.firstUpdated(changedProps);
|
||||
const hass = provideHass(this);
|
||||
hass.updateTranslations(null, "en");
|
||||
hass.updateTranslations("config", "en");
|
||||
hass.addEntities(ENTITIES);
|
||||
}
|
||||
|
||||
|
@ -89,6 +89,7 @@ export class DemoAutomationDescribeCondition extends LitElement {
|
||||
super.firstUpdated(changedProps);
|
||||
const hass = provideHass(this);
|
||||
hass.updateTranslations(null, "en");
|
||||
hass.updateTranslations("config", "en");
|
||||
hass.addEntities(ENTITIES);
|
||||
}
|
||||
|
||||
|
@ -40,6 +40,7 @@ const triggers = [
|
||||
},
|
||||
{ platform: "sun", event: "sunset" },
|
||||
{ platform: "time_pattern" },
|
||||
{ platform: "time_pattern", hours: "*", minutes: "/5", seconds: "10" },
|
||||
{ platform: "webhook" },
|
||||
{ platform: "persistent_notification" },
|
||||
{
|
||||
@ -105,6 +106,7 @@ export class DemoAutomationDescribeTrigger extends LitElement {
|
||||
super.firstUpdated(changedProps);
|
||||
const hass = provideHass(this);
|
||||
hass.updateTranslations(null, "en");
|
||||
hass.updateTranslations("config", "en");
|
||||
hass.addEntities(ENTITIES);
|
||||
}
|
||||
|
||||
|
@ -397,12 +397,10 @@ const tryDescribeTrigger = (
|
||||
}
|
||||
|
||||
// Time Pattern Trigger
|
||||
if (
|
||||
trigger.platform === "time_pattern" &&
|
||||
(trigger.seconds !== undefined ||
|
||||
trigger.minutes !== undefined ||
|
||||
trigger.hours !== undefined)
|
||||
) {
|
||||
if (trigger.platform === "time_pattern") {
|
||||
if (!trigger.seconds && !trigger.minutes && !trigger.hours) {
|
||||
return "When a time pattern matches";
|
||||
}
|
||||
let result = "Trigger ";
|
||||
if (trigger.seconds !== undefined) {
|
||||
const seconds_all = trigger.seconds === "*";
|
||||
|
@ -189,7 +189,7 @@ const tryDescribeAction = <T extends ActionType>(
|
||||
duration = hass.localize(
|
||||
`${actionTranslationBaseKey}.delay.description.duration_string`,
|
||||
{
|
||||
duration: secondsToDuration(config.delay)!,
|
||||
string: secondsToDuration(config.delay)!,
|
||||
}
|
||||
);
|
||||
} else if (typeof config.delay === "string") {
|
||||
@ -200,7 +200,7 @@ const tryDescribeAction = <T extends ActionType>(
|
||||
: hass.localize(
|
||||
`${actionTranslationBaseKey}.delay.description.duration_string`,
|
||||
{
|
||||
duration:
|
||||
string:
|
||||
config.delay ||
|
||||
hass.localize(
|
||||
`${actionTranslationBaseKey}.delay.description.duration_unknown`
|
||||
@ -211,14 +211,14 @@ const tryDescribeAction = <T extends ActionType>(
|
||||
duration = hass.localize(
|
||||
`${actionTranslationBaseKey}.delay.description.duration_string`,
|
||||
{
|
||||
duration: formatDuration(config.delay),
|
||||
string: formatDuration(config.delay),
|
||||
}
|
||||
);
|
||||
} else {
|
||||
duration = hass.localize(
|
||||
`${actionTranslationBaseKey}.delay.description.duration_string`,
|
||||
{
|
||||
duration: hass.localize(
|
||||
string: hass.localize(
|
||||
`${actionTranslationBaseKey}.delay.description.duration_unknown`
|
||||
),
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user