mirror of
https://github.com/home-assistant/frontend.git
synced 2026-04-30 06:23:04 +00:00
Compare commits
98 Commits
devtools-a
...
rc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
962e941ec9 | ||
|
|
31495b2de9 | ||
|
|
f71dcaeac1 | ||
|
|
26b1bfbe20 | ||
|
|
b95fce5f24 | ||
|
|
f6abbe80a2 | ||
|
|
71301ef5be | ||
|
|
4af618ac6f | ||
|
|
5a21ef67cd | ||
|
|
251b9a1b94 | ||
|
|
cadaa47bf0 | ||
|
|
7ec864dc6d | ||
|
|
680ceb73e9 | ||
|
|
ab31771055 | ||
|
|
07b9a6e287 | ||
|
|
be2c90cd1c | ||
|
|
2af4ff7c8f | ||
|
|
f7e92b484a | ||
|
|
9fab7bafdb | ||
|
|
0dabb02007 | ||
|
|
5b73e86786 | ||
|
|
144d7c5c3f | ||
|
|
8b396dc640 | ||
|
|
9bf48d30ab | ||
|
|
35fee46f5b | ||
|
|
9ac6636029 | ||
|
|
136462114d | ||
|
|
cf542197e0 | ||
|
|
5c2627624a | ||
|
|
698ded9d85 | ||
|
|
9a7fb96873 | ||
|
|
204c5b5e14 | ||
|
|
8ea3acfa98 | ||
|
|
306739773e | ||
|
|
8b3fa3adac | ||
|
|
37a1d59a24 | ||
|
|
6812884e00 | ||
|
|
bf7ef1f7ae | ||
|
|
fe57f601ba | ||
|
|
c89d478440 | ||
|
|
fa27d26e5f | ||
|
|
18f411ef53 | ||
|
|
24826e92f0 | ||
|
|
ea9d369d88 | ||
|
|
a9b026d0ef | ||
|
|
35339906ec | ||
|
|
ce23f716cc | ||
|
|
aaf8fa199f | ||
|
|
fba430d507 | ||
|
|
59361cbd38 | ||
|
|
b558117d8c | ||
|
|
a7c8347751 | ||
|
|
31ca9c849a | ||
|
|
6252d7e8f5 | ||
|
|
f42986adf6 | ||
|
|
9e70ea3723 | ||
|
|
de3b7bf513 | ||
|
|
2c5f491c9e | ||
|
|
1ef13c5100 | ||
|
|
c166335aca | ||
|
|
c64ec21eca | ||
|
|
8d62056f4a | ||
|
|
62e73608b6 | ||
|
|
aa66d8891c | ||
|
|
494a96c635 | ||
|
|
36d77f54ce | ||
|
|
12fec9f580 | ||
|
|
5f1f55448a | ||
|
|
837e345ecf | ||
|
|
0929d7d18a | ||
|
|
70991d3c1e | ||
|
|
82e5bd62a1 | ||
|
|
b8adf4e866 | ||
|
|
111be984e0 | ||
|
|
78a2cbb532 | ||
|
|
34b09b140b | ||
|
|
f173f901c5 | ||
|
|
ebb6ac8d8b | ||
|
|
abe214a33a | ||
|
|
248332ae27 | ||
|
|
82fc2fccdc | ||
|
|
c8f30a7ee4 | ||
|
|
77f48d91cd | ||
|
|
caa707a7b1 | ||
|
|
0bed0fa37e | ||
|
|
5b6309d984 | ||
|
|
264818bc70 | ||
|
|
d664ab6836 | ||
|
|
a6c4184054 | ||
|
|
cb6985eb7c | ||
|
|
d466ab63bd | ||
|
|
1132cdb364 | ||
|
|
0f9d48a03d | ||
|
|
7e085d9b08 | ||
|
|
1a62c7296c | ||
|
|
be1921229c | ||
|
|
640558ad35 | ||
|
|
99636c9719 |
@@ -0,0 +1,17 @@
|
||||
<svg width="268" height="28" viewBox="0 0 268 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="88" height="28" rx="8" fill="white"/>
|
||||
<rect x="0.5" y="0.5" width="87" height="27" rx="7.5" stroke="black" stroke-opacity="0.12"/>
|
||||
<rect x="8" y="8" width="12" height="12" rx="3" fill="black" fill-opacity="0.12"/>
|
||||
<rect x="28" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<rect x="48" y="8" width="12" height="12" rx="3" fill="black" fill-opacity="0.12"/>
|
||||
<rect x="68" y="8" width="12" height="12" rx="3" fill="black" fill-opacity="0.12"/>
|
||||
<path d="M107.667 18.1167V14.7833H100.233L100.208 13.1083H107.667V9.78333L111.833 13.95L107.667 18.1167Z" fill="#B1B1B1"/>
|
||||
<rect x="124" width="88" height="28" rx="8" fill="white"/>
|
||||
<rect x="124.5" y="0.5" width="87" height="27" rx="7.5" stroke="black" stroke-opacity="0.12"/>
|
||||
<rect x="132" y="8" width="12" height="12" rx="3" fill="black" fill-opacity="0.12"/>
|
||||
<rect x="152" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<rect x="172" y="8" width="12" height="12" rx="3" fill="black" fill-opacity="0.12"/>
|
||||
<rect x="192" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<path d="M237.5 13.1667H222.5V11.5H237.5V13.1667ZM237.5 14.8333H222.5V16.5H237.5V14.8333Z" fill="#B1B1B1"/>
|
||||
<path d="M257.167 16.5H253L258.833 4.83337V11.5H263L257.167 23.1667V16.5Z" fill="#5E5E5E"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.3 KiB |
@@ -0,0 +1,17 @@
|
||||
<svg width="268" height="28" viewBox="0 0 268 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 8C0 3.58172 3.58172 0 8 0H80C84.4183 0 88 3.58172 88 8V20C88 24.4183 84.4183 28 80 28H8C3.58172 28 0 24.4183 0 20V8Z" fill="#1C1C1C"/>
|
||||
<path d="M8 0.5H80C84.1421 0.5 87.5 3.85786 87.5 8V20C87.5 24.1421 84.1421 27.5 80 27.5H8C3.85786 27.5 0.5 24.1421 0.5 20V8C0.5 3.85786 3.85786 0.5 8 0.5Z" stroke="white" stroke-opacity="0.24"/>
|
||||
<rect x="8" y="8" width="12" height="12" rx="3" fill="white" fill-opacity="0.24"/>
|
||||
<rect x="28" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<rect x="48" y="8" width="12" height="12" rx="3" fill="white" fill-opacity="0.24"/>
|
||||
<rect x="68" y="8" width="12" height="12" rx="3" fill="white" fill-opacity="0.24"/>
|
||||
<path d="M109.333 16.45C108.718 17.065 107.667 16.6294 107.667 15.7596C107.667 15.2204 107.23 14.7833 106.69 14.7833H101.058C100.601 14.7833 100.228 14.4159 100.221 13.9583C100.214 13.4909 100.591 13.1083 101.058 13.1083H106.693C107.231 13.1083 107.667 12.6723 107.667 12.1345C107.667 11.2668 108.716 10.8323 109.329 11.4458L110.613 12.7296C111.287 13.4036 111.287 14.4964 110.613 15.1704L109.333 16.45Z" fill="white" fill-opacity="0.48"/>
|
||||
<path d="M124 8C124 3.58172 127.582 0 132 0H204C208.418 0 212 3.58172 212 8V20C212 24.4183 208.418 28 204 28H132C127.582 28 124 24.4183 124 20V8Z" fill="#1C1C1C"/>
|
||||
<path d="M132 0.5H204C208.142 0.5 211.5 3.85786 211.5 8V20C211.5 24.1421 208.142 27.5 204 27.5H132C127.858 27.5 124.5 24.1421 124.5 20V8C124.5 3.85786 127.858 0.5 132 0.5Z" stroke="white" stroke-opacity="0.24"/>
|
||||
<rect x="132" y="8" width="12" height="12" rx="3" fill="white" fill-opacity="0.24"/>
|
||||
<rect x="152" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<rect x="172" y="8" width="12" height="12" rx="3" fill="white" fill-opacity="0.24"/>
|
||||
<rect x="192" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<path d="M237.5 12.3333C237.5 12.7936 237.127 13.1667 236.667 13.1667H223.333C222.873 13.1667 222.5 12.7936 222.5 12.3333C222.5 11.8731 222.873 11.5 223.333 11.5H236.667C237.127 11.5 237.5 11.8731 237.5 12.3333ZM237.5 15.6667C237.5 15.2064 237.127 14.8333 236.667 14.8333H223.333C222.873 14.8333 222.5 15.2064 222.5 15.6667C222.5 16.1269 222.873 16.5 223.333 16.5H236.667C237.127 16.5 237.5 16.1269 237.5 15.6667Z" fill="white" fill-opacity="0.48"/>
|
||||
<path d="M257.167 16.5H253L258.833 4.83337V11.5H263L257.167 23.1667V16.5Z" fill="white" fill-opacity="0.24"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1,17 @@
|
||||
<svg width="268" height="28" viewBox="0 0 268 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="88" height="28" rx="8" fill="white"/>
|
||||
<rect x="0.5" y="0.5" width="87" height="27" rx="7.5" stroke="black" stroke-opacity="0.12"/>
|
||||
<rect x="8" y="8" width="12" height="12" rx="3" fill="black" fill-opacity="0.12"/>
|
||||
<rect x="28" y="8" width="12" height="12" rx="3" fill="black" fill-opacity="0.12"/>
|
||||
<rect x="48" y="8" width="12" height="12" rx="3" fill="black" fill-opacity="0.12"/>
|
||||
<rect x="68" y="8" width="12" height="12" rx="3" fill="black" fill-opacity="0.12"/>
|
||||
<path d="M107.667 18.1167V14.7833H100.233L100.208 13.1083H107.667V9.78333L111.833 13.95L107.667 18.1167Z" fill="#B1B1B1"/>
|
||||
<rect x="124" width="88" height="28" rx="8" fill="white"/>
|
||||
<rect x="124.5" y="0.5" width="87" height="27" rx="7.5" stroke="black" stroke-opacity="0.12"/>
|
||||
<rect x="132" y="8" width="12" height="12" rx="3" fill="black" fill-opacity="0.12"/>
|
||||
<rect x="152" y="8" width="12" height="12" rx="3" fill="black" fill-opacity="0.12"/>
|
||||
<rect x="172" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<rect x="192" y="8" width="12" height="12" rx="3" fill="black" fill-opacity="0.12"/>
|
||||
<path d="M237.5 13.1667H222.5V11.5H237.5V13.1667ZM237.5 14.8333H222.5V16.5H237.5V14.8333Z" fill="#B1B1B1"/>
|
||||
<path d="M257.167 16.5H253L258.833 4.83337V11.5H263L257.167 23.1667V16.5Z" fill="#5E5E5E"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.4 KiB |
@@ -0,0 +1,17 @@
|
||||
<svg width="268" height="28" viewBox="0 0 268 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 8C0 3.58172 3.58172 0 8 0H80C84.4183 0 88 3.58172 88 8V20C88 24.4183 84.4183 28 80 28H8C3.58172 28 0 24.4183 0 20V8Z" fill="#1C1C1C"/>
|
||||
<path d="M8 0.5H80C84.1421 0.5 87.5 3.85786 87.5 8V20C87.5 24.1421 84.1421 27.5 80 27.5H8C3.85786 27.5 0.5 24.1421 0.5 20V8C0.5 3.85786 3.85786 0.5 8 0.5Z" stroke="white" stroke-opacity="0.24"/>
|
||||
<rect x="8" y="8" width="12" height="12" rx="3" fill="white" fill-opacity="0.24"/>
|
||||
<rect x="28" y="8" width="12" height="12" rx="3" fill="white" fill-opacity="0.24"/>
|
||||
<rect x="48" y="8" width="12" height="12" rx="3" fill="white" fill-opacity="0.24"/>
|
||||
<rect x="68" y="8" width="12" height="12" rx="3" fill="white" fill-opacity="0.24"/>
|
||||
<path d="M109.333 16.45C108.718 17.065 107.667 16.6294 107.667 15.7596C107.667 15.2204 107.23 14.7833 106.69 14.7833H101.058C100.601 14.7833 100.228 14.4159 100.221 13.9583C100.214 13.4909 100.591 13.1083 101.058 13.1083H106.693C107.231 13.1083 107.667 12.6723 107.667 12.1345C107.667 11.2668 108.716 10.8323 109.329 11.4458L110.613 12.7296C111.287 13.4036 111.287 14.4964 110.613 15.1704L109.333 16.45Z" fill="white" fill-opacity="0.48"/>
|
||||
<path d="M124 8C124 3.58172 127.582 0 132 0H204C208.418 0 212 3.58172 212 8V20C212 24.4183 208.418 28 204 28H132C127.582 28 124 24.4183 124 20V8Z" fill="#1C1C1C"/>
|
||||
<path d="M132 0.5H204C208.142 0.5 211.5 3.85786 211.5 8V20C211.5 24.1421 208.142 27.5 204 27.5H132C127.858 27.5 124.5 24.1421 124.5 20V8C124.5 3.85786 127.858 0.5 132 0.5Z" stroke="white" stroke-opacity="0.24"/>
|
||||
<rect x="132" y="8" width="12" height="12" rx="3" fill="white" fill-opacity="0.24"/>
|
||||
<rect x="152" y="8" width="12" height="12" rx="3" fill="white" fill-opacity="0.24"/>
|
||||
<rect x="172" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<rect x="192" y="8" width="12" height="12" rx="3" fill="white" fill-opacity="0.24"/>
|
||||
<path d="M237.5 12.3333C237.5 12.7936 237.127 13.1667 236.667 13.1667H223.333C222.873 13.1667 222.5 12.7936 222.5 12.3333C222.5 11.8731 222.873 11.5 223.333 11.5H236.667C237.127 11.5 237.5 11.8731 237.5 12.3333ZM237.5 15.6667C237.5 15.2064 237.127 14.8333 236.667 14.8333H223.333C222.873 14.8333 222.5 15.2064 222.5 15.6667C222.5 16.1269 222.873 16.5 223.333 16.5H236.667C237.127 16.5 237.5 16.1269 237.5 15.6667Z" fill="white" fill-opacity="0.48"/>
|
||||
<path d="M257.167 16.5H253L258.833 4.83337V11.5H263L257.167 23.1667V16.5Z" fill="white" fill-opacity="0.24"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.4 KiB |
@@ -0,0 +1,17 @@
|
||||
<svg width="268" height="28" viewBox="0 0 268 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<rect width="88" height="28" rx="8" fill="white"/>
|
||||
<rect x="0.5" y="0.5" width="87" height="27" rx="7.5" stroke="black" stroke-opacity="0.12"/>
|
||||
<rect x="8" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<rect x="28" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<rect x="48" y="8" width="12" height="12" rx="3" fill="black" fill-opacity="0.12"/>
|
||||
<rect x="68" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<path d="M107.667 18.1167V14.7833H100.233L100.208 13.1083H107.667V9.78333L111.833 13.95L107.667 18.1167Z" fill="#B1B1B1"/>
|
||||
<rect x="124" width="88" height="28" rx="8" fill="white"/>
|
||||
<rect x="124.5" y="0.5" width="87" height="27" rx="7.5" stroke="black" stroke-opacity="0.12"/>
|
||||
<rect x="132" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<rect x="152" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<rect x="172" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<rect x="192" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<path d="M237.5 13.1667H222.5V11.5H237.5V13.1667ZM237.5 14.8333H222.5V16.5H237.5V14.8333Z" fill="#B1B1B1"/>
|
||||
<path d="M257.167 16.5H253L258.833 4.83337V11.5H263L257.167 23.1667V16.5Z" fill="#5E5E5E"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.2 KiB |
@@ -0,0 +1,17 @@
|
||||
<svg width="268" height="28" viewBox="0 0 268 28" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<path d="M0 8C0 3.58172 3.58172 0 8 0H80C84.4183 0 88 3.58172 88 8V20C88 24.4183 84.4183 28 80 28H8C3.58172 28 0 24.4183 0 20V8Z" fill="#1C1C1C"/>
|
||||
<path d="M8 0.5H80C84.1421 0.5 87.5 3.85786 87.5 8V20C87.5 24.1421 84.1421 27.5 80 27.5H8C3.85786 27.5 0.5 24.1421 0.5 20V8C0.5 3.85786 3.85786 0.5 8 0.5Z" stroke="white" stroke-opacity="0.24"/>
|
||||
<rect x="8" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<rect x="28" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<rect x="48" y="8" width="12" height="12" rx="3" fill="white" fill-opacity="0.24"/>
|
||||
<rect x="68" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<path d="M109.333 16.45C108.718 17.065 107.667 16.6294 107.667 15.7596C107.667 15.2204 107.23 14.7833 106.69 14.7833H101.058C100.601 14.7833 100.228 14.4159 100.221 13.9583C100.214 13.4909 100.591 13.1083 101.058 13.1083H106.693C107.231 13.1083 107.667 12.6723 107.667 12.1345C107.667 11.2668 108.716 10.8323 109.329 11.4458L110.613 12.7296C111.287 13.4036 111.287 14.4964 110.613 15.1704L109.333 16.45Z" fill="white" fill-opacity="0.48"/>
|
||||
<path d="M124 8C124 3.58172 127.582 0 132 0H204C208.418 0 212 3.58172 212 8V20C212 24.4183 208.418 28 204 28H132C127.582 28 124 24.4183 124 20V8Z" fill="#1C1C1C"/>
|
||||
<path d="M132 0.5H204C208.142 0.5 211.5 3.85786 211.5 8V20C211.5 24.1421 208.142 27.5 204 27.5H132C127.858 27.5 124.5 24.1421 124.5 20V8C124.5 3.85786 127.858 0.5 132 0.5Z" stroke="white" stroke-opacity="0.24"/>
|
||||
<rect x="132" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<rect x="152" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<rect x="172" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<rect x="192" y="8" width="12" height="12" rx="3" fill="#009AC7"/>
|
||||
<path d="M237.5 12.3333C237.5 12.7936 237.127 13.1667 236.667 13.1667H223.333C222.873 13.1667 222.5 12.7936 222.5 12.3333C222.5 11.8731 222.873 11.5 223.333 11.5H236.667C237.127 11.5 237.5 11.8731 237.5 12.3333ZM237.5 15.6667C237.5 15.2064 237.127 14.8333 236.667 14.8333H223.333C222.873 14.8333 222.5 15.2064 222.5 15.6667C222.5 16.1269 222.873 16.5 223.333 16.5H236.667C237.127 16.5 237.5 16.1269 237.5 15.6667Z" fill="white" fill-opacity="0.48"/>
|
||||
<path d="M257.167 16.5H253L258.833 4.83337V11.5H263L257.167 23.1667V16.5Z" fill="white" fill-opacity="0.24"/>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 2.3 KiB |
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
|
||||
|
||||
[project]
|
||||
name = "home-assistant-frontend"
|
||||
version = "20260325.0"
|
||||
version = "20260429.0"
|
||||
license = "Apache-2.0"
|
||||
license-files = ["LICENSE*"]
|
||||
description = "The Home Assistant frontend"
|
||||
|
||||
@@ -36,6 +36,9 @@ export class HaSelectBox extends LitElement {
|
||||
@property({ type: Number, attribute: "max_columns" })
|
||||
public maxColumns?: number;
|
||||
|
||||
@property({ type: Boolean, attribute: "stacked_image" })
|
||||
public stackedImage = false;
|
||||
|
||||
render() {
|
||||
const maxColumns = this.maxColumns ?? 3;
|
||||
const columns = Math.min(maxColumns, this.options.length);
|
||||
@@ -48,7 +51,8 @@ export class HaSelectBox extends LitElement {
|
||||
}
|
||||
|
||||
private _renderOption(option: SelectBoxOption) {
|
||||
const horizontal = this.maxColumns === 1;
|
||||
const horizontal = this.maxColumns === 1 && !this.stackedImage;
|
||||
const stacked = this.maxColumns === 1 && this.stackedImage;
|
||||
const disabled = option.disabled || this.disabled || false;
|
||||
const selected = option.value === this.value;
|
||||
|
||||
@@ -66,6 +70,7 @@ export class HaSelectBox extends LitElement {
|
||||
<label
|
||||
class="option ${classMap({
|
||||
horizontal: horizontal,
|
||||
stacked: stacked,
|
||||
selected: selected,
|
||||
})}"
|
||||
?disabled=${disabled}
|
||||
@@ -187,6 +192,16 @@ export class HaSelectBox extends LitElement {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.option.stacked {
|
||||
align-items: stretch;
|
||||
}
|
||||
|
||||
.option.stacked img {
|
||||
max-width: 100%;
|
||||
max-height: var(--ha-select-box-image-size, 96px);
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.option:before {
|
||||
content: "";
|
||||
display: block;
|
||||
|
||||
123
src/components/ha-selector/ha-selector-automation-behavior.ts
Normal file
123
src/components/ha-selector/ha-selector-automation-behavior.ts
Normal file
@@ -0,0 +1,123 @@
|
||||
import { LitElement, css, html, nothing } from "lit";
|
||||
import { customElement, property } from "lit/decorators";
|
||||
import { fireEvent } from "../../common/dom/fire_event";
|
||||
import type { LocalizeKeys } from "../../common/translations/localize";
|
||||
import type {
|
||||
AutomationBehavior,
|
||||
AutomationBehaviorConditionMode,
|
||||
AutomationBehaviorSelector,
|
||||
AutomationBehaviorTriggerMode,
|
||||
} from "../../data/selector";
|
||||
import type { HomeAssistant } from "../../types";
|
||||
import "../ha-input-helper-text";
|
||||
import type { SelectBoxOption } from "../ha-select-box";
|
||||
import "../ha-select-box";
|
||||
|
||||
const TRIGGER_BEHAVIORS: AutomationBehaviorTriggerMode[] = [
|
||||
"any",
|
||||
"first",
|
||||
"last",
|
||||
];
|
||||
|
||||
const CONDITION_BEHAVIORS: AutomationBehaviorConditionMode[] = ["any", "all"];
|
||||
|
||||
@customElement("ha-selector-automation_behavior")
|
||||
export class HaSelectorAutomationBehavior extends LitElement {
|
||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||
|
||||
@property({ attribute: false })
|
||||
public selector!: AutomationBehaviorSelector;
|
||||
|
||||
@property() public value?: AutomationBehavior;
|
||||
|
||||
@property() public helper?: string;
|
||||
|
||||
@property({ attribute: false })
|
||||
public localizeValue?: (key: string) => string;
|
||||
|
||||
@property({ type: Boolean }) public disabled = false;
|
||||
|
||||
@property({ type: Boolean }) public required = true;
|
||||
|
||||
protected render() {
|
||||
const { mode } = this.selector.automation_behavior ?? {};
|
||||
const modeKey = mode ?? "trigger";
|
||||
|
||||
const isTrigger = modeKey === "trigger";
|
||||
|
||||
const options = this._behaviors().map<SelectBoxOption>((behavior) => ({
|
||||
value: behavior,
|
||||
label: this._localizeOption(behavior, "label"),
|
||||
description: this._localizeOption(behavior, "description"),
|
||||
disabled: this.disabled,
|
||||
...(isTrigger && {
|
||||
image: {
|
||||
src: `/static/images/form/automation_behavior_trigger_${behavior}.svg`,
|
||||
src_dark: `/static/images/form/automation_behavior_trigger_${behavior}_dark.svg`,
|
||||
},
|
||||
}),
|
||||
}));
|
||||
|
||||
return html`
|
||||
<ha-select-box
|
||||
.hass=${this.hass}
|
||||
.options=${options}
|
||||
.value=${this.value ?? ""}
|
||||
max_columns="1"
|
||||
?stacked_image=${isTrigger}
|
||||
@value-changed=${this._valueChanged}
|
||||
></ha-select-box>
|
||||
${this.helper
|
||||
? html`<ha-input-helper-text .disabled=${this.disabled}
|
||||
>${this.helper}</ha-input-helper-text
|
||||
>`
|
||||
: nothing}
|
||||
`;
|
||||
}
|
||||
|
||||
private _behaviors(): AutomationBehavior[] {
|
||||
const mode = this.selector.automation_behavior?.mode;
|
||||
return mode === "condition" ? CONDITION_BEHAVIORS : TRIGGER_BEHAVIORS;
|
||||
}
|
||||
|
||||
private _localizeOption(
|
||||
behavior: AutomationBehavior,
|
||||
field: "label" | "description"
|
||||
): string {
|
||||
const { translation_key: translationKey, mode } =
|
||||
this.selector.automation_behavior ?? {};
|
||||
|
||||
if (this.localizeValue && translationKey) {
|
||||
const translated = this.localizeValue(
|
||||
`${translationKey}.options.${behavior}.${field}`
|
||||
);
|
||||
if (translated) {
|
||||
return translated;
|
||||
}
|
||||
}
|
||||
return this.hass.localize(
|
||||
`ui.components.selectors.automation_behavior.${mode ?? "trigger"}.options.${behavior}.${field}` as LocalizeKeys
|
||||
);
|
||||
}
|
||||
|
||||
private _valueChanged(ev: CustomEvent) {
|
||||
ev.stopPropagation();
|
||||
const value = ev.detail.value as AutomationBehavior;
|
||||
if (this.disabled || value === this.value) {
|
||||
return;
|
||||
}
|
||||
fireEvent(this, "value-changed", { value });
|
||||
}
|
||||
|
||||
static styles = css`
|
||||
ha-select-box {
|
||||
--ha-select-box-image-size: 28px;
|
||||
}
|
||||
`;
|
||||
}
|
||||
|
||||
declare global {
|
||||
interface HTMLElementTagNameMap {
|
||||
"ha-selector-automation_behavior": HaSelectorAutomationBehavior;
|
||||
}
|
||||
}
|
||||
@@ -13,6 +13,7 @@ import type { HomeAssistant } from "../../types";
|
||||
const LOAD_ELEMENTS = {
|
||||
action: () => import("./ha-selector-action"),
|
||||
addon: () => import("./ha-selector-addon"),
|
||||
automation_behavior: () => import("./ha-selector-automation-behavior"),
|
||||
app: () => import("./ha-selector-app"),
|
||||
area: () => import("./ha-selector-area"),
|
||||
areas_display: () => import("./ha-selector-areas-display"),
|
||||
|
||||
@@ -322,6 +322,7 @@ export interface ShorthandNotCondition extends ShorthandBaseCondition {
|
||||
|
||||
export interface AutomationElementGroupCollection {
|
||||
titleKey?: LocalizeKeys;
|
||||
generic?: boolean;
|
||||
groups: AutomationElementGroup;
|
||||
}
|
||||
|
||||
|
||||
@@ -8,28 +8,31 @@ import type { Selector, TargetSelector } from "./selector";
|
||||
export const CONDITION_COLLECTIONS: AutomationElementGroupCollection[] = [
|
||||
{
|
||||
groups: {
|
||||
device: {},
|
||||
dynamicGroups: {},
|
||||
entity: { icon: mdiShape, members: { state: {}, numeric_state: {} } },
|
||||
time_location: {
|
||||
icon: mdiMapClock,
|
||||
members: { sun: {}, time: {}, zone: {} },
|
||||
},
|
||||
helpers: {},
|
||||
template: {},
|
||||
trigger: {},
|
||||
other: {},
|
||||
},
|
||||
},
|
||||
{
|
||||
titleKey:
|
||||
"ui.panel.config.automation.editor.conditions.groups.helpers.label",
|
||||
"ui.panel.config.automation.editor.conditions.groups.generic.label",
|
||||
generic: true,
|
||||
groups: {
|
||||
helpers: {},
|
||||
device: {},
|
||||
entity: { icon: mdiShape, members: { state: {}, numeric_state: {} } },
|
||||
},
|
||||
},
|
||||
{
|
||||
titleKey: "ui.panel.config.automation.editor.conditions.groups.other.label",
|
||||
titleKey:
|
||||
"ui.panel.config.automation.editor.conditions.groups.custom_integrations.label",
|
||||
groups: {
|
||||
template: {},
|
||||
trigger: {},
|
||||
other: {},
|
||||
customDynamicGroups: {},
|
||||
},
|
||||
},
|
||||
] as const;
|
||||
|
||||
@@ -31,6 +31,7 @@ export type Selector =
|
||||
| AreaSelector
|
||||
| AreasDisplaySelector
|
||||
| AttributeSelector
|
||||
| AutomationBehaviorSelector
|
||||
| BooleanSelector
|
||||
| ButtonToggleSelector
|
||||
| ChooseSelector
|
||||
@@ -124,6 +125,21 @@ export interface BooleanSelector {
|
||||
boolean: {} | null;
|
||||
}
|
||||
|
||||
export type AutomationBehaviorTriggerMode = "first" | "last" | "any";
|
||||
|
||||
export type AutomationBehaviorConditionMode = "all" | "any";
|
||||
|
||||
export type AutomationBehavior =
|
||||
| AutomationBehaviorTriggerMode
|
||||
| AutomationBehaviorConditionMode;
|
||||
|
||||
export interface AutomationBehaviorSelector {
|
||||
automation_behavior: {
|
||||
mode: "trigger" | "condition";
|
||||
translation_key?: string;
|
||||
} | null;
|
||||
}
|
||||
|
||||
export interface ButtonToggleSelector {
|
||||
button_toggle: {
|
||||
options: readonly string[] | readonly SelectOption[];
|
||||
|
||||
@@ -13,9 +13,7 @@ import type { Selector, TargetSelector } from "./selector";
|
||||
export const TRIGGER_COLLECTIONS: AutomationElementGroupCollection[] = [
|
||||
{
|
||||
groups: {
|
||||
device: {},
|
||||
dynamicGroups: {},
|
||||
entity: { icon: mdiShape, members: { state: {}, numeric_state: {} } },
|
||||
time_location: {
|
||||
icon: mdiMapClock,
|
||||
members: {
|
||||
@@ -26,17 +24,6 @@ export const TRIGGER_COLLECTIONS: AutomationElementGroupCollection[] = [
|
||||
zone: {},
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
titleKey: "ui.panel.config.automation.editor.triggers.groups.helpers.label",
|
||||
groups: {
|
||||
helpers: {},
|
||||
},
|
||||
},
|
||||
{
|
||||
titleKey: "ui.panel.config.automation.editor.triggers.groups.other.label",
|
||||
groups: {
|
||||
event: {},
|
||||
geo_location: {},
|
||||
homeassistant: {},
|
||||
@@ -45,9 +32,25 @@ export const TRIGGER_COLLECTIONS: AutomationElementGroupCollection[] = [
|
||||
template: {},
|
||||
webhook: {},
|
||||
persistent_notification: {},
|
||||
helpers: {},
|
||||
other: {},
|
||||
},
|
||||
},
|
||||
{
|
||||
titleKey: "ui.panel.config.automation.editor.triggers.groups.generic.label",
|
||||
generic: true,
|
||||
groups: {
|
||||
device: {},
|
||||
entity: { icon: mdiShape, members: { state: {}, numeric_state: {} } },
|
||||
},
|
||||
},
|
||||
{
|
||||
titleKey:
|
||||
"ui.panel.config.automation.editor.triggers.groups.custom_integrations.label",
|
||||
groups: {
|
||||
customDynamicGroups: {},
|
||||
},
|
||||
},
|
||||
] as const;
|
||||
|
||||
export const isTriggerList = (trigger: Trigger): trigger is TriggerList =>
|
||||
|
||||
@@ -146,6 +146,7 @@ const TYPES = {
|
||||
export interface CollectionGroup {
|
||||
collectionIndex: number;
|
||||
titleKey?: LocalizeKeys;
|
||||
generic?: boolean;
|
||||
groups: AddAutomationElementListItem[];
|
||||
}
|
||||
|
||||
@@ -176,9 +177,16 @@ const ENTITY_DOMAINS_OTHER = new Set([
|
||||
|
||||
const ENTITY_DOMAINS_MAIN = new Set(["notify"]);
|
||||
|
||||
const DYNAMIC_KEYWORDS = ["dynamicGroups", "helpers", "other"];
|
||||
const DYNAMIC_KEYWORDS = [
|
||||
"dynamicGroups",
|
||||
"helpers",
|
||||
"other",
|
||||
"customDynamicGroups",
|
||||
];
|
||||
|
||||
const GENERIC_GROUPS = new Set(["device", "entity", `${DYNAMIC_PREFIX}event`]);
|
||||
const DYNAMIC_TO_GENERIC = new Set([`${DYNAMIC_PREFIX}event`]);
|
||||
|
||||
type CollectionGroupType = "helper" | "other" | "dynamic" | "customDynamic";
|
||||
|
||||
@customElement("add-automation-element-dialog")
|
||||
class DialogAddAutomationElement
|
||||
@@ -1086,10 +1094,27 @@ class DialogAddAutomationElement
|
||||
): CollectionGroup[] => {
|
||||
const generatedCollections: CollectionGroup[] = [];
|
||||
|
||||
let genericCollectionIndex = -1;
|
||||
let dynamicCollectionIndex = -1;
|
||||
|
||||
collections.forEach((collection, index) => {
|
||||
let collectionGroups = Object.entries(collection.groups);
|
||||
const groups: AddAutomationElementListItem[] = [];
|
||||
|
||||
const types: CollectionGroupType[] = [];
|
||||
if (collection.groups.dynamicGroups) {
|
||||
types.push("dynamic");
|
||||
}
|
||||
if (collection.groups.helpers) {
|
||||
types.push("helper");
|
||||
}
|
||||
if (collection.groups.other) {
|
||||
types.push("other");
|
||||
}
|
||||
if (collection.groups.customDynamicGroups) {
|
||||
types.push("customDynamic");
|
||||
}
|
||||
|
||||
if (
|
||||
type === "trigger" &&
|
||||
Object.keys(collection.groups).some((item) =>
|
||||
@@ -1102,11 +1127,7 @@ class DialogAddAutomationElement
|
||||
triggerDescriptions,
|
||||
manifests,
|
||||
domains,
|
||||
collection.groups.dynamicGroups
|
||||
? undefined
|
||||
: collection.groups.helpers
|
||||
? "helper"
|
||||
: "other"
|
||||
types
|
||||
)
|
||||
);
|
||||
|
||||
@@ -1125,11 +1146,7 @@ class DialogAddAutomationElement
|
||||
conditionDescriptions,
|
||||
manifests,
|
||||
domains,
|
||||
collection.groups.dynamicGroups
|
||||
? undefined
|
||||
: collection.groups.helpers
|
||||
? "helper"
|
||||
: "other"
|
||||
types
|
||||
)
|
||||
);
|
||||
|
||||
@@ -1167,55 +1184,45 @@ class DialogAddAutomationElement
|
||||
)
|
||||
);
|
||||
|
||||
generatedCollections.push({
|
||||
collectionIndex: index,
|
||||
titleKey: collection.titleKey,
|
||||
groups: groups.sort((a, b) => {
|
||||
// make sure device is always on top
|
||||
if (a.key === "device" || a.key === "device_id") {
|
||||
return -1;
|
||||
}
|
||||
if (b.key === "device" || b.key === "device_id") {
|
||||
return 1;
|
||||
}
|
||||
return stringCompare(a.name, b.name, this.hass.locale.language);
|
||||
}),
|
||||
});
|
||||
if (groups.length) {
|
||||
if (collection.generic) {
|
||||
genericCollectionIndex = index;
|
||||
}
|
||||
if (collection.groups.dynamicGroups) {
|
||||
dynamicCollectionIndex = index;
|
||||
}
|
||||
|
||||
generatedCollections.push({
|
||||
collectionIndex: index,
|
||||
titleKey: collection.titleKey,
|
||||
generic: collection.generic,
|
||||
groups: groups.sort((a, b) => {
|
||||
return stringCompare(a.name, b.name, this.hass.locale.language);
|
||||
}),
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
return !["trigger", "condition"].includes(type)
|
||||
? generatedCollections
|
||||
: generatedCollections.flatMap(
|
||||
(collection: CollectionGroup): CollectionGroup[] => {
|
||||
const genericGroups = collection.groups.filter((group) =>
|
||||
GENERIC_GROUPS.has(group.key)
|
||||
);
|
||||
// move groups from dynamic to generic
|
||||
if (genericCollectionIndex !== -1 && dynamicCollectionIndex !== -1) {
|
||||
const groupsToMove =
|
||||
generatedCollections[dynamicCollectionIndex].groups.filter((group) =>
|
||||
DYNAMIC_TO_GENERIC.has(group.key)
|
||||
) || [];
|
||||
generatedCollections[dynamicCollectionIndex].groups =
|
||||
generatedCollections[dynamicCollectionIndex].groups.filter(
|
||||
(group) => !DYNAMIC_TO_GENERIC.has(group.key)
|
||||
) || [];
|
||||
|
||||
const mainGroups = collection.groups.filter(
|
||||
(group) => !GENERIC_GROUPS.has(group.key)
|
||||
);
|
||||
generatedCollections[genericCollectionIndex].groups = [
|
||||
...(generatedCollections[genericCollectionIndex].groups || []),
|
||||
...groupsToMove,
|
||||
].sort((a, b) =>
|
||||
stringCompare(a.name, b.name, this.hass.locale.language)
|
||||
);
|
||||
}
|
||||
|
||||
return [
|
||||
...(mainGroups.length
|
||||
? [
|
||||
{
|
||||
...collection,
|
||||
groups: mainGroups,
|
||||
},
|
||||
]
|
||||
: []),
|
||||
...(genericGroups.length
|
||||
? [
|
||||
{
|
||||
collectionIndex: collection.collectionIndex,
|
||||
titleKey: "ui.panel.config.automation.editor.generic",
|
||||
groups: genericGroups,
|
||||
} satisfies CollectionGroup,
|
||||
]
|
||||
: []),
|
||||
];
|
||||
}
|
||||
);
|
||||
return generatedCollections;
|
||||
}
|
||||
);
|
||||
|
||||
@@ -1363,34 +1370,31 @@ class DialogAddAutomationElement
|
||||
domain: string,
|
||||
manifest: DomainManifestLookup[string] | undefined,
|
||||
domainUsed: boolean,
|
||||
type: "helper" | "other" | undefined
|
||||
types: CollectionGroupType[]
|
||||
): boolean {
|
||||
if (type === undefined) {
|
||||
return (
|
||||
ENTITY_DOMAINS_MAIN.has(domain) ||
|
||||
const matchDynamic =
|
||||
((types.includes("dynamic") && (!manifest || manifest.is_built_in)) ||
|
||||
(types.includes("customDynamic") &&
|
||||
!(manifest?.is_built_in ?? true))) &&
|
||||
(ENTITY_DOMAINS_MAIN.has(domain) ||
|
||||
(manifest?.integration_type === "entity" &&
|
||||
!ENTITY_DOMAINS_OTHER.has(domain) &&
|
||||
(domainUsed || (this._systemDomains?.active.has(domain) ?? false))) ||
|
||||
(manifest?.integration_type === "system" &&
|
||||
(this._systemDomains?.active.has(domain) ?? false))
|
||||
);
|
||||
}
|
||||
if (type === "helper") {
|
||||
return manifest?.integration_type === "helper";
|
||||
}
|
||||
// type === "other"
|
||||
return (
|
||||
(this._systemDomains?.active.has(domain) ?? false)));
|
||||
|
||||
const matchHelper =
|
||||
types.includes("helper") && manifest?.integration_type === "helper";
|
||||
|
||||
const matchOther =
|
||||
types.includes("other") &&
|
||||
!ENTITY_DOMAINS_MAIN.has(domain) &&
|
||||
(ENTITY_DOMAINS_OTHER.has(domain) ||
|
||||
(!domainUsed &&
|
||||
manifest?.integration_type === "entity" &&
|
||||
!(this._systemDomains?.active.has(domain) ?? false)) ||
|
||||
(manifest?.integration_type === "system" &&
|
||||
!(this._systemDomains?.active.has(domain) ?? false)) ||
|
||||
!["helper", "entity", "system"].includes(
|
||||
manifest?.integration_type || ""
|
||||
))
|
||||
);
|
||||
));
|
||||
|
||||
return matchDynamic || matchHelper || matchOther;
|
||||
}
|
||||
|
||||
private _triggerGroups = (
|
||||
@@ -1398,7 +1402,7 @@ class DialogAddAutomationElement
|
||||
triggers: TriggerDescriptions,
|
||||
manifests: DomainManifestLookup | undefined,
|
||||
domains: Set<string> | undefined,
|
||||
type: "helper" | "other" | undefined
|
||||
types: CollectionGroupType[]
|
||||
): AddAutomationElementListItem[] => {
|
||||
if (!triggers || !manifests) {
|
||||
return [];
|
||||
@@ -1416,7 +1420,7 @@ class DialogAddAutomationElement
|
||||
const manifest = manifests[domain];
|
||||
const domainUsed = !domains ? true : domains.has(domain);
|
||||
|
||||
if (this._domainMatchesGroupType(domain, manifest, domainUsed, type)) {
|
||||
if (this._domainMatchesGroupType(domain, manifest, domainUsed, types)) {
|
||||
result.push({
|
||||
icon: html`
|
||||
<ha-domain-icon .domain=${domain} brand-fallback></ha-domain-icon>
|
||||
@@ -1470,7 +1474,7 @@ class DialogAddAutomationElement
|
||||
conditions: ConditionDescriptions,
|
||||
manifests: DomainManifestLookup | undefined,
|
||||
domains: Set<string> | undefined,
|
||||
type: "helper" | "other" | undefined
|
||||
types: CollectionGroupType[]
|
||||
): AddAutomationElementListItem[] => {
|
||||
if (!conditions || !manifests) {
|
||||
return [];
|
||||
@@ -1488,7 +1492,7 @@ class DialogAddAutomationElement
|
||||
const manifest = manifests[domain];
|
||||
const domainUsed = !domains ? true : domains.has(domain);
|
||||
|
||||
if (this._domainMatchesGroupType(domain, manifest, domainUsed, type)) {
|
||||
if (this._domainMatchesGroupType(domain, manifest, domainUsed, types)) {
|
||||
result.push({
|
||||
icon: html`
|
||||
<ha-domain-icon .domain=${domain} brand-fallback></ha-domain-icon>
|
||||
|
||||
@@ -100,7 +100,8 @@ export class HaPlatformCondition extends LitElement {
|
||||
field.default !== undefined &&
|
||||
updatedOptions[key] === undefined &&
|
||||
!(
|
||||
key === "behavior" &&
|
||||
field.selector &&
|
||||
"automation_behavior" in field.selector &&
|
||||
this.description?.target &&
|
||||
!this.condition?.target
|
||||
)
|
||||
@@ -227,7 +228,7 @@ export class HaPlatformCondition extends LitElement {
|
||||
}
|
||||
|
||||
if (
|
||||
fieldName === "behavior" &&
|
||||
"automation_behavior" in selector &&
|
||||
this.description?.target &&
|
||||
(!this.condition?.target ||
|
||||
(this._resolvedTargetEntityCount !== undefined &&
|
||||
@@ -437,17 +438,32 @@ export class HaPlatformCondition extends LitElement {
|
||||
) {
|
||||
this._resolvedTargetEntityCount = getTargetEntityCount(target);
|
||||
|
||||
const behaviorFieldEntry = Object.entries(
|
||||
this.description?.fields ?? {}
|
||||
).find(
|
||||
([, field]) => field.selector && "automation_behavior" in field.selector
|
||||
);
|
||||
|
||||
if (!behaviorFieldEntry) {
|
||||
return;
|
||||
}
|
||||
|
||||
const [behaviorFieldName, behaviorField] = behaviorFieldEntry;
|
||||
|
||||
if (
|
||||
target &&
|
||||
this._resolvedTargetEntityCount > 1 &&
|
||||
this.condition.options?.behavior === undefined
|
||||
this.condition.options?.[behaviorFieldName] === undefined
|
||||
) {
|
||||
const behaviorDefault = this.description?.fields?.behavior?.default;
|
||||
const behaviorDefault = behaviorField.default;
|
||||
if (behaviorDefault !== undefined) {
|
||||
fireEvent(this, "value-changed", {
|
||||
value: {
|
||||
...this.condition,
|
||||
options: { ...this.condition.options, behavior: behaviorDefault },
|
||||
options: {
|
||||
...this.condition.options,
|
||||
[behaviorFieldName]: behaviorDefault,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -135,7 +135,8 @@ export class HaPlatformTrigger extends LitElement {
|
||||
field.default !== undefined &&
|
||||
updatedOptions[key] === undefined &&
|
||||
!(
|
||||
key === "behavior" &&
|
||||
field.selector &&
|
||||
"automation_behavior" in field.selector &&
|
||||
this.description?.target &&
|
||||
!this.trigger?.target
|
||||
)
|
||||
@@ -262,7 +263,7 @@ export class HaPlatformTrigger extends LitElement {
|
||||
}
|
||||
|
||||
if (
|
||||
fieldName === "behavior" &&
|
||||
"automation_behavior" in selector &&
|
||||
this.description?.target &&
|
||||
(!this.trigger?.target ||
|
||||
(this._resolvedTargetEntityCount !== undefined &&
|
||||
@@ -470,17 +471,32 @@ export class HaPlatformTrigger extends LitElement {
|
||||
private _updateResolvedTargetEntityCount(target: PlatformTrigger["target"]) {
|
||||
this._resolvedTargetEntityCount = getTargetEntityCount(target);
|
||||
|
||||
const behaviorFieldEntry = Object.entries(
|
||||
this.description?.fields ?? {}
|
||||
).find(
|
||||
([, field]) => field.selector && "automation_behavior" in field.selector
|
||||
);
|
||||
|
||||
if (!behaviorFieldEntry) {
|
||||
return;
|
||||
}
|
||||
|
||||
const [behaviorFieldName, behaviorField] = behaviorFieldEntry;
|
||||
|
||||
if (
|
||||
target &&
|
||||
this._resolvedTargetEntityCount > 1 &&
|
||||
this.trigger.options?.behavior === undefined
|
||||
this.trigger.options?.[behaviorFieldName] === undefined
|
||||
) {
|
||||
const behaviorDefault = this.description?.fields?.behavior?.default;
|
||||
const behaviorDefault = behaviorField.default;
|
||||
if (behaviorDefault !== undefined) {
|
||||
fireEvent(this, "value-changed", {
|
||||
value: {
|
||||
...this.trigger,
|
||||
options: { ...this.trigger.options, behavior: behaviorDefault },
|
||||
options: {
|
||||
...this.trigger.options,
|
||||
[behaviorFieldName]: behaviorDefault,
|
||||
},
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
@@ -669,6 +669,9 @@ class HaPanelDevAction extends LitElement {
|
||||
}
|
||||
.button-row {
|
||||
padding: var(--ha-space-2) var(--ha-space-4);
|
||||
border-top: 1px solid var(--divider-color);
|
||||
border-bottom: 1px solid var(--divider-color);
|
||||
background: var(--card-background-color);
|
||||
position: sticky;
|
||||
bottom: 0;
|
||||
box-sizing: border-box;
|
||||
|
||||
@@ -623,6 +623,36 @@
|
||||
"between": "In range",
|
||||
"outside": "Outside range"
|
||||
}
|
||||
},
|
||||
"automation_behavior": {
|
||||
"trigger": {
|
||||
"options": {
|
||||
"any": {
|
||||
"label": "Each",
|
||||
"description": "Triggers once for every target that changes"
|
||||
},
|
||||
"first": {
|
||||
"label": "First",
|
||||
"description": "Triggers the first time any target changes"
|
||||
},
|
||||
"last": {
|
||||
"label": "All",
|
||||
"description": "Triggers once all targets have changed"
|
||||
}
|
||||
}
|
||||
},
|
||||
"condition": {
|
||||
"options": {
|
||||
"any": {
|
||||
"label": "Any",
|
||||
"description": "Is true if any target matches the desired state"
|
||||
},
|
||||
"all": {
|
||||
"label": "All",
|
||||
"description": "Is true if all targets match the desired state"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
"logbook": {
|
||||
@@ -5079,14 +5109,14 @@
|
||||
"entity": {
|
||||
"label": "Entity"
|
||||
},
|
||||
"helpers": {
|
||||
"label": "Helpers"
|
||||
},
|
||||
"time_location": {
|
||||
"label": "Time and location"
|
||||
},
|
||||
"other": {
|
||||
"label": "Other triggers"
|
||||
"generic": {
|
||||
"label": "Generic"
|
||||
},
|
||||
"custom_integrations": {
|
||||
"label": "Custom integrations"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
@@ -5354,14 +5384,14 @@
|
||||
"time_location": {
|
||||
"label": "Time and location"
|
||||
},
|
||||
"helpers": {
|
||||
"label": "Helpers"
|
||||
},
|
||||
"other": {
|
||||
"label": "Other conditions"
|
||||
"generic": {
|
||||
"label": "Generic"
|
||||
},
|
||||
"building_blocks": {
|
||||
"label": "Building blocks"
|
||||
},
|
||||
"custom_integrations": {
|
||||
"label": "Custom integrations"
|
||||
}
|
||||
},
|
||||
"type": {
|
||||
|
||||
Reference in New Issue
Block a user