mirror of
https://github.com/home-assistant/frontend.git
synced 2025-10-03 16:59:42 +00:00
Compare commits
649 Commits
20231025.1
...
fix-automa
Author | SHA1 | Date | |
---|---|---|---|
![]() |
c9152bd077 | ||
![]() |
64fc58ddd2 | ||
![]() |
568e9ebc38 | ||
![]() |
33888beb63 | ||
![]() |
0bc6f9152a | ||
![]() |
17fd0de102 | ||
![]() |
f98e66a409 | ||
![]() |
314499005d | ||
![]() |
6dcc70f6fc | ||
![]() |
5e40bb55eb | ||
![]() |
476457fe2e | ||
![]() |
4c314928c6 | ||
![]() |
73460c7d8a | ||
![]() |
767b2b6b9c | ||
![]() |
0944b1e9d3 | ||
![]() |
623ac88166 | ||
![]() |
3a204d889f | ||
![]() |
107f0da88b | ||
![]() |
86bbff36ea | ||
![]() |
42a52f9a1c | ||
![]() |
ade8687d7b | ||
![]() |
e1341a1961 | ||
![]() |
74282e9afe | ||
![]() |
687c9753a0 | ||
![]() |
4825163b20 | ||
![]() |
a37bea3701 | ||
![]() |
0d8f9351cc | ||
![]() |
692774f6c4 | ||
![]() |
6ee1404eef | ||
![]() |
97652bd2f6 | ||
![]() |
a566479ddc | ||
![]() |
44e62fbb04 | ||
![]() |
1f9e919762 | ||
![]() |
973752b974 | ||
![]() |
75bbc33fa2 | ||
![]() |
59a3a35b19 | ||
![]() |
b224ec50e4 | ||
![]() |
2925ef3db0 | ||
![]() |
c2d71ac789 | ||
![]() |
85f086d02e | ||
![]() |
beb3454f8d | ||
![]() |
807d08d8eb | ||
![]() |
cc4cfe1b5c | ||
![]() |
88f67230fc | ||
![]() |
d335dd4b83 | ||
![]() |
98e3dbceb5 | ||
![]() |
1c9ea0a9d9 | ||
![]() |
f6af73b222 | ||
![]() |
9354ed927b | ||
![]() |
545d140dcf | ||
![]() |
634122657c | ||
![]() |
349344161a | ||
![]() |
28a8863f45 | ||
![]() |
5c72c38c0d | ||
![]() |
fffed0f5e1 | ||
![]() |
bf4b76864d | ||
![]() |
10ad0010cf | ||
![]() |
3a99a7de78 | ||
![]() |
69139b35e1 | ||
![]() |
55a5739e77 | ||
![]() |
a8b48b4619 | ||
![]() |
dcb3accdb8 | ||
![]() |
45398f84cb | ||
![]() |
319cf64977 | ||
![]() |
646c02d855 | ||
![]() |
77dd2a87d9 | ||
![]() |
51059e99a5 | ||
![]() |
809df848ef | ||
![]() |
619675318c | ||
![]() |
081636b3e7 | ||
![]() |
b969144f50 | ||
![]() |
24bfa4919a | ||
![]() |
fcc9a80103 | ||
![]() |
99a365fb49 | ||
![]() |
6a95177b32 | ||
![]() |
ca68eaab38 | ||
![]() |
6234f7b7d2 | ||
![]() |
04f6a01c3d | ||
![]() |
9bad3c8101 | ||
![]() |
7398c6ab3e | ||
![]() |
4046534fa8 | ||
![]() |
8f43caee2e | ||
![]() |
83c5408f8f | ||
![]() |
7d4284d409 | ||
![]() |
58c4bf081b | ||
![]() |
d1478567f0 | ||
![]() |
d85c729fa5 | ||
![]() |
c65fadbd8a | ||
![]() |
4326007022 | ||
![]() |
38b01e9335 | ||
![]() |
22625a805d | ||
![]() |
a06c9d0cc6 | ||
![]() |
490ed86e86 | ||
![]() |
df2514d79f | ||
![]() |
13a8b10f5c | ||
![]() |
bb4f09ad9a | ||
![]() |
1f2683dd56 | ||
![]() |
0ba8babd87 | ||
![]() |
65d4d44f06 | ||
![]() |
6f8c366bad | ||
![]() |
3842e8e3a7 | ||
![]() |
b881a2a88a | ||
![]() |
70fcea0c2b | ||
![]() |
9f26bedf51 | ||
![]() |
2053cf23c2 | ||
![]() |
b801441201 | ||
![]() |
7209ed055a | ||
![]() |
894205eff7 | ||
![]() |
64b0b64468 | ||
![]() |
920df03cc1 | ||
![]() |
5a91f613ca | ||
![]() |
61eaa07b25 | ||
![]() |
62f6766e1b | ||
![]() |
f5994d2ae5 | ||
![]() |
7e93367394 | ||
![]() |
6256192c0c | ||
![]() |
08fb3ced5f | ||
![]() |
5aa5ce8b5e | ||
![]() |
7c389a6cf0 | ||
![]() |
f63ba0c20a | ||
![]() |
01e80108d7 | ||
![]() |
148c0c98d3 | ||
![]() |
11a9a2f56b | ||
![]() |
6cdf1c1689 | ||
![]() |
2cfaa4f261 | ||
![]() |
d3b0d03e70 | ||
![]() |
08b8978ee8 | ||
![]() |
d2019c2315 | ||
![]() |
02a7d0e797 | ||
![]() |
03751d2581 | ||
![]() |
b9069b25ad | ||
![]() |
a136fa687f | ||
![]() |
de35e89c58 | ||
![]() |
85beefec4c | ||
![]() |
877c9b007b | ||
![]() |
adb851a2b4 | ||
![]() |
6ab5116c34 | ||
![]() |
a5630a4a7d | ||
![]() |
e8c1a34f3b | ||
![]() |
88abeada44 | ||
![]() |
96a41704ea | ||
![]() |
8583c879f2 | ||
![]() |
3edc77c978 | ||
![]() |
03a1c21f34 | ||
![]() |
80b1a6297b | ||
![]() |
056eb888f3 | ||
![]() |
d4ec608123 | ||
![]() |
2451cf77f9 | ||
![]() |
3b6b77c75b | ||
![]() |
e0f578c135 | ||
![]() |
ec2ae15e3f | ||
![]() |
f5fc66f47e | ||
![]() |
ae79df8c55 | ||
![]() |
104aef3dec | ||
![]() |
17e62c10d4 | ||
![]() |
90965a4f4d | ||
![]() |
8960f5fef9 | ||
![]() |
783a8242e1 | ||
![]() |
7a8f5c0cc9 | ||
![]() |
53be012b34 | ||
![]() |
be7b3a56f9 | ||
![]() |
554e5b7be5 | ||
![]() |
249c89669e | ||
![]() |
fe5431976d | ||
![]() |
72dedc7596 | ||
![]() |
8615b799c6 | ||
![]() |
fd6cae48b7 | ||
![]() |
ecadc06b45 | ||
![]() |
e5d31d85dd | ||
![]() |
e427ffca5f | ||
![]() |
4f05bd9e22 | ||
![]() |
0d8c0ac1a0 | ||
![]() |
3984702d3e | ||
![]() |
979085a9de | ||
![]() |
7a6fc573c2 | ||
![]() |
6929a9c603 | ||
![]() |
41bb677ebe | ||
![]() |
8368fb4408 | ||
![]() |
acbb7e0453 | ||
![]() |
6224cb6994 | ||
![]() |
29fefa1d60 | ||
![]() |
c7a98fa5a1 | ||
![]() |
46565715c9 | ||
![]() |
8a8b04ed00 | ||
![]() |
e721481757 | ||
![]() |
2933d642ed | ||
![]() |
7d412a9913 | ||
![]() |
5eaa6dafd9 | ||
![]() |
f994b378f1 | ||
![]() |
7d6dfaad15 | ||
![]() |
def2eadc24 | ||
![]() |
53a25dde26 | ||
![]() |
6f7da16d1d | ||
![]() |
5ac0360494 | ||
![]() |
1b6def4875 | ||
![]() |
52fcf64cfd | ||
![]() |
c650e23432 | ||
![]() |
428604d91d | ||
![]() |
d0c1481f76 | ||
![]() |
6cc9a99b77 | ||
![]() |
d25f49b694 | ||
![]() |
b92d25e28a | ||
![]() |
bf5c5bc46f | ||
![]() |
e7cc842be4 | ||
![]() |
cb29d35949 | ||
![]() |
fe18f70e51 | ||
![]() |
ee57f26415 | ||
![]() |
721ec8e559 | ||
![]() |
c584f83071 | ||
![]() |
3c2fed5041 | ||
![]() |
7e6d974438 | ||
![]() |
c95a30c837 | ||
![]() |
cb568d005e | ||
![]() |
442cce1574 | ||
![]() |
c25baf25ad | ||
![]() |
5e279405c7 | ||
![]() |
e5707b423f | ||
![]() |
7983556f98 | ||
![]() |
1916dff57b | ||
![]() |
b11563d618 | ||
![]() |
b180a587bf | ||
![]() |
5b11e0ce29 | ||
![]() |
d6684c5806 | ||
![]() |
1a0e3890f4 | ||
![]() |
caece9d6ad | ||
![]() |
953a3793c4 | ||
![]() |
8bfae3b4cf | ||
![]() |
6911685bd0 | ||
![]() |
71025eaf4d | ||
![]() |
3aa612b766 | ||
![]() |
a2ffd0ae83 | ||
![]() |
c399da586e | ||
![]() |
d7826e4e6c | ||
![]() |
f5d13c9079 | ||
![]() |
01a142790f | ||
![]() |
df54687de1 | ||
![]() |
bded31b311 | ||
![]() |
67e573aff7 | ||
![]() |
6295c4ac76 | ||
![]() |
469811847f | ||
![]() |
8a1aefefca | ||
![]() |
bea16028a1 | ||
![]() |
bedb7d1d9e | ||
![]() |
1a3a20f478 | ||
![]() |
68ecb7c219 | ||
![]() |
61b04a882b | ||
![]() |
f8e621c5b9 | ||
![]() |
2f2209682e | ||
![]() |
f4f361b51a | ||
![]() |
55e59f8cb0 | ||
![]() |
6d20ed0a22 | ||
![]() |
874f604295 | ||
![]() |
30d36a11c1 | ||
![]() |
09dcc29175 | ||
![]() |
8f07e6f141 | ||
![]() |
7b6b5724e1 | ||
![]() |
521c0b58c8 | ||
![]() |
53839ab7b1 | ||
![]() |
dcfe9617b3 | ||
![]() |
58eebf2dbd | ||
![]() |
af9b64c6f0 | ||
![]() |
2b18ac8d4e | ||
![]() |
2306234063 | ||
![]() |
883a9e422e | ||
![]() |
d77ce721e3 | ||
![]() |
325ad6f721 | ||
![]() |
d762a9365f | ||
![]() |
ce983f043e | ||
![]() |
45b7ebbe46 | ||
![]() |
3e7fa66790 | ||
![]() |
ad543dbffb | ||
![]() |
cdd2c7be9a | ||
![]() |
ddf6945190 | ||
![]() |
f2745747ba | ||
![]() |
ff9d179c13 | ||
![]() |
e813108c66 | ||
![]() |
62d8cdfcf9 | ||
![]() |
5b9d46e350 | ||
![]() |
e5db95b2d2 | ||
![]() |
a8f7c7c999 | ||
![]() |
8a423fb775 | ||
![]() |
90c3d69af6 | ||
![]() |
bcb2d73c5c | ||
![]() |
8a6cea12e1 | ||
![]() |
0056de146a | ||
![]() |
0bcdbef11e | ||
![]() |
1b208cb531 | ||
![]() |
6a975e260c | ||
![]() |
02d2bde269 | ||
![]() |
70cfa7f48a | ||
![]() |
b7d4b9c21b | ||
![]() |
673c947c11 | ||
![]() |
2682a55148 | ||
![]() |
616f6ddf5f | ||
![]() |
29769813bc | ||
![]() |
221c46344a | ||
![]() |
a33eb25c92 | ||
![]() |
1dc61320a6 | ||
![]() |
ad556a43f9 | ||
![]() |
12e6701ffa | ||
![]() |
7167b66719 | ||
![]() |
a52ba5fbd1 | ||
![]() |
22cf903656 | ||
![]() |
d77b657036 | ||
![]() |
4a3038c12c | ||
![]() |
3ac7cd5d4a | ||
![]() |
58eddd2b42 | ||
![]() |
d808da68bd | ||
![]() |
2ed4d1efa0 | ||
![]() |
fcb9e13a84 | ||
![]() |
3ada2f3279 | ||
![]() |
8d2d45ae4e | ||
![]() |
c9e6963387 | ||
![]() |
6d36b0e28c | ||
![]() |
61117bb34f | ||
![]() |
86a3c32844 | ||
![]() |
b855b3e103 | ||
![]() |
80edeebab9 | ||
![]() |
f366e287b1 | ||
![]() |
9ce8684aba | ||
![]() |
caa6ea531c | ||
![]() |
cca1183ee3 | ||
![]() |
0f9c97aea0 | ||
![]() |
8d08aa8c79 | ||
![]() |
eebcab435d | ||
![]() |
76d3c6e237 | ||
![]() |
a820ca1e90 | ||
![]() |
39260d172f | ||
![]() |
e646528b86 | ||
![]() |
86726102fb | ||
![]() |
1330558819 | ||
![]() |
b4ab0fc10b | ||
![]() |
15becf9ef6 | ||
![]() |
ef3785ce9f | ||
![]() |
134e13005d | ||
![]() |
dccd9b2541 | ||
![]() |
de83ad7a7a | ||
![]() |
7e55b9e6b8 | ||
![]() |
1b74ca47bf | ||
![]() |
c3d4be9ceb | ||
![]() |
b8d0c7f7c7 | ||
![]() |
92bce4078f | ||
![]() |
ff8f0697c2 | ||
![]() |
dddba7af00 | ||
![]() |
14a49d6664 | ||
![]() |
22da402d56 | ||
![]() |
aa4acc6572 | ||
![]() |
4d432fba57 | ||
![]() |
97b71c785b | ||
![]() |
8a93284bb3 | ||
![]() |
bb2abe4efc | ||
![]() |
ccada33caf | ||
![]() |
c5f15ee6ba | ||
![]() |
6f240ec681 | ||
![]() |
fc6aef138d | ||
![]() |
6d0eb05954 | ||
![]() |
96fbbc55e1 | ||
![]() |
7e74502ba3 | ||
![]() |
b273b31b03 | ||
![]() |
cf00ac74c6 | ||
![]() |
cc702f0fb3 | ||
![]() |
cc6eb5789d | ||
![]() |
669b80a9e1 | ||
![]() |
4c4fddee94 | ||
![]() |
b28a4e6b50 | ||
![]() |
bdd6a55a84 | ||
![]() |
d1ebc06994 | ||
![]() |
2a150788b4 | ||
![]() |
72caf72e80 | ||
![]() |
a6ff1899df | ||
![]() |
6a999597df | ||
![]() |
219fc9e53a | ||
![]() |
861959ed2d | ||
![]() |
f7f50294e7 | ||
![]() |
a226333c1e | ||
![]() |
75f18aa69b | ||
![]() |
60ff4fdc1f | ||
![]() |
8d14cb0ab7 | ||
![]() |
606c809880 | ||
![]() |
f1692038f8 | ||
![]() |
79f5ec0cd5 | ||
![]() |
416a2a080d | ||
![]() |
92dc8b1561 | ||
![]() |
07b807adfc | ||
![]() |
843430ef41 | ||
![]() |
b5b2392dd2 | ||
![]() |
bf24740c7b | ||
![]() |
4ec11c7cf6 | ||
![]() |
8ff36d0ccf | ||
![]() |
e7e465df69 | ||
![]() |
0c042079ed | ||
![]() |
a5a9bcafa7 | ||
![]() |
867f625b0a | ||
![]() |
3876c67588 | ||
![]() |
93158bb3af | ||
![]() |
5c47d8652d | ||
![]() |
eda0d12867 | ||
![]() |
4a53de4466 | ||
![]() |
e730649a8d | ||
![]() |
3a94deef69 | ||
![]() |
c1c186d279 | ||
![]() |
7356db919a | ||
![]() |
44157a5df3 | ||
![]() |
2acd1ff5e8 | ||
![]() |
150a5571cf | ||
![]() |
1eb25f4829 | ||
![]() |
d8d4ecf79f | ||
![]() |
081bd98e98 | ||
![]() |
6134f415e9 | ||
![]() |
b6a7581eca | ||
![]() |
7727f34e8f | ||
![]() |
9b20e1cf56 | ||
![]() |
b901ecacca | ||
![]() |
7691f7eb05 | ||
![]() |
8c0c56b954 | ||
![]() |
d968a20862 | ||
![]() |
9f1cd80a31 | ||
![]() |
5a9ccc5ae7 | ||
![]() |
6d7b0c5626 | ||
![]() |
400b8034e1 | ||
![]() |
05a22e3271 | ||
![]() |
c1f76e0565 | ||
![]() |
4582c3ba0a | ||
![]() |
f4ee734ea3 | ||
![]() |
2087028c47 | ||
![]() |
37a56b250a | ||
![]() |
71a41be20a | ||
![]() |
ffb19b31a5 | ||
![]() |
db68c7faa9 | ||
![]() |
07ae958eb0 | ||
![]() |
b62b5f6575 | ||
![]() |
2e1fb9df66 | ||
![]() |
31c91cea9a | ||
![]() |
9dc844ca28 | ||
![]() |
02ebc028c8 | ||
![]() |
5d35605b82 | ||
![]() |
22e86af5b3 | ||
![]() |
8c39ed46a8 | ||
![]() |
5965c3fdaa | ||
![]() |
15a5d2bc38 | ||
![]() |
0432cc95fc | ||
![]() |
6dafaac021 | ||
![]() |
d8929c9252 | ||
![]() |
5fa3a720b3 | ||
![]() |
6d3b838b6a | ||
![]() |
58e0179321 | ||
![]() |
eaf7e29b8a | ||
![]() |
260f1df1b9 | ||
![]() |
a88a4ef82c | ||
![]() |
075cca5991 | ||
![]() |
1d2dc37f75 | ||
![]() |
3da7025d78 | ||
![]() |
15b1d8ee14 | ||
![]() |
239d8fa948 | ||
![]() |
1de2e6161d | ||
![]() |
3e7f008277 | ||
![]() |
31a93d360d | ||
![]() |
2afd2788e2 | ||
![]() |
322fa99147 | ||
![]() |
c43ad52ff1 | ||
![]() |
6aa9737481 | ||
![]() |
7d9d6b99d9 | ||
![]() |
9c69e6f87c | ||
![]() |
0c90021895 | ||
![]() |
9163b9c124 | ||
![]() |
61717e1529 | ||
![]() |
168d418c27 | ||
![]() |
c787c920fc | ||
![]() |
1526209f82 | ||
![]() |
cf355c419d | ||
![]() |
eef024587b | ||
![]() |
270d463d02 | ||
![]() |
0735705dd3 | ||
![]() |
0a1dbe6d9d | ||
![]() |
15395275ba | ||
![]() |
6e66ba202f | ||
![]() |
5ebe1e0369 | ||
![]() |
860ab7a3ba | ||
![]() |
d499640304 | ||
![]() |
4f3f516767 | ||
![]() |
0996dbf2a1 | ||
![]() |
bc59e52cea | ||
![]() |
b8d4e957e2 | ||
![]() |
8002ec75bc | ||
![]() |
a45eefa742 | ||
![]() |
a1236924aa | ||
![]() |
9320e8c1a3 | ||
![]() |
addcd3a983 | ||
![]() |
e1dc73e992 | ||
![]() |
ba8849ed4d | ||
![]() |
36bca04341 | ||
![]() |
fb95de1f73 | ||
![]() |
3addfc3548 | ||
![]() |
e2e80d1f49 | ||
![]() |
a96eba2637 | ||
![]() |
274810b954 | ||
![]() |
842df983c3 | ||
![]() |
0eeadcd31a | ||
![]() |
8d37c5612b | ||
![]() |
e94461f7fe | ||
![]() |
f5edee1e91 | ||
![]() |
98cdbb4559 | ||
![]() |
f3f63d95b5 | ||
![]() |
244340f211 | ||
![]() |
75626431b1 | ||
![]() |
244868348b | ||
![]() |
a909c6d905 | ||
![]() |
f2efff9d71 | ||
![]() |
08a7a10e1c | ||
![]() |
b35e5abd83 | ||
![]() |
291e9fc0a2 | ||
![]() |
de370d6384 | ||
![]() |
1cf928b425 | ||
![]() |
b9c62c34a0 | ||
![]() |
37554213dc | ||
![]() |
3845fd2ef9 | ||
![]() |
837b36a430 | ||
![]() |
bff09a7a36 | ||
![]() |
a5e5efa526 | ||
![]() |
1cd5b9ff37 | ||
![]() |
6a11155dd7 | ||
![]() |
1acb76d2f0 | ||
![]() |
2e8a40efd5 | ||
![]() |
845a0e4e39 | ||
![]() |
9417f13cc9 | ||
![]() |
d3f52f3bc0 | ||
![]() |
7d0ec00fde | ||
![]() |
6dbb5dd4be | ||
![]() |
f30e7948cb | ||
![]() |
41472d8160 | ||
![]() |
e596d32426 | ||
![]() |
89de62812f | ||
![]() |
3e391fcbe6 | ||
![]() |
708ab2ed69 | ||
![]() |
1d45cb78fe | ||
![]() |
d3f6ebd1d0 | ||
![]() |
21644c70b3 | ||
![]() |
eb75389cac | ||
![]() |
cd4f3a091b | ||
![]() |
19c1973ec1 | ||
![]() |
a8efbe5b06 | ||
![]() |
44b5c66c19 | ||
![]() |
3fa3bba4d8 | ||
![]() |
ab09c821a2 | ||
![]() |
18b5215ce6 | ||
![]() |
00a311bd63 | ||
![]() |
749c2ab8ac | ||
![]() |
d06fdeb265 | ||
![]() |
06d76be2c2 | ||
![]() |
6728e8d107 | ||
![]() |
533e2bed8a | ||
![]() |
310a08f3e6 | ||
![]() |
0566889a1e | ||
![]() |
37b7395986 | ||
![]() |
4933413140 | ||
![]() |
1c16bd5ab2 | ||
![]() |
3a926c6f83 | ||
![]() |
7a619ad55a | ||
![]() |
bc21425981 | ||
![]() |
f2505c0798 | ||
![]() |
cee8c756fc | ||
![]() |
396b3aace9 | ||
![]() |
28dc1e4da9 | ||
![]() |
aa0419e783 | ||
![]() |
fd9c24d05e | ||
![]() |
8bdbe8c6a6 | ||
![]() |
39550cefa0 | ||
![]() |
589e3b63c7 | ||
![]() |
0cc38278b9 | ||
![]() |
aafdf7bed7 | ||
![]() |
a7f6ce3079 | ||
![]() |
3d03f74d66 | ||
![]() |
e09a6a23fc | ||
![]() |
9e4bb6ed0c | ||
![]() |
c45c8ab5c0 | ||
![]() |
5ef6973933 | ||
![]() |
1df344580a | ||
![]() |
25acc479b9 | ||
![]() |
c9f051374b | ||
![]() |
bf5116fc0b | ||
![]() |
edc8cb1d2e | ||
![]() |
a60bb3ae0a | ||
![]() |
784f753f07 | ||
![]() |
e63c7e3763 | ||
![]() |
cfa522068c | ||
![]() |
5f2375fe84 | ||
![]() |
a9e34d7590 | ||
![]() |
463cfb869f | ||
![]() |
acb5a2b283 | ||
![]() |
08597d6e91 | ||
![]() |
9478485268 | ||
![]() |
0af9ec2fff | ||
![]() |
f6e74de05e | ||
![]() |
8b0373d5c0 | ||
![]() |
ddca7584ef | ||
![]() |
e6cfe74cac | ||
![]() |
d4218250af | ||
![]() |
78783942be | ||
![]() |
17ad8013ca | ||
![]() |
f70767f084 | ||
![]() |
3972394d82 | ||
![]() |
5331fb4f5f | ||
![]() |
16df352ba8 | ||
![]() |
3b553a3a4b | ||
![]() |
8e1e75dee1 | ||
![]() |
d27b4e04a9 | ||
![]() |
36f7b34ac5 | ||
![]() |
c0ff24bf1b | ||
![]() |
abb5aa348f | ||
![]() |
37ab5cbdc3 | ||
![]() |
42be3b331c | ||
![]() |
71e05f79c2 | ||
![]() |
c5a0a5bbbf | ||
![]() |
c3d809fcf3 | ||
![]() |
cbd0c39091 | ||
![]() |
113eb5be24 | ||
![]() |
c497669fd3 | ||
![]() |
c32ca5885b | ||
![]() |
3c792c4019 | ||
![]() |
9762e61ee2 | ||
![]() |
c09c39998b | ||
![]() |
d37e29c247 | ||
![]() |
51f22cd74a | ||
![]() |
b57dc968bd | ||
![]() |
e2e8cb785a | ||
![]() |
3d674cf237 | ||
![]() |
9961a4ae3f | ||
![]() |
c25755bfcd | ||
![]() |
40983619d6 | ||
![]() |
54758b5962 | ||
![]() |
4f09485b20 | ||
![]() |
9207f6c407 | ||
![]() |
1a2312460a | ||
![]() |
951b88ab4c | ||
![]() |
d3cc57d8b4 | ||
![]() |
4e9b118728 | ||
![]() |
4e6e924a40 | ||
![]() |
f1748e4dd5 | ||
![]() |
d491d8f5ac | ||
![]() |
cf0fde0f3c | ||
![]() |
a7dc2cfaa6 | ||
![]() |
d8c7db6ebf | ||
![]() |
c3743b57ea | ||
![]() |
e16a101de8 | ||
![]() |
94ad47c60e | ||
![]() |
184ef7b7ff | ||
![]() |
81053f2e07 | ||
![]() |
e8b4eeec67 | ||
![]() |
b0b7e77e28 |
@@ -2,12 +2,12 @@
|
|||||||
"name": "Home Assistant Frontend",
|
"name": "Home Assistant Frontend",
|
||||||
"build": {
|
"build": {
|
||||||
"dockerfile": "Dockerfile",
|
"dockerfile": "Dockerfile",
|
||||||
"context": ".."
|
"context": "..",
|
||||||
},
|
},
|
||||||
"appPort": "8124:8123",
|
"appPort": "8124:8123",
|
||||||
"postStartCommand": "script/bootstrap",
|
"postStartCommand": "script/bootstrap",
|
||||||
"containerEnv": {
|
"containerEnv": {
|
||||||
"WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}"
|
"WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}",
|
||||||
},
|
},
|
||||||
"customizations": {
|
"customizations": {
|
||||||
"vscode": {
|
"vscode": {
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
"esbenp.prettier-vscode",
|
"esbenp.prettier-vscode",
|
||||||
"runem.lit-plugin",
|
"runem.lit-plugin",
|
||||||
"github.vscode-pull-request-github",
|
"github.vscode-pull-request-github",
|
||||||
"eamodio.gitlens"
|
"eamodio.gitlens",
|
||||||
],
|
],
|
||||||
"settings": {
|
"settings": {
|
||||||
"files.eol": "\n",
|
"files.eol": "\n",
|
||||||
@@ -27,17 +27,17 @@
|
|||||||
"editor.renderWhitespace": "boundary",
|
"editor.renderWhitespace": "boundary",
|
||||||
"editor.rulers": [80],
|
"editor.rulers": [80],
|
||||||
"[typescript]": {
|
"[typescript]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
},
|
},
|
||||||
"[javascript]": {
|
"[javascript]": {
|
||||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||||
},
|
},
|
||||||
"files.trimTrailingWhitespace": true,
|
"files.trimTrailingWhitespace": true,
|
||||||
"terminal.integrated.shell.linux": "/usr/bin/zsh",
|
"terminal.integrated.shell.linux": "/usr/bin/zsh",
|
||||||
"gitlens.showWelcomeOnInstall": false,
|
"gitlens.showWelcomeOnInstall": false,
|
||||||
"gitlens.showWhatsNewAfterUpgrades": false,
|
"gitlens.showWhatsNewAfterUpgrades": false,
|
||||||
"workbench.startupEditor": "none"
|
"workbench.startupEditor": "none",
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
}
|
||||||
|
3
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
3
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -9,7 +9,7 @@ body:
|
|||||||
|
|
||||||
If you have a feature or enhancement request for the frontend, please [start an discussion][fr] instead of creating an issue.
|
If you have a feature or enhancement request for the frontend, please [start an discussion][fr] instead of creating an issue.
|
||||||
|
|
||||||
**Please not not report issues for custom cards.**
|
**Please do not report issues for custom cards.**
|
||||||
|
|
||||||
[fr]: https://github.com/home-assistant/frontend/discussions
|
[fr]: https://github.com/home-assistant/frontend/discussions
|
||||||
[releases]: https://github.com/home-assistant/home-assistant/releases
|
[releases]: https://github.com/home-assistant/home-assistant/releases
|
||||||
@@ -24,6 +24,7 @@ body:
|
|||||||
required: true
|
required: true
|
||||||
- label: I have tried a different browser to see if it is related to my browser.
|
- label: I have tried a different browser to see if it is related to my browser.
|
||||||
required: true
|
required: true
|
||||||
|
- label: I have tried reproducing the issue in [safe mode](https://www.home-assistant.io/blog/2023/11/01/release-202311/#restarting-into-safe-mode) to rule out problems with unsupported custom resources.
|
||||||
- type: markdown
|
- type: markdown
|
||||||
attributes:
|
attributes:
|
||||||
value: |
|
value: |
|
||||||
|
56
.github/labeler.yml
vendored
56
.github/labeler.yml
vendored
@@ -1,31 +1,51 @@
|
|||||||
Build:
|
Build:
|
||||||
- build-scripts/**
|
- changed-files:
|
||||||
- .browserslistrc
|
- any-glob-to-any-file:
|
||||||
- gulpfile.js
|
- build-scripts/**
|
||||||
|
- .browserslistrc
|
||||||
|
- gulpfile.js
|
||||||
|
|
||||||
Cast:
|
Cast:
|
||||||
- cast/src/**
|
- changed-files:
|
||||||
- src/cast/**
|
- any-glob-to-any-file:
|
||||||
|
- cast/src/**
|
||||||
|
- src/cast/**
|
||||||
|
|
||||||
Demo:
|
Demo:
|
||||||
- demo/src/**
|
- changed-files:
|
||||||
- src/fake_data/**
|
- any-glob-to-any-file:
|
||||||
|
- demo/src/**
|
||||||
|
- src/fake_data/**
|
||||||
|
|
||||||
Design:
|
Design:
|
||||||
- gallery/src/**
|
- changed-files:
|
||||||
- src/fake_data/**
|
- any-glob-to-any-file:
|
||||||
|
- gallery/src/**
|
||||||
|
- src/fake_data/**
|
||||||
|
|
||||||
Dependencies:
|
Dependencies:
|
||||||
- package.json
|
- any:
|
||||||
- renovate.json
|
- changed-files:
|
||||||
- yarn.lock
|
# Match when only these files are changed (i.e. don't match PRs that happen to add or remove packages)
|
||||||
- .yarn/**
|
- any-glob-to-all-files:
|
||||||
- .yarnrc.yml
|
- package.json
|
||||||
- .nvmrc
|
- renovate.json
|
||||||
|
- yarn.lock
|
||||||
|
- .yarn/**
|
||||||
|
- .yarnrc.yml
|
||||||
|
- .nvmrc
|
||||||
|
# Dependabot and Renovate branches always match (i.e. compatibility tweaks by members considered minor)
|
||||||
|
- head-branch:
|
||||||
|
- "^renovate/"
|
||||||
|
- "^dependabot/"
|
||||||
|
|
||||||
GitHub Actions:
|
GitHub Actions:
|
||||||
- .github/workflows/**
|
- changed-files:
|
||||||
- .github/*.yml
|
- any-glob-to-any-file:
|
||||||
|
- .github/workflows/**
|
||||||
|
- .github/*.yml
|
||||||
|
|
||||||
Supervisor:
|
Supervisor:
|
||||||
- hassio/src/**
|
- changed-files:
|
||||||
|
- any-glob-to-any-file:
|
||||||
|
- hassio/src/**
|
||||||
|
4
.github/workflows/cast_deployment.yaml
vendored
4
.github/workflows/cast_deployment.yaml
vendored
@@ -26,7 +26,7 @@ jobs:
|
|||||||
ref: dev
|
ref: dev
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3.8.1
|
uses: actions/setup-node@v4.0.1
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -62,7 +62,7 @@ jobs:
|
|||||||
ref: master
|
ref: master
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3.8.1
|
uses: actions/setup-node@v4.0.1
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
|
19
.github/workflows/ci.yaml
vendored
19
.github/workflows/ci.yaml
vendored
@@ -26,7 +26,7 @@ jobs:
|
|||||||
- name: Check out files from GitHub
|
- name: Check out files from GitHub
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v4.1.1
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3.8.1
|
uses: actions/setup-node@v4.0.1
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -37,17 +37,20 @@ jobs:
|
|||||||
- name: Build resources
|
- name: Build resources
|
||||||
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data gather-gallery-pages
|
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data gather-gallery-pages
|
||||||
- name: Setup lint cache
|
- name: Setup lint cache
|
||||||
uses: actions/cache@v3.3.2
|
uses: actions/cache@v4.0.0
|
||||||
with:
|
with:
|
||||||
path: |
|
path: |
|
||||||
node_modules/.cache/prettier
|
node_modules/.cache/prettier
|
||||||
node_modules/.cache/eslint
|
node_modules/.cache/eslint
|
||||||
|
node_modules/.cache/typescript
|
||||||
key: lint-${{ github.sha }}
|
key: lint-${{ github.sha }}
|
||||||
restore-keys: lint-
|
restore-keys: lint-
|
||||||
- name: Run eslint
|
- name: Run eslint
|
||||||
run: yarn run lint:eslint --quiet
|
run: yarn run lint:eslint --quiet
|
||||||
- name: Run tsc
|
- name: Run tsc
|
||||||
run: yarn run lint:types
|
run: yarn run lint:types
|
||||||
|
- name: Run lit-analyzer
|
||||||
|
run: yarn run lint:lit --quiet
|
||||||
- name: Run prettier
|
- name: Run prettier
|
||||||
run: yarn run lint:prettier
|
run: yarn run lint:prettier
|
||||||
test:
|
test:
|
||||||
@@ -57,14 +60,14 @@ jobs:
|
|||||||
- name: Check out files from GitHub
|
- name: Check out files from GitHub
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v4.1.1
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3.8.1
|
uses: actions/setup-node@v4.0.1
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: yarn install --immutable
|
run: yarn install --immutable
|
||||||
- name: Build resources
|
- name: Build resources
|
||||||
run: ./node_modules/.bin/gulp build-translations build-locale-data
|
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data
|
||||||
- name: Run Tests
|
- name: Run Tests
|
||||||
run: yarn run test
|
run: yarn run test
|
||||||
build:
|
build:
|
||||||
@@ -75,7 +78,7 @@ jobs:
|
|||||||
- name: Check out files from GitHub
|
- name: Check out files from GitHub
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v4.1.1
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3.8.1
|
uses: actions/setup-node@v4.0.1
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -86,7 +89,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
IS_TEST: "true"
|
IS_TEST: "true"
|
||||||
- name: Upload bundle stats
|
- name: Upload bundle stats
|
||||||
uses: actions/upload-artifact@v3.1.3
|
uses: actions/upload-artifact@v4.3.0
|
||||||
with:
|
with:
|
||||||
name: frontend-bundle-stats
|
name: frontend-bundle-stats
|
||||||
path: build/stats/*.json
|
path: build/stats/*.json
|
||||||
@@ -99,7 +102,7 @@ jobs:
|
|||||||
- name: Check out files from GitHub
|
- name: Check out files from GitHub
|
||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v4.1.1
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3.8.1
|
uses: actions/setup-node@v4.0.1
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -110,7 +113,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
IS_TEST: "true"
|
IS_TEST: "true"
|
||||||
- name: Upload bundle stats
|
- name: Upload bundle stats
|
||||||
uses: actions/upload-artifact@v3.1.3
|
uses: actions/upload-artifact@v4.3.0
|
||||||
with:
|
with:
|
||||||
name: supervisor-bundle-stats
|
name: supervisor-bundle-stats
|
||||||
path: build/stats/*.json
|
path: build/stats/*.json
|
||||||
|
6
.github/workflows/codeql-analysis.yml
vendored
6
.github/workflows/codeql-analysis.yml
vendored
@@ -36,14 +36,14 @@ jobs:
|
|||||||
|
|
||||||
# Initializes the CodeQL tools for scanning.
|
# Initializes the CodeQL tools for scanning.
|
||||||
- name: Initialize CodeQL
|
- name: Initialize CodeQL
|
||||||
uses: github/codeql-action/init@v2
|
uses: github/codeql-action/init@v3
|
||||||
with:
|
with:
|
||||||
languages: ${{ matrix.language }}
|
languages: ${{ matrix.language }}
|
||||||
|
|
||||||
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
# Autobuild attempts to build any compiled languages (C/C++, C#, or Java).
|
||||||
# If this step fails, then you should remove it and run the build manually (see below)
|
# If this step fails, then you should remove it and run the build manually (see below)
|
||||||
- name: Autobuild
|
- name: Autobuild
|
||||||
uses: github/codeql-action/autobuild@v2
|
uses: github/codeql-action/autobuild@v3
|
||||||
|
|
||||||
# ℹ️ Command-line programs to run using the OS shell.
|
# ℹ️ Command-line programs to run using the OS shell.
|
||||||
# 📚 https://git.io/JvXDl
|
# 📚 https://git.io/JvXDl
|
||||||
@@ -57,4 +57,4 @@ jobs:
|
|||||||
# make release
|
# make release
|
||||||
|
|
||||||
- name: Perform CodeQL Analysis
|
- name: Perform CodeQL Analysis
|
||||||
uses: github/codeql-action/analyze@v2
|
uses: github/codeql-action/analyze@v3
|
||||||
|
4
.github/workflows/demo_deployment.yaml
vendored
4
.github/workflows/demo_deployment.yaml
vendored
@@ -27,7 +27,7 @@ jobs:
|
|||||||
ref: dev
|
ref: dev
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3.8.1
|
uses: actions/setup-node@v4.0.1
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -63,7 +63,7 @@ jobs:
|
|||||||
ref: master
|
ref: master
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3.8.1
|
uses: actions/setup-node@v4.0.1
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
|
2
.github/workflows/design_deployment.yaml
vendored
2
.github/workflows/design_deployment.yaml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v4.1.1
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3.8.1
|
uses: actions/setup-node@v4.0.1
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
|
2
.github/workflows/design_preview.yaml
vendored
2
.github/workflows/design_preview.yaml
vendored
@@ -24,7 +24,7 @@ jobs:
|
|||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v4.1.1
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3.8.1
|
uses: actions/setup-node@v4.0.1
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
|
2
.github/workflows/labeler.yaml
vendored
2
.github/workflows/labeler.yaml
vendored
@@ -10,6 +10,6 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Apply labels
|
- name: Apply labels
|
||||||
uses: actions/labeler@v4.3.0
|
uses: actions/labeler@v5.0.0
|
||||||
with:
|
with:
|
||||||
sync-labels: true
|
sync-labels: true
|
||||||
|
3
.github/workflows/lock.yml
vendored
3
.github/workflows/lock.yml
vendored
@@ -9,9 +9,10 @@ jobs:
|
|||||||
lock:
|
lock:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: dessant/lock-threads@v4.0.1
|
- uses: dessant/lock-threads@v5.0.1
|
||||||
with:
|
with:
|
||||||
github-token: ${{ github.token }}
|
github-token: ${{ github.token }}
|
||||||
|
process-only: "issues, prs"
|
||||||
issue-lock-inactive-days: "30"
|
issue-lock-inactive-days: "30"
|
||||||
issue-exclude-created-before: "2020-10-01T00:00:00Z"
|
issue-exclude-created-before: "2020-10-01T00:00:00Z"
|
||||||
issue-lock-reason: ""
|
issue-lock-reason: ""
|
||||||
|
10
.github/workflows/nightly.yaml
vendored
10
.github/workflows/nightly.yaml
vendored
@@ -23,12 +23,12 @@ jobs:
|
|||||||
uses: actions/checkout@v4.1.1
|
uses: actions/checkout@v4.1.1
|
||||||
|
|
||||||
- name: Set up Python ${{ env.PYTHON_VERSION }}
|
- name: Set up Python ${{ env.PYTHON_VERSION }}
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3.8.1
|
uses: actions/setup-node@v4.0.1
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -42,7 +42,7 @@ jobs:
|
|||||||
LOKALISE_TOKEN: ${{ secrets.LOKALISE_TOKEN }}
|
LOKALISE_TOKEN: ${{ secrets.LOKALISE_TOKEN }}
|
||||||
|
|
||||||
- name: Bump version
|
- name: Bump version
|
||||||
run: script/version_bump.cjs nightly
|
run: script/version_bump.js nightly
|
||||||
|
|
||||||
- name: Build nightly Python wheels
|
- name: Build nightly Python wheels
|
||||||
run: |
|
run: |
|
||||||
@@ -57,14 +57,14 @@ jobs:
|
|||||||
run: tar -czvf translations.tar.gz translations
|
run: tar -czvf translations.tar.gz translations
|
||||||
|
|
||||||
- name: Upload build artifacts
|
- name: Upload build artifacts
|
||||||
uses: actions/upload-artifact@v3.1.3
|
uses: actions/upload-artifact@v4.3.0
|
||||||
with:
|
with:
|
||||||
name: wheels
|
name: wheels
|
||||||
path: dist/home_assistant_frontend*.whl
|
path: dist/home_assistant_frontend*.whl
|
||||||
if-no-files-found: error
|
if-no-files-found: error
|
||||||
|
|
||||||
- name: Upload translations
|
- name: Upload translations
|
||||||
uses: actions/upload-artifact@v3.1.3
|
uses: actions/upload-artifact@v4.3.0
|
||||||
with:
|
with:
|
||||||
name: translations
|
name: translations
|
||||||
path: translations.tar.gz
|
path: translations.tar.gz
|
||||||
|
6
.github/workflows/release.yaml
vendored
6
.github/workflows/release.yaml
vendored
@@ -29,12 +29,12 @@ jobs:
|
|||||||
uses: home-assistant/actions/helpers/verify-version@master
|
uses: home-assistant/actions/helpers/verify-version@master
|
||||||
|
|
||||||
- name: Set up Python ${{ env.PYTHON_VERSION }}
|
- name: Set up Python ${{ env.PYTHON_VERSION }}
|
||||||
uses: actions/setup-python@v4
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v3.8.1
|
uses: actions/setup-node@v4.0.1
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -74,7 +74,7 @@ jobs:
|
|||||||
echo "home-assistant-frontend==$version" > ./requirements.txt
|
echo "home-assistant-frontend==$version" > ./requirements.txt
|
||||||
|
|
||||||
- name: Build wheels
|
- name: Build wheels
|
||||||
uses: home-assistant/wheels@2023.10.5
|
uses: home-assistant/wheels@2024.01.0
|
||||||
with:
|
with:
|
||||||
abi: cp311
|
abi: cp311
|
||||||
tag: musllinux_1_2
|
tag: musllinux_1_2
|
||||||
|
2
.github/workflows/stale.yml
vendored
2
.github/workflows/stale.yml
vendored
@@ -10,7 +10,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: 90 days stale policy
|
- name: 90 days stale policy
|
||||||
uses: actions/stale@v8.0.0
|
uses: actions/stale@v9.0.0
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
days-before-stale: 90
|
days-before-stale: 90
|
||||||
|
541
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
541
.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
vendored
File diff suppressed because one or more lines are too long
9
.yarn/plugins/@yarnpkg/plugin-typescript.cjs
vendored
9
.yarn/plugins/@yarnpkg/plugin-typescript.cjs
vendored
File diff suppressed because one or more lines are too long
874
.yarn/releases/yarn-3.6.4.cjs
vendored
874
.yarn/releases/yarn-3.6.4.cjs
vendored
File diff suppressed because one or more lines are too long
893
.yarn/releases/yarn-4.0.2.cjs
vendored
Executable file
893
.yarn/releases/yarn-4.0.2.cjs
vendored
Executable file
File diff suppressed because one or more lines are too long
12
.yarnrc.yml
12
.yarnrc.yml
@@ -1,11 +1,9 @@
|
|||||||
|
compressionLevel: mixed
|
||||||
|
|
||||||
defaultSemverRangePrefix: ""
|
defaultSemverRangePrefix: ""
|
||||||
|
|
||||||
|
enableGlobalCache: false
|
||||||
|
|
||||||
nodeLinker: node-modules
|
nodeLinker: node-modules
|
||||||
|
|
||||||
plugins:
|
yarnPath: .yarn/releases/yarn-4.0.2.cjs
|
||||||
- path: .yarn/plugins/@yarnpkg/plugin-typescript.cjs
|
|
||||||
spec: "@yarnpkg/plugin-typescript"
|
|
||||||
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
|
|
||||||
spec: "@yarnpkg/plugin-interactive-tools"
|
|
||||||
|
|
||||||
yarnPath: .yarn/releases/yarn-3.6.4.cjs
|
|
||||||
|
56
build-scripts/babel-plugins/custom-polyfill-plugin.js
Normal file
56
build-scripts/babel-plugins/custom-polyfill-plugin.js
Normal file
@@ -0,0 +1,56 @@
|
|||||||
|
import defineProvider from "@babel/helper-define-polyfill-provider";
|
||||||
|
|
||||||
|
// List of polyfill keys with supported browser targets for the functionality
|
||||||
|
const PolyfillSupport = {
|
||||||
|
fetch: {
|
||||||
|
android: 42,
|
||||||
|
chrome: 42,
|
||||||
|
edge: 14,
|
||||||
|
firefox: 39,
|
||||||
|
ios: 10.3,
|
||||||
|
opera: 29,
|
||||||
|
opera_mobile: 29,
|
||||||
|
safari: 10.1,
|
||||||
|
samsung: 4.0,
|
||||||
|
},
|
||||||
|
proxy: {
|
||||||
|
android: 49,
|
||||||
|
chrome: 49,
|
||||||
|
edge: 12,
|
||||||
|
firefox: 18,
|
||||||
|
ios: 10.0,
|
||||||
|
opera: 36,
|
||||||
|
opera_mobile: 36,
|
||||||
|
safari: 10.0,
|
||||||
|
samsung: 5.0,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Map of global variables and/or instance and static properties to the
|
||||||
|
// corresponding polyfill key and actual module to import
|
||||||
|
const polyfillMap = {
|
||||||
|
global: {
|
||||||
|
Proxy: { key: "proxy", module: "proxy-polyfill" },
|
||||||
|
fetch: { key: "fetch", module: "unfetch/polyfill" },
|
||||||
|
},
|
||||||
|
instance: {},
|
||||||
|
static: {},
|
||||||
|
};
|
||||||
|
|
||||||
|
// Create plugin using the same factory as for CoreJS
|
||||||
|
export default defineProvider(
|
||||||
|
({ createMetaResolver, debug, shouldInjectPolyfill }) => {
|
||||||
|
const resolvePolyfill = createMetaResolver(polyfillMap);
|
||||||
|
return {
|
||||||
|
name: "HA Custom",
|
||||||
|
polyfills: PolyfillSupport,
|
||||||
|
usageGlobal(meta, utils) {
|
||||||
|
const polyfill = resolvePolyfill(meta);
|
||||||
|
if (polyfill && shouldInjectPolyfill(polyfill.desc.key)) {
|
||||||
|
debug(polyfill.desc.key);
|
||||||
|
utils.injectGlobalImport(polyfill.desc.module);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}
|
||||||
|
);
|
@@ -1,6 +1,7 @@
|
|||||||
const path = require("path");
|
const path = require("path");
|
||||||
const env = require("./env.cjs");
|
const env = require("./env.cjs");
|
||||||
const paths = require("./paths.cjs");
|
const paths = require("./paths.cjs");
|
||||||
|
const { dependencies } = require("../package.json");
|
||||||
|
|
||||||
// GitHub base URL to use for production source maps
|
// GitHub base URL to use for production source maps
|
||||||
// Nightly builds use the commit SHA, otherwise assumes there is a tag that matches the version
|
// Nightly builds use the commit SHA, otherwise assumes there is a tag that matches the version
|
||||||
@@ -12,11 +13,7 @@ module.exports.sourceMapURL = () => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Files from NPM Packages that should not be imported
|
// Files from NPM Packages that should not be imported
|
||||||
// eslint-disable-next-line unused-imports/no-unused-vars
|
module.exports.ignorePackages = () => [];
|
||||||
module.exports.ignorePackages = ({ latestBuild }) => [
|
|
||||||
// Part of yaml.js and only used for !!js functions that we don't use
|
|
||||||
require.resolve("esprima"),
|
|
||||||
];
|
|
||||||
|
|
||||||
// Files from NPM packages that we should replace with empty file
|
// Files from NPM packages that we should replace with empty file
|
||||||
module.exports.emptyPackages = ({ latestBuild, isHassioBuild }) =>
|
module.exports.emptyPackages = ({ latestBuild, isHassioBuild }) =>
|
||||||
@@ -35,8 +32,6 @@ module.exports.emptyPackages = ({ latestBuild, isHassioBuild }) =>
|
|||||||
require.resolve(
|
require.resolve(
|
||||||
path.resolve(paths.polymer_dir, "src/resources/compatibility.ts")
|
path.resolve(paths.polymer_dir, "src/resources/compatibility.ts")
|
||||||
),
|
),
|
||||||
// This polyfill is loaded in workers to support ES5, filter it out.
|
|
||||||
latestBuild && require.resolve("proxy-polyfill/src/index.js"),
|
|
||||||
// Icons in supervisor conflict with icons in HA so we don't load.
|
// Icons in supervisor conflict with icons in HA so we don't load.
|
||||||
isHassioBuild &&
|
isHassioBuild &&
|
||||||
require.resolve(
|
require.resolve(
|
||||||
@@ -91,14 +86,12 @@ module.exports.babelOptions = ({ latestBuild, isProdBuild, isTestBuild }) => ({
|
|||||||
setSpreadProperties: true,
|
setSpreadProperties: true,
|
||||||
},
|
},
|
||||||
browserslistEnv: latestBuild ? "modern" : "legacy",
|
browserslistEnv: latestBuild ? "modern" : "legacy",
|
||||||
// Must be unambiguous because some dependencies are CommonJS only
|
|
||||||
sourceType: "unambiguous",
|
|
||||||
presets: [
|
presets: [
|
||||||
[
|
[
|
||||||
"@babel/preset-env",
|
"@babel/preset-env",
|
||||||
{
|
{
|
||||||
useBuiltIns: latestBuild ? false : "entry",
|
useBuiltIns: latestBuild ? false : "usage",
|
||||||
corejs: latestBuild ? false : { version: "3.33", proposals: true },
|
corejs: latestBuild ? false : dependencies["core-js"],
|
||||||
bugfixes: true,
|
bugfixes: true,
|
||||||
shippedProposals: true,
|
shippedProposals: true,
|
||||||
},
|
},
|
||||||
@@ -116,27 +109,39 @@ module.exports.babelOptions = ({ latestBuild, isProdBuild, isTestBuild }) => ({
|
|||||||
ignoreModuleNotFound: true,
|
ignoreModuleNotFound: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
[
|
||||||
|
path.resolve(
|
||||||
|
paths.polymer_dir,
|
||||||
|
"build-scripts/babel-plugins/custom-polyfill-plugin.js"
|
||||||
|
),
|
||||||
|
{ method: "usage-global" },
|
||||||
|
],
|
||||||
// Minify template literals for production
|
// Minify template literals for production
|
||||||
isProdBuild && [
|
isProdBuild && [
|
||||||
"template-html-minifier",
|
"template-html-minifier",
|
||||||
{
|
{
|
||||||
modules: {
|
modules: {
|
||||||
lit: [
|
...Object.fromEntries(
|
||||||
"html",
|
["lit", "lit-element", "lit-html"].map((m) => [
|
||||||
{ name: "svg", encapsulation: "svg" },
|
m,
|
||||||
{ name: "css", encapsulation: "style" },
|
[
|
||||||
],
|
"html",
|
||||||
"@polymer/polymer/lib/utils/html-tag": ["html"],
|
{ name: "svg", encapsulation: "svg" },
|
||||||
|
{ name: "css", encapsulation: "style" },
|
||||||
|
],
|
||||||
|
])
|
||||||
|
),
|
||||||
|
"@polymer/polymer/lib/utils/html-tag.js": ["html"],
|
||||||
},
|
},
|
||||||
strictCSS: true,
|
strictCSS: true,
|
||||||
htmlMinifier: module.exports.htmlMinifierOptions,
|
htmlMinifier: module.exports.htmlMinifierOptions,
|
||||||
failOnError: true, // we can turn this off in case of false positives
|
failOnError: false, // we can turn this off in case of false positives
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
// Import helpers and regenerator from runtime package
|
// Import helpers and regenerator from runtime package
|
||||||
[
|
[
|
||||||
"@babel/plugin-transform-runtime",
|
"@babel/plugin-transform-runtime",
|
||||||
{ version: require("../package.json").dependencies["@babel/runtime"] },
|
{ version: dependencies["@babel/runtime"] },
|
||||||
],
|
],
|
||||||
// Support some proposals still in TC39 process
|
// Support some proposals still in TC39 process
|
||||||
["@babel/plugin-proposal-decorators", { decoratorsBeforeExport: true }],
|
["@babel/plugin-proposal-decorators", { decoratorsBeforeExport: true }],
|
||||||
@@ -147,6 +152,18 @@ module.exports.babelOptions = ({ latestBuild, isProdBuild, isTestBuild }) => ({
|
|||||||
/node_modules[\\/]webpack[\\/]buildin/,
|
/node_modules[\\/]webpack[\\/]buildin/,
|
||||||
],
|
],
|
||||||
sourceMaps: !isTestBuild,
|
sourceMaps: !isTestBuild,
|
||||||
|
overrides: [
|
||||||
|
{
|
||||||
|
// Use unambiguous for dependencies so that require() is correctly injected into CommonJS files
|
||||||
|
// Exclusions are needed in some cases where ES modules have no static imports or exports, such as polyfills
|
||||||
|
sourceType: "unambiguous",
|
||||||
|
include: /\/node_modules\//,
|
||||||
|
exclude: [
|
||||||
|
"element-internals-polyfill",
|
||||||
|
"@?lit(?:-labs|-element|-html)?",
|
||||||
|
].map((p) => new RegExp(`/node_modules/${p}/`)),
|
||||||
|
},
|
||||||
|
],
|
||||||
});
|
});
|
||||||
|
|
||||||
const nameSuffix = (latestBuild) => (latestBuild ? "-modern" : "-legacy");
|
const nameSuffix = (latestBuild) => (latestBuild ? "-modern" : "-legacy");
|
||||||
|
@@ -30,8 +30,8 @@ gulp.task(
|
|||||||
env.useWDS()
|
env.useWDS()
|
||||||
? "wds-watch-app"
|
? "wds-watch-app"
|
||||||
: env.useRollup()
|
: env.useRollup()
|
||||||
? "rollup-watch-app"
|
? "rollup-watch-app"
|
||||||
: "webpack-watch-app"
|
: "webpack-watch-app"
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -45,8 +45,8 @@ gulp.task(
|
|||||||
gulp.parallel("gen-icons-json", "build-translations", "build-locale-data"),
|
gulp.parallel("gen-icons-json", "build-translations", "build-locale-data"),
|
||||||
"copy-static-app",
|
"copy-static-app",
|
||||||
env.useRollup() ? "rollup-prod-app" : "webpack-prod-app",
|
env.useRollup() ? "rollup-prod-app" : "webpack-prod-app",
|
||||||
|
gulp.parallel("gen-pages-app-prod", "gen-service-worker-app-prod"),
|
||||||
// Don't compress running tests
|
// Don't compress running tests
|
||||||
...(env.isTestBuild() ? [] : ["compress-app"]),
|
...(env.isTestBuild() ? [] : ["compress-app"])
|
||||||
gulp.parallel("gen-pages-app-prod", "gen-service-worker-app-prod")
|
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@@ -8,7 +8,10 @@ const zopfliOptions = { threshold: 150 };
|
|||||||
|
|
||||||
const compressDist = (rootDir) =>
|
const compressDist = (rootDir) =>
|
||||||
gulp
|
gulp
|
||||||
.src([`${rootDir}/**/*.{js,json,css,svg}`])
|
.src([
|
||||||
|
`${rootDir}/**/*.{js,json,css,svg,xml}`,
|
||||||
|
`${rootDir}/{authorize,onboarding}.html`,
|
||||||
|
])
|
||||||
.pipe(zopfli(zopfliOptions))
|
.pipe(zopfli(zopfliOptions))
|
||||||
.pipe(gulp.dest(rootDir));
|
.pipe(gulp.dest(rootDir));
|
||||||
|
|
||||||
|
@@ -161,6 +161,10 @@ gulp.task("fetch-lokalise", async function () {
|
|||||||
})
|
})
|
||||||
);
|
);
|
||||||
})
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
console.error(err);
|
||||||
|
throw err;
|
||||||
|
})
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
|
@@ -426,6 +426,7 @@ gulp.task(
|
|||||||
"fetch-nightly-translations",
|
"fetch-nightly-translations",
|
||||||
gulp.series("clean-translations", "ensure-translations-build-dir")
|
gulp.series("clean-translations", "ensure-translations-build-dir")
|
||||||
),
|
),
|
||||||
|
gulp.parallel("create-test-metadata", "create-test-translation"),
|
||||||
"build-master-translation",
|
"build-master-translation",
|
||||||
"build-merged-translations",
|
"build-merged-translations",
|
||||||
"build-translation-fragment-supervisor",
|
"build-translation-fragment-supervisor",
|
||||||
|
@@ -7,6 +7,9 @@ const TerserPlugin = require("terser-webpack-plugin");
|
|||||||
const { WebpackManifestPlugin } = require("webpack-manifest-plugin");
|
const { WebpackManifestPlugin } = require("webpack-manifest-plugin");
|
||||||
const log = require("fancy-log");
|
const log = require("fancy-log");
|
||||||
const WebpackBar = require("webpackbar");
|
const WebpackBar = require("webpackbar");
|
||||||
|
const {
|
||||||
|
TransformAsyncModulesPlugin,
|
||||||
|
} = require("transform-async-modules-webpack-plugin");
|
||||||
const paths = require("./paths.cjs");
|
const paths = require("./paths.cjs");
|
||||||
const bundle = require("./bundle.cjs");
|
const bundle = require("./bundle.cjs");
|
||||||
|
|
||||||
@@ -51,8 +54,8 @@ const createWebpackConfig = ({
|
|||||||
devtool: isTestBuild
|
devtool: isTestBuild
|
||||||
? false
|
? false
|
||||||
: isProdBuild
|
: isProdBuild
|
||||||
? "nosources-source-map"
|
? "nosources-source-map"
|
||||||
: "eval-cheap-module-source-map",
|
: "eval-cheap-module-source-map",
|
||||||
entry,
|
entry,
|
||||||
node: false,
|
node: false,
|
||||||
module: {
|
module: {
|
||||||
@@ -142,17 +145,6 @@ const createWebpackConfig = ({
|
|||||||
),
|
),
|
||||||
path.resolve(paths.polymer_dir, "src/util/empty.js")
|
path.resolve(paths.polymer_dir, "src/util/empty.js")
|
||||||
),
|
),
|
||||||
// See `src/resources/intl-polyfill-legacy.ts` for explanation
|
|
||||||
!latestBuild &&
|
|
||||||
new webpack.NormalModuleReplacementPlugin(
|
|
||||||
new RegExp(
|
|
||||||
path.resolve(paths.polymer_dir, "src/resources/intl-polyfill.ts")
|
|
||||||
),
|
|
||||||
path.resolve(
|
|
||||||
paths.polymer_dir,
|
|
||||||
"src/resources/intl-polyfill-legacy.ts"
|
|
||||||
)
|
|
||||||
),
|
|
||||||
!isProdBuild && new LogStartCompilePlugin(),
|
!isProdBuild && new LogStartCompilePlugin(),
|
||||||
isProdBuild &&
|
isProdBuild &&
|
||||||
new StatsWriterPlugin({
|
new StatsWriterPlugin({
|
||||||
@@ -163,6 +155,8 @@ const createWebpackConfig = ({
|
|||||||
stats: { assets: true, chunks: true, modules: true },
|
stats: { assets: true, chunks: true, modules: true },
|
||||||
transform: (stats) => JSON.stringify(filterStats(stats)),
|
transform: (stats) => JSON.stringify(filterStats(stats)),
|
||||||
}),
|
}),
|
||||||
|
!latestBuild &&
|
||||||
|
new TransformAsyncModulesPlugin({ browserslistEnv: "legacy" }),
|
||||||
].filter(Boolean),
|
].filter(Boolean),
|
||||||
resolve: {
|
resolve: {
|
||||||
extensions: [".ts", ".js", ".json"],
|
extensions: [".ts", ".js", ".json"],
|
||||||
@@ -191,11 +185,11 @@ const createWebpackConfig = ({
|
|||||||
filename: ({ chunk }) =>
|
filename: ({ chunk }) =>
|
||||||
!isProdBuild || isStatsBuild || dontHash.has(chunk.name)
|
!isProdBuild || isStatsBuild || dontHash.has(chunk.name)
|
||||||
? "[name].js"
|
? "[name].js"
|
||||||
: "[name]-[contenthash].js",
|
: "[name].[contenthash].js",
|
||||||
chunkFilename:
|
chunkFilename:
|
||||||
isProdBuild && !isStatsBuild ? "[id]-[contenthash].js" : "[name].js",
|
isProdBuild && !isStatsBuild ? "[name].[contenthash].js" : "[name].js",
|
||||||
assetModuleFilename:
|
assetModuleFilename:
|
||||||
isProdBuild && !isStatsBuild ? "[id]-[contenthash][ext]" : "[id][ext]",
|
isProdBuild && !isStatsBuild ? "[id].[contenthash][ext]" : "[id][ext]",
|
||||||
crossOriginLoading: "use-credentials",
|
crossOriginLoading: "use-credentials",
|
||||||
hashFunction: "xxhash64",
|
hashFunction: "xxhash64",
|
||||||
hashDigest: "base64url",
|
hashDigest: "base64url",
|
||||||
|
BIN
cast/public/images/nabu-loves-hass.png
Normal file
BIN
cast/public/images/nabu-loves-hass.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 9.8 KiB |
@@ -3,7 +3,7 @@ import { mdiCast, mdiCastConnected } from "@mdi/js";
|
|||||||
import "@polymer/paper-item/paper-icon-item";
|
import "@polymer/paper-item/paper-icon-item";
|
||||||
import "@polymer/paper-listbox/paper-listbox";
|
import "@polymer/paper-listbox/paper-listbox";
|
||||||
import { Auth, Connection } from "home-assistant-js-websocket";
|
import { Auth, Connection } from "home-assistant-js-websocket";
|
||||||
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
import { CSSResultGroup, LitElement, TemplateResult, css, html } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { CastManager } from "../../../../src/cast/cast_manager";
|
import { CastManager } from "../../../../src/cast/cast_manager";
|
||||||
import {
|
import {
|
||||||
@@ -22,26 +22,27 @@ import "../../../../src/components/ha-svg-icon";
|
|||||||
import {
|
import {
|
||||||
getLegacyLovelaceCollection,
|
getLegacyLovelaceCollection,
|
||||||
getLovelaceCollection,
|
getLovelaceCollection,
|
||||||
LovelaceConfig,
|
|
||||||
} from "../../../../src/data/lovelace";
|
} from "../../../../src/data/lovelace";
|
||||||
|
import { isStrategyDashboard } from "../../../../src/data/lovelace/config/types";
|
||||||
|
import { LovelaceViewConfig } from "../../../../src/data/lovelace/config/view";
|
||||||
import "../../../../src/layouts/hass-loading-screen";
|
import "../../../../src/layouts/hass-loading-screen";
|
||||||
import { generateDefaultViewConfig } from "../../../../src/panels/lovelace/common/generate-lovelace-config";
|
import { generateDefaultViewConfig } from "../../../../src/panels/lovelace/common/generate-lovelace-config";
|
||||||
import "./hc-layout";
|
import "./hc-layout";
|
||||||
|
|
||||||
@customElement("hc-cast")
|
@customElement("hc-cast")
|
||||||
class HcCast extends LitElement {
|
class HcCast extends LitElement {
|
||||||
@property() public auth!: Auth;
|
@property({ attribute: false }) public auth!: Auth;
|
||||||
|
|
||||||
@property() public connection!: Connection;
|
@property({ attribute: false }) public connection!: Connection;
|
||||||
|
|
||||||
@property() public castManager!: CastManager;
|
@property({ attribute: false }) public castManager!: CastManager;
|
||||||
|
|
||||||
@state() private askWrite = false;
|
@state() private askWrite = false;
|
||||||
|
|
||||||
@state() private lovelaceConfig?: LovelaceConfig | null;
|
@state() private lovelaceViews?: LovelaceViewConfig[] | null;
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (this.lovelaceConfig === undefined) {
|
if (this.lovelaceViews === undefined) {
|
||||||
return html`<hass-loading-screen no-toolbar></hass-loading-screen>`;
|
return html`<hass-loading-screen no-toolbar></hass-loading-screen>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -72,43 +73,44 @@ class HcCast extends LitElement {
|
|||||||
${error
|
${error
|
||||||
? html` <div class="card-content">${error}</div> `
|
? html` <div class="card-content">${error}</div> `
|
||||||
: !this.castManager.status
|
: !this.castManager.status
|
||||||
? html`
|
? html`
|
||||||
<p class="center-item">
|
<p class="center-item">
|
||||||
<mwc-button raised @click=${this._handleLaunch}>
|
<mwc-button raised @click=${this._handleLaunch}>
|
||||||
<ha-svg-icon .path=${mdiCast}></ha-svg-icon>
|
<ha-svg-icon .path=${mdiCast}></ha-svg-icon>
|
||||||
Start Casting
|
Start Casting
|
||||||
</mwc-button>
|
</mwc-button>
|
||||||
</p>
|
</p>
|
||||||
`
|
`
|
||||||
: html`
|
: html`
|
||||||
<div class="section-header">PICK A VIEW</div>
|
<div class="section-header">PICK A VIEW</div>
|
||||||
<paper-listbox
|
<paper-listbox
|
||||||
attr-for-selected="data-path"
|
attr-for-selected="data-path"
|
||||||
.selected=${this.castManager.status.lovelacePath || ""}
|
.selected=${this.castManager.status.lovelacePath || ""}
|
||||||
>
|
>
|
||||||
${(this.lovelaceConfig
|
${(
|
||||||
? this.lovelaceConfig.views
|
this.lovelaceViews ?? [
|
||||||
: [generateDefaultViewConfig({}, {}, {}, {}, () => "")]
|
generateDefaultViewConfig({}, {}, {}, {}, () => ""),
|
||||||
).map(
|
]
|
||||||
(view, idx) => html`
|
).map(
|
||||||
<paper-icon-item
|
(view, idx) => html`
|
||||||
@click=${this._handlePickView}
|
<paper-icon-item
|
||||||
data-path=${view.path || idx}
|
@click=${this._handlePickView}
|
||||||
>
|
data-path=${view.path || idx}
|
||||||
${view.icon
|
>
|
||||||
? html`
|
${view.icon
|
||||||
<ha-icon
|
? html`
|
||||||
.icon=${view.icon}
|
<ha-icon
|
||||||
slot="item-icon"
|
.icon=${view.icon}
|
||||||
></ha-icon>
|
slot="item-icon"
|
||||||
`
|
></ha-icon>
|
||||||
: ""}
|
`
|
||||||
${view.title || view.path}
|
: ""}
|
||||||
</paper-icon-item>
|
${view.title || view.path}
|
||||||
`
|
</paper-icon-item>
|
||||||
)}
|
`
|
||||||
</paper-listbox>
|
)}
|
||||||
`}
|
</paper-listbox>
|
||||||
|
`}
|
||||||
<div class="card-actions">
|
<div class="card-actions">
|
||||||
${this.castManager.status
|
${this.castManager.status
|
||||||
? html`
|
? html`
|
||||||
@@ -136,11 +138,15 @@ class HcCast extends LitElement {
|
|||||||
llColl.refresh().then(
|
llColl.refresh().then(
|
||||||
() => {
|
() => {
|
||||||
llColl.subscribe((config) => {
|
llColl.subscribe((config) => {
|
||||||
this.lovelaceConfig = config;
|
if (isStrategyDashboard(config)) {
|
||||||
|
this.lovelaceViews = null;
|
||||||
|
} else {
|
||||||
|
this.lovelaceViews = config.views;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
async () => {
|
async () => {
|
||||||
this.lovelaceConfig = null;
|
this.lovelaceViews = null;
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -159,9 +165,7 @@ class HcCast extends LitElement {
|
|||||||
toggleAttribute(
|
toggleAttribute(
|
||||||
this,
|
this,
|
||||||
"hide-icons",
|
"hide-icons",
|
||||||
this.lovelaceConfig
|
this.lovelaceViews ? !this.lovelaceViews.some((view) => view.icon) : true
|
||||||
? !this.lovelaceConfig.views.some((view) => view.icon)
|
|
||||||
: true
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -237,6 +241,8 @@ class HcCast extends LitElement {
|
|||||||
|
|
||||||
mwc-button ha-svg-icon {
|
mwc-button ha-svg-icon {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
|
margin-inline-end: 8px;
|
||||||
|
margin-inline-start: initial;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -1,6 +1,5 @@
|
|||||||
import "@material/mwc-button";
|
import "@material/mwc-button";
|
||||||
import { mdiCastConnected, mdiCast } from "@mdi/js";
|
import { mdiCastConnected, mdiCast } from "@mdi/js";
|
||||||
import "@polymer/paper-input/paper-input";
|
|
||||||
import {
|
import {
|
||||||
Auth,
|
Auth,
|
||||||
Connection,
|
Connection,
|
||||||
@@ -24,6 +23,7 @@ import "../../../../src/components/ha-svg-icon";
|
|||||||
import "../../../../src/layouts/hass-loading-screen";
|
import "../../../../src/layouts/hass-loading-screen";
|
||||||
import { registerServiceWorker } from "../../../../src/util/register-service-worker";
|
import { registerServiceWorker } from "../../../../src/util/register-service-worker";
|
||||||
import "./hc-layout";
|
import "./hc-layout";
|
||||||
|
import "../../../../src/components/ha-textfield";
|
||||||
|
|
||||||
const seeFAQ = (qid) => html`
|
const seeFAQ = (qid) => html`
|
||||||
See <a href="./faq.html${qid ? `#${qid}` : ""}">the FAQ</a> for more
|
See <a href="./faq.html${qid ? `#${qid}` : ""}">the FAQ</a> for more
|
||||||
@@ -33,13 +33,13 @@ const translateErr = (err) =>
|
|||||||
err === ERR_CANNOT_CONNECT
|
err === ERR_CANNOT_CONNECT
|
||||||
? "Unable to connect"
|
? "Unable to connect"
|
||||||
: err === ERR_HASS_HOST_REQUIRED
|
: err === ERR_HASS_HOST_REQUIRED
|
||||||
? "Please enter a Home Assistant URL."
|
? "Please enter a Home Assistant URL."
|
||||||
: err === ERR_INVALID_HTTPS_TO_HTTP
|
: err === ERR_INVALID_HTTPS_TO_HTTP
|
||||||
? html`
|
? html`
|
||||||
Cannot connect to Home Assistant instances over "http://".
|
Cannot connect to Home Assistant instances over "http://".
|
||||||
${seeFAQ("https")}
|
${seeFAQ("https")}
|
||||||
`
|
`
|
||||||
: `Unknown error (${err}).`;
|
: `Unknown error (${err}).`;
|
||||||
|
|
||||||
const INTRO = html`
|
const INTRO = html`
|
||||||
<p>
|
<p>
|
||||||
@@ -116,13 +116,11 @@ export class HcConnect extends LitElement {
|
|||||||
To get started, enter your Home Assistant URL and click authorize.
|
To get started, enter your Home Assistant URL and click authorize.
|
||||||
If you want a preview instead, click the show demo button.
|
If you want a preview instead, click the show demo button.
|
||||||
</p>
|
</p>
|
||||||
<p>
|
<ha-textfield
|
||||||
<paper-input
|
label="Home Assistant URL"
|
||||||
label="Home Assistant URL"
|
placeholder="https://abcdefghijklmnop.ui.nabu.casa"
|
||||||
placeholder="https://abcdefghijklmnop.ui.nabu.casa"
|
@keydown=${this._handleInputKeyDown}
|
||||||
@keydown=${this._handleInputKeyDown}
|
></ha-textfield>
|
||||||
></paper-input>
|
|
||||||
</p>
|
|
||||||
${this.error ? html` <p class="error">${this.error}</p> ` : ""}
|
${this.error ? html` <p class="error">${this.error}</p> ` : ""}
|
||||||
</div>
|
</div>
|
||||||
<div class="card-actions">
|
<div class="card-actions">
|
||||||
@@ -196,7 +194,7 @@ export class HcConnect extends LitElement {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private async _handleConnect() {
|
private async _handleConnect() {
|
||||||
const inputEl = this.shadowRoot!.querySelector("paper-input")!;
|
const inputEl = this.shadowRoot!.querySelector("ha-textfield")!;
|
||||||
const value = inputEl.value || "";
|
const value = inputEl.value || "";
|
||||||
this.error = undefined;
|
this.error = undefined;
|
||||||
|
|
||||||
@@ -315,6 +313,10 @@ export class HcConnect extends LitElement {
|
|||||||
.spacer {
|
.spacer {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ha-textfield {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -10,13 +10,13 @@ import "../../../../src/components/ha-card";
|
|||||||
|
|
||||||
@customElement("hc-layout")
|
@customElement("hc-layout")
|
||||||
class HcLayout extends LitElement {
|
class HcLayout extends LitElement {
|
||||||
@property() public subtitle?: string | undefined;
|
@property() public subtitle?: string;
|
||||||
|
|
||||||
@property() public auth?: Auth;
|
@property({ attribute: false }) public auth?: Auth;
|
||||||
|
|
||||||
@property() public connection?: Connection;
|
@property({ attribute: false }) public connection?: Connection;
|
||||||
|
|
||||||
@property() public user?: HassUser;
|
@property({ attribute: false }) public user?: HassUser;
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
|
@@ -1,7 +1,5 @@
|
|||||||
import {
|
import { LovelaceCardConfig } from "../../../../src/data/lovelace/config/card";
|
||||||
LovelaceCardConfig,
|
import { LovelaceConfig } from "../../../../src/data/lovelace/config/types";
|
||||||
LovelaceConfig,
|
|
||||||
} from "../../../../src/data/lovelace";
|
|
||||||
import { castContext } from "../cast_context";
|
import { castContext } from "../cast_context";
|
||||||
|
|
||||||
export const castDemoLovelace: () => LovelaceConfig = () => {
|
export const castDemoLovelace: () => LovelaceConfig = () => {
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { html, nothing } from "lit";
|
import { html, nothing } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { mockHistory } from "../../../../demo/src/stubs/history";
|
import { mockHistory } from "../../../../demo/src/stubs/history";
|
||||||
import { LovelaceConfig } from "../../../../src/data/lovelace";
|
import { LovelaceConfig } from "../../../../src/data/lovelace/config/types";
|
||||||
import {
|
import {
|
||||||
MockHomeAssistant,
|
MockHomeAssistant,
|
||||||
provideHass,
|
provideHass,
|
||||||
|
@@ -12,8 +12,8 @@ class HcLaunchScreen extends LitElement {
|
|||||||
return html`
|
return html`
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<img
|
<img
|
||||||
alt="Home Assistant logo on left, Nabu Casa logo on right, and red heart in center"
|
alt="Nabu Casa logo on left, Home Assistant logo on right, and red heart in center"
|
||||||
src="https://www.home-assistant.io/images/blog/2018-09-thinking-big/social.png"
|
src="https://cast.home-assistant.io/images/nabu-loves-hass.png"
|
||||||
/>
|
/>
|
||||||
<div class="status">
|
<div class="status">
|
||||||
${this.hass ? "Connected" : "Not Connected"}
|
${this.hass ? "Connected" : "Not Connected"}
|
||||||
@@ -45,6 +45,8 @@ class HcLaunchScreen extends LitElement {
|
|||||||
}
|
}
|
||||||
.status {
|
.status {
|
||||||
padding-right: 54px;
|
padding-right: 54px;
|
||||||
|
padding-inline-end: 54px;
|
||||||
|
padding-inline-start: initial;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@@ -1,7 +1,7 @@
|
|||||||
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
import { css, CSSResultGroup, html, LitElement, TemplateResult } from "lit";
|
||||||
import { customElement, property, query } from "lit/decorators";
|
import { customElement, property, query } from "lit/decorators";
|
||||||
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
||||||
import { LovelaceConfig } from "../../../../src/data/lovelace";
|
import { LovelaceConfig } from "../../../../src/data/lovelace/config/types";
|
||||||
import { Lovelace } from "../../../../src/panels/lovelace/types";
|
import { Lovelace } from "../../../../src/panels/lovelace/types";
|
||||||
import "../../../../src/panels/lovelace/views/hui-view";
|
import "../../../../src/panels/lovelace/views/hui-view";
|
||||||
import { HomeAssistant } from "../../../../src/types";
|
import { HomeAssistant } from "../../../../src/types";
|
||||||
@@ -14,7 +14,8 @@ import "./hc-launch-screen";
|
|||||||
class HcLovelace extends LitElement {
|
class HcLovelace extends LitElement {
|
||||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||||
|
|
||||||
@property({ attribute: false }) public lovelaceConfig!: LovelaceConfig;
|
@property({ attribute: false })
|
||||||
|
public lovelaceConfig!: LovelaceConfig;
|
||||||
|
|
||||||
@property() public viewPath?: string | number;
|
@property() public viewPath?: string | number;
|
||||||
|
|
||||||
|
@@ -21,18 +21,26 @@ import {
|
|||||||
import { atLeastVersion } from "../../../../src/common/config/version";
|
import { atLeastVersion } from "../../../../src/common/config/version";
|
||||||
import { isNavigationClick } from "../../../../src/common/dom/is-navigation-click";
|
import { isNavigationClick } from "../../../../src/common/dom/is-navigation-click";
|
||||||
import {
|
import {
|
||||||
fetchResources,
|
|
||||||
getLegacyLovelaceCollection,
|
getLegacyLovelaceCollection,
|
||||||
getLovelaceCollection,
|
getLovelaceCollection,
|
||||||
|
} from "../../../../src/data/lovelace";
|
||||||
|
import {
|
||||||
|
isStrategyDashboard,
|
||||||
LegacyLovelaceConfig,
|
LegacyLovelaceConfig,
|
||||||
LovelaceConfig,
|
LovelaceConfig,
|
||||||
} from "../../../../src/data/lovelace";
|
LovelaceDashboardStrategyConfig,
|
||||||
|
} from "../../../../src/data/lovelace/config/types";
|
||||||
|
import { fetchResources } from "../../../../src/data/lovelace/resource";
|
||||||
import { loadLovelaceResources } from "../../../../src/panels/lovelace/common/load-resources";
|
import { loadLovelaceResources } from "../../../../src/panels/lovelace/common/load-resources";
|
||||||
import { HassElement } from "../../../../src/state/hass-element";
|
import { HassElement } from "../../../../src/state/hass-element";
|
||||||
import { castContext } from "../cast_context";
|
import { castContext } from "../cast_context";
|
||||||
import "./hc-launch-screen";
|
import "./hc-launch-screen";
|
||||||
|
|
||||||
const DEFAULT_STRATEGY = "original-states";
|
const DEFAULT_CONFIG: LovelaceDashboardStrategyConfig = {
|
||||||
|
strategy: {
|
||||||
|
type: "original-states",
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
let resourcesLoaded = false;
|
let resourcesLoaded = false;
|
||||||
@customElement("hc-main")
|
@customElement("hc-main")
|
||||||
@@ -93,7 +101,7 @@ export class HcMain extends HassElement {
|
|||||||
.lovelaceConfig=${this._lovelaceConfig}
|
.lovelaceConfig=${this._lovelaceConfig}
|
||||||
.viewPath=${this._lovelacePath}
|
.viewPath=${this._lovelacePath}
|
||||||
.urlPath=${this._urlPath}
|
.urlPath=${this._urlPath}
|
||||||
@config-refresh=${this._generateLovelaceConfig}
|
@config-refresh=${this._generateDefaultLovelaceConfig}
|
||||||
></hc-lovelace>
|
></hc-lovelace>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
@@ -197,7 +205,6 @@ export class HcMain extends HassElement {
|
|||||||
expires_in: 0,
|
expires_in: 0,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
this._hassUUID = msg.hassUUID;
|
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
const errorMessage = this._getErrorMessage(err);
|
const errorMessage = this._getErrorMessage(err);
|
||||||
this._error = errorMessage;
|
this._error = errorMessage;
|
||||||
@@ -217,6 +224,17 @@ export class HcMain extends HassElement {
|
|||||||
this.hass.connection.close();
|
this.hass.connection.close();
|
||||||
}
|
}
|
||||||
this.initializeHass(auth, connection);
|
this.initializeHass(auth, connection);
|
||||||
|
if (this._hassUUID !== msg.hassUUID) {
|
||||||
|
this._hassUUID = msg.hassUUID;
|
||||||
|
this._lovelacePath = null;
|
||||||
|
this._urlPath = undefined;
|
||||||
|
this._lovelaceConfig = undefined;
|
||||||
|
if (this._unsubLovelace) {
|
||||||
|
this._unsubLovelace();
|
||||||
|
this._unsubLovelace = undefined;
|
||||||
|
}
|
||||||
|
resourcesLoaded = false;
|
||||||
|
}
|
||||||
this._error = undefined;
|
this._error = undefined;
|
||||||
this._sendStatus();
|
this._sendStatus();
|
||||||
}
|
}
|
||||||
@@ -225,7 +243,7 @@ export class HcMain extends HassElement {
|
|||||||
this._showDemo = false;
|
this._showDemo = false;
|
||||||
// We should not get this command before we are connected.
|
// We should not get this command before we are connected.
|
||||||
// Means a client got out of sync. Let's send status to them.
|
// Means a client got out of sync. Let's send status to them.
|
||||||
if (!this.hass) {
|
if (!this.hass?.connected) {
|
||||||
this._sendStatus(msg.senderId!);
|
this._sendStatus(msg.senderId!);
|
||||||
this._error = "Cannot show Lovelace because we're not connected.";
|
this._error = "Cannot show Lovelace because we're not connected.";
|
||||||
this._sendError(
|
this._sendError(
|
||||||
@@ -276,6 +294,7 @@ export class HcMain extends HassElement {
|
|||||||
this._lovelaceConfig = undefined;
|
this._lovelaceConfig = undefined;
|
||||||
if (this._unsubLovelace) {
|
if (this._unsubLovelace) {
|
||||||
this._unsubLovelace();
|
this._unsubLovelace();
|
||||||
|
this._unsubLovelace = undefined;
|
||||||
}
|
}
|
||||||
const llColl = atLeastVersion(this.hass.connection.haVersion, 0, 107)
|
const llColl = atLeastVersion(this.hass.connection.haVersion, 0, 107)
|
||||||
? getLovelaceCollection(this.hass.connection, msg.urlPath)
|
? getLovelaceCollection(this.hass.connection, msg.urlPath)
|
||||||
@@ -284,9 +303,20 @@ export class HcMain extends HassElement {
|
|||||||
// configuration.
|
// configuration.
|
||||||
try {
|
try {
|
||||||
await llColl.refresh();
|
await llColl.refresh();
|
||||||
this._unsubLovelace = llColl.subscribe((lovelaceConfig) =>
|
this._unsubLovelace = llColl.subscribe(async (rawConfig) => {
|
||||||
this._handleNewLovelaceConfig(lovelaceConfig)
|
if (isStrategyDashboard(rawConfig)) {
|
||||||
);
|
const { generateLovelaceDashboardStrategy } = await import(
|
||||||
|
"../../../../src/panels/lovelace/strategies/get-strategy"
|
||||||
|
);
|
||||||
|
const config = await generateLovelaceDashboardStrategy(
|
||||||
|
rawConfig.strategy,
|
||||||
|
this.hass!
|
||||||
|
);
|
||||||
|
this._handleNewLovelaceConfig(config);
|
||||||
|
} else {
|
||||||
|
this._handleNewLovelaceConfig(rawConfig);
|
||||||
|
}
|
||||||
|
});
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
if (
|
if (
|
||||||
atLeastVersion(this.hass.connection.haVersion, 0, 107) &&
|
atLeastVersion(this.hass.connection.haVersion, 0, 107) &&
|
||||||
@@ -300,7 +330,7 @@ export class HcMain extends HassElement {
|
|||||||
}
|
}
|
||||||
// Generate a Lovelace config.
|
// Generate a Lovelace config.
|
||||||
this._unsubLovelace = () => undefined;
|
this._unsubLovelace = () => undefined;
|
||||||
await this._generateLovelaceConfig();
|
await this._generateDefaultLovelaceConfig();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!resourcesLoaded) {
|
if (!resourcesLoaded) {
|
||||||
@@ -316,15 +346,13 @@ export class HcMain extends HassElement {
|
|||||||
this._sendStatus();
|
this._sendStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _generateLovelaceConfig() {
|
private async _generateDefaultLovelaceConfig() {
|
||||||
const { generateLovelaceDashboardStrategy } = await import(
|
const { generateLovelaceDashboardStrategy } = await import(
|
||||||
"../../../../src/panels/lovelace/strategies/get-strategy"
|
"../../../../src/panels/lovelace/strategies/get-strategy"
|
||||||
);
|
);
|
||||||
this._handleNewLovelaceConfig(
|
this._handleNewLovelaceConfig(
|
||||||
await generateLovelaceDashboardStrategy(
|
await generateLovelaceDashboardStrategy(
|
||||||
{
|
DEFAULT_CONFIG.strategy,
|
||||||
type: DEFAULT_STRATEGY,
|
|
||||||
},
|
|
||||||
this.hass!
|
this.hass!
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
@@ -1,5 +1,5 @@
|
|||||||
import { LocalizeFunc } from "../../../src/common/translations/localize";
|
import { LocalizeFunc } from "../../../src/common/translations/localize";
|
||||||
import { LovelaceConfig } from "../../../src/data/lovelace";
|
import { LovelaceConfig } from "../../../src/data/lovelace/config/types";
|
||||||
import { Entity } from "../../../src/fake_data/entity";
|
import { Entity } from "../../../src/fake_data/entity";
|
||||||
|
|
||||||
export interface DemoConfig {
|
export interface DemoConfig {
|
||||||
|
@@ -4,7 +4,7 @@ import { customElement, property, state } from "lit/decorators";
|
|||||||
import { until } from "lit/directives/until";
|
import { until } from "lit/directives/until";
|
||||||
import "../../../src/components/ha-card";
|
import "../../../src/components/ha-card";
|
||||||
import "../../../src/components/ha-circular-progress";
|
import "../../../src/components/ha-circular-progress";
|
||||||
import { LovelaceCardConfig } from "../../../src/data/lovelace";
|
import { LovelaceCardConfig } from "../../../src/data/lovelace/config/card";
|
||||||
import { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
import { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
||||||
import { Lovelace, LovelaceCard } from "../../../src/panels/lovelace/types";
|
import { Lovelace, LovelaceCard } from "../../../src/panels/lovelace/types";
|
||||||
import {
|
import {
|
||||||
@@ -39,7 +39,9 @@ export class HADemoCard extends LitElement implements LovelaceCard {
|
|||||||
<div class="picker">
|
<div class="picker">
|
||||||
<div class="label">
|
<div class="label">
|
||||||
${this._switching
|
${this._switching
|
||||||
? html`<ha-circular-progress active></ha-circular-progress>`
|
? html`<ha-circular-progress
|
||||||
|
indeterminate
|
||||||
|
></ha-circular-progress>`
|
||||||
: until(
|
: until(
|
||||||
selectedDemoConfig.then(
|
selectedDemoConfig.then(
|
||||||
(conf) => html`
|
(conf) => html`
|
||||||
@@ -48,8 +50,7 @@ export class HADemoCard extends LitElement implements LovelaceCard {
|
|||||||
<a target="_blank" href=${conf.authorUrl}>
|
<a target="_blank" href=${conf.authorUrl}>
|
||||||
${this.hass.localize(
|
${this.hass.localize(
|
||||||
"ui.panel.page-demo.cards.demo.demo_by",
|
"ui.panel.page-demo.cards.demo.demo_by",
|
||||||
"name",
|
{ name: conf.authorName }
|
||||||
conf.authorName
|
|
||||||
)}
|
)}
|
||||||
</a>
|
</a>
|
||||||
</small>
|
</small>
|
||||||
|
@@ -74,19 +74,9 @@
|
|||||||
<body>
|
<body>
|
||||||
<div id="ha-launch-screen">
|
<div id="ha-launch-screen">
|
||||||
<div class="ha-launch-screen-spacer"></div>
|
<div class="ha-launch-screen-spacer"></div>
|
||||||
<svg
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 240 240">
|
||||||
viewBox="0 0 240 240"
|
<path fill="#18BCF2" d="M240 224.762a15 15 0 0 1-15 15H15a15 15 0 0 1-15-15v-90c0-8.25 4.77-19.769 10.61-25.609l98.78-98.7805c5.83-5.83 15.38-5.83 21.21 0l98.79 98.7895c5.83 5.83 10.61 17.36 10.61 25.61v90-.01Z"/>
|
||||||
fill="none"
|
<path fill="#F2F4F9" d="m107.27 239.762-40.63-40.63c-2.09.72-4.32 1.13-6.64 1.13-11.3 0-20.5-9.2-20.5-20.5s9.2-20.5 20.5-20.5 20.5 9.2 20.5 20.5c0 2.33-.41 4.56-1.13 6.65l31.63 31.63v-115.88c-6.8-3.3395-11.5-10.3195-11.5-18.3895 0-11.3 9.2-20.5 20.5-20.5s20.5 9.2 20.5 20.5c0 8.07-4.7 15.05-11.5 18.3895v81.27l31.46-31.46c-.62-1.96-.96-4.04-.96-6.2 0-11.3 9.2-20.5 20.5-20.5s20.5 9.2 20.5 20.5-9.2 20.5-20.5 20.5c-2.5 0-4.88-.47-7.09-1.29L129 208.892v30.88z"/>
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
>
|
|
||||||
<path
|
|
||||||
d="M240 224.762C240 233.012 233.25 239.762 225 239.762H15C6.75 239.762 0 233.012 0 224.762V134.762C0 126.512 4.77 114.993 10.61 109.153L109.39 10.3725C115.22 4.5425 124.77 4.5425 130.6 10.3725L229.39 109.162C235.22 114.992 240 126.522 240 134.772V224.772V224.762Z"
|
|
||||||
fill="#F2F4F9"
|
|
||||||
/>
|
|
||||||
<path
|
|
||||||
d="M229.39 109.153L130.61 10.3725C124.78 4.5425 115.23 4.5425 109.4 10.3725L10.61 109.153C4.78 114.983 0 126.512 0 134.762V224.762C0 233.012 6.75 239.762 15 239.762H107.27L66.64 199.132C64.55 199.852 62.32 200.262 60 200.262C48.7 200.262 39.5 191.062 39.5 179.762C39.5 168.462 48.7 159.262 60 159.262C71.3 159.262 80.5 168.462 80.5 179.762C80.5 182.092 80.09 184.322 79.37 186.412L111 218.042V102.162C104.2 98.8225 99.5 91.8425 99.5 83.7725C99.5 72.4725 108.7 63.2725 120 63.2725C131.3 63.2725 140.5 72.4725 140.5 83.7725C140.5 91.8425 135.8 98.8225 129 102.162V183.432L160.46 151.972C159.84 150.012 159.5 147.932 159.5 145.772C159.5 134.472 168.7 125.272 180 125.272C191.3 125.272 200.5 134.472 200.5 145.772C200.5 157.072 191.3 166.272 180 166.272C177.5 166.272 175.12 165.802 172.91 164.982L129 208.892V239.772H225C233.25 239.772 240 233.022 240 224.772V134.772C240 126.522 235.23 115.002 229.39 109.162V109.153Z"
|
|
||||||
fill="#18BCF2"
|
|
||||||
/>
|
|
||||||
</svg>
|
</svg>
|
||||||
<div id="ha-launch-screen-info-box" class="ha-launch-screen-spacer"></div>
|
<div id="ha-launch-screen-info-box" class="ha-launch-screen-spacer"></div>
|
||||||
</div>
|
</div>
|
||||||
|
@@ -43,8 +43,8 @@ const generateMeanStatistics = (
|
|||||||
period === "day"
|
period === "day"
|
||||||
? addDays(currentDate, 1)
|
? addDays(currentDate, 1)
|
||||||
: period === "month"
|
: period === "month"
|
||||||
? addMonths(currentDate, 1)
|
? addMonths(currentDate, 1)
|
||||||
: addHours(currentDate, 1);
|
: addHours(currentDate, 1);
|
||||||
}
|
}
|
||||||
return statistics;
|
return statistics;
|
||||||
};
|
};
|
||||||
@@ -80,8 +80,8 @@ const generateSumStatistics = (
|
|||||||
period === "day"
|
period === "day"
|
||||||
? addDays(currentDate, 1)
|
? addDays(currentDate, 1)
|
||||||
: period === "month"
|
: period === "month"
|
||||||
? addMonths(currentDate, 1)
|
? addMonths(currentDate, 1)
|
||||||
: addHours(currentDate, 1);
|
: addHours(currentDate, 1);
|
||||||
}
|
}
|
||||||
return statistics;
|
return statistics;
|
||||||
};
|
};
|
||||||
|
@@ -11,7 +11,7 @@ class DemoBlackWhiteRow extends LitElement {
|
|||||||
|
|
||||||
@property() value!: any;
|
@property() value!: any;
|
||||||
|
|
||||||
@property() disabled = false;
|
@property({ type: Boolean }) public disabled = false;
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
return html`
|
return html`
|
||||||
|
@@ -11,11 +11,11 @@ export interface DemoCardConfig {
|
|||||||
|
|
||||||
@customElement("demo-card")
|
@customElement("demo-card")
|
||||||
class DemoCard extends LitElement {
|
class DemoCard extends LitElement {
|
||||||
@property() public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||||
|
|
||||||
@property() public config!: DemoCardConfig;
|
@property({ attribute: false }) public config!: DemoCardConfig;
|
||||||
|
|
||||||
@property() public showConfig = false;
|
@property({ type: Boolean }) public showConfig = false;
|
||||||
|
|
||||||
@state() private _size?: number;
|
@state() private _size?: number;
|
||||||
|
|
||||||
|
@@ -10,9 +10,9 @@ import "../ha-demo-options";
|
|||||||
|
|
||||||
@customElement("demo-cards")
|
@customElement("demo-cards")
|
||||||
class DemoCards extends LitElement {
|
class DemoCards extends LitElement {
|
||||||
@property() public configs!: DemoCardConfig[];
|
@property({ attribute: false }) public configs!: DemoCardConfig[];
|
||||||
|
|
||||||
@property() public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||||
|
|
||||||
@state() private _showConfig = false;
|
@state() private _showConfig = false;
|
||||||
|
|
||||||
|
@@ -8,11 +8,11 @@ import { HomeAssistant } from "../../../src/types";
|
|||||||
|
|
||||||
@customElement("demo-more-info")
|
@customElement("demo-more-info")
|
||||||
class DemoMoreInfo extends LitElement {
|
class DemoMoreInfo extends LitElement {
|
||||||
@property() public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||||
|
|
||||||
@property() public entityId!: string;
|
@property() public entityId!: string;
|
||||||
|
|
||||||
@property() public showConfig!: boolean;
|
@property({ type: Boolean }) public showConfig = false;
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const state = this._getState(this.entityId, this.hass.states);
|
const state = this._getState(this.entityId, this.hass.states);
|
||||||
@@ -23,7 +23,7 @@ class DemoMoreInfo extends LitElement {
|
|||||||
<state-card-content
|
<state-card-content
|
||||||
.stateObj=${state}
|
.stateObj=${state}
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
in-dialog
|
inDialog
|
||||||
></state-card-content>
|
></state-card-content>
|
||||||
|
|
||||||
<more-info-content
|
<more-info-content
|
||||||
|
@@ -1,19 +1,19 @@
|
|||||||
import { LitElement, css, html } from "lit";
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { applyThemesOnElement } from "../../../src/common/dom/apply_themes_on_element";
|
import { applyThemesOnElement } from "../../../src/common/dom/apply_themes_on_element";
|
||||||
import "../../../src/components/ha-formfield";
|
import "../../../src/components/ha-formfield";
|
||||||
import "../../../src/components/ha-switch";
|
import "../../../src/components/ha-switch";
|
||||||
import "./demo-more-info";
|
|
||||||
import "../ha-demo-options";
|
|
||||||
import { HomeAssistant } from "../../../src/types";
|
import { HomeAssistant } from "../../../src/types";
|
||||||
|
import "../ha-demo-options";
|
||||||
|
import "./demo-more-info";
|
||||||
|
|
||||||
@customElement("demo-more-infos")
|
@customElement("demo-more-infos")
|
||||||
class DemoMoreInfos extends LitElement {
|
class DemoMoreInfos extends LitElement {
|
||||||
@property() public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||||
|
|
||||||
@property() public entities!: [];
|
@property({ type: Array }) public entities!: string[];
|
||||||
|
|
||||||
@property({ attribute: false }) _showConfig: boolean = false;
|
@state() private _showConfig = false;
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return html`
|
return html`
|
||||||
|
@@ -509,7 +509,7 @@ export default {
|
|||||||
away_mode: "on",
|
away_mode: "on",
|
||||||
aux_heat: "off",
|
aux_heat: "off",
|
||||||
unit_of_measurement: "°C",
|
unit_of_measurement: "°C",
|
||||||
friendly_name: "Hvac",
|
friendly_name: "HVAC",
|
||||||
supported_features: 3833,
|
supported_features: 3833,
|
||||||
},
|
},
|
||||||
last_changed: "2018-07-19T10:44:46.200650+00:00",
|
last_changed: "2018-07-19T10:44:46.200650+00:00",
|
||||||
|
@@ -1,14 +1,14 @@
|
|||||||
import { mdiMenu } from "@mdi/js";
|
|
||||||
import "@material/mwc-drawer";
|
import "@material/mwc-drawer";
|
||||||
import "@material/mwc-top-app-bar-fixed";
|
import "@material/mwc-top-app-bar-fixed";
|
||||||
import { html, css, LitElement, PropertyValues } from "lit";
|
import { mdiMenu } from "@mdi/js";
|
||||||
import { customElement, property, query } from "lit/decorators";
|
import { LitElement, PropertyValues, css, html } from "lit";
|
||||||
|
import { customElement, query, state } from "lit/decorators";
|
||||||
|
import { dynamicElement } from "../../src/common/dom/dynamic-element-directive";
|
||||||
|
import { HaExpansionPanel } from "../../src/components/ha-expansion-panel";
|
||||||
import "../../src/components/ha-icon-button";
|
import "../../src/components/ha-icon-button";
|
||||||
import "../../src/managers/notification-manager";
|
import "../../src/managers/notification-manager";
|
||||||
import { HaExpansionPanel } from "../../src/components/ha-expansion-panel";
|
|
||||||
import { haStyle } from "../../src/resources/styles";
|
import { haStyle } from "../../src/resources/styles";
|
||||||
import { PAGES, SIDEBAR } from "../build/import-pages";
|
import { PAGES, SIDEBAR } from "../build/import-pages";
|
||||||
import { dynamicElement } from "../../src/common/dom/dynamic-element-directive";
|
|
||||||
import "./components/page-description";
|
import "./components/page-description";
|
||||||
|
|
||||||
const GITHUB_DEMO_URL =
|
const GITHUB_DEMO_URL =
|
||||||
@@ -24,7 +24,7 @@ const FAKE_HASS = {
|
|||||||
|
|
||||||
@customElement("ha-gallery")
|
@customElement("ha-gallery")
|
||||||
class HaGallery extends LitElement {
|
class HaGallery extends LitElement {
|
||||||
@property() private _page =
|
@state() private _page =
|
||||||
document.location.hash.substring(1) ||
|
document.location.hash.substring(1) ||
|
||||||
`${SIDEBAR[0].category}/${SIDEBAR[0].pages![0]}`;
|
`${SIDEBAR[0].category}/${SIDEBAR[0].pages![0]}`;
|
||||||
|
|
||||||
|
@@ -80,7 +80,7 @@ const SCHEMAS: { name: string; conditions: ConditionWithShorthand[] }[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
@customElement("demo-automation-editor-condition")
|
@customElement("demo-automation-editor-condition")
|
||||||
class DemoHaAutomationEditorCondition extends LitElement {
|
export class DemoAutomationEditorCondition extends LitElement {
|
||||||
@state() private hass!: HomeAssistant;
|
@state() private hass!: HomeAssistant;
|
||||||
|
|
||||||
@state() private _disabled = false;
|
@state() private _disabled = false;
|
||||||
@@ -155,6 +155,6 @@ class DemoHaAutomationEditorCondition extends LitElement {
|
|||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
"demo-ha-automation-editor-condition": DemoHaAutomationEditorCondition;
|
"demo-automation-editor-condition": DemoAutomationEditorCondition;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -126,7 +126,7 @@ const SCHEMAS: { name: string; triggers: Trigger[] }[] = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
@customElement("demo-automation-editor-trigger")
|
@customElement("demo-automation-editor-trigger")
|
||||||
class DemoHaAutomationEditorTrigger extends LitElement {
|
export class DemoAutomationEditorTrigger extends LitElement {
|
||||||
@state() private hass!: HomeAssistant;
|
@state() private hass!: HomeAssistant;
|
||||||
|
|
||||||
@state() private _disabled = false;
|
@state() private _disabled = false;
|
||||||
@@ -201,6 +201,6 @@ class DemoHaAutomationEditorTrigger extends LitElement {
|
|||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
"demo-ha-automation-editor-trigger": DemoHaAutomationEditorTrigger;
|
"demo-automation-editor-trigger": DemoAutomationEditorTrigger;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -1,8 +1,10 @@
|
|||||||
import { css, html, LitElement, TemplateResult } from "lit";
|
import { css, html, LitElement, TemplateResult, nothing } from "lit";
|
||||||
import { customElement } from "lit/decorators";
|
import { customElement } from "lit/decorators";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import "../../../../src/components/ha-chip";
|
import "../../../../src/components/chips/ha-chip-set";
|
||||||
import "../../../../src/components/ha-chip-set";
|
import "../../../../src/components/chips/ha-assist-chip";
|
||||||
|
import "../../../../src/components/chips/ha-input-chip";
|
||||||
|
import "../../../../src/components/chips/ha-filter-chip";
|
||||||
import "../../../../src/components/ha-svg-icon";
|
import "../../../../src/components/ha-svg-icon";
|
||||||
import { mdiHomeAssistant } from "../../../../src/resources/home-assistant-logo-svg";
|
import { mdiHomeAssistant } from "../../../../src/resources/home-assistant-logo-svg";
|
||||||
|
|
||||||
@@ -10,10 +12,6 @@ const chips: {
|
|||||||
icon?: string;
|
icon?: string;
|
||||||
content?: string;
|
content?: string;
|
||||||
}[] = [
|
}[] = [
|
||||||
{},
|
|
||||||
{
|
|
||||||
icon: mdiHomeAssistant,
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
content: "Content",
|
content: "Content",
|
||||||
},
|
},
|
||||||
@@ -29,31 +27,73 @@ export class DemoHaChips extends LitElement {
|
|||||||
return html`
|
return html`
|
||||||
<ha-card header="ha-chip demo">
|
<ha-card header="ha-chip demo">
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
${chips.map(
|
<p>Action chip</p>
|
||||||
(chip) => html`
|
|
||||||
<ha-chip .hasIcon=${chip.icon !== undefined}>
|
|
||||||
${chip.icon
|
|
||||||
? html`<ha-svg-icon slot="icon" .path=${chip.icon}>
|
|
||||||
</ha-svg-icon>`
|
|
||||||
: ""}
|
|
||||||
${chip.content}
|
|
||||||
</ha-chip>
|
|
||||||
`
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
</ha-card>
|
|
||||||
<ha-card header="ha-chip-set demo">
|
|
||||||
<div class="card-content">
|
|
||||||
<ha-chip-set>
|
<ha-chip-set>
|
||||||
${chips.map(
|
${chips.map(
|
||||||
(chip) => html`
|
(chip) => html`
|
||||||
<ha-chip .hasIcon=${chip.icon !== undefined}>
|
<ha-assist-chip .label=${chip.content}>
|
||||||
|
${chip.icon
|
||||||
|
? html`<ha-svg-icon slot="icon" .path=${chip.icon}>
|
||||||
|
</ha-svg-icon>`
|
||||||
|
: nothing}
|
||||||
|
</ha-assist-chip>
|
||||||
|
`
|
||||||
|
)}
|
||||||
|
${chips.map(
|
||||||
|
(chip) => html`
|
||||||
|
<ha-assist-chip .label=${chip.content} selected>
|
||||||
|
${chip.icon
|
||||||
|
? html`<ha-svg-icon slot="icon" .path=${chip.icon}>
|
||||||
|
</ha-svg-icon>`
|
||||||
|
: nothing}
|
||||||
|
</ha-assist-chip>
|
||||||
|
`
|
||||||
|
)}
|
||||||
|
</ha-chip-set>
|
||||||
|
<p>Filter chip</p>
|
||||||
|
<ha-chip-set>
|
||||||
|
${chips.map(
|
||||||
|
(chip) => html`
|
||||||
|
<ha-filter-chip .label=${chip.content}>
|
||||||
|
${chip.icon
|
||||||
|
? html`<ha-svg-icon slot="icon" .path=${chip.icon}>
|
||||||
|
</ha-svg-icon>`
|
||||||
|
: nothing}
|
||||||
|
</ha-filter-chip>
|
||||||
|
`
|
||||||
|
)}
|
||||||
|
${chips.map(
|
||||||
|
(chip) => html`
|
||||||
|
<ha-filter-chip .label=${chip.content} selected>
|
||||||
|
${chip.icon
|
||||||
|
? html`<ha-svg-icon slot="icon" .path=${chip.icon}>
|
||||||
|
</ha-svg-icon>`
|
||||||
|
: nothing}
|
||||||
|
</ha-filter-chip>
|
||||||
|
`
|
||||||
|
)}
|
||||||
|
</ha-chip-set>
|
||||||
|
<p>Input chip</p>
|
||||||
|
<ha-chip-set>
|
||||||
|
${chips.map(
|
||||||
|
(chip) => html`
|
||||||
|
<ha-input-chip .label=${chip.content}>
|
||||||
${chip.icon
|
${chip.icon
|
||||||
? html`<ha-svg-icon slot="icon" .path=${chip.icon}>
|
? html`<ha-svg-icon slot="icon" .path=${chip.icon}>
|
||||||
</ha-svg-icon>`
|
</ha-svg-icon>`
|
||||||
: ""}
|
: ""}
|
||||||
${chip.content}
|
${chip.content}
|
||||||
</ha-chip>
|
</ha-input-chip>
|
||||||
|
`
|
||||||
|
)}
|
||||||
|
${chips.map(
|
||||||
|
(chip) => html`
|
||||||
|
<ha-input-chip .label=${chip.content} selected>
|
||||||
|
${chip.icon
|
||||||
|
? html`<ha-svg-icon slot="icon" .path=${chip.icon}>
|
||||||
|
</ha-svg-icon>`
|
||||||
|
: nothing}
|
||||||
|
</ha-input-chip>
|
||||||
`
|
`
|
||||||
)}
|
)}
|
||||||
</ha-chip-set>
|
</ha-chip-set>
|
||||||
@@ -68,12 +108,10 @@ export class DemoHaChips extends LitElement {
|
|||||||
max-width: 600px;
|
max-width: 600px;
|
||||||
margin: 24px auto;
|
margin: 24px auto;
|
||||||
}
|
}
|
||||||
ha-chip {
|
|
||||||
margin-bottom: 4px;
|
|
||||||
}
|
|
||||||
.card-content {
|
.card-content {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
@@ -0,0 +1,4 @@
|
|||||||
|
---
|
||||||
|
title: Circular Progress
|
||||||
|
subtitle: Can be used to indicate an ongoing task.
|
||||||
|
---
|
64
gallery/src/pages/components/ha-circular-progress.ts
Normal file
64
gallery/src/pages/components/ha-circular-progress.ts
Normal file
@@ -0,0 +1,64 @@
|
|||||||
|
import { html, css, LitElement, TemplateResult } from "lit";
|
||||||
|
import { customElement, property } from "lit/decorators";
|
||||||
|
import "../../../../src/components/ha-bar";
|
||||||
|
import "../../../../src/components/ha-card";
|
||||||
|
import "../../../../src/components/ha-circular-progress";
|
||||||
|
import "@material/web/progress/circular-progress";
|
||||||
|
import { HomeAssistant } from "../../../../src/types";
|
||||||
|
|
||||||
|
@customElement("demo-components-ha-circular-progress")
|
||||||
|
export class DemoHaCircularProgress extends LitElement {
|
||||||
|
@property({ attribute: false }) hass!: HomeAssistant;
|
||||||
|
|
||||||
|
protected render(): TemplateResult {
|
||||||
|
return html`<ha-card header="Basic circular progress">
|
||||||
|
<div class="card-content">
|
||||||
|
<ha-circular-progress indeterminate></ha-circular-progress></div
|
||||||
|
></ha-card>
|
||||||
|
<ha-card header="Different circular progress sizes">
|
||||||
|
<div class="card-content">
|
||||||
|
<ha-circular-progress
|
||||||
|
indeterminate
|
||||||
|
size="tiny"
|
||||||
|
></ha-circular-progress>
|
||||||
|
<ha-circular-progress
|
||||||
|
indeterminate
|
||||||
|
size="small"
|
||||||
|
></ha-circular-progress>
|
||||||
|
<ha-circular-progress
|
||||||
|
indeterminate
|
||||||
|
size="medium"
|
||||||
|
></ha-circular-progress>
|
||||||
|
<ha-circular-progress
|
||||||
|
indeterminate
|
||||||
|
size="large"
|
||||||
|
></ha-circular-progress></div
|
||||||
|
></ha-card>
|
||||||
|
<ha-card header="Circular progress with an aria-label">
|
||||||
|
<div class="card-content">
|
||||||
|
<ha-circular-progress
|
||||||
|
indeterminate
|
||||||
|
aria-label="Doing something..."
|
||||||
|
></ha-circular-progress>
|
||||||
|
<ha-circular-progress
|
||||||
|
indeterminate
|
||||||
|
.ariaLabel=${"Doing something..."}
|
||||||
|
></ha-circular-progress></div
|
||||||
|
></ha-card>`;
|
||||||
|
}
|
||||||
|
|
||||||
|
static get styles() {
|
||||||
|
return css`
|
||||||
|
ha-card {
|
||||||
|
max-width: 600px;
|
||||||
|
margin: 24px auto;
|
||||||
|
}
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"demo-components-ha-circular-progress": DemoHaCircularProgress;
|
||||||
|
}
|
||||||
|
}
|
@@ -59,7 +59,7 @@ export class DemoHaBarButton extends LitElement {
|
|||||||
<ha-control-button
|
<ha-control-button
|
||||||
class=${ifDefined(btn.class)}
|
class=${ifDefined(btn.class)}
|
||||||
label=${ifDefined(btn.label)}
|
label=${ifDefined(btn.label)}
|
||||||
disabled=${ifDefined(btn.disabled)}
|
?disabled=${btn.disabled}
|
||||||
>
|
>
|
||||||
<ha-svg-icon .path=${btn.icon || mdiLightbulb}></ha-svg-icon>
|
<ha-svg-icon .path=${btn.icon || mdiLightbulb}></ha-svg-icon>
|
||||||
</ha-control-button>
|
</ha-control-button>
|
||||||
|
@@ -11,6 +11,7 @@ const buttons: {
|
|||||||
min?: number;
|
min?: number;
|
||||||
max?: number;
|
max?: number;
|
||||||
step?: number;
|
step?: number;
|
||||||
|
unit?: string;
|
||||||
class?: string;
|
class?: string;
|
||||||
}[] = [
|
}[] = [
|
||||||
{
|
{
|
||||||
@@ -29,6 +30,11 @@ const buttons: {
|
|||||||
label: "Custom",
|
label: "Custom",
|
||||||
class: "custom",
|
class: "custom",
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
id: "unit",
|
||||||
|
label: "With unit",
|
||||||
|
unit: "m",
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@customElement("demo-components-ha-control-number-buttons")
|
@customElement("demo-components-ha-control-number-buttons")
|
||||||
@@ -50,6 +56,7 @@ export class DemoHarControlNumberButtons extends LitElement {
|
|||||||
<pre>Config: ${JSON.stringify(config)}</pre>
|
<pre>Config: ${JSON.stringify(config)}</pre>
|
||||||
<ha-control-number-buttons
|
<ha-control-number-buttons
|
||||||
.value=${this.value}
|
.value=${this.value}
|
||||||
|
.unit=${config.unit}
|
||||||
.min=${config.min}
|
.min=${config.min}
|
||||||
.max=${config.max}
|
.max=${config.max}
|
||||||
.step=${config.step}
|
.step=${config.step}
|
||||||
|
@@ -135,7 +135,7 @@ export class DemoHaControlSelect extends LitElement {
|
|||||||
class=${ifDefined(config.class)}
|
class=${ifDefined(config.class)}
|
||||||
@value-changed=${this.handleValueChanged}
|
@value-changed=${this.handleValueChanged}
|
||||||
aria-labelledby=${id}
|
aria-labelledby=${id}
|
||||||
disabled=${ifDefined(config.disabled)}
|
?disabled=${config.disabled}
|
||||||
>
|
>
|
||||||
</ha-control-select>
|
</ha-control-select>
|
||||||
</div>
|
</div>
|
||||||
@@ -156,7 +156,7 @@ export class DemoHaControlSelect extends LitElement {
|
|||||||
class=${ifDefined(config.class)}
|
class=${ifDefined(config.class)}
|
||||||
@value-changed=${this.handleValueChanged}
|
@value-changed=${this.handleValueChanged}
|
||||||
aria-labelledby=${id}
|
aria-labelledby=${id}
|
||||||
disabled=${ifDefined(config.disabled)}
|
?disabled=${config.disabled}
|
||||||
>
|
>
|
||||||
</ha-control-select>
|
</ha-control-select>
|
||||||
`;
|
`;
|
||||||
|
@@ -9,6 +9,7 @@ const sliders: {
|
|||||||
id: string;
|
id: string;
|
||||||
label: string;
|
label: string;
|
||||||
mode?: "start" | "end" | "cursor";
|
mode?: "start" | "end" | "cursor";
|
||||||
|
unit?: string;
|
||||||
class?: string;
|
class?: string;
|
||||||
}[] = [
|
}[] = [
|
||||||
{
|
{
|
||||||
@@ -31,18 +32,21 @@ const sliders: {
|
|||||||
label: "Slider (start mode) and custom style",
|
label: "Slider (start mode) and custom style",
|
||||||
mode: "start",
|
mode: "start",
|
||||||
class: "custom",
|
class: "custom",
|
||||||
|
unit: "mm",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "slider-end-custom",
|
id: "slider-end-custom",
|
||||||
label: "Slider (end mode) and custom style",
|
label: "Slider (end mode) and custom style",
|
||||||
mode: "end",
|
mode: "end",
|
||||||
class: "custom",
|
class: "custom",
|
||||||
|
unit: "mm",
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
id: "slider-cursor-custom",
|
id: "slider-cursor-custom",
|
||||||
label: "Slider (cursor mode) and custom style",
|
label: "Slider (cursor mode) and custom style",
|
||||||
mode: "cursor",
|
mode: "cursor",
|
||||||
class: "custom",
|
class: "custom",
|
||||||
|
unit: "mm",
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
@@ -93,6 +97,7 @@ export class DemoHaBarSlider extends LitElement {
|
|||||||
@value-changed=${this.handleValueChanged}
|
@value-changed=${this.handleValueChanged}
|
||||||
@slider-moved=${this.handleSliderMoved}
|
@slider-moved=${this.handleSliderMoved}
|
||||||
aria-labelledby=${id}
|
aria-labelledby=${id}
|
||||||
|
.unit=${config.unit}
|
||||||
>
|
>
|
||||||
</ha-control-slider>
|
</ha-control-slider>
|
||||||
</div>
|
</div>
|
||||||
@@ -114,6 +119,7 @@ export class DemoHaBarSlider extends LitElement {
|
|||||||
@value-changed=${this.handleValueChanged}
|
@value-changed=${this.handleValueChanged}
|
||||||
@slider-moved=${this.handleSliderMoved}
|
@slider-moved=${this.handleSliderMoved}
|
||||||
aria-label=${label}
|
aria-label=${label}
|
||||||
|
.unit=${config.unit}
|
||||||
>
|
>
|
||||||
</ha-control-slider>
|
</ha-control-slider>
|
||||||
`;
|
`;
|
||||||
|
@@ -63,8 +63,8 @@ export class DemoHaControlSwitch extends LitElement {
|
|||||||
.pathOn=${mdiLightbulb}
|
.pathOn=${mdiLightbulb}
|
||||||
.pathOff=${mdiLightbulbOff}
|
.pathOff=${mdiLightbulbOff}
|
||||||
aria-labelledby=${id}
|
aria-labelledby=${id}
|
||||||
disabled=${ifDefined(config.disabled)}
|
?disabled=${config.disabled}
|
||||||
reversed=${ifDefined(config.reversed)}
|
?reversed=${config.reversed}
|
||||||
>
|
>
|
||||||
</ha-control-switch>
|
</ha-control-switch>
|
||||||
</div>
|
</div>
|
||||||
@@ -86,8 +86,8 @@ export class DemoHaControlSwitch extends LitElement {
|
|||||||
aria-label=${label}
|
aria-label=${label}
|
||||||
.pathOn=${mdiGarageOpen}
|
.pathOn=${mdiGarageOpen}
|
||||||
.pathOff=${mdiGarage}
|
.pathOff=${mdiGarage}
|
||||||
disabled=${ifDefined(config.disabled)}
|
?disabled=${config.disabled}
|
||||||
reversed=${ifDefined(config.reversed)}
|
?reversed=${config.reversed}
|
||||||
>
|
>
|
||||||
</ha-control-switch>
|
</ha-control-switch>
|
||||||
`;
|
`;
|
||||||
|
@@ -5,9 +5,22 @@ subtitle: Dialogs provide important prompts in a user flow.
|
|||||||
|
|
||||||
# Material Design 3
|
# Material Design 3
|
||||||
|
|
||||||
Our dialogs are based on the latest version of Material Design. Specs and guidelines can be found on its [website](https://m3.material.io/components/dialogs/overview).
|
Our dialogs are based on the latest version of Material Design. Please note that we have made some well-considered adjustments to these guideliness. Specs and guidelines can be found on its [website](https://m3.material.io/components/dialogs/overview).
|
||||||
|
|
||||||
# Highlighted guidelines
|
# Guidelines
|
||||||
|
|
||||||
|
## Design
|
||||||
|
|
||||||
|
- Dialogs have a max width of 560px. Alert and confirmation dialogs got a fixed width of 320px. If you need more width, consider a dedicated page instead.
|
||||||
|
- The close X-icon is on the top left, on all screen sizes. Except for alert and confirmation dialogs, they only have buttons and no X-icon. This is different compared to the Material guideliness.
|
||||||
|
- Dialogs can't be closed with ESC or clicked outside of the dialog when there is a form that the user needs to fill out. Instead it will animate "no" by a little shake.
|
||||||
|
- Extra icon buttons are on the top right, for example help, settings and expand dialog. More than 2 icon buttons, they will be in an overflow menu.
|
||||||
|
- The submit button is grouped with a cancel button at the bottom right, on all screen sizes. Fullscreen mobile dialogs have them sticky at the bottom.
|
||||||
|
- Keep the labels short, for example `Save`, `Delete`, `Enable`.
|
||||||
|
- Dialog with actions must always have a discard button. On desktop a `Cancel` button and X-icon, on mobile only the X-icon.
|
||||||
|
- Destructive actions should be a red warning button.
|
||||||
|
- Alert or confirmation dialogs only have buttons and no X-icon.
|
||||||
|
- Try to avoid three buttons in one dialog. Especially when you leave the dialog task unfinished.
|
||||||
|
|
||||||
## Content
|
## Content
|
||||||
|
|
||||||
@@ -17,14 +30,6 @@ Our dialogs are based on the latest version of Material Design. Specs and guidel
|
|||||||
- If users become unsure, they read the description. Make sure this explains what will happen.
|
- If users become unsure, they read the description. Make sure this explains what will happen.
|
||||||
- Strive for minimalism.
|
- Strive for minimalism.
|
||||||
|
|
||||||
## Buttons and X-icon
|
|
||||||
|
|
||||||
- Keep the labels short, for example `Save`, `Delete`, `Enable`.
|
|
||||||
- Dialog with actions must always have a discard button. On desktop a `Cancel` button and X-icon, on mobile only the X-icon.
|
|
||||||
- Destructive actions should be a red warning button.
|
|
||||||
- Alert or confirmation dialogs only have buttons and no X-icon.
|
|
||||||
- Try to avoid three buttons in one dialog. Especially when you leave the dialog task unfinished.
|
|
||||||
|
|
||||||
## Example
|
## Example
|
||||||
|
|
||||||
### Confirmation dialog
|
### Confirmation dialog
|
||||||
|
@@ -3,6 +3,7 @@ import { css, html, LitElement, TemplateResult } from "lit";
|
|||||||
import { customElement } from "lit/decorators";
|
import { customElement } from "lit/decorators";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import "../../../../src/components/ha-expansion-panel";
|
import "../../../../src/components/ha-expansion-panel";
|
||||||
|
import "../../../../src/components/ha-icon-button";
|
||||||
import "../../../../src/components/ha-markdown";
|
import "../../../../src/components/ha-markdown";
|
||||||
import "../../components/demo-black-white-row";
|
import "../../components/demo-black-white-row";
|
||||||
import { LONG_TEXT } from "../../data/text";
|
import { LONG_TEXT } from "../../data/text";
|
||||||
|
@@ -18,7 +18,7 @@ The Home Assistant interface is based on Material Design. It's a design system c
|
|||||||
|
|
||||||
We want to make it as easy for designers to contribute as it is for developers. There’s a lot a designer can contribute to:
|
We want to make it as easy for designers to contribute as it is for developers. There’s a lot a designer can contribute to:
|
||||||
|
|
||||||
- Meet us at <a href="https://discord.gg/BPBc8rZ9" rel="noopener noreferrer" target="_blank">devs_ux Discord</a>. Feel free to share your designs, user test or strategic ideas.
|
- Meet us at <a href="https://www.home-assistant.io/join-chat" rel="noopener noreferrer" target="_blank">devs_ux Discord</a>. Feel free to share your designs, user test or strategic ideas.
|
||||||
- Start designing with our <a href="https://www.figma.com/community/file/967153512097289521/Home-Assistant-DesignKit" rel="noopener noreferrer" target="_blank">Figma DesignKit</a>.
|
- Start designing with our <a href="https://www.figma.com/community/file/967153512097289521/Home-Assistant-DesignKit" rel="noopener noreferrer" target="_blank">Figma DesignKit</a>.
|
||||||
- Find the latest UX <a href="https://github.com/home-assistant/frontend/discussions?discussions_q=label%3Aux" rel="noopener noreferrer" target="_blank">discussions</a> and <a href="https://github.com/home-assistant/frontend/labels/ux" rel="noopener noreferrer" target="_blank">issues</a> on GitHub. Everyone can start a new issue or discussion!
|
- Find the latest UX <a href="https://github.com/home-assistant/frontend/discussions?discussions_q=label%3Aux" rel="noopener noreferrer" target="_blank">discussions</a> and <a href="https://github.com/home-assistant/frontend/labels/ux" rel="noopener noreferrer" target="_blank">issues</a> on GitHub. Everyone can start a new issue or discussion!
|
||||||
|
|
||||||
|
@@ -1,19 +1,20 @@
|
|||||||
import { html, css, LitElement } from "lit";
|
import "@material/mwc-list/mwc-list";
|
||||||
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
|
import { formatDateTimeNumeric } from "../../../../src/common/datetime/format_date_time";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import "../../../../src/components/ha-control-select";
|
import "../../../../src/components/ha-control-select";
|
||||||
import { translationMetadata } from "../../../../src/resources/translations-metadata";
|
|
||||||
import { formatDateTimeNumeric } from "../../../../src/common/datetime/format_date_time";
|
|
||||||
import { timeOptions } from "../../data/date-options";
|
|
||||||
import { demoConfig } from "../../../../src/fake_data/demo_config";
|
|
||||||
import {
|
import {
|
||||||
|
DateFormat,
|
||||||
|
FirstWeekday,
|
||||||
FrontendLocaleData,
|
FrontendLocaleData,
|
||||||
NumberFormat,
|
NumberFormat,
|
||||||
TimeFormat,
|
TimeFormat,
|
||||||
DateFormat,
|
|
||||||
FirstWeekday,
|
|
||||||
TimeZone,
|
TimeZone,
|
||||||
} from "../../../../src/data/translation";
|
} from "../../../../src/data/translation";
|
||||||
|
import { demoConfig } from "../../../../src/fake_data/demo_config";
|
||||||
|
import { translationMetadata } from "../../../../src/resources/translations-metadata";
|
||||||
|
import { timeOptions } from "../../data/date-options";
|
||||||
|
|
||||||
@customElement("demo-date-time-date-time-numeric")
|
@customElement("demo-date-time-date-time-numeric")
|
||||||
export class DemoDateTimeDateTimeNumeric extends LitElement {
|
export class DemoDateTimeDateTimeNumeric extends LitElement {
|
||||||
|
@@ -1,19 +1,20 @@
|
|||||||
import { html, css, LitElement } from "lit";
|
import "@material/mwc-list/mwc-list";
|
||||||
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
|
import { formatDateTimeWithSeconds } from "../../../../src/common/datetime/format_date_time";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import "../../../../src/components/ha-control-select";
|
import "../../../../src/components/ha-control-select";
|
||||||
import { translationMetadata } from "../../../../src/resources/translations-metadata";
|
|
||||||
import { formatDateTimeWithSeconds } from "../../../../src/common/datetime/format_date_time";
|
|
||||||
import { timeOptions } from "../../data/date-options";
|
|
||||||
import { demoConfig } from "../../../../src/fake_data/demo_config";
|
|
||||||
import {
|
import {
|
||||||
|
DateFormat,
|
||||||
|
FirstWeekday,
|
||||||
FrontendLocaleData,
|
FrontendLocaleData,
|
||||||
NumberFormat,
|
NumberFormat,
|
||||||
TimeFormat,
|
TimeFormat,
|
||||||
DateFormat,
|
|
||||||
FirstWeekday,
|
|
||||||
TimeZone,
|
TimeZone,
|
||||||
} from "../../../../src/data/translation";
|
} from "../../../../src/data/translation";
|
||||||
|
import { demoConfig } from "../../../../src/fake_data/demo_config";
|
||||||
|
import { translationMetadata } from "../../../../src/resources/translations-metadata";
|
||||||
|
import { timeOptions } from "../../data/date-options";
|
||||||
|
|
||||||
@customElement("demo-date-time-date-time-seconds")
|
@customElement("demo-date-time-date-time-seconds")
|
||||||
export class DemoDateTimeDateTimeSeconds extends LitElement {
|
export class DemoDateTimeDateTimeSeconds extends LitElement {
|
||||||
|
@@ -1,19 +1,20 @@
|
|||||||
import { html, css, LitElement } from "lit";
|
import "@material/mwc-list/mwc-list";
|
||||||
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
|
import { formatShortDateTimeWithYear } from "../../../../src/common/datetime/format_date_time";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import "../../../../src/components/ha-control-select";
|
import "../../../../src/components/ha-control-select";
|
||||||
import { translationMetadata } from "../../../../src/resources/translations-metadata";
|
|
||||||
import { formatShortDateTimeWithYear } from "../../../../src/common/datetime/format_date_time";
|
|
||||||
import { timeOptions } from "../../data/date-options";
|
|
||||||
import { demoConfig } from "../../../../src/fake_data/demo_config";
|
|
||||||
import {
|
import {
|
||||||
|
DateFormat,
|
||||||
|
FirstWeekday,
|
||||||
FrontendLocaleData,
|
FrontendLocaleData,
|
||||||
NumberFormat,
|
NumberFormat,
|
||||||
TimeFormat,
|
TimeFormat,
|
||||||
DateFormat,
|
|
||||||
FirstWeekday,
|
|
||||||
TimeZone,
|
TimeZone,
|
||||||
} from "../../../../src/data/translation";
|
} from "../../../../src/data/translation";
|
||||||
|
import { demoConfig } from "../../../../src/fake_data/demo_config";
|
||||||
|
import { translationMetadata } from "../../../../src/resources/translations-metadata";
|
||||||
|
import { timeOptions } from "../../data/date-options";
|
||||||
|
|
||||||
@customElement("demo-date-time-date-time-short-year")
|
@customElement("demo-date-time-date-time-short-year")
|
||||||
export class DemoDateTimeDateTimeShortYear extends LitElement {
|
export class DemoDateTimeDateTimeShortYear extends LitElement {
|
||||||
|
@@ -1,19 +1,20 @@
|
|||||||
import { html, css, LitElement } from "lit";
|
import "@material/mwc-list/mwc-list";
|
||||||
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
|
import { formatShortDateTime } from "../../../../src/common/datetime/format_date_time";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import "../../../../src/components/ha-control-select";
|
import "../../../../src/components/ha-control-select";
|
||||||
import { translationMetadata } from "../../../../src/resources/translations-metadata";
|
|
||||||
import { formatShortDateTime } from "../../../../src/common/datetime/format_date_time";
|
|
||||||
import { timeOptions } from "../../data/date-options";
|
|
||||||
import { demoConfig } from "../../../../src/fake_data/demo_config";
|
|
||||||
import {
|
import {
|
||||||
|
DateFormat,
|
||||||
|
FirstWeekday,
|
||||||
FrontendLocaleData,
|
FrontendLocaleData,
|
||||||
NumberFormat,
|
NumberFormat,
|
||||||
TimeFormat,
|
TimeFormat,
|
||||||
DateFormat,
|
|
||||||
FirstWeekday,
|
|
||||||
TimeZone,
|
TimeZone,
|
||||||
} from "../../../../src/data/translation";
|
} from "../../../../src/data/translation";
|
||||||
|
import { demoConfig } from "../../../../src/fake_data/demo_config";
|
||||||
|
import { translationMetadata } from "../../../../src/resources/translations-metadata";
|
||||||
|
import { timeOptions } from "../../data/date-options";
|
||||||
|
|
||||||
@customElement("demo-date-time-date-time-short")
|
@customElement("demo-date-time-date-time-short")
|
||||||
export class DemoDateTimeDateTimeShort extends LitElement {
|
export class DemoDateTimeDateTimeShort extends LitElement {
|
||||||
|
@@ -1,19 +1,20 @@
|
|||||||
import { html, css, LitElement } from "lit";
|
import "@material/mwc-list/mwc-list";
|
||||||
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
|
import { formatDateTime } from "../../../../src/common/datetime/format_date_time";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import "../../../../src/components/ha-control-select";
|
import "../../../../src/components/ha-control-select";
|
||||||
import { translationMetadata } from "../../../../src/resources/translations-metadata";
|
|
||||||
import { formatDateTime } from "../../../../src/common/datetime/format_date_time";
|
|
||||||
import { timeOptions } from "../../data/date-options";
|
|
||||||
import { demoConfig } from "../../../../src/fake_data/demo_config";
|
|
||||||
import {
|
import {
|
||||||
|
DateFormat,
|
||||||
|
FirstWeekday,
|
||||||
FrontendLocaleData,
|
FrontendLocaleData,
|
||||||
NumberFormat,
|
NumberFormat,
|
||||||
TimeFormat,
|
TimeFormat,
|
||||||
DateFormat,
|
|
||||||
FirstWeekday,
|
|
||||||
TimeZone,
|
TimeZone,
|
||||||
} from "../../../../src/data/translation";
|
} from "../../../../src/data/translation";
|
||||||
|
import { demoConfig } from "../../../../src/fake_data/demo_config";
|
||||||
|
import { translationMetadata } from "../../../../src/resources/translations-metadata";
|
||||||
|
import { timeOptions } from "../../data/date-options";
|
||||||
|
|
||||||
@customElement("demo-date-time-date-time")
|
@customElement("demo-date-time-date-time")
|
||||||
export class DemoDateTimeDateTime extends LitElement {
|
export class DemoDateTimeDateTime extends LitElement {
|
||||||
|
@@ -1,18 +1,20 @@
|
|||||||
import { html, css, LitElement } from "lit";
|
import "@material/mwc-list/mwc-list";
|
||||||
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
import "../../../../src/components/ha-card";
|
|
||||||
import { translationMetadata } from "../../../../src/resources/translations-metadata";
|
|
||||||
import { formatTimeWithSeconds } from "../../../../src/common/datetime/format_time";
|
import { formatTimeWithSeconds } from "../../../../src/common/datetime/format_time";
|
||||||
import { timeOptions } from "../../data/date-options";
|
import "../../../../src/components/ha-card";
|
||||||
import { demoConfig } from "../../../../src/fake_data/demo_config";
|
import "../../../../src/components/ha-control-select";
|
||||||
import {
|
import {
|
||||||
|
DateFormat,
|
||||||
|
FirstWeekday,
|
||||||
FrontendLocaleData,
|
FrontendLocaleData,
|
||||||
NumberFormat,
|
NumberFormat,
|
||||||
TimeFormat,
|
TimeFormat,
|
||||||
DateFormat,
|
|
||||||
FirstWeekday,
|
|
||||||
TimeZone,
|
TimeZone,
|
||||||
} from "../../../../src/data/translation";
|
} from "../../../../src/data/translation";
|
||||||
|
import { demoConfig } from "../../../../src/fake_data/demo_config";
|
||||||
|
import { translationMetadata } from "../../../../src/resources/translations-metadata";
|
||||||
|
import { timeOptions } from "../../data/date-options";
|
||||||
|
|
||||||
@customElement("demo-date-time-time-seconds")
|
@customElement("demo-date-time-time-seconds")
|
||||||
export class DemoDateTimeTimeSeconds extends LitElement {
|
export class DemoDateTimeTimeSeconds extends LitElement {
|
||||||
|
@@ -1,18 +1,20 @@
|
|||||||
import { html, css, LitElement } from "lit";
|
import "@material/mwc-list/mwc-list";
|
||||||
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
import "../../../../src/components/ha-card";
|
|
||||||
import { translationMetadata } from "../../../../src/resources/translations-metadata";
|
|
||||||
import { formatTimeWeekday } from "../../../../src/common/datetime/format_time";
|
import { formatTimeWeekday } from "../../../../src/common/datetime/format_time";
|
||||||
import { timeOptions } from "../../data/date-options";
|
import "../../../../src/components/ha-card";
|
||||||
import { demoConfig } from "../../../../src/fake_data/demo_config";
|
import "../../../../src/components/ha-control-select";
|
||||||
import {
|
import {
|
||||||
|
DateFormat,
|
||||||
|
FirstWeekday,
|
||||||
FrontendLocaleData,
|
FrontendLocaleData,
|
||||||
NumberFormat,
|
NumberFormat,
|
||||||
TimeFormat,
|
TimeFormat,
|
||||||
DateFormat,
|
|
||||||
FirstWeekday,
|
|
||||||
TimeZone,
|
TimeZone,
|
||||||
} from "../../../../src/data/translation";
|
} from "../../../../src/data/translation";
|
||||||
|
import { demoConfig } from "../../../../src/fake_data/demo_config";
|
||||||
|
import { translationMetadata } from "../../../../src/resources/translations-metadata";
|
||||||
|
import { timeOptions } from "../../data/date-options";
|
||||||
|
|
||||||
@customElement("demo-date-time-time-weekday")
|
@customElement("demo-date-time-time-weekday")
|
||||||
export class DemoDateTimeTimeWeekday extends LitElement {
|
export class DemoDateTimeTimeWeekday extends LitElement {
|
||||||
|
@@ -1,19 +1,20 @@
|
|||||||
import { html, css, LitElement } from "lit";
|
import "@material/mwc-list/mwc-list";
|
||||||
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
|
import { formatTime } from "../../../../src/common/datetime/format_time";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import "../../../../src/components/ha-control-select";
|
import "../../../../src/components/ha-control-select";
|
||||||
import { translationMetadata } from "../../../../src/resources/translations-metadata";
|
|
||||||
import { formatTime } from "../../../../src/common/datetime/format_time";
|
|
||||||
import { timeOptions } from "../../data/date-options";
|
|
||||||
import { demoConfig } from "../../../../src/fake_data/demo_config";
|
|
||||||
import {
|
import {
|
||||||
|
DateFormat,
|
||||||
|
FirstWeekday,
|
||||||
FrontendLocaleData,
|
FrontendLocaleData,
|
||||||
NumberFormat,
|
NumberFormat,
|
||||||
TimeFormat,
|
TimeFormat,
|
||||||
DateFormat,
|
|
||||||
FirstWeekday,
|
|
||||||
TimeZone,
|
TimeZone,
|
||||||
} from "../../../../src/data/translation";
|
} from "../../../../src/data/translation";
|
||||||
|
import { demoConfig } from "../../../../src/fake_data/demo_config";
|
||||||
|
import { translationMetadata } from "../../../../src/resources/translations-metadata";
|
||||||
|
import { timeOptions } from "../../data/date-options";
|
||||||
|
|
||||||
@customElement("demo-date-time-time")
|
@customElement("demo-date-time-time")
|
||||||
export class DemoDateTimeTime extends LitElement {
|
export class DemoDateTimeTime extends LitElement {
|
||||||
|
@@ -65,15 +65,23 @@ const CONFIGS = [
|
|||||||
>> ...by using additional greater-than signs right next to each other...
|
>> ...by using additional greater-than signs right next to each other...
|
||||||
> > > ...or with spaces between arrows.
|
> > > ...or with spaces between arrows.
|
||||||
|
|
||||||
> **Warning** Hey there
|
> [!NOTE]
|
||||||
> This is a warning with a title
|
> This is a GitHub note alert
|
||||||
|
|
||||||
> **Note**
|
> [!TIP]
|
||||||
> This is a note
|
> This is a GitHub tip alert
|
||||||
|
|
||||||
> **Note**
|
> [!IMPORTANT]
|
||||||
> This is a multiline note
|
> This is a GitHub important alert
|
||||||
> Lorem ipsum...
|
|
||||||
|
> [!WARNING]
|
||||||
|
> This is a GitHub warning alert
|
||||||
|
|
||||||
|
> [!CAUTION]
|
||||||
|
> This is a GitHub caution alert
|
||||||
|
|
||||||
|
> [!TIP]
|
||||||
|
> - This is a list entry in GitHub tip alert
|
||||||
|
|
||||||
## Lists
|
## Lists
|
||||||
|
|
||||||
|
@@ -55,7 +55,7 @@ const CONFIGS = [
|
|||||||
];
|
];
|
||||||
|
|
||||||
@customElement("demo-lovelace-media-player-row")
|
@customElement("demo-lovelace-media-player-row")
|
||||||
class DemoHuiMediaPlayerRow extends LitElement {
|
export class DemoLovelaceMediaPlayerRow extends LitElement {
|
||||||
@query("#demos") private _demoRoot!: HTMLElement;
|
@query("#demos") private _demoRoot!: HTMLElement;
|
||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
@@ -73,6 +73,6 @@ class DemoHuiMediaPlayerRow extends LitElement {
|
|||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HTMLElementTagNameMap {
|
interface HTMLElementTagNameMap {
|
||||||
"demo-lovelace-media-player-rows": DemoHuiMediaPlayerRow;
|
"demo-lovelace-media-player-row": DemoLovelaceMediaPlayerRow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -35,6 +35,18 @@ const ENTITIES = [
|
|||||||
friendly_name: "Nest",
|
friendly_name: "Nest",
|
||||||
supported_features: 43,
|
supported_features: 43,
|
||||||
}),
|
}),
|
||||||
|
getEntity("climate", "sensibo", "fan_only", {
|
||||||
|
current_temperature: null,
|
||||||
|
temperature: null,
|
||||||
|
min_temp: 0,
|
||||||
|
max_temp: 1,
|
||||||
|
target_temp_step: 1,
|
||||||
|
hvac_modes: ["fan_only", "off"],
|
||||||
|
friendly_name: "Sensibo purifier",
|
||||||
|
fan_modes: ["low", "high"],
|
||||||
|
fan_mode: "low",
|
||||||
|
supported_features: 9,
|
||||||
|
}),
|
||||||
getEntity("climate", "unavailable", "unavailable", {
|
getEntity("climate", "unavailable", "unavailable", {
|
||||||
supported_features: 43,
|
supported_features: 43,
|
||||||
}),
|
}),
|
||||||
@@ -57,6 +69,23 @@ const CONFIGS = [
|
|||||||
entity: climate.nest
|
entity: climate.nest
|
||||||
`,
|
`,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
heading: "Fan only example",
|
||||||
|
config: `
|
||||||
|
- type: thermostat
|
||||||
|
entity: climate.sensibo
|
||||||
|
features:
|
||||||
|
- type: climate-hvac-modes
|
||||||
|
hvac_modes:
|
||||||
|
- fan_only
|
||||||
|
- 'off'
|
||||||
|
- type: climate-fan-modes
|
||||||
|
style: icons
|
||||||
|
fan_modes:
|
||||||
|
- low
|
||||||
|
- high
|
||||||
|
`,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
heading: "Unavailable",
|
heading: "Unavailable",
|
||||||
config: `
|
config: `
|
||||||
|
@@ -10,7 +10,6 @@ import { computeStateDisplay } from "../../../../src/common/entity/compute_state
|
|||||||
import "../../../../src/components/data-table/ha-data-table";
|
import "../../../../src/components/data-table/ha-data-table";
|
||||||
import type { DataTableColumnContainer } from "../../../../src/components/data-table/ha-data-table";
|
import type { DataTableColumnContainer } from "../../../../src/components/data-table/ha-data-table";
|
||||||
import "../../../../src/components/entity/state-badge";
|
import "../../../../src/components/entity/state-badge";
|
||||||
import "../../../../src/components/ha-chip";
|
|
||||||
import { provideHass } from "../../../../src/fake_data/provide_hass";
|
import { provideHass } from "../../../../src/fake_data/provide_hass";
|
||||||
import { HomeAssistant } from "../../../../src/types";
|
import { HomeAssistant } from "../../../../src/types";
|
||||||
|
|
||||||
@@ -54,6 +53,7 @@ const SENSOR_DEVICE_CLASSES = [
|
|||||||
"volatile_organic_compounds_parts",
|
"volatile_organic_compounds_parts",
|
||||||
"voltage",
|
"voltage",
|
||||||
"volume",
|
"volume",
|
||||||
|
"volume_flow_rate",
|
||||||
"water",
|
"water",
|
||||||
"weight",
|
"weight",
|
||||||
"wind_speed",
|
"wind_speed",
|
||||||
@@ -345,6 +345,7 @@ export class DemoEntityState extends LitElement {
|
|||||||
title: "Icon",
|
title: "Icon",
|
||||||
template: (entry) => html`
|
template: (entry) => html`
|
||||||
<state-badge
|
<state-badge
|
||||||
|
.hass=${hass}
|
||||||
.stateObj=${entry.stateObj}
|
.stateObj=${entry.stateObj}
|
||||||
.stateColor=${true}
|
.stateColor=${true}
|
||||||
></state-badge>
|
></state-badge>
|
||||||
|
@@ -2,7 +2,7 @@ import "@material/mwc-button";
|
|||||||
import { css, html, LitElement, TemplateResult } from "lit";
|
import { css, html, LitElement, TemplateResult } from "lit";
|
||||||
import { customElement } from "lit/decorators";
|
import { customElement } from "lit/decorators";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import { ActionHandlerEvent } from "../../../../src/data/lovelace";
|
import { ActionHandlerEvent } from "../../../../src/data/lovelace/action_handler";
|
||||||
import { actionHandler } from "../../../../src/panels/lovelace/common/directives/action-handler-directive";
|
import { actionHandler } from "../../../../src/panels/lovelace/common/directives/action-handler-directive";
|
||||||
|
|
||||||
@customElement("demo-misc-util-long-press")
|
@customElement("demo-misc-util-long-press")
|
||||||
@@ -59,3 +59,9 @@ export class DemoUtilLongPress extends LitElement {
|
|||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"demo-misc-util-long-press": DemoUtilLongPress;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -31,6 +31,21 @@ const ENTITIES = [
|
|||||||
max_temp: 30,
|
max_temp: 30,
|
||||||
supported_features: ClimateEntityFeature.TARGET_TEMPERATURE,
|
supported_features: ClimateEntityFeature.TARGET_TEMPERATURE,
|
||||||
}),
|
}),
|
||||||
|
getEntity("climate", "fan", "fan_only", {
|
||||||
|
friendly_name: "Basic fan",
|
||||||
|
hvac_modes: ["fan_only", "off"],
|
||||||
|
hvac_mode: "fan_only",
|
||||||
|
fan_modes: ["low", "high"],
|
||||||
|
fan_mode: "low",
|
||||||
|
current_temperature: null,
|
||||||
|
temperature: null,
|
||||||
|
min_temp: 0,
|
||||||
|
max_temp: 1,
|
||||||
|
target_temp_step: 1,
|
||||||
|
supported_features:
|
||||||
|
// eslint-disable-next-line no-bitwise
|
||||||
|
ClimateEntityFeature.TARGET_TEMPERATURE | ClimateEntityFeature.FAN_MODE,
|
||||||
|
}),
|
||||||
getEntity("climate", "hvac", "auto", {
|
getEntity("climate", "hvac", "auto", {
|
||||||
friendly_name: "Basic hvac",
|
friendly_name: "Basic hvac",
|
||||||
hvac_modes: ["auto", "off"],
|
hvac_modes: ["auto", "off"],
|
||||||
@@ -77,7 +92,7 @@ const ENTITIES = [
|
|||||||
|
|
||||||
@customElement("demo-more-info-climate")
|
@customElement("demo-more-info-climate")
|
||||||
class DemoMoreInfoClimate extends LitElement {
|
class DemoMoreInfoClimate extends LitElement {
|
||||||
@property() public hass!: MockHomeAssistant;
|
@property({ attribute: false }) public hass!: MockHomeAssistant;
|
||||||
|
|
||||||
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
||||||
|
|
||||||
|
@@ -141,7 +141,7 @@ const ENTITIES = [
|
|||||||
|
|
||||||
@customElement("demo-more-info-cover")
|
@customElement("demo-more-info-cover")
|
||||||
class DemoMoreInfoCover extends LitElement {
|
class DemoMoreInfoCover extends LitElement {
|
||||||
@property() public hass!: MockHomeAssistant;
|
@property({ attribute: false }) public hass!: MockHomeAssistant;
|
||||||
|
|
||||||
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
||||||
|
|
||||||
|
@@ -29,7 +29,7 @@ const ENTITIES = [
|
|||||||
|
|
||||||
@customElement("demo-more-info-humidifier")
|
@customElement("demo-more-info-humidifier")
|
||||||
class DemoMoreInfoHumidifier extends LitElement {
|
class DemoMoreInfoHumidifier extends LitElement {
|
||||||
@property() public hass!: MockHomeAssistant;
|
@property({ attribute: false }) public hass!: MockHomeAssistant;
|
||||||
|
|
||||||
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
||||||
|
|
||||||
|
@@ -32,7 +32,7 @@ const ENTITIES = [
|
|||||||
|
|
||||||
@customElement("demo-more-info-input-number")
|
@customElement("demo-more-info-input-number")
|
||||||
class DemoMoreInfoInputNumber extends LitElement {
|
class DemoMoreInfoInputNumber extends LitElement {
|
||||||
@property() public hass!: MockHomeAssistant;
|
@property({ attribute: false }) public hass!: MockHomeAssistant;
|
||||||
|
|
||||||
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
||||||
|
|
||||||
|
3
gallery/src/pages/more-info/input-text.markdown
Normal file
3
gallery/src/pages/more-info/input-text.markdown
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
title: Input Text
|
||||||
|
---
|
46
gallery/src/pages/more-info/input-text.ts
Normal file
46
gallery/src/pages/more-info/input-text.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import { html, LitElement, PropertyValues, TemplateResult } from "lit";
|
||||||
|
import { customElement, property, query } from "lit/decorators";
|
||||||
|
import "../../../../src/components/ha-card";
|
||||||
|
import "../../../../src/dialogs/more-info/more-info-content";
|
||||||
|
import { getEntity } from "../../../../src/fake_data/entity";
|
||||||
|
import {
|
||||||
|
MockHomeAssistant,
|
||||||
|
provideHass,
|
||||||
|
} from "../../../../src/fake_data/provide_hass";
|
||||||
|
import "../../components/demo-more-infos";
|
||||||
|
|
||||||
|
const ENTITIES = [
|
||||||
|
getEntity("input_text", "text", "Inspiration", {
|
||||||
|
friendly_name: "Text",
|
||||||
|
mode: "text",
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
||||||
|
@customElement("demo-more-info-input-text")
|
||||||
|
class DemoMoreInfoInputText extends LitElement {
|
||||||
|
@property({ attribute: false }) public hass!: MockHomeAssistant;
|
||||||
|
|
||||||
|
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
||||||
|
|
||||||
|
protected render(): TemplateResult {
|
||||||
|
return html`
|
||||||
|
<demo-more-infos
|
||||||
|
.hass=${this.hass}
|
||||||
|
.entities=${ENTITIES.map((ent) => ent.entityId)}
|
||||||
|
></demo-more-infos>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected firstUpdated(changedProperties: PropertyValues) {
|
||||||
|
super.firstUpdated(changedProperties);
|
||||||
|
const hass = provideHass(this._demoRoot);
|
||||||
|
hass.updateTranslations(null, "en");
|
||||||
|
hass.addEntities(ENTITIES);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"demo-more-info-input-text": DemoMoreInfoInputText;
|
||||||
|
}
|
||||||
|
}
|
@@ -140,7 +140,7 @@ const ENTITIES = [
|
|||||||
|
|
||||||
@customElement("demo-more-info-light")
|
@customElement("demo-more-info-light")
|
||||||
class DemoMoreInfoLight extends LitElement {
|
class DemoMoreInfoLight extends LitElement {
|
||||||
@property() public hass!: MockHomeAssistant;
|
@property({ attribute: false }) public hass!: MockHomeAssistant;
|
||||||
|
|
||||||
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
||||||
|
|
||||||
|
3
gallery/src/pages/more-info/lock.markdown
Normal file
3
gallery/src/pages/more-info/lock.markdown
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
title: Lock
|
||||||
|
---
|
49
gallery/src/pages/more-info/lock.ts
Normal file
49
gallery/src/pages/more-info/lock.ts
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
import { html, LitElement, PropertyValues, TemplateResult } from "lit";
|
||||||
|
import { customElement, property, query } from "lit/decorators";
|
||||||
|
import "../../../../src/components/ha-card";
|
||||||
|
import "../../../../src/dialogs/more-info/more-info-content";
|
||||||
|
import { getEntity } from "../../../../src/fake_data/entity";
|
||||||
|
import {
|
||||||
|
MockHomeAssistant,
|
||||||
|
provideHass,
|
||||||
|
} from "../../../../src/fake_data/provide_hass";
|
||||||
|
import "../../components/demo-more-infos";
|
||||||
|
|
||||||
|
const ENTITIES = [
|
||||||
|
getEntity("lock", "lock", "locked", {
|
||||||
|
friendly_name: "Lock",
|
||||||
|
device_class: "lock",
|
||||||
|
}),
|
||||||
|
getEntity("lock", "unavailable", "unavailable", {
|
||||||
|
friendly_name: "Unavailable lock",
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
||||||
|
@customElement("demo-more-info-lock")
|
||||||
|
class DemoMoreInfoLock extends LitElement {
|
||||||
|
@property({ attribute: false }) public hass!: MockHomeAssistant;
|
||||||
|
|
||||||
|
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
||||||
|
|
||||||
|
protected render(): TemplateResult {
|
||||||
|
return html`
|
||||||
|
<demo-more-infos
|
||||||
|
.hass=${this.hass}
|
||||||
|
.entities=${ENTITIES.map((ent) => ent.entityId)}
|
||||||
|
></demo-more-infos>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected firstUpdated(changedProperties: PropertyValues) {
|
||||||
|
super.firstUpdated(changedProperties);
|
||||||
|
const hass = provideHass(this._demoRoot);
|
||||||
|
hass.updateTranslations(null, "en");
|
||||||
|
hass.addEntities(ENTITIES);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"demo-more-info-lock": DemoMoreInfoLock;
|
||||||
|
}
|
||||||
|
}
|
3
gallery/src/pages/more-info/media-player.markdown
Normal file
3
gallery/src/pages/more-info/media-player.markdown
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
title: Media Player
|
||||||
|
---
|
41
gallery/src/pages/more-info/media-player.ts
Normal file
41
gallery/src/pages/more-info/media-player.ts
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
import { html, LitElement, PropertyValues, TemplateResult } from "lit";
|
||||||
|
import { customElement, property, query } from "lit/decorators";
|
||||||
|
import "../../../../src/components/ha-card";
|
||||||
|
import "../../../../src/dialogs/more-info/more-info-content";
|
||||||
|
import {
|
||||||
|
MockHomeAssistant,
|
||||||
|
provideHass,
|
||||||
|
} from "../../../../src/fake_data/provide_hass";
|
||||||
|
import "../../components/demo-more-infos";
|
||||||
|
import { createMediaPlayerEntities } from "../../data/media_players";
|
||||||
|
|
||||||
|
const ENTITIES = createMediaPlayerEntities();
|
||||||
|
|
||||||
|
@customElement("demo-more-info-media-player")
|
||||||
|
class DemoMoreInfoMediaPlayer extends LitElement {
|
||||||
|
@property({ attribute: false }) public hass!: MockHomeAssistant;
|
||||||
|
|
||||||
|
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
||||||
|
|
||||||
|
protected render(): TemplateResult {
|
||||||
|
return html`
|
||||||
|
<demo-more-infos
|
||||||
|
.hass=${this.hass}
|
||||||
|
.entities=${ENTITIES.map((ent) => ent.entityId)}
|
||||||
|
></demo-more-infos>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected firstUpdated(changedProperties: PropertyValues) {
|
||||||
|
super.firstUpdated(changedProperties);
|
||||||
|
const hass = provideHass(this._demoRoot);
|
||||||
|
hass.updateTranslations(null, "en");
|
||||||
|
hass.addEntities(ENTITIES);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"demo-more-info-media-player": DemoMoreInfoMediaPlayer;
|
||||||
|
}
|
||||||
|
}
|
3
gallery/src/pages/more-info/number.markdown
Normal file
3
gallery/src/pages/more-info/number.markdown
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
title: Number
|
||||||
|
---
|
78
gallery/src/pages/more-info/number.ts
Normal file
78
gallery/src/pages/more-info/number.ts
Normal file
@@ -0,0 +1,78 @@
|
|||||||
|
import { html, LitElement, PropertyValues, TemplateResult } from "lit";
|
||||||
|
import { customElement, property, query } from "lit/decorators";
|
||||||
|
import "../../../../src/components/ha-card";
|
||||||
|
import "../../../../src/dialogs/more-info/more-info-content";
|
||||||
|
import { getEntity } from "../../../../src/fake_data/entity";
|
||||||
|
import {
|
||||||
|
MockHomeAssistant,
|
||||||
|
provideHass,
|
||||||
|
} from "../../../../src/fake_data/provide_hass";
|
||||||
|
import "../../components/demo-more-infos";
|
||||||
|
|
||||||
|
const ENTITIES = [
|
||||||
|
getEntity("number", "box1", 0, {
|
||||||
|
friendly_name: "Box1",
|
||||||
|
min: 0,
|
||||||
|
max: 100,
|
||||||
|
step: 1,
|
||||||
|
initial: 0,
|
||||||
|
mode: "box",
|
||||||
|
unit_of_measurement: "items",
|
||||||
|
}),
|
||||||
|
getEntity("number", "slider1", 0, {
|
||||||
|
friendly_name: "Slider1",
|
||||||
|
min: 0,
|
||||||
|
max: 100,
|
||||||
|
step: 1,
|
||||||
|
initial: 0,
|
||||||
|
mode: "slider",
|
||||||
|
unit_of_measurement: "items",
|
||||||
|
}),
|
||||||
|
getEntity("number", "auto1", 0, {
|
||||||
|
friendly_name: "Auto1",
|
||||||
|
min: 0,
|
||||||
|
max: 1000,
|
||||||
|
step: 1,
|
||||||
|
initial: 0,
|
||||||
|
mode: "auto",
|
||||||
|
unit_of_measurement: "items",
|
||||||
|
}),
|
||||||
|
getEntity("number", "auto2", 0, {
|
||||||
|
friendly_name: "Auto2",
|
||||||
|
min: 0,
|
||||||
|
max: 100,
|
||||||
|
step: 1,
|
||||||
|
initial: 0,
|
||||||
|
mode: "auto",
|
||||||
|
unit_of_measurement: "items",
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
||||||
|
@customElement("demo-more-info-number")
|
||||||
|
class DemoMoreInfoNumber extends LitElement {
|
||||||
|
@property({ attribute: false }) public hass!: MockHomeAssistant;
|
||||||
|
|
||||||
|
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
||||||
|
|
||||||
|
protected render(): TemplateResult {
|
||||||
|
return html`
|
||||||
|
<demo-more-infos
|
||||||
|
.hass=${this.hass}
|
||||||
|
.entities=${ENTITIES.map((ent) => ent.entityId)}
|
||||||
|
></demo-more-infos>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected firstUpdated(changedProperties: PropertyValues) {
|
||||||
|
super.firstUpdated(changedProperties);
|
||||||
|
const hass = provideHass(this._demoRoot);
|
||||||
|
hass.updateTranslations(null, "en");
|
||||||
|
hass.addEntities(ENTITIES);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"demo-more-info-number": DemoMoreInfoNumber;
|
||||||
|
}
|
||||||
|
}
|
3
gallery/src/pages/more-info/scene.markdown
Normal file
3
gallery/src/pages/more-info/scene.markdown
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
title: Scene
|
||||||
|
---
|
49
gallery/src/pages/more-info/scene.ts
Normal file
49
gallery/src/pages/more-info/scene.ts
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
import { html, LitElement, PropertyValues, TemplateResult } from "lit";
|
||||||
|
import { customElement, property, query } from "lit/decorators";
|
||||||
|
import "../../../../src/components/ha-card";
|
||||||
|
import "../../../../src/dialogs/more-info/more-info-content";
|
||||||
|
import { getEntity } from "../../../../src/fake_data/entity";
|
||||||
|
import {
|
||||||
|
MockHomeAssistant,
|
||||||
|
provideHass,
|
||||||
|
} from "../../../../src/fake_data/provide_hass";
|
||||||
|
import "../../components/demo-more-infos";
|
||||||
|
|
||||||
|
const ENTITIES = [
|
||||||
|
getEntity("scene", "romantic_lights", "scening", {
|
||||||
|
entity_id: ["light.bed_light", "light.ceiling_lights"],
|
||||||
|
friendly_name: "Romantic Scene",
|
||||||
|
}),
|
||||||
|
getEntity("scene", "unavailable", "unavailable", {
|
||||||
|
friendly_name: "Romantic Scene",
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
||||||
|
@customElement("demo-more-info-scene")
|
||||||
|
class DemoMoreInfoScene extends LitElement {
|
||||||
|
@property({ attribute: false }) public hass!: MockHomeAssistant;
|
||||||
|
|
||||||
|
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
||||||
|
|
||||||
|
protected render(): TemplateResult {
|
||||||
|
return html`
|
||||||
|
<demo-more-infos
|
||||||
|
.hass=${this.hass}
|
||||||
|
.entities=${ENTITIES.map((ent) => ent.entityId)}
|
||||||
|
></demo-more-infos>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected firstUpdated(changedProperties: PropertyValues) {
|
||||||
|
super.firstUpdated(changedProperties);
|
||||||
|
const hass = provideHass(this._demoRoot);
|
||||||
|
hass.updateTranslations(null, "en");
|
||||||
|
hass.addEntities(ENTITIES);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"demo-more-info-scene": DemoMoreInfoScene;
|
||||||
|
}
|
||||||
|
}
|
3
gallery/src/pages/more-info/timer.markdown
Normal file
3
gallery/src/pages/more-info/timer.markdown
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
title: Timer
|
||||||
|
---
|
46
gallery/src/pages/more-info/timer.ts
Normal file
46
gallery/src/pages/more-info/timer.ts
Normal file
@@ -0,0 +1,46 @@
|
|||||||
|
import { html, LitElement, PropertyValues, TemplateResult } from "lit";
|
||||||
|
import { customElement, property, query } from "lit/decorators";
|
||||||
|
import "../../../../src/components/ha-card";
|
||||||
|
import "../../../../src/dialogs/more-info/more-info-content";
|
||||||
|
import { getEntity } from "../../../../src/fake_data/entity";
|
||||||
|
import {
|
||||||
|
MockHomeAssistant,
|
||||||
|
provideHass,
|
||||||
|
} from "../../../../src/fake_data/provide_hass";
|
||||||
|
import "../../components/demo-more-infos";
|
||||||
|
|
||||||
|
const ENTITIES = [
|
||||||
|
getEntity("timer", "timer", "idle", {
|
||||||
|
friendly_name: "Timer",
|
||||||
|
duration: "0:05:00",
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
||||||
|
@customElement("demo-more-info-timer")
|
||||||
|
class DemoMoreInfoTimer extends LitElement {
|
||||||
|
@property({ attribute: false }) public hass!: MockHomeAssistant;
|
||||||
|
|
||||||
|
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
||||||
|
|
||||||
|
protected render(): TemplateResult {
|
||||||
|
return html`
|
||||||
|
<demo-more-infos
|
||||||
|
.hass=${this.hass}
|
||||||
|
.entities=${ENTITIES.map((ent) => ent.entityId)}
|
||||||
|
></demo-more-infos>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected firstUpdated(changedProperties: PropertyValues) {
|
||||||
|
super.firstUpdated(changedProperties);
|
||||||
|
const hass = provideHass(this._demoRoot);
|
||||||
|
hass.updateTranslations(null, "en");
|
||||||
|
hass.addEntities(ENTITIES);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"demo-more-info-timer": DemoMoreInfoTimer;
|
||||||
|
}
|
||||||
|
}
|
@@ -1,12 +1,6 @@
|
|||||||
import { html, LitElement, PropertyValues, TemplateResult } from "lit";
|
import { html, LitElement, PropertyValues, TemplateResult } from "lit";
|
||||||
import { customElement, property, query } from "lit/decorators";
|
import { customElement, property, query } from "lit/decorators";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
import {
|
|
||||||
UPDATE_SUPPORT_BACKUP,
|
|
||||||
UPDATE_SUPPORT_PROGRESS,
|
|
||||||
UPDATE_SUPPORT_INSTALL,
|
|
||||||
UPDATE_SUPPORT_RELEASE_NOTES,
|
|
||||||
} from "../../../../src/data/update";
|
|
||||||
import "../../../../src/dialogs/more-info/more-info-content";
|
import "../../../../src/dialogs/more-info/more-info-content";
|
||||||
import { getEntity } from "../../../../src/fake_data/entity";
|
import { getEntity } from "../../../../src/fake_data/entity";
|
||||||
import {
|
import {
|
||||||
@@ -15,13 +9,14 @@ import {
|
|||||||
} from "../../../../src/fake_data/provide_hass";
|
} from "../../../../src/fake_data/provide_hass";
|
||||||
import "../../components/demo-more-infos";
|
import "../../components/demo-more-infos";
|
||||||
import { LONG_TEXT } from "../../data/text";
|
import { LONG_TEXT } from "../../data/text";
|
||||||
|
import { UpdateEntityFeature } from "../../../../src/data/update";
|
||||||
|
|
||||||
const base_attributes = {
|
const base_attributes = {
|
||||||
title: "Awesome",
|
title: "Awesome",
|
||||||
installed_version: "1.2.2",
|
installed_version: "1.2.2",
|
||||||
latest_version: "1.2.3",
|
latest_version: "1.2.3",
|
||||||
release_url: "https://home-assistant.io",
|
release_url: "https://home-assistant.io",
|
||||||
supported_features: UPDATE_SUPPORT_INSTALL,
|
supported_features: UpdateEntityFeature.INSTALL,
|
||||||
skipped_version: null,
|
skipped_version: null,
|
||||||
in_progress: false,
|
in_progress: false,
|
||||||
release_summary:
|
release_summary:
|
||||||
@@ -61,7 +56,7 @@ const ENTITIES = [
|
|||||||
getEntity("update", "update7", "on", {
|
getEntity("update", "update7", "on", {
|
||||||
...base_attributes,
|
...base_attributes,
|
||||||
supported_features:
|
supported_features:
|
||||||
base_attributes.supported_features + UPDATE_SUPPORT_BACKUP,
|
base_attributes.supported_features + UpdateEntityFeature.BACKUP,
|
||||||
friendly_name: "With backup support",
|
friendly_name: "With backup support",
|
||||||
}),
|
}),
|
||||||
getEntity("update", "update8", "on", {
|
getEntity("update", "update8", "on", {
|
||||||
@@ -73,21 +68,21 @@ const ENTITIES = [
|
|||||||
...base_attributes,
|
...base_attributes,
|
||||||
in_progress: 25,
|
in_progress: 25,
|
||||||
supported_features:
|
supported_features:
|
||||||
base_attributes.supported_features + UPDATE_SUPPORT_PROGRESS,
|
base_attributes.supported_features + UpdateEntityFeature.PROGRESS,
|
||||||
friendly_name: "With 25 in_progress",
|
friendly_name: "With 25 in_progress",
|
||||||
}),
|
}),
|
||||||
getEntity("update", "update10", "on", {
|
getEntity("update", "update10", "on", {
|
||||||
...base_attributes,
|
...base_attributes,
|
||||||
in_progress: 50,
|
in_progress: 50,
|
||||||
supported_features:
|
supported_features:
|
||||||
base_attributes.supported_features + UPDATE_SUPPORT_PROGRESS,
|
base_attributes.supported_features + UpdateEntityFeature.PROGRESS,
|
||||||
friendly_name: "With 50 in_progress",
|
friendly_name: "With 50 in_progress",
|
||||||
}),
|
}),
|
||||||
getEntity("update", "update11", "on", {
|
getEntity("update", "update11", "on", {
|
||||||
...base_attributes,
|
...base_attributes,
|
||||||
in_progress: 75,
|
in_progress: 75,
|
||||||
supported_features:
|
supported_features:
|
||||||
base_attributes.supported_features + UPDATE_SUPPORT_PROGRESS,
|
base_attributes.supported_features + UpdateEntityFeature.PROGRESS,
|
||||||
friendly_name: "With 75 in_progress",
|
friendly_name: "With 75 in_progress",
|
||||||
}),
|
}),
|
||||||
getEntity("update", "update12", "unavailable", {
|
getEntity("update", "update12", "unavailable", {
|
||||||
@@ -114,19 +109,19 @@ const ENTITIES = [
|
|||||||
...base_attributes,
|
...base_attributes,
|
||||||
friendly_name: "Update with release notes",
|
friendly_name: "Update with release notes",
|
||||||
supported_features:
|
supported_features:
|
||||||
base_attributes.supported_features + UPDATE_SUPPORT_RELEASE_NOTES,
|
base_attributes.supported_features + UpdateEntityFeature.RELEASE_NOTES,
|
||||||
}),
|
}),
|
||||||
getEntity("update", "update17", "off", {
|
getEntity("update", "update17", "off", {
|
||||||
...base_attributes,
|
...base_attributes,
|
||||||
friendly_name: "Update with release notes error",
|
friendly_name: "Update with release notes error",
|
||||||
supported_features:
|
supported_features:
|
||||||
base_attributes.supported_features + UPDATE_SUPPORT_RELEASE_NOTES,
|
base_attributes.supported_features + UpdateEntityFeature.RELEASE_NOTES,
|
||||||
}),
|
}),
|
||||||
getEntity("update", "update18", "off", {
|
getEntity("update", "update18", "off", {
|
||||||
...base_attributes,
|
...base_attributes,
|
||||||
friendly_name: "Update with release notes loading",
|
friendly_name: "Update with release notes loading",
|
||||||
supported_features:
|
supported_features:
|
||||||
base_attributes.supported_features + UPDATE_SUPPORT_RELEASE_NOTES,
|
base_attributes.supported_features + UpdateEntityFeature.RELEASE_NOTES,
|
||||||
}),
|
}),
|
||||||
getEntity("update", "update19", "on", {
|
getEntity("update", "update19", "on", {
|
||||||
...base_attributes,
|
...base_attributes,
|
||||||
@@ -142,15 +137,16 @@ const ENTITIES = [
|
|||||||
getEntity("update", "update21", "on", {
|
getEntity("update", "update21", "on", {
|
||||||
...base_attributes,
|
...base_attributes,
|
||||||
in_progress: true,
|
in_progress: true,
|
||||||
friendly_name: "Update with in_progress true and UPDATE_SUPPORT_PROGRESS",
|
friendly_name:
|
||||||
|
"Update with in_progress true and UpdateEntityFeature.PROGRESS",
|
||||||
supported_features:
|
supported_features:
|
||||||
base_attributes.supported_features + UPDATE_SUPPORT_PROGRESS,
|
base_attributes.supported_features + UpdateEntityFeature.PROGRESS,
|
||||||
}),
|
}),
|
||||||
];
|
];
|
||||||
|
|
||||||
@customElement("demo-more-info-update")
|
@customElement("demo-more-info-update")
|
||||||
class DemoMoreInfoUpdate extends LitElement {
|
class DemoMoreInfoUpdate extends LitElement {
|
||||||
@property() public hass!: MockHomeAssistant;
|
@property({ attribute: false }) public hass!: MockHomeAssistant;
|
||||||
|
|
||||||
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
||||||
|
|
||||||
|
3
gallery/src/pages/more-info/vacuum.markdown
Normal file
3
gallery/src/pages/more-info/vacuum.markdown
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
---
|
||||||
|
title: Vacuum
|
||||||
|
---
|
50
gallery/src/pages/more-info/vacuum.ts
Normal file
50
gallery/src/pages/more-info/vacuum.ts
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
import { html, LitElement, PropertyValues, TemplateResult } from "lit";
|
||||||
|
import { customElement, property, query } from "lit/decorators";
|
||||||
|
import "../../../../src/components/ha-card";
|
||||||
|
import "../../../../src/dialogs/more-info/more-info-content";
|
||||||
|
import { getEntity } from "../../../../src/fake_data/entity";
|
||||||
|
import {
|
||||||
|
MockHomeAssistant,
|
||||||
|
provideHass,
|
||||||
|
} from "../../../../src/fake_data/provide_hass";
|
||||||
|
import "../../components/demo-more-infos";
|
||||||
|
import { VacuumEntityFeature } from "../../../../src/data/vacuum";
|
||||||
|
|
||||||
|
const ENTITIES = [
|
||||||
|
getEntity("vacuum", "first_floor_vacuum", "docked", {
|
||||||
|
friendly_name: "First floor vacuum",
|
||||||
|
supported_features:
|
||||||
|
VacuumEntityFeature.START +
|
||||||
|
VacuumEntityFeature.STOP +
|
||||||
|
VacuumEntityFeature.RETURN_HOME,
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
|
||||||
|
@customElement("demo-more-info-vacuum")
|
||||||
|
class DemoMoreInfoVacuum extends LitElement {
|
||||||
|
@property({ attribute: false }) public hass!: MockHomeAssistant;
|
||||||
|
|
||||||
|
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
||||||
|
|
||||||
|
protected render(): TemplateResult {
|
||||||
|
return html`
|
||||||
|
<demo-more-infos
|
||||||
|
.hass=${this.hass}
|
||||||
|
.entities=${ENTITIES.map((ent) => ent.entityId)}
|
||||||
|
></demo-more-infos>
|
||||||
|
`;
|
||||||
|
}
|
||||||
|
|
||||||
|
protected firstUpdated(changedProperties: PropertyValues) {
|
||||||
|
super.firstUpdated(changedProperties);
|
||||||
|
const hass = provideHass(this._demoRoot);
|
||||||
|
hass.updateTranslations(null, "en");
|
||||||
|
hass.addEntities(ENTITIES);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"demo-more-info-vacuum": DemoMoreInfoVacuum;
|
||||||
|
}
|
||||||
|
}
|
@@ -42,7 +42,7 @@ const ENTITIES = [
|
|||||||
|
|
||||||
@customElement("demo-more-info-water-heater")
|
@customElement("demo-more-info-water-heater")
|
||||||
class DemoMoreInfoWaterHeater extends LitElement {
|
class DemoMoreInfoWaterHeater extends LitElement {
|
||||||
@property() public hass!: MockHomeAssistant;
|
@property({ attribute: false }) public hass!: MockHomeAssistant;
|
||||||
|
|
||||||
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
@query("demo-more-infos") private _demoRoot!: HTMLElement;
|
||||||
|
|
||||||
|
@@ -49,11 +49,9 @@ export class HassioAddonRepositoryEl extends LitElement {
|
|||||||
return html`
|
return html`
|
||||||
<div class="content">
|
<div class="content">
|
||||||
<p class="description">
|
<p class="description">
|
||||||
${this.supervisor.localize(
|
${this.supervisor.localize("store.no_results_found", {
|
||||||
"store.no_results_found",
|
repository: repo.name,
|
||||||
"repository",
|
})}
|
||||||
repo.name
|
|
||||||
)}
|
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
@@ -86,15 +84,15 @@ export class HassioAddonRepositoryEl extends LitElement {
|
|||||||
)
|
)
|
||||||
: this.supervisor.localize("addon.state.installed")
|
: this.supervisor.localize("addon.state.installed")
|
||||||
: addon.available
|
: addon.available
|
||||||
? this.supervisor.localize("addon.state.not_installed")
|
? this.supervisor.localize("addon.state.not_installed")
|
||||||
: this.supervisor.localize("addon.state.not_available")}
|
: this.supervisor.localize("addon.state.not_available")}
|
||||||
.iconClass=${addon.installed
|
.iconClass=${addon.installed
|
||||||
? addon.update_available
|
? addon.update_available
|
||||||
? "update"
|
? "update"
|
||||||
: "installed"
|
: "installed"
|
||||||
: !addon.available
|
: !addon.available
|
||||||
? "not_available"
|
? "not_available"
|
||||||
: ""}
|
: ""}
|
||||||
.iconImage=${atLeastVersion(
|
.iconImage=${atLeastVersion(
|
||||||
this.hass.config.version,
|
this.hass.config.version,
|
||||||
0,
|
0,
|
||||||
@@ -108,8 +106,8 @@ export class HassioAddonRepositoryEl extends LitElement {
|
|||||||
? "update"
|
? "update"
|
||||||
: "installed"
|
: "installed"
|
||||||
: !addon.available
|
: !addon.available
|
||||||
? "unavailable"
|
? "unavailable"
|
||||||
: ""}
|
: ""}
|
||||||
></hassio-card-content>
|
></hassio-card-content>
|
||||||
</div>
|
</div>
|
||||||
</ha-card>
|
</ha-card>
|
||||||
@@ -142,3 +140,9 @@ export class HassioAddonRepositoryEl extends LitElement {
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"hassio-addon-repository": HassioAddonRepositoryEl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -56,7 +56,7 @@ export class HassioAddonStore extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public supervisor!: Supervisor;
|
@property({ attribute: false }) public supervisor!: Supervisor;
|
||||||
|
|
||||||
@property({ type: Boolean }) public narrow!: boolean;
|
@property({ type: Boolean }) public narrow = false;
|
||||||
|
|
||||||
@property({ attribute: false }) public route!: Route;
|
@property({ attribute: false }) public route!: Route;
|
||||||
|
|
||||||
@@ -243,8 +243,16 @@ export class HassioAddonStore extends LitElement {
|
|||||||
}
|
}
|
||||||
.advanced a {
|
.advanced a {
|
||||||
margin-left: 0.5em;
|
margin-left: 0.5em;
|
||||||
|
margin-inline-start: 0.5em;
|
||||||
|
margin-inline-end: initial;
|
||||||
color: var(--primary-color);
|
color: var(--primary-color);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
declare global {
|
||||||
|
interface HTMLElementTagNameMap {
|
||||||
|
"hassio-addon-store": HassioAddonStore;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@@ -20,7 +20,7 @@ class HassioAddonConfigDashboard extends LitElement {
|
|||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (!this.addon) {
|
if (!this.addon) {
|
||||||
return html`<ha-circular-progress active></ha-circular-progress>`;
|
return html`<ha-circular-progress indeterminate></ha-circular-progress>`;
|
||||||
}
|
}
|
||||||
const hasConfiguration =
|
const hasConfiguration =
|
||||||
(this.addon.options && Object.keys(this.addon.options).length) ||
|
(this.addon.options && Object.keys(this.addon.options).length) ||
|
||||||
|
@@ -65,9 +65,9 @@ class HassioAddonConfig extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public supervisor!: Supervisor;
|
@property({ attribute: false }) public supervisor!: Supervisor;
|
||||||
|
|
||||||
@property({ type: Boolean }) private _configHasChanged = false;
|
@state() private _configHasChanged = false;
|
||||||
|
|
||||||
@property({ type: Boolean }) private _valid = true;
|
@state() private _valid = true;
|
||||||
|
|
||||||
@state() private _canShowSchema = false;
|
@state() private _canShowSchema = false;
|
||||||
|
|
||||||
@@ -104,50 +104,50 @@ class HassioAddonConfig extends LitElement {
|
|||||||
selector: { select: { options: entry.options } },
|
selector: { select: { options: entry.options } },
|
||||||
}
|
}
|
||||||
: entry.type === "string"
|
: entry.type === "string"
|
||||||
? entry.multiple
|
? entry.multiple
|
||||||
? {
|
? {
|
||||||
name: entry.name,
|
name: entry.name,
|
||||||
required: entry.required,
|
required: entry.required,
|
||||||
selector: {
|
selector: {
|
||||||
select: { options: [], multiple: true, custom_value: true },
|
select: { options: [], multiple: true, custom_value: true },
|
||||||
},
|
|
||||||
}
|
|
||||||
: {
|
|
||||||
name: entry.name,
|
|
||||||
required: entry.required,
|
|
||||||
selector: {
|
|
||||||
text: {
|
|
||||||
type:
|
|
||||||
entry.format || MASKED_FIELDS.includes(entry.name)
|
|
||||||
? "password"
|
|
||||||
: "text",
|
|
||||||
},
|
},
|
||||||
},
|
}
|
||||||
}
|
: {
|
||||||
: entry.type === "boolean"
|
name: entry.name,
|
||||||
? {
|
required: entry.required,
|
||||||
name: entry.name,
|
selector: {
|
||||||
required: entry.required,
|
text: {
|
||||||
selector: { boolean: {} },
|
type:
|
||||||
}
|
entry.format || MASKED_FIELDS.includes(entry.name)
|
||||||
: entry.type === "schema"
|
? "password"
|
||||||
? {
|
: "text",
|
||||||
name: entry.name,
|
},
|
||||||
required: entry.required,
|
},
|
||||||
selector: { object: {} },
|
}
|
||||||
}
|
: entry.type === "boolean"
|
||||||
: entry.type === "float" || entry.type === "integer"
|
? {
|
||||||
? {
|
name: entry.name,
|
||||||
name: entry.name,
|
required: entry.required,
|
||||||
required: entry.required,
|
selector: { boolean: {} },
|
||||||
selector: {
|
}
|
||||||
number: {
|
: entry.type === "schema"
|
||||||
mode: "box",
|
? {
|
||||||
step: entry.type === "float" ? "any" : undefined,
|
name: entry.name,
|
||||||
},
|
required: entry.required,
|
||||||
},
|
selector: { object: {} },
|
||||||
}
|
}
|
||||||
: entry
|
: entry.type === "float" || entry.type === "integer"
|
||||||
|
? {
|
||||||
|
name: entry.name,
|
||||||
|
required: entry.required,
|
||||||
|
selector: {
|
||||||
|
number: {
|
||||||
|
mode: "box",
|
||||||
|
step: entry.type === "float" ? "any" : undefined,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
|
: entry
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -340,11 +340,9 @@ class HassioAddonConfig extends LitElement {
|
|||||||
};
|
};
|
||||||
fireEvent(this, "hass-api-called", eventdata);
|
fireEvent(this, "hass-api-called", eventdata);
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize("addon.failed_to_reset", {
|
||||||
"addon.failed_to_reset",
|
error: extractApiErrorMessage(err),
|
||||||
"error",
|
});
|
||||||
extractApiErrorMessage(err)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
button.progress = false;
|
button.progress = false;
|
||||||
}
|
}
|
||||||
@@ -381,11 +379,9 @@ class HassioAddonConfig extends LitElement {
|
|||||||
await suggestAddonRestart(this, this.hass, this.supervisor, this.addon);
|
await suggestAddonRestart(this, this.hass, this.supervisor, this.addon);
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize("addon.failed_to_save", {
|
||||||
"addon.failed_to_save",
|
error: extractApiErrorMessage(err),
|
||||||
"error",
|
});
|
||||||
extractApiErrorMessage(err)
|
|
||||||
);
|
|
||||||
eventdata.success = false;
|
eventdata.success = false;
|
||||||
}
|
}
|
||||||
button.progress = false;
|
button.progress = false;
|
||||||
|
@@ -180,11 +180,9 @@ class HassioAddonNetwork extends LitElement {
|
|||||||
await suggestAddonRestart(this, this.hass, this.supervisor, this.addon);
|
await suggestAddonRestart(this, this.hass, this.supervisor, this.addon);
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize("addon.failed_to_reset", {
|
||||||
"addon.failed_to_reset",
|
error: extractApiErrorMessage(err),
|
||||||
"error",
|
});
|
||||||
extractApiErrorMessage(err)
|
|
||||||
);
|
|
||||||
button.actionError();
|
button.actionError();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -220,11 +218,9 @@ class HassioAddonNetwork extends LitElement {
|
|||||||
await suggestAddonRestart(this, this.hass, this.supervisor, this.addon);
|
await suggestAddonRestart(this, this.hass, this.supervisor, this.addon);
|
||||||
}
|
}
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize("addon.failed_to_save", {
|
||||||
"addon.failed_to_save",
|
error: extractApiErrorMessage(err),
|
||||||
"error",
|
});
|
||||||
extractApiErrorMessage(err)
|
|
||||||
);
|
|
||||||
button.actionError();
|
button.actionError();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -34,7 +34,7 @@ class HassioAddonDocumentationDashboard extends LitElement {
|
|||||||
|
|
||||||
protected render(): TemplateResult {
|
protected render(): TemplateResult {
|
||||||
if (!this.addon) {
|
if (!this.addon) {
|
||||||
return html`<ha-circular-progress active></ha-circular-progress>`;
|
return html`<ha-circular-progress indeterminate></ha-circular-progress>`;
|
||||||
}
|
}
|
||||||
return html`
|
return html`
|
||||||
<div class="content">
|
<div class="content">
|
||||||
@@ -85,8 +85,7 @@ class HassioAddonDocumentationDashboard extends LitElement {
|
|||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
this._error = this.supervisor.localize(
|
this._error = this.supervisor.localize(
|
||||||
"addon.documentation.get_documentation",
|
"addon.documentation.get_documentation",
|
||||||
"error",
|
{ error: extractApiErrorMessage(err) }
|
||||||
extractApiErrorMessage(err)
|
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user