mirror of
https://github.com/esphome/esphome.git
synced 2025-11-06 10:01:51 +00:00
Compare commits
978 Commits
2025.3.0b4
...
modbus_hea
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ab9287e959 | ||
|
|
58b4e7dab2 | ||
|
|
d686257cff | ||
|
|
adb7ccdbc7 | ||
|
|
d00e20ccdf | ||
|
|
25457da97c | ||
|
|
14d7c4bdbd | ||
|
|
eef71a79da | ||
|
|
547c7d6dc8 | ||
|
|
1ef7b2d64f | ||
|
|
107304b274 | ||
|
|
b2b6f41ef3 | ||
|
|
34db02661c | ||
|
|
798eef41b9 | ||
|
|
658e4bac47 | ||
|
|
f5aab154a6 | ||
|
|
5b55e205ef | ||
|
|
4ef5c941c9 | ||
|
|
b9391f2cd4 | ||
|
|
66e090ff5b | ||
|
|
d41298897f | ||
|
|
ba42de536c | ||
|
|
bdc9f5f3b2 | ||
|
|
90f9ab0d3e | ||
|
|
00eb56d8db | ||
|
|
60eac6ea07 | ||
|
|
9b3ece4caf | ||
|
|
289aedcfe2 | ||
|
|
4cdc804c17 | ||
|
|
56a963dfe6 | ||
|
|
f6f0e52d5e | ||
|
|
eba2c82fec | ||
|
|
fae96e279c | ||
|
|
2fb23becec | ||
|
|
095acce3e2 | ||
|
|
5fa9d22c5d | ||
|
|
785b14ac84 | ||
|
|
84ab758b22 | ||
|
|
03566c34ed | ||
|
|
6a096c1d5a | ||
|
|
04a46de237 | ||
|
|
0083abe3b5 | ||
|
|
3470305d9d | ||
|
|
35de36d690 | ||
|
|
16ef5a9377 | ||
|
|
e3ccb9b46c | ||
|
|
8c34b72b62 | ||
|
|
27c745d5a1 | ||
|
|
9a0ba1657e | ||
|
|
db7a420e54 | ||
|
|
e58baab563 | ||
|
|
08c88ba0f2 | ||
|
|
78c8cd4c4e | ||
|
|
98e106e0ae | ||
|
|
0cbb5e6c1c | ||
|
|
8014cbc71e | ||
|
|
aaa7117ec9 | ||
|
|
3930609d8b | ||
|
|
3e553f517b | ||
|
|
af0bb634c6 | ||
|
|
8a9769d4e9 | ||
|
|
d86f319d66 | ||
|
|
9890659f61 | ||
|
|
140ca070a2 | ||
|
|
6a354d7c94 | ||
|
|
7f8dd4b254 | ||
|
|
0b1b8f05e1 | ||
|
|
53e9ffe656 | ||
|
|
2289073a1e | ||
|
|
687cb1cd2b | ||
|
|
e907050a17 | ||
|
|
a4b57c7e44 | ||
|
|
24bbfcdce7 | ||
|
|
d78b720350 | ||
|
|
d592208c74 | ||
|
|
971bbd088c | ||
|
|
b743577ebe | ||
|
|
a4cc6166a0 | ||
|
|
ed9850c4a4 | ||
|
|
ddbcf8549c | ||
|
|
921d0888cd | ||
|
|
21e1f3d103 | ||
|
|
53ab016098 | ||
|
|
0c249a7006 | ||
|
|
86c0fb48a3 | ||
|
|
3f1f99cf37 | ||
|
|
13d4823db6 | ||
|
|
30f61b26ff | ||
|
|
58b7d0b412 | ||
|
|
d37f5b87bd | ||
|
|
3f65cee17c | ||
|
|
094bf19ec4 | ||
|
|
f8d59b5aeb | ||
|
|
e9870c2922 | ||
|
|
50b7349fe0 | ||
|
|
61b3379f48 | ||
|
|
5010a0f5e7 | ||
|
|
52ca8deb10 | ||
|
|
156a9160ba | ||
|
|
68d66c873e | ||
|
|
948aa13fb9 | ||
|
|
9e993ac603 | ||
|
|
9f3f4ead4f | ||
|
|
068aa0ff1e | ||
|
|
e146c0796a | ||
|
|
cceab26bfb | ||
|
|
c0b1f32889 | ||
|
|
837dd46adf | ||
|
|
13512440ac | ||
|
|
7931423e8c | ||
|
|
62f28902c5 | ||
|
|
1f94e4cc14 | ||
|
|
61dfd5541f | ||
|
|
87321ce10b | ||
|
|
4f5aacdb3a | ||
|
|
b182f2d544 | ||
|
|
4fac8e9cd5 | ||
|
|
d94896c0fb | ||
|
|
15c5dd222f | ||
|
|
2930c8e9a8 | ||
|
|
b12b9b97f4 | ||
|
|
09e5aa6011 | ||
|
|
9549304007 | ||
|
|
f7ac32ceda | ||
|
|
92365f133d | ||
|
|
9daa9a6de8 | ||
|
|
23b1e428de | ||
|
|
f029f4f20e | ||
|
|
79e3d2b2d7 | ||
|
|
c74e5e0f04 | ||
|
|
15ef93ccc9 | ||
|
|
e017250445 | ||
|
|
17497eec43 | ||
|
|
6d0c6329ad | ||
|
|
f35be6b5cc | ||
|
|
b18ff48b4a | ||
|
|
7c28134214 | ||
|
|
16860e8a30 | ||
|
|
5362d1a89f | ||
|
|
5531296ee0 | ||
|
|
47db5e26f3 | ||
|
|
cf5197b68a | ||
|
|
9f831e91b3 | ||
|
|
2df0ebd895 | ||
|
|
7ad6dab383 | ||
|
|
612c8d5841 | ||
|
|
a35e476be5 | ||
|
|
87a7157fc4 | ||
|
|
fa34adbf6c | ||
|
|
ac942e0670 | ||
|
|
22e360d479 | ||
|
|
649936200e | ||
|
|
5d6e690c12 | ||
|
|
2f2ecadae7 | ||
|
|
6dfb9eba61 | ||
|
|
24587fe875 | ||
|
|
a1aebe6a2c | ||
|
|
2ad266582f | ||
|
|
1a47164876 | ||
|
|
cd22723623 | ||
|
|
aecaffa2f5 | ||
|
|
87df3596a2 | ||
|
|
41c7852128 | ||
|
|
78ec9856fb | ||
|
|
2a45467bf6 | ||
|
|
7fc5bfd787 | ||
|
|
04f592ba6d | ||
|
|
59889a6286 | ||
|
|
dc5cbd4df8 | ||
|
|
7ab9083d77 | ||
|
|
788803d588 | ||
|
|
cbfd904b9f | ||
|
|
c81dbf9d59 | ||
|
|
ac9c608542 | ||
|
|
a6c20853ca | ||
|
|
4ef0264ed3 | ||
|
|
169db9cc0a | ||
|
|
b693b8ccb1 | ||
|
|
3e98cceb00 | ||
|
|
46d962dcf1 | ||
|
|
7dbad42470 | ||
|
|
eb97781f68 | ||
|
|
4d0f8528d2 | ||
|
|
2c17b2bacc | ||
|
|
30bea20f7a | ||
|
|
d4cb4ef994 | ||
|
|
9c90ca297a | ||
|
|
a9e1a4cef3 | ||
|
|
0ce3621ac0 | ||
|
|
d527398dae | ||
|
|
2e9ac8945d | ||
|
|
40a5638005 | ||
|
|
8ba22183b9 | ||
|
|
2e11e66db4 | ||
|
|
eeb0710ad4 | ||
|
|
43c677ef37 | ||
|
|
95544e489d | ||
|
|
a08d021f77 | ||
|
|
b7b1d17ecb | ||
|
|
aa180b9581 | ||
|
|
57388254c4 | ||
|
|
f16f4e2c4c | ||
|
|
89b70e4352 | ||
|
|
6667336bd8 | ||
|
|
669ef7a0b1 | ||
|
|
c612985930 | ||
|
|
2e534ce41e | ||
|
|
fedb54bb38 | ||
|
|
68f5144084 | ||
|
|
fd3c22945b | ||
|
|
53496a1ecd | ||
|
|
da5cf99549 | ||
|
|
849c858495 | ||
|
|
808f964841 | ||
|
|
16a0f9db97 | ||
|
|
3bc5db4fd7 | ||
|
|
5269523ca1 | ||
|
|
89267b9e06 | ||
|
|
4bc9646e8f | ||
|
|
fd83628c49 | ||
|
|
62abfbec9e | ||
|
|
7cc0008837 | ||
|
|
0bf613bd34 | ||
|
|
43ab63455b | ||
|
|
47e7988c8e | ||
|
|
7ed095e635 | ||
|
|
cb8b0ec62e | ||
|
|
bf161f1eaa | ||
|
|
78c8447d1e | ||
|
|
5ffe50381a | ||
|
|
b08bd0c24a | ||
|
|
738ad8e9d3 | ||
|
|
fa7c42511a | ||
|
|
68ef9cb3dc | ||
|
|
8e176b9c61 | ||
|
|
426be153db | ||
|
|
c4f7c2d259 | ||
|
|
2a81efda0b | ||
|
|
882bfc79c7 | ||
|
|
6bad276589 | ||
|
|
47d8048a62 | ||
|
|
20d7ba5d7c | ||
|
|
e435e72654 | ||
|
|
497d66f7ec | ||
|
|
242b02a416 | ||
|
|
9644a6bb9c | ||
|
|
70d66062d6 | ||
|
|
39f6f9b0dc | ||
|
|
0454dd4e07 | ||
|
|
6f4e76c8f3 | ||
|
|
5cdcf2415d | ||
|
|
1719a2e08b | ||
|
|
5640a9fe73 | ||
|
|
4787e22f61 | ||
|
|
fb12e4e66a | ||
|
|
77740a1044 | ||
|
|
1fdfe7578f | ||
|
|
ebecf7047e | ||
|
|
00e8332bf5 | ||
|
|
5fc1f90822 | ||
|
|
0a1be3d19c | ||
|
|
40db3146b9 | ||
|
|
535c495b33 | ||
|
|
592446e430 | ||
|
|
7a5c9a821a | ||
|
|
c17a3b6fcc | ||
|
|
28d11553e0 | ||
|
|
1dbebe90ba | ||
|
|
06810e8e6a | ||
|
|
bd85ba9b6a | ||
|
|
be58cdda3b | ||
|
|
fcce4a8be6 | ||
|
|
61a558a062 | ||
|
|
59f69ac5ca | ||
|
|
f82ac34784 | ||
|
|
07cf6e723b | ||
|
|
78e3c6333f | ||
|
|
98e2684107 | ||
|
|
cb019fff9a | ||
|
|
4305c44440 | ||
|
|
a1e4143600 | ||
|
|
374c33e8dc | ||
|
|
dcfe7af9d3 | ||
|
|
049c7e00ca | ||
|
|
ee37d2f9c8 | ||
|
|
92ea697119 | ||
|
|
1c488d375f | ||
|
|
1a03b4949f | ||
|
|
731b7808cd | ||
|
|
d9da4cf24d | ||
|
|
666a3ee5e9 | ||
|
|
02469c2d4c | ||
|
|
2a629cae93 | ||
|
|
1f14c316a3 | ||
|
|
dac738a916 | ||
|
|
261b561bb2 | ||
|
|
0228379a2e | ||
|
|
da79215bc3 | ||
|
|
44323dc285 | ||
|
|
a59e1c7011 | ||
|
|
abb4d991ad | ||
|
|
f467c79a20 | ||
|
|
dcf41db878 | ||
|
|
c3c3a27af2 | ||
|
|
052f558131 | ||
|
|
e8aa7cff36 | ||
|
|
3411e45a0a | ||
|
|
a488c8cd5c | ||
|
|
9652b1a556 | ||
|
|
69f2c79ccb | ||
|
|
9d9d210176 | ||
|
|
487e1f871f | ||
|
|
0e27ac281f | ||
|
|
ad37f103fa | ||
|
|
b579bbf03b | ||
|
|
7f4d2534aa | ||
|
|
9e26daeb94 | ||
|
|
da6af184a6 | ||
|
|
4d347f1cc6 | ||
|
|
84e57b8136 | ||
|
|
63882c4a74 | ||
|
|
2ed5611a08 | ||
|
|
1467b704b8 | ||
|
|
94848e4811 | ||
|
|
3174f7ae86 | ||
|
|
962a339a8a | ||
|
|
6a76e6ae4a | ||
|
|
ce4371a80d | ||
|
|
b7ca6e087a | ||
|
|
368a0eea8a | ||
|
|
99c368fe62 | ||
|
|
ff406f8e11 | ||
|
|
b98165e077 | ||
|
|
e2a9cced94 | ||
|
|
cdae06e571 | ||
|
|
c0b05ada1a | ||
|
|
80dddb4cae | ||
|
|
245c89a6c1 | ||
|
|
4d044d4ac9 | ||
|
|
9cc2a04d54 | ||
|
|
50cdec19dd | ||
|
|
6d587278bd | ||
|
|
dde63e7459 | ||
|
|
8894f5030a | ||
|
|
9e862b8b53 | ||
|
|
24d4ada841 | ||
|
|
b1a8887548 | ||
|
|
d19997a056 | ||
|
|
de7591882d | ||
|
|
a00fc75c77 | ||
|
|
80fd827f8b | ||
|
|
1dd3c6de90 | ||
|
|
c8c43f13fd | ||
|
|
518bce50a5 | ||
|
|
4f87bea788 | ||
|
|
8054c9b4f5 | ||
|
|
935e0a365f | ||
|
|
b39a9924d8 | ||
|
|
19ec922e28 | ||
|
|
a225d6881f | ||
|
|
6675e99862 | ||
|
|
8cbe2b41f6 | ||
|
|
6a225cb4c0 | ||
|
|
e62d8bfabe | ||
|
|
d4cea84b1b | ||
|
|
b63f90a6c0 | ||
|
|
4370b6695e | ||
|
|
589f13f0f7 | ||
|
|
367017b352 | ||
|
|
ec26d31499 | ||
|
|
1bbc6db1c3 | ||
|
|
162472bdc2 | ||
|
|
aecac15809 | ||
|
|
6554af21b9 | ||
|
|
8583466c6a | ||
|
|
6666604069 | ||
|
|
13e7aacc9d | ||
|
|
737d502614 | ||
|
|
67dd649d00 | ||
|
|
b2fc51367b | ||
|
|
5771bb4907 | ||
|
|
9ba9674437 | ||
|
|
acb1532e34 | ||
|
|
e2093c34da | ||
|
|
a2e4ad90ba | ||
|
|
32e69c67f2 | ||
|
|
df0b5a187e | ||
|
|
cee0e5379b | ||
|
|
daf2bd7e66 | ||
|
|
4031077f6d | ||
|
|
fd72a64053 | ||
|
|
959a8b91bd | ||
|
|
44f1ff10e6 | ||
|
|
64e4589f4e | ||
|
|
20aba45cbe | ||
|
|
0b1c5b825e | ||
|
|
455624105b | ||
|
|
7ac5746e0d | ||
|
|
12997451f6 | ||
|
|
8c77e40695 | ||
|
|
2ddd91acf2 | ||
|
|
729e49cdc3 | ||
|
|
d64b49cc13 | ||
|
|
cfa8b3b272 | ||
|
|
51981335d5 | ||
|
|
70c5e1bbf1 | ||
|
|
43e88af28a | ||
|
|
ffc66f539f | ||
|
|
c4cb694d77 | ||
|
|
3fb9577ad9 | ||
|
|
34169491ac | ||
|
|
8eac859bab | ||
|
|
d99e3237f9 | ||
|
|
d9a9e0aea3 | ||
|
|
0ce03ae26b | ||
|
|
18653f8f69 | ||
|
|
6e0523109a | ||
|
|
b6fa4f641d | ||
|
|
ca6295d1bd | ||
|
|
18a1d31845 | ||
|
|
c5239a63ab | ||
|
|
1911269dc9 | ||
|
|
04ee1a87e9 | ||
|
|
a8fdb6db4d | ||
|
|
8860c74f0c | ||
|
|
d585440d54 | ||
|
|
f74f89c6b5 | ||
|
|
7d049a61bb | ||
|
|
f2e4dc7907 | ||
|
|
0c7589caeb | ||
|
|
321411e355 | ||
|
|
361de22370 | ||
|
|
95a17387a8 | ||
|
|
caf9930ff9 | ||
|
|
42390faf4a | ||
|
|
fdc6c4a219 | ||
|
|
6c08f5e343 | ||
|
|
e0e4ba9592 | ||
|
|
ad20825f31 | ||
|
|
e4f3a952d5 | ||
|
|
90e3c5bba2 | ||
|
|
b1d5ad27f3 | ||
|
|
5c54f75b7a | ||
|
|
a5f85b4437 | ||
|
|
da4e710249 | ||
|
|
4ac433fddb | ||
|
|
73771d5c50 | ||
|
|
af7b1a3a23 | ||
|
|
430f63fcbb | ||
|
|
5921a9cd68 | ||
|
|
ca0037d076 | ||
|
|
1e18d0b06c | ||
|
|
4b5c3e7e2b | ||
|
|
d4c4b75eb3 | ||
|
|
9dd4045984 | ||
|
|
19e2460af2 | ||
|
|
149f787035 | ||
|
|
2ab1fe1abf | ||
|
|
926b42ba1c | ||
|
|
377ed2e212 | ||
|
|
42912447fb | ||
|
|
25ead44f1c | ||
|
|
03b003af47 | ||
|
|
5baccf0ce7 | ||
|
|
e95c92773c | ||
|
|
c23ea384fb | ||
|
|
69da17742f | ||
|
|
1ec57a74b5 | ||
|
|
d1e55252d0 | ||
|
|
090feb55e9 | ||
|
|
6109acb6f3 | ||
|
|
5aa13db815 | ||
|
|
1b67dd4232 | ||
|
|
ba6efcedcb | ||
|
|
bd7c2a680c | ||
|
|
1466aa7703 | ||
|
|
787f4860db | ||
|
|
aeb4e63950 | ||
|
|
026f47bfb3 | ||
|
|
dd47d063b5 | ||
|
|
cdcd1cd292 | ||
|
|
a6fa963605 | ||
|
|
1cba22175f | ||
|
|
f2d7720a4e | ||
|
|
801138da27 | ||
|
|
51740a2e99 | ||
|
|
d68a391e67 | ||
|
|
e9d832d64a | ||
|
|
f8f09bca02 | ||
|
|
756aa13779 | ||
|
|
25bbc0c221 | ||
|
|
220a14e1f8 | ||
|
|
ac74b25c46 | ||
|
|
c5d809b3dd | ||
|
|
b1cf08b261 | ||
|
|
6ae83dfe3d | ||
|
|
0932e83b15 | ||
|
|
86670c4d39 | ||
|
|
4ce55b94ec | ||
|
|
1c5dc63eb4 | ||
|
|
937fe393a1 | ||
|
|
4b552d9fba | ||
|
|
aa53d8f1ee | ||
|
|
a28932bc29 | ||
|
|
afa7414ee1 | ||
|
|
aed7ef481e | ||
|
|
c820fee1f6 | ||
|
|
5244ac4ff6 | ||
|
|
89d283eee4 | ||
|
|
ef053d23b4 | ||
|
|
98470d32f0 | ||
|
|
cab6edd800 | ||
|
|
ef7a22ff04 | ||
|
|
dfda0e5c7c | ||
|
|
78c63311c6 | ||
|
|
1ac51e7b3e | ||
|
|
aaaf9b2b62 | ||
|
|
5b552b9ec5 | ||
|
|
d36ce7c010 | ||
|
|
b8a96f59f0 | ||
|
|
2e15ee232d | ||
|
|
904495e1b8 | ||
|
|
99c4f88c3f | ||
|
|
87a9dd18c8 | ||
|
|
dbce54477a | ||
|
|
38cfd32382 | ||
|
|
1b9ae57b9d | ||
|
|
4d54cb9b31 | ||
|
|
15d0b4355e | ||
|
|
316fe2f06c | ||
|
|
f8681adec4 | ||
|
|
868f5ff20c | ||
|
|
59295a615e | ||
|
|
d8516cfabb | ||
|
|
d847b345b8 | ||
|
|
c50e33f531 | ||
|
|
5a84bab9ec | ||
|
|
41f860c2a3 | ||
|
|
c7e62d1279 | ||
|
|
2341ff651a | ||
|
|
9704de6647 | ||
|
|
660030d157 | ||
|
|
24fbe602dd | ||
|
|
b0c1e0e28c | ||
|
|
574aabdede | ||
|
|
e47741d471 | ||
|
|
a78bea78f9 | ||
|
|
44470f31f6 | ||
|
|
18ac1b7c54 | ||
|
|
e87b659483 | ||
|
|
fefcb45e1f | ||
|
|
5c92367ca2 | ||
|
|
b469a504e4 | ||
|
|
218f8e0caf | ||
|
|
7965558d5e | ||
|
|
d9b860088e | ||
|
|
115975c409 | ||
|
|
4761ffe023 | ||
|
|
88edddf07a | ||
|
|
0b77cb1d16 | ||
|
|
efa6745a5e | ||
|
|
dd8d8ad952 | ||
|
|
57284b1ac3 | ||
|
|
1a651ce66d | ||
|
|
730441c120 | ||
|
|
bb1f24ab43 | ||
|
|
edb8d187be | ||
|
|
e7b6081c5c | ||
|
|
97fb8c2cdf | ||
|
|
5454500024 | ||
|
|
d9839f3a5c | ||
|
|
498e3904a9 | ||
|
|
7cb01bf842 | ||
|
|
c050e8d0fb | ||
|
|
4f2643e6e9 | ||
|
|
7d0262dd1a | ||
|
|
c30ffd0098 | ||
|
|
ea31122979 | ||
|
|
191afd3e69 | ||
|
|
de27ce79dc | ||
|
|
a12bd78ceb | ||
|
|
ddb986b4fa | ||
|
|
c98c78e368 | ||
|
|
1e20440c8e | ||
|
|
5570a788fd | ||
|
|
42c355e6d7 | ||
|
|
a835ab48bc | ||
|
|
f28a373898 | ||
|
|
0630244195 | ||
|
|
28e29efd98 | ||
|
|
183659f527 | ||
|
|
4ea63af796 | ||
|
|
0aa7911b1b | ||
|
|
032949bc77 | ||
|
|
6f8ee65919 | ||
|
|
c5654b4cb2 | ||
|
|
410b6353fe | ||
|
|
a36e1aab8e | ||
|
|
864ae7a56c | ||
|
|
2560d2b9d0 | ||
|
|
0cf9b05afd | ||
|
|
8b65d1673a | ||
|
|
5e164b107a | ||
|
|
a83959d738 | ||
|
|
0ccc5bf714 | ||
|
|
bc0956019b | ||
|
|
49f631d6c5 | ||
|
|
a9d5eb8470 | ||
|
|
7c0546c9f0 | ||
|
|
f4eb75e4e0 | ||
|
|
5b2c19bc86 | ||
|
|
185b84b8b2 | ||
|
|
facf94699e | ||
|
|
58104229e2 | ||
|
|
50c88b7aa7 | ||
|
|
81bae96109 | ||
|
|
a3ed090594 | ||
|
|
cff1820772 | ||
|
|
bdd2774544 | ||
|
|
38790793dd | ||
|
|
dcd786d21c | ||
|
|
71e88fe9b2 | ||
|
|
11dcaf7383 | ||
|
|
dded81d622 | ||
|
|
8324b3244c | ||
|
|
401c090edd | ||
|
|
8757957e17 | ||
|
|
e2c8a5b638 | ||
|
|
7bb899bfa1 | ||
|
|
3e2359ddff | ||
|
|
04147a7f27 | ||
|
|
cae3c030d2 | ||
|
|
d7c615ec43 | ||
|
|
1294e8ccd5 | ||
|
|
37a2cb07d1 | ||
|
|
2af3994f79 | ||
|
|
0c0fe81814 | ||
|
|
82c8614315 | ||
|
|
a85dc65038 | ||
|
|
290b8bdca0 | ||
|
|
a96ed0b70a | ||
|
|
cdc1a7c646 | ||
|
|
7f59aff157 | ||
|
|
cdce59f7f9 | ||
|
|
ff1c3cb52e | ||
|
|
bec9d91419 | ||
|
|
8399d894c1 | ||
|
|
e1732c4945 | ||
|
|
ca221d6cb2 | ||
|
|
8a90ce882a | ||
|
|
b3400a1308 | ||
|
|
23fb1bed61 | ||
|
|
2b3757dff8 | ||
|
|
1da8e99d27 | ||
|
|
e94e71ded8 | ||
|
|
00f20c1e55 | ||
|
|
45d019a7e4 | ||
|
|
8465017db9 | ||
|
|
782d748210 | ||
|
|
b01d85a974 | ||
|
|
797a4c61f2 | ||
|
|
8e29437900 | ||
|
|
9e64e71cdf | ||
|
|
ef2621aa54 | ||
|
|
882273cb56 | ||
|
|
ad2b74d9b4 | ||
|
|
26669bd1b6 | ||
|
|
54ead9a6b4 | ||
|
|
d60e1f02c0 | ||
|
|
213648564c | ||
|
|
8bdbde9732 | ||
|
|
e988762576 | ||
|
|
75496849eb | ||
|
|
39b119e9cc | ||
|
|
4d43caf6c1 | ||
|
|
ce5e1a6294 | ||
|
|
88be14aaa3 | ||
|
|
1ac56b06c5 | ||
|
|
8bbc509b0b | ||
|
|
6f35d0ac88 | ||
|
|
3b8a5db97c | ||
|
|
b8d83d0765 | ||
|
|
e7a2b395fd | ||
|
|
ad99d7fb45 | ||
|
|
0b032e5c19 | ||
|
|
c7523ace78 | ||
|
|
2a6827e1d2 | ||
|
|
125aff79ec | ||
|
|
a31d8ec309 | ||
|
|
3ed03edfec | ||
|
|
4dc6cbe2d7 | ||
|
|
524cd4b4e3 | ||
|
|
84ebbf0762 | ||
|
|
670ad7192c | ||
|
|
bc6ee20270 | ||
|
|
e869a3aec3 | ||
|
|
8aff6d2fdd | ||
|
|
8d33c6de36 | ||
|
|
f4b5f32cb4 | ||
|
|
2eb9582d0f | ||
|
|
db97440b04 | ||
|
|
ced7ae1d7a | ||
|
|
d6699fa3c0 | ||
|
|
836e5ffa43 | ||
|
|
c7f597bc75 | ||
|
|
e215fafebe | ||
|
|
da9c755f67 | ||
|
|
087ff865a7 | ||
|
|
8cd62c0308 | ||
|
|
f5241ff777 | ||
|
|
1aa2b79311 | ||
|
|
2dca2d5f85 | ||
|
|
f03b42ced5 | ||
|
|
0f8a0af244 | ||
|
|
62646f5f32 | ||
|
|
71f81d2f18 | ||
|
|
4ec8414050 | ||
|
|
807925fd38 | ||
|
|
b597565165 | ||
|
|
9a9b91b180 | ||
|
|
9dcf295df8 | ||
|
|
e8a3de2642 | ||
|
|
d2b4dba51f | ||
|
|
bf527b0331 | ||
|
|
cdc77506de | ||
|
|
6de6a0c82c | ||
|
|
20062576a3 | ||
|
|
07ba9fdf8f | ||
|
|
caa255f5d1 | ||
|
|
c0be2c14f3 | ||
|
|
9f629dcaa2 | ||
|
|
0fe6c65ba3 | ||
|
|
c756bb3b3e | ||
|
|
ecb91b0101 | ||
|
|
5f9a509bdc | ||
|
|
dc6dd9fe0d | ||
|
|
5baa034d0d | ||
|
|
b8ba26787e | ||
|
|
844569e96b | ||
|
|
43580739ac | ||
|
|
c9f7ab6948 | ||
|
|
7900660bb8 | ||
|
|
f096567ac7 | ||
|
|
5bfb5ccc34 | ||
|
|
1c60038111 | ||
|
|
b940db6549 | ||
|
|
aa6e172e14 | ||
|
|
86033b6612 | ||
|
|
59b4a1f554 | ||
|
|
b5bdfb3089 | ||
|
|
a31a5e74bd | ||
|
|
629481a526 | ||
|
|
3291a11824 | ||
|
|
d2ee2d3b23 | ||
|
|
253e3ec6f6 | ||
|
|
fdc4ec8a57 | ||
|
|
1da0dff8b1 | ||
|
|
38dae8489e | ||
|
|
22c0e1079e | ||
|
|
2d3f141140 | ||
|
|
e49252ca3d | ||
|
|
c9d1476ae0 | ||
|
|
ee646d7324 | ||
|
|
e557bca420 | ||
|
|
adcd6517db | ||
|
|
4c8f5275f9 | ||
|
|
526db0102c | ||
|
|
8a3fe9ce4c | ||
|
|
fb97ef33a8 | ||
|
|
805a6d85a5 | ||
|
|
8f9fbb15b8 | ||
|
|
3d24dea455 | ||
|
|
666d5374ea | ||
|
|
6792ff6d58 | ||
|
|
f29ccb9e75 | ||
|
|
911bd54765 | ||
|
|
89b1b12993 | ||
|
|
33d79e03d9 | ||
|
|
991f3d3a10 | ||
|
|
97823ddd16 | ||
|
|
6ff180152a | ||
|
|
dbb7cbed3e | ||
|
|
fbf00f0af4 | ||
|
|
82c6a40371 | ||
|
|
0242ac56df | ||
|
|
b82666002d | ||
|
|
e11883e431 | ||
|
|
ff5b9df607 | ||
|
|
e5b7e3039a | ||
|
|
31ed1eb6f0 | ||
|
|
0c3daab649 | ||
|
|
816371e3e9 | ||
|
|
3c7bb65a23 | ||
|
|
4a65fd76b3 | ||
|
|
2704db5eef | ||
|
|
f10bc73d31 | ||
|
|
55e099450c | ||
|
|
248dbd32a5 | ||
|
|
a7b676231a | ||
|
|
2fd5f9ac58 | ||
|
|
ca4838a5f4 | ||
|
|
1b72550236 | ||
|
|
71afd49e3e | ||
|
|
e5d718d1b1 | ||
|
|
61f33d6401 | ||
|
|
af9b568778 | ||
|
|
4a1eec567f | ||
|
|
5706b8476f | ||
|
|
8981a86793 | ||
|
|
a7fd6dc382 | ||
|
|
cb0a87c1f9 | ||
|
|
b913a0b178 | ||
|
|
214454ff51 | ||
|
|
3677ef71d1 | ||
|
|
7e133171e0 | ||
|
|
bc56d319b5 | ||
|
|
c423a6fb61 | ||
|
|
4034bf4f04 | ||
|
|
477abc05ae | ||
|
|
ff2b93a3e4 | ||
|
|
a52d6388a9 | ||
|
|
6259ca9ded | ||
|
|
f6ef50505b | ||
|
|
b4cf437761 | ||
|
|
1d9f5f1f1e | ||
|
|
e47489708e | ||
|
|
8e1bdcd211 | ||
|
|
3432d73584 | ||
|
|
2bb86641f8 | ||
|
|
6ca72a3a26 | ||
|
|
c215098cb7 | ||
|
|
566968b6be | ||
|
|
fe51ee6257 | ||
|
|
2c499b326a | ||
|
|
7c4ab7abfe | ||
|
|
3c242b7296 | ||
|
|
00dd5b8339 | ||
|
|
a007a8237a | ||
|
|
9b86cc37f0 | ||
|
|
2dfcf950fa | ||
|
|
5908b93e82 | ||
|
|
995db1f961 | ||
|
|
abcc656a6f | ||
|
|
4a9f323d92 | ||
|
|
34a4e70cc5 | ||
|
|
fb5d697c22 | ||
|
|
df4642208e | ||
|
|
264e234efc | ||
|
|
ca78dd44b5 | ||
|
|
7edf458898 | ||
|
|
d9873e24a7 | ||
|
|
645bd490ba | ||
|
|
27f6d00e7a | ||
|
|
f9d668eeca | ||
|
|
92d1557efd | ||
|
|
6b930595e2 | ||
|
|
4a1cbfc533 | ||
|
|
1f7a84cc8e | ||
|
|
8c5adfb33f | ||
|
|
399c9ba4be | ||
|
|
a866370a2e | ||
|
|
6240bfff97 | ||
|
|
1c72fd4674 | ||
|
|
2291a1dc39 | ||
|
|
8269e2c961 | ||
|
|
23dec912ad | ||
|
|
9637ef35bd | ||
|
|
23e5cdb30e | ||
|
|
f3b1b11eba | ||
|
|
5ceba618f6 | ||
|
|
99d5ca3266 | ||
|
|
219ba6152c | ||
|
|
ef0f969604 | ||
|
|
82adcd656f | ||
|
|
fe35eee8df | ||
|
|
864dd69038 | ||
|
|
79f198ebff | ||
|
|
4b0622aa23 | ||
|
|
4ecc72ed54 | ||
|
|
791740e554 | ||
|
|
6bccc7e389 | ||
|
|
655075e71b | ||
|
|
1df1e3cf48 | ||
|
|
05e52cae2b | ||
|
|
be60d9be9b | ||
|
|
e3eb3ee5d2 | ||
|
|
0812b3dd70 | ||
|
|
28a9f12595 | ||
|
|
36b75c3faa | ||
|
|
584c5bd5be | ||
|
|
bc372dbeb2 | ||
|
|
37a03de849 | ||
|
|
c8395cdf0a | ||
|
|
79c8a55459 | ||
|
|
36d6fe29f2 | ||
|
|
e1868ddecb | ||
|
|
6151644b96 | ||
|
|
a4914eb5b7 | ||
|
|
57a57f0d6a | ||
|
|
7e9f93a290 | ||
|
|
402ada07b5 | ||
|
|
9aa9abfc08 | ||
|
|
4c1f83614b | ||
|
|
d1763f9831 | ||
|
|
c49391427f | ||
|
|
c42343be3a | ||
|
|
ffc233d99d | ||
|
|
5ed0046bdd | ||
|
|
2e16dd788c | ||
|
|
58fe8b39b2 | ||
|
|
ccd55a8e84 | ||
|
|
4bb59ce1d1 | ||
|
|
bb988604c8 | ||
|
|
573088aadb | ||
|
|
031b1c8bd0 | ||
|
|
f95b2ba898 | ||
|
|
ea4b573f9a | ||
|
|
8fcbd57f2f | ||
|
|
f131186e6b | ||
|
|
20c7778524 | ||
|
|
2d8e86324b | ||
|
|
2dfd28ba3e | ||
|
|
63221d7a1f | ||
|
|
fb9a15f0af | ||
|
|
ce2e966005 | ||
|
|
e7d1072c85 | ||
|
|
bc999b50b3 | ||
|
|
6cfe3ac44d | ||
|
|
6787730aa4 | ||
|
|
48a7927a60 | ||
|
|
8ea4d8402f | ||
|
|
2c53408cfc | ||
|
|
33dce6e522 | ||
|
|
e213932b7c | ||
|
|
42fb0e2809 | ||
|
|
acce0bc45b | ||
|
|
f5885de6f1 | ||
|
|
17e3bb7324 | ||
|
|
d891521ce2 | ||
|
|
3320e4112b | ||
|
|
c0e4701e1d | ||
|
|
f3390ff7f5 | ||
|
|
dfbfb2a2bb | ||
|
|
874026ca8f | ||
|
|
4adda632bb | ||
|
|
6ea89644e7 | ||
|
|
64ff62c005 | ||
|
|
c4de9e87e4 | ||
|
|
918924d697 | ||
|
|
43805e6c56 | ||
|
|
38bbfaccc6 | ||
|
|
56b32aae11 | ||
|
|
e2c16b4baa | ||
|
|
10a9162f48 | ||
|
|
fbc884772c | ||
|
|
cbf68f1fd2 | ||
|
|
cf227d6f32 | ||
|
|
f993bb08c7 | ||
|
|
afa481aeea | ||
|
|
dfb162e7a6 | ||
|
|
098921b88f | ||
|
|
c63a545750 | ||
|
|
89f82be4cd | ||
|
|
c336dd9436 | ||
|
|
fa25cebed5 | ||
|
|
7679c716b3 | ||
|
|
225e2585e8 | ||
|
|
c90185854e | ||
|
|
7d8c39d295 | ||
|
|
59d282489a | ||
|
|
f9a0a63290 | ||
|
|
00000e0ea8 | ||
|
|
bd853e6883 | ||
|
|
64d1d93fe0 | ||
|
|
266c2ef337 | ||
|
|
35199c9b96 | ||
|
|
0a29138045 | ||
|
|
04dc0ed129 |
@@ -1,2 +1,4 @@
|
|||||||
[run]
|
[run]
|
||||||
omit = esphome/components/*
|
omit =
|
||||||
|
esphome/components/*
|
||||||
|
tests/integration/*
|
||||||
|
|||||||
37
.devcontainer/Dockerfile
Normal file
37
.devcontainer/Dockerfile
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
ARG BUILD_BASE_VERSION=2025.04.0
|
||||||
|
|
||||||
|
|
||||||
|
FROM ghcr.io/esphome/docker-base:debian-${BUILD_BASE_VERSION} AS base
|
||||||
|
|
||||||
|
RUN git config --system --add safe.directory "*"
|
||||||
|
|
||||||
|
RUN apt update \
|
||||||
|
&& apt install -y \
|
||||||
|
protobuf-compiler
|
||||||
|
|
||||||
|
RUN pip install uv
|
||||||
|
|
||||||
|
RUN useradd esphome -m
|
||||||
|
|
||||||
|
USER esphome
|
||||||
|
ENV VIRTUAL_ENV=/home/esphome/.local/esphome-venv
|
||||||
|
RUN uv venv $VIRTUAL_ENV
|
||||||
|
ENV PATH="$VIRTUAL_ENV/bin:$PATH"
|
||||||
|
# Override this set to true in the docker-base image
|
||||||
|
ENV UV_SYSTEM_PYTHON=false
|
||||||
|
|
||||||
|
WORKDIR /tmp
|
||||||
|
|
||||||
|
COPY requirements.txt ./
|
||||||
|
RUN uv pip install -r requirements.txt
|
||||||
|
COPY requirements_dev.txt requirements_test.txt ./
|
||||||
|
RUN uv pip install -r requirements_dev.txt -r requirements_test.txt
|
||||||
|
|
||||||
|
RUN \
|
||||||
|
platformio settings set enable_telemetry No \
|
||||||
|
&& platformio settings set check_platformio_interval 1000000
|
||||||
|
|
||||||
|
COPY script/platformio_install_deps.py platformio.ini ./
|
||||||
|
RUN ./platformio_install_deps.py platformio.ini --libraries --platforms --tools
|
||||||
|
|
||||||
|
WORKDIR /workspaces
|
||||||
@@ -1,18 +1,17 @@
|
|||||||
{
|
{
|
||||||
"name": "ESPHome Dev",
|
"name": "ESPHome Dev",
|
||||||
"image": "ghcr.io/esphome/esphome-lint:dev",
|
"context": "..",
|
||||||
|
"dockerFile": "Dockerfile",
|
||||||
"postCreateCommand": [
|
"postCreateCommand": [
|
||||||
"script/devcontainer-post-create"
|
"script/devcontainer-post-create"
|
||||||
],
|
],
|
||||||
"containerEnv": {
|
"features": {
|
||||||
"DEVCONTAINER": "1",
|
"ghcr.io/devcontainers/features/github-cli:1": {}
|
||||||
"PIP_BREAK_SYSTEM_PACKAGES": "1",
|
|
||||||
"PIP_ROOT_USER_ACTION": "ignore"
|
|
||||||
},
|
},
|
||||||
"runArgs": [
|
"runArgs": [
|
||||||
"--privileged",
|
"--privileged",
|
||||||
"-e",
|
"-e",
|
||||||
"ESPHOME_DASHBOARD_USE_PING=1"
|
"GIT_EDITOR=code --wait"
|
||||||
// uncomment and edit the path in order to pass though local USB serial to the conatiner
|
// uncomment and edit the path in order to pass though local USB serial to the conatiner
|
||||||
// , "--device=/dev/ttyACM0"
|
// , "--device=/dev/ttyACM0"
|
||||||
],
|
],
|
||||||
|
|||||||
@@ -114,4 +114,5 @@ config/
|
|||||||
examples/
|
examples/
|
||||||
Dockerfile
|
Dockerfile
|
||||||
.git/
|
.git/
|
||||||
tests/build/
|
tests/
|
||||||
|
.*
|
||||||
|
|||||||
4
.github/FUNDING.yml
vendored
4
.github/FUNDING.yml
vendored
@@ -1,4 +0,0 @@
|
|||||||
---
|
|
||||||
# These are supported funding model platforms
|
|
||||||
|
|
||||||
custom: https://www.nabucasa.com
|
|
||||||
33
.github/actions/build-image/action.yaml
vendored
33
.github/actions/build-image/action.yaml
vendored
@@ -1,15 +1,11 @@
|
|||||||
name: Build Image
|
name: Build Image
|
||||||
inputs:
|
inputs:
|
||||||
platform:
|
|
||||||
description: "Platform to build for"
|
|
||||||
required: true
|
|
||||||
example: "linux/amd64"
|
|
||||||
target:
|
target:
|
||||||
description: "Target to build"
|
description: "Target to build"
|
||||||
required: true
|
required: true
|
||||||
example: "docker"
|
example: "docker"
|
||||||
baseimg:
|
build_type:
|
||||||
description: "Base image type"
|
description: "Build type"
|
||||||
required: true
|
required: true
|
||||||
example: "docker"
|
example: "docker"
|
||||||
suffix:
|
suffix:
|
||||||
@@ -19,6 +15,11 @@ inputs:
|
|||||||
description: "Version to build"
|
description: "Version to build"
|
||||||
required: true
|
required: true
|
||||||
example: "2023.12.0"
|
example: "2023.12.0"
|
||||||
|
base_os:
|
||||||
|
description: "Base OS to use"
|
||||||
|
required: false
|
||||||
|
default: "debian"
|
||||||
|
example: "debian"
|
||||||
runs:
|
runs:
|
||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
@@ -46,52 +47,52 @@ runs:
|
|||||||
|
|
||||||
- name: Build and push to ghcr by digest
|
- name: Build and push to ghcr by digest
|
||||||
id: build-ghcr
|
id: build-ghcr
|
||||||
uses: docker/build-push-action@v6.15.0
|
uses: docker/build-push-action@v6.18.0
|
||||||
env:
|
env:
|
||||||
DOCKER_BUILD_SUMMARY: false
|
DOCKER_BUILD_SUMMARY: false
|
||||||
DOCKER_BUILD_RECORD_UPLOAD: false
|
DOCKER_BUILD_RECORD_UPLOAD: false
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./docker/Dockerfile
|
file: ./docker/Dockerfile
|
||||||
platforms: ${{ inputs.platform }}
|
|
||||||
target: ${{ inputs.target }}
|
target: ${{ inputs.target }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: ${{ steps.cache-to.outputs.value }}
|
cache-to: ${{ steps.cache-to.outputs.value }}
|
||||||
build-args: |
|
build-args: |
|
||||||
BASEIMGTYPE=${{ inputs.baseimg }}
|
BUILD_TYPE=${{ inputs.build_type }}
|
||||||
BUILD_VERSION=${{ inputs.version }}
|
BUILD_VERSION=${{ inputs.version }}
|
||||||
|
BUILD_OS=${{ inputs.base_os }}
|
||||||
outputs: |
|
outputs: |
|
||||||
type=image,name=ghcr.io/${{ steps.tags.outputs.image_name }},push-by-digest=true,name-canonical=true,push=true
|
type=image,name=ghcr.io/${{ steps.tags.outputs.image_name }},push-by-digest=true,name-canonical=true,push=true
|
||||||
|
|
||||||
- name: Export ghcr digests
|
- name: Export ghcr digests
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir -p /tmp/digests/${{ inputs.target }}/ghcr
|
mkdir -p /tmp/digests/${{ inputs.build_type }}/ghcr
|
||||||
digest="${{ steps.build-ghcr.outputs.digest }}"
|
digest="${{ steps.build-ghcr.outputs.digest }}"
|
||||||
touch "/tmp/digests/${{ inputs.target }}/ghcr/${digest#sha256:}"
|
touch "/tmp/digests/${{ inputs.build_type }}/ghcr/${digest#sha256:}"
|
||||||
|
|
||||||
- name: Build and push to dockerhub by digest
|
- name: Build and push to dockerhub by digest
|
||||||
id: build-dockerhub
|
id: build-dockerhub
|
||||||
uses: docker/build-push-action@v6.15.0
|
uses: docker/build-push-action@v6.18.0
|
||||||
env:
|
env:
|
||||||
DOCKER_BUILD_SUMMARY: false
|
DOCKER_BUILD_SUMMARY: false
|
||||||
DOCKER_BUILD_RECORD_UPLOAD: false
|
DOCKER_BUILD_RECORD_UPLOAD: false
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
file: ./docker/Dockerfile
|
file: ./docker/Dockerfile
|
||||||
platforms: ${{ inputs.platform }}
|
|
||||||
target: ${{ inputs.target }}
|
target: ${{ inputs.target }}
|
||||||
cache-from: type=gha
|
cache-from: type=gha
|
||||||
cache-to: ${{ steps.cache-to.outputs.value }}
|
cache-to: ${{ steps.cache-to.outputs.value }}
|
||||||
build-args: |
|
build-args: |
|
||||||
BASEIMGTYPE=${{ inputs.baseimg }}
|
BUILD_TYPE=${{ inputs.build_type }}
|
||||||
BUILD_VERSION=${{ inputs.version }}
|
BUILD_VERSION=${{ inputs.version }}
|
||||||
|
BUILD_OS=${{ inputs.base_os }}
|
||||||
outputs: |
|
outputs: |
|
||||||
type=image,name=docker.io/${{ steps.tags.outputs.image_name }},push-by-digest=true,name-canonical=true,push=true
|
type=image,name=docker.io/${{ steps.tags.outputs.image_name }},push-by-digest=true,name-canonical=true,push=true
|
||||||
|
|
||||||
- name: Export dockerhub digests
|
- name: Export dockerhub digests
|
||||||
shell: bash
|
shell: bash
|
||||||
run: |
|
run: |
|
||||||
mkdir -p /tmp/digests/${{ inputs.target }}/dockerhub
|
mkdir -p /tmp/digests/${{ inputs.build_type }}/dockerhub
|
||||||
digest="${{ steps.build-dockerhub.outputs.digest }}"
|
digest="${{ steps.build-dockerhub.outputs.digest }}"
|
||||||
touch "/tmp/digests/${{ inputs.target }}/dockerhub/${digest#sha256:}"
|
touch "/tmp/digests/${{ inputs.build_type }}/dockerhub/${digest#sha256:}"
|
||||||
|
|||||||
8
.github/actions/restore-python/action.yml
vendored
8
.github/actions/restore-python/action.yml
vendored
@@ -17,12 +17,12 @@ runs:
|
|||||||
steps:
|
steps:
|
||||||
- name: Set up Python ${{ inputs.python-version }}
|
- name: Set up Python ${{ inputs.python-version }}
|
||||||
id: python
|
id: python
|
||||||
uses: actions/setup-python@v5.4.0
|
uses: actions/setup-python@v5.6.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ inputs.python-version }}
|
python-version: ${{ inputs.python-version }}
|
||||||
- name: Restore Python virtual environment
|
- name: Restore Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache/restore@v4.2.2
|
uses: actions/cache/restore@v4.2.3
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
# yamllint disable-line rule:line-length
|
# yamllint disable-line rule:line-length
|
||||||
@@ -34,7 +34,7 @@ runs:
|
|||||||
python -m venv venv
|
python -m venv venv
|
||||||
source venv/bin/activate
|
source venv/bin/activate
|
||||||
python --version
|
python --version
|
||||||
pip install -r requirements.txt -r requirements_optional.txt -r requirements_test.txt
|
pip install -r requirements.txt -r requirements_test.txt
|
||||||
pip install -e .
|
pip install -e .
|
||||||
- name: Create Python virtual environment
|
- name: Create Python virtual environment
|
||||||
if: steps.cache-venv.outputs.cache-hit != 'true' && runner.os == 'Windows'
|
if: steps.cache-venv.outputs.cache-hit != 'true' && runner.os == 'Windows'
|
||||||
@@ -43,5 +43,5 @@ runs:
|
|||||||
python -m venv venv
|
python -m venv venv
|
||||||
./venv/Scripts/activate
|
./venv/Scripts/activate
|
||||||
python --version
|
python --version
|
||||||
pip install -r requirements.txt -r requirements_optional.txt -r requirements_test.txt
|
pip install -r requirements.txt -r requirements_test.txt
|
||||||
pip install -e .
|
pip install -e .
|
||||||
|
|||||||
1
.github/dependabot.yml
vendored
1
.github/dependabot.yml
vendored
@@ -17,7 +17,6 @@ updates:
|
|||||||
docker-actions:
|
docker-actions:
|
||||||
applies-to: version-updates
|
applies-to: version-updates
|
||||||
patterns:
|
patterns:
|
||||||
- "docker/setup-qemu-action"
|
|
||||||
- "docker/login-action"
|
- "docker/login-action"
|
||||||
- "docker/setup-buildx-action"
|
- "docker/setup-buildx-action"
|
||||||
- package-ecosystem: github-actions
|
- package-ecosystem: github-actions
|
||||||
|
|||||||
15
.github/workflows/ci-api-proto.yml
vendored
15
.github/workflows/ci-api-proto.yml
vendored
@@ -21,9 +21,9 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5.4.0
|
uses: actions/setup-python@v5.6.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.11"
|
python-version: "3.11"
|
||||||
|
|
||||||
@@ -57,6 +57,17 @@ jobs:
|
|||||||
event: 'REQUEST_CHANGES',
|
event: 'REQUEST_CHANGES',
|
||||||
body: 'You have altered the generated proto files but they do not match what is expected.\nPlease run "script/api_protobuf/api_protobuf.py" and commit the changes.'
|
body: 'You have altered the generated proto files but they do not match what is expected.\nPlease run "script/api_protobuf/api_protobuf.py" and commit the changes.'
|
||||||
})
|
})
|
||||||
|
- if: failure()
|
||||||
|
name: Show changes
|
||||||
|
run: git diff
|
||||||
|
- if: failure()
|
||||||
|
name: Archive artifacts
|
||||||
|
uses: actions/upload-artifact@v4.6.2
|
||||||
|
with:
|
||||||
|
name: generated-proto-files
|
||||||
|
path: |
|
||||||
|
esphome/components/api/api_pb2.*
|
||||||
|
esphome/components/api/api_pb2_service.*
|
||||||
- if: success()
|
- if: success()
|
||||||
name: Dismiss review
|
name: Dismiss review
|
||||||
uses: actions/github-script@v7.0.1
|
uses: actions/github-script@v7.0.1
|
||||||
|
|||||||
15
.github/workflows/ci-docker.yml
vendored
15
.github/workflows/ci-docker.yml
vendored
@@ -37,16 +37,19 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
os: ["ubuntu-latest", "ubuntu-24.04-arm"]
|
os: ["ubuntu-24.04", "ubuntu-24.04-arm"]
|
||||||
build_type: ["ha-addon", "docker", "lint"]
|
build_type:
|
||||||
|
- "ha-addon"
|
||||||
|
- "docker"
|
||||||
|
# - "lint"
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.7
|
- uses: actions/checkout@v4.2.2
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5.4.0
|
uses: actions/setup-python@v5.6.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.9"
|
python-version: "3.10"
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3.10.0
|
uses: docker/setup-buildx-action@v3.11.1
|
||||||
|
|
||||||
- name: Set TAG
|
- name: Set TAG
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
68
.github/workflows/ci.yml
vendored
68
.github/workflows/ci.yml
vendored
@@ -20,8 +20,8 @@ permissions:
|
|||||||
contents: read
|
contents: read
|
||||||
|
|
||||||
env:
|
env:
|
||||||
DEFAULT_PYTHON: "3.9"
|
DEFAULT_PYTHON: "3.10"
|
||||||
PYUPGRADE_TARGET: "--py39-plus"
|
PYUPGRADE_TARGET: "--py310-plus"
|
||||||
|
|
||||||
concurrency:
|
concurrency:
|
||||||
# yamllint disable-line rule:line-length
|
# yamllint disable-line rule:line-length
|
||||||
@@ -36,18 +36,18 @@ jobs:
|
|||||||
cache-key: ${{ steps.cache-key.outputs.key }}
|
cache-key: ${{ steps.cache-key.outputs.key }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Generate cache-key
|
- name: Generate cache-key
|
||||||
id: cache-key
|
id: cache-key
|
||||||
run: echo key="${{ hashFiles('requirements.txt', 'requirements_optional.txt', 'requirements_test.txt') }}" >> $GITHUB_OUTPUT
|
run: echo key="${{ hashFiles('requirements.txt', 'requirements_test.txt') }}" >> $GITHUB_OUTPUT
|
||||||
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
|
||||||
id: python
|
id: python
|
||||||
uses: actions/setup-python@v5.4.0
|
uses: actions/setup-python@v5.6.0
|
||||||
with:
|
with:
|
||||||
python-version: ${{ env.DEFAULT_PYTHON }}
|
python-version: ${{ env.DEFAULT_PYTHON }}
|
||||||
- name: Restore Python virtual environment
|
- name: Restore Python virtual environment
|
||||||
id: cache-venv
|
id: cache-venv
|
||||||
uses: actions/cache@v4.2.2
|
uses: actions/cache@v4.2.3
|
||||||
with:
|
with:
|
||||||
path: venv
|
path: venv
|
||||||
# yamllint disable-line rule:line-length
|
# yamllint disable-line rule:line-length
|
||||||
@@ -58,7 +58,7 @@ jobs:
|
|||||||
python -m venv venv
|
python -m venv venv
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
python --version
|
python --version
|
||||||
pip install -r requirements.txt -r requirements_optional.txt -r requirements_test.txt
|
pip install -r requirements.txt -r requirements_test.txt
|
||||||
pip install -e .
|
pip install -e .
|
||||||
|
|
||||||
ruff:
|
ruff:
|
||||||
@@ -68,7 +68,7 @@ jobs:
|
|||||||
- common
|
- common
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Restore Python
|
- name: Restore Python
|
||||||
uses: ./.github/actions/restore-python
|
uses: ./.github/actions/restore-python
|
||||||
with:
|
with:
|
||||||
@@ -89,7 +89,7 @@ jobs:
|
|||||||
- common
|
- common
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Restore Python
|
- name: Restore Python
|
||||||
uses: ./.github/actions/restore-python
|
uses: ./.github/actions/restore-python
|
||||||
with:
|
with:
|
||||||
@@ -110,7 +110,7 @@ jobs:
|
|||||||
- common
|
- common
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Restore Python
|
- name: Restore Python
|
||||||
uses: ./.github/actions/restore-python
|
uses: ./.github/actions/restore-python
|
||||||
with:
|
with:
|
||||||
@@ -131,7 +131,7 @@ jobs:
|
|||||||
- common
|
- common
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Restore Python
|
- name: Restore Python
|
||||||
uses: ./.github/actions/restore-python
|
uses: ./.github/actions/restore-python
|
||||||
with:
|
with:
|
||||||
@@ -152,7 +152,7 @@ jobs:
|
|||||||
- common
|
- common
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Restore Python
|
- name: Restore Python
|
||||||
uses: ./.github/actions/restore-python
|
uses: ./.github/actions/restore-python
|
||||||
with:
|
with:
|
||||||
@@ -165,6 +165,7 @@ jobs:
|
|||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
script/ci-custom.py
|
script/ci-custom.py
|
||||||
script/build_codeowners.py --check
|
script/build_codeowners.py --check
|
||||||
|
script/build_language_schema.py --check
|
||||||
|
|
||||||
pytest:
|
pytest:
|
||||||
name: Run pytest
|
name: Run pytest
|
||||||
@@ -172,10 +173,10 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
python-version:
|
python-version:
|
||||||
- "3.9"
|
|
||||||
- "3.10"
|
- "3.10"
|
||||||
- "3.11"
|
- "3.11"
|
||||||
- "3.12"
|
- "3.12"
|
||||||
|
- "3.13"
|
||||||
os:
|
os:
|
||||||
- ubuntu-latest
|
- ubuntu-latest
|
||||||
- macOS-latest
|
- macOS-latest
|
||||||
@@ -184,24 +185,24 @@ jobs:
|
|||||||
# Minimize CI resource usage
|
# Minimize CI resource usage
|
||||||
# by only running the Python version
|
# by only running the Python version
|
||||||
# version used for docker images on Windows and macOS
|
# version used for docker images on Windows and macOS
|
||||||
|
- python-version: "3.13"
|
||||||
|
os: windows-latest
|
||||||
- python-version: "3.12"
|
- python-version: "3.12"
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
- python-version: "3.10"
|
- python-version: "3.10"
|
||||||
os: windows-latest
|
os: windows-latest
|
||||||
- python-version: "3.9"
|
- python-version: "3.13"
|
||||||
os: windows-latest
|
os: macOS-latest
|
||||||
- python-version: "3.12"
|
- python-version: "3.12"
|
||||||
os: macOS-latest
|
os: macOS-latest
|
||||||
- python-version: "3.10"
|
- python-version: "3.10"
|
||||||
os: macOS-latest
|
os: macOS-latest
|
||||||
- python-version: "3.9"
|
|
||||||
os: macOS-latest
|
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
needs:
|
needs:
|
||||||
- common
|
- common
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Restore Python
|
- name: Restore Python
|
||||||
uses: ./.github/actions/restore-python
|
uses: ./.github/actions/restore-python
|
||||||
with:
|
with:
|
||||||
@@ -213,14 +214,14 @@ jobs:
|
|||||||
if: matrix.os == 'windows-latest'
|
if: matrix.os == 'windows-latest'
|
||||||
run: |
|
run: |
|
||||||
./venv/Scripts/activate
|
./venv/Scripts/activate
|
||||||
pytest -vv --cov-report=xml --tb=native tests
|
pytest -vv --cov-report=xml --tb=native -n auto tests
|
||||||
- name: Run pytest
|
- name: Run pytest
|
||||||
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest'
|
if: matrix.os == 'ubuntu-latest' || matrix.os == 'macOS-latest'
|
||||||
run: |
|
run: |
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
pytest -vv --cov-report=xml --tb=native tests
|
pytest -vv --cov-report=xml --tb=native -n auto tests
|
||||||
- name: Upload coverage to Codecov
|
- name: Upload coverage to Codecov
|
||||||
uses: codecov/codecov-action@v5
|
uses: codecov/codecov-action@v5.4.3
|
||||||
with:
|
with:
|
||||||
token: ${{ secrets.CODECOV_TOKEN }}
|
token: ${{ secrets.CODECOV_TOKEN }}
|
||||||
|
|
||||||
@@ -231,7 +232,7 @@ jobs:
|
|||||||
- common
|
- common
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Restore Python
|
- name: Restore Python
|
||||||
uses: ./.github/actions/restore-python
|
uses: ./.github/actions/restore-python
|
||||||
with:
|
with:
|
||||||
@@ -291,10 +292,15 @@ jobs:
|
|||||||
name: Run script/clang-tidy for ESP32 IDF
|
name: Run script/clang-tidy for ESP32 IDF
|
||||||
options: --environment esp32-idf-tidy --grep USE_ESP_IDF
|
options: --environment esp32-idf-tidy --grep USE_ESP_IDF
|
||||||
pio_cache_key: tidyesp32-idf
|
pio_cache_key: tidyesp32-idf
|
||||||
|
- id: clang-tidy
|
||||||
|
name: Run script/clang-tidy for ZEPHYR
|
||||||
|
options: --environment nrf52-tidy --grep USE_ZEPHYR
|
||||||
|
pio_cache_key: tidy-zephyr
|
||||||
|
ignore_errors: false
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Restore Python
|
- name: Restore Python
|
||||||
uses: ./.github/actions/restore-python
|
uses: ./.github/actions/restore-python
|
||||||
with:
|
with:
|
||||||
@@ -303,14 +309,14 @@ jobs:
|
|||||||
|
|
||||||
- name: Cache platformio
|
- name: Cache platformio
|
||||||
if: github.ref == 'refs/heads/dev'
|
if: github.ref == 'refs/heads/dev'
|
||||||
uses: actions/cache@v4.2.2
|
uses: actions/cache@v4.2.3
|
||||||
with:
|
with:
|
||||||
path: ~/.platformio
|
path: ~/.platformio
|
||||||
key: platformio-${{ matrix.pio_cache_key }}
|
key: platformio-${{ matrix.pio_cache_key }}
|
||||||
|
|
||||||
- name: Cache platformio
|
- name: Cache platformio
|
||||||
if: github.ref != 'refs/heads/dev'
|
if: github.ref != 'refs/heads/dev'
|
||||||
uses: actions/cache/restore@v4.2.2
|
uses: actions/cache/restore@v4.2.3
|
||||||
with:
|
with:
|
||||||
path: ~/.platformio
|
path: ~/.platformio
|
||||||
key: platformio-${{ matrix.pio_cache_key }}
|
key: platformio-${{ matrix.pio_cache_key }}
|
||||||
@@ -330,13 +336,13 @@ jobs:
|
|||||||
- name: Run clang-tidy
|
- name: Run clang-tidy
|
||||||
run: |
|
run: |
|
||||||
. venv/bin/activate
|
. venv/bin/activate
|
||||||
script/clang-tidy --all-headers --fix ${{ matrix.options }}
|
script/clang-tidy --all-headers --fix ${{ matrix.options }} ${{ matrix.ignore_errors && '|| true' || '' }}
|
||||||
env:
|
env:
|
||||||
# Also cache libdeps, store them in a ~/.platformio subfolder
|
# Also cache libdeps, store them in a ~/.platformio subfolder
|
||||||
PLATFORMIO_LIBDEPS_DIR: ~/.platformio/libdeps
|
PLATFORMIO_LIBDEPS_DIR: ~/.platformio/libdeps
|
||||||
|
|
||||||
- name: Suggested changes
|
- name: Suggested changes
|
||||||
run: script/ci-suggest-changes
|
run: script/ci-suggest-changes ${{ matrix.ignore_errors && '|| true' || '' }}
|
||||||
# yamllint disable-line rule:line-length
|
# yamllint disable-line rule:line-length
|
||||||
if: always()
|
if: always()
|
||||||
|
|
||||||
@@ -350,7 +356,7 @@ jobs:
|
|||||||
count: ${{ steps.list-components.outputs.count }}
|
count: ${{ steps.list-components.outputs.count }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
with:
|
with:
|
||||||
# Fetch enough history so `git merge-base refs/remotes/origin/dev HEAD` works.
|
# Fetch enough history so `git merge-base refs/remotes/origin/dev HEAD` works.
|
||||||
fetch-depth: 500
|
fetch-depth: 500
|
||||||
@@ -400,7 +406,7 @@ jobs:
|
|||||||
sudo apt-get install libsdl2-dev
|
sudo apt-get install libsdl2-dev
|
||||||
|
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Restore Python
|
- name: Restore Python
|
||||||
uses: ./.github/actions/restore-python
|
uses: ./.github/actions/restore-python
|
||||||
with:
|
with:
|
||||||
@@ -426,7 +432,7 @@ jobs:
|
|||||||
matrix: ${{ steps.split.outputs.components }}
|
matrix: ${{ steps.split.outputs.components }}
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Split components into 20 groups
|
- name: Split components into 20 groups
|
||||||
id: split
|
id: split
|
||||||
run: |
|
run: |
|
||||||
@@ -456,7 +462,7 @@ jobs:
|
|||||||
sudo apt-get install libsdl2-dev
|
sudo apt-get install libsdl2-dev
|
||||||
|
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Restore Python
|
- name: Restore Python
|
||||||
uses: ./.github/actions/restore-python
|
uses: ./.github/actions/restore-python
|
||||||
with:
|
with:
|
||||||
|
|||||||
23
.github/workflows/lock.yml
vendored
23
.github/workflows/lock.yml
vendored
@@ -1,28 +1,11 @@
|
|||||||
---
|
---
|
||||||
name: Lock
|
name: Lock closed issues and PRs
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
schedule:
|
||||||
- cron: "30 0 * * *"
|
- cron: "30 0 * * *" # Run daily at 00:30 UTC
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
permissions:
|
|
||||||
issues: write
|
|
||||||
pull-requests: write
|
|
||||||
|
|
||||||
concurrency:
|
|
||||||
group: lock
|
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
lock:
|
lock:
|
||||||
runs-on: ubuntu-latest
|
uses: esphome/workflows/.github/workflows/lock.yml@main
|
||||||
steps:
|
|
||||||
- uses: dessant/lock-threads@v5.0.1
|
|
||||||
with:
|
|
||||||
pr-inactive-days: "1"
|
|
||||||
pr-lock-reason: ""
|
|
||||||
exclude-any-pr-labels: keep-open
|
|
||||||
|
|
||||||
issue-inactive-days: "7"
|
|
||||||
issue-lock-reason: ""
|
|
||||||
exclude-any-issue-labels: keep-open
|
|
||||||
|
|||||||
130
.github/workflows/release.yml
vendored
130
.github/workflows/release.yml
vendored
@@ -18,8 +18,9 @@ jobs:
|
|||||||
outputs:
|
outputs:
|
||||||
tag: ${{ steps.tag.outputs.tag }}
|
tag: ${{ steps.tag.outputs.tag }}
|
||||||
branch_build: ${{ steps.tag.outputs.branch_build }}
|
branch_build: ${{ steps.tag.outputs.branch_build }}
|
||||||
|
deploy_env: ${{ steps.tag.outputs.deploy_env }}
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.7
|
- uses: actions/checkout@v4.2.2
|
||||||
- name: Get tag
|
- name: Get tag
|
||||||
id: tag
|
id: tag
|
||||||
# yamllint disable rule:line-length
|
# yamllint disable rule:line-length
|
||||||
@@ -27,6 +28,11 @@ jobs:
|
|||||||
if [[ "${{ github.event_name }}" = "release" ]]; then
|
if [[ "${{ github.event_name }}" = "release" ]]; then
|
||||||
TAG="${{ github.event.release.tag_name}}"
|
TAG="${{ github.event.release.tag_name}}"
|
||||||
BRANCH_BUILD="false"
|
BRANCH_BUILD="false"
|
||||||
|
if [[ "${{ github.event.release.prerelease }}" = "true" ]]; then
|
||||||
|
ENVIRONMENT="beta"
|
||||||
|
else
|
||||||
|
ENVIRONMENT="production"
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
TAG=$(cat esphome/const.py | sed -n -E "s/^__version__\s+=\s+\"(.+)\"$/\1/p")
|
TAG=$(cat esphome/const.py | sed -n -E "s/^__version__\s+=\s+\"(.+)\"$/\1/p")
|
||||||
today="$(date --utc '+%Y%m%d')"
|
today="$(date --utc '+%Y%m%d')"
|
||||||
@@ -35,12 +41,15 @@ jobs:
|
|||||||
if [[ "$BRANCH" != "dev" ]]; then
|
if [[ "$BRANCH" != "dev" ]]; then
|
||||||
TAG="${TAG}-${BRANCH}"
|
TAG="${TAG}-${BRANCH}"
|
||||||
BRANCH_BUILD="true"
|
BRANCH_BUILD="true"
|
||||||
|
ENVIRONMENT=""
|
||||||
else
|
else
|
||||||
BRANCH_BUILD="false"
|
BRANCH_BUILD="false"
|
||||||
|
ENVIRONMENT="dev"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
echo "tag=${TAG}" >> $GITHUB_OUTPUT
|
||||||
echo "branch_build=${BRANCH_BUILD}" >> $GITHUB_OUTPUT
|
echo "branch_build=${BRANCH_BUILD}" >> $GITHUB_OUTPUT
|
||||||
|
echo "deploy_env=${ENVIRONMENT}" >> $GITHUB_OUTPUT
|
||||||
# yamllint enable rule:line-length
|
# yamllint enable rule:line-length
|
||||||
|
|
||||||
deploy-pypi:
|
deploy-pypi:
|
||||||
@@ -51,56 +60,54 @@ jobs:
|
|||||||
contents: read
|
contents: read
|
||||||
id-token: write
|
id-token: write
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.7
|
- uses: actions/checkout@v4.2.2
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5.4.0
|
uses: actions/setup-python@v5.6.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.x"
|
python-version: "3.x"
|
||||||
- name: Set up python environment
|
|
||||||
env:
|
|
||||||
ESPHOME_NO_VENV: 1
|
|
||||||
run: script/setup
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |-
|
run: |-
|
||||||
pip3 install build
|
pip3 install build
|
||||||
python3 -m build
|
python3 -m build
|
||||||
- name: Publish
|
- name: Publish
|
||||||
uses: pypa/gh-action-pypi-publish@v1.12.4
|
uses: pypa/gh-action-pypi-publish@v1.12.4
|
||||||
|
with:
|
||||||
|
skip-existing: true
|
||||||
|
|
||||||
deploy-docker:
|
deploy-docker:
|
||||||
name: Build ESPHome ${{ matrix.platform }}
|
name: Build ESPHome ${{ matrix.platform.arch }}
|
||||||
if: github.repository == 'esphome/esphome'
|
if: github.repository == 'esphome/esphome'
|
||||||
permissions:
|
permissions:
|
||||||
contents: read
|
contents: read
|
||||||
packages: write
|
packages: write
|
||||||
runs-on: ubuntu-latest
|
runs-on: ${{ matrix.platform.os }}
|
||||||
needs: [init]
|
needs: [init]
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
platform:
|
platform:
|
||||||
- linux/amd64
|
- arch: amd64
|
||||||
- linux/arm64
|
os: "ubuntu-24.04"
|
||||||
|
- arch: arm64
|
||||||
|
os: "ubuntu-24.04-arm"
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.7
|
- uses: actions/checkout@v4.2.2
|
||||||
- name: Set up Python
|
- name: Set up Python
|
||||||
uses: actions/setup-python@v5.4.0
|
uses: actions/setup-python@v5.6.0
|
||||||
with:
|
with:
|
||||||
python-version: "3.9"
|
python-version: "3.10"
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3.10.0
|
uses: docker/setup-buildx-action@v3.11.1
|
||||||
- name: Set up QEMU
|
|
||||||
if: matrix.platform != 'linux/amd64'
|
|
||||||
uses: docker/setup-qemu-action@v3.6.0
|
|
||||||
|
|
||||||
- name: Log in to docker hub
|
- name: Log in to docker hub
|
||||||
uses: docker/login-action@v3.3.0
|
uses: docker/login-action@v3.4.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
- name: Log in to the GitHub container registry
|
- name: Log in to the GitHub container registry
|
||||||
uses: docker/login-action@v3.3.0
|
uses: docker/login-action@v3.4.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
@@ -109,45 +116,36 @@ jobs:
|
|||||||
- name: Build docker
|
- name: Build docker
|
||||||
uses: ./.github/actions/build-image
|
uses: ./.github/actions/build-image
|
||||||
with:
|
with:
|
||||||
platform: ${{ matrix.platform }}
|
target: final
|
||||||
target: docker
|
build_type: docker
|
||||||
baseimg: docker
|
|
||||||
suffix: ""
|
suffix: ""
|
||||||
version: ${{ needs.init.outputs.tag }}
|
version: ${{ needs.init.outputs.tag }}
|
||||||
|
|
||||||
- name: Build ha-addon
|
- name: Build ha-addon
|
||||||
uses: ./.github/actions/build-image
|
uses: ./.github/actions/build-image
|
||||||
with:
|
with:
|
||||||
platform: ${{ matrix.platform }}
|
target: final
|
||||||
target: hassio
|
build_type: ha-addon
|
||||||
baseimg: hassio
|
|
||||||
suffix: "hassio"
|
suffix: "hassio"
|
||||||
version: ${{ needs.init.outputs.tag }}
|
version: ${{ needs.init.outputs.tag }}
|
||||||
|
|
||||||
- name: Build lint
|
# - name: Build lint
|
||||||
uses: ./.github/actions/build-image
|
# uses: ./.github/actions/build-image
|
||||||
with:
|
# with:
|
||||||
platform: ${{ matrix.platform }}
|
# target: lint
|
||||||
target: lint
|
# build_type: lint
|
||||||
baseimg: docker
|
# suffix: lint
|
||||||
suffix: lint
|
# version: ${{ needs.init.outputs.tag }}
|
||||||
version: ${{ needs.init.outputs.tag }}
|
|
||||||
|
|
||||||
- name: Sanitize platform name
|
|
||||||
id: sanitize
|
|
||||||
run: |
|
|
||||||
echo "${{ matrix.platform }}" | sed 's|/|-|g' > /tmp/platform
|
|
||||||
echo name=$(cat /tmp/platform) >> $GITHUB_OUTPUT
|
|
||||||
|
|
||||||
- name: Upload digests
|
- name: Upload digests
|
||||||
uses: actions/upload-artifact@v4.6.1
|
uses: actions/upload-artifact@v4.6.2
|
||||||
with:
|
with:
|
||||||
name: digests-${{ steps.sanitize.outputs.name }}
|
name: digests-${{ matrix.platform.arch }}
|
||||||
path: /tmp/digests
|
path: /tmp/digests
|
||||||
retention-days: 1
|
retention-days: 1
|
||||||
|
|
||||||
deploy-manifest:
|
deploy-manifest:
|
||||||
name: Publish ESPHome ${{ matrix.image.title }} to ${{ matrix.registry }}
|
name: Publish ESPHome ${{ matrix.image.build_type }} to ${{ matrix.registry }}
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
needs:
|
needs:
|
||||||
- init
|
- init
|
||||||
@@ -160,40 +158,37 @@ jobs:
|
|||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
image:
|
image:
|
||||||
- title: "ha-addon"
|
- build_type: "docker"
|
||||||
target: "hassio"
|
|
||||||
suffix: "hassio"
|
|
||||||
- title: "docker"
|
|
||||||
target: "docker"
|
|
||||||
suffix: ""
|
suffix: ""
|
||||||
- title: "lint"
|
- build_type: "ha-addon"
|
||||||
target: "lint"
|
suffix: "hassio"
|
||||||
suffix: "lint"
|
# - build_type: "lint"
|
||||||
|
# suffix: "lint"
|
||||||
registry:
|
registry:
|
||||||
- ghcr
|
- ghcr
|
||||||
- dockerhub
|
- dockerhub
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4.1.7
|
- uses: actions/checkout@v4.2.2
|
||||||
|
|
||||||
- name: Download digests
|
- name: Download digests
|
||||||
uses: actions/download-artifact@v4.1.9
|
uses: actions/download-artifact@v4.3.0
|
||||||
with:
|
with:
|
||||||
pattern: digests-*
|
pattern: digests-*
|
||||||
path: /tmp/digests
|
path: /tmp/digests
|
||||||
merge-multiple: true
|
merge-multiple: true
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3.10.0
|
uses: docker/setup-buildx-action@v3.11.1
|
||||||
|
|
||||||
- name: Log in to docker hub
|
- name: Log in to docker hub
|
||||||
if: matrix.registry == 'dockerhub'
|
if: matrix.registry == 'dockerhub'
|
||||||
uses: docker/login-action@v3.3.0
|
uses: docker/login-action@v3.4.0
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USER }}
|
username: ${{ secrets.DOCKER_USER }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
- name: Log in to the GitHub container registry
|
- name: Log in to the GitHub container registry
|
||||||
if: matrix.registry == 'ghcr'
|
if: matrix.registry == 'ghcr'
|
||||||
uses: docker/login-action@v3.3.0
|
uses: docker/login-action@v3.4.0
|
||||||
with:
|
with:
|
||||||
registry: ghcr.io
|
registry: ghcr.io
|
||||||
username: ${{ github.actor }}
|
username: ${{ github.actor }}
|
||||||
@@ -212,7 +207,7 @@ jobs:
|
|||||||
done
|
done
|
||||||
|
|
||||||
- name: Create manifest list and push
|
- name: Create manifest list and push
|
||||||
working-directory: /tmp/digests/${{ matrix.image.target }}/${{ matrix.registry }}
|
working-directory: /tmp/digests/${{ matrix.image.build_type }}/${{ matrix.registry }}
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools create $(jq -Rcnr 'inputs | . / "," | map("-t " + .) | join(" ")' <<< "${{ steps.tags.outputs.tags}}") \
|
docker buildx imagetools create $(jq -Rcnr 'inputs | . / "," | map("-t " + .) | join(" ")' <<< "${{ steps.tags.outputs.tags}}") \
|
||||||
$(printf '${{ steps.tags.outputs.image }}@sha256:%s ' *)
|
$(printf '${{ steps.tags.outputs.image }}@sha256:%s ' *)
|
||||||
@@ -243,3 +238,24 @@ jobs:
|
|||||||
content: description
|
content: description
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
deploy-esphome-schema:
|
||||||
|
if: github.repository == 'esphome/esphome' && needs.init.outputs.branch_build == 'false'
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
needs: [init]
|
||||||
|
environment: ${{ needs.init.outputs.deploy_env }}
|
||||||
|
steps:
|
||||||
|
- name: Trigger Workflow
|
||||||
|
uses: actions/github-script@v7.0.1
|
||||||
|
with:
|
||||||
|
github-token: ${{ secrets.DEPLOY_ESPHOME_SCHEMA_REPO_TOKEN }}
|
||||||
|
script: |
|
||||||
|
github.rest.actions.createWorkflowDispatch({
|
||||||
|
owner: "esphome",
|
||||||
|
repo: "esphome-schema",
|
||||||
|
workflow_id: "generate-schemas.yml",
|
||||||
|
ref: "main",
|
||||||
|
inputs: {
|
||||||
|
version: "${{ needs.init.outputs.tag }}",
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|||||||
14
.github/workflows/sync-device-classes.yml
vendored
14
.github/workflows/sync-device-classes.yml
vendored
@@ -13,18 +13,18 @@ jobs:
|
|||||||
if: github.repository == 'esphome/esphome'
|
if: github.repository == 'esphome/esphome'
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout
|
- name: Checkout
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
|
|
||||||
- name: Checkout Home Assistant
|
- name: Checkout Home Assistant
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
with:
|
with:
|
||||||
repository: home-assistant/core
|
repository: home-assistant/core
|
||||||
path: lib/home-assistant
|
path: lib/home-assistant
|
||||||
|
|
||||||
- name: Setup Python
|
- name: Setup Python
|
||||||
uses: actions/setup-python@v5.4.0
|
uses: actions/setup-python@v5.6.0
|
||||||
with:
|
with:
|
||||||
python-version: 3.12
|
python-version: 3.13
|
||||||
|
|
||||||
- name: Install Home Assistant
|
- name: Install Home Assistant
|
||||||
run: |
|
run: |
|
||||||
@@ -36,11 +36,11 @@ jobs:
|
|||||||
python ./script/sync-device_class.py
|
python ./script/sync-device_class.py
|
||||||
|
|
||||||
- name: Commit changes
|
- name: Commit changes
|
||||||
uses: peter-evans/create-pull-request@v7.0.7
|
uses: peter-evans/create-pull-request@v7.0.8
|
||||||
with:
|
with:
|
||||||
commit-message: "Synchronise Device Classes from Home Assistant"
|
commit-message: "Synchronise Device Classes from Home Assistant"
|
||||||
committer: esphomebot <esphome@nabucasa.com>
|
committer: esphomebot <esphome@openhomefoundation.org>
|
||||||
author: esphomebot <esphome@nabucasa.com>
|
author: esphomebot <esphome@openhomefoundation.org>
|
||||||
branch: sync/device-classes
|
branch: sync/device-classes
|
||||||
delete-branch: true
|
delete-branch: true
|
||||||
title: "Synchronise Device Classes from Home Assistant"
|
title: "Synchronise Device Classes from Home Assistant"
|
||||||
|
|||||||
2
.github/workflows/yaml-lint.yml
vendored
2
.github/workflows/yaml-lint.yml
vendored
@@ -18,7 +18,7 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Check out code from GitHub
|
- name: Check out code from GitHub
|
||||||
uses: actions/checkout@v4.1.7
|
uses: actions/checkout@v4.2.2
|
||||||
- name: Run yamllint
|
- name: Run yamllint
|
||||||
uses: frenck/action-yamllint@v1.5.0
|
uses: frenck/action-yamllint@v1.5.0
|
||||||
with:
|
with:
|
||||||
|
|||||||
1
.gitignore
vendored
1
.gitignore
vendored
@@ -143,3 +143,4 @@ sdkconfig.*
|
|||||||
/components
|
/components
|
||||||
/managed_components
|
/managed_components
|
||||||
|
|
||||||
|
api-docs/
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
repos:
|
repos:
|
||||||
- repo: https://github.com/astral-sh/ruff-pre-commit
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
# Ruff version.
|
# Ruff version.
|
||||||
rev: v0.9.2
|
rev: v0.12.2
|
||||||
hooks:
|
hooks:
|
||||||
# Run the linter.
|
# Run the linter.
|
||||||
- id: ruff
|
- id: ruff
|
||||||
@@ -12,11 +12,11 @@ repos:
|
|||||||
# Run the formatter.
|
# Run the formatter.
|
||||||
- id: ruff-format
|
- id: ruff-format
|
||||||
- repo: https://github.com/PyCQA/flake8
|
- repo: https://github.com/PyCQA/flake8
|
||||||
rev: 6.1.0
|
rev: 7.3.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: flake8
|
- id: flake8
|
||||||
additional_dependencies:
|
additional_dependencies:
|
||||||
- flake8-docstrings==1.5.0
|
- flake8-docstrings==1.7.0
|
||||||
- pydocstyle==5.1.1
|
- pydocstyle==5.1.1
|
||||||
files: ^(esphome|tests)/.+\.py$
|
files: ^(esphome|tests)/.+\.py$
|
||||||
- repo: https://github.com/pre-commit/pre-commit-hooks
|
- repo: https://github.com/pre-commit/pre-commit-hooks
|
||||||
@@ -28,12 +28,12 @@ repos:
|
|||||||
- --branch=release
|
- --branch=release
|
||||||
- --branch=beta
|
- --branch=beta
|
||||||
- repo: https://github.com/asottile/pyupgrade
|
- repo: https://github.com/asottile/pyupgrade
|
||||||
rev: v3.15.2
|
rev: v3.20.0
|
||||||
hooks:
|
hooks:
|
||||||
- id: pyupgrade
|
- id: pyupgrade
|
||||||
args: [--py39-plus]
|
args: [--py310-plus]
|
||||||
- repo: https://github.com/adrienverge/yamllint.git
|
- repo: https://github.com/adrienverge/yamllint.git
|
||||||
rev: v1.35.1
|
rev: v1.37.1
|
||||||
hooks:
|
hooks:
|
||||||
- id: yamllint
|
- id: yamllint
|
||||||
- repo: https://github.com/pre-commit/mirrors-clang-format
|
- repo: https://github.com/pre-commit/mirrors-clang-format
|
||||||
|
|||||||
31
CODEOWNERS
31
CODEOWNERS
@@ -96,8 +96,10 @@ esphome/components/ch422g/* @clydebarrow @jesterret
|
|||||||
esphome/components/chsc6x/* @kkosik20
|
esphome/components/chsc6x/* @kkosik20
|
||||||
esphome/components/climate/* @esphome/core
|
esphome/components/climate/* @esphome/core
|
||||||
esphome/components/climate_ir/* @glmnet
|
esphome/components/climate_ir/* @glmnet
|
||||||
|
esphome/components/cm1106/* @andrewjswan
|
||||||
esphome/components/color_temperature/* @jesserockz
|
esphome/components/color_temperature/* @jesserockz
|
||||||
esphome/components/combination/* @Cat-Ion @kahrendt
|
esphome/components/combination/* @Cat-Ion @kahrendt
|
||||||
|
esphome/components/const/* @esphome/core
|
||||||
esphome/components/coolix/* @glmnet
|
esphome/components/coolix/* @glmnet
|
||||||
esphome/components/copy/* @OttoWinter
|
esphome/components/copy/* @OttoWinter
|
||||||
esphome/components/cover/* @esphome/core
|
esphome/components/cover/* @esphome/core
|
||||||
@@ -122,6 +124,7 @@ esphome/components/dht/* @OttoWinter
|
|||||||
esphome/components/display_menu_base/* @numo68
|
esphome/components/display_menu_base/* @numo68
|
||||||
esphome/components/dps310/* @kbx81
|
esphome/components/dps310/* @kbx81
|
||||||
esphome/components/ds1307/* @badbadc0ffee
|
esphome/components/ds1307/* @badbadc0ffee
|
||||||
|
esphome/components/ds2484/* @mrk-its
|
||||||
esphome/components/dsmr/* @glmnet @zuidwijk
|
esphome/components/dsmr/* @glmnet @zuidwijk
|
||||||
esphome/components/duty_time/* @dudanov
|
esphome/components/duty_time/* @dudanov
|
||||||
esphome/components/ee895/* @Stock-M
|
esphome/components/ee895/* @Stock-M
|
||||||
@@ -137,16 +140,19 @@ esphome/components/es7210/* @kahrendt
|
|||||||
esphome/components/es7243e/* @kbx81
|
esphome/components/es7243e/* @kbx81
|
||||||
esphome/components/es8156/* @kbx81
|
esphome/components/es8156/* @kbx81
|
||||||
esphome/components/es8311/* @kahrendt @kroimon
|
esphome/components/es8311/* @kahrendt @kroimon
|
||||||
|
esphome/components/es8388/* @P4uLT
|
||||||
esphome/components/esp32/* @esphome/core
|
esphome/components/esp32/* @esphome/core
|
||||||
esphome/components/esp32_ble/* @Rapsssito @jesserockz
|
esphome/components/esp32_ble/* @Rapsssito @jesserockz
|
||||||
esphome/components/esp32_ble_client/* @jesserockz
|
esphome/components/esp32_ble_client/* @jesserockz
|
||||||
esphome/components/esp32_ble_server/* @Rapsssito @clydebarrow @jesserockz
|
esphome/components/esp32_ble_server/* @Rapsssito @clydebarrow @jesserockz
|
||||||
esphome/components/esp32_camera_web_server/* @ayufan
|
esphome/components/esp32_camera_web_server/* @ayufan
|
||||||
esphome/components/esp32_can/* @Sympatron
|
esphome/components/esp32_can/* @Sympatron
|
||||||
|
esphome/components/esp32_hosted/* @swoboda1337
|
||||||
esphome/components/esp32_improv/* @jesserockz
|
esphome/components/esp32_improv/* @jesserockz
|
||||||
esphome/components/esp32_rmt/* @jesserockz
|
esphome/components/esp32_rmt/* @jesserockz
|
||||||
esphome/components/esp32_rmt_led_strip/* @jesserockz
|
esphome/components/esp32_rmt_led_strip/* @jesserockz
|
||||||
esphome/components/esp8266/* @esphome/core
|
esphome/components/esp8266/* @esphome/core
|
||||||
|
esphome/components/esp_ldo/* @clydebarrow
|
||||||
esphome/components/ethernet_info/* @gtjadsonsantos
|
esphome/components/ethernet_info/* @gtjadsonsantos
|
||||||
esphome/components/event/* @nohat
|
esphome/components/event/* @nohat
|
||||||
esphome/components/event_emitter/* @Rapsssito
|
esphome/components/event_emitter/* @Rapsssito
|
||||||
@@ -168,7 +174,7 @@ esphome/components/gp2y1010au0f/* @zry98
|
|||||||
esphome/components/gp8403/* @jesserockz
|
esphome/components/gp8403/* @jesserockz
|
||||||
esphome/components/gpio/* @esphome/core
|
esphome/components/gpio/* @esphome/core
|
||||||
esphome/components/gpio/one_wire/* @ssieb
|
esphome/components/gpio/one_wire/* @ssieb
|
||||||
esphome/components/gps/* @coogle
|
esphome/components/gps/* @coogle @ximex
|
||||||
esphome/components/graph/* @synco
|
esphome/components/graph/* @synco
|
||||||
esphome/components/graphical_display_menu/* @MrMDavidson
|
esphome/components/graphical_display_menu/* @MrMDavidson
|
||||||
esphome/components/gree/* @orestismers
|
esphome/components/gree/* @orestismers
|
||||||
@@ -232,6 +238,7 @@ esphome/components/kamstrup_kmp/* @cfeenstra1024
|
|||||||
esphome/components/key_collector/* @ssieb
|
esphome/components/key_collector/* @ssieb
|
||||||
esphome/components/key_provider/* @ssieb
|
esphome/components/key_provider/* @ssieb
|
||||||
esphome/components/kuntze/* @ssieb
|
esphome/components/kuntze/* @ssieb
|
||||||
|
esphome/components/lc709203f/* @ilikecake
|
||||||
esphome/components/lcd_menu/* @numo68
|
esphome/components/lcd_menu/* @numo68
|
||||||
esphome/components/ld2410/* @regevbr @sebcaps
|
esphome/components/ld2410/* @regevbr @sebcaps
|
||||||
esphome/components/ld2420/* @descipher
|
esphome/components/ld2420/* @descipher
|
||||||
@@ -242,6 +249,7 @@ esphome/components/libretiny_pwm/* @kuba2k2
|
|||||||
esphome/components/light/* @esphome/core
|
esphome/components/light/* @esphome/core
|
||||||
esphome/components/lightwaverf/* @max246
|
esphome/components/lightwaverf/* @max246
|
||||||
esphome/components/lilygo_t5_47/touchscreen/* @jesserockz
|
esphome/components/lilygo_t5_47/touchscreen/* @jesserockz
|
||||||
|
esphome/components/ln882x/* @lamauny
|
||||||
esphome/components/lock/* @esphome/core
|
esphome/components/lock/* @esphome/core
|
||||||
esphome/components/logger/* @esphome/core
|
esphome/components/logger/* @esphome/core
|
||||||
esphome/components/logger/select/* @clydebarrow
|
esphome/components/logger/select/* @clydebarrow
|
||||||
@@ -250,6 +258,7 @@ esphome/components/ltr501/* @latonita
|
|||||||
esphome/components/ltr_als_ps/* @latonita
|
esphome/components/ltr_als_ps/* @latonita
|
||||||
esphome/components/lvgl/* @clydebarrow
|
esphome/components/lvgl/* @clydebarrow
|
||||||
esphome/components/m5stack_8angle/* @rnauber
|
esphome/components/m5stack_8angle/* @rnauber
|
||||||
|
esphome/components/mapping/* @clydebarrow
|
||||||
esphome/components/matrix_keypad/* @ssieb
|
esphome/components/matrix_keypad/* @ssieb
|
||||||
esphome/components/max17043/* @blacknell
|
esphome/components/max17043/* @blacknell
|
||||||
esphome/components/max31865/* @DAVe3283
|
esphome/components/max31865/* @DAVe3283
|
||||||
@@ -266,6 +275,7 @@ esphome/components/mcp23x17_base/* @jesserockz
|
|||||||
esphome/components/mcp23xxx_base/* @jesserockz
|
esphome/components/mcp23xxx_base/* @jesserockz
|
||||||
esphome/components/mcp2515/* @danielschramm @mvturnho
|
esphome/components/mcp2515/* @danielschramm @mvturnho
|
||||||
esphome/components/mcp3204/* @rsumner
|
esphome/components/mcp3204/* @rsumner
|
||||||
|
esphome/components/mcp4461/* @p1ngb4ck
|
||||||
esphome/components/mcp4728/* @berfenger
|
esphome/components/mcp4728/* @berfenger
|
||||||
esphome/components/mcp47a1/* @jesserockz
|
esphome/components/mcp47a1/* @jesserockz
|
||||||
esphome/components/mcp9600/* @mreditor97
|
esphome/components/mcp9600/* @mreditor97
|
||||||
@@ -275,10 +285,11 @@ esphome/components/mdns/* @esphome/core
|
|||||||
esphome/components/media_player/* @jesserockz
|
esphome/components/media_player/* @jesserockz
|
||||||
esphome/components/micro_wake_word/* @jesserockz @kahrendt
|
esphome/components/micro_wake_word/* @jesserockz @kahrendt
|
||||||
esphome/components/micronova/* @jorre05
|
esphome/components/micronova/* @jorre05
|
||||||
esphome/components/microphone/* @jesserockz
|
esphome/components/microphone/* @jesserockz @kahrendt
|
||||||
esphome/components/mics_4514/* @jesserockz
|
esphome/components/mics_4514/* @jesserockz
|
||||||
esphome/components/midea/* @dudanov
|
esphome/components/midea/* @dudanov
|
||||||
esphome/components/midea_ir/* @dudanov
|
esphome/components/midea_ir/* @dudanov
|
||||||
|
esphome/components/mipi_spi/* @clydebarrow
|
||||||
esphome/components/mitsubishi/* @RubyBailey
|
esphome/components/mitsubishi/* @RubyBailey
|
||||||
esphome/components/mixer/speaker/* @kahrendt
|
esphome/components/mixer/speaker/* @kahrendt
|
||||||
esphome/components/mlx90393/* @functionpointer
|
esphome/components/mlx90393/* @functionpointer
|
||||||
@@ -314,16 +325,22 @@ esphome/components/number/* @esphome/core
|
|||||||
esphome/components/one_wire/* @ssieb
|
esphome/components/one_wire/* @ssieb
|
||||||
esphome/components/online_image/* @clydebarrow @guillempages
|
esphome/components/online_image/* @clydebarrow @guillempages
|
||||||
esphome/components/opentherm/* @olegtarasov
|
esphome/components/opentherm/* @olegtarasov
|
||||||
|
esphome/components/openthread/* @mrene
|
||||||
|
esphome/components/opt3001/* @ccutrer
|
||||||
esphome/components/ota/* @esphome/core
|
esphome/components/ota/* @esphome/core
|
||||||
esphome/components/output/* @esphome/core
|
esphome/components/output/* @esphome/core
|
||||||
|
esphome/components/packet_transport/* @clydebarrow
|
||||||
esphome/components/pca6416a/* @Mat931
|
esphome/components/pca6416a/* @Mat931
|
||||||
esphome/components/pca9554/* @clydebarrow @hwstar
|
esphome/components/pca9554/* @clydebarrow @hwstar
|
||||||
esphome/components/pcf85063/* @brogon
|
esphome/components/pcf85063/* @brogon
|
||||||
esphome/components/pcf8563/* @KoenBreeman
|
esphome/components/pcf8563/* @KoenBreeman
|
||||||
|
esphome/components/pi4ioe5v6408/* @jesserockz
|
||||||
esphome/components/pid/* @OttoWinter
|
esphome/components/pid/* @OttoWinter
|
||||||
esphome/components/pipsolar/* @andreashergert1984
|
esphome/components/pipsolar/* @andreashergert1984
|
||||||
esphome/components/pm1006/* @habbie
|
esphome/components/pm1006/* @habbie
|
||||||
|
esphome/components/pm2005/* @andrewjswan
|
||||||
esphome/components/pmsa003i/* @sjtrny
|
esphome/components/pmsa003i/* @sjtrny
|
||||||
|
esphome/components/pmsx003/* @ximex
|
||||||
esphome/components/pmwcs3/* @SeByDocKy
|
esphome/components/pmwcs3/* @SeByDocKy
|
||||||
esphome/components/pn532/* @OttoWinter @jesserockz
|
esphome/components/pn532/* @OttoWinter @jesserockz
|
||||||
esphome/components/pn532_i2c/* @OttoWinter @jesserockz
|
esphome/components/pn532_i2c/* @OttoWinter @jesserockz
|
||||||
@@ -392,6 +409,7 @@ esphome/components/smt100/* @piechade
|
|||||||
esphome/components/sn74hc165/* @jesserockz
|
esphome/components/sn74hc165/* @jesserockz
|
||||||
esphome/components/socket/* @esphome/core
|
esphome/components/socket/* @esphome/core
|
||||||
esphome/components/sonoff_d1/* @anatoly-savchenkov
|
esphome/components/sonoff_d1/* @anatoly-savchenkov
|
||||||
|
esphome/components/sound_level/* @kahrendt
|
||||||
esphome/components/speaker/* @jesserockz @kahrendt
|
esphome/components/speaker/* @jesserockz @kahrendt
|
||||||
esphome/components/speaker/media_player/* @kahrendt @synesthesiam
|
esphome/components/speaker/media_player/* @kahrendt @synesthesiam
|
||||||
esphome/components/spi/* @clydebarrow @esphome/core
|
esphome/components/spi/* @clydebarrow @esphome/core
|
||||||
@@ -423,6 +441,8 @@ esphome/components/sun/* @OttoWinter
|
|||||||
esphome/components/sun_gtil2/* @Mat931
|
esphome/components/sun_gtil2/* @Mat931
|
||||||
esphome/components/switch/* @esphome/core
|
esphome/components/switch/* @esphome/core
|
||||||
esphome/components/switch/binary_sensor/* @ssieb
|
esphome/components/switch/binary_sensor/* @ssieb
|
||||||
|
esphome/components/sx127x/* @swoboda1337
|
||||||
|
esphome/components/syslog/* @clydebarrow
|
||||||
esphome/components/t6615/* @tylermenezes
|
esphome/components/t6615/* @tylermenezes
|
||||||
esphome/components/tc74/* @sethgirvan
|
esphome/components/tc74/* @sethgirvan
|
||||||
esphome/components/tca9548a/* @andreashergert1984
|
esphome/components/tca9548a/* @andreashergert1984
|
||||||
@@ -462,21 +482,25 @@ esphome/components/tuya/switch/* @jesserockz
|
|||||||
esphome/components/tuya/text_sensor/* @dentra
|
esphome/components/tuya/text_sensor/* @dentra
|
||||||
esphome/components/uart/* @esphome/core
|
esphome/components/uart/* @esphome/core
|
||||||
esphome/components/uart/button/* @ssieb
|
esphome/components/uart/button/* @ssieb
|
||||||
|
esphome/components/uart/packet_transport/* @clydebarrow
|
||||||
esphome/components/udp/* @clydebarrow
|
esphome/components/udp/* @clydebarrow
|
||||||
esphome/components/ufire_ec/* @pvizeli
|
esphome/components/ufire_ec/* @pvizeli
|
||||||
esphome/components/ufire_ise/* @pvizeli
|
esphome/components/ufire_ise/* @pvizeli
|
||||||
esphome/components/ultrasonic/* @OttoWinter
|
esphome/components/ultrasonic/* @OttoWinter
|
||||||
esphome/components/update/* @jesserockz
|
esphome/components/update/* @jesserockz
|
||||||
esphome/components/uponor_smatrix/* @kroimon
|
esphome/components/uponor_smatrix/* @kroimon
|
||||||
|
esphome/components/usb_host/* @clydebarrow
|
||||||
|
esphome/components/usb_uart/* @clydebarrow
|
||||||
esphome/components/valve/* @esphome/core
|
esphome/components/valve/* @esphome/core
|
||||||
esphome/components/vbus/* @ssieb
|
esphome/components/vbus/* @ssieb
|
||||||
esphome/components/veml3235/* @kbx81
|
esphome/components/veml3235/* @kbx81
|
||||||
esphome/components/veml7700/* @latonita
|
esphome/components/veml7700/* @latonita
|
||||||
esphome/components/version/* @esphome/core
|
esphome/components/version/* @esphome/core
|
||||||
esphome/components/voice_assistant/* @jesserockz
|
esphome/components/voice_assistant/* @jesserockz @kahrendt
|
||||||
esphome/components/wake_on_lan/* @clydebarrow @willwill2will54
|
esphome/components/wake_on_lan/* @clydebarrow @willwill2will54
|
||||||
esphome/components/watchdog/* @oarcher
|
esphome/components/watchdog/* @oarcher
|
||||||
esphome/components/waveshare_epaper/* @clydebarrow
|
esphome/components/waveshare_epaper/* @clydebarrow
|
||||||
|
esphome/components/web_server/ota/* @esphome/core
|
||||||
esphome/components/web_server_base/* @OttoWinter
|
esphome/components/web_server_base/* @OttoWinter
|
||||||
esphome/components/web_server_idf/* @dentra
|
esphome/components/web_server_idf/* @dentra
|
||||||
esphome/components/weikai/* @DrCoolZic
|
esphome/components/weikai/* @DrCoolZic
|
||||||
@@ -503,6 +527,7 @@ esphome/components/xiaomi_lywsd03mmc/* @ahpohl
|
|||||||
esphome/components/xiaomi_mhoc303/* @drug123
|
esphome/components/xiaomi_mhoc303/* @drug123
|
||||||
esphome/components/xiaomi_mhoc401/* @vevsvevs
|
esphome/components/xiaomi_mhoc401/* @vevsvevs
|
||||||
esphome/components/xiaomi_rtcgq02lm/* @jesserockz
|
esphome/components/xiaomi_rtcgq02lm/* @jesserockz
|
||||||
|
esphome/components/xiaomi_xmwsdj04mmc/* @medusalix
|
||||||
esphome/components/xl9535/* @mreditor97
|
esphome/components/xl9535/* @mreditor97
|
||||||
esphome/components/xpt2046/touchscreen/* @nielsnl68 @numo68
|
esphome/components/xpt2046/touchscreen/* @nielsnl68 @numo68
|
||||||
esphome/components/xxtea/* @clydebarrow
|
esphome/components/xxtea/* @clydebarrow
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe
|
|||||||
|
|
||||||
## Enforcement
|
## Enforcement
|
||||||
|
|
||||||
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at esphome@nabucasa.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at esphome@openhomefoundation.org. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
|
||||||
|
|
||||||
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.
|
||||||
|
|
||||||
|
|||||||
@@ -1,131 +1,56 @@
|
|||||||
# Build these with the build.py script
|
ARG BUILD_VERSION=dev
|
||||||
# Example:
|
ARG BUILD_OS=alpine
|
||||||
# python3 docker/build.py --tag dev --arch amd64 --build-type docker build
|
ARG BUILD_BASE_VERSION=2025.04.0
|
||||||
|
ARG BUILD_TYPE=docker
|
||||||
|
|
||||||
# One of "docker", "hassio"
|
FROM ghcr.io/esphome/docker-base:${BUILD_OS}-${BUILD_BASE_VERSION} AS base-source-docker
|
||||||
ARG BASEIMGTYPE=docker
|
FROM ghcr.io/esphome/docker-base:${BUILD_OS}-ha-addon-${BUILD_BASE_VERSION} AS base-source-ha-addon
|
||||||
|
|
||||||
|
ARG BUILD_TYPE
|
||||||
|
FROM base-source-${BUILD_TYPE} AS base
|
||||||
|
|
||||||
# https://github.com/hassio-addons/addon-debian-base/releases
|
RUN git config --system --add safe.directory "*"
|
||||||
FROM ghcr.io/hassio-addons/debian-base:7.2.0 AS base-hassio
|
|
||||||
# https://hub.docker.com/_/debian?tab=tags&page=1&name=bookworm
|
|
||||||
FROM debian:12.2-slim AS base-docker
|
|
||||||
|
|
||||||
FROM base-${BASEIMGTYPE} AS base
|
ENV PIP_DISABLE_PIP_VERSION_CHECK=1
|
||||||
|
|
||||||
|
RUN pip install --no-cache-dir -U pip uv==0.6.14
|
||||||
|
|
||||||
ARG TARGETARCH
|
COPY requirements.txt /
|
||||||
ARG TARGETVARIANT
|
|
||||||
|
|
||||||
|
|
||||||
# Note that --break-system-packages is used below because
|
|
||||||
# https://peps.python.org/pep-0668/ added a safety check that prevents
|
|
||||||
# installing packages with the same name as a system package. This is
|
|
||||||
# not a problem for us because we are not concerned about overwriting
|
|
||||||
# system packages because we are running in an isolated container.
|
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
apt-get update \
|
uv pip install --no-cache-dir \
|
||||||
# Use pinned versions so that we get updates with build caching
|
-r /requirements.txt
|
||||||
&& apt-get install -y --no-install-recommends \
|
|
||||||
python3-pip=23.0.1+dfsg-1 \
|
|
||||||
python3-setuptools=66.1.1-1+deb12u1 \
|
|
||||||
python3-venv=3.11.2-1+b1 \
|
|
||||||
python3-wheel=0.38.4-2 \
|
|
||||||
iputils-ping=3:20221126-1+deb12u1 \
|
|
||||||
git=1:2.39.5-0+deb12u2 \
|
|
||||||
curl=7.88.1-10+deb12u12 \
|
|
||||||
openssh-client=1:9.2p1-2+deb12u5 \
|
|
||||||
python3-cffi=1.15.1-5 \
|
|
||||||
libcairo2=1.16.0-7 \
|
|
||||||
libmagic1=1:5.44-3 \
|
|
||||||
patch=2.7.6-7 \
|
|
||||||
&& rm -rf \
|
|
||||||
/tmp/* \
|
|
||||||
/var/{cache,log}/* \
|
|
||||||
/var/lib/apt/lists/*
|
|
||||||
|
|
||||||
ENV \
|
|
||||||
# Fix click python3 lang warning https://click.palletsprojects.com/en/7.x/python3/
|
|
||||||
LANG=C.UTF-8 LC_ALL=C.UTF-8 \
|
|
||||||
# Store globally installed pio libs in /piolibs
|
|
||||||
PLATFORMIO_GLOBALLIB_DIR=/piolibs
|
|
||||||
|
|
||||||
RUN \
|
RUN \
|
||||||
pip3 install \
|
platformio settings set enable_telemetry No \
|
||||||
--break-system-packages --no-cache-dir \
|
|
||||||
# Keep platformio version in sync with requirements.txt
|
|
||||||
platformio==6.1.16 \
|
|
||||||
# Change some platformio settings
|
|
||||||
&& platformio settings set enable_telemetry No \
|
|
||||||
&& platformio settings set check_platformio_interval 1000000 \
|
&& platformio settings set check_platformio_interval 1000000 \
|
||||||
&& mkdir -p /piolibs
|
&& mkdir -p /piolibs
|
||||||
|
|
||||||
|
|
||||||
# First install requirements to leverage caching when requirements don't change
|
|
||||||
# tmpfs is for https://github.com/rust-lang/cargo/issues/8719
|
|
||||||
|
|
||||||
COPY requirements.txt requirements_optional.txt /
|
|
||||||
RUN --mount=type=tmpfs,target=/root/.cargo <<END-OF-RUN
|
|
||||||
# Fail on any non-zero status
|
|
||||||
set -e
|
|
||||||
|
|
||||||
# install build tools in case wheels are not available
|
|
||||||
BUILD_DEPS="
|
|
||||||
build-essential=12.9
|
|
||||||
python3-dev=3.11.2-1+b1
|
|
||||||
zlib1g-dev=1:1.2.13.dfsg-1
|
|
||||||
libjpeg-dev=1:2.1.5-2
|
|
||||||
libfreetype-dev=2.12.1+dfsg-5+deb12u4
|
|
||||||
libssl-dev=3.0.15-1~deb12u1
|
|
||||||
libffi-dev=3.4.4-1
|
|
||||||
cargo=0.66.0+ds1-1
|
|
||||||
pkg-config=1.8.1-1
|
|
||||||
"
|
|
||||||
LIB_DEPS="
|
|
||||||
libtiff6=4.5.0-6+deb12u1
|
|
||||||
libopenjp2-7=2.5.0-2+deb12u1
|
|
||||||
"
|
|
||||||
if [ "$TARGETARCH$TARGETVARIANT" = "arm64" ]
|
|
||||||
then
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y --no-install-recommends $BUILD_DEPS $LIB_DEPS
|
|
||||||
fi
|
|
||||||
|
|
||||||
CARGO_REGISTRIES_CRATES_IO_PROTOCOL=sparse CARGO_HOME=/root/.cargo
|
|
||||||
pip3 install --break-system-packages --no-cache-dir -r /requirements.txt -r /requirements_optional.txt
|
|
||||||
|
|
||||||
if [ "$TARGETARCH$TARGETVARIANT" = "arm64" ]
|
|
||||||
then
|
|
||||||
apt-get remove -y --purge --auto-remove $BUILD_DEPS
|
|
||||||
rm -rf /tmp/* /var/{cache,log}/* /var/lib/apt/lists/*
|
|
||||||
fi
|
|
||||||
END-OF-RUN
|
|
||||||
|
|
||||||
|
|
||||||
COPY script/platformio_install_deps.py platformio.ini /
|
COPY script/platformio_install_deps.py platformio.ini /
|
||||||
RUN /platformio_install_deps.py /platformio.ini --libraries
|
RUN /platformio_install_deps.py /platformio.ini --libraries
|
||||||
|
|
||||||
# Avoid unsafe git error when container user and file config volume permissions don't match
|
ARG BUILD_VERSION
|
||||||
RUN git config --system --add safe.directory '*'
|
|
||||||
|
LABEL \
|
||||||
|
org.opencontainers.image.authors="The ESPHome Authors" \
|
||||||
|
org.opencontainers.image.title="ESPHome" \
|
||||||
|
org.opencontainers.image.description="ESPHome is a system to configure your microcontrollers by simple yet powerful configuration files and control them remotely through Home Automation systems" \
|
||||||
|
org.opencontainers.image.url="https://esphome.io/" \
|
||||||
|
org.opencontainers.image.documentation="https://esphome.io/" \
|
||||||
|
org.opencontainers.image.source="https://github.com/esphome/esphome" \
|
||||||
|
org.opencontainers.image.licenses="ESPHome" \
|
||||||
|
org.opencontainers.image.version=${BUILD_VERSION}
|
||||||
|
|
||||||
|
|
||||||
# ======================= docker-type image =======================
|
# ======================= docker-type image =======================
|
||||||
FROM base AS docker
|
FROM base AS base-docker
|
||||||
|
|
||||||
# Copy esphome and install
|
|
||||||
COPY . /esphome
|
|
||||||
RUN pip3 install --break-system-packages --no-cache-dir -e /esphome
|
|
||||||
|
|
||||||
# Settings for dashboard
|
|
||||||
ENV USERNAME="" PASSWORD=""
|
|
||||||
|
|
||||||
# Expose the dashboard to Docker
|
# Expose the dashboard to Docker
|
||||||
EXPOSE 6052
|
EXPOSE 6052
|
||||||
|
|
||||||
# Run healthcheck (heartbeat)
|
# Run healthcheck (heartbeat)
|
||||||
HEALTHCHECK --interval=30s --timeout=30s \
|
HEALTHCHECK --interval=30s --timeout=30s \
|
||||||
CMD curl --fail http://localhost:6052/version -A "HealthCheck" || exit 1
|
CMD curl --fail http://localhost:6052/version -A "HealthCheck" || exit 1
|
||||||
|
|
||||||
COPY docker/docker_entrypoint.sh /entrypoint.sh
|
COPY docker/docker_entrypoint.sh /entrypoint.sh
|
||||||
|
|
||||||
@@ -139,43 +64,13 @@ ENTRYPOINT ["/entrypoint.sh"]
|
|||||||
CMD ["dashboard", "/config"]
|
CMD ["dashboard", "/config"]
|
||||||
|
|
||||||
|
|
||||||
ARG BUILD_VERSION=dev
|
# ======================= ha-addon-type image =======================
|
||||||
|
FROM base AS base-ha-addon
|
||||||
# Labels
|
|
||||||
LABEL \
|
|
||||||
org.opencontainers.image.authors="The ESPHome Authors" \
|
|
||||||
org.opencontainers.image.title="ESPHome" \
|
|
||||||
org.opencontainers.image.description="ESPHome is a system to configure your microcontrollers by simple yet powerful configuration files and control them remotely through Home Automation systems" \
|
|
||||||
org.opencontainers.image.url="https://esphome.io/" \
|
|
||||||
org.opencontainers.image.documentation="https://esphome.io/" \
|
|
||||||
org.opencontainers.image.source="https://github.com/esphome/esphome" \
|
|
||||||
org.opencontainers.image.licenses="ESPHome" \
|
|
||||||
org.opencontainers.image.version=${BUILD_VERSION}
|
|
||||||
|
|
||||||
|
|
||||||
# ======================= hassio-type image =======================
|
|
||||||
FROM base AS hassio
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
apt-get update \
|
|
||||||
# Use pinned versions so that we get updates with build caching
|
|
||||||
&& apt-get install -y --no-install-recommends \
|
|
||||||
nginx-light=1.22.1-9+deb12u1 \
|
|
||||||
&& rm -rf \
|
|
||||||
/tmp/* \
|
|
||||||
/var/{cache,log}/* \
|
|
||||||
/var/lib/apt/lists/*
|
|
||||||
|
|
||||||
ARG BUILD_VERSION=dev
|
|
||||||
|
|
||||||
# Copy root filesystem
|
# Copy root filesystem
|
||||||
COPY docker/ha-addon-rootfs/ /
|
COPY docker/ha-addon-rootfs/ /
|
||||||
|
|
||||||
# Copy esphome and install
|
ARG BUILD_VERSION
|
||||||
COPY . /esphome
|
|
||||||
RUN pip3 install --break-system-packages --no-cache-dir -e /esphome
|
|
||||||
|
|
||||||
# Labels
|
|
||||||
LABEL \
|
LABEL \
|
||||||
io.hass.name="ESPHome" \
|
io.hass.name="ESPHome" \
|
||||||
io.hass.description="ESPHome is a system to configure your microcontrollers by simple yet powerful configuration files and control them remotely through Home Automation systems" \
|
io.hass.description="ESPHome is a system to configure your microcontrollers by simple yet powerful configuration files and control them remotely through Home Automation systems" \
|
||||||
@@ -183,35 +78,9 @@ LABEL \
|
|||||||
io.hass.version="${BUILD_VERSION}"
|
io.hass.version="${BUILD_VERSION}"
|
||||||
# io.hass.arch is inherited from addon-debian-base
|
# io.hass.arch is inherited from addon-debian-base
|
||||||
|
|
||||||
|
ARG BUILD_TYPE
|
||||||
|
FROM base-${BUILD_TYPE} AS final
|
||||||
|
|
||||||
|
# Copy esphome and install
|
||||||
|
COPY . /esphome
|
||||||
# ======================= lint-type image =======================
|
RUN uv pip install --no-cache-dir -e /esphome
|
||||||
FROM base AS lint
|
|
||||||
|
|
||||||
ENV \
|
|
||||||
PLATFORMIO_CORE_DIR=/esphome/.temp/platformio
|
|
||||||
|
|
||||||
RUN \
|
|
||||||
curl -L https://apt.llvm.org/llvm-snapshot.gpg.key -o /etc/apt/trusted.gpg.d/apt.llvm.org.asc \
|
|
||||||
&& echo "deb http://apt.llvm.org/bookworm/ llvm-toolchain-bookworm-18 main" > /etc/apt/sources.list.d/llvm.sources.list \
|
|
||||||
&& apt-get update \
|
|
||||||
# Use pinned versions so that we get updates with build caching
|
|
||||||
&& apt-get install -y --no-install-recommends \
|
|
||||||
clang-format-13=1:13.0.1-11+b2 \
|
|
||||||
patch=2.7.6-7 \
|
|
||||||
software-properties-common=0.99.30-4.1~deb12u1 \
|
|
||||||
nano=7.2-1+deb12u1 \
|
|
||||||
build-essential=12.9 \
|
|
||||||
python3-dev=3.11.2-1+b1 \
|
|
||||||
clang-tidy-18=1:18.1.8~++20240731024826+3b5b5c1ec4a3-1~exp1~20240731144843.145 \
|
|
||||||
&& rm -rf \
|
|
||||||
/tmp/* \
|
|
||||||
/var/{cache,log}/* \
|
|
||||||
/var/lib/apt/lists/*
|
|
||||||
|
|
||||||
COPY requirements_test.txt /
|
|
||||||
RUN pip3 install --break-system-packages --no-cache-dir -r /requirements_test.txt
|
|
||||||
|
|
||||||
VOLUME ["/esphome"]
|
|
||||||
WORKDIR /esphome
|
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ manifest_parser = subparsers.add_parser(
|
|||||||
class DockerParams:
|
class DockerParams:
|
||||||
build_to: str
|
build_to: str
|
||||||
manifest_to: str
|
manifest_to: str
|
||||||
baseimgtype: str
|
build_type: str
|
||||||
platform: str
|
platform: str
|
||||||
target: str
|
target: str
|
||||||
|
|
||||||
@@ -66,24 +66,19 @@ class DockerParams:
|
|||||||
TYPE_LINT: "esphome/esphome-lint",
|
TYPE_LINT: "esphome/esphome-lint",
|
||||||
}[build_type]
|
}[build_type]
|
||||||
build_to = f"{prefix}-{arch}"
|
build_to = f"{prefix}-{arch}"
|
||||||
baseimgtype = {
|
|
||||||
TYPE_DOCKER: "docker",
|
|
||||||
TYPE_HA_ADDON: "hassio",
|
|
||||||
TYPE_LINT: "docker",
|
|
||||||
}[build_type]
|
|
||||||
platform = {
|
platform = {
|
||||||
ARCH_AMD64: "linux/amd64",
|
ARCH_AMD64: "linux/amd64",
|
||||||
ARCH_AARCH64: "linux/arm64",
|
ARCH_AARCH64: "linux/arm64",
|
||||||
}[arch]
|
}[arch]
|
||||||
target = {
|
target = {
|
||||||
TYPE_DOCKER: "docker",
|
TYPE_DOCKER: "final",
|
||||||
TYPE_HA_ADDON: "hassio",
|
TYPE_HA_ADDON: "final",
|
||||||
TYPE_LINT: "lint",
|
TYPE_LINT: "lint",
|
||||||
}[build_type]
|
}[build_type]
|
||||||
return cls(
|
return cls(
|
||||||
build_to=build_to,
|
build_to=build_to,
|
||||||
manifest_to=prefix,
|
manifest_to=prefix,
|
||||||
baseimgtype=baseimgtype,
|
build_type=build_type,
|
||||||
platform=platform,
|
platform=platform,
|
||||||
target=target,
|
target=target,
|
||||||
)
|
)
|
||||||
@@ -145,7 +140,7 @@ def main():
|
|||||||
"buildx",
|
"buildx",
|
||||||
"build",
|
"build",
|
||||||
"--build-arg",
|
"--build-arg",
|
||||||
f"BASEIMGTYPE={params.baseimgtype}",
|
f"BUILD_TYPE={params.build_type}",
|
||||||
"--build-arg",
|
"--build-arg",
|
||||||
f"BUILD_VERSION={args.tag}",
|
f"BUILD_VERSION={args.tag}",
|
||||||
"--cache-from",
|
"--cache-from",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
import re
|
|
||||||
import argparse
|
import argparse
|
||||||
|
import re
|
||||||
|
|
||||||
CHANNEL_DEV = "dev"
|
CHANNEL_DEV = "dev"
|
||||||
CHANNEL_BETA = "beta"
|
CHANNEL_BETA = "beta"
|
||||||
|
|||||||
@@ -34,16 +34,14 @@ from esphome.const import (
|
|||||||
CONF_PORT,
|
CONF_PORT,
|
||||||
CONF_SUBSTITUTIONS,
|
CONF_SUBSTITUTIONS,
|
||||||
CONF_TOPIC,
|
CONF_TOPIC,
|
||||||
PLATFORM_BK72XX,
|
|
||||||
PLATFORM_ESP32,
|
PLATFORM_ESP32,
|
||||||
PLATFORM_ESP8266,
|
PLATFORM_ESP8266,
|
||||||
PLATFORM_RP2040,
|
PLATFORM_RP2040,
|
||||||
PLATFORM_RTL87XX,
|
|
||||||
SECRETS_FILES,
|
SECRETS_FILES,
|
||||||
)
|
)
|
||||||
from esphome.core import CORE, EsphomeError, coroutine
|
from esphome.core import CORE, EsphomeError, coroutine
|
||||||
from esphome.helpers import get_bool_env, indent, is_ip_address
|
from esphome.helpers import get_bool_env, indent, is_ip_address
|
||||||
from esphome.log import Fore, color, setup_log
|
from esphome.log import AnsiFore, color, setup_log
|
||||||
from esphome.util import (
|
from esphome.util import (
|
||||||
get_serial_ports,
|
get_serial_ports,
|
||||||
list_yaml_files,
|
list_yaml_files,
|
||||||
@@ -83,7 +81,7 @@ def choose_prompt(options, purpose: str = None):
|
|||||||
raise ValueError
|
raise ValueError
|
||||||
break
|
break
|
||||||
except ValueError:
|
except ValueError:
|
||||||
safe_print(color(Fore.RED, f"Invalid option: '{opt}'"))
|
safe_print(color(AnsiFore.RED, f"Invalid option: '{opt}'"))
|
||||||
return options[opt - 1][1]
|
return options[opt - 1][1]
|
||||||
|
|
||||||
|
|
||||||
@@ -133,7 +131,8 @@ def get_port_type(port):
|
|||||||
return "NETWORK"
|
return "NETWORK"
|
||||||
|
|
||||||
|
|
||||||
def run_miniterm(config, port):
|
def run_miniterm(config, port, args):
|
||||||
|
from aioesphomeapi import LogParser
|
||||||
import serial
|
import serial
|
||||||
|
|
||||||
from esphome import platformio_api
|
from esphome import platformio_api
|
||||||
@@ -154,10 +153,11 @@ def run_miniterm(config, port):
|
|||||||
|
|
||||||
# We can't set to False by default since it leads to toggling and hence
|
# We can't set to False by default since it leads to toggling and hence
|
||||||
# ESP32 resets on some platforms.
|
# ESP32 resets on some platforms.
|
||||||
if config["logger"][CONF_DEASSERT_RTS_DTR]:
|
if config["logger"][CONF_DEASSERT_RTS_DTR] or args.reset:
|
||||||
ser.dtr = False
|
ser.dtr = False
|
||||||
ser.rts = False
|
ser.rts = False
|
||||||
|
|
||||||
|
parser = LogParser()
|
||||||
tries = 0
|
tries = 0
|
||||||
while tries < 5:
|
while tries < 5:
|
||||||
try:
|
try:
|
||||||
@@ -174,8 +174,7 @@ def run_miniterm(config, port):
|
|||||||
.decode("utf8", "backslashreplace")
|
.decode("utf8", "backslashreplace")
|
||||||
)
|
)
|
||||||
time_str = datetime.now().time().strftime("[%H:%M:%S]")
|
time_str = datetime.now().time().strftime("[%H:%M:%S]")
|
||||||
message = time_str + line
|
safe_print(parser.parse_line(line, time_str))
|
||||||
safe_print(message)
|
|
||||||
|
|
||||||
backtrace_state = platformio_api.process_stacktrace(
|
backtrace_state = platformio_api.process_stacktrace(
|
||||||
config, line, backtrace_state=backtrace_state
|
config, line, backtrace_state=backtrace_state
|
||||||
@@ -244,11 +243,11 @@ def compile_program(args, config):
|
|||||||
return 0 if idedata is not None else 1
|
return 0 if idedata is not None else 1
|
||||||
|
|
||||||
|
|
||||||
def upload_using_esptool(config, port, file):
|
def upload_using_esptool(config, port, file, speed):
|
||||||
from esphome import platformio_api
|
from esphome import platformio_api
|
||||||
|
|
||||||
first_baudrate = config[CONF_ESPHOME][CONF_PLATFORMIO_OPTIONS].get(
|
first_baudrate = speed or config[CONF_ESPHOME][CONF_PLATFORMIO_OPTIONS].get(
|
||||||
"upload_speed", 460800
|
"upload_speed", os.getenv("ESPHOME_UPLOAD_SPEED", "460800")
|
||||||
)
|
)
|
||||||
|
|
||||||
if file is not None:
|
if file is not None:
|
||||||
@@ -348,12 +347,12 @@ def upload_program(config, args, host):
|
|||||||
check_permissions(host)
|
check_permissions(host)
|
||||||
if CORE.target_platform in (PLATFORM_ESP32, PLATFORM_ESP8266):
|
if CORE.target_platform in (PLATFORM_ESP32, PLATFORM_ESP8266):
|
||||||
file = getattr(args, "file", None)
|
file = getattr(args, "file", None)
|
||||||
return upload_using_esptool(config, host, file)
|
return upload_using_esptool(config, host, file, args.upload_speed)
|
||||||
|
|
||||||
if CORE.target_platform in (PLATFORM_RP2040):
|
if CORE.target_platform in (PLATFORM_RP2040):
|
||||||
return upload_using_platformio(config, args.device)
|
return upload_using_platformio(config, args.device)
|
||||||
|
|
||||||
if CORE.target_platform in (PLATFORM_BK72XX, PLATFORM_RTL87XX):
|
if CORE.is_libretiny:
|
||||||
return upload_using_platformio(config, host)
|
return upload_using_platformio(config, host)
|
||||||
|
|
||||||
return 1 # Unknown target platform
|
return 1 # Unknown target platform
|
||||||
@@ -375,10 +374,12 @@ def upload_program(config, args, host):
|
|||||||
password = ota_conf.get(CONF_PASSWORD, "")
|
password = ota_conf.get(CONF_PASSWORD, "")
|
||||||
|
|
||||||
if (
|
if (
|
||||||
not is_ip_address(CORE.address) # pylint: disable=too-many-boolean-expressions
|
CONF_MQTT in config # pylint: disable=too-many-boolean-expressions
|
||||||
and (get_port_type(host) == "MQTT" or config[CONF_MDNS][CONF_DISABLED])
|
|
||||||
and CONF_MQTT in config
|
|
||||||
and (not args.device or args.device in ("MQTT", "OTA"))
|
and (not args.device or args.device in ("MQTT", "OTA"))
|
||||||
|
and (
|
||||||
|
((config[CONF_MDNS][CONF_DISABLED]) and not is_ip_address(CORE.address))
|
||||||
|
or get_port_type(host) == "MQTT"
|
||||||
|
)
|
||||||
):
|
):
|
||||||
from esphome import mqtt
|
from esphome import mqtt
|
||||||
|
|
||||||
@@ -397,7 +398,7 @@ def show_logs(config, args, port):
|
|||||||
raise EsphomeError("Logger is not configured!")
|
raise EsphomeError("Logger is not configured!")
|
||||||
if get_port_type(port) == "SERIAL":
|
if get_port_type(port) == "SERIAL":
|
||||||
check_permissions(port)
|
check_permissions(port)
|
||||||
return run_miniterm(config, port)
|
return run_miniterm(config, port, args)
|
||||||
if get_port_type(port) == "NETWORK" and "api" in config:
|
if get_port_type(port) == "NETWORK" and "api" in config:
|
||||||
if config[CONF_MDNS][CONF_DISABLED] and CONF_MQTT in config:
|
if config[CONF_MDNS][CONF_DISABLED] and CONF_MQTT in config:
|
||||||
from esphome import mqtt
|
from esphome import mqtt
|
||||||
@@ -591,33 +592,38 @@ def command_update_all(args):
|
|||||||
middle_text = f" {middle_text} "
|
middle_text = f" {middle_text} "
|
||||||
width = len(click.unstyle(middle_text))
|
width = len(click.unstyle(middle_text))
|
||||||
half_line = "=" * ((twidth - width) // 2)
|
half_line = "=" * ((twidth - width) // 2)
|
||||||
click.echo(f"{half_line}{middle_text}{half_line}")
|
safe_print(f"{half_line}{middle_text}{half_line}")
|
||||||
|
|
||||||
for f in files:
|
for f in files:
|
||||||
print(f"Updating {color(Fore.CYAN, f)}")
|
safe_print(f"Updating {color(AnsiFore.CYAN, f)}")
|
||||||
print("-" * twidth)
|
safe_print("-" * twidth)
|
||||||
print()
|
safe_print()
|
||||||
rc = run_external_process(
|
if CORE.dashboard:
|
||||||
"esphome", "--dashboard", "run", f, "--no-logs", "--device", "OTA"
|
rc = run_external_process(
|
||||||
)
|
"esphome", "--dashboard", "run", f, "--no-logs", "--device", "OTA"
|
||||||
|
)
|
||||||
|
else:
|
||||||
|
rc = run_external_process(
|
||||||
|
"esphome", "run", f, "--no-logs", "--device", "OTA"
|
||||||
|
)
|
||||||
if rc == 0:
|
if rc == 0:
|
||||||
print_bar(f"[{color(Fore.BOLD_GREEN, 'SUCCESS')}] {f}")
|
print_bar(f"[{color(AnsiFore.BOLD_GREEN, 'SUCCESS')}] {f}")
|
||||||
success[f] = True
|
success[f] = True
|
||||||
else:
|
else:
|
||||||
print_bar(f"[{color(Fore.BOLD_RED, 'ERROR')}] {f}")
|
print_bar(f"[{color(AnsiFore.BOLD_RED, 'ERROR')}] {f}")
|
||||||
success[f] = False
|
success[f] = False
|
||||||
|
|
||||||
print()
|
safe_print()
|
||||||
print()
|
safe_print()
|
||||||
print()
|
safe_print()
|
||||||
|
|
||||||
print_bar(f"[{color(Fore.BOLD_WHITE, 'SUMMARY')}]")
|
print_bar(f"[{color(AnsiFore.BOLD_WHITE, 'SUMMARY')}]")
|
||||||
failed = 0
|
failed = 0
|
||||||
for f in files:
|
for f in files:
|
||||||
if success[f]:
|
if success[f]:
|
||||||
print(f" - {f}: {color(Fore.GREEN, 'SUCCESS')}")
|
safe_print(f" - {f}: {color(AnsiFore.GREEN, 'SUCCESS')}")
|
||||||
else:
|
else:
|
||||||
print(f" - {f}: {color(Fore.BOLD_RED, 'FAILED')}")
|
safe_print(f" - {f}: {color(AnsiFore.BOLD_RED, 'FAILED')}")
|
||||||
failed += 1
|
failed += 1
|
||||||
return failed
|
return failed
|
||||||
|
|
||||||
@@ -643,7 +649,7 @@ def command_rename(args, config):
|
|||||||
if c not in ALLOWED_NAME_CHARS:
|
if c not in ALLOWED_NAME_CHARS:
|
||||||
print(
|
print(
|
||||||
color(
|
color(
|
||||||
Fore.BOLD_RED,
|
AnsiFore.BOLD_RED,
|
||||||
f"'{c}' is an invalid character for names. Valid characters are: "
|
f"'{c}' is an invalid character for names. Valid characters are: "
|
||||||
f"{ALLOWED_NAME_CHARS} (lowercase, no spaces)",
|
f"{ALLOWED_NAME_CHARS} (lowercase, no spaces)",
|
||||||
)
|
)
|
||||||
@@ -656,7 +662,9 @@ def command_rename(args, config):
|
|||||||
yaml = yaml_util.load_yaml(CORE.config_path)
|
yaml = yaml_util.load_yaml(CORE.config_path)
|
||||||
if CONF_ESPHOME not in yaml or CONF_NAME not in yaml[CONF_ESPHOME]:
|
if CONF_ESPHOME not in yaml or CONF_NAME not in yaml[CONF_ESPHOME]:
|
||||||
print(
|
print(
|
||||||
color(Fore.BOLD_RED, "Complex YAML files cannot be automatically renamed.")
|
color(
|
||||||
|
AnsiFore.BOLD_RED, "Complex YAML files cannot be automatically renamed."
|
||||||
|
)
|
||||||
)
|
)
|
||||||
return 1
|
return 1
|
||||||
old_name = yaml[CONF_ESPHOME][CONF_NAME]
|
old_name = yaml[CONF_ESPHOME][CONF_NAME]
|
||||||
@@ -679,7 +687,7 @@ def command_rename(args, config):
|
|||||||
)
|
)
|
||||||
> 1
|
> 1
|
||||||
):
|
):
|
||||||
print(color(Fore.BOLD_RED, "Too many matches in YAML to safely rename"))
|
print(color(AnsiFore.BOLD_RED, "Too many matches in YAML to safely rename"))
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
new_raw = re.sub(
|
new_raw = re.sub(
|
||||||
@@ -691,7 +699,7 @@ def command_rename(args, config):
|
|||||||
|
|
||||||
new_path = os.path.join(CORE.config_dir, args.name + ".yaml")
|
new_path = os.path.join(CORE.config_dir, args.name + ".yaml")
|
||||||
print(
|
print(
|
||||||
f"Updating {color(Fore.CYAN, CORE.config_path)} to {color(Fore.CYAN, new_path)}"
|
f"Updating {color(AnsiFore.CYAN, CORE.config_path)} to {color(AnsiFore.CYAN, new_path)}"
|
||||||
)
|
)
|
||||||
print()
|
print()
|
||||||
|
|
||||||
@@ -700,7 +708,7 @@ def command_rename(args, config):
|
|||||||
|
|
||||||
rc = run_external_process("esphome", "config", new_path)
|
rc = run_external_process("esphome", "config", new_path)
|
||||||
if rc != 0:
|
if rc != 0:
|
||||||
print(color(Fore.BOLD_RED, "Rename failed. Reverting changes."))
|
print(color(AnsiFore.BOLD_RED, "Rename failed. Reverting changes."))
|
||||||
os.remove(new_path)
|
os.remove(new_path)
|
||||||
return 1
|
return 1
|
||||||
|
|
||||||
@@ -726,7 +734,7 @@ def command_rename(args, config):
|
|||||||
if CORE.config_path != new_path:
|
if CORE.config_path != new_path:
|
||||||
os.remove(CORE.config_path)
|
os.remove(CORE.config_path)
|
||||||
|
|
||||||
print(color(Fore.BOLD_GREEN, "SUCCESS"))
|
print(color(AnsiFore.BOLD_GREEN, "SUCCESS"))
|
||||||
print()
|
print()
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
@@ -842,6 +850,10 @@ def parse_args(argv):
|
|||||||
"--device",
|
"--device",
|
||||||
help="Manually specify the serial port/address to use, for example /dev/ttyUSB0.",
|
help="Manually specify the serial port/address to use, for example /dev/ttyUSB0.",
|
||||||
)
|
)
|
||||||
|
parser_upload.add_argument(
|
||||||
|
"--upload_speed",
|
||||||
|
help="Override the default or configured upload speed.",
|
||||||
|
)
|
||||||
parser_upload.add_argument(
|
parser_upload.add_argument(
|
||||||
"--file",
|
"--file",
|
||||||
help="Manually specify the binary file to upload.",
|
help="Manually specify the binary file to upload.",
|
||||||
@@ -860,6 +872,13 @@ def parse_args(argv):
|
|||||||
"--device",
|
"--device",
|
||||||
help="Manually specify the serial port/address to use, for example /dev/ttyUSB0.",
|
help="Manually specify the serial port/address to use, for example /dev/ttyUSB0.",
|
||||||
)
|
)
|
||||||
|
parser_logs.add_argument(
|
||||||
|
"--reset",
|
||||||
|
"-r",
|
||||||
|
action="store_true",
|
||||||
|
help="Reset the device before starting serial logs.",
|
||||||
|
default=os.getenv("ESPHOME_SERIAL_LOGGING_RESET"),
|
||||||
|
)
|
||||||
|
|
||||||
parser_discover = subparsers.add_parser(
|
parser_discover = subparsers.add_parser(
|
||||||
"discover",
|
"discover",
|
||||||
@@ -882,9 +901,20 @@ def parse_args(argv):
|
|||||||
"--device",
|
"--device",
|
||||||
help="Manually specify the serial port/address to use, for example /dev/ttyUSB0.",
|
help="Manually specify the serial port/address to use, for example /dev/ttyUSB0.",
|
||||||
)
|
)
|
||||||
|
parser_run.add_argument(
|
||||||
|
"--upload_speed",
|
||||||
|
help="Override the default or configured upload speed.",
|
||||||
|
)
|
||||||
parser_run.add_argument(
|
parser_run.add_argument(
|
||||||
"--no-logs", help="Disable starting logs.", action="store_true"
|
"--no-logs", help="Disable starting logs.", action="store_true"
|
||||||
)
|
)
|
||||||
|
parser_run.add_argument(
|
||||||
|
"--reset",
|
||||||
|
"-r",
|
||||||
|
action="store_true",
|
||||||
|
help="Reset the device before starting serial logs.",
|
||||||
|
default=os.getenv("ESPHOME_SERIAL_LOGGING_RESET"),
|
||||||
|
)
|
||||||
|
|
||||||
parser_clean = subparsers.add_parser(
|
parser_clean = subparsers.add_parser(
|
||||||
"clean-mqtt",
|
"clean-mqtt",
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ from esphome.cpp_generator import ( # noqa: F401
|
|||||||
TemplateArguments,
|
TemplateArguments,
|
||||||
add,
|
add,
|
||||||
add_build_flag,
|
add_build_flag,
|
||||||
|
add_build_unflag,
|
||||||
add_define,
|
add_define,
|
||||||
add_global,
|
add_global,
|
||||||
add_library,
|
add_library,
|
||||||
@@ -34,6 +35,7 @@ from esphome.cpp_generator import ( # noqa: F401
|
|||||||
process_lambda,
|
process_lambda,
|
||||||
progmem_array,
|
progmem_array,
|
||||||
safe_exp,
|
safe_exp,
|
||||||
|
set_cpp_standard,
|
||||||
statement,
|
statement,
|
||||||
static_const_array,
|
static_const_array,
|
||||||
templatable,
|
templatable,
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
from esphome.components import sensor, uart
|
from esphome.components import sensor, uart
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
|
DEVICE_CLASS_DISTANCE,
|
||||||
|
ICON_ARROW_EXPAND_VERTICAL,
|
||||||
STATE_CLASS_MEASUREMENT,
|
STATE_CLASS_MEASUREMENT,
|
||||||
UNIT_METER,
|
UNIT_METER,
|
||||||
ICON_ARROW_EXPAND_VERTICAL,
|
|
||||||
DEVICE_CLASS_DISTANCE,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
CODEOWNERS = ["@MrSuicideParrot"]
|
CODEOWNERS = ["@MrSuicideParrot"]
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
from esphome.components import sensor, uart
|
from esphome.components import sensor, uart
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
STATE_CLASS_MEASUREMENT,
|
|
||||||
ICON_ARROW_EXPAND_VERTICAL,
|
|
||||||
DEVICE_CLASS_DISTANCE,
|
DEVICE_CLASS_DISTANCE,
|
||||||
|
ICON_ARROW_EXPAND_VERTICAL,
|
||||||
|
STATE_CLASS_MEASUREMENT,
|
||||||
UNIT_MILLIMETER,
|
UNIT_MILLIMETER,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace a4988 {
|
|||||||
static const char *const TAG = "a4988.stepper";
|
static const char *const TAG = "a4988.stepper";
|
||||||
|
|
||||||
void A4988::setup() {
|
void A4988::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up A4988...");
|
ESP_LOGCONFIG(TAG, "Running setup");
|
||||||
if (this->sleep_pin_ != nullptr) {
|
if (this->sleep_pin_ != nullptr) {
|
||||||
this->sleep_pin_->setup();
|
this->sleep_pin_->setup();
|
||||||
this->sleep_pin_->digital_write(false);
|
this->sleep_pin_->digital_write(false);
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
from esphome import pins
|
from esphome import pins
|
||||||
|
import esphome.codegen as cg
|
||||||
from esphome.components import stepper
|
from esphome.components import stepper
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
import esphome.codegen as cg
|
|
||||||
from esphome.const import CONF_DIR_PIN, CONF_ID, CONF_SLEEP_PIN, CONF_STEP_PIN
|
from esphome.const import CONF_DIR_PIN, CONF_ID, CONF_SLEEP_PIN, CONF_STEP_PIN
|
||||||
|
|
||||||
|
|
||||||
a4988_ns = cg.esphome_ns.namespace("a4988")
|
a4988_ns = cg.esphome_ns.namespace("a4988")
|
||||||
A4988 = a4988_ns.class_("A4988", stepper.Stepper, cg.Component)
|
A4988 = a4988_ns.class_("A4988", stepper.Stepper, cg.Component)
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ namespace absolute_humidity {
|
|||||||
static const char *const TAG = "absolute_humidity.sensor";
|
static const char *const TAG = "absolute_humidity.sensor";
|
||||||
|
|
||||||
void AbsoluteHumidityComponent::setup() {
|
void AbsoluteHumidityComponent::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up absolute humidity '%s'...", this->get_name().c_str());
|
ESP_LOGCONFIG(TAG, "Running setup for '%s'", this->get_name().c_str());
|
||||||
|
|
||||||
ESP_LOGD(TAG, " Added callback for temperature '%s'", this->temperature_sensor_->get_name().c_str());
|
ESP_LOGD(TAG, " Added callback for temperature '%s'", this->temperature_sensor_->get_name().c_str());
|
||||||
this->temperature_sensor_->add_on_state_callback([this](float state) { this->temperature_callback_(state); });
|
this->temperature_sensor_->add_on_state_callback([this](float state) { this->temperature_callback_(state); });
|
||||||
@@ -40,9 +40,11 @@ void AbsoluteHumidityComponent::dump_config() {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGCONFIG(TAG, "Sources");
|
ESP_LOGCONFIG(TAG,
|
||||||
ESP_LOGCONFIG(TAG, " Temperature: '%s'", this->temperature_sensor_->get_name().c_str());
|
"Sources\n"
|
||||||
ESP_LOGCONFIG(TAG, " Relative Humidity: '%s'", this->humidity_sensor_->get_name().c_str());
|
" Temperature: '%s'\n"
|
||||||
|
" Relative Humidity: '%s'",
|
||||||
|
this->temperature_sensor_->get_name().c_str(), this->humidity_sensor_->get_name().c_str());
|
||||||
}
|
}
|
||||||
|
|
||||||
float AbsoluteHumidityComponent::get_setup_priority() const { return setup_priority::DATA; }
|
float AbsoluteHumidityComponent::get_setup_priority() const { return setup_priority::DATA; }
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import sensor
|
from esphome.components import sensor
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
|
CONF_EQUATION,
|
||||||
CONF_HUMIDITY,
|
CONF_HUMIDITY,
|
||||||
CONF_TEMPERATURE,
|
CONF_TEMPERATURE,
|
||||||
STATE_CLASS_MEASUREMENT,
|
|
||||||
CONF_EQUATION,
|
|
||||||
ICON_WATER,
|
ICON_WATER,
|
||||||
|
STATE_CLASS_MEASUREMENT,
|
||||||
UNIT_GRAMS_PER_CUBIC_METER,
|
UNIT_GRAMS_PER_CUBIC_METER,
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@@ -4,6 +4,7 @@
|
|||||||
#include "esphome/core/helpers.h"
|
#include "esphome/core/helpers.h"
|
||||||
#include "esphome/core/log.h"
|
#include "esphome/core/log.h"
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
#include <numbers>
|
||||||
|
|
||||||
#ifdef USE_ESP8266
|
#ifdef USE_ESP8266
|
||||||
#include <core_esp8266_waveform.h>
|
#include <core_esp8266_waveform.h>
|
||||||
@@ -114,13 +115,14 @@ void IRAM_ATTR HOT AcDimmerDataStore::gpio_intr() {
|
|||||||
// fully off, disable output immediately
|
// fully off, disable output immediately
|
||||||
this->gate_pin.digital_write(false);
|
this->gate_pin.digital_write(false);
|
||||||
} else {
|
} else {
|
||||||
|
auto min_us = this->cycle_time_us * this->min_power / 1000;
|
||||||
if (this->method == DIM_METHOD_TRAILING) {
|
if (this->method == DIM_METHOD_TRAILING) {
|
||||||
this->enable_time_us = 1; // cannot be 0
|
this->enable_time_us = 1; // cannot be 0
|
||||||
this->disable_time_us = std::max((uint32_t) 10, this->value * this->cycle_time_us / 65535);
|
// calculate time until disable in µs with integer arithmetic and take into account min_power
|
||||||
|
this->disable_time_us = std::max((uint32_t) 10, this->value * (this->cycle_time_us - min_us) / 65535 + min_us);
|
||||||
} else {
|
} else {
|
||||||
// calculate time until enable in µs: (1.0-value)*cycle_time, but with integer arithmetic
|
// calculate time until enable in µs: (1.0-value)*cycle_time, but with integer arithmetic
|
||||||
// also take into account min_power
|
// also take into account min_power
|
||||||
auto min_us = this->cycle_time_us * this->min_power / 1000;
|
|
||||||
this->enable_time_us = std::max((uint32_t) 1, ((65535 - this->value) * (this->cycle_time_us - min_us)) / 65535);
|
this->enable_time_us = std::max((uint32_t) 1, ((65535 - this->value) * (this->cycle_time_us - min_us)) / 65535);
|
||||||
|
|
||||||
if (this->method == DIM_METHOD_LEADING_PULSE) {
|
if (this->method == DIM_METHOD_LEADING_PULSE) {
|
||||||
@@ -192,18 +194,17 @@ void AcDimmer::setup() {
|
|||||||
setTimer1Callback(&timer_interrupt);
|
setTimer1Callback(&timer_interrupt);
|
||||||
#endif
|
#endif
|
||||||
#ifdef USE_ESP32
|
#ifdef USE_ESP32
|
||||||
// 80 Divider -> 1 count=1µs
|
// timer frequency of 1mhz
|
||||||
dimmer_timer = timerBegin(0, 80, true);
|
dimmer_timer = timerBegin(1000000);
|
||||||
timerAttachInterrupt(dimmer_timer, &AcDimmerDataStore::s_timer_intr, true);
|
timerAttachInterrupt(dimmer_timer, &AcDimmerDataStore::s_timer_intr);
|
||||||
// For ESP32, we can't use dynamic interval calculation because the timerX functions
|
// For ESP32, we can't use dynamic interval calculation because the timerX functions
|
||||||
// are not callable from ISR (placed in flash storage).
|
// are not callable from ISR (placed in flash storage).
|
||||||
// Here we just use an interrupt firing every 50 µs.
|
// Here we just use an interrupt firing every 50 µs.
|
||||||
timerAlarmWrite(dimmer_timer, 50, true);
|
timerAlarm(dimmer_timer, 50, true, 0);
|
||||||
timerAlarmEnable(dimmer_timer);
|
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
void AcDimmer::write_state(float state) {
|
void AcDimmer::write_state(float state) {
|
||||||
state = std::acos(1 - (2 * state)) / 3.14159; // RMS power compensation
|
state = std::acos(1 - (2 * state)) / std::numbers::pi; // RMS power compensation
|
||||||
auto new_value = static_cast<uint16_t>(roundf(state * 65535));
|
auto new_value = static_cast<uint16_t>(roundf(state * 65535));
|
||||||
if (new_value != 0 && this->store_.value == 0)
|
if (new_value != 0 && this->store_.value == 0)
|
||||||
this->store_.init_cycle = this->init_with_half_cycle_;
|
this->store_.init_cycle = this->init_with_half_cycle_;
|
||||||
@@ -213,8 +214,10 @@ void AcDimmer::dump_config() {
|
|||||||
ESP_LOGCONFIG(TAG, "AcDimmer:");
|
ESP_LOGCONFIG(TAG, "AcDimmer:");
|
||||||
LOG_PIN(" Output Pin: ", this->gate_pin_);
|
LOG_PIN(" Output Pin: ", this->gate_pin_);
|
||||||
LOG_PIN(" Zero-Cross Pin: ", this->zero_cross_pin_);
|
LOG_PIN(" Zero-Cross Pin: ", this->zero_cross_pin_);
|
||||||
ESP_LOGCONFIG(TAG, " Min Power: %.1f%%", this->store_.min_power / 10.0f);
|
ESP_LOGCONFIG(TAG,
|
||||||
ESP_LOGCONFIG(TAG, " Init with half cycle: %s", YESNO(this->init_with_half_cycle_));
|
" Min Power: %.1f%%\n"
|
||||||
|
" Init with half cycle: %s",
|
||||||
|
this->store_.min_power / 10.0f, YESNO(this->init_with_half_cycle_));
|
||||||
if (method_ == DIM_METHOD_LEADING_PULSE) {
|
if (method_ == DIM_METHOD_LEADING_PULSE) {
|
||||||
ESP_LOGCONFIG(TAG, " Method: leading pulse");
|
ESP_LOGCONFIG(TAG, " Method: leading pulse");
|
||||||
} else if (method_ == DIM_METHOD_LEADING) {
|
} else if (method_ == DIM_METHOD_LEADING) {
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome import pins
|
from esphome import pins
|
||||||
|
import esphome.codegen as cg
|
||||||
from esphome.components import output
|
from esphome.components import output
|
||||||
from esphome.const import CONF_ID, CONF_MIN_POWER, CONF_METHOD
|
import esphome.config_validation as cv
|
||||||
|
from esphome.const import CONF_ID, CONF_METHOD, CONF_MIN_POWER
|
||||||
|
|
||||||
CODEOWNERS = ["@glmnet"]
|
CODEOWNERS = ["@glmnet"]
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import uart
|
from esphome.components import uart
|
||||||
from esphome.components.light.types import AddressableLightEffect
|
|
||||||
from esphome.components.light.effects import register_addressable_effect
|
from esphome.components.light.effects import register_addressable_effect
|
||||||
|
from esphome.components.light.types import AddressableLightEffect
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import CONF_NAME, CONF_UART_ID
|
from esphome.const import CONF_NAME, CONF_UART_ID
|
||||||
|
|
||||||
DEPENDENCIES = ["uart"]
|
DEPENDENCIES = ["uart"]
|
||||||
|
|||||||
@@ -47,9 +47,10 @@ SAMPLING_MODES = {
|
|||||||
adc1_channel_t = cg.global_ns.enum("adc1_channel_t")
|
adc1_channel_t = cg.global_ns.enum("adc1_channel_t")
|
||||||
adc2_channel_t = cg.global_ns.enum("adc2_channel_t")
|
adc2_channel_t = cg.global_ns.enum("adc2_channel_t")
|
||||||
|
|
||||||
# From https://github.com/espressif/esp-idf/blob/master/components/driver/include/driver/adc_common.h
|
|
||||||
# pin to adc1 channel mapping
|
# pin to adc1 channel mapping
|
||||||
|
# https://github.com/espressif/esp-idf/blob/v4.4.8/components/driver/include/driver/adc.h
|
||||||
ESP32_VARIANT_ADC1_PIN_TO_CHANNEL = {
|
ESP32_VARIANT_ADC1_PIN_TO_CHANNEL = {
|
||||||
|
# https://github.com/espressif/esp-idf/blob/master/components/soc/esp32/include/soc/adc_channel.h
|
||||||
VARIANT_ESP32: {
|
VARIANT_ESP32: {
|
||||||
36: adc1_channel_t.ADC1_CHANNEL_0,
|
36: adc1_channel_t.ADC1_CHANNEL_0,
|
||||||
37: adc1_channel_t.ADC1_CHANNEL_1,
|
37: adc1_channel_t.ADC1_CHANNEL_1,
|
||||||
@@ -60,6 +61,41 @@ ESP32_VARIANT_ADC1_PIN_TO_CHANNEL = {
|
|||||||
34: adc1_channel_t.ADC1_CHANNEL_6,
|
34: adc1_channel_t.ADC1_CHANNEL_6,
|
||||||
35: adc1_channel_t.ADC1_CHANNEL_7,
|
35: adc1_channel_t.ADC1_CHANNEL_7,
|
||||||
},
|
},
|
||||||
|
# https://github.com/espressif/esp-idf/blob/master/components/soc/esp32c2/include/soc/adc_channel.h
|
||||||
|
VARIANT_ESP32C2: {
|
||||||
|
0: adc1_channel_t.ADC1_CHANNEL_0,
|
||||||
|
1: adc1_channel_t.ADC1_CHANNEL_1,
|
||||||
|
2: adc1_channel_t.ADC1_CHANNEL_2,
|
||||||
|
3: adc1_channel_t.ADC1_CHANNEL_3,
|
||||||
|
4: adc1_channel_t.ADC1_CHANNEL_4,
|
||||||
|
},
|
||||||
|
# https://github.com/espressif/esp-idf/blob/master/components/soc/esp32c3/include/soc/adc_channel.h
|
||||||
|
VARIANT_ESP32C3: {
|
||||||
|
0: adc1_channel_t.ADC1_CHANNEL_0,
|
||||||
|
1: adc1_channel_t.ADC1_CHANNEL_1,
|
||||||
|
2: adc1_channel_t.ADC1_CHANNEL_2,
|
||||||
|
3: adc1_channel_t.ADC1_CHANNEL_3,
|
||||||
|
4: adc1_channel_t.ADC1_CHANNEL_4,
|
||||||
|
},
|
||||||
|
# https://github.com/espressif/esp-idf/blob/master/components/soc/esp32c6/include/soc/adc_channel.h
|
||||||
|
VARIANT_ESP32C6: {
|
||||||
|
0: adc1_channel_t.ADC1_CHANNEL_0,
|
||||||
|
1: adc1_channel_t.ADC1_CHANNEL_1,
|
||||||
|
2: adc1_channel_t.ADC1_CHANNEL_2,
|
||||||
|
3: adc1_channel_t.ADC1_CHANNEL_3,
|
||||||
|
4: adc1_channel_t.ADC1_CHANNEL_4,
|
||||||
|
5: adc1_channel_t.ADC1_CHANNEL_5,
|
||||||
|
6: adc1_channel_t.ADC1_CHANNEL_6,
|
||||||
|
},
|
||||||
|
# https://github.com/espressif/esp-idf/blob/master/components/soc/esp32h2/include/soc/adc_channel.h
|
||||||
|
VARIANT_ESP32H2: {
|
||||||
|
1: adc1_channel_t.ADC1_CHANNEL_0,
|
||||||
|
2: adc1_channel_t.ADC1_CHANNEL_1,
|
||||||
|
3: adc1_channel_t.ADC1_CHANNEL_2,
|
||||||
|
4: adc1_channel_t.ADC1_CHANNEL_3,
|
||||||
|
5: adc1_channel_t.ADC1_CHANNEL_4,
|
||||||
|
},
|
||||||
|
# https://github.com/espressif/esp-idf/blob/master/components/soc/esp32s2/include/soc/adc_channel.h
|
||||||
VARIANT_ESP32S2: {
|
VARIANT_ESP32S2: {
|
||||||
1: adc1_channel_t.ADC1_CHANNEL_0,
|
1: adc1_channel_t.ADC1_CHANNEL_0,
|
||||||
2: adc1_channel_t.ADC1_CHANNEL_1,
|
2: adc1_channel_t.ADC1_CHANNEL_1,
|
||||||
@@ -72,6 +108,7 @@ ESP32_VARIANT_ADC1_PIN_TO_CHANNEL = {
|
|||||||
9: adc1_channel_t.ADC1_CHANNEL_8,
|
9: adc1_channel_t.ADC1_CHANNEL_8,
|
||||||
10: adc1_channel_t.ADC1_CHANNEL_9,
|
10: adc1_channel_t.ADC1_CHANNEL_9,
|
||||||
},
|
},
|
||||||
|
# https://github.com/espressif/esp-idf/blob/master/components/soc/esp32s3/include/soc/adc_channel.h
|
||||||
VARIANT_ESP32S3: {
|
VARIANT_ESP32S3: {
|
||||||
1: adc1_channel_t.ADC1_CHANNEL_0,
|
1: adc1_channel_t.ADC1_CHANNEL_0,
|
||||||
2: adc1_channel_t.ADC1_CHANNEL_1,
|
2: adc1_channel_t.ADC1_CHANNEL_1,
|
||||||
@@ -84,40 +121,12 @@ ESP32_VARIANT_ADC1_PIN_TO_CHANNEL = {
|
|||||||
9: adc1_channel_t.ADC1_CHANNEL_8,
|
9: adc1_channel_t.ADC1_CHANNEL_8,
|
||||||
10: adc1_channel_t.ADC1_CHANNEL_9,
|
10: adc1_channel_t.ADC1_CHANNEL_9,
|
||||||
},
|
},
|
||||||
VARIANT_ESP32C3: {
|
|
||||||
0: adc1_channel_t.ADC1_CHANNEL_0,
|
|
||||||
1: adc1_channel_t.ADC1_CHANNEL_1,
|
|
||||||
2: adc1_channel_t.ADC1_CHANNEL_2,
|
|
||||||
3: adc1_channel_t.ADC1_CHANNEL_3,
|
|
||||||
4: adc1_channel_t.ADC1_CHANNEL_4,
|
|
||||||
},
|
|
||||||
VARIANT_ESP32C2: {
|
|
||||||
0: adc1_channel_t.ADC1_CHANNEL_0,
|
|
||||||
1: adc1_channel_t.ADC1_CHANNEL_1,
|
|
||||||
2: adc1_channel_t.ADC1_CHANNEL_2,
|
|
||||||
3: adc1_channel_t.ADC1_CHANNEL_3,
|
|
||||||
4: adc1_channel_t.ADC1_CHANNEL_4,
|
|
||||||
},
|
|
||||||
VARIANT_ESP32C6: {
|
|
||||||
0: adc1_channel_t.ADC1_CHANNEL_0,
|
|
||||||
1: adc1_channel_t.ADC1_CHANNEL_1,
|
|
||||||
2: adc1_channel_t.ADC1_CHANNEL_2,
|
|
||||||
3: adc1_channel_t.ADC1_CHANNEL_3,
|
|
||||||
4: adc1_channel_t.ADC1_CHANNEL_4,
|
|
||||||
5: adc1_channel_t.ADC1_CHANNEL_5,
|
|
||||||
6: adc1_channel_t.ADC1_CHANNEL_6,
|
|
||||||
},
|
|
||||||
VARIANT_ESP32H2: {
|
|
||||||
1: adc1_channel_t.ADC1_CHANNEL_0,
|
|
||||||
2: adc1_channel_t.ADC1_CHANNEL_1,
|
|
||||||
3: adc1_channel_t.ADC1_CHANNEL_2,
|
|
||||||
4: adc1_channel_t.ADC1_CHANNEL_3,
|
|
||||||
5: adc1_channel_t.ADC1_CHANNEL_4,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# pin to adc2 channel mapping
|
||||||
|
# https://github.com/espressif/esp-idf/blob/v4.4.8/components/driver/include/driver/adc.h
|
||||||
ESP32_VARIANT_ADC2_PIN_TO_CHANNEL = {
|
ESP32_VARIANT_ADC2_PIN_TO_CHANNEL = {
|
||||||
# TODO: add other variants
|
# https://github.com/espressif/esp-idf/blob/master/components/soc/esp32/include/soc/adc_channel.h
|
||||||
VARIANT_ESP32: {
|
VARIANT_ESP32: {
|
||||||
4: adc2_channel_t.ADC2_CHANNEL_0,
|
4: adc2_channel_t.ADC2_CHANNEL_0,
|
||||||
0: adc2_channel_t.ADC2_CHANNEL_1,
|
0: adc2_channel_t.ADC2_CHANNEL_1,
|
||||||
@@ -130,6 +139,19 @@ ESP32_VARIANT_ADC2_PIN_TO_CHANNEL = {
|
|||||||
25: adc2_channel_t.ADC2_CHANNEL_8,
|
25: adc2_channel_t.ADC2_CHANNEL_8,
|
||||||
26: adc2_channel_t.ADC2_CHANNEL_9,
|
26: adc2_channel_t.ADC2_CHANNEL_9,
|
||||||
},
|
},
|
||||||
|
# https://github.com/espressif/esp-idf/blob/master/components/soc/esp32c2/include/soc/adc_channel.h
|
||||||
|
VARIANT_ESP32C2: {
|
||||||
|
5: adc2_channel_t.ADC2_CHANNEL_0,
|
||||||
|
},
|
||||||
|
# https://github.com/espressif/esp-idf/blob/master/components/soc/esp32c3/include/soc/adc_channel.h
|
||||||
|
VARIANT_ESP32C3: {
|
||||||
|
5: adc2_channel_t.ADC2_CHANNEL_0,
|
||||||
|
},
|
||||||
|
# https://github.com/espressif/esp-idf/blob/master/components/soc/esp32c6/include/soc/adc_channel.h
|
||||||
|
VARIANT_ESP32C6: {}, # no ADC2
|
||||||
|
# https://github.com/espressif/esp-idf/blob/master/components/soc/esp32h2/include/soc/adc_channel.h
|
||||||
|
VARIANT_ESP32H2: {}, # no ADC2
|
||||||
|
# https://github.com/espressif/esp-idf/blob/master/components/soc/esp32s2/include/soc/adc_channel.h
|
||||||
VARIANT_ESP32S2: {
|
VARIANT_ESP32S2: {
|
||||||
11: adc2_channel_t.ADC2_CHANNEL_0,
|
11: adc2_channel_t.ADC2_CHANNEL_0,
|
||||||
12: adc2_channel_t.ADC2_CHANNEL_1,
|
12: adc2_channel_t.ADC2_CHANNEL_1,
|
||||||
@@ -142,6 +164,7 @@ ESP32_VARIANT_ADC2_PIN_TO_CHANNEL = {
|
|||||||
19: adc2_channel_t.ADC2_CHANNEL_8,
|
19: adc2_channel_t.ADC2_CHANNEL_8,
|
||||||
20: adc2_channel_t.ADC2_CHANNEL_9,
|
20: adc2_channel_t.ADC2_CHANNEL_9,
|
||||||
},
|
},
|
||||||
|
# https://github.com/espressif/esp-idf/blob/master/components/soc/esp32s3/include/soc/adc_channel.h
|
||||||
VARIANT_ESP32S3: {
|
VARIANT_ESP32S3: {
|
||||||
11: adc2_channel_t.ADC2_CHANNEL_0,
|
11: adc2_channel_t.ADC2_CHANNEL_0,
|
||||||
12: adc2_channel_t.ADC2_CHANNEL_1,
|
12: adc2_channel_t.ADC2_CHANNEL_1,
|
||||||
@@ -154,12 +177,6 @@ ESP32_VARIANT_ADC2_PIN_TO_CHANNEL = {
|
|||||||
19: adc2_channel_t.ADC2_CHANNEL_8,
|
19: adc2_channel_t.ADC2_CHANNEL_8,
|
||||||
20: adc2_channel_t.ADC2_CHANNEL_9,
|
20: adc2_channel_t.ADC2_CHANNEL_9,
|
||||||
},
|
},
|
||||||
VARIANT_ESP32C3: {
|
|
||||||
5: adc2_channel_t.ADC2_CHANNEL_0,
|
|
||||||
},
|
|
||||||
VARIANT_ESP32C2: {},
|
|
||||||
VARIANT_ESP32C6: {},
|
|
||||||
VARIANT_ESP32H2: {},
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,8 +15,7 @@ namespace adc {
|
|||||||
|
|
||||||
#ifdef USE_ESP32
|
#ifdef USE_ESP32
|
||||||
// clang-format off
|
// clang-format off
|
||||||
#if (ESP_IDF_VERSION_MAJOR == 4 && ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 7)) || \
|
#if (ESP_IDF_VERSION_MAJOR == 5 && \
|
||||||
(ESP_IDF_VERSION_MAJOR == 5 && \
|
|
||||||
((ESP_IDF_VERSION_MINOR == 0 && ESP_IDF_VERSION_PATCH >= 5) || \
|
((ESP_IDF_VERSION_MINOR == 0 && ESP_IDF_VERSION_PATCH >= 5) || \
|
||||||
(ESP_IDF_VERSION_MINOR == 1 && ESP_IDF_VERSION_PATCH >= 3) || \
|
(ESP_IDF_VERSION_MINOR == 1 && ESP_IDF_VERSION_PATCH >= 3) || \
|
||||||
(ESP_IDF_VERSION_MINOR >= 2)) \
|
(ESP_IDF_VERSION_MINOR >= 2)) \
|
||||||
@@ -28,19 +27,24 @@ static const adc_atten_t ADC_ATTEN_DB_12_COMPAT = ADC_ATTEN_DB_11;
|
|||||||
#endif
|
#endif
|
||||||
#endif // USE_ESP32
|
#endif // USE_ESP32
|
||||||
|
|
||||||
enum class SamplingMode : uint8_t { AVG = 0, MIN = 1, MAX = 2 };
|
enum class SamplingMode : uint8_t {
|
||||||
|
AVG = 0,
|
||||||
|
MIN = 1,
|
||||||
|
MAX = 2,
|
||||||
|
};
|
||||||
|
|
||||||
const LogString *sampling_mode_to_str(SamplingMode mode);
|
const LogString *sampling_mode_to_str(SamplingMode mode);
|
||||||
|
|
||||||
class Aggregator {
|
class Aggregator {
|
||||||
public:
|
public:
|
||||||
|
Aggregator(SamplingMode mode);
|
||||||
void add_sample(uint32_t value);
|
void add_sample(uint32_t value);
|
||||||
uint32_t aggregate();
|
uint32_t aggregate();
|
||||||
Aggregator(SamplingMode mode);
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
SamplingMode mode_{SamplingMode::AVG};
|
|
||||||
uint32_t aggr_{0};
|
uint32_t aggr_{0};
|
||||||
uint32_t samples_{0};
|
uint32_t samples_{0};
|
||||||
|
SamplingMode mode_{SamplingMode::AVG};
|
||||||
};
|
};
|
||||||
|
|
||||||
class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage_sampler::VoltageSampler {
|
class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage_sampler::VoltageSampler {
|
||||||
@@ -81,9 +85,9 @@ class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage
|
|||||||
#endif // USE_RP2040
|
#endif // USE_RP2040
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
InternalGPIOPin *pin_;
|
|
||||||
bool output_raw_{false};
|
|
||||||
uint8_t sample_count_{1};
|
uint8_t sample_count_{1};
|
||||||
|
bool output_raw_{false};
|
||||||
|
InternalGPIOPin *pin_;
|
||||||
SamplingMode sampling_mode_{SamplingMode::AVG};
|
SamplingMode sampling_mode_{SamplingMode::AVG};
|
||||||
|
|
||||||
#ifdef USE_RP2040
|
#ifdef USE_RP2040
|
||||||
@@ -95,11 +99,7 @@ class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage
|
|||||||
adc1_channel_t channel1_{ADC1_CHANNEL_MAX};
|
adc1_channel_t channel1_{ADC1_CHANNEL_MAX};
|
||||||
adc2_channel_t channel2_{ADC2_CHANNEL_MAX};
|
adc2_channel_t channel2_{ADC2_CHANNEL_MAX};
|
||||||
bool autorange_{false};
|
bool autorange_{false};
|
||||||
#if ESP_IDF_VERSION_MAJOR >= 5
|
|
||||||
esp_adc_cal_characteristics_t cal_characteristics_[SOC_ADC_ATTEN_NUM] = {};
|
esp_adc_cal_characteristics_t cal_characteristics_[SOC_ADC_ATTEN_NUM] = {};
|
||||||
#else
|
|
||||||
esp_adc_cal_characteristics_t cal_characteristics_[ADC_ATTEN_MAX] = {};
|
|
||||||
#endif // ESP_IDF_VERSION_MAJOR
|
|
||||||
#endif // USE_ESP32
|
#endif // USE_ESP32
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ uint32_t Aggregator::aggregate() {
|
|||||||
|
|
||||||
void ADCSensor::update() {
|
void ADCSensor::update() {
|
||||||
float value_v = this->sample();
|
float value_v = this->sample();
|
||||||
ESP_LOGV(TAG, "'%s': Got voltage=%.4fV", this->get_name().c_str(), value_v);
|
ESP_LOGV(TAG, "'%s': Voltage=%.4fV", this->get_name().c_str(), value_v);
|
||||||
this->publish_state(value_v);
|
this->publish_state(value_v);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -22,7 +22,7 @@ static const int ADC_MAX = (1 << SOC_ADC_RTC_MAX_BITWIDTH) - 1;
|
|||||||
static const int ADC_HALF = (1 << SOC_ADC_RTC_MAX_BITWIDTH) >> 1;
|
static const int ADC_HALF = (1 << SOC_ADC_RTC_MAX_BITWIDTH) >> 1;
|
||||||
|
|
||||||
void ADCSensor::setup() {
|
void ADCSensor::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up ADC '%s'...", this->get_name().c_str());
|
ESP_LOGCONFIG(TAG, "Running setup for '%s'", this->get_name().c_str());
|
||||||
|
|
||||||
if (this->channel1_ != ADC1_CHANNEL_MAX) {
|
if (this->channel1_ != ADC1_CHANNEL_MAX) {
|
||||||
adc1_config_width(ADC_WIDTH_MAX_SOC_BITS);
|
adc1_config_width(ADC_WIDTH_MAX_SOC_BITS);
|
||||||
@@ -55,30 +55,40 @@ void ADCSensor::setup() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ADCSensor::dump_config() {
|
void ADCSensor::dump_config() {
|
||||||
|
static const char *const ATTEN_AUTO_STR = "auto";
|
||||||
|
static const char *const ATTEN_0DB_STR = "0 db";
|
||||||
|
static const char *const ATTEN_2_5DB_STR = "2.5 db";
|
||||||
|
static const char *const ATTEN_6DB_STR = "6 db";
|
||||||
|
static const char *const ATTEN_12DB_STR = "12 db";
|
||||||
|
const char *atten_str = ATTEN_AUTO_STR;
|
||||||
|
|
||||||
LOG_SENSOR("", "ADC Sensor", this);
|
LOG_SENSOR("", "ADC Sensor", this);
|
||||||
LOG_PIN(" Pin: ", this->pin_);
|
LOG_PIN(" Pin: ", this->pin_);
|
||||||
if (this->autorange_) {
|
|
||||||
ESP_LOGCONFIG(TAG, " Attenuation: auto");
|
if (!this->autorange_) {
|
||||||
} else {
|
|
||||||
switch (this->attenuation_) {
|
switch (this->attenuation_) {
|
||||||
case ADC_ATTEN_DB_0:
|
case ADC_ATTEN_DB_0:
|
||||||
ESP_LOGCONFIG(TAG, " Attenuation: 0db");
|
atten_str = ATTEN_0DB_STR;
|
||||||
break;
|
break;
|
||||||
case ADC_ATTEN_DB_2_5:
|
case ADC_ATTEN_DB_2_5:
|
||||||
ESP_LOGCONFIG(TAG, " Attenuation: 2.5db");
|
atten_str = ATTEN_2_5DB_STR;
|
||||||
break;
|
break;
|
||||||
case ADC_ATTEN_DB_6:
|
case ADC_ATTEN_DB_6:
|
||||||
ESP_LOGCONFIG(TAG, " Attenuation: 6db");
|
atten_str = ATTEN_6DB_STR;
|
||||||
break;
|
break;
|
||||||
case ADC_ATTEN_DB_12_COMPAT:
|
case ADC_ATTEN_DB_12_COMPAT:
|
||||||
ESP_LOGCONFIG(TAG, " Attenuation: 12db");
|
atten_str = ATTEN_12DB_STR;
|
||||||
break;
|
break;
|
||||||
default: // This is to satisfy the unused ADC_ATTEN_MAX
|
default: // This is to satisfy the unused ADC_ATTEN_MAX
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ESP_LOGCONFIG(TAG, " Samples: %i", this->sample_count_);
|
|
||||||
ESP_LOGCONFIG(TAG, " Sampling mode: %s", LOG_STR_ARG(sampling_mode_to_str(this->sampling_mode_)));
|
ESP_LOGCONFIG(TAG,
|
||||||
|
" Attenuation: %s\n"
|
||||||
|
" Samples: %i\n"
|
||||||
|
" Sampling mode: %s",
|
||||||
|
atten_str, this->sample_count_, LOG_STR_ARG(sampling_mode_to_str(this->sampling_mode_)));
|
||||||
LOG_UPDATE_INTERVAL(this);
|
LOG_UPDATE_INTERVAL(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace adc {
|
|||||||
static const char *const TAG = "adc.esp8266";
|
static const char *const TAG = "adc.esp8266";
|
||||||
|
|
||||||
void ADCSensor::setup() {
|
void ADCSensor::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up ADC '%s'...", this->get_name().c_str());
|
ESP_LOGCONFIG(TAG, "Running setup for '%s'", this->get_name().c_str());
|
||||||
#ifndef USE_ADC_SENSOR_VCC
|
#ifndef USE_ADC_SENSOR_VCC
|
||||||
this->pin_->setup();
|
this->pin_->setup();
|
||||||
#endif
|
#endif
|
||||||
@@ -30,8 +30,10 @@ void ADCSensor::dump_config() {
|
|||||||
#else
|
#else
|
||||||
LOG_PIN(" Pin: ", this->pin_);
|
LOG_PIN(" Pin: ", this->pin_);
|
||||||
#endif // USE_ADC_SENSOR_VCC
|
#endif // USE_ADC_SENSOR_VCC
|
||||||
ESP_LOGCONFIG(TAG, " Samples: %i", this->sample_count_);
|
ESP_LOGCONFIG(TAG,
|
||||||
ESP_LOGCONFIG(TAG, " Sampling mode: %s", LOG_STR_ARG(sampling_mode_to_str(this->sampling_mode_)));
|
" Samples: %i\n"
|
||||||
|
" Sampling mode: %s",
|
||||||
|
this->sample_count_, LOG_STR_ARG(sampling_mode_to_str(this->sampling_mode_)));
|
||||||
LOG_UPDATE_INTERVAL(this);
|
LOG_UPDATE_INTERVAL(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ namespace adc {
|
|||||||
static const char *const TAG = "adc.libretiny";
|
static const char *const TAG = "adc.libretiny";
|
||||||
|
|
||||||
void ADCSensor::setup() {
|
void ADCSensor::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up ADC '%s'...", this->get_name().c_str());
|
ESP_LOGCONFIG(TAG, "Running setup for '%s'", this->get_name().c_str());
|
||||||
#ifndef USE_ADC_SENSOR_VCC
|
#ifndef USE_ADC_SENSOR_VCC
|
||||||
this->pin_->setup();
|
this->pin_->setup();
|
||||||
#endif // !USE_ADC_SENSOR_VCC
|
#endif // !USE_ADC_SENSOR_VCC
|
||||||
@@ -22,8 +22,10 @@ void ADCSensor::dump_config() {
|
|||||||
#else // USE_ADC_SENSOR_VCC
|
#else // USE_ADC_SENSOR_VCC
|
||||||
LOG_PIN(" Pin: ", this->pin_);
|
LOG_PIN(" Pin: ", this->pin_);
|
||||||
#endif // USE_ADC_SENSOR_VCC
|
#endif // USE_ADC_SENSOR_VCC
|
||||||
ESP_LOGCONFIG(TAG, " Samples: %i", this->sample_count_);
|
ESP_LOGCONFIG(TAG,
|
||||||
ESP_LOGCONFIG(TAG, " Sampling mode: %s", LOG_STR_ARG(sampling_mode_to_str(this->sampling_mode_)));
|
" Samples: %i\n"
|
||||||
|
" Sampling mode: %s",
|
||||||
|
this->sample_count_, LOG_STR_ARG(sampling_mode_to_str(this->sampling_mode_)));
|
||||||
LOG_UPDATE_INTERVAL(this);
|
LOG_UPDATE_INTERVAL(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ namespace adc {
|
|||||||
static const char *const TAG = "adc.rp2040";
|
static const char *const TAG = "adc.rp2040";
|
||||||
|
|
||||||
void ADCSensor::setup() {
|
void ADCSensor::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up ADC '%s'...", this->get_name().c_str());
|
ESP_LOGCONFIG(TAG, "Running setup for '%s'", this->get_name().c_str());
|
||||||
static bool initialized = false;
|
static bool initialized = false;
|
||||||
if (!initialized) {
|
if (!initialized) {
|
||||||
adc_init();
|
adc_init();
|
||||||
@@ -33,8 +33,10 @@ void ADCSensor::dump_config() {
|
|||||||
LOG_PIN(" Pin: ", this->pin_);
|
LOG_PIN(" Pin: ", this->pin_);
|
||||||
#endif // USE_ADC_SENSOR_VCC
|
#endif // USE_ADC_SENSOR_VCC
|
||||||
}
|
}
|
||||||
ESP_LOGCONFIG(TAG, " Samples: %i", this->sample_count_);
|
ESP_LOGCONFIG(TAG,
|
||||||
ESP_LOGCONFIG(TAG, " Sampling mode: %s", LOG_STR_ARG(sampling_mode_to_str(this->sampling_mode_)));
|
" Samples: %i\n"
|
||||||
|
" Sampling mode: %s",
|
||||||
|
this->sample_count_, LOG_STR_ARG(sampling_mode_to_str(this->sampling_mode_)));
|
||||||
LOG_UPDATE_INTERVAL(this);
|
LOG_UPDATE_INTERVAL(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import spi
|
from esphome.components import spi
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import CONF_ID
|
from esphome.const import CONF_ID
|
||||||
|
|
||||||
DEPENDENCIES = ["spi"]
|
DEPENDENCIES = ["spi"]
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ static const char *const TAG = "adc128s102";
|
|||||||
float ADC128S102::get_setup_priority() const { return setup_priority::HARDWARE; }
|
float ADC128S102::get_setup_priority() const { return setup_priority::HARDWARE; }
|
||||||
|
|
||||||
void ADC128S102::setup() {
|
void ADC128S102::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up adc128s102");
|
ESP_LOGCONFIG(TAG, "Running setup");
|
||||||
this->spi_setup();
|
this->spi_setup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import sensor, voltage_sampler
|
from esphome.components import sensor, voltage_sampler
|
||||||
from esphome.const import CONF_ID, CONF_CHANNEL
|
import esphome.config_validation as cv
|
||||||
|
from esphome.const import CONF_CHANNEL, CONF_ID
|
||||||
|
|
||||||
from .. import adc128s102_ns, ADC128S102
|
from .. import ADC128S102, adc128s102_ns
|
||||||
|
|
||||||
AUTO_LOAD = ["voltage_sampler"]
|
AUTO_LOAD = ["voltage_sampler"]
|
||||||
DEPENDENCIES = ["adc128s102"]
|
DEPENDENCIES = ["adc128s102"]
|
||||||
|
|||||||
@@ -1,15 +1,15 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import display, light
|
from esphome.components import display, light
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
|
CONF_ADDRESSABLE_LIGHT_ID,
|
||||||
|
CONF_HEIGHT,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
CONF_LAMBDA,
|
CONF_LAMBDA,
|
||||||
CONF_PAGES,
|
CONF_PAGES,
|
||||||
CONF_ADDRESSABLE_LIGHT_ID,
|
|
||||||
CONF_HEIGHT,
|
|
||||||
CONF_WIDTH,
|
|
||||||
CONF_UPDATE_INTERVAL,
|
|
||||||
CONF_PIXEL_MAPPER,
|
CONF_PIXEL_MAPPER,
|
||||||
|
CONF_UPDATE_INTERVAL,
|
||||||
|
CONF_WIDTH,
|
||||||
)
|
)
|
||||||
|
|
||||||
CODEOWNERS = ["@justfalter"]
|
CODEOWNERS = ["@justfalter"]
|
||||||
|
|||||||
@@ -177,11 +177,14 @@ void ADE7880::dump_config() {
|
|||||||
LOG_SENSOR(" ", "Power Factor", this->channel_a_->power_factor);
|
LOG_SENSOR(" ", "Power Factor", this->channel_a_->power_factor);
|
||||||
LOG_SENSOR(" ", "Forward Active Energy", this->channel_a_->forward_active_energy);
|
LOG_SENSOR(" ", "Forward Active Energy", this->channel_a_->forward_active_energy);
|
||||||
LOG_SENSOR(" ", "Reverse Active Energy", this->channel_a_->reverse_active_energy);
|
LOG_SENSOR(" ", "Reverse Active Energy", this->channel_a_->reverse_active_energy);
|
||||||
ESP_LOGCONFIG(TAG, " Calibration:");
|
ESP_LOGCONFIG(TAG,
|
||||||
ESP_LOGCONFIG(TAG, " Current: %" PRId32, this->channel_a_->current_gain_calibration);
|
" Calibration:\n"
|
||||||
ESP_LOGCONFIG(TAG, " Voltage: %" PRId32, this->channel_a_->voltage_gain_calibration);
|
" Current: %" PRId32 "\n"
|
||||||
ESP_LOGCONFIG(TAG, " Power: %" PRId32, this->channel_a_->power_gain_calibration);
|
" Voltage: %" PRId32 "\n"
|
||||||
ESP_LOGCONFIG(TAG, " Phase Angle: %u", this->channel_a_->phase_angle_calibration);
|
" Power: %" PRId32 "\n"
|
||||||
|
" Phase Angle: %u",
|
||||||
|
this->channel_a_->current_gain_calibration, this->channel_a_->voltage_gain_calibration,
|
||||||
|
this->channel_a_->power_gain_calibration, this->channel_a_->phase_angle_calibration);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->channel_b_ != nullptr) {
|
if (this->channel_b_ != nullptr) {
|
||||||
@@ -193,11 +196,14 @@ void ADE7880::dump_config() {
|
|||||||
LOG_SENSOR(" ", "Power Factor", this->channel_b_->power_factor);
|
LOG_SENSOR(" ", "Power Factor", this->channel_b_->power_factor);
|
||||||
LOG_SENSOR(" ", "Forward Active Energy", this->channel_b_->forward_active_energy);
|
LOG_SENSOR(" ", "Forward Active Energy", this->channel_b_->forward_active_energy);
|
||||||
LOG_SENSOR(" ", "Reverse Active Energy", this->channel_b_->reverse_active_energy);
|
LOG_SENSOR(" ", "Reverse Active Energy", this->channel_b_->reverse_active_energy);
|
||||||
ESP_LOGCONFIG(TAG, " Calibration:");
|
ESP_LOGCONFIG(TAG,
|
||||||
ESP_LOGCONFIG(TAG, " Current: %" PRId32, this->channel_b_->current_gain_calibration);
|
" Calibration:\n"
|
||||||
ESP_LOGCONFIG(TAG, " Voltage: %" PRId32, this->channel_b_->voltage_gain_calibration);
|
" Current: %" PRId32 "\n"
|
||||||
ESP_LOGCONFIG(TAG, " Power: %" PRId32, this->channel_b_->power_gain_calibration);
|
" Voltage: %" PRId32 "\n"
|
||||||
ESP_LOGCONFIG(TAG, " Phase Angle: %u", this->channel_b_->phase_angle_calibration);
|
" Power: %" PRId32 "\n"
|
||||||
|
" Phase Angle: %u",
|
||||||
|
this->channel_b_->current_gain_calibration, this->channel_b_->voltage_gain_calibration,
|
||||||
|
this->channel_b_->power_gain_calibration, this->channel_b_->phase_angle_calibration);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->channel_c_ != nullptr) {
|
if (this->channel_c_ != nullptr) {
|
||||||
@@ -209,18 +215,23 @@ void ADE7880::dump_config() {
|
|||||||
LOG_SENSOR(" ", "Power Factor", this->channel_c_->power_factor);
|
LOG_SENSOR(" ", "Power Factor", this->channel_c_->power_factor);
|
||||||
LOG_SENSOR(" ", "Forward Active Energy", this->channel_c_->forward_active_energy);
|
LOG_SENSOR(" ", "Forward Active Energy", this->channel_c_->forward_active_energy);
|
||||||
LOG_SENSOR(" ", "Reverse Active Energy", this->channel_c_->reverse_active_energy);
|
LOG_SENSOR(" ", "Reverse Active Energy", this->channel_c_->reverse_active_energy);
|
||||||
ESP_LOGCONFIG(TAG, " Calibration:");
|
ESP_LOGCONFIG(TAG,
|
||||||
ESP_LOGCONFIG(TAG, " Current: %" PRId32, this->channel_c_->current_gain_calibration);
|
" Calibration:\n"
|
||||||
ESP_LOGCONFIG(TAG, " Voltage: %" PRId32, this->channel_c_->voltage_gain_calibration);
|
" Current: %" PRId32 "\n"
|
||||||
ESP_LOGCONFIG(TAG, " Power: %" PRId32, this->channel_c_->power_gain_calibration);
|
" Voltage: %" PRId32 "\n"
|
||||||
ESP_LOGCONFIG(TAG, " Phase Angle: %u", this->channel_c_->phase_angle_calibration);
|
" Power: %" PRId32 "\n"
|
||||||
|
" Phase Angle: %u",
|
||||||
|
this->channel_c_->current_gain_calibration, this->channel_c_->voltage_gain_calibration,
|
||||||
|
this->channel_c_->power_gain_calibration, this->channel_c_->phase_angle_calibration);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (this->channel_n_ != nullptr) {
|
if (this->channel_n_ != nullptr) {
|
||||||
ESP_LOGCONFIG(TAG, " Neutral:");
|
ESP_LOGCONFIG(TAG, " Neutral:");
|
||||||
LOG_SENSOR(" ", "Current", this->channel_n_->current);
|
LOG_SENSOR(" ", "Current", this->channel_n_->current);
|
||||||
ESP_LOGCONFIG(TAG, " Calibration:");
|
ESP_LOGCONFIG(TAG,
|
||||||
ESP_LOGCONFIG(TAG, " Current: %" PRId32, this->channel_n_->current_gain_calibration);
|
" Calibration:\n"
|
||||||
|
" Current: %" PRId32,
|
||||||
|
this->channel_n_->current_gain_calibration);
|
||||||
}
|
}
|
||||||
|
|
||||||
LOG_I2C_DEVICE(this);
|
LOG_I2C_DEVICE(this);
|
||||||
|
|||||||
@@ -85,8 +85,6 @@ class ADE7880 : public i2c::I2CDevice, public PollingComponent {
|
|||||||
|
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
|
|
||||||
float get_setup_priority() const override { return setup_priority::DATA; }
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
ADE7880Store store_{};
|
ADE7880Store store_{};
|
||||||
InternalGPIOPin *irq0_pin_{nullptr};
|
InternalGPIOPin *irq0_pin_{nullptr};
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import sensor, i2c
|
|
||||||
from esphome import pins
|
from esphome import pins
|
||||||
|
import esphome.codegen as cg
|
||||||
|
from esphome.components import i2c, sensor
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_ACTIVE_POWER,
|
CONF_ACTIVE_POWER,
|
||||||
CONF_APPARENT_POWER,
|
CONF_APPARENT_POWER,
|
||||||
|
|||||||
@@ -1,27 +1,27 @@
|
|||||||
import esphome.codegen as cg
|
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import sensor
|
|
||||||
from esphome import pins
|
from esphome import pins
|
||||||
|
import esphome.codegen as cg
|
||||||
|
from esphome.components import sensor
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
|
CONF_FREQUENCY,
|
||||||
CONF_IRQ_PIN,
|
CONF_IRQ_PIN,
|
||||||
CONF_VOLTAGE,
|
CONF_VOLTAGE,
|
||||||
CONF_FREQUENCY,
|
|
||||||
CONF_VOLTAGE_GAIN,
|
CONF_VOLTAGE_GAIN,
|
||||||
DEVICE_CLASS_CURRENT,
|
|
||||||
DEVICE_CLASS_APPARENT_POWER,
|
DEVICE_CLASS_APPARENT_POWER,
|
||||||
DEVICE_CLASS_POWER,
|
DEVICE_CLASS_CURRENT,
|
||||||
DEVICE_CLASS_REACTIVE_POWER,
|
|
||||||
DEVICE_CLASS_POWER_FACTOR,
|
|
||||||
DEVICE_CLASS_VOLTAGE,
|
|
||||||
DEVICE_CLASS_FREQUENCY,
|
DEVICE_CLASS_FREQUENCY,
|
||||||
|
DEVICE_CLASS_POWER,
|
||||||
|
DEVICE_CLASS_POWER_FACTOR,
|
||||||
|
DEVICE_CLASS_REACTIVE_POWER,
|
||||||
|
DEVICE_CLASS_VOLTAGE,
|
||||||
STATE_CLASS_MEASUREMENT,
|
STATE_CLASS_MEASUREMENT,
|
||||||
UNIT_VOLT,
|
|
||||||
UNIT_HERTZ,
|
|
||||||
UNIT_AMPERE,
|
UNIT_AMPERE,
|
||||||
UNIT_VOLT_AMPS,
|
UNIT_HERTZ,
|
||||||
UNIT_WATT,
|
|
||||||
UNIT_VOLT_AMPS_REACTIVE,
|
|
||||||
UNIT_PERCENT,
|
UNIT_PERCENT,
|
||||||
|
UNIT_VOLT,
|
||||||
|
UNIT_VOLT_AMPS,
|
||||||
|
UNIT_VOLT_AMPS_REACTIVE,
|
||||||
|
UNIT_WATT,
|
||||||
)
|
)
|
||||||
|
|
||||||
CONF_CURRENT_A = "current_a"
|
CONF_CURRENT_A = "current_a"
|
||||||
|
|||||||
@@ -58,15 +58,18 @@ void ADE7953::dump_config() {
|
|||||||
LOG_SENSOR(" ", "Active Power B Sensor", this->active_power_b_sensor_);
|
LOG_SENSOR(" ", "Active Power B Sensor", this->active_power_b_sensor_);
|
||||||
LOG_SENSOR(" ", "Rective Power A Sensor", this->reactive_power_a_sensor_);
|
LOG_SENSOR(" ", "Rective Power A Sensor", this->reactive_power_a_sensor_);
|
||||||
LOG_SENSOR(" ", "Reactive Power B Sensor", this->reactive_power_b_sensor_);
|
LOG_SENSOR(" ", "Reactive Power B Sensor", this->reactive_power_b_sensor_);
|
||||||
ESP_LOGCONFIG(TAG, " USE_ACC_ENERGY_REGS: %d", this->use_acc_energy_regs_);
|
ESP_LOGCONFIG(TAG,
|
||||||
ESP_LOGCONFIG(TAG, " PGA_V_8: 0x%X", pga_v_);
|
" USE_ACC_ENERGY_REGS: %d\n"
|
||||||
ESP_LOGCONFIG(TAG, " PGA_IA_8: 0x%X", pga_ia_);
|
" PGA_V_8: 0x%X\n"
|
||||||
ESP_LOGCONFIG(TAG, " PGA_IB_8: 0x%X", pga_ib_);
|
" PGA_IA_8: 0x%X\n"
|
||||||
ESP_LOGCONFIG(TAG, " VGAIN_32: 0x%08jX", (uintmax_t) vgain_);
|
" PGA_IB_8: 0x%X\n"
|
||||||
ESP_LOGCONFIG(TAG, " AIGAIN_32: 0x%08jX", (uintmax_t) aigain_);
|
" VGAIN_32: 0x%08jX\n"
|
||||||
ESP_LOGCONFIG(TAG, " BIGAIN_32: 0x%08jX", (uintmax_t) bigain_);
|
" AIGAIN_32: 0x%08jX\n"
|
||||||
ESP_LOGCONFIG(TAG, " AWGAIN_32: 0x%08jX", (uintmax_t) awgain_);
|
" BIGAIN_32: 0x%08jX\n"
|
||||||
ESP_LOGCONFIG(TAG, " BWGAIN_32: 0x%08jX", (uintmax_t) bwgain_);
|
" AWGAIN_32: 0x%08jX\n"
|
||||||
|
" BWGAIN_32: 0x%08jX",
|
||||||
|
this->use_acc_energy_regs_, pga_v_, pga_ia_, pga_ib_, (uintmax_t) vgain_, (uintmax_t) aigain_,
|
||||||
|
(uintmax_t) bigain_, (uintmax_t) awgain_, (uintmax_t) bwgain_);
|
||||||
}
|
}
|
||||||
|
|
||||||
#define ADE_PUBLISH_(name, val, factor) \
|
#define ADE_PUBLISH_(name, val, factor) \
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "ade7953_i2c.h"
|
#include "ade7953_i2c.h"
|
||||||
#include "esphome/core/log.h"
|
|
||||||
#include "esphome/core/helpers.h"
|
#include "esphome/core/helpers.h"
|
||||||
|
#include "esphome/core/log.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace ade7953_i2c {
|
namespace ade7953_i2c {
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
|
from esphome.components import ade7953_base, i2c
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.components import i2c, ade7953_base
|
|
||||||
from esphome.const import CONF_ID
|
from esphome.const import CONF_ID
|
||||||
|
|
||||||
|
|
||||||
DEPENDENCIES = ["i2c"]
|
DEPENDENCIES = ["i2c"]
|
||||||
AUTO_LOAD = ["ade7953_base"]
|
AUTO_LOAD = ["ade7953_base"]
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#include "ade7953_spi.h"
|
#include "ade7953_spi.h"
|
||||||
#include "esphome/core/log.h"
|
|
||||||
#include "esphome/core/helpers.h"
|
#include "esphome/core/helpers.h"
|
||||||
|
#include "esphome/core/log.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace ade7953_spi {
|
namespace ade7953_spi {
|
||||||
|
|||||||
@@ -1,9 +1,8 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
|
from esphome.components import ade7953_base, spi
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.components import spi, ade7953_base
|
|
||||||
from esphome.const import CONF_ID
|
from esphome.const import CONF_ID
|
||||||
|
|
||||||
|
|
||||||
DEPENDENCIES = ["spi"]
|
DEPENDENCIES = ["spi"]
|
||||||
AUTO_LOAD = ["ade7953_base"]
|
AUTO_LOAD = ["ade7953_base"]
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import i2c
|
from esphome.components import i2c
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import CONF_ID
|
from esphome.const import CONF_ID
|
||||||
|
|
||||||
DEPENDENCIES = ["i2c"]
|
DEPENDENCIES = ["i2c"]
|
||||||
|
|||||||
@@ -10,15 +10,13 @@ static const uint8_t ADS1115_REGISTER_CONVERSION = 0x00;
|
|||||||
static const uint8_t ADS1115_REGISTER_CONFIG = 0x01;
|
static const uint8_t ADS1115_REGISTER_CONFIG = 0x01;
|
||||||
|
|
||||||
void ADS1115Component::setup() {
|
void ADS1115Component::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up ADS1115...");
|
ESP_LOGCONFIG(TAG, "Running setup");
|
||||||
uint16_t value;
|
uint16_t value;
|
||||||
if (!this->read_byte_16(ADS1115_REGISTER_CONVERSION, &value)) {
|
if (!this->read_byte_16(ADS1115_REGISTER_CONVERSION, &value)) {
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGCONFIG(TAG, "Configuring ADS1115...");
|
|
||||||
|
|
||||||
uint16_t config = 0;
|
uint16_t config = 0;
|
||||||
// Clear single-shot bit
|
// Clear single-shot bit
|
||||||
// 0b0xxxxxxxxxxxxxxx
|
// 0b0xxxxxxxxxxxxxxx
|
||||||
@@ -68,10 +66,10 @@ void ADS1115Component::setup() {
|
|||||||
this->prev_config_ = config;
|
this->prev_config_ = config;
|
||||||
}
|
}
|
||||||
void ADS1115Component::dump_config() {
|
void ADS1115Component::dump_config() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up ADS1115...");
|
ESP_LOGCONFIG(TAG, "ADS1115:");
|
||||||
LOG_I2C_DEVICE(this);
|
LOG_I2C_DEVICE(this);
|
||||||
if (this->is_failed()) {
|
if (this->is_failed()) {
|
||||||
ESP_LOGE(TAG, "Communication with ADS1115 failed!");
|
ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
float ADS1115Component::request_measurement(ADS1115Multiplexer multiplexer, ADS1115Gain gain,
|
float ADS1115Component::request_measurement(ADS1115Multiplexer multiplexer, ADS1115Gain gain,
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ class ADS1115Component : public Component, public i2c::I2CDevice {
|
|||||||
void setup() override;
|
void setup() override;
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
/// HARDWARE_LATE setup priority
|
/// HARDWARE_LATE setup priority
|
||||||
float get_setup_priority() const override { return setup_priority::DATA; }
|
|
||||||
void set_continuous_mode(bool continuous_mode) { continuous_mode_ = continuous_mode; }
|
void set_continuous_mode(bool continuous_mode) { continuous_mode_ = continuous_mode; }
|
||||||
|
|
||||||
/// Helper method to request a measurement from a sensor.
|
/// Helper method to request a measurement from a sensor.
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import sensor, voltage_sampler
|
from esphome.components import sensor, voltage_sampler
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_GAIN,
|
CONF_GAIN,
|
||||||
|
CONF_ID,
|
||||||
CONF_MULTIPLEXER,
|
CONF_MULTIPLEXER,
|
||||||
CONF_RESOLUTION,
|
CONF_RESOLUTION,
|
||||||
CONF_SAMPLE_RATE,
|
CONF_SAMPLE_RATE,
|
||||||
DEVICE_CLASS_VOLTAGE,
|
DEVICE_CLASS_VOLTAGE,
|
||||||
STATE_CLASS_MEASUREMENT,
|
STATE_CLASS_MEASUREMENT,
|
||||||
UNIT_VOLT,
|
UNIT_VOLT,
|
||||||
CONF_ID,
|
|
||||||
)
|
)
|
||||||
from .. import ads1115_ns, ADS1115Component, CONF_ADS1115_ID
|
|
||||||
|
from .. import CONF_ADS1115_ID, ADS1115Component, ads1115_ns
|
||||||
|
|
||||||
AUTO_LOAD = ["voltage_sampler"]
|
AUTO_LOAD = ["voltage_sampler"]
|
||||||
DEPENDENCIES = ["ads1115"]
|
DEPENDENCIES = ["ads1115"]
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import spi
|
from esphome.components import spi
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import CONF_ID
|
from esphome.const import CONF_ID
|
||||||
|
|
||||||
CODEOWNERS = ["@solomondg1"]
|
CODEOWNERS = ["@solomondg1"]
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "ads1118.h"
|
#include "ads1118.h"
|
||||||
|
#include "esphome/core/helpers.h"
|
||||||
#include "esphome/core/log.h"
|
#include "esphome/core/log.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
@@ -8,7 +9,7 @@ static const char *const TAG = "ads1118";
|
|||||||
static const uint8_t ADS1118_DATA_RATE_860_SPS = 0b111;
|
static const uint8_t ADS1118_DATA_RATE_860_SPS = 0b111;
|
||||||
|
|
||||||
void ADS1118::setup() {
|
void ADS1118::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up ads1118");
|
ESP_LOGCONFIG(TAG, "Running setup");
|
||||||
this->spi_setup();
|
this->spi_setup();
|
||||||
|
|
||||||
this->config_ = 0;
|
this->config_ = 0;
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ class ADS1118 : public Component,
|
|||||||
ADS1118() = default;
|
ADS1118() = default;
|
||||||
void setup() override;
|
void setup() override;
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
float get_setup_priority() const override { return setup_priority::DATA; }
|
|
||||||
/// Helper method to request a measurement from a sensor.
|
/// Helper method to request a measurement from a sensor.
|
||||||
float request_measurement(ADS1118Multiplexer multiplexer, ADS1118Gain gain, bool temperature_mode);
|
float request_measurement(ADS1118Multiplexer multiplexer, ADS1118Gain gain, bool temperature_mode);
|
||||||
|
|
||||||
|
|||||||
@@ -1,17 +1,18 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import sensor, voltage_sampler
|
from esphome.components import sensor, voltage_sampler
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_GAIN,
|
CONF_GAIN,
|
||||||
CONF_MULTIPLEXER,
|
CONF_MULTIPLEXER,
|
||||||
DEVICE_CLASS_VOLTAGE,
|
CONF_TYPE,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
DEVICE_CLASS_TEMPERATURE,
|
||||||
|
DEVICE_CLASS_VOLTAGE,
|
||||||
STATE_CLASS_MEASUREMENT,
|
STATE_CLASS_MEASUREMENT,
|
||||||
UNIT_CELSIUS,
|
UNIT_CELSIUS,
|
||||||
UNIT_VOLT,
|
UNIT_VOLT,
|
||||||
CONF_TYPE,
|
|
||||||
)
|
)
|
||||||
from .. import ads1118_ns, ADS1118, CONF_ADS1118_ID
|
|
||||||
|
from .. import ADS1118, CONF_ADS1118_ID, ads1118_ns
|
||||||
|
|
||||||
AUTO_LOAD = ["voltage_sampler"]
|
AUTO_LOAD = ["voltage_sampler"]
|
||||||
DEPENDENCIES = ["ads1118"]
|
DEPENDENCIES = ["ads1118"]
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
#include "ags10.h"
|
#include "ags10.h"
|
||||||
|
#include "esphome/core/helpers.h"
|
||||||
|
|
||||||
#include <cinttypes>
|
#include <cinttypes>
|
||||||
|
|
||||||
@@ -23,7 +24,7 @@ static const uint16_t ZP_CURRENT = 0x0000;
|
|||||||
static const uint16_t ZP_DEFAULT = 0xFFFF;
|
static const uint16_t ZP_DEFAULT = 0xFFFF;
|
||||||
|
|
||||||
void AGS10Component::setup() {
|
void AGS10Component::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up ags10...");
|
ESP_LOGCONFIG(TAG, "Running setup");
|
||||||
|
|
||||||
auto version = this->read_version_();
|
auto version = this->read_version_();
|
||||||
if (version) {
|
if (version) {
|
||||||
@@ -65,7 +66,7 @@ void AGS10Component::dump_config() {
|
|||||||
case NONE:
|
case NONE:
|
||||||
break;
|
break;
|
||||||
case COMMUNICATION_FAILED:
|
case COMMUNICATION_FAILED:
|
||||||
ESP_LOGE(TAG, "Communication with AGS10 failed!");
|
ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL);
|
||||||
break;
|
break;
|
||||||
case CRC_CHECK_FAILED:
|
case CRC_CHECK_FAILED:
|
||||||
ESP_LOGE(TAG, "The crc check failed");
|
ESP_LOGE(TAG, "The crc check failed");
|
||||||
|
|||||||
@@ -31,8 +31,6 @@ class AGS10Component : public PollingComponent, public i2c::I2CDevice {
|
|||||||
|
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
|
|
||||||
float get_setup_priority() const override { return setup_priority::DATA; }
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Modifies target address of AGS10.
|
* Modifies target address of AGS10.
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -1,21 +1,21 @@
|
|||||||
import esphome.codegen as cg
|
|
||||||
from esphome import automation
|
from esphome import automation
|
||||||
import esphome.config_validation as cv
|
import esphome.codegen as cg
|
||||||
from esphome.components import i2c, sensor
|
from esphome.components import i2c, sensor
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
|
CONF_ADDRESS,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
ICON_RADIATOR,
|
CONF_MODE,
|
||||||
ICON_RESTART,
|
CONF_TVOC,
|
||||||
|
CONF_VALUE,
|
||||||
|
CONF_VERSION,
|
||||||
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
|
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
|
||||||
ENTITY_CATEGORY_DIAGNOSTIC,
|
ENTITY_CATEGORY_DIAGNOSTIC,
|
||||||
|
ICON_RADIATOR,
|
||||||
|
ICON_RESTART,
|
||||||
STATE_CLASS_MEASUREMENT,
|
STATE_CLASS_MEASUREMENT,
|
||||||
UNIT_OHM,
|
UNIT_OHM,
|
||||||
UNIT_PARTS_PER_BILLION,
|
UNIT_PARTS_PER_BILLION,
|
||||||
CONF_ADDRESS,
|
|
||||||
CONF_TVOC,
|
|
||||||
CONF_VERSION,
|
|
||||||
CONF_MODE,
|
|
||||||
CONF_VALUE,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
CONF_RESISTANCE = "resistance"
|
CONF_RESISTANCE = "resistance"
|
||||||
|
|||||||
@@ -13,8 +13,9 @@
|
|||||||
// results making successive requests; the current implementation makes 3 attempts with a delay of 30ms each time.
|
// results making successive requests; the current implementation makes 3 attempts with a delay of 30ms each time.
|
||||||
|
|
||||||
#include "aht10.h"
|
#include "aht10.h"
|
||||||
#include "esphome/core/log.h"
|
|
||||||
#include "esphome/core/hal.h"
|
#include "esphome/core/hal.h"
|
||||||
|
#include "esphome/core/helpers.h"
|
||||||
|
#include "esphome/core/log.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace aht10 {
|
namespace aht10 {
|
||||||
@@ -34,57 +35,59 @@ static const uint8_t AHT10_INIT_ATTEMPTS = 10;
|
|||||||
|
|
||||||
static const uint8_t AHT10_STATUS_BUSY = 0x80;
|
static const uint8_t AHT10_STATUS_BUSY = 0x80;
|
||||||
|
|
||||||
|
static const float AHT10_DIVISOR = 1048576.0f; // 2^20, used for temperature and humidity calculations
|
||||||
|
|
||||||
void AHT10Component::setup() {
|
void AHT10Component::setup() {
|
||||||
|
ESP_LOGCONFIG(TAG, "Running setup");
|
||||||
|
|
||||||
if (this->write(AHT10_SOFTRESET_CMD, sizeof(AHT10_SOFTRESET_CMD)) != i2c::ERROR_OK) {
|
if (this->write(AHT10_SOFTRESET_CMD, sizeof(AHT10_SOFTRESET_CMD)) != i2c::ERROR_OK) {
|
||||||
ESP_LOGE(TAG, "Reset AHT10 failed!");
|
ESP_LOGE(TAG, "Reset failed");
|
||||||
}
|
}
|
||||||
delay(AHT10_SOFTRESET_DELAY);
|
delay(AHT10_SOFTRESET_DELAY);
|
||||||
|
|
||||||
i2c::ErrorCode error_code = i2c::ERROR_INVALID_ARGUMENT;
|
i2c::ErrorCode error_code = i2c::ERROR_INVALID_ARGUMENT;
|
||||||
switch (this->variant_) {
|
switch (this->variant_) {
|
||||||
case AHT10Variant::AHT20:
|
case AHT10Variant::AHT20:
|
||||||
ESP_LOGCONFIG(TAG, "Setting up AHT20");
|
|
||||||
error_code = this->write(AHT20_INITIALIZE_CMD, sizeof(AHT20_INITIALIZE_CMD));
|
error_code = this->write(AHT20_INITIALIZE_CMD, sizeof(AHT20_INITIALIZE_CMD));
|
||||||
break;
|
break;
|
||||||
case AHT10Variant::AHT10:
|
case AHT10Variant::AHT10:
|
||||||
ESP_LOGCONFIG(TAG, "Setting up AHT10");
|
|
||||||
error_code = this->write(AHT10_INITIALIZE_CMD, sizeof(AHT10_INITIALIZE_CMD));
|
error_code = this->write(AHT10_INITIALIZE_CMD, sizeof(AHT10_INITIALIZE_CMD));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (error_code != i2c::ERROR_OK) {
|
if (error_code != i2c::ERROR_OK) {
|
||||||
ESP_LOGE(TAG, "Communication with AHT10 failed!");
|
ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL);
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
uint8_t cal_attempts = 0;
|
||||||
uint8_t data = AHT10_STATUS_BUSY;
|
uint8_t data = AHT10_STATUS_BUSY;
|
||||||
int cal_attempts = 0;
|
|
||||||
while (data & AHT10_STATUS_BUSY) {
|
while (data & AHT10_STATUS_BUSY) {
|
||||||
delay(AHT10_DEFAULT_DELAY);
|
delay(AHT10_DEFAULT_DELAY);
|
||||||
if (this->read(&data, 1) != i2c::ERROR_OK) {
|
if (this->read(&data, 1) != i2c::ERROR_OK) {
|
||||||
ESP_LOGE(TAG, "Communication with AHT10 failed!");
|
ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL);
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
++cal_attempts;
|
++cal_attempts;
|
||||||
if (cal_attempts > AHT10_INIT_ATTEMPTS) {
|
if (cal_attempts > AHT10_INIT_ATTEMPTS) {
|
||||||
ESP_LOGE(TAG, "AHT10 initialization timed out!");
|
ESP_LOGE(TAG, "Initialization timed out");
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ((data & 0x68) != 0x08) { // Bit[6:5] = 0b00, NORMAL mode and Bit[3] = 0b1, CALIBRATED
|
if ((data & 0x68) != 0x08) { // Bit[6:5] = 0b00, NORMAL mode and Bit[3] = 0b1, CALIBRATED
|
||||||
ESP_LOGE(TAG, "AHT10 initialization failed!");
|
ESP_LOGE(TAG, "Initialization failed");
|
||||||
this->mark_failed();
|
this->mark_failed();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGV(TAG, "AHT10 initialization");
|
ESP_LOGV(TAG, "Initialization complete");
|
||||||
}
|
}
|
||||||
|
|
||||||
void AHT10Component::restart_read_() {
|
void AHT10Component::restart_read_() {
|
||||||
if (this->read_count_ == AHT10_ATTEMPTS) {
|
if (this->read_count_ == AHT10_ATTEMPTS) {
|
||||||
this->read_count_ = 0;
|
this->read_count_ = 0;
|
||||||
this->status_set_error("Measurements reading timed-out!");
|
this->status_set_error("Reading timed out");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->read_count_++;
|
this->read_count_++;
|
||||||
@@ -97,24 +100,24 @@ void AHT10Component::read_data_() {
|
|||||||
ESP_LOGD(TAG, "Read attempt %d at %ums", this->read_count_, (unsigned) (millis() - this->start_time_));
|
ESP_LOGD(TAG, "Read attempt %d at %ums", this->read_count_, (unsigned) (millis() - this->start_time_));
|
||||||
}
|
}
|
||||||
if (this->read(data, 6) != i2c::ERROR_OK) {
|
if (this->read(data, 6) != i2c::ERROR_OK) {
|
||||||
this->status_set_warning("AHT10 read failed, retrying soon");
|
this->status_set_warning("Read failed, will retry");
|
||||||
this->restart_read_();
|
this->restart_read_();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((data[0] & 0x80) == 0x80) { // Bit[7] = 0b1, device is busy
|
if ((data[0] & 0x80) == 0x80) { // Bit[7] = 0b1, device is busy
|
||||||
ESP_LOGD(TAG, "AHT10 is busy, waiting...");
|
ESP_LOGD(TAG, "Device busy, will retry");
|
||||||
this->restart_read_();
|
this->restart_read_();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (data[1] == 0x0 && data[2] == 0x0 && (data[3] >> 4) == 0x0) {
|
if (data[1] == 0x0 && data[2] == 0x0 && (data[3] >> 4) == 0x0) {
|
||||||
// Unrealistic humidity (0x0)
|
// Invalid humidity (0x0)
|
||||||
if (this->humidity_sensor_ == nullptr) {
|
if (this->humidity_sensor_ == nullptr) {
|
||||||
ESP_LOGV(TAG, "ATH10 Unrealistic humidity (0x0), but humidity is not required");
|
ESP_LOGV(TAG, "Invalid humidity (reading not required)");
|
||||||
} else {
|
} else {
|
||||||
ESP_LOGD(TAG, "ATH10 Unrealistic humidity (0x0), retrying...");
|
ESP_LOGD(TAG, "Invalid humidity, retrying");
|
||||||
if (this->write(AHT10_MEASURE_CMD, sizeof(AHT10_MEASURE_CMD)) != i2c::ERROR_OK) {
|
if (this->write(AHT10_MEASURE_CMD, sizeof(AHT10_MEASURE_CMD)) != i2c::ERROR_OK) {
|
||||||
this->status_set_warning("Communication with AHT10 failed!");
|
this->status_set_warning(ESP_LOG_MSG_COMM_FAIL);
|
||||||
}
|
}
|
||||||
this->restart_read_();
|
this->restart_read_();
|
||||||
return;
|
return;
|
||||||
@@ -123,22 +126,17 @@ void AHT10Component::read_data_() {
|
|||||||
if (this->read_count_ > 1) {
|
if (this->read_count_ > 1) {
|
||||||
ESP_LOGD(TAG, "Success at %ums", (unsigned) (millis() - this->start_time_));
|
ESP_LOGD(TAG, "Success at %ums", (unsigned) (millis() - this->start_time_));
|
||||||
}
|
}
|
||||||
uint32_t raw_temperature = ((data[3] & 0x0F) << 16) | (data[4] << 8) | data[5];
|
uint32_t raw_temperature = encode_uint24(data[3] & 0xF, data[4], data[5]);
|
||||||
uint32_t raw_humidity = ((data[1] << 16) | (data[2] << 8) | data[3]) >> 4;
|
uint32_t raw_humidity = encode_uint24(data[1], data[2], data[3]) >> 4;
|
||||||
|
|
||||||
if (this->temperature_sensor_ != nullptr) {
|
if (this->temperature_sensor_ != nullptr) {
|
||||||
float temperature = ((200.0f * (float) raw_temperature) / 1048576.0f) - 50.0f;
|
float temperature = ((200.0f * static_cast<float>(raw_temperature)) / AHT10_DIVISOR) - 50.0f;
|
||||||
this->temperature_sensor_->publish_state(temperature);
|
this->temperature_sensor_->publish_state(temperature);
|
||||||
}
|
}
|
||||||
if (this->humidity_sensor_ != nullptr) {
|
if (this->humidity_sensor_ != nullptr) {
|
||||||
float humidity;
|
float humidity = raw_humidity == 0 ? NAN : static_cast<float>(raw_humidity) * 100.0f / AHT10_DIVISOR;
|
||||||
if (raw_humidity == 0) { // unrealistic value
|
|
||||||
humidity = NAN;
|
|
||||||
} else {
|
|
||||||
humidity = (float) raw_humidity * 100.0f / 1048576.0f;
|
|
||||||
}
|
|
||||||
if (std::isnan(humidity)) {
|
if (std::isnan(humidity)) {
|
||||||
ESP_LOGW(TAG, "Invalid humidity! Sensor reported 0%% Hum");
|
ESP_LOGW(TAG, "Invalid humidity reading (0%%), ");
|
||||||
}
|
}
|
||||||
this->humidity_sensor_->publish_state(humidity);
|
this->humidity_sensor_->publish_state(humidity);
|
||||||
}
|
}
|
||||||
@@ -150,7 +148,7 @@ void AHT10Component::update() {
|
|||||||
return;
|
return;
|
||||||
this->start_time_ = millis();
|
this->start_time_ = millis();
|
||||||
if (this->write(AHT10_MEASURE_CMD, sizeof(AHT10_MEASURE_CMD)) != i2c::ERROR_OK) {
|
if (this->write(AHT10_MEASURE_CMD, sizeof(AHT10_MEASURE_CMD)) != i2c::ERROR_OK) {
|
||||||
this->status_set_warning("Communication with AHT10 failed!");
|
this->status_set_warning(ESP_LOG_MSG_COMM_FAIL);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this->restart_read_();
|
this->restart_read_();
|
||||||
@@ -162,7 +160,7 @@ void AHT10Component::dump_config() {
|
|||||||
ESP_LOGCONFIG(TAG, "AHT10:");
|
ESP_LOGCONFIG(TAG, "AHT10:");
|
||||||
LOG_I2C_DEVICE(this);
|
LOG_I2C_DEVICE(this);
|
||||||
if (this->is_failed()) {
|
if (this->is_failed()) {
|
||||||
ESP_LOGE(TAG, "Communication with AHT10 failed!");
|
ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL);
|
||||||
}
|
}
|
||||||
LOG_SENSOR(" ", "Temperature", this->temperature_sensor_);
|
LOG_SENSOR(" ", "Temperature", this->temperature_sensor_);
|
||||||
LOG_SENSOR(" ", "Humidity", this->humidity_sensor_);
|
LOG_SENSOR(" ", "Humidity", this->humidity_sensor_);
|
||||||
|
|||||||
@@ -1,16 +1,16 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import i2c, sensor
|
from esphome.components import i2c, sensor
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_HUMIDITY,
|
CONF_HUMIDITY,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
CONF_TEMPERATURE,
|
CONF_TEMPERATURE,
|
||||||
|
CONF_VARIANT,
|
||||||
DEVICE_CLASS_HUMIDITY,
|
DEVICE_CLASS_HUMIDITY,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
DEVICE_CLASS_TEMPERATURE,
|
||||||
STATE_CLASS_MEASUREMENT,
|
STATE_CLASS_MEASUREMENT,
|
||||||
UNIT_CELSIUS,
|
UNIT_CELSIUS,
|
||||||
UNIT_PERCENT,
|
UNIT_PERCENT,
|
||||||
CONF_VARIANT,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
DEPENDENCIES = ["i2c"]
|
DEPENDENCIES = ["i2c"]
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ static const char *const TAG = "aic3204";
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AIC3204::setup() {
|
void AIC3204::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up AIC3204...");
|
ESP_LOGCONFIG(TAG, "Running setup");
|
||||||
|
|
||||||
// Set register page to 0
|
// Set register page to 0
|
||||||
ERROR_CHECK(this->write_byte(AIC3204_PAGE_CTRL, 0x00), "Set page 0 failed");
|
ERROR_CHECK(this->write_byte(AIC3204_PAGE_CTRL, 0x00), "Set page 0 failed");
|
||||||
@@ -113,7 +113,7 @@ void AIC3204::dump_config() {
|
|||||||
LOG_I2C_DEVICE(this);
|
LOG_I2C_DEVICE(this);
|
||||||
|
|
||||||
if (this->is_failed()) {
|
if (this->is_failed()) {
|
||||||
ESP_LOGE(TAG, "Communication with AIC3204 failed");
|
ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ class AIC3204 : public audio_dac::AudioDac, public Component, public i2c::I2CDev
|
|||||||
public:
|
public:
|
||||||
void setup() override;
|
void setup() override;
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
float get_setup_priority() const override { return setup_priority::DATA; }
|
|
||||||
|
|
||||||
bool set_mute_off() override;
|
bool set_mute_off() override;
|
||||||
bool set_mute_on() override;
|
bool set_mute_on() override;
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import esp32_ble_tracker
|
from esphome.components import esp32_ble_tracker
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import CONF_ID
|
from esphome.const import CONF_ID
|
||||||
|
|
||||||
DEPENDENCIES = ["esp32_ble_tracker"]
|
DEPENDENCIES = ["esp32_ble_tracker"]
|
||||||
|
|||||||
@@ -1,18 +1,17 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
|
from esphome.components import ble_client, sensor
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.components import sensor, ble_client
|
|
||||||
|
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_BATTERY_VOLTAGE,
|
CONF_BATTERY_VOLTAGE,
|
||||||
CONF_HUMIDITY,
|
CONF_HUMIDITY,
|
||||||
CONF_PRESSURE,
|
CONF_PRESSURE,
|
||||||
CONF_TEMPERATURE,
|
CONF_TEMPERATURE,
|
||||||
CONF_TVOC,
|
CONF_TVOC,
|
||||||
DEVICE_CLASS_VOLTAGE,
|
|
||||||
DEVICE_CLASS_HUMIDITY,
|
DEVICE_CLASS_HUMIDITY,
|
||||||
DEVICE_CLASS_PRESSURE,
|
DEVICE_CLASS_PRESSURE,
|
||||||
DEVICE_CLASS_TEMPERATURE,
|
DEVICE_CLASS_TEMPERATURE,
|
||||||
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
|
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS,
|
||||||
|
DEVICE_CLASS_VOLTAGE,
|
||||||
ENTITY_CATEGORY_DIAGNOSTIC,
|
ENTITY_CATEGORY_DIAGNOSTIC,
|
||||||
STATE_CLASS_MEASUREMENT,
|
STATE_CLASS_MEASUREMENT,
|
||||||
UNIT_CELSIUS,
|
UNIT_CELSIUS,
|
||||||
@@ -35,7 +34,7 @@ AirthingsWaveBase = airthings_wave_base_ns.class_(
|
|||||||
|
|
||||||
|
|
||||||
BASE_SCHEMA = (
|
BASE_SCHEMA = (
|
||||||
sensor.SENSOR_SCHEMA.extend(
|
cv.Schema(
|
||||||
{
|
{
|
||||||
cv.Optional(CONF_HUMIDITY): sensor.sensor_schema(
|
cv.Optional(CONF_HUMIDITY): sensor.sensor_schema(
|
||||||
unit_of_measurement=UNIT_PERCENT,
|
unit_of_measurement=UNIT_PERCENT,
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import airthings_wave_base
|
from esphome.components import airthings_wave_base
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import CONF_ID
|
||||||
CONF_ID,
|
|
||||||
)
|
|
||||||
|
|
||||||
DEPENDENCIES = airthings_wave_base.DEPENDENCIES
|
DEPENDENCIES = airthings_wave_base.DEPENDENCIES
|
||||||
|
|
||||||
|
|||||||
@@ -1,20 +1,19 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
|
from esphome.components import airthings_wave_base, sensor
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.components import sensor, airthings_wave_base
|
|
||||||
|
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
DEVICE_CLASS_CARBON_DIOXIDE,
|
CONF_CO2,
|
||||||
STATE_CLASS_MEASUREMENT,
|
|
||||||
ICON_RADIOACTIVE,
|
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
|
CONF_ILLUMINANCE,
|
||||||
CONF_RADON,
|
CONF_RADON,
|
||||||
CONF_RADON_LONG_TERM,
|
CONF_RADON_LONG_TERM,
|
||||||
CONF_CO2,
|
DEVICE_CLASS_CARBON_DIOXIDE,
|
||||||
UNIT_BECQUEREL_PER_CUBIC_METER,
|
|
||||||
UNIT_PARTS_PER_MILLION,
|
|
||||||
CONF_ILLUMINANCE,
|
|
||||||
UNIT_LUX,
|
|
||||||
DEVICE_CLASS_ILLUMINANCE,
|
DEVICE_CLASS_ILLUMINANCE,
|
||||||
|
ICON_RADIOACTIVE,
|
||||||
|
STATE_CLASS_MEASUREMENT,
|
||||||
|
UNIT_BECQUEREL_PER_CUBIC_METER,
|
||||||
|
UNIT_LUX,
|
||||||
|
UNIT_PARTS_PER_MILLION,
|
||||||
)
|
)
|
||||||
|
|
||||||
DEPENDENCIES = airthings_wave_base.DEPENDENCIES
|
DEPENDENCIES = airthings_wave_base.DEPENDENCIES
|
||||||
|
|||||||
@@ -5,6 +5,8 @@ from esphome.components import mqtt, web_server
|
|||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_CODE,
|
CONF_CODE,
|
||||||
|
CONF_ENTITY_CATEGORY,
|
||||||
|
CONF_ICON,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
CONF_MQTT_ID,
|
CONF_MQTT_ID,
|
||||||
CONF_ON_STATE,
|
CONF_ON_STATE,
|
||||||
@@ -12,7 +14,8 @@ from esphome.const import (
|
|||||||
CONF_WEB_SERVER,
|
CONF_WEB_SERVER,
|
||||||
)
|
)
|
||||||
from esphome.core import CORE, coroutine_with_priority
|
from esphome.core import CORE, coroutine_with_priority
|
||||||
from esphome.cpp_helpers import setup_entity
|
from esphome.core.entity_helpers import entity_duplicate_validator, setup_entity
|
||||||
|
from esphome.cpp_generator import MockObjClass
|
||||||
|
|
||||||
CODEOWNERS = ["@grahambrown11", "@hwstar"]
|
CODEOWNERS = ["@grahambrown11", "@hwstar"]
|
||||||
IS_PLATFORM_COMPONENT = True
|
IS_PLATFORM_COMPONENT = True
|
||||||
@@ -78,12 +81,11 @@ AlarmControlPanelCondition = alarm_control_panel_ns.class_(
|
|||||||
"AlarmControlPanelCondition", automation.Condition
|
"AlarmControlPanelCondition", automation.Condition
|
||||||
)
|
)
|
||||||
|
|
||||||
ALARM_CONTROL_PANEL_SCHEMA = (
|
_ALARM_CONTROL_PANEL_SCHEMA = (
|
||||||
cv.ENTITY_BASE_SCHEMA.extend(web_server.WEBSERVER_SORTING_SCHEMA)
|
cv.ENTITY_BASE_SCHEMA.extend(web_server.WEBSERVER_SORTING_SCHEMA)
|
||||||
.extend(cv.MQTT_COMMAND_COMPONENT_SCHEMA)
|
.extend(cv.MQTT_COMMAND_COMPONENT_SCHEMA)
|
||||||
.extend(
|
.extend(
|
||||||
{
|
{
|
||||||
cv.GenerateID(): cv.declare_id(AlarmControlPanel),
|
|
||||||
cv.OnlyWith(CONF_MQTT_ID, "mqtt"): cv.declare_id(
|
cv.OnlyWith(CONF_MQTT_ID, "mqtt"): cv.declare_id(
|
||||||
mqtt.MQTTAlarmControlPanelComponent
|
mqtt.MQTTAlarmControlPanelComponent
|
||||||
),
|
),
|
||||||
@@ -146,6 +148,36 @@ ALARM_CONTROL_PANEL_SCHEMA = (
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
_ALARM_CONTROL_PANEL_SCHEMA.add_extra(entity_duplicate_validator("alarm_control_panel"))
|
||||||
|
|
||||||
|
|
||||||
|
def alarm_control_panel_schema(
|
||||||
|
class_: MockObjClass,
|
||||||
|
*,
|
||||||
|
entity_category: str = cv.UNDEFINED,
|
||||||
|
icon: str = cv.UNDEFINED,
|
||||||
|
) -> cv.Schema:
|
||||||
|
schema = {
|
||||||
|
cv.GenerateID(): cv.declare_id(class_),
|
||||||
|
}
|
||||||
|
|
||||||
|
for key, default, validator in [
|
||||||
|
(CONF_ENTITY_CATEGORY, entity_category, cv.entity_category),
|
||||||
|
(CONF_ICON, icon, cv.icon),
|
||||||
|
]:
|
||||||
|
if default is not cv.UNDEFINED:
|
||||||
|
schema[cv.Optional(key, default=default)] = validator
|
||||||
|
|
||||||
|
return _ALARM_CONTROL_PANEL_SCHEMA.extend(schema)
|
||||||
|
|
||||||
|
|
||||||
|
# Remove before 2025.11.0
|
||||||
|
ALARM_CONTROL_PANEL_SCHEMA = alarm_control_panel_schema(AlarmControlPanel)
|
||||||
|
ALARM_CONTROL_PANEL_SCHEMA.add_extra(
|
||||||
|
cv.deprecated_schema_constant("alarm_control_panel")
|
||||||
|
)
|
||||||
|
|
||||||
ALARM_CONTROL_PANEL_ACTION_SCHEMA = maybe_simple_id(
|
ALARM_CONTROL_PANEL_ACTION_SCHEMA = maybe_simple_id(
|
||||||
{
|
{
|
||||||
cv.GenerateID(): cv.use_id(AlarmControlPanel),
|
cv.GenerateID(): cv.use_id(AlarmControlPanel),
|
||||||
@@ -161,7 +193,7 @@ ALARM_CONTROL_PANEL_CONDITION_SCHEMA = maybe_simple_id(
|
|||||||
|
|
||||||
|
|
||||||
async def setup_alarm_control_panel_core_(var, config):
|
async def setup_alarm_control_panel_core_(var, config):
|
||||||
await setup_entity(var, config)
|
await setup_entity(var, config, "alarm_control_panel")
|
||||||
for conf in config.get(CONF_ON_STATE, []):
|
for conf in config.get(CONF_ON_STATE, []):
|
||||||
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
|
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
|
||||||
await automation.build_automation(trigger, [], conf)
|
await automation.build_automation(trigger, [], conf)
|
||||||
@@ -206,9 +238,16 @@ async def register_alarm_control_panel(var, config):
|
|||||||
if not CORE.has_id(config[CONF_ID]):
|
if not CORE.has_id(config[CONF_ID]):
|
||||||
var = cg.Pvariable(config[CONF_ID], var)
|
var = cg.Pvariable(config[CONF_ID], var)
|
||||||
cg.add(cg.App.register_alarm_control_panel(var))
|
cg.add(cg.App.register_alarm_control_panel(var))
|
||||||
|
CORE.register_platform_component("alarm_control_panel", var)
|
||||||
await setup_alarm_control_panel_core_(var, config)
|
await setup_alarm_control_panel_core_(var, config)
|
||||||
|
|
||||||
|
|
||||||
|
async def new_alarm_control_panel(config, *args):
|
||||||
|
var = cg.new_Pvariable(config[CONF_ID], *args)
|
||||||
|
await register_alarm_control_panel(var, config)
|
||||||
|
return var
|
||||||
|
|
||||||
|
|
||||||
@automation.register_action(
|
@automation.register_action(
|
||||||
"alarm_control_panel.arm_away", ArmAwayAction, ALARM_CONTROL_PANEL_ACTION_SCHEMA
|
"alarm_control_panel.arm_away", ArmAwayAction, ALARM_CONTROL_PANEL_ACTION_SCHEMA
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -41,7 +41,6 @@ class Alpha3 : public esphome::ble_client::BLEClientNode, public PollingComponen
|
|||||||
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
|
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
|
||||||
esp_ble_gattc_cb_param_t *param) override;
|
esp_ble_gattc_cb_param_t *param) override;
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
float get_setup_priority() const override { return setup_priority::DATA; }
|
|
||||||
void set_flow_sensor(sensor::Sensor *sensor) { this->flow_sensor_ = sensor; }
|
void set_flow_sensor(sensor::Sensor *sensor) { this->flow_sensor_ = sensor; }
|
||||||
void set_head_sensor(sensor::Sensor *sensor) { this->head_sensor_ = sensor; }
|
void set_head_sensor(sensor::Sensor *sensor) { this->head_sensor_ = sensor; }
|
||||||
void set_power_sensor(sensor::Sensor *sensor) { this->power_sensor_ = sensor; }
|
void set_power_sensor(sensor::Sensor *sensor) { this->power_sensor_ = sensor; }
|
||||||
|
|||||||
@@ -1,20 +1,20 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
|
from esphome.components import ble_client, sensor
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.components import sensor, ble_client
|
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_ID,
|
|
||||||
CONF_CURRENT,
|
CONF_CURRENT,
|
||||||
CONF_FLOW,
|
CONF_FLOW,
|
||||||
CONF_HEAD,
|
CONF_HEAD,
|
||||||
|
CONF_ID,
|
||||||
CONF_POWER,
|
CONF_POWER,
|
||||||
CONF_SPEED,
|
CONF_SPEED,
|
||||||
CONF_VOLTAGE,
|
CONF_VOLTAGE,
|
||||||
UNIT_AMPERE,
|
UNIT_AMPERE,
|
||||||
|
UNIT_CUBIC_METER_PER_HOUR,
|
||||||
|
UNIT_METER,
|
||||||
|
UNIT_REVOLUTIONS_PER_MINUTE,
|
||||||
UNIT_VOLT,
|
UNIT_VOLT,
|
||||||
UNIT_WATT,
|
UNIT_WATT,
|
||||||
UNIT_METER,
|
|
||||||
UNIT_CUBIC_METER_PER_HOUR,
|
|
||||||
UNIT_REVOLUTIONS_PER_MINUTE,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
alpha3_ns = cg.esphome_ns.namespace("alpha3")
|
alpha3_ns = cg.esphome_ns.namespace("alpha3")
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ bool AM2315C::convert_(uint8_t *data, float &humidity, float &temperature) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void AM2315C::setup() {
|
void AM2315C::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up AM2315C...");
|
ESP_LOGCONFIG(TAG, "Running setup");
|
||||||
|
|
||||||
// get status
|
// get status
|
||||||
uint8_t status = 0;
|
uint8_t status = 0;
|
||||||
@@ -128,7 +128,7 @@ void AM2315C::update() {
|
|||||||
data[2] = 0x00;
|
data[2] = 0x00;
|
||||||
if (this->write(data, 3) != i2c::ERROR_OK) {
|
if (this->write(data, 3) != i2c::ERROR_OK) {
|
||||||
ESP_LOGE(TAG, "Write failed!");
|
ESP_LOGE(TAG, "Write failed!");
|
||||||
this->mark_failed();
|
this->status_set_warning();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -138,12 +138,12 @@ void AM2315C::update() {
|
|||||||
uint8_t status = 0;
|
uint8_t status = 0;
|
||||||
if (this->read(&status, 1) != i2c::ERROR_OK) {
|
if (this->read(&status, 1) != i2c::ERROR_OK) {
|
||||||
ESP_LOGE(TAG, "Read failed!");
|
ESP_LOGE(TAG, "Read failed!");
|
||||||
this->mark_failed();
|
this->status_set_warning();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if ((status & 0x80) == 0x80) {
|
if ((status & 0x80) == 0x80) {
|
||||||
ESP_LOGE(TAG, "HW still busy!");
|
ESP_LOGE(TAG, "HW still busy!");
|
||||||
this->mark_failed();
|
this->status_set_warning();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,7 +151,7 @@ void AM2315C::update() {
|
|||||||
uint8_t data[7];
|
uint8_t data[7];
|
||||||
if (this->read(data, 7) != i2c::ERROR_OK) {
|
if (this->read(data, 7) != i2c::ERROR_OK) {
|
||||||
ESP_LOGE(TAG, "Read failed!");
|
ESP_LOGE(TAG, "Read failed!");
|
||||||
this->mark_failed();
|
this->status_set_warning();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -188,7 +188,7 @@ void AM2315C::dump_config() {
|
|||||||
ESP_LOGCONFIG(TAG, "AM2315C:");
|
ESP_LOGCONFIG(TAG, "AM2315C:");
|
||||||
LOG_I2C_DEVICE(this);
|
LOG_I2C_DEVICE(this);
|
||||||
if (this->is_failed()) {
|
if (this->is_failed()) {
|
||||||
ESP_LOGE(TAG, "Communication with AM2315C failed!");
|
ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL);
|
||||||
}
|
}
|
||||||
LOG_SENSOR(" ", "Temperature", this->temperature_sensor_);
|
LOG_SENSOR(" ", "Temperature", this->temperature_sensor_);
|
||||||
LOG_SENSOR(" ", "Humidity", this->humidity_sensor_);
|
LOG_SENSOR(" ", "Humidity", this->humidity_sensor_);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import i2c, sensor
|
from esphome.components import i2c, sensor
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_HUMIDITY,
|
CONF_HUMIDITY,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
|
|||||||
@@ -34,7 +34,7 @@ void AM2320Component::update() {
|
|||||||
this->status_clear_warning();
|
this->status_clear_warning();
|
||||||
}
|
}
|
||||||
void AM2320Component::setup() {
|
void AM2320Component::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up AM2320...");
|
ESP_LOGCONFIG(TAG, "Running setup");
|
||||||
uint8_t data[8];
|
uint8_t data[8];
|
||||||
data[0] = 0;
|
data[0] = 0;
|
||||||
data[1] = 4;
|
data[1] = 4;
|
||||||
@@ -47,7 +47,7 @@ void AM2320Component::dump_config() {
|
|||||||
ESP_LOGD(TAG, "AM2320:");
|
ESP_LOGD(TAG, "AM2320:");
|
||||||
LOG_I2C_DEVICE(this);
|
LOG_I2C_DEVICE(this);
|
||||||
if (this->is_failed()) {
|
if (this->is_failed()) {
|
||||||
ESP_LOGE(TAG, "Communication with AM2320 failed!");
|
ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL);
|
||||||
}
|
}
|
||||||
LOG_SENSOR(" ", "Temperature", this->temperature_sensor_);
|
LOG_SENSOR(" ", "Temperature", this->temperature_sensor_);
|
||||||
LOG_SENSOR(" ", "Humidity", this->humidity_sensor_);
|
LOG_SENSOR(" ", "Humidity", this->humidity_sensor_);
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import i2c, sensor
|
from esphome.components import i2c, sensor
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_HUMIDITY,
|
CONF_HUMIDITY,
|
||||||
CONF_ID,
|
CONF_ID,
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "esphome/core/log.h"
|
|
||||||
#include "esphome/core/helpers.h"
|
#include "esphome/core/helpers.h"
|
||||||
|
#include "esphome/core/log.h"
|
||||||
|
|
||||||
namespace esphome {
|
namespace esphome {
|
||||||
namespace am43 {
|
namespace am43 {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
|
from esphome.components import ble_client, cover
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.components import cover, ble_client
|
from esphome.const import CONF_PIN
|
||||||
from esphome.const import CONF_ID, CONF_PIN
|
|
||||||
|
|
||||||
CODEOWNERS = ["@buxtronix"]
|
CODEOWNERS = ["@buxtronix"]
|
||||||
DEPENDENCIES = ["ble_client"]
|
DEPENDENCIES = ["ble_client"]
|
||||||
@@ -15,9 +15,9 @@ Am43Component = am43_ns.class_(
|
|||||||
)
|
)
|
||||||
|
|
||||||
CONFIG_SCHEMA = (
|
CONFIG_SCHEMA = (
|
||||||
cover.COVER_SCHEMA.extend(
|
cover.cover_schema(Am43Component)
|
||||||
|
.extend(
|
||||||
{
|
{
|
||||||
cv.GenerateID(): cv.declare_id(Am43Component),
|
|
||||||
cv.Optional(CONF_PIN, default=8888): cv.int_range(min=0, max=0xFFFF),
|
cv.Optional(CONF_PIN, default=8888): cv.int_range(min=0, max=0xFFFF),
|
||||||
cv.Optional(CONF_INVERT_POSITION, default=False): cv.boolean,
|
cv.Optional(CONF_INVERT_POSITION, default=False): cv.boolean,
|
||||||
}
|
}
|
||||||
@@ -28,9 +28,8 @@ CONFIG_SCHEMA = (
|
|||||||
|
|
||||||
|
|
||||||
async def to_code(config):
|
async def to_code(config):
|
||||||
var = cg.new_Pvariable(config[CONF_ID])
|
var = await cover.new_cover(config)
|
||||||
cg.add(var.set_pin(config[CONF_PIN]))
|
cg.add(var.set_pin(config[CONF_PIN]))
|
||||||
cg.add(var.set_invert_position(config[CONF_INVERT_POSITION]))
|
cg.add(var.set_invert_position(config[CONF_INVERT_POSITION]))
|
||||||
await cg.register_component(var, config)
|
await cg.register_component(var, config)
|
||||||
await cover.register_cover(var, config)
|
|
||||||
await ble_client.register_ble_node(var, config)
|
await ble_client.register_ble_node(var, config)
|
||||||
|
|||||||
@@ -12,8 +12,10 @@ using namespace esphome::cover;
|
|||||||
|
|
||||||
void Am43Component::dump_config() {
|
void Am43Component::dump_config() {
|
||||||
LOG_COVER("", "AM43 Cover", this);
|
LOG_COVER("", "AM43 Cover", this);
|
||||||
ESP_LOGCONFIG(TAG, " Device Pin: %d", this->pin_);
|
ESP_LOGCONFIG(TAG,
|
||||||
ESP_LOGCONFIG(TAG, " Invert Position: %d", (int) this->invert_position_);
|
" Device Pin: %d\n"
|
||||||
|
" Invert Position: %d",
|
||||||
|
this->pin_, (int) this->invert_position_);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Am43Component::setup() {
|
void Am43Component::setup() {
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ class Am43Component : public cover::Cover, public esphome::ble_client::BLEClient
|
|||||||
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
|
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
|
||||||
esp_ble_gattc_cb_param_t *param) override;
|
esp_ble_gattc_cb_param_t *param) override;
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
float get_setup_priority() const override { return setup_priority::DATA; }
|
|
||||||
cover::CoverTraits get_traits() override;
|
cover::CoverTraits get_traits() override;
|
||||||
void set_pin(uint16_t pin) { this->pin_ = pin; }
|
void set_pin(uint16_t pin) { this->pin_ = pin; }
|
||||||
void set_invert_position(bool invert_position) { this->invert_position_ = invert_position; }
|
void set_invert_position(bool invert_position) { this->invert_position_ = invert_position; }
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
|
from esphome.components import ble_client, sensor
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.components import sensor, ble_client
|
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_ID,
|
|
||||||
CONF_BATTERY_LEVEL,
|
CONF_BATTERY_LEVEL,
|
||||||
|
CONF_ID,
|
||||||
|
CONF_ILLUMINANCE,
|
||||||
DEVICE_CLASS_BATTERY,
|
DEVICE_CLASS_BATTERY,
|
||||||
ENTITY_CATEGORY_DIAGNOSTIC,
|
ENTITY_CATEGORY_DIAGNOSTIC,
|
||||||
CONF_ILLUMINANCE,
|
|
||||||
ICON_BRIGHTNESS_5,
|
ICON_BRIGHTNESS_5,
|
||||||
UNIT_PERCENT,
|
UNIT_PERCENT,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ class Am43 : public esphome::ble_client::BLEClientNode, public PollingComponent
|
|||||||
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
|
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
|
||||||
esp_ble_gattc_cb_param_t *param) override;
|
esp_ble_gattc_cb_param_t *param) override;
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
float get_setup_priority() const override { return setup_priority::DATA; }
|
|
||||||
void set_battery(sensor::Sensor *battery) { battery_ = battery; }
|
void set_battery(sensor::Sensor *battery) { battery_ = battery; }
|
||||||
void set_illuminance(sensor::Sensor *illuminance) { illuminance_ = illuminance; }
|
void set_illuminance(sensor::Sensor *illuminance) { illuminance_ = illuminance; }
|
||||||
|
|
||||||
|
|||||||
@@ -14,7 +14,8 @@ void AnalogThresholdBinarySensor::setup() {
|
|||||||
if (std::isnan(sensor_value)) {
|
if (std::isnan(sensor_value)) {
|
||||||
this->publish_initial_state(false);
|
this->publish_initial_state(false);
|
||||||
} else {
|
} else {
|
||||||
this->publish_initial_state(sensor_value >= (this->lower_threshold_ + this->upper_threshold_) / 2.0f);
|
this->publish_initial_state(sensor_value >=
|
||||||
|
(this->lower_threshold_.value() + this->upper_threshold_.value()) / 2.0f);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -24,7 +25,8 @@ void AnalogThresholdBinarySensor::set_sensor(sensor::Sensor *analog_sensor) {
|
|||||||
this->sensor_->add_on_state_callback([this](float sensor_value) {
|
this->sensor_->add_on_state_callback([this](float sensor_value) {
|
||||||
// if there is an invalid sensor reading, ignore the change and keep the current state
|
// if there is an invalid sensor reading, ignore the change and keep the current state
|
||||||
if (!std::isnan(sensor_value)) {
|
if (!std::isnan(sensor_value)) {
|
||||||
this->publish_state(sensor_value >= (this->state ? this->lower_threshold_ : this->upper_threshold_));
|
this->publish_state(sensor_value >=
|
||||||
|
(this->state ? this->lower_threshold_.value() : this->upper_threshold_.value()));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -32,8 +34,10 @@ void AnalogThresholdBinarySensor::set_sensor(sensor::Sensor *analog_sensor) {
|
|||||||
void AnalogThresholdBinarySensor::dump_config() {
|
void AnalogThresholdBinarySensor::dump_config() {
|
||||||
LOG_BINARY_SENSOR("", "Analog Threshold Binary Sensor", this);
|
LOG_BINARY_SENSOR("", "Analog Threshold Binary Sensor", this);
|
||||||
LOG_SENSOR(" ", "Sensor", this->sensor_);
|
LOG_SENSOR(" ", "Sensor", this->sensor_);
|
||||||
ESP_LOGCONFIG(TAG, " Upper threshold: %.11f", this->upper_threshold_);
|
ESP_LOGCONFIG(TAG,
|
||||||
ESP_LOGCONFIG(TAG, " Lower threshold: %.11f", this->lower_threshold_);
|
" Upper threshold: %.11f\n"
|
||||||
|
" Lower threshold: %.11f",
|
||||||
|
this->upper_threshold_.value(), this->lower_threshold_.value());
|
||||||
}
|
}
|
||||||
|
|
||||||
} // namespace analog_threshold
|
} // namespace analog_threshold
|
||||||
|
|||||||
@@ -12,17 +12,14 @@ class AnalogThresholdBinarySensor : public Component, public binary_sensor::Bina
|
|||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
void setup() override;
|
void setup() override;
|
||||||
|
|
||||||
float get_setup_priority() const override { return setup_priority::DATA; }
|
|
||||||
|
|
||||||
void set_sensor(sensor::Sensor *analog_sensor);
|
void set_sensor(sensor::Sensor *analog_sensor);
|
||||||
void set_upper_threshold(float threshold) { this->upper_threshold_ = threshold; }
|
template<typename T> void set_upper_threshold(T upper_threshold) { this->upper_threshold_ = upper_threshold; }
|
||||||
void set_lower_threshold(float threshold) { this->lower_threshold_ = threshold; }
|
template<typename T> void set_lower_threshold(T lower_threshold) { this->lower_threshold_ = lower_threshold; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
sensor::Sensor *sensor_{nullptr};
|
sensor::Sensor *sensor_{nullptr};
|
||||||
|
TemplatableValue<float> upper_threshold_{};
|
||||||
float upper_threshold_;
|
TemplatableValue<float> lower_threshold_{};
|
||||||
float lower_threshold_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace analog_threshold
|
} // namespace analog_threshold
|
||||||
|
|||||||
@@ -1,10 +1,7 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import binary_sensor, sensor
|
from esphome.components import binary_sensor, sensor
|
||||||
from esphome.const import (
|
import esphome.config_validation as cv
|
||||||
CONF_SENSOR_ID,
|
from esphome.const import CONF_SENSOR_ID, CONF_THRESHOLD
|
||||||
CONF_THRESHOLD,
|
|
||||||
)
|
|
||||||
|
|
||||||
analog_threshold_ns = cg.esphome_ns.namespace("analog_threshold")
|
analog_threshold_ns = cg.esphome_ns.namespace("analog_threshold")
|
||||||
|
|
||||||
@@ -21,11 +18,11 @@ CONFIG_SCHEMA = (
|
|||||||
{
|
{
|
||||||
cv.Required(CONF_SENSOR_ID): cv.use_id(sensor.Sensor),
|
cv.Required(CONF_SENSOR_ID): cv.use_id(sensor.Sensor),
|
||||||
cv.Required(CONF_THRESHOLD): cv.Any(
|
cv.Required(CONF_THRESHOLD): cv.Any(
|
||||||
cv.float_,
|
cv.templatable(cv.float_),
|
||||||
cv.Schema(
|
cv.Schema(
|
||||||
{
|
{
|
||||||
cv.Required(CONF_UPPER): cv.float_,
|
cv.Required(CONF_UPPER): cv.templatable(cv.float_),
|
||||||
cv.Required(CONF_LOWER): cv.float_,
|
cv.Required(CONF_LOWER): cv.templatable(cv.float_),
|
||||||
}
|
}
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
@@ -42,9 +39,11 @@ async def to_code(config):
|
|||||||
sens = await cg.get_variable(config[CONF_SENSOR_ID])
|
sens = await cg.get_variable(config[CONF_SENSOR_ID])
|
||||||
cg.add(var.set_sensor(sens))
|
cg.add(var.set_sensor(sens))
|
||||||
|
|
||||||
if isinstance(config[CONF_THRESHOLD], float):
|
if isinstance(config[CONF_THRESHOLD], dict):
|
||||||
cg.add(var.set_upper_threshold(config[CONF_THRESHOLD]))
|
lower = await cg.templatable(config[CONF_THRESHOLD][CONF_LOWER], [], float)
|
||||||
cg.add(var.set_lower_threshold(config[CONF_THRESHOLD]))
|
upper = await cg.templatable(config[CONF_THRESHOLD][CONF_UPPER], [], float)
|
||||||
else:
|
else:
|
||||||
cg.add(var.set_upper_threshold(config[CONF_THRESHOLD][CONF_UPPER]))
|
lower = await cg.templatable(config[CONF_THRESHOLD], [], float)
|
||||||
cg.add(var.set_lower_threshold(config[CONF_THRESHOLD][CONF_LOWER]))
|
upper = lower
|
||||||
|
cg.add(var.set_upper_threshold(upper))
|
||||||
|
cg.add(var.set_lower_threshold(lower))
|
||||||
|
|||||||
@@ -17,7 +17,11 @@ void Anova::setup() {
|
|||||||
this->current_request_ = 0;
|
this->current_request_ = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Anova::loop() {}
|
void Anova::loop() {
|
||||||
|
// Parent BLEClientNode has a loop() method, but this component uses
|
||||||
|
// polling via update() and BLE callbacks so loop isn't needed
|
||||||
|
this->disable_loop();
|
||||||
|
}
|
||||||
|
|
||||||
void Anova::control(const ClimateCall &call) {
|
void Anova::control(const ClimateCall &call) {
|
||||||
if (call.get_mode().has_value()) {
|
if (call.get_mode().has_value()) {
|
||||||
|
|||||||
@@ -26,7 +26,6 @@ class Anova : public climate::Climate, public esphome::ble_client::BLEClientNode
|
|||||||
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
|
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
|
||||||
esp_ble_gattc_cb_param_t *param) override;
|
esp_ble_gattc_cb_param_t *param) override;
|
||||||
void dump_config() override;
|
void dump_config() override;
|
||||||
float get_setup_priority() const override { return setup_priority::DATA; }
|
|
||||||
climate::ClimateTraits traits() override {
|
climate::ClimateTraits traits() override {
|
||||||
auto traits = climate::ClimateTraits();
|
auto traits = climate::ClimateTraits();
|
||||||
traits.set_supports_current_temperature(true);
|
traits.set_supports_current_temperature(true);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
|
from esphome.components import ble_client, climate
|
||||||
import esphome.config_validation as cv
|
import esphome.config_validation as cv
|
||||||
from esphome.components import climate, ble_client
|
from esphome.const import CONF_UNIT_OF_MEASUREMENT
|
||||||
from esphome.const import CONF_ID, CONF_UNIT_OF_MEASUREMENT
|
|
||||||
|
|
||||||
UNITS = {
|
UNITS = {
|
||||||
"f": "f",
|
"f": "f",
|
||||||
@@ -17,9 +17,9 @@ Anova = anova_ns.class_(
|
|||||||
)
|
)
|
||||||
|
|
||||||
CONFIG_SCHEMA = (
|
CONFIG_SCHEMA = (
|
||||||
climate.CLIMATE_SCHEMA.extend(
|
climate.climate_schema(Anova)
|
||||||
|
.extend(
|
||||||
{
|
{
|
||||||
cv.GenerateID(): cv.declare_id(Anova),
|
|
||||||
cv.Required(CONF_UNIT_OF_MEASUREMENT): cv.enum(UNITS),
|
cv.Required(CONF_UNIT_OF_MEASUREMENT): cv.enum(UNITS),
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
@@ -29,8 +29,7 @@ CONFIG_SCHEMA = (
|
|||||||
|
|
||||||
|
|
||||||
async def to_code(config):
|
async def to_code(config):
|
||||||
var = cg.new_Pvariable(config[CONF_ID])
|
var = await climate.new_climate(config)
|
||||||
await cg.register_component(var, config)
|
await cg.register_component(var, config)
|
||||||
await climate.register_climate(var, config)
|
|
||||||
await ble_client.register_ble_node(var, config)
|
await ble_client.register_ble_node(var, config)
|
||||||
cg.add(var.set_unit_of_measurement(config[CONF_UNIT_OF_MEASUREMENT]))
|
cg.add(var.set_unit_of_measurement(config[CONF_UNIT_OF_MEASUREMENT]))
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ enum { // APDS9306 registers
|
|||||||
}
|
}
|
||||||
|
|
||||||
void APDS9306::setup() {
|
void APDS9306::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up APDS9306...");
|
ESP_LOGCONFIG(TAG, "Running setup");
|
||||||
|
|
||||||
uint8_t id;
|
uint8_t id;
|
||||||
if (!this->read_byte(APDS9306_PART_ID, &id)) { // Part ID register
|
if (!this->read_byte(APDS9306_PART_ID, &id)) { // Part ID register
|
||||||
@@ -97,7 +97,7 @@ void APDS9306::dump_config() {
|
|||||||
if (this->is_failed()) {
|
if (this->is_failed()) {
|
||||||
switch (this->error_code_) {
|
switch (this->error_code_) {
|
||||||
case COMMUNICATION_FAILED:
|
case COMMUNICATION_FAILED:
|
||||||
ESP_LOGE(TAG, "Communication with APDS9306 failed!");
|
ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL);
|
||||||
break;
|
break;
|
||||||
case WRONG_ID:
|
case WRONG_ID:
|
||||||
ESP_LOGE(TAG, "APDS9306 has invalid id!");
|
ESP_LOGE(TAG, "APDS9306 has invalid id!");
|
||||||
@@ -108,9 +108,12 @@ void APDS9306::dump_config() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
ESP_LOGCONFIG(TAG, " Gain: %u", AMBIENT_LIGHT_GAIN_VALUES[this->gain_]);
|
ESP_LOGCONFIG(TAG,
|
||||||
ESP_LOGCONFIG(TAG, " Measurement rate: %u", MEASUREMENT_RATE_VALUES[this->measurement_rate_]);
|
" Gain: %u\n"
|
||||||
ESP_LOGCONFIG(TAG, " Measurement Resolution/Bit width: %d", MEASUREMENT_BIT_WIDTH_VALUES[this->bit_width_]);
|
" Measurement rate: %u\n"
|
||||||
|
" Measurement Resolution/Bit width: %d",
|
||||||
|
AMBIENT_LIGHT_GAIN_VALUES[this->gain_], MEASUREMENT_RATE_VALUES[this->measurement_rate_],
|
||||||
|
MEASUREMENT_BIT_WIDTH_VALUES[this->bit_width_]);
|
||||||
|
|
||||||
LOG_UPDATE_INTERVAL(this);
|
LOG_UPDATE_INTERVAL(this);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
# https://www.mouser.ca/datasheet/2/678/AVGO_S_A0002854364_1-2574547.pdf
|
# https://www.mouser.ca/datasheet/2/678/AVGO_S_A0002854364_1-2574547.pdf
|
||||||
|
|
||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import i2c, sensor
|
from esphome.components import i2c, sensor
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_GAIN,
|
CONF_GAIN,
|
||||||
DEVICE_CLASS_ILLUMINANCE,
|
DEVICE_CLASS_ILLUMINANCE,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import i2c
|
from esphome.components import i2c
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import CONF_ID
|
from esphome.const import CONF_ID
|
||||||
|
|
||||||
DEPENDENCIES = ["i2c"]
|
DEPENDENCIES = ["i2c"]
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ static const char *const TAG = "apds9960";
|
|||||||
#define APDS9960_WRITE_BYTE(reg, value) APDS9960_ERROR_CHECK(this->write_byte(reg, value));
|
#define APDS9960_WRITE_BYTE(reg, value) APDS9960_ERROR_CHECK(this->write_byte(reg, value));
|
||||||
|
|
||||||
void APDS9960::setup() {
|
void APDS9960::setup() {
|
||||||
ESP_LOGCONFIG(TAG, "Setting up APDS9960...");
|
ESP_LOGCONFIG(TAG, "Running setup");
|
||||||
uint8_t id;
|
uint8_t id;
|
||||||
if (!this->read_byte(0x92, &id)) { // ID register
|
if (!this->read_byte(0x92, &id)) { // ID register
|
||||||
this->error_code_ = COMMUNICATION_FAILED;
|
this->error_code_ = COMMUNICATION_FAILED;
|
||||||
@@ -141,7 +141,7 @@ void APDS9960::dump_config() {
|
|||||||
if (this->is_failed()) {
|
if (this->is_failed()) {
|
||||||
switch (this->error_code_) {
|
switch (this->error_code_) {
|
||||||
case COMMUNICATION_FAILED:
|
case COMMUNICATION_FAILED:
|
||||||
ESP_LOGE(TAG, "Communication with APDS9960 failed!");
|
ESP_LOGE(TAG, ESP_LOG_MSG_COMM_FAIL);
|
||||||
break;
|
break;
|
||||||
case WRONG_ID:
|
case WRONG_ID:
|
||||||
ESP_LOGE(TAG, "APDS9960 has invalid id!");
|
ESP_LOGE(TAG, "APDS9960 has invalid id!");
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import binary_sensor
|
from esphome.components import binary_sensor
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import CONF_DIRECTION, DEVICE_CLASS_MOVING
|
from esphome.const import CONF_DIRECTION, DEVICE_CLASS_MOVING
|
||||||
|
|
||||||
from . import APDS9960, CONF_APDS9960_ID
|
from . import APDS9960, CONF_APDS9960_ID
|
||||||
|
|
||||||
DEPENDENCIES = ["apds9960"]
|
DEPENDENCIES = ["apds9960"]
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
import esphome.codegen as cg
|
import esphome.codegen as cg
|
||||||
import esphome.config_validation as cv
|
|
||||||
from esphome.components import sensor
|
from esphome.components import sensor
|
||||||
|
import esphome.config_validation as cv
|
||||||
from esphome.const import (
|
from esphome.const import (
|
||||||
CONF_TYPE,
|
CONF_TYPE,
|
||||||
|
ICON_LIGHTBULB,
|
||||||
STATE_CLASS_MEASUREMENT,
|
STATE_CLASS_MEASUREMENT,
|
||||||
UNIT_PERCENT,
|
UNIT_PERCENT,
|
||||||
ICON_LIGHTBULB,
|
|
||||||
)
|
)
|
||||||
|
|
||||||
from . import APDS9960, CONF_APDS9960_ID
|
from . import APDS9960, CONF_APDS9960_ID
|
||||||
|
|
||||||
DEPENDENCIES = ["apds9960"]
|
DEPENDENCIES = ["apds9960"]
|
||||||
|
|||||||
@@ -49,6 +49,7 @@ SERVICE_ARG_NATIVE_TYPES = {
|
|||||||
"string[]": cg.std_vector.template(cg.std_string),
|
"string[]": cg.std_vector.template(cg.std_string),
|
||||||
}
|
}
|
||||||
CONF_ENCRYPTION = "encryption"
|
CONF_ENCRYPTION = "encryption"
|
||||||
|
CONF_BATCH_DELAY = "batch_delay"
|
||||||
|
|
||||||
|
|
||||||
def validate_encryption_key(value):
|
def validate_encryption_key(value):
|
||||||
@@ -82,6 +83,19 @@ ACTIONS_SCHEMA = automation.validate_automation(
|
|||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
ENCRYPTION_SCHEMA = cv.Schema(
|
||||||
|
{
|
||||||
|
cv.Optional(CONF_KEY): validate_encryption_key,
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
def _encryption_schema(config):
|
||||||
|
if config is None:
|
||||||
|
config = {}
|
||||||
|
return ENCRYPTION_SCHEMA(config)
|
||||||
|
|
||||||
|
|
||||||
CONFIG_SCHEMA = cv.All(
|
CONFIG_SCHEMA = cv.All(
|
||||||
cv.Schema(
|
cv.Schema(
|
||||||
{
|
{
|
||||||
@@ -95,10 +109,10 @@ CONFIG_SCHEMA = cv.All(
|
|||||||
CONF_SERVICES, group_of_exclusion=CONF_ACTIONS
|
CONF_SERVICES, group_of_exclusion=CONF_ACTIONS
|
||||||
): ACTIONS_SCHEMA,
|
): ACTIONS_SCHEMA,
|
||||||
cv.Exclusive(CONF_ACTIONS, group_of_exclusion=CONF_ACTIONS): ACTIONS_SCHEMA,
|
cv.Exclusive(CONF_ACTIONS, group_of_exclusion=CONF_ACTIONS): ACTIONS_SCHEMA,
|
||||||
cv.Optional(CONF_ENCRYPTION): cv.Schema(
|
cv.Optional(CONF_ENCRYPTION): _encryption_schema,
|
||||||
{
|
cv.Optional(CONF_BATCH_DELAY, default="100ms"): cv.All(
|
||||||
cv.Required(CONF_KEY): validate_encryption_key,
|
cv.positive_time_period_milliseconds,
|
||||||
}
|
cv.Range(max=cv.TimePeriod(milliseconds=65535)),
|
||||||
),
|
),
|
||||||
cv.Optional(CONF_ON_CLIENT_CONNECTED): automation.validate_automation(
|
cv.Optional(CONF_ON_CLIENT_CONNECTED): automation.validate_automation(
|
||||||
single=True
|
single=True
|
||||||
@@ -118,26 +132,32 @@ async def to_code(config):
|
|||||||
await cg.register_component(var, config)
|
await cg.register_component(var, config)
|
||||||
|
|
||||||
cg.add(var.set_port(config[CONF_PORT]))
|
cg.add(var.set_port(config[CONF_PORT]))
|
||||||
cg.add(var.set_password(config[CONF_PASSWORD]))
|
if config[CONF_PASSWORD]:
|
||||||
|
cg.add_define("USE_API_PASSWORD")
|
||||||
|
cg.add(var.set_password(config[CONF_PASSWORD]))
|
||||||
cg.add(var.set_reboot_timeout(config[CONF_REBOOT_TIMEOUT]))
|
cg.add(var.set_reboot_timeout(config[CONF_REBOOT_TIMEOUT]))
|
||||||
|
cg.add(var.set_batch_delay(config[CONF_BATCH_DELAY]))
|
||||||
|
|
||||||
for conf in config.get(CONF_ACTIONS, []):
|
if actions := config.get(CONF_ACTIONS, []):
|
||||||
template_args = []
|
cg.add_define("USE_API_YAML_SERVICES")
|
||||||
func_args = []
|
for conf in actions:
|
||||||
service_arg_names = []
|
template_args = []
|
||||||
for name, var_ in conf[CONF_VARIABLES].items():
|
func_args = []
|
||||||
native = SERVICE_ARG_NATIVE_TYPES[var_]
|
service_arg_names = []
|
||||||
template_args.append(native)
|
for name, var_ in conf[CONF_VARIABLES].items():
|
||||||
func_args.append((native, name))
|
native = SERVICE_ARG_NATIVE_TYPES[var_]
|
||||||
service_arg_names.append(name)
|
template_args.append(native)
|
||||||
templ = cg.TemplateArguments(*template_args)
|
func_args.append((native, name))
|
||||||
trigger = cg.new_Pvariable(
|
service_arg_names.append(name)
|
||||||
conf[CONF_TRIGGER_ID], templ, conf[CONF_ACTION], service_arg_names
|
templ = cg.TemplateArguments(*template_args)
|
||||||
)
|
trigger = cg.new_Pvariable(
|
||||||
cg.add(var.register_user_service(trigger))
|
conf[CONF_TRIGGER_ID], templ, conf[CONF_ACTION], service_arg_names
|
||||||
await automation.build_automation(trigger, func_args, conf)
|
)
|
||||||
|
cg.add(var.register_user_service(trigger))
|
||||||
|
await automation.build_automation(trigger, func_args, conf)
|
||||||
|
|
||||||
if CONF_ON_CLIENT_CONNECTED in config:
|
if CONF_ON_CLIENT_CONNECTED in config:
|
||||||
|
cg.add_define("USE_API_CLIENT_CONNECTED_TRIGGER")
|
||||||
await automation.build_automation(
|
await automation.build_automation(
|
||||||
var.get_client_connected_trigger(),
|
var.get_client_connected_trigger(),
|
||||||
[(cg.std_string, "client_info"), (cg.std_string, "client_address")],
|
[(cg.std_string, "client_info"), (cg.std_string, "client_address")],
|
||||||
@@ -145,17 +165,26 @@ async def to_code(config):
|
|||||||
)
|
)
|
||||||
|
|
||||||
if CONF_ON_CLIENT_DISCONNECTED in config:
|
if CONF_ON_CLIENT_DISCONNECTED in config:
|
||||||
|
cg.add_define("USE_API_CLIENT_DISCONNECTED_TRIGGER")
|
||||||
await automation.build_automation(
|
await automation.build_automation(
|
||||||
var.get_client_disconnected_trigger(),
|
var.get_client_disconnected_trigger(),
|
||||||
[(cg.std_string, "client_info"), (cg.std_string, "client_address")],
|
[(cg.std_string, "client_info"), (cg.std_string, "client_address")],
|
||||||
config[CONF_ON_CLIENT_DISCONNECTED],
|
config[CONF_ON_CLIENT_DISCONNECTED],
|
||||||
)
|
)
|
||||||
|
|
||||||
if encryption_config := config.get(CONF_ENCRYPTION):
|
if (encryption_config := config.get(CONF_ENCRYPTION, None)) is not None:
|
||||||
decoded = base64.b64decode(encryption_config[CONF_KEY])
|
if key := encryption_config.get(CONF_KEY):
|
||||||
cg.add(var.set_noise_psk(list(decoded)))
|
decoded = base64.b64decode(key)
|
||||||
|
cg.add(var.set_noise_psk(list(decoded)))
|
||||||
|
else:
|
||||||
|
# No key provided, but encryption desired
|
||||||
|
# This will allow a plaintext client to provide a noise key,
|
||||||
|
# send it to the device, and then switch to noise.
|
||||||
|
# The key will be saved in flash and used for future connections
|
||||||
|
# and plaintext disabled. Only a factory reset can remove it.
|
||||||
|
cg.add_define("USE_API_PLAINTEXT")
|
||||||
cg.add_define("USE_API_NOISE")
|
cg.add_define("USE_API_NOISE")
|
||||||
cg.add_library("esphome/noise-c", "0.1.6")
|
cg.add_library("esphome/noise-c", "0.1.10")
|
||||||
else:
|
else:
|
||||||
cg.add_define("USE_API_PLAINTEXT")
|
cg.add_define("USE_API_PLAINTEXT")
|
||||||
|
|
||||||
|
|||||||
@@ -31,24 +31,26 @@ service APIConnection {
|
|||||||
option (needs_authentication) = false;
|
option (needs_authentication) = false;
|
||||||
}
|
}
|
||||||
rpc execute_service (ExecuteServiceRequest) returns (void) {}
|
rpc execute_service (ExecuteServiceRequest) returns (void) {}
|
||||||
|
rpc noise_encryption_set_key (NoiseEncryptionSetKeyRequest) returns (NoiseEncryptionSetKeyResponse) {}
|
||||||
|
|
||||||
rpc cover_command (CoverCommandRequest) returns (void) {}
|
rpc button_command (ButtonCommandRequest) returns (void) {}
|
||||||
rpc fan_command (FanCommandRequest) returns (void) {}
|
|
||||||
rpc light_command (LightCommandRequest) returns (void) {}
|
|
||||||
rpc switch_command (SwitchCommandRequest) returns (void) {}
|
|
||||||
rpc camera_image (CameraImageRequest) returns (void) {}
|
rpc camera_image (CameraImageRequest) returns (void) {}
|
||||||
rpc climate_command (ClimateCommandRequest) returns (void) {}
|
rpc climate_command (ClimateCommandRequest) returns (void) {}
|
||||||
rpc number_command (NumberCommandRequest) returns (void) {}
|
rpc cover_command (CoverCommandRequest) returns (void) {}
|
||||||
rpc text_command (TextCommandRequest) returns (void) {}
|
|
||||||
rpc select_command (SelectCommandRequest) returns (void) {}
|
|
||||||
rpc button_command (ButtonCommandRequest) returns (void) {}
|
|
||||||
rpc lock_command (LockCommandRequest) returns (void) {}
|
|
||||||
rpc valve_command (ValveCommandRequest) returns (void) {}
|
|
||||||
rpc media_player_command (MediaPlayerCommandRequest) returns (void) {}
|
|
||||||
rpc date_command (DateCommandRequest) returns (void) {}
|
rpc date_command (DateCommandRequest) returns (void) {}
|
||||||
rpc time_command (TimeCommandRequest) returns (void) {}
|
|
||||||
rpc datetime_command (DateTimeCommandRequest) returns (void) {}
|
rpc datetime_command (DateTimeCommandRequest) returns (void) {}
|
||||||
|
rpc fan_command (FanCommandRequest) returns (void) {}
|
||||||
|
rpc light_command (LightCommandRequest) returns (void) {}
|
||||||
|
rpc lock_command (LockCommandRequest) returns (void) {}
|
||||||
|
rpc media_player_command (MediaPlayerCommandRequest) returns (void) {}
|
||||||
|
rpc number_command (NumberCommandRequest) returns (void) {}
|
||||||
|
rpc select_command (SelectCommandRequest) returns (void) {}
|
||||||
|
rpc siren_command (SirenCommandRequest) returns (void) {}
|
||||||
|
rpc switch_command (SwitchCommandRequest) returns (void) {}
|
||||||
|
rpc text_command (TextCommandRequest) returns (void) {}
|
||||||
|
rpc time_command (TimeCommandRequest) returns (void) {}
|
||||||
rpc update_command (UpdateCommandRequest) returns (void) {}
|
rpc update_command (UpdateCommandRequest) returns (void) {}
|
||||||
|
rpc valve_command (ValveCommandRequest) returns (void) {}
|
||||||
|
|
||||||
rpc subscribe_bluetooth_le_advertisements(SubscribeBluetoothLEAdvertisementsRequest) returns (void) {}
|
rpc subscribe_bluetooth_le_advertisements(SubscribeBluetoothLEAdvertisementsRequest) returns (void) {}
|
||||||
rpc bluetooth_device_request(BluetoothDeviceRequest) returns (void) {}
|
rpc bluetooth_device_request(BluetoothDeviceRequest) returns (void) {}
|
||||||
@@ -60,6 +62,7 @@ service APIConnection {
|
|||||||
rpc bluetooth_gatt_notify(BluetoothGATTNotifyRequest) returns (void) {}
|
rpc bluetooth_gatt_notify(BluetoothGATTNotifyRequest) returns (void) {}
|
||||||
rpc subscribe_bluetooth_connections_free(SubscribeBluetoothConnectionsFreeRequest) returns (BluetoothConnectionsFreeResponse) {}
|
rpc subscribe_bluetooth_connections_free(SubscribeBluetoothConnectionsFreeRequest) returns (BluetoothConnectionsFreeResponse) {}
|
||||||
rpc unsubscribe_bluetooth_le_advertisements(UnsubscribeBluetoothLEAdvertisementsRequest) returns (void) {}
|
rpc unsubscribe_bluetooth_le_advertisements(UnsubscribeBluetoothLEAdvertisementsRequest) returns (void) {}
|
||||||
|
rpc bluetooth_scanner_set_mode(BluetoothScannerSetModeRequest) returns (void) {}
|
||||||
|
|
||||||
rpc subscribe_voice_assistant(SubscribeVoiceAssistantRequest) returns (void) {}
|
rpc subscribe_voice_assistant(SubscribeVoiceAssistantRequest) returns (void) {}
|
||||||
rpc voice_assistant_get_configuration(VoiceAssistantConfigurationRequest) returns (VoiceAssistantConfigurationResponse) {}
|
rpc voice_assistant_get_configuration(VoiceAssistantConfigurationRequest) returns (VoiceAssistantConfigurationResponse) {}
|
||||||
@@ -185,6 +188,17 @@ message DeviceInfoRequest {
|
|||||||
// Empty
|
// Empty
|
||||||
}
|
}
|
||||||
|
|
||||||
|
message AreaInfo {
|
||||||
|
uint32 area_id = 1;
|
||||||
|
string name = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message DeviceInfo {
|
||||||
|
uint32 device_id = 1;
|
||||||
|
string name = 2;
|
||||||
|
uint32 area_id = 3;
|
||||||
|
}
|
||||||
|
|
||||||
message DeviceInfoResponse {
|
message DeviceInfoResponse {
|
||||||
option (id) = 10;
|
option (id) = 10;
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
@@ -230,6 +244,15 @@ message DeviceInfoResponse {
|
|||||||
|
|
||||||
// The Bluetooth mac address of the device. For example "AC:BC:32:89:0E:AA"
|
// The Bluetooth mac address of the device. For example "AC:BC:32:89:0E:AA"
|
||||||
string bluetooth_mac_address = 18;
|
string bluetooth_mac_address = 18;
|
||||||
|
|
||||||
|
// Supports receiving and saving api encryption key
|
||||||
|
bool api_encryption_supported = 19;
|
||||||
|
|
||||||
|
repeated DeviceInfo devices = 20;
|
||||||
|
repeated AreaInfo areas = 21;
|
||||||
|
|
||||||
|
// Top-level area info to phase out suggested_area
|
||||||
|
AreaInfo area = 22;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ListEntitiesRequest {
|
message ListEntitiesRequest {
|
||||||
@@ -260,6 +283,7 @@ enum EntityCategory {
|
|||||||
// ==================== BINARY SENSOR ====================
|
// ==================== BINARY SENSOR ====================
|
||||||
message ListEntitiesBinarySensorResponse {
|
message ListEntitiesBinarySensorResponse {
|
||||||
option (id) = 12;
|
option (id) = 12;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_BINARY_SENSOR";
|
option (ifdef) = "USE_BINARY_SENSOR";
|
||||||
|
|
||||||
@@ -273,9 +297,11 @@ message ListEntitiesBinarySensorResponse {
|
|||||||
bool disabled_by_default = 7;
|
bool disabled_by_default = 7;
|
||||||
string icon = 8;
|
string icon = 8;
|
||||||
EntityCategory entity_category = 9;
|
EntityCategory entity_category = 9;
|
||||||
|
uint32 device_id = 10;
|
||||||
}
|
}
|
||||||
message BinarySensorStateResponse {
|
message BinarySensorStateResponse {
|
||||||
option (id) = 21;
|
option (id) = 21;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_BINARY_SENSOR";
|
option (ifdef) = "USE_BINARY_SENSOR";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
@@ -285,11 +311,13 @@ message BinarySensorStateResponse {
|
|||||||
// If the binary sensor does not have a valid state yet.
|
// If the binary sensor does not have a valid state yet.
|
||||||
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
|
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
|
||||||
bool missing_state = 3;
|
bool missing_state = 3;
|
||||||
|
uint32 device_id = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==================== COVER ====================
|
// ==================== COVER ====================
|
||||||
message ListEntitiesCoverResponse {
|
message ListEntitiesCoverResponse {
|
||||||
option (id) = 13;
|
option (id) = 13;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_COVER";
|
option (ifdef) = "USE_COVER";
|
||||||
|
|
||||||
@@ -306,6 +334,7 @@ message ListEntitiesCoverResponse {
|
|||||||
string icon = 10;
|
string icon = 10;
|
||||||
EntityCategory entity_category = 11;
|
EntityCategory entity_category = 11;
|
||||||
bool supports_stop = 12;
|
bool supports_stop = 12;
|
||||||
|
uint32 device_id = 13;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum LegacyCoverState {
|
enum LegacyCoverState {
|
||||||
@@ -319,6 +348,7 @@ enum CoverOperation {
|
|||||||
}
|
}
|
||||||
message CoverStateResponse {
|
message CoverStateResponse {
|
||||||
option (id) = 22;
|
option (id) = 22;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_COVER";
|
option (ifdef) = "USE_COVER";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
@@ -331,6 +361,7 @@ message CoverStateResponse {
|
|||||||
float position = 3;
|
float position = 3;
|
||||||
float tilt = 4;
|
float tilt = 4;
|
||||||
CoverOperation current_operation = 5;
|
CoverOperation current_operation = 5;
|
||||||
|
uint32 device_id = 6;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum LegacyCoverCommand {
|
enum LegacyCoverCommand {
|
||||||
@@ -361,6 +392,7 @@ message CoverCommandRequest {
|
|||||||
// ==================== FAN ====================
|
// ==================== FAN ====================
|
||||||
message ListEntitiesFanResponse {
|
message ListEntitiesFanResponse {
|
||||||
option (id) = 14;
|
option (id) = 14;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_FAN";
|
option (ifdef) = "USE_FAN";
|
||||||
|
|
||||||
@@ -377,6 +409,7 @@ message ListEntitiesFanResponse {
|
|||||||
string icon = 10;
|
string icon = 10;
|
||||||
EntityCategory entity_category = 11;
|
EntityCategory entity_category = 11;
|
||||||
repeated string supported_preset_modes = 12;
|
repeated string supported_preset_modes = 12;
|
||||||
|
uint32 device_id = 13;
|
||||||
}
|
}
|
||||||
enum FanSpeed {
|
enum FanSpeed {
|
||||||
FAN_SPEED_LOW = 0;
|
FAN_SPEED_LOW = 0;
|
||||||
@@ -389,6 +422,7 @@ enum FanDirection {
|
|||||||
}
|
}
|
||||||
message FanStateResponse {
|
message FanStateResponse {
|
||||||
option (id) = 23;
|
option (id) = 23;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_FAN";
|
option (ifdef) = "USE_FAN";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
@@ -400,6 +434,7 @@ message FanStateResponse {
|
|||||||
FanDirection direction = 5;
|
FanDirection direction = 5;
|
||||||
int32 speed_level = 6;
|
int32 speed_level = 6;
|
||||||
string preset_mode = 7;
|
string preset_mode = 7;
|
||||||
|
uint32 device_id = 8;
|
||||||
}
|
}
|
||||||
message FanCommandRequest {
|
message FanCommandRequest {
|
||||||
option (id) = 31;
|
option (id) = 31;
|
||||||
@@ -426,7 +461,8 @@ message FanCommandRequest {
|
|||||||
enum ColorMode {
|
enum ColorMode {
|
||||||
COLOR_MODE_UNKNOWN = 0;
|
COLOR_MODE_UNKNOWN = 0;
|
||||||
COLOR_MODE_ON_OFF = 1;
|
COLOR_MODE_ON_OFF = 1;
|
||||||
COLOR_MODE_BRIGHTNESS = 2;
|
COLOR_MODE_LEGACY_BRIGHTNESS = 2;
|
||||||
|
COLOR_MODE_BRIGHTNESS = 3;
|
||||||
COLOR_MODE_WHITE = 7;
|
COLOR_MODE_WHITE = 7;
|
||||||
COLOR_MODE_COLOR_TEMPERATURE = 11;
|
COLOR_MODE_COLOR_TEMPERATURE = 11;
|
||||||
COLOR_MODE_COLD_WARM_WHITE = 19;
|
COLOR_MODE_COLD_WARM_WHITE = 19;
|
||||||
@@ -437,6 +473,7 @@ enum ColorMode {
|
|||||||
}
|
}
|
||||||
message ListEntitiesLightResponse {
|
message ListEntitiesLightResponse {
|
||||||
option (id) = 15;
|
option (id) = 15;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_LIGHT";
|
option (ifdef) = "USE_LIGHT";
|
||||||
|
|
||||||
@@ -457,9 +494,11 @@ message ListEntitiesLightResponse {
|
|||||||
bool disabled_by_default = 13;
|
bool disabled_by_default = 13;
|
||||||
string icon = 14;
|
string icon = 14;
|
||||||
EntityCategory entity_category = 15;
|
EntityCategory entity_category = 15;
|
||||||
|
uint32 device_id = 16;
|
||||||
}
|
}
|
||||||
message LightStateResponse {
|
message LightStateResponse {
|
||||||
option (id) = 24;
|
option (id) = 24;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_LIGHT";
|
option (ifdef) = "USE_LIGHT";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
@@ -477,6 +516,7 @@ message LightStateResponse {
|
|||||||
float cold_white = 12;
|
float cold_white = 12;
|
||||||
float warm_white = 13;
|
float warm_white = 13;
|
||||||
string effect = 9;
|
string effect = 9;
|
||||||
|
uint32 device_id = 14;
|
||||||
}
|
}
|
||||||
message LightCommandRequest {
|
message LightCommandRequest {
|
||||||
option (id) = 32;
|
option (id) = 32;
|
||||||
@@ -529,6 +569,7 @@ enum SensorLastResetType {
|
|||||||
|
|
||||||
message ListEntitiesSensorResponse {
|
message ListEntitiesSensorResponse {
|
||||||
option (id) = 16;
|
option (id) = 16;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_SENSOR";
|
option (ifdef) = "USE_SENSOR";
|
||||||
|
|
||||||
@@ -547,9 +588,11 @@ message ListEntitiesSensorResponse {
|
|||||||
SensorLastResetType legacy_last_reset_type = 11;
|
SensorLastResetType legacy_last_reset_type = 11;
|
||||||
bool disabled_by_default = 12;
|
bool disabled_by_default = 12;
|
||||||
EntityCategory entity_category = 13;
|
EntityCategory entity_category = 13;
|
||||||
|
uint32 device_id = 14;
|
||||||
}
|
}
|
||||||
message SensorStateResponse {
|
message SensorStateResponse {
|
||||||
option (id) = 25;
|
option (id) = 25;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_SENSOR";
|
option (ifdef) = "USE_SENSOR";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
@@ -559,11 +602,13 @@ message SensorStateResponse {
|
|||||||
// If the sensor does not have a valid state yet.
|
// If the sensor does not have a valid state yet.
|
||||||
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
|
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
|
||||||
bool missing_state = 3;
|
bool missing_state = 3;
|
||||||
|
uint32 device_id = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==================== SWITCH ====================
|
// ==================== SWITCH ====================
|
||||||
message ListEntitiesSwitchResponse {
|
message ListEntitiesSwitchResponse {
|
||||||
option (id) = 17;
|
option (id) = 17;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_SWITCH";
|
option (ifdef) = "USE_SWITCH";
|
||||||
|
|
||||||
@@ -577,15 +622,18 @@ message ListEntitiesSwitchResponse {
|
|||||||
bool disabled_by_default = 7;
|
bool disabled_by_default = 7;
|
||||||
EntityCategory entity_category = 8;
|
EntityCategory entity_category = 8;
|
||||||
string device_class = 9;
|
string device_class = 9;
|
||||||
|
uint32 device_id = 10;
|
||||||
}
|
}
|
||||||
message SwitchStateResponse {
|
message SwitchStateResponse {
|
||||||
option (id) = 26;
|
option (id) = 26;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_SWITCH";
|
option (ifdef) = "USE_SWITCH";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
|
|
||||||
fixed32 key = 1;
|
fixed32 key = 1;
|
||||||
bool state = 2;
|
bool state = 2;
|
||||||
|
uint32 device_id = 3;
|
||||||
}
|
}
|
||||||
message SwitchCommandRequest {
|
message SwitchCommandRequest {
|
||||||
option (id) = 33;
|
option (id) = 33;
|
||||||
@@ -600,6 +648,7 @@ message SwitchCommandRequest {
|
|||||||
// ==================== TEXT SENSOR ====================
|
// ==================== TEXT SENSOR ====================
|
||||||
message ListEntitiesTextSensorResponse {
|
message ListEntitiesTextSensorResponse {
|
||||||
option (id) = 18;
|
option (id) = 18;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_TEXT_SENSOR";
|
option (ifdef) = "USE_TEXT_SENSOR";
|
||||||
|
|
||||||
@@ -612,9 +661,11 @@ message ListEntitiesTextSensorResponse {
|
|||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
EntityCategory entity_category = 7;
|
EntityCategory entity_category = 7;
|
||||||
string device_class = 8;
|
string device_class = 8;
|
||||||
|
uint32 device_id = 9;
|
||||||
}
|
}
|
||||||
message TextSensorStateResponse {
|
message TextSensorStateResponse {
|
||||||
option (id) = 27;
|
option (id) = 27;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_TEXT_SENSOR";
|
option (ifdef) = "USE_TEXT_SENSOR";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
@@ -624,6 +675,7 @@ message TextSensorStateResponse {
|
|||||||
// If the text sensor does not have a valid state yet.
|
// If the text sensor does not have a valid state yet.
|
||||||
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
|
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
|
||||||
bool missing_state = 3;
|
bool missing_state = 3;
|
||||||
|
uint32 device_id = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==================== SUBSCRIBE LOGS ====================
|
// ==================== SUBSCRIBE LOGS ====================
|
||||||
@@ -650,10 +702,27 @@ message SubscribeLogsResponse {
|
|||||||
option (no_delay) = false;
|
option (no_delay) = false;
|
||||||
|
|
||||||
LogLevel level = 1;
|
LogLevel level = 1;
|
||||||
string message = 3;
|
bytes message = 3;
|
||||||
bool send_failed = 4;
|
bool send_failed = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ==================== NOISE ENCRYPTION ====================
|
||||||
|
message NoiseEncryptionSetKeyRequest {
|
||||||
|
option (id) = 124;
|
||||||
|
option (source) = SOURCE_CLIENT;
|
||||||
|
option (ifdef) = "USE_API_NOISE";
|
||||||
|
|
||||||
|
bytes key = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message NoiseEncryptionSetKeyResponse {
|
||||||
|
option (id) = 125;
|
||||||
|
option (source) = SOURCE_SERVER;
|
||||||
|
option (ifdef) = "USE_API_NOISE";
|
||||||
|
|
||||||
|
bool success = 1;
|
||||||
|
}
|
||||||
|
|
||||||
// ==================== HOMEASSISTANT.SERVICE ====================
|
// ==================== HOMEASSISTANT.SERVICE ====================
|
||||||
message SubscribeHomeassistantServicesRequest {
|
message SubscribeHomeassistantServicesRequest {
|
||||||
option (id) = 34;
|
option (id) = 34;
|
||||||
@@ -765,6 +834,7 @@ message ExecuteServiceRequest {
|
|||||||
// ==================== CAMERA ====================
|
// ==================== CAMERA ====================
|
||||||
message ListEntitiesCameraResponse {
|
message ListEntitiesCameraResponse {
|
||||||
option (id) = 43;
|
option (id) = 43;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_ESP32_CAMERA";
|
option (ifdef) = "USE_ESP32_CAMERA";
|
||||||
|
|
||||||
@@ -775,6 +845,7 @@ message ListEntitiesCameraResponse {
|
|||||||
bool disabled_by_default = 5;
|
bool disabled_by_default = 5;
|
||||||
string icon = 6;
|
string icon = 6;
|
||||||
EntityCategory entity_category = 7;
|
EntityCategory entity_category = 7;
|
||||||
|
uint32 device_id = 8;
|
||||||
}
|
}
|
||||||
|
|
||||||
message CameraImageResponse {
|
message CameraImageResponse {
|
||||||
@@ -845,6 +916,7 @@ enum ClimatePreset {
|
|||||||
}
|
}
|
||||||
message ListEntitiesClimateResponse {
|
message ListEntitiesClimateResponse {
|
||||||
option (id) = 46;
|
option (id) = 46;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_CLIMATE";
|
option (ifdef) = "USE_CLIMATE";
|
||||||
|
|
||||||
@@ -876,9 +948,11 @@ message ListEntitiesClimateResponse {
|
|||||||
bool supports_target_humidity = 23;
|
bool supports_target_humidity = 23;
|
||||||
float visual_min_humidity = 24;
|
float visual_min_humidity = 24;
|
||||||
float visual_max_humidity = 25;
|
float visual_max_humidity = 25;
|
||||||
|
uint32 device_id = 26;
|
||||||
}
|
}
|
||||||
message ClimateStateResponse {
|
message ClimateStateResponse {
|
||||||
option (id) = 47;
|
option (id) = 47;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_CLIMATE";
|
option (ifdef) = "USE_CLIMATE";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
@@ -889,6 +963,7 @@ message ClimateStateResponse {
|
|||||||
float target_temperature = 4;
|
float target_temperature = 4;
|
||||||
float target_temperature_low = 5;
|
float target_temperature_low = 5;
|
||||||
float target_temperature_high = 6;
|
float target_temperature_high = 6;
|
||||||
|
// For older peers, equal to preset == CLIMATE_PRESET_AWAY
|
||||||
bool unused_legacy_away = 7;
|
bool unused_legacy_away = 7;
|
||||||
ClimateAction action = 8;
|
ClimateAction action = 8;
|
||||||
ClimateFanMode fan_mode = 9;
|
ClimateFanMode fan_mode = 9;
|
||||||
@@ -898,6 +973,7 @@ message ClimateStateResponse {
|
|||||||
string custom_preset = 13;
|
string custom_preset = 13;
|
||||||
float current_humidity = 14;
|
float current_humidity = 14;
|
||||||
float target_humidity = 15;
|
float target_humidity = 15;
|
||||||
|
uint32 device_id = 16;
|
||||||
}
|
}
|
||||||
message ClimateCommandRequest {
|
message ClimateCommandRequest {
|
||||||
option (id) = 48;
|
option (id) = 48;
|
||||||
@@ -914,6 +990,7 @@ message ClimateCommandRequest {
|
|||||||
float target_temperature_low = 7;
|
float target_temperature_low = 7;
|
||||||
bool has_target_temperature_high = 8;
|
bool has_target_temperature_high = 8;
|
||||||
float target_temperature_high = 9;
|
float target_temperature_high = 9;
|
||||||
|
// legacy, for older peers, newer ones should use CLIMATE_PRESET_AWAY in preset
|
||||||
bool unused_has_legacy_away = 10;
|
bool unused_has_legacy_away = 10;
|
||||||
bool unused_legacy_away = 11;
|
bool unused_legacy_away = 11;
|
||||||
bool has_fan_mode = 12;
|
bool has_fan_mode = 12;
|
||||||
@@ -938,6 +1015,7 @@ enum NumberMode {
|
|||||||
}
|
}
|
||||||
message ListEntitiesNumberResponse {
|
message ListEntitiesNumberResponse {
|
||||||
option (id) = 49;
|
option (id) = 49;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_NUMBER";
|
option (ifdef) = "USE_NUMBER";
|
||||||
|
|
||||||
@@ -955,9 +1033,11 @@ message ListEntitiesNumberResponse {
|
|||||||
string unit_of_measurement = 11;
|
string unit_of_measurement = 11;
|
||||||
NumberMode mode = 12;
|
NumberMode mode = 12;
|
||||||
string device_class = 13;
|
string device_class = 13;
|
||||||
|
uint32 device_id = 14;
|
||||||
}
|
}
|
||||||
message NumberStateResponse {
|
message NumberStateResponse {
|
||||||
option (id) = 50;
|
option (id) = 50;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_NUMBER";
|
option (ifdef) = "USE_NUMBER";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
@@ -967,6 +1047,7 @@ message NumberStateResponse {
|
|||||||
// If the number does not have a valid state yet.
|
// If the number does not have a valid state yet.
|
||||||
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
|
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
|
||||||
bool missing_state = 3;
|
bool missing_state = 3;
|
||||||
|
uint32 device_id = 4;
|
||||||
}
|
}
|
||||||
message NumberCommandRequest {
|
message NumberCommandRequest {
|
||||||
option (id) = 51;
|
option (id) = 51;
|
||||||
@@ -981,6 +1062,7 @@ message NumberCommandRequest {
|
|||||||
// ==================== SELECT ====================
|
// ==================== SELECT ====================
|
||||||
message ListEntitiesSelectResponse {
|
message ListEntitiesSelectResponse {
|
||||||
option (id) = 52;
|
option (id) = 52;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_SELECT";
|
option (ifdef) = "USE_SELECT";
|
||||||
|
|
||||||
@@ -993,9 +1075,11 @@ message ListEntitiesSelectResponse {
|
|||||||
repeated string options = 6;
|
repeated string options = 6;
|
||||||
bool disabled_by_default = 7;
|
bool disabled_by_default = 7;
|
||||||
EntityCategory entity_category = 8;
|
EntityCategory entity_category = 8;
|
||||||
|
uint32 device_id = 9;
|
||||||
}
|
}
|
||||||
message SelectStateResponse {
|
message SelectStateResponse {
|
||||||
option (id) = 53;
|
option (id) = 53;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_SELECT";
|
option (ifdef) = "USE_SELECT";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
@@ -1005,6 +1089,7 @@ message SelectStateResponse {
|
|||||||
// If the select does not have a valid state yet.
|
// If the select does not have a valid state yet.
|
||||||
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
|
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
|
||||||
bool missing_state = 3;
|
bool missing_state = 3;
|
||||||
|
uint32 device_id = 4;
|
||||||
}
|
}
|
||||||
message SelectCommandRequest {
|
message SelectCommandRequest {
|
||||||
option (id) = 54;
|
option (id) = 54;
|
||||||
@@ -1016,6 +1101,53 @@ message SelectCommandRequest {
|
|||||||
string state = 2;
|
string state = 2;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// ==================== SIREN ====================
|
||||||
|
message ListEntitiesSirenResponse {
|
||||||
|
option (id) = 55;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
|
option (source) = SOURCE_SERVER;
|
||||||
|
option (ifdef) = "USE_SIREN";
|
||||||
|
|
||||||
|
string object_id = 1;
|
||||||
|
fixed32 key = 2;
|
||||||
|
string name = 3;
|
||||||
|
string unique_id = 4;
|
||||||
|
|
||||||
|
string icon = 5;
|
||||||
|
bool disabled_by_default = 6;
|
||||||
|
repeated string tones = 7;
|
||||||
|
bool supports_duration = 8;
|
||||||
|
bool supports_volume = 9;
|
||||||
|
EntityCategory entity_category = 10;
|
||||||
|
uint32 device_id = 11;
|
||||||
|
}
|
||||||
|
message SirenStateResponse {
|
||||||
|
option (id) = 56;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
|
option (source) = SOURCE_SERVER;
|
||||||
|
option (ifdef) = "USE_SIREN";
|
||||||
|
option (no_delay) = true;
|
||||||
|
|
||||||
|
fixed32 key = 1;
|
||||||
|
bool state = 2;
|
||||||
|
uint32 device_id = 3;
|
||||||
|
}
|
||||||
|
message SirenCommandRequest {
|
||||||
|
option (id) = 57;
|
||||||
|
option (source) = SOURCE_CLIENT;
|
||||||
|
option (ifdef) = "USE_SIREN";
|
||||||
|
option (no_delay) = true;
|
||||||
|
|
||||||
|
fixed32 key = 1;
|
||||||
|
bool has_state = 2;
|
||||||
|
bool state = 3;
|
||||||
|
bool has_tone = 4;
|
||||||
|
string tone = 5;
|
||||||
|
bool has_duration = 6;
|
||||||
|
uint32 duration = 7;
|
||||||
|
bool has_volume = 8;
|
||||||
|
float volume = 9;
|
||||||
|
}
|
||||||
|
|
||||||
// ==================== LOCK ====================
|
// ==================== LOCK ====================
|
||||||
enum LockState {
|
enum LockState {
|
||||||
@@ -1033,6 +1165,7 @@ enum LockCommand {
|
|||||||
}
|
}
|
||||||
message ListEntitiesLockResponse {
|
message ListEntitiesLockResponse {
|
||||||
option (id) = 58;
|
option (id) = 58;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_LOCK";
|
option (ifdef) = "USE_LOCK";
|
||||||
|
|
||||||
@@ -1051,14 +1184,17 @@ message ListEntitiesLockResponse {
|
|||||||
|
|
||||||
// Not yet implemented:
|
// Not yet implemented:
|
||||||
string code_format = 11;
|
string code_format = 11;
|
||||||
|
uint32 device_id = 12;
|
||||||
}
|
}
|
||||||
message LockStateResponse {
|
message LockStateResponse {
|
||||||
option (id) = 59;
|
option (id) = 59;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_LOCK";
|
option (ifdef) = "USE_LOCK";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
fixed32 key = 1;
|
fixed32 key = 1;
|
||||||
LockState state = 2;
|
LockState state = 2;
|
||||||
|
uint32 device_id = 3;
|
||||||
}
|
}
|
||||||
message LockCommandRequest {
|
message LockCommandRequest {
|
||||||
option (id) = 60;
|
option (id) = 60;
|
||||||
@@ -1076,6 +1212,7 @@ message LockCommandRequest {
|
|||||||
// ==================== BUTTON ====================
|
// ==================== BUTTON ====================
|
||||||
message ListEntitiesButtonResponse {
|
message ListEntitiesButtonResponse {
|
||||||
option (id) = 61;
|
option (id) = 61;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_BUTTON";
|
option (ifdef) = "USE_BUTTON";
|
||||||
|
|
||||||
@@ -1088,6 +1225,7 @@ message ListEntitiesButtonResponse {
|
|||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
EntityCategory entity_category = 7;
|
EntityCategory entity_category = 7;
|
||||||
string device_class = 8;
|
string device_class = 8;
|
||||||
|
uint32 device_id = 9;
|
||||||
}
|
}
|
||||||
message ButtonCommandRequest {
|
message ButtonCommandRequest {
|
||||||
option (id) = 62;
|
option (id) = 62;
|
||||||
@@ -1127,6 +1265,7 @@ message MediaPlayerSupportedFormat {
|
|||||||
}
|
}
|
||||||
message ListEntitiesMediaPlayerResponse {
|
message ListEntitiesMediaPlayerResponse {
|
||||||
option (id) = 63;
|
option (id) = 63;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_MEDIA_PLAYER";
|
option (ifdef) = "USE_MEDIA_PLAYER";
|
||||||
|
|
||||||
@@ -1142,9 +1281,12 @@ message ListEntitiesMediaPlayerResponse {
|
|||||||
bool supports_pause = 8;
|
bool supports_pause = 8;
|
||||||
|
|
||||||
repeated MediaPlayerSupportedFormat supported_formats = 9;
|
repeated MediaPlayerSupportedFormat supported_formats = 9;
|
||||||
|
|
||||||
|
uint32 device_id = 10;
|
||||||
}
|
}
|
||||||
message MediaPlayerStateResponse {
|
message MediaPlayerStateResponse {
|
||||||
option (id) = 64;
|
option (id) = 64;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_MEDIA_PLAYER";
|
option (ifdef) = "USE_MEDIA_PLAYER";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
@@ -1152,6 +1294,7 @@ message MediaPlayerStateResponse {
|
|||||||
MediaPlayerState state = 2;
|
MediaPlayerState state = 2;
|
||||||
float volume = 3;
|
float volume = 3;
|
||||||
bool muted = 4;
|
bool muted = 4;
|
||||||
|
uint32 device_id = 5;
|
||||||
}
|
}
|
||||||
message MediaPlayerCommandRequest {
|
message MediaPlayerCommandRequest {
|
||||||
option (id) = 65;
|
option (id) = 65;
|
||||||
@@ -1185,8 +1328,8 @@ message SubscribeBluetoothLEAdvertisementsRequest {
|
|||||||
|
|
||||||
message BluetoothServiceData {
|
message BluetoothServiceData {
|
||||||
string uuid = 1;
|
string uuid = 1;
|
||||||
repeated uint32 legacy_data = 2 [deprecated = true];
|
repeated uint32 legacy_data = 2 [deprecated = true]; // Removed in api version 1.7
|
||||||
bytes data = 3; // Changed in proto version 1.7
|
bytes data = 3; // Added in api version 1.7
|
||||||
}
|
}
|
||||||
message BluetoothLEAdvertisementResponse {
|
message BluetoothLEAdvertisementResponse {
|
||||||
option (id) = 67;
|
option (id) = 67;
|
||||||
@@ -1195,7 +1338,7 @@ message BluetoothLEAdvertisementResponse {
|
|||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
|
|
||||||
uint64 address = 1;
|
uint64 address = 1;
|
||||||
string name = 2;
|
bytes name = 2;
|
||||||
sint32 rssi = 3;
|
sint32 rssi = 3;
|
||||||
|
|
||||||
repeated string service_uuids = 4;
|
repeated string service_uuids = 4;
|
||||||
@@ -1451,7 +1594,38 @@ message BluetoothDeviceClearCacheResponse {
|
|||||||
int32 error = 3;
|
int32 error = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==================== PUSH TO TALK ====================
|
enum BluetoothScannerState {
|
||||||
|
BLUETOOTH_SCANNER_STATE_IDLE = 0;
|
||||||
|
BLUETOOTH_SCANNER_STATE_STARTING = 1;
|
||||||
|
BLUETOOTH_SCANNER_STATE_RUNNING = 2;
|
||||||
|
BLUETOOTH_SCANNER_STATE_FAILED = 3;
|
||||||
|
BLUETOOTH_SCANNER_STATE_STOPPING = 4;
|
||||||
|
BLUETOOTH_SCANNER_STATE_STOPPED = 5;
|
||||||
|
}
|
||||||
|
|
||||||
|
enum BluetoothScannerMode {
|
||||||
|
BLUETOOTH_SCANNER_MODE_PASSIVE = 0;
|
||||||
|
BLUETOOTH_SCANNER_MODE_ACTIVE = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message BluetoothScannerStateResponse {
|
||||||
|
option(id) = 126;
|
||||||
|
option(source) = SOURCE_SERVER;
|
||||||
|
option(ifdef) = "USE_BLUETOOTH_PROXY";
|
||||||
|
|
||||||
|
BluetoothScannerState state = 1;
|
||||||
|
BluetoothScannerMode mode = 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
message BluetoothScannerSetModeRequest {
|
||||||
|
option(id) = 127;
|
||||||
|
option(source) = SOURCE_CLIENT;
|
||||||
|
option(ifdef) = "USE_BLUETOOTH_PROXY";
|
||||||
|
|
||||||
|
BluetoothScannerMode mode = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ==================== VOICE ASSISTANT ====================
|
||||||
enum VoiceAssistantSubscribeFlag {
|
enum VoiceAssistantSubscribeFlag {
|
||||||
VOICE_ASSISTANT_SUBSCRIBE_NONE = 0;
|
VOICE_ASSISTANT_SUBSCRIBE_NONE = 0;
|
||||||
VOICE_ASSISTANT_SUBSCRIBE_API_AUDIO = 1;
|
VOICE_ASSISTANT_SUBSCRIBE_API_AUDIO = 1;
|
||||||
@@ -1515,6 +1689,7 @@ enum VoiceAssistantEvent {
|
|||||||
VOICE_ASSISTANT_STT_VAD_END = 12;
|
VOICE_ASSISTANT_STT_VAD_END = 12;
|
||||||
VOICE_ASSISTANT_TTS_STREAM_START = 98;
|
VOICE_ASSISTANT_TTS_STREAM_START = 98;
|
||||||
VOICE_ASSISTANT_TTS_STREAM_END = 99;
|
VOICE_ASSISTANT_TTS_STREAM_END = 99;
|
||||||
|
VOICE_ASSISTANT_INTENT_PROGRESS = 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
message VoiceAssistantEventData {
|
message VoiceAssistantEventData {
|
||||||
@@ -1635,6 +1810,7 @@ enum AlarmControlPanelStateCommand {
|
|||||||
|
|
||||||
message ListEntitiesAlarmControlPanelResponse {
|
message ListEntitiesAlarmControlPanelResponse {
|
||||||
option (id) = 94;
|
option (id) = 94;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_ALARM_CONTROL_PANEL";
|
option (ifdef) = "USE_ALARM_CONTROL_PANEL";
|
||||||
|
|
||||||
@@ -1648,15 +1824,18 @@ message ListEntitiesAlarmControlPanelResponse {
|
|||||||
uint32 supported_features = 8;
|
uint32 supported_features = 8;
|
||||||
bool requires_code = 9;
|
bool requires_code = 9;
|
||||||
bool requires_code_to_arm = 10;
|
bool requires_code_to_arm = 10;
|
||||||
|
uint32 device_id = 11;
|
||||||
}
|
}
|
||||||
|
|
||||||
message AlarmControlPanelStateResponse {
|
message AlarmControlPanelStateResponse {
|
||||||
option (id) = 95;
|
option (id) = 95;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_ALARM_CONTROL_PANEL";
|
option (ifdef) = "USE_ALARM_CONTROL_PANEL";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
fixed32 key = 1;
|
fixed32 key = 1;
|
||||||
AlarmControlPanelState state = 2;
|
AlarmControlPanelState state = 2;
|
||||||
|
uint32 device_id = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
message AlarmControlPanelCommandRequest {
|
message AlarmControlPanelCommandRequest {
|
||||||
@@ -1676,6 +1855,7 @@ enum TextMode {
|
|||||||
}
|
}
|
||||||
message ListEntitiesTextResponse {
|
message ListEntitiesTextResponse {
|
||||||
option (id) = 97;
|
option (id) = 97;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_TEXT";
|
option (ifdef) = "USE_TEXT";
|
||||||
|
|
||||||
@@ -1691,9 +1871,11 @@ message ListEntitiesTextResponse {
|
|||||||
uint32 max_length = 9;
|
uint32 max_length = 9;
|
||||||
string pattern = 10;
|
string pattern = 10;
|
||||||
TextMode mode = 11;
|
TextMode mode = 11;
|
||||||
|
uint32 device_id = 12;
|
||||||
}
|
}
|
||||||
message TextStateResponse {
|
message TextStateResponse {
|
||||||
option (id) = 98;
|
option (id) = 98;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_TEXT";
|
option (ifdef) = "USE_TEXT";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
@@ -1703,6 +1885,7 @@ message TextStateResponse {
|
|||||||
// If the Text does not have a valid state yet.
|
// If the Text does not have a valid state yet.
|
||||||
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
|
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
|
||||||
bool missing_state = 3;
|
bool missing_state = 3;
|
||||||
|
uint32 device_id = 4;
|
||||||
}
|
}
|
||||||
message TextCommandRequest {
|
message TextCommandRequest {
|
||||||
option (id) = 99;
|
option (id) = 99;
|
||||||
@@ -1718,6 +1901,7 @@ message TextCommandRequest {
|
|||||||
// ==================== DATETIME DATE ====================
|
// ==================== DATETIME DATE ====================
|
||||||
message ListEntitiesDateResponse {
|
message ListEntitiesDateResponse {
|
||||||
option (id) = 100;
|
option (id) = 100;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_DATETIME_DATE";
|
option (ifdef) = "USE_DATETIME_DATE";
|
||||||
|
|
||||||
@@ -1729,9 +1913,11 @@ message ListEntitiesDateResponse {
|
|||||||
string icon = 5;
|
string icon = 5;
|
||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
EntityCategory entity_category = 7;
|
EntityCategory entity_category = 7;
|
||||||
|
uint32 device_id = 8;
|
||||||
}
|
}
|
||||||
message DateStateResponse {
|
message DateStateResponse {
|
||||||
option (id) = 101;
|
option (id) = 101;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_DATETIME_DATE";
|
option (ifdef) = "USE_DATETIME_DATE";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
@@ -1743,6 +1929,7 @@ message DateStateResponse {
|
|||||||
uint32 year = 3;
|
uint32 year = 3;
|
||||||
uint32 month = 4;
|
uint32 month = 4;
|
||||||
uint32 day = 5;
|
uint32 day = 5;
|
||||||
|
uint32 device_id = 6;
|
||||||
}
|
}
|
||||||
message DateCommandRequest {
|
message DateCommandRequest {
|
||||||
option (id) = 102;
|
option (id) = 102;
|
||||||
@@ -1759,6 +1946,7 @@ message DateCommandRequest {
|
|||||||
// ==================== DATETIME TIME ====================
|
// ==================== DATETIME TIME ====================
|
||||||
message ListEntitiesTimeResponse {
|
message ListEntitiesTimeResponse {
|
||||||
option (id) = 103;
|
option (id) = 103;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_DATETIME_TIME";
|
option (ifdef) = "USE_DATETIME_TIME";
|
||||||
|
|
||||||
@@ -1770,9 +1958,11 @@ message ListEntitiesTimeResponse {
|
|||||||
string icon = 5;
|
string icon = 5;
|
||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
EntityCategory entity_category = 7;
|
EntityCategory entity_category = 7;
|
||||||
|
uint32 device_id = 8;
|
||||||
}
|
}
|
||||||
message TimeStateResponse {
|
message TimeStateResponse {
|
||||||
option (id) = 104;
|
option (id) = 104;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_DATETIME_TIME";
|
option (ifdef) = "USE_DATETIME_TIME";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
@@ -1784,6 +1974,7 @@ message TimeStateResponse {
|
|||||||
uint32 hour = 3;
|
uint32 hour = 3;
|
||||||
uint32 minute = 4;
|
uint32 minute = 4;
|
||||||
uint32 second = 5;
|
uint32 second = 5;
|
||||||
|
uint32 device_id = 6;
|
||||||
}
|
}
|
||||||
message TimeCommandRequest {
|
message TimeCommandRequest {
|
||||||
option (id) = 105;
|
option (id) = 105;
|
||||||
@@ -1800,6 +1991,7 @@ message TimeCommandRequest {
|
|||||||
// ==================== EVENT ====================
|
// ==================== EVENT ====================
|
||||||
message ListEntitiesEventResponse {
|
message ListEntitiesEventResponse {
|
||||||
option (id) = 107;
|
option (id) = 107;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_EVENT";
|
option (ifdef) = "USE_EVENT";
|
||||||
|
|
||||||
@@ -1814,19 +2006,23 @@ message ListEntitiesEventResponse {
|
|||||||
string device_class = 8;
|
string device_class = 8;
|
||||||
|
|
||||||
repeated string event_types = 9;
|
repeated string event_types = 9;
|
||||||
|
uint32 device_id = 10;
|
||||||
}
|
}
|
||||||
message EventResponse {
|
message EventResponse {
|
||||||
option (id) = 108;
|
option (id) = 108;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_EVENT";
|
option (ifdef) = "USE_EVENT";
|
||||||
|
|
||||||
fixed32 key = 1;
|
fixed32 key = 1;
|
||||||
string event_type = 2;
|
string event_type = 2;
|
||||||
|
uint32 device_id = 3;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ==================== VALVE ====================
|
// ==================== VALVE ====================
|
||||||
message ListEntitiesValveResponse {
|
message ListEntitiesValveResponse {
|
||||||
option (id) = 109;
|
option (id) = 109;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_VALVE";
|
option (ifdef) = "USE_VALVE";
|
||||||
|
|
||||||
@@ -1843,6 +2039,7 @@ message ListEntitiesValveResponse {
|
|||||||
bool assumed_state = 9;
|
bool assumed_state = 9;
|
||||||
bool supports_position = 10;
|
bool supports_position = 10;
|
||||||
bool supports_stop = 11;
|
bool supports_stop = 11;
|
||||||
|
uint32 device_id = 12;
|
||||||
}
|
}
|
||||||
|
|
||||||
enum ValveOperation {
|
enum ValveOperation {
|
||||||
@@ -1852,6 +2049,7 @@ enum ValveOperation {
|
|||||||
}
|
}
|
||||||
message ValveStateResponse {
|
message ValveStateResponse {
|
||||||
option (id) = 110;
|
option (id) = 110;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_VALVE";
|
option (ifdef) = "USE_VALVE";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
@@ -1859,6 +2057,7 @@ message ValveStateResponse {
|
|||||||
fixed32 key = 1;
|
fixed32 key = 1;
|
||||||
float position = 2;
|
float position = 2;
|
||||||
ValveOperation current_operation = 3;
|
ValveOperation current_operation = 3;
|
||||||
|
uint32 device_id = 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
message ValveCommandRequest {
|
message ValveCommandRequest {
|
||||||
@@ -1876,6 +2075,7 @@ message ValveCommandRequest {
|
|||||||
// ==================== DATETIME DATETIME ====================
|
// ==================== DATETIME DATETIME ====================
|
||||||
message ListEntitiesDateTimeResponse {
|
message ListEntitiesDateTimeResponse {
|
||||||
option (id) = 112;
|
option (id) = 112;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_DATETIME_DATETIME";
|
option (ifdef) = "USE_DATETIME_DATETIME";
|
||||||
|
|
||||||
@@ -1887,9 +2087,11 @@ message ListEntitiesDateTimeResponse {
|
|||||||
string icon = 5;
|
string icon = 5;
|
||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
EntityCategory entity_category = 7;
|
EntityCategory entity_category = 7;
|
||||||
|
uint32 device_id = 8;
|
||||||
}
|
}
|
||||||
message DateTimeStateResponse {
|
message DateTimeStateResponse {
|
||||||
option (id) = 113;
|
option (id) = 113;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_DATETIME_DATETIME";
|
option (ifdef) = "USE_DATETIME_DATETIME";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
@@ -1899,6 +2101,7 @@ message DateTimeStateResponse {
|
|||||||
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
|
// Equivalent to `!obj->has_state()` - inverse logic to make state packets smaller
|
||||||
bool missing_state = 2;
|
bool missing_state = 2;
|
||||||
fixed32 epoch_seconds = 3;
|
fixed32 epoch_seconds = 3;
|
||||||
|
uint32 device_id = 4;
|
||||||
}
|
}
|
||||||
message DateTimeCommandRequest {
|
message DateTimeCommandRequest {
|
||||||
option (id) = 114;
|
option (id) = 114;
|
||||||
@@ -1913,6 +2116,7 @@ message DateTimeCommandRequest {
|
|||||||
// ==================== UPDATE ====================
|
// ==================== UPDATE ====================
|
||||||
message ListEntitiesUpdateResponse {
|
message ListEntitiesUpdateResponse {
|
||||||
option (id) = 116;
|
option (id) = 116;
|
||||||
|
option (base_class) = "InfoResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_UPDATE";
|
option (ifdef) = "USE_UPDATE";
|
||||||
|
|
||||||
@@ -1925,9 +2129,11 @@ message ListEntitiesUpdateResponse {
|
|||||||
bool disabled_by_default = 6;
|
bool disabled_by_default = 6;
|
||||||
EntityCategory entity_category = 7;
|
EntityCategory entity_category = 7;
|
||||||
string device_class = 8;
|
string device_class = 8;
|
||||||
|
uint32 device_id = 9;
|
||||||
}
|
}
|
||||||
message UpdateStateResponse {
|
message UpdateStateResponse {
|
||||||
option (id) = 117;
|
option (id) = 117;
|
||||||
|
option (base_class) = "StateResponseProtoMessage";
|
||||||
option (source) = SOURCE_SERVER;
|
option (source) = SOURCE_SERVER;
|
||||||
option (ifdef) = "USE_UPDATE";
|
option (ifdef) = "USE_UPDATE";
|
||||||
option (no_delay) = true;
|
option (no_delay) = true;
|
||||||
@@ -1942,6 +2148,7 @@ message UpdateStateResponse {
|
|||||||
string title = 8;
|
string title = 8;
|
||||||
string release_summary = 9;
|
string release_summary = 9;
|
||||||
string release_url = 10;
|
string release_url = 10;
|
||||||
|
uint32 device_id = 11;
|
||||||
}
|
}
|
||||||
enum UpdateCommand {
|
enum UpdateCommand {
|
||||||
UPDATE_COMMAND_NONE = 0;
|
UPDATE_COMMAND_NONE = 0;
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user