mirror of
https://github.com/home-assistant/frontend.git
synced 2025-12-11 18:47:24 +00:00
Compare commits
740 Commits
fix-naviga
...
theme-by-u
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f3f0dfc62b | ||
|
|
d4125d433f | ||
|
|
c824e58e0a | ||
|
|
c6617718b7 | ||
|
|
cd1ca72e45 | ||
|
|
4f9ca3b173 | ||
|
|
1349c8520c | ||
|
|
6d1a55cc3a | ||
|
|
23a9ae6835 | ||
|
|
dbd1e928de | ||
|
|
e86ad21ce2 | ||
|
|
0d97afb3f2 | ||
|
|
03a415beff | ||
|
|
44cc75afbc | ||
|
|
748642a8d6 | ||
|
|
3d5c65d652 | ||
|
|
a26bf80b13 | ||
|
|
497c6c35f1 | ||
|
|
b0b06a2787 | ||
|
|
f3d55447ca | ||
|
|
1b3d4b77d3 | ||
|
|
6ec4041c4c | ||
|
|
d919e8d333 | ||
|
|
af7bb85667 | ||
|
|
9061e2039b | ||
|
|
906e6f4a88 | ||
|
|
73fbe9a69d | ||
|
|
2a0f69a629 | ||
|
|
9411a77f14 | ||
|
|
de3bf2e088 | ||
|
|
16181b48ae | ||
|
|
8682debe61 | ||
|
|
bdbc9bc1b4 | ||
|
|
79b9f8d083 | ||
|
|
3918194d2d | ||
|
|
e9fef1f873 | ||
|
|
35face602b | ||
|
|
803ac496f6 | ||
|
|
f1173dd84b | ||
|
|
44dcca9923 | ||
|
|
bd74d39dd8 | ||
|
|
172d6c3079 | ||
|
|
56539e8065 | ||
|
|
8f6867f142 | ||
|
|
d51f8995dd | ||
|
|
f2e35dc70a | ||
|
|
6487b9b7ea | ||
|
|
e50b658db7 | ||
|
|
6efe237639 | ||
|
|
4a94cfc05b | ||
|
|
7cbdb1dcfd | ||
|
|
553bb61db7 | ||
|
|
786ff787d1 | ||
|
|
28b3f2970a | ||
|
|
7d170a710e | ||
|
|
cc40b50675 | ||
|
|
b6eaff46e9 | ||
|
|
674bb0d16a | ||
|
|
6ff018afc9 | ||
|
|
ad48732bb7 | ||
|
|
fef162346a | ||
|
|
72d208d1ac | ||
|
|
5a8b1b0fd4 | ||
|
|
4cfc651799 | ||
|
|
b4a3f4cb2c | ||
|
|
f0507a88a6 | ||
|
|
fe041e442d | ||
|
|
e5fea98460 | ||
|
|
31180e3a9e | ||
|
|
ce0f02a45b | ||
|
|
53f090356e | ||
|
|
776c4da688 | ||
|
|
849922f7be | ||
|
|
a26701808f | ||
|
|
904ee2e418 | ||
|
|
11ae3a77e8 | ||
|
|
3a12019b64 | ||
|
|
6c2cf1ff60 | ||
|
|
02ae0b5864 | ||
|
|
85fe2213c1 | ||
|
|
7dbc78f1d6 | ||
|
|
f965a3504f | ||
|
|
077f5efe7e | ||
|
|
ef3bea71a0 | ||
|
|
fcf655b0ec | ||
|
|
b263b74916 | ||
|
|
0f4b6b423a | ||
|
|
72df585c5e | ||
|
|
4698a63642 | ||
|
|
6eb43a7d61 | ||
|
|
af35b15400 | ||
|
|
0d50d2664f | ||
|
|
ff1159402e | ||
|
|
f8742ae690 | ||
|
|
c786d26542 | ||
|
|
3f8ff94002 | ||
|
|
64a968543b | ||
|
|
aea98f702b | ||
|
|
863ff622be | ||
|
|
730cea6646 | ||
|
|
7d1f8d618a | ||
|
|
67b970fcaa | ||
|
|
38bcdaa6f6 | ||
|
|
8f1389de66 | ||
|
|
37ac796c8f | ||
|
|
716cd19d41 | ||
|
|
173725f011 | ||
|
|
ad561b885b | ||
|
|
d77bdf4ac6 | ||
|
|
ac3796ec31 | ||
|
|
8c3fdfb6fb | ||
|
|
b7c7d0b4b5 | ||
|
|
8b0e6eed3a | ||
|
|
603f884e8c | ||
|
|
97dfccf4c7 | ||
|
|
fd1e31c0cc | ||
|
|
1de740e7b5 | ||
|
|
5abfb90b16 | ||
|
|
6b691063a8 | ||
|
|
d1d746e7e6 | ||
|
|
2fcb64d4a1 | ||
|
|
3769f8c7c0 | ||
|
|
f0a56e75f5 | ||
|
|
15f33e1f19 | ||
|
|
181122177b | ||
|
|
684cd0f627 | ||
|
|
277202e363 | ||
|
|
b388d1fd42 | ||
|
|
251e6399f5 | ||
|
|
f44c5d7a63 | ||
|
|
cae1ca52f0 | ||
|
|
f8de2c64a5 | ||
|
|
34ef5be720 | ||
|
|
1402802031 | ||
|
|
816989ab4d | ||
|
|
d4497ca39c | ||
|
|
6e39242ca3 | ||
|
|
0197e32783 | ||
|
|
87dfed4beb | ||
|
|
dae991dc89 | ||
|
|
6197e3483b | ||
|
|
b2a6c8bd36 | ||
|
|
938855e13c | ||
|
|
a8712e3b8e | ||
|
|
b15b577057 | ||
|
|
653aeae3d8 | ||
|
|
0aea6141ad | ||
|
|
5243c1d871 | ||
|
|
9449f5ad0a | ||
|
|
c337bc5f97 | ||
|
|
6aab60cf45 | ||
|
|
52e9bc3213 | ||
|
|
e48b2383cf | ||
|
|
002a249777 | ||
|
|
10498ce18d | ||
|
|
6a5936b2b2 | ||
|
|
dc68aaa803 | ||
|
|
e7931ce049 | ||
|
|
59b2582fe3 | ||
|
|
8577b0721c | ||
|
|
91319be855 | ||
|
|
0dff538298 | ||
|
|
6ac6d9c6eb | ||
|
|
6ba0071296 | ||
|
|
fef5dc4232 | ||
|
|
ce58962dbb | ||
|
|
9fb1e1d2ed | ||
|
|
a29544c1e6 | ||
|
|
b2b71edd04 | ||
|
|
028472fc7b | ||
|
|
b056ce228b | ||
|
|
0cd4256c0e | ||
|
|
e274c5b23f | ||
|
|
ea57846465 | ||
|
|
3f2e2bc659 | ||
|
|
e3f2f66206 | ||
|
|
b95e87845f | ||
|
|
bc49ebc489 | ||
|
|
c97d0ce68a | ||
|
|
a0e7d6f1c6 | ||
|
|
25d2a5ddac | ||
|
|
a2f2d64f5c | ||
|
|
fcdcbbda05 | ||
|
|
4b5c7fc2de | ||
|
|
dd64d88afe | ||
|
|
5feffd08ff | ||
|
|
543c7df3e0 | ||
|
|
167f859f2a | ||
|
|
c7d9699a24 | ||
|
|
a638cf443d | ||
|
|
438d1c13ef | ||
|
|
cc8869b9f9 | ||
|
|
cbdb7406ad | ||
|
|
f8d2560104 | ||
|
|
cc48ae82d6 | ||
|
|
e1bda9b57d | ||
|
|
89e9316a40 | ||
|
|
85e4975206 | ||
|
|
142faba04d | ||
|
|
c1c6d71ccf | ||
|
|
5204a565cf | ||
|
|
05b8a48ba8 | ||
|
|
41770a89b4 | ||
|
|
b7d14d7950 | ||
|
|
4ccef6f28b | ||
|
|
d1be441455 | ||
|
|
b3391b34e4 | ||
|
|
9359e9d475 | ||
|
|
5453da75ea | ||
|
|
bc21877008 | ||
|
|
c9956c65e9 | ||
|
|
74814cc305 | ||
|
|
8f231d7b3e | ||
|
|
5b6818d72d | ||
|
|
8c75865a02 | ||
|
|
99d832ac77 | ||
|
|
240e48f5c1 | ||
|
|
77fc11cda6 | ||
|
|
f8f152f118 | ||
|
|
20a67cf73c | ||
|
|
dd11b3092e | ||
|
|
7f3363621e | ||
|
|
edce1901d7 | ||
|
|
546087066a | ||
|
|
a95c589a06 | ||
|
|
5f6da9d959 | ||
|
|
bc94ca0a0a | ||
|
|
dc8d483e8b | ||
|
|
a329553ce1 | ||
|
|
1f8cfdd0de | ||
|
|
fd1f966216 | ||
|
|
243a2ce0e2 | ||
|
|
77c1786171 | ||
|
|
7a7c204d74 | ||
|
|
dcb74ad2ee | ||
|
|
fd4c62a852 | ||
|
|
bf1b0ac949 | ||
|
|
c6f0c62fd6 | ||
|
|
ac98672cb7 | ||
|
|
6b471ba6e7 | ||
|
|
b28e7d2f06 | ||
|
|
bf471eb8c3 | ||
|
|
8c52bc3ffb | ||
|
|
54b328648a | ||
|
|
62a9da2de2 | ||
|
|
25ff96b9bf | ||
|
|
caeb616dc6 | ||
|
|
fb79e2cfb2 | ||
|
|
666316e44a | ||
|
|
1532093426 | ||
|
|
2effb0935c | ||
|
|
06a08bb4f2 | ||
|
|
09102d34d6 | ||
|
|
27d683f6e8 | ||
|
|
b89bd0be3b | ||
|
|
51e6e6d230 | ||
|
|
9005f8faa9 | ||
|
|
7aa2abc9c2 | ||
|
|
898fd51c7d | ||
|
|
b3141a0653 | ||
|
|
1025f73c36 | ||
|
|
1cd44728df | ||
|
|
eaab19fb8c | ||
|
|
c4b2896fac | ||
|
|
ca2a9f9171 | ||
|
|
9e868e144d | ||
|
|
fcb6da55d8 | ||
|
|
87907b98bd | ||
|
|
7535d66373 | ||
|
|
e994e3565d | ||
|
|
562589a6cb | ||
|
|
e87f6d6d5e | ||
|
|
3feedb792a | ||
|
|
fc290028c6 | ||
|
|
2f5fd6f0c7 | ||
|
|
9a3ca59d77 | ||
|
|
f76c22cb5b | ||
|
|
aad94624e2 | ||
|
|
076ab91199 | ||
|
|
d121b33263 | ||
|
|
dbfcf310c3 | ||
|
|
25ea6c2c55 | ||
|
|
b2b2c21477 | ||
|
|
09777db549 | ||
|
|
f108f65e39 | ||
|
|
2ee9824bcc | ||
|
|
812461ea00 | ||
|
|
c430c28c2a | ||
|
|
d67c463b98 | ||
|
|
8efaf2b031 | ||
|
|
5b038a4fef | ||
|
|
2105793355 | ||
|
|
21c2351137 | ||
|
|
ebd1bdd686 | ||
|
|
05bd70dd64 | ||
|
|
e5d2f2d94b | ||
|
|
57edb86c5c | ||
|
|
173d60b913 | ||
|
|
c17c1e4217 | ||
|
|
d112872eb2 | ||
|
|
e54f178b02 | ||
|
|
7960da1872 | ||
|
|
6288154c53 | ||
|
|
52d8e98cdb | ||
|
|
1043db29be | ||
|
|
e6cc920781 | ||
|
|
8bc78ba793 | ||
|
|
e703750136 | ||
|
|
69a93ddb6e | ||
|
|
630b48218b | ||
|
|
54c78ecc4d | ||
|
|
57a17b8663 | ||
|
|
d3e832c09b | ||
|
|
abe8899f9b | ||
|
|
922cd72be4 | ||
|
|
3f4ee97ede | ||
|
|
6f9a385619 | ||
|
|
eda0ea077c | ||
|
|
9934ea4b4f | ||
|
|
cc42d958ce | ||
|
|
2e1efecdf7 | ||
|
|
5fead1b03a | ||
|
|
730da177ef | ||
|
|
bd53d1076f | ||
|
|
e012a9e929 | ||
|
|
95ac8eb5ab | ||
|
|
6dbc04455f | ||
|
|
2b8fc04fdc | ||
|
|
3baeb22423 | ||
|
|
aae4ba7341 | ||
|
|
46d62d55a3 | ||
|
|
de027b6d93 | ||
|
|
f1cc02b40f | ||
|
|
23c6155f9b | ||
|
|
b0e6c5dbaf | ||
|
|
8cb4452126 | ||
|
|
0cd0f65d51 | ||
|
|
3479879bd0 | ||
|
|
60b9fbced7 | ||
|
|
7496998a69 | ||
|
|
c9db02ba2e | ||
|
|
08737366fc | ||
|
|
707192feac | ||
|
|
4b03caa01a | ||
|
|
3ffbd435e0 | ||
|
|
2e2f39adbd | ||
|
|
5e7f356707 | ||
|
|
b02d0e58b1 | ||
|
|
c01d3aee41 | ||
|
|
6dde7d6945 | ||
|
|
14c71f436e | ||
|
|
9acdd9f903 | ||
|
|
12b2edaa65 | ||
|
|
d55d388046 | ||
|
|
ec1dedcb6b | ||
|
|
d0fbba5063 | ||
|
|
344e083ac6 | ||
|
|
0ee6548650 | ||
|
|
166633cfa8 | ||
|
|
853059ac73 | ||
|
|
31ed0f7bea | ||
|
|
57388ae429 | ||
|
|
20203a3cef | ||
|
|
9ec9c7e56b | ||
|
|
788441499a | ||
|
|
712817df65 | ||
|
|
f8264e4500 | ||
|
|
50fa8dd269 | ||
|
|
fc20716ff2 | ||
|
|
c6aec2db7d | ||
|
|
f75f4b9733 | ||
|
|
b1acf9a057 | ||
|
|
221b3932ed | ||
|
|
c50f701160 | ||
|
|
85bebfc309 | ||
|
|
6e90afc5bd | ||
|
|
e137e695ec | ||
|
|
7133dc5688 | ||
|
|
617480472e | ||
|
|
6ef799be60 | ||
|
|
9ff1ce3c96 | ||
|
|
f53ac94e76 | ||
|
|
6d084813d5 | ||
|
|
926f5e3cd8 | ||
|
|
befc650f81 | ||
|
|
2019b8992e | ||
|
|
4d2e9f203f | ||
|
|
760d898de7 | ||
|
|
a755af96a6 | ||
|
|
046b90ae25 | ||
|
|
a3e8bcf848 | ||
|
|
2cf1b7b6e6 | ||
|
|
4b13dde92e | ||
|
|
ebcee7680a | ||
|
|
ffff7970f5 | ||
|
|
2a2b6d33b8 | ||
|
|
61ed889370 | ||
|
|
4cc95938c8 | ||
|
|
63c658e5b9 | ||
|
|
3d1817a6b9 | ||
|
|
8be2ca5392 | ||
|
|
f043886273 | ||
|
|
ff75c89ed4 | ||
|
|
a8803de6e3 | ||
|
|
e9f3f71be1 | ||
|
|
334c87b194 | ||
|
|
8db4a76bb9 | ||
|
|
7aa2136c21 | ||
|
|
47308e7b46 | ||
|
|
87884ac747 | ||
|
|
ec1fc09140 | ||
|
|
e2ad94469a | ||
|
|
70541ec966 | ||
|
|
0bf64ee7f4 | ||
|
|
4ea0c83fbe | ||
|
|
d126e02747 | ||
|
|
102a9eeb61 | ||
|
|
fc3e99e794 | ||
|
|
70953788cc | ||
|
|
4ffec51a5e | ||
|
|
71e10d5d8e | ||
|
|
cfbcb74ac2 | ||
|
|
3ff5b832bc | ||
|
|
1faf024c5b | ||
|
|
6d48e725c7 | ||
|
|
052744e3d1 | ||
|
|
2945a7b701 | ||
|
|
6c9df587e7 | ||
|
|
8f58681d83 | ||
|
|
4a16d9bd44 | ||
|
|
fcc9da6d85 | ||
|
|
e03dc2c382 | ||
|
|
be967940a2 | ||
|
|
64ad37ed6a | ||
|
|
01bc45c78b | ||
|
|
2206644c47 | ||
|
|
486038c426 | ||
|
|
711f721007 | ||
|
|
3b8bc242fe | ||
|
|
7e80eed003 | ||
|
|
a7ef498d75 | ||
|
|
caf8fdf4c7 | ||
|
|
f19ca78b89 | ||
|
|
0fba0e2850 | ||
|
|
15606a5a90 | ||
|
|
c7df147908 | ||
|
|
031658eef4 | ||
|
|
fa672ffbba | ||
|
|
34bcd5e71c | ||
|
|
73854efa57 | ||
|
|
a371b842da | ||
|
|
b439c5d213 | ||
|
|
04a9c67112 | ||
|
|
012bd0714c | ||
|
|
4e10d140d9 | ||
|
|
8df67b8eb1 | ||
|
|
fb09eba831 | ||
|
|
a5de6ff3af | ||
|
|
806cc2c608 | ||
|
|
48a160f057 | ||
|
|
c697843c34 | ||
|
|
317a2f5b21 | ||
|
|
220011f15f | ||
|
|
35faeb651b | ||
|
|
8daea5b565 | ||
|
|
cd69c4c361 | ||
|
|
eaab47a667 | ||
|
|
d08a28ab9e | ||
|
|
e8af454705 | ||
|
|
713b5c7cf7 | ||
|
|
8b17286fb6 | ||
|
|
f3705a7e1d | ||
|
|
d0123b2cce | ||
|
|
884c22f92b | ||
|
|
700690474c | ||
|
|
4686808e53 | ||
|
|
cf1df712e4 | ||
|
|
c338e9cb30 | ||
|
|
8e8fd89d56 | ||
|
|
f1c360c550 | ||
|
|
b429ecc376 | ||
|
|
6d8422513a | ||
|
|
cb0a48265a | ||
|
|
c9082724a8 | ||
|
|
455cd0485e | ||
|
|
f5ec2dcbe2 | ||
|
|
6b039a1073 | ||
|
|
94c03be7ae | ||
|
|
4bf0a23513 | ||
|
|
f01388473a | ||
|
|
1d0c3da294 | ||
|
|
be849887a1 | ||
|
|
e1a6f6f0e3 | ||
|
|
d0327915db | ||
|
|
351d318c89 | ||
|
|
7d1ca2acf0 | ||
|
|
fea83c0873 | ||
|
|
d3b4014182 | ||
|
|
5c7fe04562 | ||
|
|
44e26c925b | ||
|
|
205dd3f968 | ||
|
|
86133a0696 | ||
|
|
2105db9104 | ||
|
|
49c377b1c4 | ||
|
|
3fd3c8003a | ||
|
|
ccbb2704d1 | ||
|
|
34218f08ef | ||
|
|
cf91e6a2a3 | ||
|
|
ab9759c6dd | ||
|
|
95adbfcc12 | ||
|
|
1b9cbe434d | ||
|
|
918aa562c5 | ||
|
|
2ff0cb58bc | ||
|
|
a94460a0c7 | ||
|
|
60e57748f7 | ||
|
|
0ecb8a6866 | ||
|
|
d9dfea938e | ||
|
|
6fe4f94d55 | ||
|
|
01bec32fd6 | ||
|
|
5453d6f7f5 | ||
|
|
a0799a409b | ||
|
|
704e7f279f | ||
|
|
1daaf50773 | ||
|
|
54eb7d169c | ||
|
|
33b410dea0 | ||
|
|
c05054e4ff | ||
|
|
f416b1b5da | ||
|
|
6a345d86a6 | ||
|
|
a04e9b68bd | ||
|
|
f7dbd38c2e | ||
|
|
7150016375 | ||
|
|
c3507abd9c | ||
|
|
fc8a8b28c2 | ||
|
|
637fe37ef4 | ||
|
|
657bfc82ca | ||
|
|
44423812f4 | ||
|
|
a6a76155e5 | ||
|
|
8c18d816b6 | ||
|
|
361caafab9 | ||
|
|
94f679e387 | ||
|
|
85bd6432a9 | ||
|
|
00c1dfa1d2 | ||
|
|
fb72e1fb9c | ||
|
|
152d2d0bdf | ||
|
|
e06aa52a21 | ||
|
|
49aa935490 | ||
|
|
cead1e355d | ||
|
|
edc99b5d6c | ||
|
|
b38963b214 | ||
|
|
0d99531855 | ||
|
|
9cde7637ca | ||
|
|
edc08994b3 | ||
|
|
fc0907ef72 | ||
|
|
bdb28246fc | ||
|
|
0582798cde | ||
|
|
e7d9032cc4 | ||
|
|
331385794c | ||
|
|
8e71bd7e82 | ||
|
|
664cc9b33d | ||
|
|
6757cda7f0 | ||
|
|
97e6313890 | ||
|
|
3cfba7b960 | ||
|
|
5fb384ad31 | ||
|
|
76cb9ce807 | ||
|
|
0e61596f5c | ||
|
|
061b6af812 | ||
|
|
fd95ab5518 | ||
|
|
a7cacbbbe6 | ||
|
|
5a0225b86a | ||
|
|
8b79fc5848 | ||
|
|
5513da51a8 | ||
|
|
56f9165323 | ||
|
|
6afcd4d770 | ||
|
|
52e1f9315e | ||
|
|
a00f645921 | ||
|
|
faf3bb2644 | ||
|
|
31d98ec935 | ||
|
|
7d0a269f1b | ||
|
|
147098f0fd | ||
|
|
d4cbfd9583 | ||
|
|
a35ba38a2d | ||
|
|
8fa36c8226 | ||
|
|
5ccc3365fe | ||
|
|
dcf97d4667 | ||
|
|
4b7acbb766 | ||
|
|
7900eb4054 | ||
|
|
53caef8f92 | ||
|
|
14bebc76b0 | ||
|
|
8b6382448f | ||
|
|
5cd6f22e99 | ||
|
|
523c38a83e | ||
|
|
0a28bbdd72 | ||
|
|
e58bef7795 | ||
|
|
d403532fc1 | ||
|
|
4de8b562bd | ||
|
|
31e85836f0 | ||
|
|
e1359781a5 | ||
|
|
379bc3a4e3 | ||
|
|
b3b0006ba3 | ||
|
|
cd44b33201 | ||
|
|
33df805168 | ||
|
|
fad435ea10 | ||
|
|
b35f9944ea | ||
|
|
dc799bf691 | ||
|
|
1f7929bb3d | ||
|
|
fb228dc918 | ||
|
|
c66f5e2d8a | ||
|
|
d71b29d089 | ||
|
|
6b230b6142 | ||
|
|
c532a9023a | ||
|
|
ecc704e6ac | ||
|
|
5470c8f250 | ||
|
|
d21f249aac | ||
|
|
907299b139 | ||
|
|
37aa2bd869 | ||
|
|
f1f53b9f24 | ||
|
|
49d9c7f392 | ||
|
|
65860a3142 | ||
|
|
3b52d3d302 | ||
|
|
2fe6203eae | ||
|
|
92b02e39c9 | ||
|
|
b693fd1edc | ||
|
|
b84e00b312 | ||
|
|
973fd51639 | ||
|
|
e0494ccb57 | ||
|
|
95559cbc2a | ||
|
|
3da13b823a | ||
|
|
c022871ead | ||
|
|
c4fcbf0613 | ||
|
|
79921745a8 | ||
|
|
40a4255045 | ||
|
|
2d902a0688 | ||
|
|
8a46ef6168 | ||
|
|
ba3d37b550 | ||
|
|
88d0247217 | ||
|
|
1c076d22a6 | ||
|
|
0ecdae2551 | ||
|
|
6f8ba6afac | ||
|
|
ad1c32a880 | ||
|
|
48819a59e7 | ||
|
|
2718801c69 | ||
|
|
2b43f5f8c8 | ||
|
|
0ef23cd712 | ||
|
|
7370d1e0dd | ||
|
|
da7d3e118c | ||
|
|
d4188d9aee | ||
|
|
8722157623 | ||
|
|
6e2f0d8c9b | ||
|
|
08459394a6 | ||
|
|
ee292f900f | ||
|
|
3aaf08ac03 | ||
|
|
d31f4a5f1d | ||
|
|
875ab0cb97 | ||
|
|
678af025ac | ||
|
|
1fd38d085f | ||
|
|
ec324ab09f | ||
|
|
efcd57934a | ||
|
|
1efe61445f | ||
|
|
6db9bf800a | ||
|
|
65458538a7 | ||
|
|
9ddeb3734f | ||
|
|
c89fc188a5 | ||
|
|
d366471058 | ||
|
|
9951c162a1 | ||
|
|
0c7d689b5a | ||
|
|
655ce05efe | ||
|
|
2a6e562d37 | ||
|
|
98d1954812 | ||
|
|
72a2f54598 | ||
|
|
9364ea060a | ||
|
|
f8dfdcb090 | ||
|
|
3d78a7821a | ||
|
|
e923d610ce | ||
|
|
8b25fe88a4 | ||
|
|
3768be55ff | ||
|
|
47cf17ab50 | ||
|
|
d2ec24f32a | ||
|
|
69ed736080 | ||
|
|
7d3c77008d | ||
|
|
27dbabc6bf | ||
|
|
27ce395d68 | ||
|
|
145a536156 | ||
|
|
e9b2a83411 | ||
|
|
784b7e4d04 | ||
|
|
f4bf999ae2 | ||
|
|
9c04f57e35 | ||
|
|
f0ddc408e8 | ||
|
|
df4d5a4567 | ||
|
|
0a413cba03 | ||
|
|
7e2217b542 | ||
|
|
f9844e8e58 | ||
|
|
86f9909ac9 | ||
|
|
629ae3fbf3 | ||
|
|
ddd2c177b5 | ||
|
|
829de4a073 | ||
|
|
0df8b96133 | ||
|
|
443921a97c | ||
|
|
54bc0525f7 | ||
|
|
72f8f020fc | ||
|
|
7f31acf764 | ||
|
|
8c5862e4ce | ||
|
|
f3e0df93b5 | ||
|
|
c6c5ea34d3 | ||
|
|
287a068ada | ||
|
|
8ca52820b1 | ||
|
|
cd8900dd26 | ||
|
|
6d2e7f9fbd | ||
|
|
1016c87c60 | ||
|
|
dbda1d75f9 | ||
|
|
a9c25b49b9 | ||
|
|
fbff95345c | ||
|
|
8f4e65d392 | ||
|
|
3a2cb51f8d | ||
|
|
6c9cfed49f | ||
|
|
257cab1061 | ||
|
|
5f6577a24c | ||
|
|
f8d6f0fae4 | ||
|
|
5b7eeb6ac1 | ||
|
|
191feed920 | ||
|
|
13c1763277 | ||
|
|
ac9085c7a4 | ||
|
|
8beb93b695 | ||
|
|
4f76e66cc0 | ||
|
|
1ebd13027c | ||
|
|
04beef5e36 | ||
|
|
0a578c5847 | ||
|
|
41924d8ec6 | ||
|
|
6ff1a6fecc | ||
|
|
05eb6e15a5 | ||
|
|
6d01728d54 | ||
|
|
2550bff4e9 | ||
|
|
6e003907fb | ||
|
|
f6c15dc990 | ||
|
|
1061769144 | ||
|
|
1edfec08e1 | ||
|
|
239cad9b47 | ||
|
|
8d7c175d70 | ||
|
|
795bbefba6 | ||
|
|
e1b34eaa33 | ||
|
|
91d5d2f1eb |
@@ -1,5 +1,4 @@
|
|||||||
# See here for image contents: https://github.com/microsoft/vscode-dev-containers/tree/v0.148.1/containers/python-3/.devcontainer/base.Dockerfile
|
FROM mcr.microsoft.com/devcontainers/python:1-3.13
|
||||||
FROM mcr.microsoft.com/devcontainers/python:3.12
|
|
||||||
|
|
||||||
ENV \
|
ENV \
|
||||||
DEBIAN_FRONTEND=noninteractive \
|
DEBIAN_FRONTEND=noninteractive \
|
||||||
|
|||||||
@@ -11,6 +11,9 @@
|
|||||||
"DEV_CONTAINER": "1",
|
"DEV_CONTAINER": "1",
|
||||||
"WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}"
|
"WORKSPACE_DIRECTORY": "${containerWorkspaceFolder}"
|
||||||
},
|
},
|
||||||
|
"remoteEnv": {
|
||||||
|
"NODE_OPTIONS": "--max_old_space_size=8192"
|
||||||
|
},
|
||||||
"customizations": {
|
"customizations": {
|
||||||
"vscode": {
|
"vscode": {
|
||||||
"extensions": [
|
"extensions": [
|
||||||
|
|||||||
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
4
.github/ISSUE_TEMPLATE/bug_report.yml
vendored
@@ -7,7 +7,7 @@ body:
|
|||||||
value: |
|
value: |
|
||||||
Make sure you are running the [latest version of Home Assistant][releases] before reporting an issue.
|
Make sure you are running the [latest version of Home Assistant][releases] before reporting an issue.
|
||||||
|
|
||||||
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 a discussion][fr] instead of creating an issue.
|
||||||
|
|
||||||
**Please do not report issues for custom cards.**
|
**Please do not report issues for custom cards.**
|
||||||
|
|
||||||
@@ -74,7 +74,7 @@ body:
|
|||||||
If known, otherwise leave blank.
|
If known, otherwise leave blank.
|
||||||
- type: input
|
- type: input
|
||||||
attributes:
|
attributes:
|
||||||
label: In which browser are you experiencing the issue with?
|
label: In which browser are you experiencing the issue?
|
||||||
placeholder: Google Chrome 88.0.4324.150
|
placeholder: Google Chrome 88.0.4324.150
|
||||||
description: >
|
description: >
|
||||||
Provide the full name and don't forget to add the version!
|
Provide the full name and don't forget to add the version!
|
||||||
|
|||||||
2
.github/ISSUE_TEMPLATE/config.yml
vendored
2
.github/ISSUE_TEMPLATE/config.yml
vendored
@@ -2,7 +2,7 @@ blank_issues_enabled: false
|
|||||||
contact_links:
|
contact_links:
|
||||||
- name: Request a feature for the UI / Dashboards
|
- name: Request a feature for the UI / Dashboards
|
||||||
url: https://github.com/home-assistant/frontend/discussions/category_choices
|
url: https://github.com/home-assistant/frontend/discussions/category_choices
|
||||||
about: Request an new feature for the Home Assistant frontend.
|
about: Request a new feature for the Home Assistant frontend.
|
||||||
- name: Report a bug that is NOT related to the UI / Dashboards
|
- name: Report a bug that is NOT related to the UI / Dashboards
|
||||||
url: https://github.com/home-assistant/core/issues
|
url: https://github.com/home-assistant/core/issues
|
||||||
about: This is the issue tracker for our frontend. Please report other issues in the backend ("core") repository.
|
about: This is the issue tracker for our frontend. Please report other issues in the backend ("core") repository.
|
||||||
|
|||||||
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@v4.1.0
|
uses: actions/setup-node@v4.2.0
|
||||||
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@v4.1.0
|
uses: actions/setup-node@v4.2.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
|
|||||||
46
.github/workflows/ci.yaml
vendored
46
.github/workflows/ci.yaml
vendored
@@ -26,20 +26,14 @@ jobs:
|
|||||||
- name: Check out files from GitHub
|
- name: Check out files from GitHub
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
id: setup-node
|
uses: actions/setup-node@v4.2.0
|
||||||
uses: actions/setup-node@v4.1.0
|
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
- uses: actions/cache@v4.2.0
|
|
||||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
||||||
with:
|
|
||||||
path: "node_modules"
|
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('.yarnrc.yml') }}-${{ steps.setup-node.outputs.node-version }}-${{ hashFiles('yarn.lock') }}
|
|
||||||
restore-keys: ${{ runner.os }}-yarn-${{ hashFiles('.yarnrc.yml') }}-${{ steps.setup-node.outputs.node-version }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: steps.yarn-cache.outputs.cache-hit != 'true'
|
|
||||||
run: yarn install --immutable
|
run: yarn install --immutable
|
||||||
|
- name: Check for duplicate dependencies
|
||||||
|
run: yarn dedupe --check
|
||||||
- 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
|
||||||
@@ -66,19 +60,11 @@ jobs:
|
|||||||
- name: Check out files from GitHub
|
- name: Check out files from GitHub
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
id: setup-node
|
uses: actions/setup-node@v4.2.0
|
||||||
uses: actions/setup-node@v4.1.0
|
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
- uses: actions/cache@v4.2.0
|
|
||||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
||||||
with:
|
|
||||||
path: "node_modules"
|
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('.yarnrc.yml') }}-${{ steps.setup-node.outputs.node-version }}-${{ hashFiles('yarn.lock') }}
|
|
||||||
restore-keys: ${{ runner.os }}-yarn-${{ hashFiles('.yarnrc.yml') }}-${{ steps.setup-node.outputs.node-version }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: steps.yarn-cache.outputs.cache-hit != 'true'
|
|
||||||
run: yarn install --immutable
|
run: yarn install --immutable
|
||||||
- name: Build resources
|
- name: Build resources
|
||||||
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data
|
run: ./node_modules/.bin/gulp gen-icons-json build-translations build-locale-data
|
||||||
@@ -92,26 +78,18 @@ jobs:
|
|||||||
- name: Check out files from GitHub
|
- name: Check out files from GitHub
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
id: setup-node
|
uses: actions/setup-node@v4.2.0
|
||||||
uses: actions/setup-node@v4.1.0
|
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
- uses: actions/cache@v4.2.0
|
|
||||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
||||||
with:
|
|
||||||
path: "node_modules"
|
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('.yarnrc.yml') }}-${{ steps.setup-node.outputs.node-version }}-${{ hashFiles('yarn.lock') }}
|
|
||||||
restore-keys: ${{ runner.os }}-yarn-${{ hashFiles('.yarnrc.yml') }}-${{ steps.setup-node.outputs.node-version }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: steps.yarn-cache.outputs.cache-hit != 'true'
|
|
||||||
run: yarn install --immutable
|
run: yarn install --immutable
|
||||||
- name: Build Application
|
- name: Build Application
|
||||||
run: ./node_modules/.bin/gulp build-app
|
run: ./node_modules/.bin/gulp build-app
|
||||||
env:
|
env:
|
||||||
IS_TEST: "true"
|
IS_TEST: "true"
|
||||||
- name: Upload bundle stats
|
- name: Upload bundle stats
|
||||||
uses: actions/upload-artifact@v4.4.3
|
uses: actions/upload-artifact@v4.6.0
|
||||||
with:
|
with:
|
||||||
name: frontend-bundle-stats
|
name: frontend-bundle-stats
|
||||||
path: build/stats/*.json
|
path: build/stats/*.json
|
||||||
@@ -124,26 +102,18 @@ jobs:
|
|||||||
- name: Check out files from GitHub
|
- name: Check out files from GitHub
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
id: setup-node
|
uses: actions/setup-node@v4.2.0
|
||||||
uses: actions/setup-node@v4.1.0
|
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
- uses: actions/cache@v4.2.0
|
|
||||||
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
|
|
||||||
with:
|
|
||||||
path: "node_modules"
|
|
||||||
key: ${{ runner.os }}-yarn-${{ hashFiles('.yarnrc.yml') }}-${{ steps.setup-node.outputs.node-version }}-${{ hashFiles('yarn.lock') }}
|
|
||||||
restore-keys: ${{ runner.os }}-yarn-${{ hashFiles('.yarnrc.yml') }}-${{ steps.setup-node.outputs.node-version }}
|
|
||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
if: steps.yarn-cache.outputs.cache-hit != 'true'
|
|
||||||
run: yarn install --immutable
|
run: yarn install --immutable
|
||||||
- name: Build Application
|
- name: Build Application
|
||||||
run: ./node_modules/.bin/gulp build-hassio
|
run: ./node_modules/.bin/gulp build-hassio
|
||||||
env:
|
env:
|
||||||
IS_TEST: "true"
|
IS_TEST: "true"
|
||||||
- name: Upload bundle stats
|
- name: Upload bundle stats
|
||||||
uses: actions/upload-artifact@v4.4.3
|
uses: actions/upload-artifact@v4.6.0
|
||||||
with:
|
with:
|
||||||
name: supervisor-bundle-stats
|
name: supervisor-bundle-stats
|
||||||
path: build/stats/*.json
|
path: build/stats/*.json
|
||||||
|
|||||||
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@v4.1.0
|
uses: actions/setup-node@v4.2.0
|
||||||
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@v4.1.0
|
uses: actions/setup-node@v4.2.0
|
||||||
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.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.1.0
|
uses: actions/setup-node@v4.2.0
|
||||||
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.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.1.0
|
uses: actions/setup-node@v4.2.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
|
|||||||
8
.github/workflows/nightly.yaml
vendored
8
.github/workflows/nightly.yaml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
- cron: "0 1 * * *"
|
- cron: "0 1 * * *"
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PYTHON_VERSION: "3.12"
|
PYTHON_VERSION: "3.13"
|
||||||
NODE_OPTIONS: --max_old_space_size=6144
|
NODE_OPTIONS: --max_old_space_size=6144
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
@@ -28,7 +28,7 @@ jobs:
|
|||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.1.0
|
uses: actions/setup-node@v4.2.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -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@v4.4.3
|
uses: actions/upload-artifact@v4.6.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@v4.4.3
|
uses: actions/upload-artifact@v4.6.0
|
||||||
with:
|
with:
|
||||||
name: translations
|
name: translations
|
||||||
path: translations.tar.gz
|
path: translations.tar.gz
|
||||||
|
|||||||
2
.github/workflows/release-drafter.yaml
vendored
2
.github/workflows/release-drafter.yaml
vendored
@@ -18,6 +18,6 @@ jobs:
|
|||||||
pull-requests: read
|
pull-requests: read
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: release-drafter/release-drafter@v6.0.0
|
- uses: release-drafter/release-drafter@v6.1.0
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|||||||
22
.github/workflows/release.yaml
vendored
22
.github/workflows/release.yaml
vendored
@@ -6,7 +6,7 @@ on:
|
|||||||
- published
|
- published
|
||||||
|
|
||||||
env:
|
env:
|
||||||
PYTHON_VERSION: "3.12"
|
PYTHON_VERSION: "3.13"
|
||||||
NODE_OPTIONS: --max_old_space_size=6144
|
NODE_OPTIONS: --max_old_space_size=6144
|
||||||
|
|
||||||
# Set default workflow permissions
|
# Set default workflow permissions
|
||||||
@@ -25,16 +25,16 @@ jobs:
|
|||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
|
|
||||||
- name: Verify version
|
|
||||||
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@v5
|
uses: actions/setup-python@v5
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.PYTHON_VERSION }}
|
python-version: ${{ env.PYTHON_VERSION }}
|
||||||
|
|
||||||
|
- name: Verify version
|
||||||
|
uses: home-assistant/actions/helpers/verify-version@master
|
||||||
|
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.1.0
|
uses: actions/setup-node@v4.2.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -55,7 +55,7 @@ jobs:
|
|||||||
script/release
|
script/release
|
||||||
|
|
||||||
- name: Upload release assets
|
- name: Upload release assets
|
||||||
uses: softprops/action-gh-release@v2.1.0
|
uses: softprops/action-gh-release@v2.2.1
|
||||||
with:
|
with:
|
||||||
files: |
|
files: |
|
||||||
dist/*.whl
|
dist/*.whl
|
||||||
@@ -76,7 +76,7 @@ jobs:
|
|||||||
- name: Build wheels
|
- name: Build wheels
|
||||||
uses: home-assistant/wheels@2024.11.0
|
uses: home-assistant/wheels@2024.11.0
|
||||||
with:
|
with:
|
||||||
abi: cp312
|
abi: cp313
|
||||||
tag: musllinux_1_2
|
tag: musllinux_1_2
|
||||||
arch: amd64
|
arch: amd64
|
||||||
wheels-key: ${{ secrets.WHEELS_KEY }}
|
wheels-key: ${{ secrets.WHEELS_KEY }}
|
||||||
@@ -92,7 +92,7 @@ jobs:
|
|||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.1.0
|
uses: actions/setup-node@v4.2.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -107,7 +107,7 @@ jobs:
|
|||||||
- name: Tar folder
|
- name: Tar folder
|
||||||
run: tar -czf landing-page/home_assistant_frontend_landingpage-${{ github.event.release.tag_name }}.tar.gz -C landing-page/dist .
|
run: tar -czf landing-page/home_assistant_frontend_landingpage-${{ github.event.release.tag_name }}.tar.gz -C landing-page/dist .
|
||||||
- name: Upload release asset
|
- name: Upload release asset
|
||||||
uses: softprops/action-gh-release@v2.1.0
|
uses: softprops/action-gh-release@v2.2.1
|
||||||
with:
|
with:
|
||||||
files: landing-page/home_assistant_frontend_landingpage-${{ github.event.release.tag_name }}.tar.gz
|
files: landing-page/home_assistant_frontend_landingpage-${{ github.event.release.tag_name }}.tar.gz
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ jobs:
|
|||||||
- name: Checkout the repository
|
- name: Checkout the repository
|
||||||
uses: actions/checkout@v4.2.2
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Setup Node
|
- name: Setup Node
|
||||||
uses: actions/setup-node@v4.1.0
|
uses: actions/setup-node@v4.2.0
|
||||||
with:
|
with:
|
||||||
node-version-file: ".nvmrc"
|
node-version-file: ".nvmrc"
|
||||||
cache: yarn
|
cache: yarn
|
||||||
@@ -136,6 +136,6 @@ jobs:
|
|||||||
- name: Tar folder
|
- name: Tar folder
|
||||||
run: tar -czf hassio/home_assistant_frontend_supervisor-${{ github.event.release.tag_name }}.tar.gz -C hassio/build .
|
run: tar -czf hassio/home_assistant_frontend_supervisor-${{ github.event.release.tag_name }}.tar.gz -C hassio/build .
|
||||||
- name: Upload release asset
|
- name: Upload release asset
|
||||||
uses: softprops/action-gh-release@v2.1.0
|
uses: softprops/action-gh-release@v2.2.1
|
||||||
with:
|
with:
|
||||||
files: hassio/home_assistant_frontend_supervisor-${{ github.event.release.tag_name }}.tar.gz
|
files: hassio/home_assistant_frontend_supervisor-${{ github.event.release.tag_name }}.tar.gz
|
||||||
|
|||||||
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@v9.0.0
|
uses: actions/stale@v9.1.0
|
||||||
with:
|
with:
|
||||||
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
repo-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
days-before-stale: 90
|
days-before-stale: 90
|
||||||
|
|||||||
File diff suppressed because one or more lines are too long
@@ -6,4 +6,4 @@ enableGlobalCache: false
|
|||||||
|
|
||||||
nodeLinker: node-modules
|
nodeLinker: node-modules
|
||||||
|
|
||||||
yarnPath: .yarn/releases/yarn-4.5.3.cjs
|
yarnPath: .yarn/releases/yarn-4.6.0.cjs
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import paths from "../paths.cjs";
|
|||||||
const POLYFILL_DIR = join(paths.polymer_dir, "src/resources/polyfills");
|
const POLYFILL_DIR = join(paths.polymer_dir, "src/resources/polyfills");
|
||||||
|
|
||||||
// List of polyfill keys with supported browser targets for the functionality
|
// List of polyfill keys with supported browser targets for the functionality
|
||||||
const PolyfillSupport = {
|
const polyfillSupport = {
|
||||||
// Note states and shadowRoot properties should be supported.
|
// Note states and shadowRoot properties should be supported.
|
||||||
"element-internals": {
|
"element-internals": {
|
||||||
android: 90,
|
android: 90,
|
||||||
@@ -18,17 +18,6 @@ const PolyfillSupport = {
|
|||||||
safari: 17.4,
|
safari: 17.4,
|
||||||
samsung: 15.0,
|
samsung: 15.0,
|
||||||
},
|
},
|
||||||
"element-append": {
|
|
||||||
android: 54,
|
|
||||||
chrome: 54,
|
|
||||||
edge: 17,
|
|
||||||
firefox: 49,
|
|
||||||
ios: 10.0,
|
|
||||||
opera: 41,
|
|
||||||
opera_mobile: 41,
|
|
||||||
safari: 10.0,
|
|
||||||
samsung: 6.0,
|
|
||||||
},
|
|
||||||
"element-getattributenames": {
|
"element-getattributenames": {
|
||||||
android: 61,
|
android: 61,
|
||||||
chrome: 61,
|
chrome: 61,
|
||||||
@@ -51,27 +40,18 @@ const PolyfillSupport = {
|
|||||||
safari: 12.0,
|
safari: 12.0,
|
||||||
samsung: 10.0,
|
samsung: 10.0,
|
||||||
},
|
},
|
||||||
fetch: {
|
// FormatJS polyfill detects fix for https://bugs.chromium.org/p/v8/issues/detail?id=10682,
|
||||||
android: 42,
|
// so adjusted to several months after that was marked fixed
|
||||||
chrome: 42,
|
|
||||||
edge: 14,
|
|
||||||
firefox: 39,
|
|
||||||
ios: 10.3,
|
|
||||||
opera: 29,
|
|
||||||
opera_mobile: 29,
|
|
||||||
safari: 10.1,
|
|
||||||
samsung: 4.0,
|
|
||||||
},
|
|
||||||
"intl-getcanonicallocales": {
|
"intl-getcanonicallocales": {
|
||||||
android: 54,
|
android: 90,
|
||||||
chrome: 54,
|
chrome: 90,
|
||||||
edge: 16,
|
edge: 90,
|
||||||
firefox: 48,
|
firefox: 48,
|
||||||
ios: 10.3,
|
ios: 10.3,
|
||||||
opera: 41,
|
opera: 76,
|
||||||
opera_mobile: 41,
|
opera_mobile: 64,
|
||||||
safari: 10.1,
|
safari: 10.1,
|
||||||
samsung: 6.0,
|
samsung: 15.0,
|
||||||
},
|
},
|
||||||
"intl-locale": {
|
"intl-locale": {
|
||||||
android: 74,
|
android: 74,
|
||||||
@@ -87,17 +67,6 @@ const PolyfillSupport = {
|
|||||||
"intl-other": {
|
"intl-other": {
|
||||||
// Not specified (i.e. always try polyfill) since compatibility depends on supported locales
|
// Not specified (i.e. always try polyfill) since compatibility depends on supported locales
|
||||||
},
|
},
|
||||||
proxy: {
|
|
||||||
android: 49,
|
|
||||||
chrome: 49,
|
|
||||||
edge: 12,
|
|
||||||
firefox: 18,
|
|
||||||
ios: 10.0,
|
|
||||||
opera: 36,
|
|
||||||
opera_mobile: 36,
|
|
||||||
safari: 10.0,
|
|
||||||
samsung: 5.0,
|
|
||||||
},
|
|
||||||
"resize-observer": {
|
"resize-observer": {
|
||||||
android: 64,
|
android: 64,
|
||||||
chrome: 64,
|
chrome: 64,
|
||||||
@@ -115,8 +84,6 @@ const PolyfillSupport = {
|
|||||||
// corresponding polyfill key and actual module to import
|
// corresponding polyfill key and actual module to import
|
||||||
const polyfillMap = {
|
const polyfillMap = {
|
||||||
global: {
|
global: {
|
||||||
fetch: { key: "fetch", module: "unfetch/polyfill" },
|
|
||||||
Proxy: { key: "proxy", module: "proxy-polyfill" },
|
|
||||||
ResizeObserver: {
|
ResizeObserver: {
|
||||||
key: "resize-observer",
|
key: "resize-observer",
|
||||||
module: join(POLYFILL_DIR, "resize-observer.ts"),
|
module: join(POLYFILL_DIR, "resize-observer.ts"),
|
||||||
@@ -128,7 +95,7 @@ const polyfillMap = {
|
|||||||
module: "element-internals-polyfill",
|
module: "element-internals-polyfill",
|
||||||
},
|
},
|
||||||
...Object.fromEntries(
|
...Object.fromEntries(
|
||||||
["append", "getAttributeNames", "toggleAttribute"].map((prop) => {
|
["getAttributeNames", "toggleAttribute"].map((prop) => {
|
||||||
const key = `element-${prop.toLowerCase()}`;
|
const key = `element-${prop.toLowerCase()}`;
|
||||||
return [prop, { key, module: join(POLYFILL_DIR, `${key}.ts`) }];
|
return [prop, { key, module: join(POLYFILL_DIR, `${key}.ts`) }];
|
||||||
})
|
})
|
||||||
@@ -168,7 +135,7 @@ export default defineProvider(
|
|||||||
const resolvePolyfill = createMetaResolver(polyfillMap);
|
const resolvePolyfill = createMetaResolver(polyfillMap);
|
||||||
return {
|
return {
|
||||||
name: "custom-polyfill",
|
name: "custom-polyfill",
|
||||||
polyfills: PolyfillSupport,
|
polyfills: polyfillSupport,
|
||||||
usageGlobal(meta, utils) {
|
usageGlobal(meta, utils) {
|
||||||
const polyfill = resolvePolyfill(meta);
|
const polyfill = resolvePolyfill(meta);
|
||||||
if (polyfill && shouldInjectPolyfill(polyfill.desc.key)) {
|
if (polyfill && shouldInjectPolyfill(polyfill.desc.key)) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ export default [
|
|||||||
"import/extensions": "off",
|
"import/extensions": "off",
|
||||||
"import/no-dynamic-require": "off",
|
"import/no-dynamic-require": "off",
|
||||||
"global-require": "off",
|
"global-require": "off",
|
||||||
"@typescript-eslint/no-var-requires": "off",
|
"@typescript-eslint/no-require-imports": "off",
|
||||||
"prefer-arrow-callback": "off",
|
"prefer-arrow-callback": "off",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
import { constants } from "node:zlib";
|
import { constants } from "node:zlib";
|
||||||
import gulp from "gulp";
|
import gulp from "gulp";
|
||||||
import brotli from "gulp-brotli";
|
import brotli from "gulp-brotli";
|
||||||
|
import zopfli from "gulp-zopfli-green";
|
||||||
import paths from "../paths.cjs";
|
import paths from "../paths.cjs";
|
||||||
|
|
||||||
const filesGlob = "*.{js,json,css,svg,xml}";
|
const filesGlob = "*.{js,json,css,svg,xml}";
|
||||||
@@ -12,17 +13,18 @@ const brotliOptions = {
|
|||||||
[constants.BROTLI_PARAM_QUALITY]: constants.BROTLI_MAX_QUALITY,
|
[constants.BROTLI_PARAM_QUALITY]: constants.BROTLI_MAX_QUALITY,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
const zopfliOptions = { threshold: 150 };
|
||||||
|
|
||||||
const compressModern = (rootDir, modernDir) =>
|
const compressModern = (rootDir, modernDir, compress) =>
|
||||||
gulp
|
gulp
|
||||||
.src([`${modernDir}/**/${filesGlob}`, `${rootDir}/sw-modern.js`], {
|
.src([`${modernDir}/**/${filesGlob}`, `${rootDir}/sw-modern.js`], {
|
||||||
base: rootDir,
|
base: rootDir,
|
||||||
allowEmpty: true,
|
allowEmpty: true,
|
||||||
})
|
})
|
||||||
.pipe(brotli(brotliOptions))
|
.pipe(compress === "zopfli" ? zopfli(zopfliOptions) : brotli(brotliOptions))
|
||||||
.pipe(gulp.dest(rootDir));
|
.pipe(gulp.dest(rootDir));
|
||||||
|
|
||||||
const compressOther = (rootDir, modernDir) =>
|
const compressOther = (rootDir, modernDir, compress) =>
|
||||||
gulp
|
gulp
|
||||||
.src(
|
.src(
|
||||||
[
|
[
|
||||||
@@ -33,21 +35,52 @@ const compressOther = (rootDir, modernDir) =>
|
|||||||
],
|
],
|
||||||
{ base: rootDir, allowEmpty: true }
|
{ base: rootDir, allowEmpty: true }
|
||||||
)
|
)
|
||||||
.pipe(brotli(brotliOptions))
|
.pipe(compress === "zopfli" ? zopfli(zopfliOptions) : brotli(brotliOptions))
|
||||||
.pipe(gulp.dest(rootDir));
|
.pipe(gulp.dest(rootDir));
|
||||||
|
|
||||||
const compressAppModern = () =>
|
const compressAppModernBrotli = () =>
|
||||||
compressModern(paths.app_output_root, paths.app_output_latest);
|
compressModern(paths.app_output_root, paths.app_output_latest, "brotli");
|
||||||
const compressHassioModern = () =>
|
const compressAppModernZopfli = () =>
|
||||||
compressModern(paths.hassio_output_root, paths.hassio_output_latest);
|
compressModern(paths.app_output_root, paths.app_output_latest, "zopfli");
|
||||||
|
|
||||||
const compressAppOther = () =>
|
const compressHassioModernBrotli = () =>
|
||||||
compressOther(paths.app_output_root, paths.app_output_latest);
|
compressModern(
|
||||||
const compressHassioOther = () =>
|
paths.hassio_output_root,
|
||||||
compressOther(paths.hassio_output_root, paths.hassio_output_latest);
|
paths.hassio_output_latest,
|
||||||
|
"brotli"
|
||||||
|
);
|
||||||
|
const compressHassioModernZopfli = () =>
|
||||||
|
compressModern(
|
||||||
|
paths.hassio_output_root,
|
||||||
|
paths.hassio_output_latest,
|
||||||
|
"zopfli"
|
||||||
|
);
|
||||||
|
|
||||||
gulp.task("compress-app", gulp.parallel(compressAppModern, compressAppOther));
|
const compressAppOtherBrotli = () =>
|
||||||
|
compressOther(paths.app_output_root, paths.app_output_latest, "brotli");
|
||||||
|
const compressAppOtherZopfli = () =>
|
||||||
|
compressOther(paths.app_output_root, paths.app_output_latest, "zopfli");
|
||||||
|
|
||||||
|
const compressHassioOtherBrotli = () =>
|
||||||
|
compressOther(paths.hassio_output_root, paths.hassio_output_latest, "brotli");
|
||||||
|
const compressHassioOtherZopfli = () =>
|
||||||
|
compressOther(paths.hassio_output_root, paths.hassio_output_latest, "zopfli");
|
||||||
|
|
||||||
|
gulp.task(
|
||||||
|
"compress-app",
|
||||||
|
gulp.parallel(
|
||||||
|
compressAppModernBrotli,
|
||||||
|
compressAppOtherBrotli,
|
||||||
|
compressAppModernZopfli,
|
||||||
|
compressAppOtherZopfli
|
||||||
|
)
|
||||||
|
);
|
||||||
gulp.task(
|
gulp.task(
|
||||||
"compress-hassio",
|
"compress-hassio",
|
||||||
gulp.parallel(compressHassioModern, compressHassioOther)
|
gulp.parallel(
|
||||||
|
compressHassioModernBrotli,
|
||||||
|
compressHassioOtherBrotli,
|
||||||
|
compressHassioModernZopfli,
|
||||||
|
compressHassioOtherZopfli
|
||||||
|
)
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -67,12 +67,6 @@ function copyPolyfills(staticDir) {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
function copyLoaderJS(staticDir) {
|
|
||||||
const staticPath = genStaticPath(staticDir);
|
|
||||||
copyFileDir(npmPath("systemjs/dist/s.min.js"), staticPath("js"));
|
|
||||||
copyFileDir(npmPath("systemjs/dist/s.min.js.map"), staticPath("js"));
|
|
||||||
}
|
|
||||||
|
|
||||||
function copyFonts(staticDir) {
|
function copyFonts(staticDir) {
|
||||||
const staticPath = genStaticPath(staticDir);
|
const staticPath = genStaticPath(staticDir);
|
||||||
// Local fonts
|
// Local fonts
|
||||||
@@ -140,8 +134,6 @@ gulp.task("copy-static-app", async () => {
|
|||||||
const staticDir = paths.app_output_static;
|
const staticDir = paths.app_output_static;
|
||||||
// Basic static files
|
// Basic static files
|
||||||
fs.copySync(polyPath("public"), paths.app_output_root);
|
fs.copySync(polyPath("public"), paths.app_output_root);
|
||||||
|
|
||||||
copyLoaderJS(staticDir);
|
|
||||||
copyPolyfills(staticDir);
|
copyPolyfills(staticDir);
|
||||||
copyFonts(staticDir);
|
copyFonts(staticDir);
|
||||||
copyTranslations(staticDir);
|
copyTranslations(staticDir);
|
||||||
@@ -164,8 +156,6 @@ gulp.task("copy-static-demo", async () => {
|
|||||||
);
|
);
|
||||||
// Copy demo static files
|
// Copy demo static files
|
||||||
fs.copySync(path.resolve(paths.demo_dir, "public"), paths.demo_output_root);
|
fs.copySync(path.resolve(paths.demo_dir, "public"), paths.demo_output_root);
|
||||||
|
|
||||||
copyLoaderJS(paths.demo_output_static);
|
|
||||||
copyPolyfills(paths.demo_output_static);
|
copyPolyfills(paths.demo_output_static);
|
||||||
copyMapPanel(paths.demo_output_static);
|
copyMapPanel(paths.demo_output_static);
|
||||||
copyFonts(paths.demo_output_static);
|
copyFonts(paths.demo_output_static);
|
||||||
@@ -179,8 +169,6 @@ gulp.task("copy-static-cast", async () => {
|
|||||||
fs.copySync(polyPath("public/static"), paths.cast_output_static);
|
fs.copySync(polyPath("public/static"), paths.cast_output_static);
|
||||||
// Copy cast static files
|
// Copy cast static files
|
||||||
fs.copySync(path.resolve(paths.cast_dir, "public"), paths.cast_output_root);
|
fs.copySync(path.resolve(paths.cast_dir, "public"), paths.cast_output_root);
|
||||||
|
|
||||||
copyLoaderJS(paths.cast_output_static);
|
|
||||||
copyPolyfills(paths.cast_output_static);
|
copyPolyfills(paths.cast_output_static);
|
||||||
copyMapPanel(paths.cast_output_static);
|
copyMapPanel(paths.cast_output_static);
|
||||||
copyFonts(paths.cast_output_static);
|
copyFonts(paths.cast_output_static);
|
||||||
|
|||||||
17
build-scripts/gulp/index.mjs
Normal file
17
build-scripts/gulp/index.mjs
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import "./app.js";
|
||||||
|
import "./cast.js";
|
||||||
|
import "./clean.js";
|
||||||
|
import "./compress.js";
|
||||||
|
import "./demo.js";
|
||||||
|
import "./download-translations.js";
|
||||||
|
import "./entry-html.js";
|
||||||
|
import "./fetch-nightly-translations.js";
|
||||||
|
import "./gallery.js";
|
||||||
|
import "./gather-static.js";
|
||||||
|
import "./gen-icons-json.js";
|
||||||
|
import "./hassio.js";
|
||||||
|
import "./landing-page.js";
|
||||||
|
import "./locale-data.js";
|
||||||
|
import "./rspack.js";
|
||||||
|
import "./service-worker.js";
|
||||||
|
import "./translations.js";
|
||||||
@@ -25,7 +25,7 @@ Home Assistant Cast is made up of two separate applications:
|
|||||||
|
|
||||||
### Setting dev variables
|
### Setting dev variables
|
||||||
|
|
||||||
Open `src/cast/dev_const.ts` and change `CAST_DEV_APP_ID` to the ID of the app you just created. And set the `CAST_DEV_HASS_URL` to the url of you development machine.
|
Open `src/cast/dev_const.ts` and change `CAST_DEV_APP_ID` to the ID of the app you just created. And set the `CAST_DEV_HASS_URL` to the url of your development machine.
|
||||||
|
|
||||||
### Changing configuration
|
### Changing configuration
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,6 @@
|
|||||||
<%= renderTemplate("../../../src/html/_style_base.html.template") %>
|
<%= renderTemplate("../../../src/html/_style_base.html.template") %>
|
||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
background-color: white;
|
|
||||||
font-size: initial;
|
font-size: initial;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import "@material/mwc-list/mwc-list";
|
|||||||
import type { ActionDetail } from "@material/mwc-list/mwc-list";
|
import type { ActionDetail } from "@material/mwc-list/mwc-list";
|
||||||
import { mdiCast, mdiCastConnected, mdiViewDashboard } from "@mdi/js";
|
import { mdiCast, mdiCastConnected, mdiViewDashboard } from "@mdi/js";
|
||||||
import type { Auth, Connection } from "home-assistant-js-websocket";
|
import type { Auth, Connection } from "home-assistant-js-websocket";
|
||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { TemplateResult } from "lit";
|
||||||
import { LitElement, css, html } from "lit";
|
import { LitElement, css, html } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import type { CastManager } from "../../../../src/cast/cast_manager";
|
import type { CastManager } from "../../../../src/cast/cast_manager";
|
||||||
@@ -203,74 +203,72 @@ class HcCast extends LitElement {
|
|||||||
}
|
}
|
||||||
this.connection.close();
|
this.connection.close();
|
||||||
location.reload();
|
location.reload();
|
||||||
} catch (err: any) {
|
} catch (_err: any) {
|
||||||
alert("Unable to log out!");
|
alert("Unable to log out!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static styles = css`
|
||||||
return css`
|
.center-item {
|
||||||
.center-item {
|
display: flex;
|
||||||
display: flex;
|
justify-content: space-around;
|
||||||
justify-content: space-around;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.action-item {
|
.action-item {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
}
|
}
|
||||||
|
|
||||||
.question {
|
.question {
|
||||||
position: relative;
|
position: relative;
|
||||||
padding: 8px 16px;
|
padding: 8px 16px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.question:before {
|
.question:before {
|
||||||
border-radius: 4px;
|
border-radius: 4px;
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 0;
|
top: 0;
|
||||||
right: 0;
|
right: 0;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
content: "";
|
content: "";
|
||||||
background-color: var(--primary-color);
|
background-color: var(--primary-color);
|
||||||
opacity: 0.12;
|
opacity: 0.12;
|
||||||
will-change: opacity;
|
will-change: opacity;
|
||||||
}
|
}
|
||||||
|
|
||||||
.connection,
|
.connection,
|
||||||
.connection a {
|
.connection a {
|
||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
mwc-button ha-svg-icon {
|
mwc-button ha-svg-icon {
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
margin-inline-end: 8px;
|
margin-inline-end: 8px;
|
||||||
margin-inline-start: initial;
|
margin-inline-start: initial;
|
||||||
height: 18px;
|
height: 18px;
|
||||||
}
|
}
|
||||||
|
|
||||||
ha-list-item ha-icon,
|
ha-list-item ha-icon,
|
||||||
ha-list-item ha-svg-icon {
|
ha-list-item ha-svg-icon {
|
||||||
padding: 12px;
|
padding: 12px;
|
||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
}
|
}
|
||||||
|
|
||||||
:host([hide-icons]) ha-icon {
|
:host([hide-icons]) ha-icon {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacer {
|
.spacer {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.card-content a {
|
.card-content a {
|
||||||
color: var(--primary-color);
|
color: var(--primary-color);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ import {
|
|||||||
ERR_INVALID_HTTPS_TO_HTTP,
|
ERR_INVALID_HTTPS_TO_HTTP,
|
||||||
getAuth,
|
getAuth,
|
||||||
} from "home-assistant-js-websocket";
|
} from "home-assistant-js-websocket";
|
||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { TemplateResult } from "lit";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
import type { CastManager } from "../../../../src/cast/cast_manager";
|
import type { CastManager } from "../../../../src/cast/cast_manager";
|
||||||
@@ -215,7 +215,7 @@ export class HcConnect extends LitElement {
|
|||||||
let url: URL;
|
let url: URL;
|
||||||
try {
|
try {
|
||||||
url = new URL(value);
|
url = new URL(value);
|
||||||
} catch (err: any) {
|
} catch (_err: any) {
|
||||||
this.error = "Invalid URL";
|
this.error = "Invalid URL";
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -252,7 +252,7 @@ export class HcConnect extends LitElement {
|
|||||||
this.loading = false;
|
this.loading = false;
|
||||||
return;
|
return;
|
||||||
} finally {
|
} finally {
|
||||||
// Clear url if we have a auth callback in url.
|
// Clear url if we have an auth callback in url.
|
||||||
if (location.search.includes("auth_callback=1")) {
|
if (location.search.includes("auth_callback=1")) {
|
||||||
history.replaceState(null, "", location.pathname);
|
history.replaceState(null, "", location.pathname);
|
||||||
}
|
}
|
||||||
@@ -288,41 +288,39 @@ export class HcConnect extends LitElement {
|
|||||||
try {
|
try {
|
||||||
saveTokens(null);
|
saveTokens(null);
|
||||||
location.reload();
|
location.reload();
|
||||||
} catch (err: any) {
|
} catch (_err: any) {
|
||||||
alert("Unable to log out!");
|
alert("Unable to log out!");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static styles = css`
|
||||||
return css`
|
.card-content a {
|
||||||
.card-content a {
|
color: var(--primary-color);
|
||||||
color: var(--primary-color);
|
}
|
||||||
}
|
.card-actions a {
|
||||||
.card-actions a {
|
text-decoration: none;
|
||||||
text-decoration: none;
|
}
|
||||||
}
|
.error {
|
||||||
.error {
|
color: red;
|
||||||
color: red;
|
font-weight: bold;
|
||||||
font-weight: bold;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.error a {
|
.error a {
|
||||||
color: darkred;
|
color: darkred;
|
||||||
}
|
}
|
||||||
|
|
||||||
mwc-button ha-svg-icon {
|
mwc-button ha-svg-icon {
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.spacer {
|
.spacer {
|
||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ha-textfield {
|
ha-textfield {
|
||||||
width: 100%;
|
width: 100%;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import type { Auth, Connection, HassUser } from "home-assistant-js-websocket";
|
import type { Auth, Connection, HassUser } from "home-assistant-js-websocket";
|
||||||
import { getUser } from "home-assistant-js-websocket";
|
import { getUser } from "home-assistant-js-websocket";
|
||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { TemplateResult } from "lit";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import "../../../../src/components/ha-card";
|
import "../../../../src/components/ha-card";
|
||||||
@@ -63,96 +63,94 @@ class HcLayout extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static styles = css`
|
||||||
return css`
|
:host {
|
||||||
|
display: flex;
|
||||||
|
min-height: 100%;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
ha-card {
|
||||||
|
display: flex;
|
||||||
|
width: 100%;
|
||||||
|
max-width: 500px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.layout {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header {
|
||||||
|
color: var(--ha-card-header-color, var(--primary-text-color));
|
||||||
|
font-family: var(--ha-card-header-font-family, inherit);
|
||||||
|
font-size: var(--ha-card-header-font-size, 24px);
|
||||||
|
letter-spacing: -0.012em;
|
||||||
|
line-height: 32px;
|
||||||
|
padding: 24px 16px 16px;
|
||||||
|
display: block;
|
||||||
|
margin: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
.hero {
|
||||||
|
border-radius: 4px 4px 0 0;
|
||||||
|
}
|
||||||
|
.subtitle {
|
||||||
|
font-size: 14px;
|
||||||
|
color: var(--secondary-text-color);
|
||||||
|
line-height: initial;
|
||||||
|
}
|
||||||
|
.subtitle a {
|
||||||
|
color: var(--secondary-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
:host ::slotted(.card-content:not(:first-child)),
|
||||||
|
slot:not(:first-child)::slotted(.card-content) {
|
||||||
|
padding-top: 0px;
|
||||||
|
margin-top: -8px;
|
||||||
|
}
|
||||||
|
|
||||||
|
:host ::slotted(.section-header) {
|
||||||
|
font-weight: 500;
|
||||||
|
padding: 4px 16px;
|
||||||
|
text-transform: uppercase;
|
||||||
|
}
|
||||||
|
|
||||||
|
:host ::slotted(.card-content) {
|
||||||
|
padding: 16px;
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
:host ::slotted(.card-actions) {
|
||||||
|
border-top: 1px solid #e8e8e8;
|
||||||
|
padding: 5px 16px;
|
||||||
|
display: flex;
|
||||||
|
}
|
||||||
|
|
||||||
|
img {
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.footer {
|
||||||
|
text-align: center;
|
||||||
|
font-size: 12px;
|
||||||
|
padding: 8px 0 24px;
|
||||||
|
color: var(--secondary-text-color);
|
||||||
|
}
|
||||||
|
.footer a {
|
||||||
|
color: var(--secondary-text-color);
|
||||||
|
}
|
||||||
|
|
||||||
|
@media all and (max-width: 500px) {
|
||||||
:host {
|
:host {
|
||||||
display: flex;
|
justify-content: flex-start;
|
||||||
min-height: 100%;
|
min-height: 90%;
|
||||||
align-items: center;
|
margin-bottom: 30px;
|
||||||
justify-content: center;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ha-card {
|
`;
|
||||||
display: flex;
|
|
||||||
width: 100%;
|
|
||||||
max-width: 500px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.layout {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-header {
|
|
||||||
color: var(--ha-card-header-color, var(--primary-text-color));
|
|
||||||
font-family: var(--ha-card-header-font-family, inherit);
|
|
||||||
font-size: var(--ha-card-header-font-size, 24px);
|
|
||||||
letter-spacing: -0.012em;
|
|
||||||
line-height: 32px;
|
|
||||||
padding: 24px 16px 16px;
|
|
||||||
display: block;
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
.hero {
|
|
||||||
border-radius: 4px 4px 0 0;
|
|
||||||
}
|
|
||||||
.subtitle {
|
|
||||||
font-size: 14px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
line-height: initial;
|
|
||||||
}
|
|
||||||
.subtitle a {
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
:host ::slotted(.card-content:not(:first-child)),
|
|
||||||
slot:not(:first-child)::slotted(.card-content) {
|
|
||||||
padding-top: 0px;
|
|
||||||
margin-top: -8px;
|
|
||||||
}
|
|
||||||
|
|
||||||
:host ::slotted(.section-header) {
|
|
||||||
font-weight: 500;
|
|
||||||
padding: 4px 16px;
|
|
||||||
text-transform: uppercase;
|
|
||||||
}
|
|
||||||
|
|
||||||
:host ::slotted(.card-content) {
|
|
||||||
padding: 16px;
|
|
||||||
flex: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
:host ::slotted(.card-actions) {
|
|
||||||
border-top: 1px solid #e8e8e8;
|
|
||||||
padding: 5px 16px;
|
|
||||||
display: flex;
|
|
||||||
}
|
|
||||||
|
|
||||||
img {
|
|
||||||
width: 100%;
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
text-align: center;
|
|
||||||
font-size: 12px;
|
|
||||||
padding: 8px 0 24px;
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
.footer a {
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
|
|
||||||
@media all and (max-width: 500px) {
|
|
||||||
:host {
|
|
||||||
justify-content: flex-start;
|
|
||||||
min-height: 90%;
|
|
||||||
margin-bottom: 30px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { TemplateResult } from "lit";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import type { HomeAssistant } from "../../../../src/types";
|
import type { HomeAssistant } from "../../../../src/types";
|
||||||
@@ -24,31 +24,29 @@ class HcLaunchScreen extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static styles = css`
|
||||||
return css`
|
:host {
|
||||||
:host {
|
display: block;
|
||||||
display: block;
|
height: 100vh;
|
||||||
height: 100vh;
|
background-color: #f2f4f9;
|
||||||
background-color: #f2f4f9;
|
font-size: 24px;
|
||||||
font-size: 24px;
|
}
|
||||||
}
|
.container {
|
||||||
.container {
|
display: flex;
|
||||||
display: flex;
|
flex-direction: column;
|
||||||
flex-direction: column;
|
text-align: center;
|
||||||
text-align: center;
|
align-items: center;
|
||||||
align-items: center;
|
height: 100%;
|
||||||
height: 100%;
|
justify-content: space-evenly;
|
||||||
justify-content: space-evenly;
|
}
|
||||||
}
|
img {
|
||||||
img {
|
max-width: 80%;
|
||||||
max-width: 80%;
|
object-fit: cover;
|
||||||
object-fit: cover;
|
}
|
||||||
}
|
.status {
|
||||||
.status {
|
color: #1d2126;
|
||||||
color: #1d2126;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -1,10 +1,4 @@
|
|||||||
import {
|
import { css, html, LitElement, type TemplateResult } from "lit";
|
||||||
css,
|
|
||||||
type CSSResultGroup,
|
|
||||||
html,
|
|
||||||
LitElement,
|
|
||||||
type TemplateResult,
|
|
||||||
} from "lit";
|
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
||||||
import type { LovelaceConfig } from "../../../../src/data/lovelace/config/types";
|
import type { LovelaceConfig } from "../../../../src/data/lovelace/config/types";
|
||||||
@@ -14,6 +8,7 @@ import "../../../../src/panels/lovelace/views/hui-view";
|
|||||||
import "../../../../src/panels/lovelace/views/hui-view-container";
|
import "../../../../src/panels/lovelace/views/hui-view-container";
|
||||||
import type { HomeAssistant } from "../../../../src/types";
|
import type { HomeAssistant } from "../../../../src/types";
|
||||||
import "./hc-launch-screen";
|
import "./hc-launch-screen";
|
||||||
|
import "../../../../src/panels/lovelace/views/hui-view-background";
|
||||||
|
|
||||||
(window as any).loadCardHelpers = () =>
|
(window as any).loadCardHelpers = () =>
|
||||||
import("../../../../src/panels/lovelace/custom-card-helpers");
|
import("../../../../src/panels/lovelace/custom-card-helpers");
|
||||||
@@ -57,11 +52,9 @@ class HcLovelace extends LitElement {
|
|||||||
const background = viewConfig.background || this.lovelaceConfig.background;
|
const background = viewConfig.background || this.lovelaceConfig.background;
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<hui-view-container
|
<hui-view-container .hass=${this.hass} .theme=${viewConfig.theme}>
|
||||||
.hass=${this.hass}
|
<hui-view-background .hass=${this.hass} .background=${background}>
|
||||||
.background=${background}
|
</hui-view-background>
|
||||||
.theme=${viewConfig.theme}
|
|
||||||
>
|
|
||||||
<hui-view
|
<hui-view
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
.lovelace=${lovelace}
|
.lovelace=${lovelace}
|
||||||
@@ -118,20 +111,18 @@ class HcLovelace extends LitElement {
|
|||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static styles = css`
|
||||||
return css`
|
hui-view-container {
|
||||||
hui-view-container {
|
display: flex;
|
||||||
display: flex;
|
position: relative;
|
||||||
position: relative;
|
min-height: 100vh;
|
||||||
min-height: 100vh;
|
box-sizing: border-box;
|
||||||
box-sizing: border-box;
|
}
|
||||||
}
|
hui-view-container > * {
|
||||||
hui-view {
|
flex: 1 1 100%;
|
||||||
flex: 1 1 100%;
|
max-width: 100%;
|
||||||
max-width: 100%;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface CastViewChanged {
|
export interface CastViewChanged {
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type { Lovelace } from "../../../src/panels/lovelace/types";
|
|||||||
import { energyEntities } from "../stubs/entities";
|
import { energyEntities } from "../stubs/entities";
|
||||||
import type { DemoConfig } from "./types";
|
import type { DemoConfig } from "./types";
|
||||||
|
|
||||||
export const demoConfigs: Array<() => Promise<DemoConfig>> = [
|
export const demoConfigs: (() => Promise<DemoConfig>)[] = [
|
||||||
() => import("./sections").then((mod) => mod.demoSections),
|
() => import("./sections").then((mod) => mod.demoSections),
|
||||||
() => import("./arsaboo").then((mod) => mod.demoArsaboo),
|
() => import("./arsaboo").then((mod) => mod.demoArsaboo),
|
||||||
() => import("./teachingbirds").then((mod) => mod.demoTeachingbirds),
|
() => import("./teachingbirds").then((mod) => mod.demoTeachingbirds),
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { mdiTelevision } from "@mdi/js";
|
import { mdiTelevision } from "@mdi/js";
|
||||||
import type { CSSResultGroup } from "lit";
|
|
||||||
import { css, html, LitElement, nothing } from "lit";
|
import { css, html, LitElement, nothing } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, state } from "lit/decorators";
|
||||||
import type { CastManager } from "../../../src/cast/cast_manager";
|
import type { CastManager } from "../../../src/cast/cast_manager";
|
||||||
@@ -67,37 +66,35 @@ class CastDemoRow extends LitElement implements LovelaceRow {
|
|||||||
this.style.display = this._castManager ? "" : "none";
|
this.style.display = this._castManager ? "" : "none";
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static styles = css`
|
||||||
return css`
|
:host {
|
||||||
:host {
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
}
|
||||||
}
|
ha-svg-icon {
|
||||||
ha-svg-icon {
|
padding: 8px;
|
||||||
padding: 8px;
|
color: var(--paper-item-icon-color);
|
||||||
color: var(--paper-item-icon-color);
|
}
|
||||||
}
|
.flex {
|
||||||
.flex {
|
flex: 1;
|
||||||
flex: 1;
|
overflow: hidden;
|
||||||
overflow: hidden;
|
margin-left: 16px;
|
||||||
margin-left: 16px;
|
display: flex;
|
||||||
display: flex;
|
justify-content: space-between;
|
||||||
justify-content: space-between;
|
align-items: center;
|
||||||
align-items: center;
|
}
|
||||||
}
|
.name {
|
||||||
.name {
|
white-space: nowrap;
|
||||||
white-space: nowrap;
|
overflow: hidden;
|
||||||
overflow: hidden;
|
text-overflow: ellipsis;
|
||||||
text-overflow: ellipsis;
|
}
|
||||||
}
|
google-cast-launcher {
|
||||||
google-cast-launcher {
|
cursor: pointer;
|
||||||
cursor: pointer;
|
display: inline-block;
|
||||||
display: inline-block;
|
height: 24px;
|
||||||
height: 24px;
|
width: 24px;
|
||||||
width: 24px;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -32,6 +32,7 @@ export class HADemoCard extends LitElement implements LovelaceCard {
|
|||||||
return this._hidden ? 0 : 2;
|
return this._hidden ? 0 : 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
public setConfig(_config: LovelaceCardConfig) {}
|
public setConfig(_config: LovelaceCardConfig) {}
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ export class HaDemo extends HomeAssistantAppEl {
|
|||||||
mockEntityRegistry(hass, [
|
mockEntityRegistry(hass, [
|
||||||
{
|
{
|
||||||
config_entry_id: "co2signal",
|
config_entry_id: "co2signal",
|
||||||
|
config_subentry_id: null,
|
||||||
device_id: "co2signal",
|
device_id: "co2signal",
|
||||||
area_id: null,
|
area_id: null,
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
@@ -85,6 +86,7 @@ export class HaDemo extends HomeAssistantAppEl {
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
config_entry_id: "co2signal",
|
config_entry_id: "co2signal",
|
||||||
|
config_subentry_id: null,
|
||||||
device_id: "co2signal",
|
device_id: "co2signal",
|
||||||
area_id: null,
|
area_id: null,
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export const mockConfigEntries = (hass: MockHomeAssistant) => {
|
|||||||
supports_remove_device: false,
|
supports_remove_device: false,
|
||||||
supports_unload: true,
|
supports_unload: true,
|
||||||
supports_reconfigure: true,
|
supports_reconfigure: true,
|
||||||
|
supported_subentry_types: {},
|
||||||
pref_disable_new_entities: false,
|
pref_disable_new_entities: false,
|
||||||
pref_disable_polling: false,
|
pref_disable_polling: false,
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
|
|||||||
@@ -131,6 +131,7 @@ export const mockHistory = (mockHass: MockHomeAssistant) => {
|
|||||||
});
|
});
|
||||||
}, 1);
|
}, 1);
|
||||||
|
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
return () => {};
|
return () => {};
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ customElements.whenDefined("hui-root").then(() => {
|
|||||||
const index = (ev as CustomEvent).detail.index;
|
const index = (ev as CustomEvent).detail.index;
|
||||||
try {
|
try {
|
||||||
await setDemoConfig(this.hass, this.lovelace!, index);
|
await setDemoConfig(this.hass, this.lovelace!, index);
|
||||||
} catch (err: any) {
|
} catch (_err: any) {
|
||||||
setDemoConfig(this.hass, this.lovelace!, selectedDemoConfigIndex);
|
setDemoConfig(this.hass, this.lovelace!, selectedDemoConfigIndex);
|
||||||
alert("Failed to switch config :-(");
|
alert("Failed to switch config :-(");
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ export const mockPersistentNotification = (hass: MockHomeAssistant) => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
} as PersistentNotificationMessage);
|
} as PersistentNotificationMessage);
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
return () => {};
|
return () => {};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ import type { MockHomeAssistant } from "../../../src/fake_data/provide_hass";
|
|||||||
const generateMeanStatistics = (
|
const generateMeanStatistics = (
|
||||||
start: Date,
|
start: Date,
|
||||||
end: Date,
|
end: Date,
|
||||||
// eslint-disable-next-line @typescript-eslint/default-param-last
|
// eslint-disable-next-line default-param-last
|
||||||
period: "5minute" | "hour" | "day" | "month" = "hour",
|
period: "5minute" | "hour" | "day" | "month" = "hour",
|
||||||
initValue: number,
|
initValue: number,
|
||||||
maxDiff: number
|
maxDiff: number
|
||||||
@@ -52,7 +52,7 @@ const generateMeanStatistics = (
|
|||||||
const generateSumStatistics = (
|
const generateSumStatistics = (
|
||||||
start: Date,
|
start: Date,
|
||||||
end: Date,
|
end: Date,
|
||||||
// eslint-disable-next-line @typescript-eslint/default-param-last
|
// eslint-disable-next-line default-param-last
|
||||||
period: "5minute" | "hour" | "day" | "month" = "hour",
|
period: "5minute" | "hour" | "day" | "month" = "hour",
|
||||||
initValue: number,
|
initValue: number,
|
||||||
maxDiff: number
|
maxDiff: number
|
||||||
@@ -89,7 +89,7 @@ const generateSumStatistics = (
|
|||||||
const generateCurvedStatistics = (
|
const generateCurvedStatistics = (
|
||||||
start: Date,
|
start: Date,
|
||||||
end: Date,
|
end: Date,
|
||||||
// eslint-disable-next-line @typescript-eslint/default-param-last
|
// eslint-disable-next-line default-param-last
|
||||||
_period: "5minute" | "hour" | "day" | "month" = "hour",
|
_period: "5minute" | "hour" | "day" | "month" = "hour",
|
||||||
initValue: number,
|
initValue: number,
|
||||||
maxDiff: number,
|
maxDiff: number,
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ export const mockTemplate = (hass: MockHomeAssistant) => {
|
|||||||
result: msg.template,
|
result: msg.template,
|
||||||
listeners: { all: false, domains: [], entities: [], time: false },
|
listeners: { all: false, domains: [], entities: [], time: false },
|
||||||
});
|
});
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
return () => {};
|
return () => {};
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -22,5 +22,6 @@ export const mockTodo = (hass: MockHomeAssistant) => {
|
|||||||
},
|
},
|
||||||
] as TodoItem[],
|
] as TodoItem[],
|
||||||
}));
|
}));
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
||||||
hass.mockWS("todo/item/subscribe", (_msg, _hass) => () => {});
|
hass.mockWS("todo/item/subscribe", (_msg, _hass) => () => {});
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -18,8 +18,9 @@ const compat = new FlatCompat({
|
|||||||
export default [
|
export default [
|
||||||
...compat.extends(
|
...compat.extends(
|
||||||
"airbnb-base",
|
"airbnb-base",
|
||||||
"airbnb-typescript/base",
|
|
||||||
"plugin:@typescript-eslint/recommended",
|
"plugin:@typescript-eslint/recommended",
|
||||||
|
"plugin:@typescript-eslint/strict",
|
||||||
|
"plugin:@typescript-eslint/stylistic",
|
||||||
"plugin:wc/recommended",
|
"plugin:wc/recommended",
|
||||||
"plugin:lit/all",
|
"plugin:lit/all",
|
||||||
"plugin:lit-a11y/recommended",
|
"plugin:lit-a11y/recommended",
|
||||||
@@ -50,8 +51,6 @@ export default [
|
|||||||
ecmaFeatures: {
|
ecmaFeatures: {
|
||||||
modules: true,
|
modules: true,
|
||||||
},
|
},
|
||||||
|
|
||||||
project: "./tsconfig.json",
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -148,15 +147,15 @@ export default [
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|
||||||
"@typescript-eslint/no-unused-vars": "off",
|
"@typescript-eslint/no-unused-vars": [
|
||||||
|
|
||||||
"unused-imports/no-unused-vars": [
|
|
||||||
"error",
|
"error",
|
||||||
{
|
{
|
||||||
vars: "all",
|
args: "all",
|
||||||
varsIgnorePattern: "^_",
|
|
||||||
args: "after-used",
|
|
||||||
argsIgnorePattern: "^_",
|
argsIgnorePattern: "^_",
|
||||||
|
caughtErrors: "all",
|
||||||
|
caughtErrorsIgnorePattern: "^_",
|
||||||
|
destructuredArrayIgnorePattern: "^_",
|
||||||
|
varsIgnorePattern: "^_",
|
||||||
ignoreRestSiblings: true,
|
ignoreRestSiblings: true,
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -174,6 +173,16 @@ export default [
|
|||||||
"lit-a11y/role-has-required-aria-attrs": "error",
|
"lit-a11y/role-has-required-aria-attrs": "error",
|
||||||
"@typescript-eslint/consistent-type-imports": "error",
|
"@typescript-eslint/consistent-type-imports": "error",
|
||||||
"@typescript-eslint/no-import-type-side-effects": "error",
|
"@typescript-eslint/no-import-type-side-effects": "error",
|
||||||
|
camelcase: "off",
|
||||||
|
"@typescript-eslint/no-dynamic-delete": "off",
|
||||||
|
"@typescript-eslint/no-empty-object-type": [
|
||||||
|
"error",
|
||||||
|
{
|
||||||
|
allowInterfaces: "always",
|
||||||
|
allowObjectTypes: "always",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
"no-use-before-define": "off",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ In most cases, Create can be paired with Delete, and Add can be paired with Remo
|
|||||||
|
|
||||||
## Add
|
## Add
|
||||||
|
|
||||||
An already-exisiting item.
|
An already-existing item.
|
||||||
|
|
||||||
For example:
|
For example:
|
||||||
|
|
||||||
|
|||||||
@@ -177,26 +177,24 @@ export class DemoAutomationDescribeAction extends LitElement {
|
|||||||
this._action = ev.detail.isValid ? ev.detail.value : undefined;
|
this._action = ev.detail.isValid ? ev.detail.value : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
.action {
|
||||||
.action {
|
padding: 16px;
|
||||||
padding: 16px;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
justify-content: space-between;
|
||||||
justify-content: space-between;
|
}
|
||||||
}
|
span {
|
||||||
span {
|
margin-right: 16px;
|
||||||
margin-right: 16px;
|
}
|
||||||
}
|
ha-yaml-editor {
|
||||||
ha-yaml-editor {
|
width: 50%;
|
||||||
width: 50%;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -98,26 +98,24 @@ export class DemoAutomationDescribeCondition extends LitElement {
|
|||||||
this._condition = ev.detail.isValid ? ev.detail.value : undefined;
|
this._condition = ev.detail.isValid ? ev.detail.value : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
.condition {
|
||||||
.condition {
|
padding: 16px;
|
||||||
padding: 16px;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
justify-content: space-between;
|
||||||
justify-content: space-between;
|
}
|
||||||
}
|
span {
|
||||||
span {
|
margin-right: 16px;
|
||||||
margin-right: 16px;
|
}
|
||||||
}
|
ha-yaml-editor {
|
||||||
ha-yaml-editor {
|
width: 50%;
|
||||||
width: 50%;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -121,26 +121,24 @@ export class DemoAutomationDescribeTrigger extends LitElement {
|
|||||||
this._trigger = ev.detail.isValid ? ev.detail.value : undefined;
|
this._trigger = ev.detail.isValid ? ev.detail.value : undefined;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
.trigger {
|
||||||
.trigger {
|
padding: 16px;
|
||||||
padding: 16px;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
justify-content: space-between;
|
||||||
justify-content: space-between;
|
}
|
||||||
}
|
span {
|
||||||
span {
|
margin-right: 16px;
|
||||||
margin-right: 16px;
|
}
|
||||||
}
|
ha-yaml-editor {
|
||||||
ha-yaml-editor {
|
width: 50%;
|
||||||
width: 50%;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -58,22 +58,20 @@ export class DemoAutomationTraceTimeline extends LitElement {
|
|||||||
hass.updateTranslations("config", "en");
|
hass.updateTranslations("config", "en");
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px;
|
||||||
margin: 24px;
|
}
|
||||||
}
|
.card-content {
|
||||||
.card-content {
|
display: flex;
|
||||||
display: flex;
|
}
|
||||||
}
|
button {
|
||||||
button {
|
position: absolute;
|
||||||
position: absolute;
|
top: 0;
|
||||||
top: 0;
|
right: 0;
|
||||||
right: 0;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -68,28 +68,26 @@ export class DemoAutomationTrace extends LitElement {
|
|||||||
this._selected = { ...this._selected, [sampleIdx]: ev.detail.path };
|
this._selected = { ...this._selected, [sampleIdx]: ev.detail.path };
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px;
|
||||||
margin: 24px;
|
}
|
||||||
}
|
.card-content {
|
||||||
.card-content {
|
display: flex;
|
||||||
display: flex;
|
}
|
||||||
}
|
.card-content > * {
|
||||||
.card-content > * {
|
margin-right: 16px;
|
||||||
margin-right: 16px;
|
}
|
||||||
}
|
.card-content > *:last-child {
|
||||||
.card-content > *:last-child {
|
margin-right: 0;
|
||||||
margin-right: 0;
|
}
|
||||||
}
|
button {
|
||||||
button {
|
position: absolute;
|
||||||
position: absolute;
|
top: 0;
|
||||||
top: 0;
|
right: 0;
|
||||||
right: 0;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ The alert offers four severity levels that set a distinctive icon and color.
|
|||||||
</ha-alert>
|
</ha-alert>
|
||||||
|
|
||||||
<ha-alert alert-type="warning">
|
<ha-alert alert-type="warning">
|
||||||
This is an warning alert — check it out!
|
This is a warning alert — check it out!
|
||||||
</ha-alert>
|
</ha-alert>
|
||||||
|
|
||||||
<ha-alert alert-type="info">
|
<ha-alert alert-type="info">
|
||||||
@@ -27,7 +27,7 @@ The alert offers four severity levels that set a distinctive icon and color.
|
|||||||
</ha-alert>
|
</ha-alert>
|
||||||
|
|
||||||
<ha-alert alert-type="success">
|
<ha-alert alert-type="success">
|
||||||
This is an success alert — check it out!
|
This is a success alert — check it out!
|
||||||
</ha-alert>
|
</ha-alert>
|
||||||
|
|
||||||
**Note:** This component is by <a href="https://mui.com/components/alert/" rel="noopener noreferrer" target="_blank">MUI</a> and is not documented in the <a href="https://material.io" rel="noopener noreferrer" target="_blank">Material Design guidelines</a>.
|
**Note:** This component is by <a href="https://mui.com/components/alert/" rel="noopener noreferrer" target="_blank">MUI</a> and is not documented in the <a href="https://material.io" rel="noopener noreferrer" target="_blank">Material Design guidelines</a>.
|
||||||
@@ -95,7 +95,7 @@ Actions must have a tab index of 0 so that they can be reached by keyboard-only
|
|||||||
</ha-alert>
|
</ha-alert>
|
||||||
|
|
||||||
<ha-alert alert-type="warning">
|
<ha-alert alert-type="warning">
|
||||||
This is an warning alert — check it out!
|
This is a warning alert — check it out!
|
||||||
</ha-alert>
|
</ha-alert>
|
||||||
|
|
||||||
<ha-alert alert-type="info">
|
<ha-alert alert-type="info">
|
||||||
@@ -103,7 +103,7 @@ Actions must have a tab index of 0 so that they can be reached by keyboard-only
|
|||||||
</ha-alert>
|
</ha-alert>
|
||||||
|
|
||||||
<ha-alert alert-type="success">
|
<ha-alert alert-type="success">
|
||||||
This is an success alert — check it out!
|
This is a success alert — check it out!
|
||||||
</ha-alert>
|
</ha-alert>
|
||||||
|
|
||||||
```html
|
```html
|
||||||
@@ -122,37 +122,37 @@ Actions must have a tab index of 0 so that they can be reached by keyboard-only
|
|||||||
The `title ` option should not be used without a description.
|
The `title ` option should not be used without a description.
|
||||||
|
|
||||||
<ha-alert alert-type="success" title="Success">
|
<ha-alert alert-type="success" title="Success">
|
||||||
This is an success alert — check it out!
|
This is a success alert — check it out!
|
||||||
</ha-alert>
|
</ha-alert>
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<ha-alert alert-type="success" title="Success">
|
<ha-alert alert-type="success" title="Success">
|
||||||
This is an success alert — check it out!
|
This is a success alert — check it out!
|
||||||
</ha-alert>
|
</ha-alert>
|
||||||
```
|
```
|
||||||
|
|
||||||
**Dismissable**
|
**Dismissable**
|
||||||
|
|
||||||
<ha-alert alert-type="success" dismissable>
|
<ha-alert alert-type="success" dismissable>
|
||||||
This is an success alert — check it out!
|
This is a success alert — check it out!
|
||||||
</ha-alert>
|
</ha-alert>
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<ha-alert alert-type="success" dismissable>
|
<ha-alert alert-type="success" dismissable>
|
||||||
This is an success alert — check it out!
|
This is a success alert — check it out!
|
||||||
</ha-alert>
|
</ha-alert>
|
||||||
```
|
```
|
||||||
|
|
||||||
**Slotted action**
|
**Slotted action**
|
||||||
|
|
||||||
<ha-alert alert-type="success">
|
<ha-alert alert-type="success">
|
||||||
This is an success alert — check it out!
|
This is a success alert — check it out!
|
||||||
<mwc-button slot="action" label="Undo"></mwc-button>
|
<mwc-button slot="action" label="Undo"></mwc-button>
|
||||||
</ha-alert>
|
</ha-alert>
|
||||||
|
|
||||||
```html
|
```html
|
||||||
<ha-alert alert-type="success">
|
<ha-alert alert-type="success">
|
||||||
This is an success alert — check it out!
|
This is a success alert — check it out!
|
||||||
<mwc-button slot="action" label="Undo"></mwc-button>
|
<mwc-button slot="action" label="Undo"></mwc-button>
|
||||||
</ha-alert>
|
</ha-alert>
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -177,46 +177,44 @@ export class DemoHaAlert extends LitElement {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
:host {
|
||||||
:host {
|
display: flex;
|
||||||
display: flex;
|
flex-direction: row;
|
||||||
flex-direction: row;
|
justify-content: space-between;
|
||||||
justify-content: space-between;
|
}
|
||||||
}
|
.dark,
|
||||||
.dark,
|
.light {
|
||||||
.light {
|
display: block;
|
||||||
display: block;
|
background-color: var(--primary-background-color);
|
||||||
background-color: var(--primary-background-color);
|
padding: 0 50px;
|
||||||
padding: 0 50px;
|
}
|
||||||
}
|
ha-card {
|
||||||
ha-card {
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
ha-alert {
|
||||||
ha-alert {
|
display: block;
|
||||||
display: block;
|
margin: 24px 0;
|
||||||
margin: 24px 0;
|
}
|
||||||
}
|
.condition {
|
||||||
.condition {
|
padding: 16px;
|
||||||
padding: 16px;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
justify-content: space-between;
|
||||||
justify-content: space-between;
|
}
|
||||||
}
|
.image {
|
||||||
.image {
|
display: inline-flex;
|
||||||
display: inline-flex;
|
height: 100%;
|
||||||
height: 100%;
|
align-items: center;
|
||||||
align-items: center;
|
}
|
||||||
}
|
img {
|
||||||
img {
|
max-height: 24px;
|
||||||
max-height: 24px;
|
width: 24px;
|
||||||
width: 24px;
|
}
|
||||||
}
|
mwc-button {
|
||||||
mwc-button {
|
--mdc-theme-primary: var(--primary-text-color);
|
||||||
--mdc-theme-primary: var(--primary-text-color);
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -63,20 +63,18 @@ export class DemoHaBar extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
.warning {
|
||||||
.warning {
|
--ha-bar-primary-color: var(--warning-color);
|
||||||
--ha-bar-primary-color: var(--warning-color);
|
}
|
||||||
}
|
.error {
|
||||||
.error {
|
--ha-bar-primary-color: var(--error-color);
|
||||||
--ha-bar-primary-color: var(--error-color);
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -103,19 +103,17 @@ export class DemoHaChips extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
.card-content {
|
||||||
.card-content {
|
display: flex;
|
||||||
display: flex;
|
flex-direction: column;
|
||||||
flex-direction: column;
|
align-items: flex-start;
|
||||||
align-items: flex-start;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -48,14 +48,12 @@ export class DemoHaCircularProgress extends LitElement {
|
|||||||
></ha-card>`;
|
></ha-card>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -14,12 +14,12 @@ import "../../../../src/components/ha-card";
|
|||||||
import "../../../../src/components/ha-svg-icon";
|
import "../../../../src/components/ha-svg-icon";
|
||||||
import "../../../../src/components/ha-control-button-group";
|
import "../../../../src/components/ha-control-button-group";
|
||||||
|
|
||||||
type Button = {
|
interface Button {
|
||||||
label: string;
|
label: string;
|
||||||
icon?: string;
|
icon?: string;
|
||||||
class?: string;
|
class?: string;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
};
|
}
|
||||||
|
|
||||||
const buttons: Button[] = [
|
const buttons: Button[] = [
|
||||||
{
|
{
|
||||||
@@ -35,10 +35,10 @@ const buttons: Button[] = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
type ButtonGroup = {
|
interface ButtonGroup {
|
||||||
vertical?: boolean;
|
vertical?: boolean;
|
||||||
class?: string;
|
class?: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
const buttonGroups: ButtonGroup[] = [
|
const buttonGroups: ButtonGroup[] = [
|
||||||
{},
|
{},
|
||||||
@@ -137,53 +137,51 @@ export class DemoHaBarButton extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
pre {
|
||||||
pre {
|
margin-top: 0;
|
||||||
margin-top: 0;
|
margin-bottom: 8px;
|
||||||
margin-bottom: 8px;
|
}
|
||||||
}
|
p {
|
||||||
p {
|
margin: 0;
|
||||||
margin: 0;
|
}
|
||||||
}
|
label {
|
||||||
label {
|
font-weight: 600;
|
||||||
font-weight: 600;
|
}
|
||||||
}
|
.custom {
|
||||||
.custom {
|
--control-button-icon-color: var(--primary-color);
|
||||||
--control-button-icon-color: var(--primary-color);
|
--control-button-background-color: var(--primary-color);
|
||||||
--control-button-background-color: var(--primary-color);
|
--control-button-background-opacity: 0.2;
|
||||||
--control-button-background-opacity: 0.2;
|
--control-button-border-radius: 18px;
|
||||||
--control-button-border-radius: 18px;
|
height: 100px;
|
||||||
height: 100px;
|
width: 100px;
|
||||||
width: 100px;
|
}
|
||||||
}
|
.custom-group {
|
||||||
.custom-group {
|
--control-button-group-thickness: 100px;
|
||||||
--control-button-group-thickness: 100px;
|
--control-button-group-border-radius: 36px;
|
||||||
--control-button-group-border-radius: 36px;
|
--control-button-group-spacing: 20px;
|
||||||
--control-button-group-spacing: 20px;
|
}
|
||||||
}
|
.custom-group ha-control-button {
|
||||||
.custom-group ha-control-button {
|
--control-button-border-radius: 18px;
|
||||||
--control-button-border-radius: 18px;
|
--mdc-icon-size: 32px;
|
||||||
--mdc-icon-size: 32px;
|
}
|
||||||
}
|
.vertical-buttons {
|
||||||
.vertical-buttons {
|
height: 300px;
|
||||||
height: 300px;
|
display: flex;
|
||||||
display: flex;
|
flex-direction: row;
|
||||||
flex-direction: row;
|
justify-content: space-between;
|
||||||
justify-content: space-between;
|
}
|
||||||
}
|
p.title {
|
||||||
p.title {
|
margin-bottom: 12px;
|
||||||
margin-bottom: 12px;
|
}
|
||||||
}
|
.vertical-switches > *:not(:last-child) {
|
||||||
.vertical-switches > *:not(:last-child) {
|
margin-right: 4px;
|
||||||
margin-right: 4px;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -133,39 +133,37 @@ export class DemoHaCircularSlider extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
pre {
|
||||||
pre {
|
margin-top: 0;
|
||||||
margin-top: 0;
|
margin-bottom: 8px;
|
||||||
margin-bottom: 8px;
|
}
|
||||||
}
|
p {
|
||||||
p {
|
margin: 0;
|
||||||
margin: 0;
|
}
|
||||||
}
|
p.title {
|
||||||
p.title {
|
margin-bottom: 12px;
|
||||||
margin-bottom: 12px;
|
}
|
||||||
}
|
ha-control-circular-slider {
|
||||||
ha-control-circular-slider {
|
--control-circular-slider-color: #ff9800;
|
||||||
--control-circular-slider-color: #ff9800;
|
}
|
||||||
}
|
ha-control-circular-slider[inverted] {
|
||||||
ha-control-circular-slider[inverted] {
|
--control-circular-slider-color: #2196f3;
|
||||||
--control-circular-slider-color: #2196f3;
|
}
|
||||||
}
|
ha-control-circular-slider[dual] {
|
||||||
ha-control-circular-slider[dual] {
|
--control-circular-slider-high-color: #2196f3;
|
||||||
--control-circular-slider-high-color: #2196f3;
|
--control-circular-slider-low-color: #ff9800;
|
||||||
--control-circular-slider-low-color: #ff9800;
|
}
|
||||||
}
|
.field {
|
||||||
.field {
|
display: flex;
|
||||||
display: flex;
|
flex-direction: row;
|
||||||
flex-direction: row;
|
align-items: center;
|
||||||
align-items: center;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -73,32 +73,30 @@ export class DemoHarControlNumberButtons extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
pre {
|
||||||
pre {
|
margin-top: 0;
|
||||||
margin-top: 0;
|
margin-bottom: 8px;
|
||||||
margin-bottom: 8px;
|
}
|
||||||
}
|
p {
|
||||||
p {
|
margin: 0;
|
||||||
margin: 0;
|
}
|
||||||
}
|
label {
|
||||||
label {
|
font-weight: 600;
|
||||||
font-weight: 600;
|
}
|
||||||
}
|
.custom {
|
||||||
.custom {
|
color: #2196f3;
|
||||||
color: #2196f3;
|
--control-number-buttons-color: #2196f3;
|
||||||
--control-number-buttons-color: #2196f3;
|
--control-number-buttons-background-color: #2196f3;
|
||||||
--control-number-buttons-background-color: #2196f3;
|
--control-number-buttons-background-opacity: 0.1;
|
||||||
--control-number-buttons-background-opacity: 0.1;
|
--control-number-buttons-thickness: 100px;
|
||||||
--control-number-buttons-thickness: 100px;
|
--control-number-buttons-border-radius: 36px;
|
||||||
--control-number-buttons-border-radius: 36px;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -8,19 +8,19 @@ import "../../../../src/components/ha-control-select-menu";
|
|||||||
import "../../../../src/components/ha-list-item";
|
import "../../../../src/components/ha-list-item";
|
||||||
import "../../../../src/components/ha-svg-icon";
|
import "../../../../src/components/ha-svg-icon";
|
||||||
|
|
||||||
type SelectMenuOptions = {
|
interface SelectMenuOptions {
|
||||||
label: string;
|
label: string;
|
||||||
value: string;
|
value: string;
|
||||||
icon?: string;
|
icon?: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
type SelectMenu = {
|
interface SelectMenu {
|
||||||
label: string;
|
label: string;
|
||||||
icon: string;
|
icon: string;
|
||||||
class?: string;
|
class?: string;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
options: SelectMenuOptions[];
|
options: SelectMenuOptions[];
|
||||||
};
|
}
|
||||||
|
|
||||||
const selects: SelectMenu[] = [
|
const selects: SelectMenu[] = [
|
||||||
{
|
{
|
||||||
@@ -112,32 +112,30 @@ export class DemoHaControlSelectMenu extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
pre {
|
||||||
pre {
|
margin-top: 0;
|
||||||
margin-top: 0;
|
margin-bottom: 8px;
|
||||||
margin-bottom: 8px;
|
}
|
||||||
}
|
p {
|
||||||
p {
|
margin: 0;
|
||||||
margin: 0;
|
}
|
||||||
}
|
label {
|
||||||
label {
|
font-weight: 600;
|
||||||
font-weight: 600;
|
}
|
||||||
}
|
.custom {
|
||||||
.custom {
|
--control-button-icon-color: var(--primary-color);
|
||||||
--control-button-icon-color: var(--primary-color);
|
--control-button-background-color: var(--primary-color);
|
||||||
--control-button-background-color: var(--primary-color);
|
--control-button-background-opacity: 0.2;
|
||||||
--control-button-background-opacity: 0.2;
|
--control-button-border-radius: 18px;
|
||||||
--control-button-border-radius: 18px;
|
height: 100px;
|
||||||
height: 100px;
|
width: 100px;
|
||||||
width: 100px;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -168,42 +168,40 @@ export class DemoHaControlSelect extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
pre {
|
||||||
pre {
|
margin-top: 0;
|
||||||
margin-top: 0;
|
margin-bottom: 8px;
|
||||||
margin-bottom: 8px;
|
}
|
||||||
}
|
p {
|
||||||
p {
|
margin: 0;
|
||||||
margin: 0;
|
}
|
||||||
}
|
label {
|
||||||
label {
|
font-weight: 600;
|
||||||
font-weight: 600;
|
}
|
||||||
}
|
.custom {
|
||||||
.custom {
|
--mdc-icon-size: 24px;
|
||||||
--mdc-icon-size: 24px;
|
--control-select-color: var(--state-fan-active-color);
|
||||||
--control-select-color: var(--state-fan-active-color);
|
--control-select-thickness: 130px;
|
||||||
--control-select-thickness: 130px;
|
--control-select-border-radius: 36px;
|
||||||
--control-select-border-radius: 36px;
|
}
|
||||||
}
|
.vertical-selects {
|
||||||
.vertical-selects {
|
height: 300px;
|
||||||
height: 300px;
|
display: flex;
|
||||||
display: flex;
|
flex-direction: row;
|
||||||
flex-direction: row;
|
justify-content: space-between;
|
||||||
justify-content: space-between;
|
}
|
||||||
}
|
p.title {
|
||||||
p.title {
|
margin-bottom: 12px;
|
||||||
margin-bottom: 12px;
|
}
|
||||||
}
|
.vertical-selects > *:not(:last-child) {
|
||||||
.vertical-selects > *:not(:last-child) {
|
margin-right: 4px;
|
||||||
margin-right: 4px;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -131,43 +131,41 @@ export class DemoHaBarSlider extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
pre {
|
||||||
pre {
|
margin-top: 0;
|
||||||
margin-top: 0;
|
margin-bottom: 8px;
|
||||||
margin-bottom: 8px;
|
}
|
||||||
}
|
p {
|
||||||
p {
|
margin: 0;
|
||||||
margin: 0;
|
}
|
||||||
}
|
label {
|
||||||
label {
|
font-weight: 600;
|
||||||
font-weight: 600;
|
}
|
||||||
}
|
.custom {
|
||||||
.custom {
|
--control-slider-color: #ffcf4c;
|
||||||
--control-slider-color: #ffcf4c;
|
--control-slider-background: #ffcf4c;
|
||||||
--control-slider-background: #ffcf4c;
|
--control-slider-background-opacity: 0.2;
|
||||||
--control-slider-background-opacity: 0.2;
|
--control-slider-thickness: 130px;
|
||||||
--control-slider-thickness: 130px;
|
--control-slider-border-radius: 36px;
|
||||||
--control-slider-border-radius: 36px;
|
}
|
||||||
}
|
.vertical-sliders {
|
||||||
.vertical-sliders {
|
height: 300px;
|
||||||
height: 300px;
|
display: flex;
|
||||||
display: flex;
|
flex-direction: row;
|
||||||
flex-direction: row;
|
justify-content: space-between;
|
||||||
justify-content: space-between;
|
}
|
||||||
}
|
p.title {
|
||||||
p.title {
|
margin-bottom: 12px;
|
||||||
margin-bottom: 12px;
|
}
|
||||||
}
|
.vertical-sliders > *:not(:last-child) {
|
||||||
.vertical-sliders > *:not(:last-child) {
|
margin-right: 4px;
|
||||||
margin-right: 4px;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -99,44 +99,42 @@ export class DemoHaControlSwitch extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
pre {
|
||||||
pre {
|
margin-top: 0;
|
||||||
margin-top: 0;
|
margin-bottom: 8px;
|
||||||
margin-bottom: 8px;
|
}
|
||||||
}
|
p {
|
||||||
p {
|
margin: 0;
|
||||||
margin: 0;
|
}
|
||||||
}
|
label {
|
||||||
label {
|
font-weight: 600;
|
||||||
font-weight: 600;
|
}
|
||||||
}
|
.custom {
|
||||||
.custom {
|
--control-switch-on-color: var(--green-color);
|
||||||
--control-switch-on-color: var(--green-color);
|
--control-switch-off-color: var(--red-color);
|
||||||
--control-switch-off-color: var(--red-color);
|
--control-switch-thickness: 130px;
|
||||||
--control-switch-thickness: 130px;
|
--control-switch-border-radius: 36px;
|
||||||
--control-switch-border-radius: 36px;
|
--control-switch-padding: 6px;
|
||||||
--control-switch-padding: 6px;
|
--mdc-icon-size: 24px;
|
||||||
--mdc-icon-size: 24px;
|
}
|
||||||
}
|
.vertical-switches {
|
||||||
.vertical-switches {
|
height: 300px;
|
||||||
height: 300px;
|
display: flex;
|
||||||
display: flex;
|
flex-direction: row;
|
||||||
flex-direction: row;
|
justify-content: space-between;
|
||||||
justify-content: space-between;
|
}
|
||||||
}
|
p.title {
|
||||||
p.title {
|
margin-bottom: 12px;
|
||||||
margin-bottom: 12px;
|
}
|
||||||
}
|
.vertical-switches > *:not(:last-child) {
|
||||||
.vertical-switches > *:not(:last-child) {
|
margin-right: 4px;
|
||||||
margin-right: 4px;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -143,13 +143,11 @@ export class DemoHaExpansionPanel extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-expansion-panel {
|
||||||
ha-expansion-panel {
|
margin: -16px;
|
||||||
margin: -16px;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@ export class DemoHaFaded extends LitElement {
|
|||||||
<ha-faded><span>${LONG_TEXT}</span></ha-faded>
|
<ha-faded><span>${LONG_TEXT}</span></ha-faded>
|
||||||
<h3>No text</h3>
|
<h3>No text</h3>
|
||||||
<ha-faded><span></span></ha-faded>
|
<ha-faded><span></span></ha-faded>
|
||||||
<h3>Smal text</h3>
|
<h3>Small text</h3>
|
||||||
<ha-faded><span>${SMALL_TEXT}</span></ha-faded>
|
<ha-faded><span>${SMALL_TEXT}</span></ha-faded>
|
||||||
<h3>Long text in markdown</h3>
|
<h3>Long text in markdown</h3>
|
||||||
<ha-faded>
|
<ha-faded>
|
||||||
@@ -61,14 +61,12 @@ export class DemoHaFaded extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -48,6 +48,7 @@ const DEVICES: DeviceRegistryEntry[] = [
|
|||||||
area_id: "bedroom",
|
area_id: "bedroom",
|
||||||
configuration_url: null,
|
configuration_url: null,
|
||||||
config_entries: ["config_entry_1"],
|
config_entries: ["config_entry_1"],
|
||||||
|
config_entries_subentries: {},
|
||||||
connections: [],
|
connections: [],
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
entry_type: null,
|
entry_type: null,
|
||||||
@@ -71,6 +72,7 @@ const DEVICES: DeviceRegistryEntry[] = [
|
|||||||
area_id: "backyard",
|
area_id: "backyard",
|
||||||
configuration_url: null,
|
configuration_url: null,
|
||||||
config_entries: ["config_entry_2"],
|
config_entries: ["config_entry_2"],
|
||||||
|
config_entries_subentries: {},
|
||||||
connections: [],
|
connections: [],
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
entry_type: null,
|
entry_type: null,
|
||||||
@@ -94,6 +96,7 @@ const DEVICES: DeviceRegistryEntry[] = [
|
|||||||
area_id: null,
|
area_id: null,
|
||||||
configuration_url: null,
|
configuration_url: null,
|
||||||
config_entries: ["config_entry_3"],
|
config_entries: ["config_entry_3"],
|
||||||
|
config_entries_subentries: {},
|
||||||
connections: [],
|
connections: [],
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
entry_type: null,
|
entry_type: null,
|
||||||
@@ -124,6 +127,8 @@ const AREAS: AreaRegistryEntry[] = [
|
|||||||
picture: null,
|
picture: null,
|
||||||
aliases: [],
|
aliases: [],
|
||||||
labels: [],
|
labels: [],
|
||||||
|
temperature_entity_id: null,
|
||||||
|
humidity_entity_id: null,
|
||||||
created_at: 0,
|
created_at: 0,
|
||||||
modified_at: 0,
|
modified_at: 0,
|
||||||
},
|
},
|
||||||
@@ -135,6 +140,8 @@ const AREAS: AreaRegistryEntry[] = [
|
|||||||
picture: null,
|
picture: null,
|
||||||
aliases: [],
|
aliases: [],
|
||||||
labels: [],
|
labels: [],
|
||||||
|
temperature_entity_id: null,
|
||||||
|
humidity_entity_id: null,
|
||||||
created_at: 0,
|
created_at: 0,
|
||||||
modified_at: 0,
|
modified_at: 0,
|
||||||
},
|
},
|
||||||
@@ -146,6 +153,8 @@ const AREAS: AreaRegistryEntry[] = [
|
|||||||
picture: null,
|
picture: null,
|
||||||
aliases: [],
|
aliases: [],
|
||||||
labels: [],
|
labels: [],
|
||||||
|
temperature_entity_id: null,
|
||||||
|
humidity_entity_id: null,
|
||||||
created_at: 0,
|
created_at: 0,
|
||||||
modified_at: 0,
|
modified_at: 0,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ export class DemoHaHsColorPicker extends LitElement {
|
|||||||
@change=${this._saturationChanged}
|
@change=${this._saturationChanged}
|
||||||
>
|
>
|
||||||
</ha-slider>
|
</ha-slider>
|
||||||
<p>Color Brighness : ${this.brightness}</p>
|
<p>Color Brightness : ${this.brightness}</p>
|
||||||
<ha-slider
|
<ha-slider
|
||||||
labeled
|
labeled
|
||||||
step="1"
|
step="1"
|
||||||
@@ -91,27 +91,25 @@ export class DemoHaHsColorPicker extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
.card-content {
|
||||||
.card-content {
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
flex-direction: column;
|
||||||
flex-direction: column;
|
}
|
||||||
}
|
ha-hs-color-picker {
|
||||||
ha-hs-color-picker {
|
width: 400px;
|
||||||
width: 400px;
|
}
|
||||||
}
|
.value {
|
||||||
.value {
|
font-size: 22px;
|
||||||
font-size: 22px;
|
font-weight: bold;
|
||||||
font-weight: bold;
|
margin: 0 0 12px 0;
|
||||||
margin: 0 0 12px 0;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -95,25 +95,23 @@ export class DemoHaLabelBadge extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
pre {
|
||||||
pre {
|
margin-left: 16px;
|
||||||
margin-left: 16px;
|
background-color: var(--markdown-code-background-color);
|
||||||
background-color: var(--markdown-code-background-color);
|
padding: 8px;
|
||||||
padding: 8px;
|
}
|
||||||
}
|
.badge {
|
||||||
.badge {
|
display: flex;
|
||||||
display: flex;
|
flex-direction: row;
|
||||||
flex-direction: row;
|
margin-bottom: 16px;
|
||||||
margin-bottom: 16px;
|
align-items: center;
|
||||||
align-items: center;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -47,6 +47,7 @@ const DEVICES: DeviceRegistryEntry[] = [
|
|||||||
area_id: "bedroom",
|
area_id: "bedroom",
|
||||||
configuration_url: null,
|
configuration_url: null,
|
||||||
config_entries: ["config_entry_1"],
|
config_entries: ["config_entry_1"],
|
||||||
|
config_entries_subentries: {},
|
||||||
connections: [],
|
connections: [],
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
entry_type: null,
|
entry_type: null,
|
||||||
@@ -70,6 +71,7 @@ const DEVICES: DeviceRegistryEntry[] = [
|
|||||||
area_id: "backyard",
|
area_id: "backyard",
|
||||||
configuration_url: null,
|
configuration_url: null,
|
||||||
config_entries: ["config_entry_2"],
|
config_entries: ["config_entry_2"],
|
||||||
|
config_entries_subentries: {},
|
||||||
connections: [],
|
connections: [],
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
entry_type: null,
|
entry_type: null,
|
||||||
@@ -93,6 +95,7 @@ const DEVICES: DeviceRegistryEntry[] = [
|
|||||||
area_id: null,
|
area_id: null,
|
||||||
configuration_url: null,
|
configuration_url: null,
|
||||||
config_entries: ["config_entry_3"],
|
config_entries: ["config_entry_3"],
|
||||||
|
config_entries_subentries: {},
|
||||||
connections: [],
|
connections: [],
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
entry_type: null,
|
entry_type: null,
|
||||||
@@ -123,6 +126,8 @@ const AREAS: AreaRegistryEntry[] = [
|
|||||||
picture: null,
|
picture: null,
|
||||||
aliases: [],
|
aliases: [],
|
||||||
labels: [],
|
labels: [],
|
||||||
|
temperature_entity_id: null,
|
||||||
|
humidity_entity_id: null,
|
||||||
created_at: 0,
|
created_at: 0,
|
||||||
modified_at: 0,
|
modified_at: 0,
|
||||||
},
|
},
|
||||||
@@ -134,6 +139,8 @@ const AREAS: AreaRegistryEntry[] = [
|
|||||||
picture: null,
|
picture: null,
|
||||||
aliases: [],
|
aliases: [],
|
||||||
labels: [],
|
labels: [],
|
||||||
|
temperature_entity_id: null,
|
||||||
|
humidity_entity_id: null,
|
||||||
created_at: 0,
|
created_at: 0,
|
||||||
modified_at: 0,
|
modified_at: 0,
|
||||||
},
|
},
|
||||||
@@ -145,6 +152,8 @@ const AREAS: AreaRegistryEntry[] = [
|
|||||||
picture: null,
|
picture: null,
|
||||||
aliases: [],
|
aliases: [],
|
||||||
labels: [],
|
labels: [],
|
||||||
|
temperature_entity_id: null,
|
||||||
|
humidity_entity_id: null,
|
||||||
created_at: 0,
|
created_at: 0,
|
||||||
modified_at: 0,
|
modified_at: 0,
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -48,27 +48,25 @@ export class DemoHaTip extends LitElement {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
:host {
|
||||||
:host {
|
display: flex;
|
||||||
display: flex;
|
flex-direction: row;
|
||||||
flex-direction: row;
|
justify-content: space-between;
|
||||||
justify-content: space-between;
|
}
|
||||||
}
|
.dark,
|
||||||
.dark,
|
.light {
|
||||||
.light {
|
display: block;
|
||||||
display: block;
|
background-color: var(--primary-background-color);
|
||||||
background-color: var(--primary-background-color);
|
padding: 0 50px;
|
||||||
padding: 0 50px;
|
}
|
||||||
}
|
ha-tip {
|
||||||
ha-tip {
|
margin-bottom: 14px;
|
||||||
margin-bottom: 14px;
|
}
|
||||||
}
|
ha-card {
|
||||||
ha-card {
|
margin: 24px auto;
|
||||||
margin: 24px auto;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -100,32 +100,30 @@ export class DemoDateTimeDateTimeNumeric extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-control-select {
|
||||||
ha-control-select {
|
max-width: 800px;
|
||||||
max-width: 800px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
}
|
||||||
}
|
.header {
|
||||||
.header {
|
font-weight: bold;
|
||||||
font-weight: bold;
|
}
|
||||||
}
|
.center {
|
||||||
.center {
|
text-align: center;
|
||||||
text-align: center;
|
}
|
||||||
}
|
.container {
|
||||||
.container {
|
max-width: 900px;
|
||||||
max-width: 900px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
justify-content: space-evenly;
|
||||||
justify-content: space-evenly;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.container > div {
|
.container > div {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -100,32 +100,30 @@ export class DemoDateTimeDateTimeSeconds extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-control-select {
|
||||||
ha-control-select {
|
max-width: 800px;
|
||||||
max-width: 800px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
}
|
||||||
}
|
.header {
|
||||||
.header {
|
font-weight: bold;
|
||||||
font-weight: bold;
|
}
|
||||||
}
|
.center {
|
||||||
.center {
|
text-align: center;
|
||||||
text-align: center;
|
}
|
||||||
}
|
.container {
|
||||||
.container {
|
max-width: 900px;
|
||||||
max-width: 900px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
justify-content: space-evenly;
|
||||||
justify-content: space-evenly;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.container > div {
|
.container > div {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -100,32 +100,30 @@ export class DemoDateTimeDateTimeShortYear extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-control-select {
|
||||||
ha-control-select {
|
max-width: 800px;
|
||||||
max-width: 800px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
}
|
||||||
}
|
.header {
|
||||||
.header {
|
font-weight: bold;
|
||||||
font-weight: bold;
|
}
|
||||||
}
|
.center {
|
||||||
.center {
|
text-align: center;
|
||||||
text-align: center;
|
}
|
||||||
}
|
.container {
|
||||||
.container {
|
max-width: 900px;
|
||||||
max-width: 900px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
justify-content: space-evenly;
|
||||||
justify-content: space-evenly;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.container > div {
|
.container > div {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -100,32 +100,30 @@ export class DemoDateTimeDateTimeShort extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-control-select {
|
||||||
ha-control-select {
|
max-width: 800px;
|
||||||
max-width: 800px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
}
|
||||||
}
|
.header {
|
||||||
.header {
|
font-weight: bold;
|
||||||
font-weight: bold;
|
}
|
||||||
}
|
.center {
|
||||||
.center {
|
text-align: center;
|
||||||
text-align: center;
|
}
|
||||||
}
|
.container {
|
||||||
.container {
|
max-width: 900px;
|
||||||
max-width: 900px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
justify-content: space-evenly;
|
||||||
justify-content: space-evenly;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.container > div {
|
.container > div {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -100,32 +100,30 @@ export class DemoDateTimeDateTime extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-control-select {
|
||||||
ha-control-select {
|
max-width: 800px;
|
||||||
max-width: 800px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
}
|
||||||
}
|
.header {
|
||||||
.header {
|
font-weight: bold;
|
||||||
font-weight: bold;
|
}
|
||||||
}
|
.center {
|
||||||
.center {
|
text-align: center;
|
||||||
text-align: center;
|
}
|
||||||
}
|
.container {
|
||||||
.container {
|
max-width: 900px;
|
||||||
max-width: 900px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
justify-content: space-evenly;
|
||||||
justify-content: space-evenly;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.container > div {
|
.container > div {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -90,28 +90,26 @@ export class DemoDateTimeDate extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
.header {
|
||||||
.header {
|
font-weight: bold;
|
||||||
font-weight: bold;
|
}
|
||||||
}
|
.center {
|
||||||
.center {
|
text-align: center;
|
||||||
text-align: center;
|
}
|
||||||
}
|
.container {
|
||||||
.container {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
justify-content: space-evenly;
|
||||||
justify-content: space-evenly;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.container > div {
|
.container > div {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -100,32 +100,30 @@ export class DemoDateTimeTimeSeconds extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-control-select {
|
||||||
ha-control-select {
|
max-width: 800px;
|
||||||
max-width: 800px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
}
|
||||||
}
|
.header {
|
||||||
.header {
|
font-weight: bold;
|
||||||
font-weight: bold;
|
}
|
||||||
}
|
.center {
|
||||||
.center {
|
text-align: center;
|
||||||
text-align: center;
|
}
|
||||||
}
|
.container {
|
||||||
.container {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
justify-content: space-evenly;
|
||||||
justify-content: space-evenly;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.container > div {
|
.container > div {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -100,32 +100,30 @@ export class DemoDateTimeTimeWeekday extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-control-select {
|
||||||
ha-control-select {
|
max-width: 800px;
|
||||||
max-width: 800px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
}
|
||||||
}
|
.header {
|
||||||
.header {
|
font-weight: bold;
|
||||||
font-weight: bold;
|
}
|
||||||
}
|
.center {
|
||||||
.center {
|
text-align: center;
|
||||||
text-align: center;
|
}
|
||||||
}
|
.container {
|
||||||
.container {
|
max-width: 800px;
|
||||||
max-width: 800px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
justify-content: space-evenly;
|
||||||
justify-content: space-evenly;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.container > div {
|
.container > div {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -100,32 +100,30 @@ export class DemoDateTimeTime extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-control-select {
|
||||||
ha-control-select {
|
max-width: 800px;
|
||||||
max-width: 800px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
}
|
||||||
}
|
.header {
|
||||||
.header {
|
font-weight: bold;
|
||||||
font-weight: bold;
|
}
|
||||||
}
|
.center {
|
||||||
.center {
|
text-align: center;
|
||||||
text-align: center;
|
}
|
||||||
}
|
.container {
|
||||||
.container {
|
max-width: 600px;
|
||||||
max-width: 600px;
|
margin: 12px auto;
|
||||||
margin: 12px auto;
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
justify-content: space-evenly;
|
||||||
justify-content: space-evenly;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.container > div {
|
.container > div {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
width: 20%;
|
width: 20%;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -321,13 +321,13 @@ function createEntity(
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
type EntityRowData = {
|
interface EntityRowData {
|
||||||
stateObj: HassEntity;
|
stateObj: HassEntity;
|
||||||
entity_id: string;
|
entity_id: string;
|
||||||
state: string;
|
state: string;
|
||||||
device_class?: string;
|
device_class?: string;
|
||||||
domain: string;
|
domain: string;
|
||||||
};
|
}
|
||||||
|
|
||||||
function createRowData(stateObj: HassEntity): EntityRowData {
|
function createRowData(stateObj: HassEntity): EntityRowData {
|
||||||
return {
|
return {
|
||||||
@@ -429,17 +429,15 @@ export class DemoEntityState extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
.color {
|
||||||
.color {
|
display: block;
|
||||||
display: block;
|
height: 20px;
|
||||||
height: 20px;
|
width: 20px;
|
||||||
width: 20px;
|
border-radius: 10px;
|
||||||
border-radius: 10px;
|
background-color: rgb(--color);
|
||||||
background-color: rgb(--color);
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -76,14 +76,12 @@ export class DemoMiscMarkdown extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
ha-card {
|
||||||
ha-card {
|
margin: 12px;
|
||||||
margin: 12px;
|
padding: 12px;
|
||||||
padding: 12px;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -32,6 +32,8 @@ const createConfigEntry = (
|
|||||||
supports_remove_device: false,
|
supports_remove_device: false,
|
||||||
supports_unload: true,
|
supports_unload: true,
|
||||||
supports_reconfigure: true,
|
supports_reconfigure: true,
|
||||||
|
supported_subentry_types: {},
|
||||||
|
num_subentries: 0,
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
pref_disable_new_entities: false,
|
pref_disable_new_entities: false,
|
||||||
pref_disable_polling: false,
|
pref_disable_polling: false,
|
||||||
@@ -135,12 +137,12 @@ const configFlows: DataEntryFlowProgressExtended[] = [
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const configEntries: Array<{
|
const configEntries: {
|
||||||
items: ConfigEntryExtended[];
|
items: ConfigEntryExtended[];
|
||||||
is_custom?: boolean;
|
is_custom?: boolean;
|
||||||
disabled?: boolean;
|
disabled?: boolean;
|
||||||
highlight?: string;
|
highlight?: string;
|
||||||
}> = [
|
}[] = [
|
||||||
{ items: [loadedEntry] },
|
{ items: [loadedEntry] },
|
||||||
{ items: [configPanelEntry] },
|
{ items: [configPanelEntry] },
|
||||||
{ items: [optionsFlowEntry] },
|
{ items: [optionsFlowEntry] },
|
||||||
@@ -188,6 +190,7 @@ const createEntityRegistryEntries = (
|
|||||||
): EntityRegistryEntry[] => [
|
): EntityRegistryEntry[] => [
|
||||||
{
|
{
|
||||||
config_entry_id: item.entry_id,
|
config_entry_id: item.entry_id,
|
||||||
|
config_subentry_id: null,
|
||||||
device_id: "mock-device-id",
|
device_id: "mock-device-id",
|
||||||
area_id: null,
|
area_id: null,
|
||||||
disabled_by: null,
|
disabled_by: null,
|
||||||
@@ -214,6 +217,7 @@ const createDeviceRegistryEntries = (
|
|||||||
{
|
{
|
||||||
entry_type: null,
|
entry_type: null,
|
||||||
config_entries: [item.entry_id],
|
config_entries: [item.entry_id],
|
||||||
|
config_entries_subentries: {},
|
||||||
connections: [],
|
connections: [],
|
||||||
manufacturer: "ESPHome",
|
manufacturer: "ESPHome",
|
||||||
model: "Mock Device",
|
model: "Mock Device",
|
||||||
@@ -349,26 +353,24 @@ export class DemoIntegrationCard extends LitElement {
|
|||||||
this.isCloud = !this.isCloud;
|
this.isCloud = !this.isCloud;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles() {
|
static styles = css`
|
||||||
return css`
|
.container {
|
||||||
.container {
|
display: grid;
|
||||||
display: grid;
|
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
||||||
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
|
grid-gap: 8px 8px;
|
||||||
grid-gap: 8px 8px;
|
padding: 8px 16px 16px;
|
||||||
padding: 8px 16px 16px;
|
margin-bottom: 16px;
|
||||||
margin-bottom: 16px;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.container > * {
|
.container > * {
|
||||||
max-width: 500px;
|
max-width: 500px;
|
||||||
}
|
}
|
||||||
|
|
||||||
ha-formfield {
|
ha-formfield {
|
||||||
margin: 8px 0;
|
margin: 8px 0;
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
14
gulpfile.js
14
gulpfile.js
@@ -1,16 +1,4 @@
|
|||||||
import { globIterate } from "glob";
|
|
||||||
import { availableParallelism } from "node:os";
|
import { availableParallelism } from "node:os";
|
||||||
|
import "./build-scripts/gulp/index.mjs";
|
||||||
|
|
||||||
process.env.UV_THREADPOOL_SIZE = availableParallelism();
|
process.env.UV_THREADPOOL_SIZE = availableParallelism();
|
||||||
|
|
||||||
const gulpImports = [];
|
|
||||||
|
|
||||||
for await (const gulpModule of globIterate("build-scripts/gulp/*.?(c|m)js", {
|
|
||||||
dotRelative: true,
|
|
||||||
})) {
|
|
||||||
gulpImports.push(import(gulpModule));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Since all tasks are currently registered with gulp.task(), this is enough
|
|
||||||
// If any are converted to named exports, need to loop and aggregate exports here
|
|
||||||
await Promise.all(gulpImports);
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
import type { ActionDetail } from "@material/mwc-list/mwc-list-foundation";
|
||||||
import "@material/mwc-list/mwc-list-item";
|
import "@material/mwc-list/mwc-list-item";
|
||||||
import { mdiDotsVertical } from "@mdi/js";
|
import { mdiDotsVertical } from "@mdi/js";
|
||||||
import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit";
|
import type { PropertyValues, TemplateResult } from "lit";
|
||||||
import { css, html, LitElement, nothing } from "lit";
|
import { css, html, LitElement, nothing } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import memoizeOne from "memoize-one";
|
import memoizeOne from "memoize-one";
|
||||||
@@ -211,35 +211,33 @@ export class HassioAddonStore extends LitElement {
|
|||||||
this._filter = e.detail.value;
|
this._filter = e.detail.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static styles = css`
|
||||||
return css`
|
hassio-addon-repository {
|
||||||
hassio-addon-repository {
|
margin-top: 24px;
|
||||||
margin-top: 24px;
|
}
|
||||||
}
|
.search {
|
||||||
.search {
|
position: sticky;
|
||||||
position: sticky;
|
top: 0;
|
||||||
top: 0;
|
z-index: 2;
|
||||||
z-index: 2;
|
}
|
||||||
}
|
search-input {
|
||||||
search-input {
|
display: block;
|
||||||
display: block;
|
--mdc-text-field-fill-color: var(--sidebar-background-color);
|
||||||
--mdc-text-field-fill-color: var(--sidebar-background-color);
|
--mdc-text-field-idle-line-color: var(--divider-color);
|
||||||
--mdc-text-field-idle-line-color: var(--divider-color);
|
}
|
||||||
}
|
.advanced {
|
||||||
.advanced {
|
padding: 12px;
|
||||||
padding: 12px;
|
display: flex;
|
||||||
display: flex;
|
flex-wrap: wrap;
|
||||||
flex-wrap: wrap;
|
color: var(--primary-text-color);
|
||||||
color: var(--primary-text-color);
|
}
|
||||||
}
|
.advanced a {
|
||||||
.advanced a {
|
margin-left: 0.5em;
|
||||||
margin-left: 0.5em;
|
margin-inline-start: 0.5em;
|
||||||
margin-inline-start: 0.5em;
|
margin-inline-end: initial;
|
||||||
margin-inline-end: initial;
|
color: var(--primary-color);
|
||||||
color: var(--primary-color);
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -299,7 +299,7 @@ class HassioAddonConfig extends LitElement {
|
|||||||
if (this.addon.schema && this._canShowSchema && !this._yamlMode) {
|
if (this.addon.schema && this._canShowSchema && !this._yamlMode) {
|
||||||
this._valid = true;
|
this._valid = true;
|
||||||
this._configHasChanged = true;
|
this._configHasChanged = true;
|
||||||
this._options! = ev.detail.value;
|
this._options = ev.detail.value;
|
||||||
} else {
|
} else {
|
||||||
this._configHasChanged = true;
|
this._configHasChanged = true;
|
||||||
this._valid = ev.detail.isValid;
|
this._valid = ev.detail.isValid;
|
||||||
|
|||||||
@@ -151,7 +151,7 @@ class HassioAddonNetwork extends LitElement {
|
|||||||
|
|
||||||
private async _configChanged(ev: CustomEvent): Promise<void> {
|
private async _configChanged(ev: CustomEvent): Promise<void> {
|
||||||
this._configHasChanged = true;
|
this._configHasChanged = true;
|
||||||
this._config! = ev.detail.value;
|
this._config = ev.detail.value;
|
||||||
}
|
}
|
||||||
|
|
||||||
private async _resetTapped(ev: CustomEvent): Promise<void> {
|
private async _resetTapped(ev: CustomEvent): Promise<void> {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { mdiHelpCircle } from "@mdi/js";
|
import { mdiHelpCircle } from "@mdi/js";
|
||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { TemplateResult } from "lit";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import "../../../src/components/ha-svg-icon";
|
import "../../../src/components/ha-svg-icon";
|
||||||
@@ -64,86 +64,84 @@ class HassioCardContent extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static styles = css`
|
||||||
return css`
|
:host {
|
||||||
:host {
|
direction: ltr;
|
||||||
direction: ltr;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
ha-svg-icon {
|
ha-svg-icon {
|
||||||
margin-right: 24px;
|
margin-right: 24px;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
margin-top: 12px;
|
margin-top: 12px;
|
||||||
float: left;
|
float: left;
|
||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
}
|
}
|
||||||
ha-svg-icon.update {
|
ha-svg-icon.update {
|
||||||
color: var(--warning-color);
|
color: var(--warning-color);
|
||||||
}
|
}
|
||||||
ha-svg-icon.running,
|
ha-svg-icon.running,
|
||||||
ha-svg-icon.installed {
|
ha-svg-icon.installed {
|
||||||
color: var(--success-color);
|
color: var(--success-color);
|
||||||
}
|
}
|
||||||
ha-svg-icon.hassupdate,
|
ha-svg-icon.hassupdate,
|
||||||
ha-svg-icon.backup {
|
ha-svg-icon.backup {
|
||||||
color: var(--paper-item-icon-color);
|
color: var(--paper-item-icon-color);
|
||||||
}
|
}
|
||||||
ha-svg-icon.not_available {
|
ha-svg-icon.not_available {
|
||||||
color: var(--error-color);
|
color: var(--error-color);
|
||||||
}
|
}
|
||||||
.title {
|
.title {
|
||||||
color: var(--primary-text-color);
|
color: var(--primary-text-color);
|
||||||
white-space: nowrap;
|
white-space: nowrap;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
}
|
}
|
||||||
.addition {
|
.addition {
|
||||||
color: var(--secondary-text-color);
|
color: var(--secondary-text-color);
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
position: relative;
|
position: relative;
|
||||||
height: 2.4em;
|
height: 2.4em;
|
||||||
line-height: 1.2em;
|
line-height: 1.2em;
|
||||||
}
|
}
|
||||||
.icon_image img {
|
.icon_image img {
|
||||||
max-height: 40px;
|
max-height: 40px;
|
||||||
max-width: 40px;
|
max-width: 40px;
|
||||||
margin-top: 4px;
|
margin-top: 4px;
|
||||||
margin-right: 16px;
|
margin-right: 16px;
|
||||||
float: left;
|
float: left;
|
||||||
}
|
}
|
||||||
.icon_image.stopped,
|
.icon_image.stopped,
|
||||||
.icon_image.not_available {
|
.icon_image.not_available {
|
||||||
filter: grayscale(1);
|
filter: grayscale(1);
|
||||||
}
|
}
|
||||||
.dot {
|
.dot {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
background-color: var(--warning-color);
|
background-color: var(--warning-color);
|
||||||
width: 12px;
|
width: 12px;
|
||||||
height: 12px;
|
height: 12px;
|
||||||
top: 8px;
|
top: 8px;
|
||||||
right: 8px;
|
right: 8px;
|
||||||
border-radius: 50%;
|
border-radius: 50%;
|
||||||
}
|
}
|
||||||
.topbar {
|
.topbar {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 2px;
|
height: 2px;
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
border-top-left-radius: 2px;
|
border-top-left-radius: 2px;
|
||||||
border-top-right-radius: 2px;
|
border-top-right-radius: 2px;
|
||||||
}
|
}
|
||||||
.topbar.installed {
|
.topbar.installed {
|
||||||
background-color: var(--primary-color);
|
background-color: var(--primary-color);
|
||||||
}
|
}
|
||||||
.topbar.update {
|
.topbar.update {
|
||||||
background-color: var(--accent-color);
|
background-color: var(--accent-color);
|
||||||
}
|
}
|
||||||
.topbar.unavailable {
|
.topbar.unavailable {
|
||||||
background-color: var(--error-color);
|
background-color: var(--error-color);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -1,8 +1,6 @@
|
|||||||
import type { IFuseOptions } from "fuse.js";
|
import type { IFuseOptions } from "fuse.js";
|
||||||
import Fuse from "fuse.js";
|
import Fuse from "fuse.js";
|
||||||
import { stripDiacritics } from "../../../src/common/string/strip-diacritics";
|
|
||||||
import type { StoreAddon } from "../../../src/data/supervisor/store";
|
import type { StoreAddon } from "../../../src/data/supervisor/store";
|
||||||
import { getStripDiacriticsFn } from "../../../src/util/fuse";
|
|
||||||
|
|
||||||
export function filterAndSort(addons: StoreAddon[], filter: string) {
|
export function filterAndSort(addons: StoreAddon[], filter: string) {
|
||||||
const options: IFuseOptions<StoreAddon> = {
|
const options: IFuseOptions<StoreAddon> = {
|
||||||
@@ -10,8 +8,8 @@ export function filterAndSort(addons: StoreAddon[], filter: string) {
|
|||||||
isCaseSensitive: false,
|
isCaseSensitive: false,
|
||||||
minMatchCharLength: Math.min(filter.length, 2),
|
minMatchCharLength: Math.min(filter.length, 2),
|
||||||
threshold: 0.2,
|
threshold: 0.2,
|
||||||
getFn: getStripDiacriticsFn,
|
ignoreDiacritics: true,
|
||||||
};
|
};
|
||||||
const fuse = new Fuse(addons, options);
|
const fuse = new Fuse(addons, options);
|
||||||
return fuse.search(stripDiacritics(filter)).map((result) => result.item);
|
return fuse.search(filter).map((result) => result.item);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { mdiFolderUpload } from "@mdi/js";
|
import { mdiFolderUpload } from "@mdi/js";
|
||||||
import type { TemplateResult } from "lit";
|
import type { TemplateResult } from "lit";
|
||||||
import { html, LitElement } from "lit";
|
import { html, LitElement } from "lit";
|
||||||
import { customElement, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { fireEvent } from "../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../src/common/dom/fire_event";
|
||||||
import "../../../src/components/ha-circular-progress";
|
import "../../../src/components/ha-circular-progress";
|
||||||
import "../../../src/components/ha-file-upload";
|
import "../../../src/components/ha-file-upload";
|
||||||
@@ -10,10 +10,12 @@ import { uploadBackup } from "../../../src/data/hassio/backup";
|
|||||||
import { extractApiErrorMessage } from "../../../src/data/hassio/common";
|
import { extractApiErrorMessage } from "../../../src/data/hassio/common";
|
||||||
import { showAlertDialog } from "../../../src/dialogs/generic/show-dialog-box";
|
import { showAlertDialog } from "../../../src/dialogs/generic/show-dialog-box";
|
||||||
import type { HomeAssistant } from "../../../src/types";
|
import type { HomeAssistant } from "../../../src/types";
|
||||||
|
import type { LocalizeFunc } from "../../../src/common/translations/localize";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
interface HASSDomEvents {
|
interface HASSDomEvents {
|
||||||
"backup-uploaded": { backup: HassioBackup };
|
"hassio-backup-uploaded": { backup: HassioBackup };
|
||||||
|
"backup-cleared": undefined;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,6 +23,8 @@ declare global {
|
|||||||
export class HassioUploadBackup extends LitElement {
|
export class HassioUploadBackup extends LitElement {
|
||||||
public hass?: HomeAssistant;
|
public hass?: HomeAssistant;
|
||||||
|
|
||||||
|
@property({ attribute: false }) public localize?: LocalizeFunc;
|
||||||
|
|
||||||
@state() public value: string | null = null;
|
@state() public value: string | null = null;
|
||||||
|
|
||||||
@state() private _uploading = false;
|
@state() private _uploading = false;
|
||||||
@@ -32,13 +36,26 @@ export class HassioUploadBackup extends LitElement {
|
|||||||
.uploading=${this._uploading}
|
.uploading=${this._uploading}
|
||||||
.icon=${mdiFolderUpload}
|
.icon=${mdiFolderUpload}
|
||||||
accept="application/x-tar"
|
accept="application/x-tar"
|
||||||
label="Upload backup"
|
.label=${this.localize?.(
|
||||||
supports="Supports .TAR files"
|
"ui.panel.page-onboarding.restore.upload_backup"
|
||||||
|
) || "Upload backup"}
|
||||||
|
.supports=${this.localize?.(
|
||||||
|
"ui.panel.page-onboarding.restore.upload_supports"
|
||||||
|
) || "Supports .TAR files"}
|
||||||
|
.secondary=${this.localize?.(
|
||||||
|
"ui.panel.page-onboarding.restore.upload_drop"
|
||||||
|
) || "Or drop your file here"}
|
||||||
@file-picked=${this._uploadFile}
|
@file-picked=${this._uploadFile}
|
||||||
|
@files-cleared=${this._clear}
|
||||||
></ha-file-upload>
|
></ha-file-upload>
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _clear() {
|
||||||
|
this.value = null;
|
||||||
|
fireEvent(this, "backup-cleared");
|
||||||
|
}
|
||||||
|
|
||||||
private async _uploadFile(ev) {
|
private async _uploadFile(ev) {
|
||||||
const file = ev.detail.files[0];
|
const file = ev.detail.files[0];
|
||||||
|
|
||||||
@@ -53,7 +70,7 @@ export class HassioUploadBackup extends LitElement {
|
|||||||
this._uploading = true;
|
this._uploading = true;
|
||||||
try {
|
try {
|
||||||
const backup = await uploadBackup(this.hass, file);
|
const backup = await uploadBackup(this.hass, file);
|
||||||
fireEvent(this, "backup-uploaded", { backup: backup.data });
|
fireEvent(this, "hassio-backup-uploaded", { backup: backup.data });
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
showAlertDialog(this, {
|
showAlertDialog(this, {
|
||||||
title: "Upload failed",
|
title: "Upload failed",
|
||||||
|
|||||||
@@ -1,11 +1,10 @@
|
|||||||
import { mdiFolder, mdiPuzzle } from "@mdi/js";
|
import { mdiFolder, mdiPuzzle } from "@mdi/js";
|
||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { TemplateResult } from "lit";
|
||||||
import { LitElement, css, html, nothing } from "lit";
|
import { LitElement, css, html, nothing } from "lit";
|
||||||
import { customElement, property, query } from "lit/decorators";
|
import { customElement, property, query } from "lit/decorators";
|
||||||
import { atLeastVersion } from "../../../src/common/config/version";
|
import { atLeastVersion } from "../../../src/common/config/version";
|
||||||
import { formatDate } from "../../../src/common/datetime/format_date";
|
import { formatDate } from "../../../src/common/datetime/format_date";
|
||||||
import { formatDateTime } from "../../../src/common/datetime/format_date_time";
|
import { formatDateTime } from "../../../src/common/datetime/format_date_time";
|
||||||
import type { LocalizeFunc } from "../../../src/common/translations/localize";
|
|
||||||
import "../../../src/components/ha-checkbox";
|
import "../../../src/components/ha-checkbox";
|
||||||
import "../../../src/components/ha-formfield";
|
import "../../../src/components/ha-formfield";
|
||||||
import "../../../src/components/ha-textfield";
|
import "../../../src/components/ha-textfield";
|
||||||
@@ -19,13 +18,10 @@ import type {
|
|||||||
} from "../../../src/data/hassio/backup";
|
} from "../../../src/data/hassio/backup";
|
||||||
import type { Supervisor } from "../../../src/data/supervisor/supervisor";
|
import type { Supervisor } from "../../../src/data/supervisor/supervisor";
|
||||||
import { mdiHomeAssistant } from "../../../src/resources/home-assistant-logo-svg";
|
import { mdiHomeAssistant } from "../../../src/resources/home-assistant-logo-svg";
|
||||||
import type { HomeAssistant, TranslationDict } from "../../../src/types";
|
import type { HomeAssistant } from "../../../src/types";
|
||||||
import "./supervisor-formfield-label";
|
import "./supervisor-formfield-label";
|
||||||
import type { HaTextField } from "../../../src/components/ha-textfield";
|
import type { HaTextField } from "../../../src/components/ha-textfield";
|
||||||
|
|
||||||
type BackupOrRestoreKey = keyof TranslationDict["supervisor"]["backup"] &
|
|
||||||
keyof TranslationDict["ui"]["panel"]["page-onboarding"]["restore"];
|
|
||||||
|
|
||||||
interface CheckboxItem {
|
interface CheckboxItem {
|
||||||
slug: string;
|
slug: string;
|
||||||
checked: boolean;
|
checked: boolean;
|
||||||
@@ -65,9 +61,7 @@ const _computeAddons = (addons): AddonCheckboxItem[] =>
|
|||||||
|
|
||||||
@customElement("supervisor-backup-content")
|
@customElement("supervisor-backup-content")
|
||||||
export class SupervisorBackupContent extends LitElement {
|
export class SupervisorBackupContent extends LitElement {
|
||||||
@property({ attribute: false }) public hass!: HomeAssistant;
|
@property({ attribute: false }) public hass?: HomeAssistant;
|
||||||
|
|
||||||
@property({ attribute: false }) public localize?: LocalizeFunc;
|
|
||||||
|
|
||||||
@property({ attribute: false }) public supervisor?: Supervisor;
|
@property({ attribute: false }) public supervisor?: Supervisor;
|
||||||
|
|
||||||
@@ -115,10 +109,6 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
this._focusTarget?.focus();
|
this._focusTarget?.focus();
|
||||||
}
|
}
|
||||||
|
|
||||||
private _localize = (key: BackupOrRestoreKey) =>
|
|
||||||
this.supervisor?.localize(`backup.${key}`) ||
|
|
||||||
this.localize!(`ui.panel.page-onboarding.restore.${key}`);
|
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
if (!this.onboarding && !this.supervisor) {
|
if (!this.onboarding && !this.supervisor) {
|
||||||
return nothing;
|
return nothing;
|
||||||
@@ -132,8 +122,8 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
${this.backup
|
${this.backup
|
||||||
? html`<div class="details">
|
? html`<div class="details">
|
||||||
${this.backup.type === "full"
|
${this.backup.type === "full"
|
||||||
? this._localize("full_backup")
|
? this.supervisor?.localize("backup.full_backup")
|
||||||
: this._localize("partial_backup")}
|
: this.supervisor?.localize("backup.partial_backup")}
|
||||||
(${Math.ceil(this.backup.size * 10) / 10 + " MB"})<br />
|
(${Math.ceil(this.backup.size * 10) / 10 + " MB"})<br />
|
||||||
${this.hass
|
${this.hass
|
||||||
? formatDateTime(
|
? formatDateTime(
|
||||||
@@ -145,7 +135,7 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
</div>`
|
</div>`
|
||||||
: html`<ha-textfield
|
: html`<ha-textfield
|
||||||
name="backupName"
|
name="backupName"
|
||||||
.label=${this._localize("name")}
|
.label=${this.supervisor?.localize("backup.name")}
|
||||||
.value=${this.backupName}
|
.value=${this.backupName}
|
||||||
@change=${this._handleTextValueChanged}
|
@change=${this._handleTextValueChanged}
|
||||||
>
|
>
|
||||||
@@ -153,11 +143,13 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
${!this.backup || this.backup.type === "full"
|
${!this.backup || this.backup.type === "full"
|
||||||
? html`<div class="sub-header">
|
? html`<div class="sub-header">
|
||||||
${!this.backup
|
${!this.backup
|
||||||
? this._localize("type")
|
? this.supervisor?.localize("backup.type")
|
||||||
: this._localize("select_type")}
|
: this.supervisor?.localize("backup.select_type")}
|
||||||
</div>
|
</div>
|
||||||
<div class="backup-types">
|
<div class="backup-types">
|
||||||
<ha-formfield .label=${this._localize("full_backup")}>
|
<ha-formfield
|
||||||
|
.label=${this.supervisor?.localize("backup.full_backup")}
|
||||||
|
>
|
||||||
<ha-radio
|
<ha-radio
|
||||||
@change=${this._handleRadioValueChanged}
|
@change=${this._handleRadioValueChanged}
|
||||||
value="full"
|
value="full"
|
||||||
@@ -166,7 +158,9 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
>
|
>
|
||||||
</ha-radio>
|
</ha-radio>
|
||||||
</ha-formfield>
|
</ha-formfield>
|
||||||
<ha-formfield .label=${this._localize("partial_backup")}>
|
<ha-formfield
|
||||||
|
.label=${this.supervisor?.localize("backup.partial_backup")}
|
||||||
|
>
|
||||||
<ha-radio
|
<ha-radio
|
||||||
@change=${this._handleRadioValueChanged}
|
@change=${this._handleRadioValueChanged}
|
||||||
value="partial"
|
value="partial"
|
||||||
@@ -186,12 +180,13 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
.iconPath=${mdiHomeAssistant}
|
.iconPath=${mdiHomeAssistant}
|
||||||
.version=${this.backup
|
.version=${this.backup
|
||||||
? this.backup.homeassistant
|
? this.backup.homeassistant
|
||||||
: this.hass.config.version}
|
: this.hass?.config.version}
|
||||||
>
|
>
|
||||||
</supervisor-formfield-label>`}
|
</supervisor-formfield-label>`}
|
||||||
>
|
>
|
||||||
<ha-checkbox
|
<ha-checkbox
|
||||||
.checked=${this.homeAssistant}
|
.checked=${this.onboarding || this.homeAssistant}
|
||||||
|
.disabled=${this.onboarding}
|
||||||
@change=${this._toggleHomeAssistant}
|
@change=${this._toggleHomeAssistant}
|
||||||
>
|
>
|
||||||
</ha-checkbox>
|
</ha-checkbox>
|
||||||
@@ -201,7 +196,7 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
? html`
|
? html`
|
||||||
<ha-formfield
|
<ha-formfield
|
||||||
.label=${html`<supervisor-formfield-label
|
.label=${html`<supervisor-formfield-label
|
||||||
.label=${this._localize("folders")}
|
.label=${this.supervisor?.localize("backup.folders")}
|
||||||
.iconPath=${mdiFolder}
|
.iconPath=${mdiFolder}
|
||||||
>
|
>
|
||||||
</supervisor-formfield-label>`}
|
</supervisor-formfield-label>`}
|
||||||
@@ -221,7 +216,7 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
? html`
|
? html`
|
||||||
<ha-formfield
|
<ha-formfield
|
||||||
.label=${html`<supervisor-formfield-label
|
.label=${html`<supervisor-formfield-label
|
||||||
.label=${this._localize("addons")}
|
.label=${this.supervisor?.localize("backup.addons")}
|
||||||
.iconPath=${mdiPuzzle}
|
.iconPath=${mdiPuzzle}
|
||||||
>
|
>
|
||||||
</supervisor-formfield-label>`}
|
</supervisor-formfield-label>`}
|
||||||
@@ -246,7 +241,7 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
${!this.backup
|
${!this.backup
|
||||||
? html`<ha-formfield
|
? html`<ha-formfield
|
||||||
class="password"
|
class="password"
|
||||||
.label=${this._localize("password_protection")}
|
.label=${this.supervisor?.localize("backup.password_protection")}
|
||||||
>
|
>
|
||||||
<ha-checkbox
|
<ha-checkbox
|
||||||
.checked=${this.backupHasPassword}
|
.checked=${this.backupHasPassword}
|
||||||
@@ -258,7 +253,7 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
${this.backupHasPassword
|
${this.backupHasPassword
|
||||||
? html`
|
? html`
|
||||||
<ha-password-field
|
<ha-password-field
|
||||||
.label=${this._localize("password")}
|
.label=${this.supervisor?.localize("backup.password")}
|
||||||
name="backupPassword"
|
name="backupPassword"
|
||||||
.value=${this.backupPassword}
|
.value=${this.backupPassword}
|
||||||
@change=${this._handleTextValueChanged}
|
@change=${this._handleTextValueChanged}
|
||||||
@@ -266,7 +261,7 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
</ha-password-field>
|
</ha-password-field>
|
||||||
${!this.backup
|
${!this.backup
|
||||||
? html`<ha-password-field
|
? html`<ha-password-field
|
||||||
.label=${this._localize("confirm_password")}
|
.label=${this.supervisor?.localize("backup.confirm_password")}
|
||||||
name="confirmBackupPassword"
|
name="confirmBackupPassword"
|
||||||
.value=${this.confirmBackupPassword}
|
.value=${this.confirmBackupPassword}
|
||||||
@change=${this._handleTextValueChanged}
|
@change=${this._handleTextValueChanged}
|
||||||
@@ -282,59 +277,57 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
this.homeAssistant = !this.homeAssistant;
|
this.homeAssistant = !this.homeAssistant;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static styles = css`
|
||||||
return css`
|
.partial-picker ha-formfield {
|
||||||
.partial-picker ha-formfield {
|
display: block;
|
||||||
display: block;
|
}
|
||||||
}
|
.partial-picker ha-checkbox {
|
||||||
.partial-picker ha-checkbox {
|
--mdc-checkbox-touch-target-size: 32px;
|
||||||
--mdc-checkbox-touch-target-size: 32px;
|
}
|
||||||
}
|
.partial-picker {
|
||||||
.partial-picker {
|
display: block;
|
||||||
display: block;
|
margin: 0px -6px;
|
||||||
margin: 0px -6px;
|
}
|
||||||
}
|
supervisor-formfield-label {
|
||||||
supervisor-formfield-label {
|
display: inline-flex;
|
||||||
display: inline-flex;
|
align-items: center;
|
||||||
align-items: center;
|
}
|
||||||
}
|
hr {
|
||||||
hr {
|
border-color: var(--divider-color);
|
||||||
border-color: var(--divider-color);
|
border-bottom: none;
|
||||||
border-bottom: none;
|
margin: 16px 0;
|
||||||
margin: 16px 0;
|
}
|
||||||
}
|
.details {
|
||||||
.details {
|
color: var(--secondary-text-color);
|
||||||
color: var(--secondary-text-color);
|
}
|
||||||
}
|
.section-content {
|
||||||
.section-content {
|
display: flex;
|
||||||
display: flex;
|
flex-direction: column;
|
||||||
flex-direction: column;
|
margin-left: 30px;
|
||||||
margin-left: 30px;
|
margin-inline-start: 30px;
|
||||||
margin-inline-start: 30px;
|
margin-inline-end: initial;
|
||||||
margin-inline-end: initial;
|
}
|
||||||
}
|
ha-formfield.password {
|
||||||
ha-formfield.password {
|
display: block;
|
||||||
display: block;
|
margin: 0 -14px -16px;
|
||||||
margin: 0 -14px -16px;
|
}
|
||||||
}
|
.backup-types {
|
||||||
.backup-types {
|
display: flex;
|
||||||
display: flex;
|
margin-left: -13px;
|
||||||
margin-left: -13px;
|
margin-inline-start: -13px;
|
||||||
margin-inline-start: -13px;
|
margin-inline-end: initial;
|
||||||
margin-inline-end: initial;
|
}
|
||||||
}
|
.sub-header {
|
||||||
.sub-header {
|
margin-top: 8px;
|
||||||
margin-top: 8px;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
|
|
||||||
public backupDetails():
|
public backupDetails():
|
||||||
| HassioPartialBackupCreateParams
|
| HassioPartialBackupCreateParams
|
||||||
| HassioFullBackupCreateParams {
|
| HassioFullBackupCreateParams {
|
||||||
const data: any = {};
|
const data: any = {};
|
||||||
|
|
||||||
if (!this.backup) {
|
if (!this.backup && this.hass) {
|
||||||
data.name =
|
data.name =
|
||||||
this.backupName ||
|
this.backupName ||
|
||||||
formatDate(new Date(), this.hass.locale, this.hass.config);
|
formatDate(new Date(), this.hass.locale, this.hass.config);
|
||||||
@@ -364,7 +357,9 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
if (folders?.length) {
|
if (folders?.length) {
|
||||||
data.folders = folders;
|
data.folders = folders;
|
||||||
}
|
}
|
||||||
data.homeassistant = this.homeAssistant;
|
|
||||||
|
// onboarding needs at least homeassistant to restore
|
||||||
|
data.homeassistant = this.onboarding || this.homeAssistant;
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
}
|
}
|
||||||
@@ -386,6 +381,7 @@ export class SupervisorBackupContent extends LitElement {
|
|||||||
.iconPath=${section === "addons" ? mdiPuzzle : mdiFolder}
|
.iconPath=${section === "addons" ? mdiPuzzle : mdiFolder}
|
||||||
.imageUrl=${section === "addons" &&
|
.imageUrl=${section === "addons" &&
|
||||||
!this.onboarding &&
|
!this.onboarding &&
|
||||||
|
this.hass &&
|
||||||
atLeastVersion(this.hass.config.version, 0, 105) &&
|
atLeastVersion(this.hass.config.version, 0, 105) &&
|
||||||
addons?.get(item.slug)?.icon
|
addons?.get(item.slug)?.icon
|
||||||
? `/api/hassio/addons/${item.slug}/icon`
|
? `/api/hassio/addons/${item.slug}/icon`
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { TemplateResult } from "lit";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import "../../../src/components/ha-svg-icon";
|
import "../../../src/components/ha-svg-icon";
|
||||||
@@ -30,29 +30,27 @@ class SupervisorFormfieldLabel extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static styles = css`
|
||||||
return css`
|
:host {
|
||||||
:host {
|
display: flex;
|
||||||
display: flex;
|
align-items: center;
|
||||||
align-items: center;
|
}
|
||||||
}
|
.label {
|
||||||
.label {
|
margin-right: 4px;
|
||||||
margin-right: 4px;
|
margin-inline-end: 4px;
|
||||||
margin-inline-end: 4px;
|
margin-inline-start: initial;
|
||||||
margin-inline-start: initial;
|
}
|
||||||
}
|
.version {
|
||||||
.version {
|
color: var(--secondary-text-color);
|
||||||
color: var(--secondary-text-color);
|
}
|
||||||
}
|
.icon {
|
||||||
.icon {
|
max-height: 22px;
|
||||||
max-height: 22px;
|
max-width: 22px;
|
||||||
max-width: 22px;
|
margin-right: 8px;
|
||||||
margin-right: 8px;
|
margin-inline-end: 8px;
|
||||||
margin-inline-end: 8px;
|
margin-inline-start: initial;
|
||||||
margin-inline-start: initial;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { TemplateResult } from "lit";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import { classMap } from "lit/directives/class-map";
|
import { classMap } from "lit/directives/class-map";
|
||||||
@@ -31,46 +31,41 @@ class SupervisorMetric extends LitElement {
|
|||||||
</ha-settings-row>`;
|
</ha-settings-row>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static styles = css`
|
||||||
return css`
|
ha-settings-row {
|
||||||
ha-settings-row {
|
padding: 0;
|
||||||
padding: 0;
|
height: 54px;
|
||||||
height: 54px;
|
width: 100%;
|
||||||
width: 100%;
|
}
|
||||||
}
|
ha-settings-row > div[slot="description"] {
|
||||||
ha-settings-row > div[slot="description"] {
|
white-space: normal;
|
||||||
white-space: normal;
|
color: var(--secondary-text-color);
|
||||||
color: var(--secondary-text-color);
|
display: flex;
|
||||||
display: flex;
|
justify-content: space-between;
|
||||||
justify-content: space-between;
|
}
|
||||||
}
|
ha-bar {
|
||||||
ha-bar {
|
--ha-bar-primary-color: var(--hassio-bar-ok-color, var(--success-color));
|
||||||
--ha-bar-primary-color: var(
|
}
|
||||||
--hassio-bar-ok-color,
|
.target-warning {
|
||||||
var(--success-color)
|
--ha-bar-primary-color: var(
|
||||||
);
|
--hassio-bar-warning-color,
|
||||||
}
|
var(--warning-color)
|
||||||
.target-warning {
|
);
|
||||||
--ha-bar-primary-color: var(
|
}
|
||||||
--hassio-bar-warning-color,
|
.target-critical {
|
||||||
var(--warning-color)
|
--ha-bar-primary-color: var(
|
||||||
);
|
--hassio-bar-critical-color,
|
||||||
}
|
var(--error-color)
|
||||||
.target-critical {
|
);
|
||||||
--ha-bar-primary-color: var(
|
}
|
||||||
--hassio-bar-critical-color,
|
.value {
|
||||||
var(--error-color)
|
width: 48px;
|
||||||
);
|
padding-right: 4px;
|
||||||
}
|
padding-inline-start: initial;
|
||||||
.value {
|
padding-inline-end: 4px;
|
||||||
width: 48px;
|
flex-shrink: 0;
|
||||||
padding-right: 4px;
|
}
|
||||||
padding-inline-start: initial;
|
`;
|
||||||
padding-inline-end: 4px;
|
|
||||||
flex-shrink: 0;
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ export class DialogHassioBackupUpload
|
|||||||
await this.updateComplete;
|
await this.updateComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
public closeDialog(): void {
|
public closeDialog() {
|
||||||
if (this._dialogParams && !this._dialogParams.onboarding) {
|
if (this._dialogParams && !this._dialogParams.onboarding) {
|
||||||
if (this._dialogParams.reloadBackup) {
|
if (this._dialogParams.reloadBackup) {
|
||||||
this._dialogParams.reloadBackup();
|
this._dialogParams.reloadBackup();
|
||||||
@@ -36,6 +36,7 @@ export class DialogHassioBackupUpload
|
|||||||
}
|
}
|
||||||
this._dialogParams = undefined;
|
this._dialogParams = undefined;
|
||||||
fireEvent(this, "dialog-closed", { dialog: this.localName });
|
fireEvent(this, "dialog-closed", { dialog: this.localName });
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
@@ -71,7 +72,7 @@ export class DialogHassioBackupUpload
|
|||||||
</ha-header-bar>
|
</ha-header-bar>
|
||||||
</div>
|
</div>
|
||||||
<hassio-upload-backup
|
<hassio-upload-backup
|
||||||
@backup-uploaded=${this._backupUploaded}
|
@hassio-backup-uploaded=${this._backupUploaded}
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
></hassio-upload-backup>
|
></hassio-upload-backup>
|
||||||
</ha-dialog>
|
</ha-dialog>
|
||||||
|
|||||||
@@ -8,9 +8,11 @@ import { atLeastVersion } from "../../../../src/common/config/version";
|
|||||||
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
||||||
import { stopPropagation } from "../../../../src/common/dom/stop_propagation";
|
import { stopPropagation } from "../../../../src/common/dom/stop_propagation";
|
||||||
import { slugify } from "../../../../src/common/string/slugify";
|
import { slugify } from "../../../../src/common/string/slugify";
|
||||||
import "../../../../src/components/ha-dialog";
|
import "../../../../src/components/ha-md-dialog";
|
||||||
|
import "../../../../src/components/ha-dialog-header";
|
||||||
import "../../../../src/components/buttons/ha-progress-button";
|
import "../../../../src/components/buttons/ha-progress-button";
|
||||||
import "../../../../src/components/ha-alert";
|
import "../../../../src/components/ha-alert";
|
||||||
|
import "../../../../src/components/ha-button";
|
||||||
import "../../../../src/components/ha-button-menu";
|
import "../../../../src/components/ha-button-menu";
|
||||||
import "../../../../src/components/ha-header-bar";
|
import "../../../../src/components/ha-header-bar";
|
||||||
import "../../../../src/components/ha-icon-button";
|
import "../../../../src/components/ha-icon-button";
|
||||||
@@ -19,6 +21,7 @@ import type { HassioBackupDetail } from "../../../../src/data/hassio/backup";
|
|||||||
import {
|
import {
|
||||||
fetchHassioBackupInfo,
|
fetchHassioBackupInfo,
|
||||||
removeBackup,
|
removeBackup,
|
||||||
|
restoreBackup,
|
||||||
} from "../../../../src/data/hassio/backup";
|
} from "../../../../src/data/hassio/backup";
|
||||||
import { extractApiErrorMessage } from "../../../../src/data/hassio/common";
|
import { extractApiErrorMessage } from "../../../../src/data/hassio/common";
|
||||||
import {
|
import {
|
||||||
@@ -32,14 +35,14 @@ import { fileDownload } from "../../../../src/util/file_download";
|
|||||||
import "../../components/supervisor-backup-content";
|
import "../../components/supervisor-backup-content";
|
||||||
import type { SupervisorBackupContent } from "../../components/supervisor-backup-content";
|
import type { SupervisorBackupContent } from "../../components/supervisor-backup-content";
|
||||||
import type { HassioBackupDialogParams } from "./show-dialog-hassio-backup";
|
import type { HassioBackupDialogParams } from "./show-dialog-hassio-backup";
|
||||||
import type { BackupOrRestoreKey } from "../../util/translations";
|
import type { HaMdDialog } from "../../../../src/components/ha-md-dialog";
|
||||||
|
|
||||||
@customElement("dialog-hassio-backup")
|
@customElement("dialog-hassio-backup")
|
||||||
class HassioBackupDialog
|
class HassioBackupDialog
|
||||||
extends LitElement
|
extends LitElement
|
||||||
implements HassDialog<HassioBackupDialogParams>
|
implements HassDialog<HassioBackupDialogParams>
|
||||||
{
|
{
|
||||||
@property({ attribute: false }) public hass?: HomeAssistant;
|
@property({ attribute: false }) public hass!: HomeAssistant;
|
||||||
|
|
||||||
@state() private _error?: string;
|
@state() private _error?: string;
|
||||||
|
|
||||||
@@ -52,13 +55,24 @@ class HassioBackupDialog
|
|||||||
@query("supervisor-backup-content")
|
@query("supervisor-backup-content")
|
||||||
private _backupContent!: SupervisorBackupContent;
|
private _backupContent!: SupervisorBackupContent;
|
||||||
|
|
||||||
|
@query("ha-md-dialog") private _dialog?: HaMdDialog;
|
||||||
|
|
||||||
public async showDialog(dialogParams: HassioBackupDialogParams) {
|
public async showDialog(dialogParams: HassioBackupDialogParams) {
|
||||||
this._backup = await fetchHassioBackupInfo(this.hass, dialogParams.slug);
|
|
||||||
this._dialogParams = dialogParams;
|
this._dialogParams = dialogParams;
|
||||||
|
this._backup = await fetchHassioBackupInfo(this.hass, dialogParams.slug);
|
||||||
|
if (!this._backup) {
|
||||||
|
this._error = this._dialogParams.supervisor?.localize(
|
||||||
|
"backup.no_backup_found"
|
||||||
|
);
|
||||||
|
} else if (this._dialogParams.onboarding && !this._backup.homeassistant) {
|
||||||
|
this._error = this._dialogParams.supervisor?.localize(
|
||||||
|
"backup.restore_no_home_assistant"
|
||||||
|
);
|
||||||
|
}
|
||||||
this._restoringBackup = false;
|
this._restoringBackup = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public closeDialog() {
|
private _dialogClosed(): void {
|
||||||
this._backup = undefined;
|
this._backup = undefined;
|
||||||
this._dialogParams = undefined;
|
this._dialogParams = undefined;
|
||||||
this._restoringBackup = false;
|
this._restoringBackup = false;
|
||||||
@@ -66,11 +80,9 @@ class HassioBackupDialog
|
|||||||
fireEvent(this, "dialog-closed", { dialog: this.localName });
|
fireEvent(this, "dialog-closed", { dialog: this.localName });
|
||||||
}
|
}
|
||||||
|
|
||||||
private _localize(key: BackupOrRestoreKey) {
|
public closeDialog() {
|
||||||
return (
|
this._dialog?.close();
|
||||||
this._dialogParams!.supervisor?.localize(`backup.${key}`) ||
|
return true;
|
||||||
this._dialogParams!.localize!(`ui.panel.page-onboarding.restore.${key}`)
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
@@ -78,100 +90,79 @@ class HassioBackupDialog
|
|||||||
return nothing;
|
return nothing;
|
||||||
}
|
}
|
||||||
return html`
|
return html`
|
||||||
<ha-dialog
|
<ha-md-dialog
|
||||||
open
|
open
|
||||||
scrimClickAction
|
.disableCancelAction=${!this._error}
|
||||||
@closed=${this.closeDialog}
|
@closed=${this._dialogClosed}
|
||||||
.heading=${this._backup.name}
|
|
||||||
>
|
>
|
||||||
<div slot="heading">
|
<ha-dialog-header slot="headline">
|
||||||
<ha-header-bar>
|
<ha-icon-button
|
||||||
<span slot="title">${this._backup.name}</span>
|
slot="navigationIcon"
|
||||||
<ha-icon-button
|
.label=${this._dialogParams.supervisor?.localize("backup.close")}
|
||||||
.label=${this._localize("close")}
|
.path=${mdiClose}
|
||||||
.path=${mdiClose}
|
@click=${this.closeDialog}
|
||||||
slot="actionItems"
|
.disabled=${this._restoringBackup}
|
||||||
dialogAction="cancel"
|
></ha-icon-button>
|
||||||
></ha-icon-button>
|
<span slot="title" .title=${this._backup.name}
|
||||||
</ha-header-bar>
|
>${this._backup.name}</span
|
||||||
|
>
|
||||||
|
${!this._dialogParams.onboarding && this._dialogParams.supervisor
|
||||||
|
? html`<ha-button-menu
|
||||||
|
slot="actionItems"
|
||||||
|
fixed
|
||||||
|
@action=${this._handleMenuAction}
|
||||||
|
@closed=${stopPropagation}
|
||||||
|
>
|
||||||
|
<ha-icon-button
|
||||||
|
.label=${this._dialogParams.supervisor.localize(
|
||||||
|
"backup.more_actions"
|
||||||
|
)}
|
||||||
|
.path=${mdiDotsVertical}
|
||||||
|
slot="trigger"
|
||||||
|
></ha-icon-button>
|
||||||
|
<mwc-list-item
|
||||||
|
>${this._dialogParams.supervisor.localize(
|
||||||
|
"backup.download_backup"
|
||||||
|
)}</mwc-list-item
|
||||||
|
>
|
||||||
|
<mwc-list-item class="error"
|
||||||
|
>${this._dialogParams.supervisor.localize(
|
||||||
|
"backup.delete_backup_title"
|
||||||
|
)}</mwc-list-item
|
||||||
|
>
|
||||||
|
</ha-button-menu>`
|
||||||
|
: nothing}
|
||||||
|
</ha-dialog-header>
|
||||||
|
<div slot="content">
|
||||||
|
${this._error
|
||||||
|
? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
|
||||||
|
: this._restoringBackup
|
||||||
|
? html`<div class="loading">
|
||||||
|
<ha-circular-progress indeterminate></ha-circular-progress>
|
||||||
|
</div>`
|
||||||
|
: html`
|
||||||
|
<supervisor-backup-content
|
||||||
|
.hass=${this.hass}
|
||||||
|
.supervisor=${this._dialogParams.supervisor}
|
||||||
|
.backup=${this._backup}
|
||||||
|
.onboarding=${this._dialogParams.onboarding || false}
|
||||||
|
dialogInitialFocus
|
||||||
|
>
|
||||||
|
</supervisor-backup-content>
|
||||||
|
`}
|
||||||
</div>
|
</div>
|
||||||
${this._restoringBackup
|
<div slot="actions">
|
||||||
? html`<ha-circular-progress indeterminate></ha-circular-progress>`
|
<ha-button
|
||||||
: html`
|
.disabled=${this._restoringBackup || !!this._error}
|
||||||
<supervisor-backup-content
|
@click=${this._restoreClicked}
|
||||||
.hass=${this.hass}
|
>
|
||||||
.supervisor=${this._dialogParams.supervisor}
|
${this._dialogParams.supervisor?.localize("backup.restore")}
|
||||||
.backup=${this._backup}
|
</ha-button>
|
||||||
.onboarding=${this._dialogParams.onboarding || false}
|
</div>
|
||||||
.localize=${this._dialogParams.localize}
|
</ha-md-dialog>
|
||||||
dialogInitialFocus
|
|
||||||
>
|
|
||||||
</supervisor-backup-content>
|
|
||||||
`}
|
|
||||||
${this._error
|
|
||||||
? html`<ha-alert alert-type="error">${this._error}</ha-alert>`
|
|
||||||
: nothing}
|
|
||||||
|
|
||||||
<mwc-button
|
|
||||||
.disabled=${this._restoringBackup}
|
|
||||||
slot="secondaryAction"
|
|
||||||
@click=${this._restoreClicked}
|
|
||||||
>
|
|
||||||
${this._localize("restore")}
|
|
||||||
</mwc-button>
|
|
||||||
|
|
||||||
${!this._dialogParams.onboarding && this._dialogParams.supervisor
|
|
||||||
? html`<ha-button-menu
|
|
||||||
fixed
|
|
||||||
slot="primaryAction"
|
|
||||||
@action=${this._handleMenuAction}
|
|
||||||
@closed=${stopPropagation}
|
|
||||||
>
|
|
||||||
<ha-icon-button
|
|
||||||
.label=${this._dialogParams.supervisor.localize(
|
|
||||||
"backup.more_actions"
|
|
||||||
)}
|
|
||||||
.path=${mdiDotsVertical}
|
|
||||||
slot="trigger"
|
|
||||||
></ha-icon-button>
|
|
||||||
<mwc-list-item
|
|
||||||
>${this._dialogParams.supervisor.localize(
|
|
||||||
"backup.download_backup"
|
|
||||||
)}</mwc-list-item
|
|
||||||
>
|
|
||||||
<mwc-list-item class="error"
|
|
||||||
>${this._dialogParams.supervisor.localize(
|
|
||||||
"backup.delete_backup_title"
|
|
||||||
)}</mwc-list-item
|
|
||||||
>
|
|
||||||
</ha-button-menu>`
|
|
||||||
: nothing}
|
|
||||||
</ha-dialog>
|
|
||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
|
||||||
return [
|
|
||||||
haStyle,
|
|
||||||
haStyleDialog,
|
|
||||||
css`
|
|
||||||
ha-circular-progress {
|
|
||||||
display: block;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
ha-header-bar {
|
|
||||||
--mdc-theme-on-primary: var(--primary-text-color);
|
|
||||||
--mdc-theme-primary: var(--mdc-theme-surface);
|
|
||||||
flex-shrink: 0;
|
|
||||||
display: block;
|
|
||||||
}
|
|
||||||
ha-icon-button {
|
|
||||||
color: var(--secondary-text-color);
|
|
||||||
}
|
|
||||||
`,
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
private _handleMenuAction(ev: CustomEvent<ActionDetail>) {
|
private _handleMenuAction(ev: CustomEvent<ActionDetail>) {
|
||||||
switch (ev.detail.index) {
|
switch (ev.detail.index) {
|
||||||
case 0:
|
case 0:
|
||||||
@@ -186,16 +177,7 @@ class HassioBackupDialog
|
|||||||
private async _restoreClicked() {
|
private async _restoreClicked() {
|
||||||
const backupDetails = this._backupContent.backupDetails();
|
const backupDetails = this._backupContent.backupDetails();
|
||||||
this._restoringBackup = true;
|
this._restoringBackup = true;
|
||||||
this._dialogParams?.onRestoring?.();
|
|
||||||
if (this._backupContent.backupType === "full") {
|
|
||||||
await this._fullRestoreClicked(backupDetails);
|
|
||||||
} else {
|
|
||||||
await this._partialRestoreClicked(backupDetails);
|
|
||||||
}
|
|
||||||
this._restoringBackup = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
private async _partialRestoreClicked(backupDetails) {
|
|
||||||
const supervisor = this._dialogParams?.supervisor;
|
const supervisor = this._dialogParams?.supervisor;
|
||||||
if (supervisor !== undefined && supervisor.info.state !== "running") {
|
if (supervisor !== undefined && supervisor.info.state !== "running") {
|
||||||
await showAlertDialog(this, {
|
await showAlertDialog(this, {
|
||||||
@@ -204,91 +186,50 @@ class HassioBackupDialog
|
|||||||
state: supervisor.info.state,
|
state: supervisor.info.state,
|
||||||
}),
|
}),
|
||||||
});
|
});
|
||||||
|
this._restoringBackup = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (
|
if (
|
||||||
!(await showConfirmationDialog(this, {
|
!(await showConfirmationDialog(this, {
|
||||||
title: this._localize("confirm_restore_partial_backup_title"),
|
title: supervisor?.localize(
|
||||||
text: this._localize("confirm_restore_partial_backup_text"),
|
`backup.${
|
||||||
confirmText: this._localize("restore"),
|
this._backup!.type === "full"
|
||||||
dismissText: this._localize("cancel"),
|
? "confirm_restore_full_backup_title"
|
||||||
|
: "confirm_restore_partial_backup_title"
|
||||||
|
}`
|
||||||
|
),
|
||||||
|
text: supervisor?.localize(
|
||||||
|
`backup.${
|
||||||
|
this._backup!.type === "full"
|
||||||
|
? "confirm_restore_full_backup_text"
|
||||||
|
: "confirm_restore_partial_backup_text"
|
||||||
|
}`
|
||||||
|
),
|
||||||
|
confirmText: supervisor?.localize("backup.restore"),
|
||||||
|
dismissText: supervisor?.localize("backup.cancel"),
|
||||||
}))
|
}))
|
||||||
) {
|
) {
|
||||||
|
this._restoringBackup = false;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!this._dialogParams?.onboarding) {
|
try {
|
||||||
try {
|
await restoreBackup(
|
||||||
await this.hass!.callApi(
|
this.hass,
|
||||||
"POST",
|
this._backup!.type,
|
||||||
|
this._backup!.slug,
|
||||||
`hassio/${
|
{ ...backupDetails, background: this._dialogParams?.onboarding },
|
||||||
atLeastVersion(this.hass!.config.version, 2021, 9)
|
!!this.hass && atLeastVersion(this.hass.config.version, 2021, 9)
|
||||||
? "backups"
|
|
||||||
: "snapshots"
|
|
||||||
}/${this._backup!.slug}/restore/partial`,
|
|
||||||
backupDetails
|
|
||||||
);
|
|
||||||
this.closeDialog();
|
|
||||||
} catch (error: any) {
|
|
||||||
this._error = error.body.message;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
this._dialogParams?.onRestoring?.();
|
|
||||||
await fetch(`/api/hassio/backups/${this._backup!.slug}/restore/partial`, {
|
|
||||||
method: "POST",
|
|
||||||
body: JSON.stringify(backupDetails),
|
|
||||||
});
|
|
||||||
this.closeDialog();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private async _fullRestoreClicked(backupDetails) {
|
|
||||||
const supervisor = this._dialogParams?.supervisor;
|
|
||||||
if (supervisor !== undefined && supervisor.info.state !== "running") {
|
|
||||||
await showAlertDialog(this, {
|
|
||||||
title: supervisor.localize("backup.could_not_restore"),
|
|
||||||
text: supervisor.localize("backup.restore_blocked_not_running", {
|
|
||||||
state: supervisor.info.state,
|
|
||||||
}),
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
if (
|
|
||||||
!(await showConfirmationDialog(this, {
|
|
||||||
title: this._localize("confirm_restore_full_backup_title"),
|
|
||||||
text: this._localize("confirm_restore_full_backup_text"),
|
|
||||||
confirmText: this._localize("restore"),
|
|
||||||
dismissText: this._localize("cancel"),
|
|
||||||
}))
|
|
||||||
) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!this._dialogParams?.onboarding) {
|
|
||||||
this.hass!.callApi(
|
|
||||||
"POST",
|
|
||||||
`hassio/${
|
|
||||||
atLeastVersion(this.hass!.config.version, 2021, 9)
|
|
||||||
? "backups"
|
|
||||||
: "snapshots"
|
|
||||||
}/${this._backup!.slug}/restore/full`,
|
|
||||||
backupDetails
|
|
||||||
).then(
|
|
||||||
() => {
|
|
||||||
this.closeDialog();
|
|
||||||
},
|
|
||||||
(error) => {
|
|
||||||
this._error = error.body.message;
|
|
||||||
}
|
|
||||||
);
|
);
|
||||||
} else {
|
|
||||||
this._dialogParams?.onRestoring?.();
|
this._dialogParams?.onRestoring?.();
|
||||||
fetch(`/api/hassio/backups/${this._backup!.slug}/restore/full`, {
|
|
||||||
method: "POST",
|
|
||||||
body: JSON.stringify(backupDetails),
|
|
||||||
});
|
|
||||||
this.closeDialog();
|
this.closeDialog();
|
||||||
|
} catch (error: any) {
|
||||||
|
this._error =
|
||||||
|
error?.body?.message ||
|
||||||
|
supervisor?.localize("backup.restore_start_failed");
|
||||||
|
} finally {
|
||||||
|
this._restoringBackup = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -345,7 +286,7 @@ class HassioBackupDialog
|
|||||||
title: supervisor.localize("backup.remote_download_title"),
|
title: supervisor.localize("backup.remote_download_title"),
|
||||||
text: supervisor.localize("backup.remote_download_text"),
|
text: supervisor.localize("backup.remote_download_text"),
|
||||||
confirmText: supervisor.localize("backup.download"),
|
confirmText: supervisor.localize("backup.download"),
|
||||||
dismissText: this._localize("cancel"),
|
dismissText: supervisor?.localize("backup.cancel"),
|
||||||
});
|
});
|
||||||
if (!confirm) {
|
if (!confirm) {
|
||||||
return;
|
return;
|
||||||
@@ -361,7 +302,36 @@ class HassioBackupDialog
|
|||||||
private get _computeName() {
|
private get _computeName() {
|
||||||
return this._backup
|
return this._backup
|
||||||
? this._backup.name || this._backup.slug
|
? this._backup.name || this._backup.slug
|
||||||
: "Unnamed backup";
|
: this._dialogParams!.supervisor?.localize("backup.unnamed_backup") || "";
|
||||||
|
}
|
||||||
|
|
||||||
|
static get styles(): CSSResultGroup {
|
||||||
|
return [
|
||||||
|
haStyle,
|
||||||
|
haStyleDialog,
|
||||||
|
css`
|
||||||
|
ha-circular-progress {
|
||||||
|
display: block;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
ha-header-bar {
|
||||||
|
--mdc-theme-on-primary: var(--primary-text-color);
|
||||||
|
--mdc-theme-primary: var(--mdc-theme-surface);
|
||||||
|
flex-shrink: 0;
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
ha-icon-button {
|
||||||
|
color: var(--secondary-text-color);
|
||||||
|
}
|
||||||
|
.loading {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
height: 100%;
|
||||||
|
justify-content: center;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
`,
|
||||||
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../../src/common/dom/fire_event";
|
||||||
import type { LocalizeFunc } from "../../../../src/common/translations/localize";
|
|
||||||
import type { Supervisor } from "../../../../src/data/supervisor/supervisor";
|
import type { Supervisor } from "../../../../src/data/supervisor/supervisor";
|
||||||
|
|
||||||
export interface HassioBackupDialogParams {
|
export interface HassioBackupDialogParams {
|
||||||
@@ -8,7 +7,6 @@ export interface HassioBackupDialogParams {
|
|||||||
onRestoring?: () => void;
|
onRestoring?: () => void;
|
||||||
onboarding?: boolean;
|
onboarding?: boolean;
|
||||||
supervisor?: Supervisor;
|
supervisor?: Supervisor;
|
||||||
localize?: LocalizeFunc;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export const showHassioBackupDialog = (
|
export const showHassioBackupDialog = (
|
||||||
|
|||||||
@@ -82,10 +82,11 @@ export class DialogHassioNetwork
|
|||||||
await this.updateComplete;
|
await this.updateComplete;
|
||||||
}
|
}
|
||||||
|
|
||||||
public closeDialog(): void {
|
public closeDialog() {
|
||||||
this._params = undefined;
|
this._params = undefined;
|
||||||
this._processing = false;
|
this._processing = false;
|
||||||
fireEvent(this, "dialog-closed", { dialog: this.localName });
|
fireEvent(this, "dialog-closed", { dialog: this.localName });
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected render() {
|
protected render() {
|
||||||
|
|||||||
@@ -92,7 +92,7 @@ class HassioMyRedirect extends LitElement {
|
|||||||
let url: string;
|
let url: string;
|
||||||
try {
|
try {
|
||||||
url = this._createRedirectUrl(redirect);
|
url = this._createRedirectUrl(redirect);
|
||||||
} catch (err: any) {
|
} catch (_err: any) {
|
||||||
this._error = this.supervisor.localize("my.error");
|
this._error = this.supervisor.localize("my.error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { TemplateResult } from "lit";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import type { Supervisor } from "../../src/data/supervisor/supervisor";
|
import type { Supervisor } from "../../src/data/supervisor/supervisor";
|
||||||
@@ -39,15 +39,13 @@ class HassioPanel extends LitElement {
|
|||||||
`;
|
`;
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static styles = css`
|
||||||
return css`
|
:host {
|
||||||
:host {
|
--app-header-background-color: var(--sidebar-background-color);
|
||||||
--app-header-background-color: var(--sidebar-background-color);
|
--app-header-text-color: var(--sidebar-text-color);
|
||||||
--app-header-text-color: var(--sidebar-text-color);
|
--app-header-border-bottom: 1px solid var(--divider-color);
|
||||||
--app-header-border-bottom: 1px solid var(--divider-color);
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
import { mdiMenu } from "@mdi/js";
|
import { mdiMenu } from "@mdi/js";
|
||||||
import type { CSSResultGroup, PropertyValues, TemplateResult } from "lit";
|
import type { PropertyValues, TemplateResult } from "lit";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import { fireEvent } from "../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../src/common/dom/fire_event";
|
||||||
@@ -158,7 +158,7 @@ class HassioIngressView extends LitElement {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
addon = await fetchHassioAddonInfo(this.hass, addonSlug);
|
addon = await fetchHassioAddonInfo(this.hass, addonSlug);
|
||||||
} catch (err: any) {
|
} catch (_err: any) {
|
||||||
await this.updateComplete;
|
await this.updateComplete;
|
||||||
await showAlertDialog(this, {
|
await showAlertDialog(this, {
|
||||||
text:
|
text:
|
||||||
@@ -219,7 +219,7 @@ class HassioIngressView extends LitElement {
|
|||||||
});
|
});
|
||||||
this._fetchData(addonSlug);
|
this._fetchData(addonSlug);
|
||||||
return;
|
return;
|
||||||
} catch (e) {
|
} catch (_err) {
|
||||||
await showAlertDialog(this, {
|
await showAlertDialog(this, {
|
||||||
text:
|
text:
|
||||||
this.supervisor.localize("ingress.error_starting_addon") ||
|
this.supervisor.localize("ingress.error_starting_addon") ||
|
||||||
@@ -264,7 +264,7 @@ class HassioIngressView extends LitElement {
|
|||||||
|
|
||||||
try {
|
try {
|
||||||
session = await createSessionPromise;
|
session = await createSessionPromise;
|
||||||
} catch (err: any) {
|
} catch (_err: any) {
|
||||||
if (this._sessionKeepAlive) {
|
if (this._sessionKeepAlive) {
|
||||||
clearInterval(this._sessionKeepAlive);
|
clearInterval(this._sessionKeepAlive);
|
||||||
}
|
}
|
||||||
@@ -285,7 +285,7 @@ class HassioIngressView extends LitElement {
|
|||||||
this._sessionKeepAlive = window.setInterval(async () => {
|
this._sessionKeepAlive = window.setInterval(async () => {
|
||||||
try {
|
try {
|
||||||
await validateHassioSession(this.hass, session);
|
await validateHassioSession(this.hass, session);
|
||||||
} catch (err: any) {
|
} catch (_err: any) {
|
||||||
session = await createHassioSession(this.hass);
|
session = await createHassioSession(this.hass);
|
||||||
}
|
}
|
||||||
}, 60000);
|
}, 60000);
|
||||||
@@ -325,51 +325,49 @@ class HassioIngressView extends LitElement {
|
|||||||
fireEvent(this, "hass-toggle-menu");
|
fireEvent(this, "hass-toggle-menu");
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static styles = css`
|
||||||
return css`
|
iframe {
|
||||||
iframe {
|
display: block;
|
||||||
display: block;
|
width: 100%;
|
||||||
width: 100%;
|
height: 100%;
|
||||||
height: 100%;
|
border: 0;
|
||||||
border: 0;
|
}
|
||||||
}
|
|
||||||
|
|
||||||
.header + iframe {
|
.header + iframe {
|
||||||
height: calc(100% - 40px);
|
height: calc(100% - 40px);
|
||||||
}
|
}
|
||||||
|
|
||||||
.header {
|
.header {
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
font-size: 16px;
|
font-size: 16px;
|
||||||
height: 40px;
|
height: 40px;
|
||||||
padding: 0 16px;
|
padding: 0 16px;
|
||||||
pointer-events: none;
|
pointer-events: none;
|
||||||
background-color: var(--app-header-background-color);
|
background-color: var(--app-header-background-color);
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
color: var(--app-header-text-color, white);
|
color: var(--app-header-text-color, white);
|
||||||
border-bottom: var(--app-header-border-bottom, none);
|
border-bottom: var(--app-header-border-bottom, none);
|
||||||
box-sizing: border-box;
|
box-sizing: border-box;
|
||||||
--mdc-icon-size: 20px;
|
--mdc-icon-size: 20px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.main-title {
|
.main-title {
|
||||||
margin: var(--margin-title);
|
margin: var(--margin-title);
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
ha-icon-button {
|
ha-icon-button {
|
||||||
pointer-events: auto;
|
pointer-events: auto;
|
||||||
}
|
}
|
||||||
|
|
||||||
hass-subpage {
|
hass-subpage {
|
||||||
--app-header-background-color: var(--sidebar-background-color);
|
--app-header-background-color: var(--sidebar-background-color);
|
||||||
--app-header-text-color: var(--sidebar-text-color);
|
--app-header-text-color: var(--sidebar-text-color);
|
||||||
--app-header-border-bottom: 1px solid var(--divider-color);
|
--app-header-border-bottom: 1px solid var(--divider-color);
|
||||||
}
|
}
|
||||||
`;
|
`;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
@@ -33,7 +33,7 @@ class HassioCoreInfo extends LitElement {
|
|||||||
|
|
||||||
@state() private _metrics?: HassioStats;
|
@state() private _metrics?: HassioStats;
|
||||||
|
|
||||||
protected render(): TemplateResult | void {
|
protected render(): TemplateResult | undefined {
|
||||||
const metrics = [
|
const metrics = [
|
||||||
{
|
{
|
||||||
description: this.supervisor.localize("system.core.cpu_usage"),
|
description: this.supervisor.localize("system.core.cpu_usage"),
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ class HassioHostInfo extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public supervisor!: Supervisor;
|
@property({ attribute: false }) public supervisor!: Supervisor;
|
||||||
|
|
||||||
protected render(): TemplateResult | void {
|
protected render(): TemplateResult | undefined {
|
||||||
const primaryIpAddress = this.supervisor.host.features.includes("network")
|
const primaryIpAddress = this.supervisor.host.features.includes("network")
|
||||||
? this._primaryIpAddress(this.supervisor.network!)
|
? this._primaryIpAddress(this.supervisor.network!)
|
||||||
: "";
|
: "";
|
||||||
|
|||||||
@@ -44,7 +44,7 @@ class HassioSupervisorInfo extends LitElement {
|
|||||||
|
|
||||||
@state() private _metrics?: HassioStats;
|
@state() private _metrics?: HassioStats;
|
||||||
|
|
||||||
protected render(): TemplateResult | void {
|
protected render(): TemplateResult | undefined {
|
||||||
const metrics = [
|
const metrics = [
|
||||||
{
|
{
|
||||||
description: this.supervisor.localize("system.supervisor.cpu_usage"),
|
description: this.supervisor.localize("system.supervisor.cpu_usage"),
|
||||||
|
|||||||
@@ -65,7 +65,7 @@ class HassioSupervisorLog extends LitElement {
|
|||||||
await this._loadData();
|
await this._loadData();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected render(): TemplateResult | void {
|
protected render(): TemplateResult | undefined {
|
||||||
return html`
|
return html`
|
||||||
<ha-card outlined>
|
<ha-card outlined>
|
||||||
${this._error
|
${this._error
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ class HassioSystem extends LitElement {
|
|||||||
|
|
||||||
@property({ attribute: false }) public route!: Route;
|
@property({ attribute: false }) public route!: Route;
|
||||||
|
|
||||||
protected render(): TemplateResult | void {
|
protected render(): TemplateResult | undefined {
|
||||||
return html`
|
return html`
|
||||||
<hass-tabs-subpage
|
<hass-tabs-subpage
|
||||||
.hass=${this.hass}
|
.hass=${this.hass}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ import {
|
|||||||
} from "lit";
|
} from "lit";
|
||||||
import { customElement, property, state } from "lit/decorators";
|
import { customElement, property, state } from "lit/decorators";
|
||||||
import memoizeOne from "memoize-one";
|
import memoizeOne from "memoize-one";
|
||||||
|
import { atLeastVersion } from "../../../src/common/config/version";
|
||||||
import { fireEvent } from "../../../src/common/dom/fire_event";
|
import { fireEvent } from "../../../src/common/dom/fire_event";
|
||||||
import "../../../src/components/buttons/ha-progress-button";
|
import "../../../src/components/buttons/ha-progress-button";
|
||||||
import "../../../src/components/ha-alert";
|
import "../../../src/components/ha-alert";
|
||||||
@@ -18,7 +19,8 @@ import "../../../src/components/ha-checkbox";
|
|||||||
import "../../../src/components/ha-faded";
|
import "../../../src/components/ha-faded";
|
||||||
import "../../../src/components/ha-icon-button";
|
import "../../../src/components/ha-icon-button";
|
||||||
import "../../../src/components/ha-markdown";
|
import "../../../src/components/ha-markdown";
|
||||||
import "../../../src/components/ha-settings-row";
|
import "../../../src/components/ha-md-list";
|
||||||
|
import "../../../src/components/ha-md-list-item";
|
||||||
import "../../../src/components/ha-svg-icon";
|
import "../../../src/components/ha-svg-icon";
|
||||||
import "../../../src/components/ha-switch";
|
import "../../../src/components/ha-switch";
|
||||||
import type { HaSwitch } from "../../../src/components/ha-switch";
|
import type { HaSwitch } from "../../../src/components/ha-switch";
|
||||||
@@ -124,6 +126,8 @@ class UpdateAvailableCard extends LitElement {
|
|||||||
|
|
||||||
const changelog = changelogUrl(this._updateType, this._version_latest);
|
const changelog = changelogUrl(this._updateType, this._version_latest);
|
||||||
|
|
||||||
|
const createBackupTexts = this._computeCreateBackupTexts();
|
||||||
|
|
||||||
return html`
|
return html`
|
||||||
<ha-card
|
<ha-card
|
||||||
outlined
|
outlined
|
||||||
@@ -163,17 +167,28 @@ class UpdateAvailableCard extends LitElement {
|
|||||||
)}
|
)}
|
||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
${["core", "addon"].includes(this._updateType)
|
${createBackupTexts
|
||||||
? html`
|
? html`
|
||||||
<hr />
|
<hr />
|
||||||
<ha-settings-row>
|
<ha-md-list>
|
||||||
<span slot="heading">
|
<ha-md-list-item>
|
||||||
${this.supervisor.localize(
|
<span slot="headline">
|
||||||
"update_available.create_backup"
|
${createBackupTexts.title}
|
||||||
)}
|
</span>
|
||||||
</span>
|
|
||||||
<ha-switch id="create_backup" checked></ha-switch>
|
${createBackupTexts.description
|
||||||
</ha-settings-row>
|
? html`
|
||||||
|
<span slot="supporting-text">
|
||||||
|
${createBackupTexts.description}
|
||||||
|
</span>
|
||||||
|
`
|
||||||
|
: nothing}
|
||||||
|
<ha-switch
|
||||||
|
slot="end"
|
||||||
|
id="create-backup"
|
||||||
|
></ha-switch>
|
||||||
|
</ha-md-list-item>
|
||||||
|
</ha-md-list>
|
||||||
`
|
`
|
||||||
: nothing}
|
: nothing}
|
||||||
`
|
`
|
||||||
@@ -243,6 +258,35 @@ class UpdateAvailableCard extends LitElement {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private _computeCreateBackupTexts():
|
||||||
|
| { title: string; description?: string }
|
||||||
|
| undefined {
|
||||||
|
// Addon backup
|
||||||
|
if (
|
||||||
|
this._updateType === "addon" &&
|
||||||
|
atLeastVersion(this.hass.config.version, 2025, 2, 0)
|
||||||
|
) {
|
||||||
|
const version = this._version;
|
||||||
|
return {
|
||||||
|
title: this.supervisor.localize("update_available.create_backup.addon"),
|
||||||
|
description: this.supervisor.localize(
|
||||||
|
"update_available.create_backup.addon_description",
|
||||||
|
{ version: version }
|
||||||
|
),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
// Old behavior
|
||||||
|
if (this._updateType && ["core", "addon"].includes(this._updateType)) {
|
||||||
|
return {
|
||||||
|
title: this.supervisor.localize(
|
||||||
|
"update_available.create_backup.generic"
|
||||||
|
),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
|
||||||
get _shouldCreateBackup(): boolean {
|
get _shouldCreateBackup(): boolean {
|
||||||
if (this._updateType && !["core", "addon"].includes(this._updateType)) {
|
if (this._updateType && !["core", "addon"].includes(this._updateType)) {
|
||||||
return false;
|
return false;
|
||||||
@@ -374,7 +418,6 @@ class UpdateAvailableCard extends LitElement {
|
|||||||
this._error = this.supervisor.localize("backup.backup_already_running");
|
this._error = this.supervisor.localize("backup.backup_already_running");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
this._error = undefined;
|
this._error = undefined;
|
||||||
this._updating = true;
|
this._updating = true;
|
||||||
|
|
||||||
@@ -436,16 +479,22 @@ class UpdateAvailableCard extends LitElement {
|
|||||||
padding-bottom: 8px;
|
padding-bottom: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
ha-settings-row {
|
|
||||||
padding: 0;
|
|
||||||
margin-bottom: -16px;
|
|
||||||
}
|
|
||||||
|
|
||||||
hr {
|
hr {
|
||||||
border-color: var(--divider-color);
|
border-color: var(--divider-color);
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
margin: 16px 0 0 0;
|
margin: 16px 0 0 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ha-md-list {
|
||||||
|
padding: 0;
|
||||||
|
margin-bottom: -16px;
|
||||||
|
}
|
||||||
|
|
||||||
|
ha-md-list-item {
|
||||||
|
--md-list-item-leading-space: 0;
|
||||||
|
--md-list-item-trailing-space: 0;
|
||||||
|
--md-item-overflow: visible;
|
||||||
|
}
|
||||||
`,
|
`,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { CSSResultGroup, TemplateResult } from "lit";
|
import type { TemplateResult } from "lit";
|
||||||
import { css, html, LitElement } from "lit";
|
import { css, html, LitElement } from "lit";
|
||||||
import { customElement, property } from "lit/decorators";
|
import { customElement, property } from "lit/decorators";
|
||||||
import type { Supervisor } from "../../../src/data/supervisor/supervisor";
|
import type { Supervisor } from "../../../src/data/supervisor/supervisor";
|
||||||
@@ -38,20 +38,18 @@ class UpdateAvailableDashboard extends LitElement {
|
|||||||
history.back();
|
history.back();
|
||||||
}
|
}
|
||||||
|
|
||||||
static get styles(): CSSResultGroup {
|
static styles = css`
|
||||||
return css`
|
hass-subpage {
|
||||||
hass-subpage {
|
--app-header-background-color: var(--primary-background-color);
|
||||||
--app-header-background-color: var(--primary-background-color);
|
--app-header-text-color: var(--sidebar-text-color);
|
||||||
--app-header-text-color: var(--sidebar-text-color);
|
}
|
||||||
}
|
update-available-card {
|
||||||
update-available-card {
|
margin: auto;
|
||||||
margin: auto;
|
margin-top: 16px;
|
||||||
margin-top: 16px;
|
margin-bottom: 24px;
|
||||||
margin-bottom: 24px;
|
max-width: 600px;
|
||||||
max-width: 600px;
|
}
|
||||||
}
|
`;
|
||||||
`;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user