mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-02 00:27:49 +01:00
Fix deprecation
This commit is contained in:
@@ -813,16 +813,16 @@ const describeLegacyTrigger = (
|
||||
: trigger.entity_id;
|
||||
|
||||
let offsetChoice = "other";
|
||||
let offset: string | string[] = "";
|
||||
let offset = "";
|
||||
if (trigger.offset) {
|
||||
offsetChoice = trigger.offset.startsWith("-") ? "before" : "after";
|
||||
offset = trigger.offset.startsWith("-")
|
||||
const parts = trigger.offset.startsWith("-")
|
||||
? trigger.offset.substring(1).split(":")
|
||||
: trigger.offset.split(":");
|
||||
const duration = {
|
||||
hours: offset.length > 0 ? +offset[0] : 0,
|
||||
minutes: offset.length > 1 ? +offset[1] : 0,
|
||||
seconds: offset.length > 2 ? +offset[2] : 0,
|
||||
hours: parts.length > 0 ? +parts[0] : 0,
|
||||
minutes: parts.length > 1 ? +parts[1] : 0,
|
||||
seconds: parts.length > 2 ? +parts[2] : 0,
|
||||
};
|
||||
offset = formatDurationLong(hass.locale, duration);
|
||||
if (offset === "") {
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
"useDefineForClassFields": false,
|
||||
// Modules
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"moduleResolution": "bundler",
|
||||
"resolveJsonModule": true,
|
||||
// Babel handles transpiling and no need for declaration files
|
||||
"noEmit": true,
|
||||
@@ -130,7 +130,35 @@
|
||||
],
|
||||
"@formatjs/intl-relativetimeformat/polyfill-force": [
|
||||
"./node_modules/@formatjs/intl-relativetimeformat/polyfill-force.js"
|
||||
]
|
||||
],
|
||||
"@formatjs/intl-durationformat/src/types": [
|
||||
"./node_modules/@formatjs/intl-durationformat/src/types.js"
|
||||
],
|
||||
"@formatjs/intl-pluralrules/locale-data/en": [
|
||||
"./node_modules/@formatjs/intl-pluralrules/locale-data/en.js"
|
||||
],
|
||||
"@home-assistant/webawesome/dist/components/*": [
|
||||
"./node_modules/@home-assistant/webawesome/dist/components/*"
|
||||
],
|
||||
"@home-assistant/webawesome/dist/events/*": [
|
||||
"./node_modules/@home-assistant/webawesome/dist/events/*"
|
||||
],
|
||||
"@home-assistant/webawesome/dist/internal/*": [
|
||||
"./node_modules/@home-assistant/webawesome/dist/internal/*"
|
||||
],
|
||||
"@lit-labs/virtualizer/virtualize": [
|
||||
"./node_modules/@lit-labs/virtualizer/virtualize.js"
|
||||
],
|
||||
"@lit/reactive-element/reactive-controller": [
|
||||
"./node_modules/@lit/reactive-element/reactive-controller.js"
|
||||
],
|
||||
"echarts/types/src/*": ["./node_modules/echarts/types/src/*.d.ts"],
|
||||
"echarts/lib/*": ["./node_modules/echarts/lib/*"],
|
||||
"home-assistant-js-websocket/dist/*": [
|
||||
"./node_modules/home-assistant-js-websocket/dist/*"
|
||||
],
|
||||
"lit/directives/join": ["./node_modules/lit/directives/join.js"],
|
||||
"lit/directives/ref": ["./node_modules/lit/directives/ref.js"]
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user