Compare commits

..

1501 Commits

Author SHA1 Message Date
Jesse Hills
ae65f76dfe Merge pull request #8272 from esphome/bump-2025.2.0b6
2025.2.0b6
2025-02-19 10:44:08 +13:00
Jesse Hills
4d380214df Bump version to 2025.2.0b6 2025-02-19 09:22:52 +13:00
J. Nick Koston
c5ebf7683e Bump zeroconf to 0.145.1 (#8267) 2025-02-19 09:22:52 +13:00
G-Two
a973adda67 Increase default repeat delay for Toto remote transmitter protocol (#8265) 2025-02-19 09:22:52 +13:00
J. Nick Koston
d9b419eaf5 Bump openssh-client to 1:9.2p1-2+deb12u4 to fix docker builds (#8269) 2025-02-19 09:22:52 +13:00
Jesse Hills
2bc9782ce7 Merge pull request #8264 from esphome/bump-2025.2.0b5
2025.2.0b5
2025-02-18 14:13:33 +13:00
Jesse Hills
6583e17810 Bump version to 2025.2.0b5 2025-02-18 13:39:42 +13:00
J. Nick Koston
64c8bcef2e Bump aioesphomeapi to 29.1.0 (#8105) 2025-02-18 13:39:42 +13:00
J. Nick Koston
f9da8dbfb8 Replace glyphsets with esphome_glyphsets (#8261) 2025-02-18 13:39:42 +13:00
Jesse Hills
26d25464da Merge pull request #8259 from esphome/bump-2025.2.0b4
2025.2.0b4
2025-02-17 13:09:45 +13:00
Jesse Hills
78b55e22ee Bump version to 2025.2.0b4 2025-02-17 12:14:06 +13:00
Ali Jafri
9ee5227fe0 DHT platform now supports modules with inbuilt external resistor (#8257) 2025-02-17 12:14:06 +13:00
J. Nick Koston
e89603fe3b Bump zeroconf to 0.144.3 (#8253) 2025-02-17 12:14:06 +13:00
Djordje Mandic
c0804d665d [scd30] Increase minimal CONF_UPDATE_INTERVAL from 1 to 2 seconds (#8256) 2025-02-17 12:14:05 +13:00
Samuel Sieb
a67b85eabf don't crash on null pages (#8254)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2025-02-17 12:14:05 +13:00
Jesse Hills
6e45a7c9af Merge pull request #8251 from esphome/bump-2025.2.0b3
2025.2.0b3
2025-02-14 16:43:58 +13:00
Jesse Hills
e17582544e Bump version to 2025.2.0b3 2025-02-14 14:28:42 +13:00
Jesse Hills
daa7960031 Fix crash when storage file doesnt exist yet (#8249) 2025-02-14 14:28:41 +13:00
Dániel Márai
6999cc0581 Add support for the DAC on the S2 (#8030)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2025-02-14 14:28:41 +13:00
Jonathan Swoboda
92ad6286aa [logger] Fix bug causing global log level to be overwritten (#8248) 2025-02-14 14:28:41 +13:00
guillempages
1111aa167f [online_image]Fix reset if buffer not allocated (#8236) 2025-02-14 14:28:41 +13:00
Jesse Hills
897873496a Merge pull request #8246 from esphome/bump-2025.2.0b2
2025.2.0b2
2025-02-13 21:31:05 +13:00
Jesse Hills
b0f6dd7d9c Bump version to 2025.2.0b2 2025-02-13 20:44:12 +13:00
Keith Burzinski
be5639faf1 [modbus_controller] Remove stream dependency (#8244) 2025-02-13 20:44:12 +13:00
Keith Burzinski
e9a537784e [graph] Remove `stream` dependency (#8243) 2025-02-13 20:44:12 +13:00
Gábor Poczkodi
35d303809e [cse7766] Remove stream dependency (#7720)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2025-02-13 20:44:12 +13:00
Jesse Hills
4740f12ce8 [core] Fix `config_dir` for dashboard (#8242) 2025-02-13 20:44:12 +13:00
J. Nick Koston
c8e7e275a4 Bump zeroconf to 0.144.1 (#8238) 2025-02-13 20:44:12 +13:00
Jesse Hills
077ee5b714 [core] Ignore dot-prefixed config entries when looking for target platform (#8240) 2025-02-13 20:44:12 +13:00
Jesse Hills
3d48eb26cd Merge pull request #8237 from esphome/bump-2025.2.0b1
2025.2.0b1
2025-02-12 17:24:00 +13:00
Jesse Hills
2b75e34719 Bump version to 2025.2.0b1 2025-02-12 13:53:43 +13:00
Jesse Hills
0b6c416680 Bump esphome-dashboard to 20250212.0 (#8235) 2025-02-12 13:16:17 +13:00
Neil Ségard
7bb2c3c496 Add support for Waveshare 7.3" ACeP 7-Color display (#6380) 2025-02-12 10:31:56 +11:00
Michael Grüner
88cfdc33d4 GDEY042T81 e-paper displays support (#8061)
Co-authored-by: clydebarrow <2366188+clydebarrow@users.noreply.github.com>
2025-02-12 10:17:34 +11:00
Daniël Koek
a2f1b90238 Add GDEY029T94 support (#7931)
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2025-02-12 10:16:33 +11:00
Rachasak Ragkamnerd
0401ee9428 added Waveshare BWR Mode for the 4.2in Display (#7995)
Co-authored-by: rrachasak <dev@rachasak.org>
Co-authored-by: clydebarrow <2366188+clydebarrow@users.noreply.github.com>
2025-02-12 08:35:07 +11:00
tmpeh
14d7931bd6 Added Waveshare e-paper display model "7.50inv2p" to the waveshare_epaper component. (#7751)
Co-authored-by: Tim Pehla <tim.pehla@uni-bielefeld.de>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2025-02-12 09:41:52 +13:00
Jordan Zucker
6b3f3e1da6 [prometheus] Adding valve entity metrics (#8223) 2025-02-12 08:51:55 +13:00
Kevin Ahrendt
33f9d66e81 [voice_assistant] Add announce support (#8232) 2025-02-12 07:20:39 +13:00
Kevin Ahrendt
46d19d82c2 [speaker] Bugfix: Ensure all audio is played after completely decoding a file (#8231) 2025-02-12 07:14:59 +13:00
guillempages
c9e7562aff [online_image] Improve error handling (#8212) 2025-02-11 22:12:13 +11:00
guillempages
8b7aa4c110 [http_request]Use std::string for headers (#8225) 2025-02-11 11:39:03 +11:00
Táta GEEK
b667ceaced Add waveshare 2.9inch e-Paper HAT (D) (#7906)
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2025-02-11 11:35:56 +11:00
mystster
abdf215d3a Add partial update of GDEW029T5 e-paper display (#8162)
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2025-02-11 07:29:27 +11:00
Kevin Ahrendt
84836f15db [speaker] Media Player Components PR9 (#8171)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2025-02-11 08:00:23 +13:00
Jonathan Swoboda
8be9f02693 [ota] Increase socket timeout earlier in OTA script (#8129) 2025-02-10 17:42:40 +13:00
Igor Novgorodov
1ab1768b6a Add ADC sampling method option (#8131)
Co-authored-by: Djordje Mandic <6750655+DjordjeMandic@users.noreply.github.com>
2025-02-10 17:32:54 +13:00
Stefan Rado
0d13e2040d Don't activate venv in devcontainer (#8128) 2025-02-10 17:12:46 +13:00
Awesome Walrus
fd24b1423c Fix pref conflict of WiFi creds and fast_connect (#8219) 2025-02-10 16:54:37 +13:00
Clyde Stubbs
66c35a9432 [waveshare_epaper] Rationalise and complete tests (#8221) 2025-02-10 16:46:05 +13:00
Craig Andrews
45b8810ab8 [online_image] Set Accept header (#8216) 2025-02-10 15:55:16 +13:00
Clyde Stubbs
ff7d232ee6 [logger] Add runtime level select (#8222)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2025-02-10 15:53:26 +13:00
guillempages
0cd3af2fcd [online_image]Pin specific version of JPEG library (#8217) 2025-02-10 13:17:29 +13:00
Keith Burzinski
8897a9866d [CI] Consolidate some tests (T) (#8208) 2025-02-10 10:43:21 +13:00
Keith Burzinski
dc8646cda6 [CI] Consolidate some tests (U, V, W, X, Y, Z) (#8210) 2025-02-10 10:43:17 +13:00
Keith Burzinski
353924257a [CI] Consolidate some tests (S) (#8206) 2025-02-10 10:43:10 +13:00
Keith Burzinski
da3d007d7b Markdown tweaks/updates (#8211) 2025-02-10 10:40:19 +13:00
G-Two
9e3359cdf2 Add Toto protocol to remote receiver and transmitter (#8177) 2025-02-06 23:08:06 -06:00
Jonathan Swoboda
7e626b04f2 [esp32_rmt] Set pull-up and open-drain modes based on pin schema (#8178)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2025-02-06 22:09:24 -06:00
dependabot[bot]
4eb551864d Bump the docker-actions group with 2 updates (#8215)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-06 20:33:57 +01:00
bdm310
e337bd7beb [sdl] Implement binary sensors from keystrokes (#8207)
Co-authored-by: clydebarrow <2366188+clydebarrow@users.noreply.github.com>
2025-02-05 21:53:23 +11:00
Jan Schröter
57739b8bb0 [uponor_smatrix] add target temperature as sensor (#7745) 2025-02-05 15:53:05 +13:00
Jordan Zucker
65ca000e6d [prometheus] Add update entity to prometheus metrics (#8173) 2025-02-05 15:43:44 +13:00
Keith Burzinski
bf6874b52e [CI] Consolidate some tests (Q, R) (#8205) 2025-02-05 15:37:22 +13:00
Keith Burzinski
cecce0f3cb [CI] Consolidate some tests (N, O, P) (#8204) 2025-02-05 15:37:15 +13:00
Clyde Stubbs
4d8f58db94 [preferences] Better handling of flash_write_interval (#8199) 2025-02-05 15:34:30 +13:00
Clyde Stubbs
977333a73c [lvgl] Make layouts work properly on base display (#8193) 2025-02-05 14:44:51 +13:00
Clyde Stubbs
1215d2ffeb [xxtea] Extract encryption functions to separate component (#8183)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2025-02-05 12:22:40 +13:00
Clyde Stubbs
9b56f9cc6d [lvgl] add triggers for swipe gestures (#8190) 2025-02-05 12:13:21 +13:00
Jonathan Swoboda
2e61229aed [i2c] Workaround for i2c on s2 (#8188) 2025-02-05 12:09:37 +13:00
Keith Burzinski
55203143df [CI] Consolidate some tests (I, J) (#8200) 2025-02-05 12:06:08 +13:00
Keith Burzinski
4e4566361f [CI] Consolidate some tests (M) (#8202) 2025-02-05 12:05:59 +13:00
Keith Burzinski
4273449003 [CI] Consolidate some tests (K, L) (#8201) 2025-02-05 12:05:53 +13:00
Keith Burzinski
f8fae676b1 [CI] Consolidate some tests (H) (#8198) 2025-02-05 12:05:50 +13:00
Keith Burzinski
211aee91e5 [CI] Consolidate some tests (G) (#8196) 2025-02-05 12:05:45 +13:00
Keith Burzinski
6e3527a88b [CI] Consolidate some tests (F) (#8195) 2025-02-05 12:05:35 +13:00
Keith Burzinski
06f9764f51 [CI] Consolidate some tests (E) (#8191) 2025-02-05 12:05:24 +13:00
Keith Burzinski
693d813c4b [CI] Consolidate some tests (D) (#8189) 2025-02-05 12:05:17 +13:00
Keith Burzinski
61ad2510fc [CI] Consolidate some tests (C) (#8186) 2025-02-05 12:05:08 +13:00
Keith Burzinski
53c15f6716 [CI] Consolidate some tests (B) (#8185) 2025-02-05 12:05:02 +13:00
Keith Burzinski
d4ac2d3c7e [CI] Consolidate some tests (A) (#8184) 2025-02-05 12:04:53 +13:00
Kevin Ahrendt
6f4e8f1fbf [mixer] Media Player Components PR8 (#8170)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2025-02-04 23:00:02 +00:00
Kevin Ahrendt
847cff06b3 [resampler] Media Player Components PR7 (#8169)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2025-02-05 09:18:11 +13:00
Jesse Hills
bd34697715 Remove arm/v7 container image support (#8194) 2025-02-05 07:56:38 +13:00
Kevin Ahrendt
6b55df36c7 [audio] Media Player Components PR6 (#8168)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2025-02-04 15:58:35 +13:00
Kevin Ahrendt
b8f9eaecd8 [audio] Media Player Components PR5 (#8167) 2025-02-03 23:47:50 +00:00
Kevin Ahrendt
c8bbc2e84c [audio] Media Player Components PR4 (#8166)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2025-02-03 22:34:20 +00:00
Djordje Mandic
5108b9a8b7 Make get_flags() in GPIOPin mandatory (#8182)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2025-02-03 11:14:55 -06:00
Djordje Mandic
8de5af4eec Add virtual get_flags() to GPIOPin and implementation in InternalGPIOPin derivatives (#8151) 2025-02-02 21:55:55 -06:00
Kevin Ahrendt
6e5e681055 [audio] Media Player Components PR3 (#8165) 2025-02-03 02:54:55 +00:00
Kevin Ahrendt
f6cf99384b [audio, i2s_audio, speaker] Media Player Components PR2 (#8164)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2025-02-03 15:25:41 +13:00
Kevin Ahrendt
2b711e532b [i2s_audio] Media Player Components PR1 (#8163) 2025-02-02 21:38:10 +01:00
J. Nick Koston
72c6f04a97 Bump zeroconf to 0.143.0 (#8104) 2025-02-02 21:35:52 +01:00
Rodrigo Martín
03e2701bd0 feat(core): Add support for <...> includes (#8132) 2025-02-02 21:34:38 +01:00
Jonathan Swoboda
051fa3a49f [remote_base] Add default value for offset in is_valid (#8159) 2025-02-01 04:13:38 -06:00
NicoIIT
7392397630 Use abspath for config path dir (#8044) 2025-01-29 15:03:42 +01:00
Jonathan Swoboda
714e2d3e56 [remote_transmitter] Fix issues with 32bit rollover on esp8266 and libretiny (#8056)
Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
2025-01-29 07:34:10 -06:00
dependabot[bot]
12d6c1bbca Bump actions/setup-python from 5.3.0 to 5.4.0 in /.github/actions/restore-python (#8153)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-29 14:31:49 +01:00
dependabot[bot]
7727879f01 Bump actions/setup-python from 5.3.0 to 5.4.0 (#8154)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-29 14:30:30 +01:00
dependabot[bot]
334e952a34 Bump pypa/gh-action-pypi-publish from 1.12.3 to 1.12.4 (#8137)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-29 13:40:31 +01:00
dependabot[bot]
f9856135d0 Bump docker/build-push-action from 6.12.0 to 6.13.0 in /.github/actions/build-image (#8136)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-29 13:40:25 +01:00
Olliver Schinagl
ba3e5e8ecb [climate] Accept °K as intended (#8134) 2025-01-30 00:27:55 +13:00
Jonathan Swoboda
67ccd0eb7f [esp32_rmt] Increase default symbols in led strip and remove IRAM config (#8133) 2025-01-29 04:51:04 -06:00
Clyde Stubbs
619ce93dec [display] Properly handle case of auto_clear_enabled: false (#8156) 2025-01-29 04:45:29 -06:00
Jimmy Hedman
9957840dfc Add multicast support to udp component (#8051) 2025-01-29 21:00:18 +11:00
Stefan Rado
a23ce416ea Fix forgotten uses of use_transparency (#8115) 2025-01-29 14:54:10 +11:00
Clyde Stubbs
2489f95107 [logger] Ensure PRIu32 and friends are available (#8155) 2025-01-28 23:58:06 +00:00
guillempages
7dab1a6082 [online_image] Add JPEG support to online_image (#8127)
Co-authored-by: Jimmy Hedman <jimmy.hedman@gmail.com>
Co-authored-by: J. Nick Koston <nick@koston.org>
Co-authored-by: Rodrigo Martín <contact@rodrigomartin.dev>
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2025-01-29 10:35:43 +11:00
Rodrigo Martín
f7f8bf4da4 [esp32_ble_server] Create custom services, characteristics and descriptors (#7009)
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2025-01-28 22:00:28 +11:00
J. Nick Koston
dd18a219db Include Bluetooth connection slot allocations in connections free message (#8148) 2025-01-28 06:57:52 +04:00
Jimmy Hedman
dbf4c2c4da Update mdns for ESP-IDF (#8145) 2025-01-26 22:23:57 -06:00
guillempages
fc847c1de8 [online_image] Code Improvements (#8130) 2025-01-24 07:32:03 +11:00
Jesse Hills
7fccc9ff86 [online_image] Add binary bmp support (#8116)
Co-authored-by: guillempages <guillempages@users.noreply.github.com>
2025-01-23 15:10:19 +13:00
Olliver Schinagl
dee1d84979 [spi] Fix data type in bitbash transfer_() (#8125) 2025-01-22 23:41:55 +00:00
Oskari Lemmelä
65b2d48a6f Fix mqtt climate step rounding (#8121) 2025-01-23 12:32:45 +13:00
brambo123
8aeb08f868 [ads1115] Add sample rate control (#8102) 2025-01-23 12:31:07 +13:00
Djordje Mandic
d4857a1727 Add verbose logging for pulse width calculation in pulse_meter (#8124) 2025-01-23 12:07:26 +13:00
tomaszduda23
0c032bc431 [core] add support for custom platform (#7616)
Co-authored-by: Tomasz Duda <tomaszduda23@gmai.com>
2025-01-23 12:06:07 +13:00
Keith Burzinski
5a103543c4 [esp32] Set logger default interface for C6 (#8126) 2025-01-22 23:00:40 +00:00
Frederik
01ab6d3ddc [debug] fix debug_esp32 printf for partition size and address (#8122)
Co-authored-by: Djordje Mandic <6750655+DjordjeMandic@users.noreply.github.com>
2025-01-23 09:37:32 +11:00
Keith Burzinski
f2170c633a [es7243e] Add support for ES7243E audio ADC (#8098) 2025-01-23 09:23:22 +13:00
Citric Li
c2e52f4b11 Add: Human Presence and Target Count to the Seeed Studio MR60BHA2 (#8010)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Spencer Yan <spencer@spenyan.com>
2025-01-22 13:01:15 +13:00
Keith Burzinski
4843bbd38a [custom] Remove platforms (#8119) 2025-01-22 12:56:51 +13:00
dependabot[bot]
78ce8f014a Bump actions/stale from 9.0.0 to 9.1.0 (#8120)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-22 08:15:56 +13:00
Jesse Hills
b454f63b36 [core] Remove old style platform configuration (#8118) 2025-01-21 00:32:47 -06:00
Jonathan Swoboda
db644542ed [esp32_touch] Fix deprecated warning (#8092)
Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
2025-01-21 16:17:32 +13:00
Keith Burzinski
716a8b87e1 [es8156] Add support for ES8156 audio DAC (#8085)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2025-01-21 16:15:18 +13:00
Clyde Stubbs
0f4e274e52 [uptime] Cosmetic improvements for uptime text_sensor (#8101) 2025-01-21 15:43:50 +13:00
Keith Burzinski
576dbd6f0c [audio_adc] Add new `audio_adc` component (#8094) 2025-01-21 15:35:40 +13:00
Jesse Hills
c3d00b45f7 Update defines.h for esp-idf 5.1.5 (#8117) 2025-01-21 01:50:04 +00:00
Mikkel Jeppesen
98b872abc7 Fixed incorrect display dimension (#8110) 2025-01-20 09:36:07 +11:00
guillempages
75026be951 [online_image] Use RAMAllocator (#8114) 2025-01-19 22:16:37 +00:00
guillempages
47a0ec467a [image]Rename option "use_transparency" (#8113) 2025-01-20 08:34:38 +11:00
Jesse Hills
9e40d4cf45 Merge branch 'release' into dev 2025-01-17 14:47:56 +13:00
Jesse Hills
fecae2f740 Merge pull request #8100 from esphome/bump-2024.12.4
2024.12.4
2025-01-17 14:47:16 +13:00
Jesse Hills
5a01670803 Bump version to 2024.12.4 2025-01-17 13:40:12 +13:00
Jesse Hills
c2423b18cb Bump python3-setuptools to 66.1.1-1+deb12u1 (#8074) 2025-01-17 13:40:11 +13:00
Jesse Hills
2363b3dfd6 Merge branch 'release' into dev 2025-01-17 13:32:53 +13:00
Jesse Hills
628e47f670 Merge pull request #8099 from esphome/bump-2024.12.3
2024.12.3
2025-01-17 13:32:12 +13:00
Jesse Hills
7666581c54 Bump version to 2024.12.3 2025-01-17 12:24:22 +13:00
Kevin Ahrendt
03c36920ff [http_request] Bugfix: run update function in a task (#8018) 2025-01-17 12:24:22 +13:00
Piotr Szulc
abdd6b232f Fixed libretiny preference wrongly detecting change in the data to store (#7990) 2025-01-17 12:24:22 +13:00
j-sepul
07be7ad7e2 Increase Daly-BMS coltage cells from 16 to 18 cells (#8057) 2025-01-17 11:08:04 +13:00
Katherine Whitlock
820e3488d0 Remove black-formatter from pre-commit hooks (#8097) 2025-01-17 10:44:26 +13:00
Kevin Ahrendt
8c6c45e6c1 [http_request] Bugfix: run update function in a task (#8018) 2025-01-17 10:43:41 +13:00
Katherine Whitlock
16bf56b0f9 Fix running pre-commit on Windows (#8095) 2025-01-17 09:10:20 +13:00
Clyde Stubbs
49c01c26f1 Revert "Add resistance_sampler interface for config validation" (#8093)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2025-01-16 16:12:30 +11:00
dependabot[bot]
b4a804cc77 Bump docker/build-push-action from 6.11.0 to 6.12.0 in /.github/actions/build-image (#8090)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-16 14:53:23 +13:00
Jordan Zucker
df26ace0f1 [prometheus] Select, media_player, and number prometheus metrics (#7895) 2025-01-15 16:56:22 +13:00
Jesse Hills
e779a8bcb2 [event] Store `last_event_type` in class (#8088) 2025-01-15 16:54:45 +13:00
Jesse Hills
c458fd18df Bump version to 2025.2.0-dev 2025-01-15 16:49:58 +13:00
Kevin Ahrendt
98817a5bbf [es7210] add support for es7210 ADC (#8007) 2025-01-15 16:47:22 +13:00
Saninn Salas Diaz
c43d8460bd fix(web_server/fan): send speed update values even when fan is off (#8086) 2025-01-15 15:14:58 +13:00
Clyde Stubbs
17b88f2e3e [lvgl] fix lvgl.widget.update and friends (#8087) 2025-01-15 14:29:51 +13:00
Clyde Stubbs
dac9768f6a [spi] Restore `SPIDelegateDummy` (#8019) 2025-01-15 13:56:52 +13:00
Clyde Stubbs
e8d2ad4ce8 [ili9xxx] psram and 8 bit changes (#8084) 2025-01-15 11:53:44 +13:00
Clyde Stubbs
c3412df169 [image] Fix mdi images (#8082) 2025-01-15 11:29:27 +13:00
Clyde Stubbs
fc2b15e307 [uptime] Add text_sensor (#8028) 2025-01-15 11:27:47 +13:00
Stefan Rado
bdb1094b47 Allow external libraries to use ESP_LOGx macros (#8078) 2025-01-14 14:20:52 +11:00
Clyde Stubbs
6262fb8fcf [lvgl] fix tests (#8075) 2025-01-13 15:32:54 -06:00
Nate Clark
f319472066 web_server: Adds REST API POST endpoints to arm and disarm (#7985) 2025-01-13 17:35:29 +13:00
Dusan Cervenka
b4a2b50ee0 Fixed topic when mac is used (#7988) 2025-01-13 17:34:07 +13:00
Piotr Szulc
30bb806f26 Fixed libretiny preference wrongly detecting change in the data to store (#7990) 2025-01-13 17:31:01 +13:00
NP v/d Spek
9874d17613 add missing include in base_automation.h (#8001) 2025-01-13 17:29:38 +13:00
Ryan Henderson
13909b7994 [esp32_wifi] Enhance WiFi component with TCPIP core locking. (#7997) 2025-01-13 17:26:23 +13:00
Ryan Henderson
df50e57409 Include esp_mac.h and C++20 str_startswith/str_ends (#7999) 2025-01-13 17:18:20 +13:00
Ryan Henderson
3fa67fad32 Fix compile errors with pioarduino/platform-espressif32: wifi_component_esp32_arduino.cpp (#7998) 2025-01-13 17:17:28 +13:00
Douglas
8fbd512952 Use ESPHome logo on readme page according to theme (light/dark) (#7992) 2025-01-13 17:16:43 +13:00
Edward Firmo
528d3672b4 [psram] Improve total PSRAM display in logs by using rounded KB values (#8008)
Co-authored-by: Djordje Mandic <6750655+DjordjeMandic@users.noreply.github.com>
2025-01-13 17:11:48 +13:00
Edward Firmo
fef50afef8 [debug] Add ESP32 partition table logging to dump_config (#8012) 2025-01-13 17:08:20 +13:00
Edward Firmo
aa1879082c [debug] Add framework type to debug info (#8013) 2025-01-13 17:06:44 +13:00
Djordje Mandic
d8c943972b [core] fix comment for crc8 function in helpers.h (#8016) 2025-01-13 17:05:53 +13:00
Kyle Cascade
f3ebb4eb39 Added VERY_VERBOSE dfplayer printing (#8026) 2025-01-13 16:23:35 +13:00
Clyde Stubbs
f1c0570e3b [image] Transparency changes; code refactor (#7908) 2025-01-13 16:21:42 +13:00
Keith Burzinski
aa87c60717 [nextion] Brightness control tweaks (#8027) 2025-01-13 16:12:54 +13:00
Clyde Stubbs
92a8ebe1f8 [json] use correct formatting (#8039) 2025-01-13 15:56:42 +13:00
Marcin Żbik
dd3ffc7f29 Fix Waveshare 7in5bv3bwr image quality in BWR mode (#8043)
Co-authored-by: zbikmarc <zbimarc+github@gmail.com>
2025-01-13 15:55:30 +13:00
Jonathan Swoboda
aac3841991 [esp32] Fix arch_get_cpu_freq_hz (#8047)
Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
2025-01-13 14:45:35 +13:00
Mischa Siekmann
fb87a1c0bc Allow CONF_RMT_CHANNEL parameter for IDF 4.X (#8035) 2025-01-13 14:42:03 +13:00
Jesse Hills
4409471cd1 Bump python3-setuptools to 66.1.1-1+deb12u1 (#8074) 2025-01-13 14:32:10 +13:00
dependabot[bot]
739edce268 Bump docker/build-push-action from 6.10.0 to 6.11.0 in /.github/actions/build-image (#8053)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 12:55:53 +13:00
dependabot[bot]
f25f3334d1 Bump docker/setup-qemu-action from 3.2.0 to 3.3.0 in the docker-actions group (#8052)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 12:55:37 +13:00
dependabot[bot]
571935fb3b Bump peter-evans/create-pull-request from 7.0.5 to 7.0.6 (#8024)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 12:55:00 +13:00
dependabot[bot]
7c39422692 Bump actions/upload-artifact from 4.5.0 to 4.6.0 (#8058)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-13 12:54:44 +13:00
tomaszduda23
731fb1d172 [spi] relay on KEY_TARGET_PLATFORM as the other platforms does (#8066) 2025-01-13 11:15:39 +13:00
Brian Whicheloe
40bee2a854 Add log level env var (#7604)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2025-01-13 08:15:22 +13:00
Jimmy Hedman
d69926485c Convert IPAddress to use Pythonmodule ipaddress (#8072) 2025-01-13 08:12:38 +13:00
Clyde Stubbs
fe80750743 [display] auto_clear_enabled defaults (#7986) 2025-01-13 07:56:54 +13:00
Clyde Stubbs
109d737d5d [lvgl] Implement lvgl.page.is_showing: condition (#8055) 2025-01-13 07:53:26 +13:00
Clyde Stubbs
bd17ee8e33 [config] Early check for required version (#8000) 2025-01-13 07:50:13 +13:00
Clyde Stubbs
f1712cffa8 [spi_led_strip] Fix priority (#8021) 2025-01-13 07:49:05 +13:00
Clyde Stubbs
0df6a913b3 [lgvl] disp_bg_image and disp_bg_opa changes (#8025) 2025-01-13 07:46:17 +13:00
Clyde Stubbs
8a98b69a57 [lvgl] fix bg_image_src (#8005)
Co-authored-by: clydeps <U5yx99dok9>
2025-01-13 07:42:03 +13:00
Clyde Stubbs
4530e4d60f [lvgl] remove default state (#8038) 2025-01-13 07:40:50 +13:00
Juan Jose Restrepo
4d7c6b28e1 Update sprinkler.cpp (#7996) 2025-01-10 17:22:30 -06:00
Jimmy Hedman
de603c7565 Enable udp to work (on ipv4) when ipv6 is enabled (#8060)
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2025-01-10 21:10:19 +00:00
Peter Zich
a498fb5dcf Fix braceless else statements (#7799) 2025-01-09 00:47:30 -06:00
Samu Németh
78543e1e15 Fixed comment typo in light_color_values.h (#8050)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2025-01-08 22:37:52 +00:00
Clyde Stubbs
5e72b7196b Remove rmt channel from idf tests (#8054) 2025-01-08 21:14:08 +00:00
Clyde Stubbs
a0615a92f0 [addressable_light] Remove rmt channel from idf tests (#7987) 2025-01-08 14:25:10 -06:00
Peter Zich
dc5b408748 Initialize esp32_rmt_led_strip buffer (#8036) 2025-01-05 19:50:35 -06:00
Jonathan Swoboda
387bde665e [esp32_rmt] IDF 5+ update fixes (#8002)
Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-12-24 03:15:40 -06:00
tomaszduda23
45beea68eb [ble_client, bluetooth_proxy, esp32_ble_client, esp32_ble_tracker] fix ble proxy stop working (#7901)
Co-authored-by: J. Nick Koston <nick@koston.org>
2024-12-22 19:49:04 -10:00
Keith Burzinski
c457d8835e Merge branch 'release' into dev 2024-12-20 18:56:18 -06:00
Keith Burzinski
4b51ba3fa4 Merge pull request #7989 from esphome/bump-2024.12.2
2024.12.2
2024-12-20 18:56:03 -06:00
Keith Burzinski
499953e3f4 Bump version to 2024.12.2 2024-12-20 14:34:11 -06:00
Keith Burzinski
69f1a81e1d [esp32_ble] Fix for Improv (#7984) 2024-12-20 14:34:11 -06:00
Keith Burzinski
37fcccbb1c [esp32] Fix flash size warning when using IDF (#7983) 2024-12-20 14:34:10 -06:00
Keith Burzinski
f3cb179f54 [esp32_ble] Fix for Improv (#7984) 2024-12-20 14:16:18 -06:00
Keith Burzinski
ba2edbc189 [esp32] Fix flash size warning when using IDF (#7983) 2024-12-20 01:28:08 -06:00
tomaszduda23
f33b4a714e [esp32_ble] do not skip events if queue is blocked (#7960) 2024-12-19 14:45:40 -10:00
Jesse Hills
85d863601b Merge branch 'release' into dev 2024-12-19 19:48:11 +13:00
Jesse Hills
fe0700166a Merge pull request #7982 from esphome/bump-2024.12.1
2024.12.1
2024-12-19 19:47:30 +13:00
Jesse Hills
d28cf011d1 Bump version to 2024.12.1 2024-12-19 17:07:43 +13:00
Kevin Ahrendt
434879ea04 [core] Bugfix: Implement ring buffer with xRingbuffer (#7973) 2024-12-19 17:07:43 +13:00
dependabot[bot]
7da07303c9 Bump actions/upload-artifact from 4.4.3 to 4.5.0 (#7981)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-19 16:42:29 +13:00
Clyde Stubbs
b33b4481ea [helpers] Provide calls to get free heap and largest available block. (#7978) 2024-12-19 16:40:08 +13:00
Clyde Stubbs
ac631711ab [qspi_dbi] Bugfix and new features (#7979) 2024-12-19 16:30:23 +13:00
Jonathan Swoboda
265b6ec445 [esp32_rmt] Updates for IDF 5+ (#7770)
Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-12-18 20:31:22 -06:00
Kevin Ahrendt
61499dbdd8 [core] Bugfix: Implement ring buffer with xRingbuffer (#7973) 2024-12-19 15:07:07 +13:00
Jesse Hills
0aaef9293b Merge branch 'release' into dev 2024-12-18 17:07:26 +13:00
Jesse Hills
0f0b829bc6 Merge pull request #7976 from esphome/bump-2024.12.0
2024.12.0
2024-12-18 17:06:44 +13:00
Djordje Mandic
a9d883b65a [midea] Add Fahrenheit support to midea_ac.follow_me action (#7762) 2024-12-18 13:47:43 +13:00
Jesse Hills
d330e73c1e Bump version to 2024.12.0 2024-12-18 11:35:43 +13:00
Jonathan Swoboda
7554e954fe [core] Add c6 and h2 to split default (#7974)
Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
2024-12-18 10:12:14 +13:00
Jesse Hills
752af94a75 Merge branch 'beta' into dev 2024-12-18 10:03:48 +13:00
Jesse Hills
561d92d402 Merge pull request #7975 from esphome/bump-2024.12.0b3
2024.12.0b3
2024-12-18 10:02:03 +13:00
Jesse Hills
1a69236473 Bump version to 2024.12.0b3 2024-12-18 07:43:38 +13:00
Jesse Hills
c86ea99145 [esp32_ble] Use RAMAllocator to avoid panic abort from `new` (#7936) 2024-12-18 07:43:38 +13:00
Jesse Hills
7661609049 Bump esphome-dashboard to 20241217.1 (#7971) 2024-12-18 07:43:38 +13:00
Jesse Hills
c38826824f [dashboard] Accept basic auth header (#7965) 2024-12-18 07:43:38 +13:00
Clyde Stubbs
e890486043 [font] cleanly handle font file format exception (Bugfix) (#7970) 2024-12-18 07:43:38 +13:00
Jesse Hills
ccc9fd4a3f [esp32_ble] Use RAMAllocator to avoid panic abort from `new` (#7936) 2024-12-17 12:10:38 -06:00
Jesse Hills
54fbf5184e Bump esphome-dashboard to 20241217.1 (#7971) 2024-12-17 17:32:52 +13:00
Jesse Hills
759df7ae6c [dashboard] Accept basic auth header (#7965) 2024-12-16 22:26:16 -06:00
dependabot[bot]
3d56397e58 Bump docker/setup-buildx-action from 3.7.1 to 3.8.0 in the docker-actions group (#7969)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-17 14:09:09 +13:00
Clyde Stubbs
9f6c64afa6 [font] cleanly handle font file format exception (Bugfix) (#7970) 2024-12-17 14:07:43 +13:00
Jesse Hills
663e18310d [ci] Dont run main ci suite on docker files (#7966) 2024-12-16 16:58:42 -06:00
Jesse Hills
1a89aa8fbf [uart] Use `SOC_UART_NUM as number of uarts instead of UART_NUM_MAX` (#7967) 2024-12-16 05:52:34 +00:00
Edward Firmo
e04743e381 [debug] Detailed reset reason (#7729)
Co-authored-by: Ramil Valitov <ramilvalitov@gmail.com>
2024-12-16 12:12:45 +13:00
Oleg Tarasov
a6957b9d3b [opentherm] Message ordering, on-the-fly message editing, code improvements (#7903) 2024-12-16 12:04:26 +13:00
Edward Firmo
9816c27031 [nextion] Remove _internal from non-protected functions (#7656) 2024-12-16 11:00:44 +13:00
luar123
ea06740b46 Fix adc channel for ESP32-H2 (#7964) 2024-12-16 10:59:54 +13:00
Jesse Hills
9a5ec1b9e6 Merge branch 'beta' into dev 2024-12-16 10:42:53 +13:00
Jesse Hills
6dcbd1a8ae Merge pull request #7963 from esphome/bump-2024.12.0b2
2024.12.0b2
2024-12-16 10:42:21 +13:00
Jesse Hills
63b0930ae8 Bump version to 2024.12.0b2 2024-12-16 07:57:06 +13:00
Edward Firmo
5382bd2a97 [adc] Restore missing LIBRETINY code in a separated file (#7955) 2024-12-16 07:57:06 +13:00
Kevin Ahrendt
de1fbd390b [i2s_audio] Bugfix: Correctly set ring buffer size (#7959) 2024-12-16 07:57:06 +13:00
Jonathan Swoboda
af23357dca [core] Move delay_microseconds_safe to iram (#7957)
Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
2024-12-16 07:57:06 +13:00
Jesse Hills
0fbe6c0d8b [sgp30] Set default update interval to 60s (#7952) 2024-12-16 07:57:06 +13:00
Jonathan Swoboda
4e1ff31342 [const] Add RMT CONF variables to const.py (#7953)
Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
2024-12-16 07:57:06 +13:00
Edward Firmo
df4224e779 [nextion] Publishes is_connected() (#7961) 2024-12-16 07:30:47 +13:00
Edward Firmo
5877c57a35 [adc] Restore missing LIBRETINY code in a separated file (#7955) 2024-12-15 07:55:04 +13:00
Kevin Ahrendt
7f2ca800c1 [i2s_audio] Bugfix: Correctly set ring buffer size (#7959) 2024-12-13 23:17:58 -06:00
Edward Firmo
ce7ff15c8a [pulse_counter] Fix volatile increment/decrement deprecation warnings (#7954) 2024-12-14 08:21:54 +11:00
Edward Firmo
88742e0399 [rotary_encoder] Fix volatile increment/decrement deprecation warnings (#7958) 2024-12-14 08:16:11 +11:00
Jonathan Swoboda
c187cb547c [core] Move delay_microseconds_safe to iram (#7957)
Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
2024-12-13 11:45:10 -08:00
Jesse Hills
42bc960a36 [sgp30] Set default update interval to 60s (#7952) 2024-12-12 03:37:51 -06:00
Jonathan Swoboda
ba63d266d8 [const] Add RMT CONF variables to const.py (#7953)
Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
2024-12-12 04:37:22 +00:00
Jesse Hills
90baba4db7 Merge branch 'beta' into dev 2024-12-11 21:19:19 +13:00
Jesse Hills
1656ced351 Merge pull request #7950 from esphome/bump-2024.12.0b1
2024.12.0b1
2024-12-11 21:18:43 +13:00
Jesse Hills
1dfd15e607 Bump version to 2025.1.0-dev 2024-12-11 15:55:29 +13:00
Jesse Hills
5dcaf1241f Bump version to 2024.12.0b1 2024-12-11 15:55:29 +13:00
Jesse Hills
7aa54b6879 [i2c] Use correct macro to determine number of i2c peripherals for idf (#7947) 2024-12-10 10:24:06 +00:00
Jesse Hills
444e162c92 Synchronise esp32 boards with platform version 51.03.07 (#7945) 2024-12-10 06:39:00 +00:00
Clyde Stubbs
bb27eaaf1e [lvgl] Add on_change event (#7939) 2024-12-10 14:25:29 +13:00
Clyde Stubbs
517f659da8 [lvgl] Fix image mode property (Bugfix) (#7938) 2024-12-10 14:23:30 +13:00
Jesse Hills
5a92e24662 [const] Move `CONF_TEMPERATURE_COMPENSATION` to common const.py (#7943) 2024-12-10 14:22:30 +13:00
Edward Firmo
437b236a4d [adc] Split files by platform (#7940) 2024-12-10 13:38:45 +13:00
dependabot[bot]
14eac3dbce Bump pypa/gh-action-pypi-publish from 1.12.2 to 1.12.3 (#7941)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-09 23:44:39 +01:00
Yoonji Park
132a096ae7 Add font anti-aliasing for grayscale display (#7934) 2024-12-09 22:13:21 +11:00
Jesse Hills
440080a753 [display] Fix strftime overload ignoring alignment (#7937) 2024-12-09 17:09:29 +13:00
David Schneider
f15e3cfb9b Optimize QMC5883L reads (#7889) 2024-12-09 15:51:37 +13:00
Citric Lee
9d000e9abf Add: Seeed Studio MR60BHA2 mmWave Sensor (#7589)
Co-authored-by: Spencer Yan <spencer@spenyan.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-12-09 15:28:41 +13:00
Jesse Hills
97fd7493b5 Merge branch 'release' into dev 2024-12-06 17:23:14 +13:00
Jesse Hills
4c87658503 Merge pull request #7929 from esphome/bump-2024.11.3
2024.11.3
2024-12-06 17:22:32 +13:00
Jesse Hills
c80e035bd5 Bump version to 2024.11.3 2024-12-06 15:55:51 +13:00
Clyde Stubbs
c8ec0bb7ea [esp32] Fix crash with empty platformio_options: value (#7920) 2024-12-06 15:55:51 +13:00
Clyde Stubbs
86ae1c5931 [lvgl] Fix msgbox content (#7912) 2024-12-06 15:55:51 +13:00
Clyde Stubbs
d0958f7cf2 [lvgl] Bugfixes (#7896) 2024-12-06 15:55:51 +13:00
Jesse Hills
982ce1db72 Cast port to int for ota pushing (#7888) 2024-12-06 15:55:51 +13:00
Krzysztof Zdulski
f042c6e643 Fix recalc_timestamp_utc (#7894) 2024-12-06 15:55:51 +13:00
Jesse Hills
5fcd26bfe9 [st7920] Remove unnecessary warning when drawing outside display bounds (#7868) 2024-12-06 15:55:51 +13:00
FreeBear-nc
5717d557f5 Add IRAM_ATTR to all functions used during interrupts on esp8266 chips. (#7840) 2024-12-06 15:55:51 +13:00
guillempages
3bac45e737 [online_image]Don't access decoder if not initialized (#7882) 2024-12-06 15:55:50 +13:00
Samuel Sieb
e623989878 fix local time timestamp calculation (#7807)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-12-06 15:55:50 +13:00
Oleg Tarasov
39cbc6b183 [opentherm] Fix out of memory errors on ESP8266 (#7835) 2024-12-06 15:55:50 +13:00
Keith Burzinski
749a5e3348 [modbus] More clean-up (#7921) 2024-12-06 15:41:53 +13:00
Jesse Hills
b0e3ac01e8 Update project description (#7928) 2024-12-06 15:24:20 +13:00
Jesse Hills
58123845ff Move docker oci labels to correct image (#7927) 2024-12-06 14:11:11 +13:00
alorente
bfd75d736c Add OCI Image Labels (#7924) 2024-12-06 13:21:14 +13:00
Clyde Stubbs
4e3195b474 [esp32] Fix crash with empty platformio_options: value (#7920) 2024-12-06 13:16:59 +13:00
dependabot[bot]
d3a71a1d45 Bump actions/cache from 4.1.2 to 4.2.0 in /.github/actions/restore-python (#7925)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-06 13:11:46 +13:00
dependabot[bot]
555bdac604 Bump actions/cache from 4.1.2 to 4.2.0 (#7926)
Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-12-06 13:11:31 +13:00
Keith Burzinski
acc8d24a32 [esp32] Use pioarduino + IDF 5.1.5 as default for IDF builds (#7706)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-12-05 02:39:30 -06:00
Jesse Hills
f3cc1e541a [esp32_rmt_led_strip] Add `COMPONENT_SCHEMA` extending (#7918) 2024-12-04 21:44:59 -06:00
Keith Burzinski
ece72c6b18 [i2s_audio] Speaker type fix (#7919) 2024-12-04 21:03:38 -06:00
Sebastian Muszynski
4e839d42d0 [CI] Update clang-tidy to 18.1.8 (#7915) 2024-12-04 15:44:34 -06:00
Pavlo Dudnytskyi
d429aa8bb8 Haier AC quiet mode switch fix (#7902) 2024-12-05 10:43:00 +13:00
Kevin Ahrendt
472402745d [i2s_audio] Bugfix: Follow configured bits per sample (#7916) 2024-12-05 10:18:14 +13:00
mikosoft83
016fac2496 Add strftime variant with background color (#7714)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-12-04 13:18:00 +13:00
Clyde Stubbs
79478cdb8a [sntp] Resolve warnings from ESP-IDF 5.x (#7913) 2024-12-04 13:13:07 +13:00
Keith Burzinski
dbed74b50d [docker] Fix clang-tidy installation (#7910) 2024-12-04 12:26:27 +13:00
Keith Burzinski
d00ec7e544 [helpers] clang-tidy fix for #7706 (#7909) 2024-12-04 12:23:17 +13:00
Clyde Stubbs
a37ff2dbd9 [lvgl] Fix msgbox content (#7912) 2024-12-03 20:48:50 +00:00
Clyde Stubbs
00ddb0a427 [font] Restore correct default glyphs for bitmap fonts (#7907) 2024-12-03 19:50:56 +13:00
Clyde Stubbs
c95887a14a [lvgl] Bugfixes (#7896) 2024-12-03 19:50:11 +13:00
Jesse Hills
dc5942a59b [ble] Allow setting shorter name for ble advertisements (#7867)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-12-02 23:38:44 -06:00
kbullet
584dbf2668 MQTT sensors handling of publishing NaN values (#7768)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-12-02 23:50:05 +00:00
Keith Burzinski
9c8976be13 [CI] Update clang-tidy to 18.1.3 (#7822) 2024-12-03 11:29:45 +13:00
Clyde Stubbs
e08a9cc3a3 [font et. al.] Remove explicit check for pillow installed. (#7891) 2024-12-03 11:27:51 +13:00
Keith Burzinski
b79a3d6727 [CI] Bump GHA runners to `ubuntu-24.04` (#7905) 2024-12-03 06:42:44 +13:00
David Woodhouse
fb96e3588d Add H-Bridge switch component (#7421)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-12-02 02:16:58 -06:00
Keith Burzinski
edd847ea40 [modbus_controller] Clang fixes (#7899) 2024-12-02 13:27:32 +13:00
Jesse Hills
83d6834e27 Cast port to int for ota pushing (#7888) 2024-12-01 17:10:18 +01:00
Keith Burzinski
8f69d07061 [hx711] clang-tidy fixes for #7822 (#7900) 2024-12-01 17:08:52 +01:00
Krzysztof Zdulski
30477c764d Fix recalc_timestamp_utc (#7894) 2024-11-29 13:05:00 -08:00
Jesse Hills
217a80a178 [st7920] Remove unnecessary warning when drawing outside display bounds (#7868) 2024-11-28 16:57:11 +13:00
FreeBear-nc
5486b40aab Add IRAM_ATTR to all functions used during interrupts on esp8266 chips. (#7840) 2024-11-28 16:56:37 +13:00
guillempages
beb8ab50e2 [online_image]Don't access decoder if not initialized (#7882) 2024-11-28 16:55:20 +13:00
Max Slotov
7cdf5b55ef [deep_sleep] fix deep_sleep not keeping awake when sleep_duration is defined (#7885) 2024-11-28 16:51:07 +13:00
Clyde Stubbs
c9b0490305 [lvgl] Make image update via lambda work (#7886) 2024-11-28 16:48:48 +13:00
Keith Burzinski
d305870284 [network] clang-tidy fixes for #7822 (#7870) 2024-11-28 11:25:34 +13:00
Keith Burzinski
ff5004d7db [dht] clang-tidy fixes for #7822 (#7871) 2024-11-28 11:25:15 +13:00
Keith Burzinski
7aa3a1a1cc [apds9306] clang-tidy fixes for #7822 (#7872) 2024-11-28 11:25:00 +13:00
Keith Burzinski
e124151e5c [ezo] clang-tidy fixes for #7822 (#7873) 2024-11-28 11:24:43 +13:00
Keith Burzinski
e229ed0da3 [logger] clang-tidy fixes for #7822 (#7875) 2024-11-28 11:23:40 +13:00
Keith Burzinski
12cdeca48a [various] clang-tidy fixes for #7822 (#7874) 2024-11-28 11:23:20 +13:00
Keith Burzinski
a825ef59d4 [nextion] clang-tidy fixes for #7822 (#7878) 2024-11-28 11:22:37 +13:00
Keith Burzinski
65a5216d17 [pca6416a, pca9554] clang-tidy fixes for #7822 (#7879) 2024-11-28 11:22:18 +13:00
Keith Burzinski
567256bd62 [rotary_encoder] clang-tidy fixes for #7822 (#7880) 2024-11-28 11:21:10 +13:00
Keith Burzinski
4da57c35d0 [uln2003] clang-tidy fixes for #7822 (#7881) 2024-11-28 11:20:51 +13:00
Keith Burzinski
f2e8e655ba [mqtt] clang-tidy fixes for #7822 (#7877) 2024-11-28 11:19:41 +13:00
Keith Burzinski
8439232b11 [esp32_ble] clang-tidy fixes for #7822 (#7883) 2024-11-28 11:18:43 +13:00
Keith Burzinski
e6c730ab10 [max31865] clang-tidy fixes for #7822 (#7876) 2024-11-28 11:16:54 +13:00
Jesse Hills
e49df765d2 Merge branch 'release' into dev 2024-11-28 07:22:24 +13:00
Jesse Hills
e6da55b925 Merge pull request #7869 from esphome/bump-2024.11.2
2024.11.2
2024-11-28 07:21:44 +13:00
Jesse Hills
c894645747 Bump version to 2024.11.2 2024-11-27 14:06:21 +13:00
Samuel Sieb
2539cba610 [honeywell] use warning instead of failing (#7862)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-11-27 14:06:21 +13:00
Samuel Sieb
5ddbe5cdba [wifi] fix 32 char SSIDs (#7834)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-11-27 14:06:20 +13:00
Samuel Sieb
4c7552eca4 keypad binary sensors should be initially off (#7808)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-11-27 14:06:20 +13:00
Ramil Valitov
72bf0086e4 [fix] Status sensor does not check if required network component is missing (#7734)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-11-27 14:06:20 +13:00
TFGF
1b91e0027b [Modbus Controller] Fix issue #6477. Online automation triggering Offline (#7801) 2024-11-27 14:06:20 +13:00
Samuel Sieb
e9851e7eb2 fix modbus crashing when bad data returned (#7810)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-11-27 14:06:20 +13:00
Clyde Stubbs
80fedbc1a5 [qspi_dbi] Fix init sequences (Bugfix) (#7805) 2024-11-27 14:06:20 +13:00
Clyde Stubbs
a4a71797d9 [docker] Leave run-time required libraries installed. (#7804) 2024-11-27 14:06:20 +13:00
Clyde Stubbs
4a97064b2c [lvgl] Bugfixes (#7803) 2024-11-27 14:06:20 +13:00
tomaszduda23
a3ef2ed7fd python lint for platform components (#7864) 2024-11-27 09:56:43 +13:00
dependabot[bot]
3a8b41daa3 Bump docker/build-push-action from 6.9.0 to 6.10.0 in /.github/actions/build-image (#7866)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-26 21:06:56 +01:00
Jesse Hills
921be1a17c Move `USE_CAPTIVE_PORTAL` into all define groups it can be used with (#7863) 2024-11-27 07:09:16 +13:00
Keith Burzinski
e3d673d16c [helpers, optional] clang-tidy fixes for #7822 (#7841) 2024-11-27 07:08:02 +13:00
Keith Burzinski
39f3f795e2 [mqtt] clang-tidy fixes for #7822 (#7851) 2024-11-27 07:07:53 +13:00
Keith Burzinski
53691d28a8 [haier] clang-tidy fixes for #7822 (#7849) 2024-11-27 07:07:42 +13:00
Keith Burzinski
3730b0310b [sprinkler] clang-tidy fixes for #7822 (#7857) 2024-11-27 07:07:36 +13:00
Keith Burzinski
2b9013699d [alarm_control_panel] clang-tidy fixes for #7822 (#7845) 2024-11-26 11:05:39 +01:00
Samuel Sieb
be78827274 [honeywell] use warning instead of failing (#7862)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-11-26 23:05:20 +13:00
Keith Burzinski
cd1ee96606 [cse7766] clang-tidy fixes for #7822 (#7846) 2024-11-26 11:04:50 +01:00
Keith Burzinski
2fa8d907b3 [ltr501] clang-tidy fixes for #7822 (#7850) 2024-11-26 11:01:34 +01:00
Keith Burzinski
4c383906c4 [pipsolar] clang-tidy fixes for #7822 (#7855) 2024-11-26 11:00:40 +01:00
Keith Burzinski
bdc6302ea1 [sun_gtil2] clang-tidy fixes for #7822 (#7858) 2024-11-26 11:00:03 +01:00
Keith Burzinski
31c13e4c16 [output] clang-tidy fixes for #7822 (#7854) 2024-11-26 10:59:29 +01:00
Keith Burzinski
6b59f55a50 [nfc, pn532, pn7150, pn7160] clang-tidy fixes for #7822 (#7853) 2024-11-26 10:58:18 +01:00
Keith Burzinski
e6bd2238ce [sim800l] clang-tidy fixes for #7822 (#7856) 2024-11-26 10:54:16 +01:00
Keith Burzinski
2d4688a206 [shelly_dimmer] clang-tidy fixes for #7822 (#7844) 2024-11-26 10:53:23 +01:00
Keith Burzinski
536bcab5de [nextion] clang-tidy fixes for #7822 (#7852) 2024-11-26 10:52:57 +01:00
Keith Burzinski
1c2d2bce5a [display_menu_base] clang-tidy fixes for #7822 (#7847) 2024-11-26 10:52:26 +01:00
Keith Burzinski
2eac8b6c46 [camera_web_server] Use header instead of mock struct (#7823) 2024-11-26 10:50:33 +01:00
Jesse Hills
6e50e2aa65 Fix entity name validation to allow "Off" and "On" (#7821) 2024-11-26 10:50:16 +01:00
Keith Burzinski
841d278224 [dsmr] clang-tidy fixes for #7822 (#7848) 2024-11-26 10:47:57 +01:00
Keith Burzinski
11076e4614 [wireguard] clang-tidy fixes for #7822 (#7859) 2024-11-26 10:47:24 +01:00
Keith Burzinski
72df3d1606 [xiaomi_ble] clang-tidy fixes for #7822 (#7860) 2024-11-26 10:37:20 +01:00
Keith Burzinski
ae6736311a [lvgl] clang-tidy fixes for #7822 (#7843) 2024-11-26 04:29:36 +00:00
Citric Lee
c0dcecc465 Add: Seeed Studio mr60fda2 mmwave sensor (#7576)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Spencer Yan <spencer@spenyan.com>
2024-11-26 13:53:21 +13:00
Samuel Sieb
d9d368d38e add on_key trigger to matrix_keypad (#7830)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-11-26 13:21:47 +13:00
Samuel Sieb
a70cee1dc1 fix local time timestamp calculation (#7807)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-11-26 13:15:01 +13:00
Samuel Sieb
f4766ab74f [wifi] fix 32 char SSIDs (#7834)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-11-26 12:58:21 +13:00
Keith Burzinski
4fbf41472a [CI] Add/update some system include paths (#7831) 2024-11-25 17:41:27 -06:00
Keith Burzinski
6ee02c47c2 [homeassistant.number] Return when value not set (#7839) 2024-11-25 22:42:12 +00:00
JonasB2497
140d77061b added Waveshare BWR Mode for the 7.5in Display (#7687) 2024-11-26 11:29:58 +13:00
programmingbgloDE
d6f4f05090 Add waveshare 1 45 in v2 b support (#7052) 2024-11-26 11:26:48 +13:00
Keith Burzinski
bdb91112ea [helpers] Add NOLINT for Mutex private field `handle_` (#7838) 2024-11-25 16:20:03 -06:00
Keith Burzinski
b027b6a711 [opentherm] Add nolint for 8266 static global (#7837) 2024-11-26 10:57:40 +13:00
Oleg Tarasov
89ecfc2004 [opentherm] Fix out of memory errors on ESP8266 (#7835) 2024-11-26 10:47:01 +13:00
Keith Burzinski
cf835d1580 [opentherm] Follow variable naming convention (#7833) 2024-11-25 03:50:24 -06:00
Keith Burzinski
17a09cd221 [audio] Header modernization (#7832) 2024-11-25 03:50:18 -06:00
Keith Burzinski
1bd2d41ffd [uart] void functions should return nothing (#7829) 2024-11-25 21:39:22 +13:00
Keith Burzinski
aa6cea6f7e [sx1509] Fix up includes (#7828) 2024-11-25 08:27:36 +00:00
Keith Burzinski
ebf895990b [stepper] Remove unnecessary `#include` (#7827) 2024-11-25 08:25:04 +00:00
Keith Burzinski
46a435f5f2 [safe_mode] Remove unused capture (#7826) 2024-11-25 08:24:35 +00:00
Keith Burzinski
6c548a1596 [ota] void functions should return nothing (#7825) 2024-11-25 08:23:00 +00:00
Keith Burzinski
7f75f2135d [nextion] Remove assignment within if (#7824) 2024-11-25 08:22:50 +00:00
Samuel Sieb
c49f7293fe binary_sensor for switch state (#7819) 2024-11-24 23:24:23 -08:00
Jesse Hills
71496574e9 Move `CONF_NAME_ADD_MAC_SUFFIX to const.py` (#7820) 2024-11-25 17:26:36 +13:00
Samuel Sieb
b95b4a0694 keypad binary sensors should be initially off (#7808)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-11-25 11:40:51 +13:00
Samuel Sieb
59653ec785 allow multiple graphical menus (#7809)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-11-25 11:40:28 +13:00
Ramil Valitov
e02f3cdac7 [fix] Status sensor does not check if required network component is missing (#7734)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-11-25 11:23:30 +13:00
TFGF
d4d630823c [Modbus Controller] Fix issue #6477. Online automation triggering Offline (#7801) 2024-11-25 11:15:10 +13:00
Rodrigo Martín
9fc1377b44 feat(WiFi): Add wifi.configure action (#7335) 2024-11-25 11:06:21 +13:00
Samuel Sieb
e3e3d92347 fix modbus crashing when bad data returned (#7810)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-11-25 09:42:46 +13:00
Clyde Stubbs
13077095c2 [qspi_dbi] Fix init sequences (Bugfix) (#7805) 2024-11-25 09:27:09 +13:00
Clyde Stubbs
4001d82ca2 [docker] Leave run-time required libraries installed. (#7804) 2024-11-25 09:25:51 +13:00
Clyde Stubbs
4936ca1700 [lvgl] Bugfixes (#7803) 2024-11-25 09:25:16 +13:00
NP v/d Spek
2ecd5cff07 [wifi] Make wifi_channel_() public (#7818) 2024-11-25 09:16:51 +13:00
Petr Kejval
dea297c8d7 [nextion] Add publish actions (#7646)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-11-22 22:52:02 -06:00
Jesse Hills
ef7c5c6055 Merge branch 'release' into dev 2024-11-22 11:34:47 +13:00
Jesse Hills
ee3cfb2b76 Merge pull request #7798 from esphome/bump-2024.11.1
2024.11.1
2024-11-22 11:23:56 +13:00
Jesse Hills
2cc2a2153b Bump version to 2024.11.1 2024-11-22 10:08:00 +13:00
J. Nick Koston
e51f3d9498 Ensure storage I/O for ignored devices runs in the executor (#7792) 2024-11-22 10:08:00 +13:00
Alain Turbide
1c1f3f7c55 Fix for OTA mode not activating in safe_mode when OTA section has an on_xxxx action (#7796)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-11-22 10:08:00 +13:00
Spencer Owen
ea424b0699 Check for min_version earlier in validation (#7797) 2024-11-22 10:08:00 +13:00
Manuel Kasper
489d0d20d2 [qspi_dbi] Fix garbled graphics on RM690B0 (#7795) 2024-11-22 10:08:00 +13:00
Jesse Hills
f04e3de7b8 [speaker] Add missing auto-load for `audio` (#7794) 2024-11-22 10:08:00 +13:00
Jesse Hills
a0693060e4 [rtttl] Clamp gain between 0 and 1 (#7793) 2024-11-22 10:08:00 +13:00
Clyde Stubbs
888b237964 [http_request] Fix within context with parameters. (Bugfix) (#7790) 2024-11-22 10:08:00 +13:00
J. Nick Koston
122ff731ef Ensure storage I/O for ignored devices runs in the executor (#7792) 2024-11-22 09:41:31 +13:00
Alain Turbide
3232866dc3 Fix for OTA mode not activating in safe_mode when OTA section has an on_xxxx action (#7796)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-11-22 09:39:32 +13:00
Spencer Owen
ccf2854b61 Check for min_version earlier in validation (#7797) 2024-11-22 08:24:10 +13:00
Manuel Kasper
03ae6b2c1b [qspi_dbi] Fix garbled graphics on RM690B0 (#7795) 2024-11-21 20:46:49 +11:00
Jesse Hills
6bcbbcce02 [speaker] Add missing auto-load for `audio` (#7794) 2024-11-21 02:10:20 -06:00
Jesse Hills
fbb9967117 [rtttl] Clamp gain between 0 and 1 (#7793) 2024-11-21 00:22:02 -06:00
Clyde Stubbs
6d4f787f67 [http_request] Fix within context with parameters. (Bugfix) (#7790) 2024-11-21 13:10:28 +13:00
Kjell Braden
5e27a8df1f enable rp2040 for online_image (#7769) 2024-11-21 07:29:48 +13:00
Edward Firmo
846b091aac [nextion] New trigger on_buffer_overflow (#7772) 2024-11-21 07:28:21 +13:00
Jonathan Swoboda
372d68a177 [remote_base] Fix extra comma in dump raw (#7774)
Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
2024-11-21 07:27:23 +13:00
Jesse Hills
4fc19902ab Merge branch 'release' into dev 2024-11-21 06:44:07 +13:00
Jesse Hills
9a7d5dcad8 Merge pull request #7789 from esphome/bump-2024.11.0
2024.11.0
2024-11-21 06:42:54 +13:00
Jesse Hills
ef78c404dd Bump version to 2024.11.0 2024-11-20 21:29:42 +13:00
Jesse Hills
c857f98557 Merge branch 'beta' into dev 2024-11-20 20:18:12 +13:00
Jesse Hills
01a24de3a8 Merge pull request #7788 from esphome/bump-2024.11.0b4
2024.11.0b4
2024-11-20 20:17:38 +13:00
Jesse Hills
ae46dcef7e Bump version to 2024.11.0b4 2024-11-20 17:50:30 +13:00
Jesse Hills
872b8ee753 Bump esphome-dashboard to 20241120.0 (#7787) 2024-11-20 17:50:29 +13:00
Jesse Hills
eb8a2326ad [http_request] Feed watchdog timeout around http request functions (#7786) 2024-11-20 17:50:29 +13:00
Jesse Hills
cf63d627fe Bump esphome-dashboard to 20241120.0 (#7787) 2024-11-20 17:39:28 +13:00
Jesse Hills
49e9c43339 [http_request] Feed watchdog timeout around http request functions (#7786) 2024-11-19 18:54:19 -06:00
Jesse Hills
f1dc9537ff Merge branch 'beta' into dev 2024-11-20 07:28:20 +13:00
Jesse Hills
1ad535d030 Merge pull request #7784 from esphome/bump-2024.11.0b3
2024.11.0b3
2024-11-20 07:27:37 +13:00
Jesse Hills
1ed27b7cc0 Bump version to 2024.11.0b3 2024-11-19 09:04:30 +13:00
Jesse Hills
585586780b Bump esphome-dashboard to 20241118.0 (#7782) 2024-11-19 09:04:30 +13:00
pethans
50aeefc662 TuyaFan control should use oscillation_type (#7776)
Co-authored-by: Peter Hanson <phanson@whistler.lan>
2024-11-19 09:04:30 +13:00
Jesse Hills
6e41c22e9d Bump esphome-dashboard to 20241118.0 (#7782) 2024-11-18 20:44:39 +13:00
pethans
e81191ebd2 TuyaFan control should use oscillation_type (#7776)
Co-authored-by: Peter Hanson <phanson@whistler.lan>
2024-11-18 07:47:29 +13:00
dependabot[bot]
b29c119408 Bump codecov/codecov-action from 4 to 5 (#7771)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-15 12:43:52 +01:00
Jesse Hills
e819185de1 Merge branch 'beta' into dev 2024-11-14 15:33:40 +13:00
Jesse Hills
00465f4a6f Merge pull request #7765 from esphome/bump-2024.11.0b2
2024.11.0b2
2024-11-14 15:33:10 +13:00
Jesse Hills
f4dc11477f Bump version to 2024.11.0b2 2024-11-14 14:21:43 +13:00
Fabio Bonelli
754352b4d7 ld2420: fix typo in log message (#7758) 2024-11-14 14:21:43 +13:00
Jordan Zucker
67a4e56fcf Disable bluetooth proxy during update (#7695)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-11-14 14:21:43 +13:00
Felipe Santos
9bc7b74d01 Fix reactive power unit of measurement from VAR to var (#7757)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-11-14 14:21:43 +13:00
Roving Ronin
15bfc4c91f Update UNIT_VOLT_AMPS_REACTIVE = "var" (Currently 'VAR') (#7643) 2024-11-14 14:21:43 +13:00
Kevin Ahrendt
a0159a2746 [i2s_audio] Bugfix: Adjust I2S speaker setup priority (#7759) 2024-11-14 14:21:43 +13:00
luar123
44545a18a0 Fix temperature and humidity for bme680 with bsec2 (#7728) 2024-11-14 14:21:43 +13:00
Fabio Bonelli
0b51ec2c88 ld2420: fix typo in log message (#7758) 2024-11-14 13:57:51 +13:00
Jordan Zucker
5e62c489b0 Disable bluetooth proxy during update (#7695)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-11-14 13:57:09 +13:00
Felipe Santos
d015088855 Fix reactive power unit of measurement from VAR to var (#7757)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-11-14 13:44:18 +13:00
Roving Ronin
39c889e662 Update UNIT_VOLT_AMPS_REACTIVE = "var" (Currently 'VAR') (#7643) 2024-11-14 13:43:21 +13:00
Kevin Ahrendt
c7c8711c9c [i2s_audio] Bugfix: Adjust I2S speaker setup priority (#7759) 2024-11-14 06:39:02 +13:00
Jesse Hills
0a92405f2d Merge branch 'beta' into dev 2024-11-13 17:33:07 +13:00
Jesse Hills
b4b6b75e84 Merge pull request #7756 from esphome/bump-2024.11.0b1
2024.11.0b1
2024-11-13 17:32:32 +13:00
Jesse Hills
a2cab960a9 Bump version to 2024.12.0-dev 2024-11-13 13:49:38 +13:00
luar123
1f7f03f563 Fix temperature and humidity for bme680 with bsec2 (#7728) 2024-11-12 18:18:10 -06:00
Jesse Hills
80226694d5 Bump version to 2024.11.0b1 2024-11-13 13:16:13 +13:00
Kyle Cascade
053465d3f6 Updated dfplayer logging to be more user-friendly (#7740) 2024-11-13 11:54:25 +13:00
TFGF
7d75c9157b [Modbus Controller] Added on_online and on_offline automation (#7417) 2024-11-13 09:48:40 +13:00
Kevin Ahrendt
b367c01b4b [core] Ring buffer write functions use const pointer parameter (#7750) 2024-11-13 07:48:03 +13:00
Edward Firmo
e6a1254e65 [sun] Implements is_above_horizon() (#7754) 2024-11-13 07:23:00 +13:00
FreeBear-nc
1e80c4807e Message to string extend (#7755) 2024-11-13 07:20:48 +13:00
Kevin Ahrendt
928b39f495 [i2s_audio] I2S speaker improvements (#7749) 2024-11-13 07:20:12 +13:00
Oleg Tarasov
58d028ac13 Add OpenTherm component (part 3: rest of the sensors) (#7676)
Co-authored-by: FreeBear <freebear@tuxcnc.org>
Co-authored-by: FreeBear-nc <67865163+FreeBear-nc@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-11-12 16:19:42 +13:00
Djordje Mandic
a2dccc4730 [midea] Add temperature validation in do_follow_me method (bugfix) (#7736) 2024-11-11 17:14:01 +13:00
Clyde Stubbs
ffee2f0e88 [lvgl] Implement keypads (#7719) 2024-11-11 16:07:48 +13:00
Clyde Stubbs
d885d65c9b [sensor] Make some values templatable (#7735) 2024-11-11 14:18:05 +13:00
Kyle Cascade
c35240ca32 Remove the choice for MQTT logging if it is disabled (#7723) 2024-11-11 14:13:43 +13:00
Jesse Hills
7c00c5db70 [docker] Bump curl, iputils-ping and libssl-dev (#7748) 2024-11-11 09:44:02 +13:00
Jesse Hills
335faf858b Fix dashboard ip resolving (#7747) 2024-11-11 08:55:19 +13:00
Jesse Hills
1829e68730 Merge branch 'release' into dev 2024-11-08 22:42:27 +13:00
Jesse Hills
b8eadb2ba5 Merge pull request #7732 from esphome/bump-2024.10.3
2024.10.3
2024-11-08 22:41:29 +13:00
Jesse Hills
551ea37882 Bump version to 2024.10.3 2024-11-08 17:02:31 +13:00
Clyde Stubbs
3a25eaca3f [lvgl] Ensure images are configured before using them. (Bugfix) (#7721) 2024-11-08 17:02:31 +13:00
Bonne Eggleston
e85cbf26f8 Fixes modbus timing error (#7674) 2024-11-08 17:02:31 +13:00
Clyde Stubbs
2ec17eed58 [rpi_dpi_rgb] Fix get_width and height (Bugfix) (#7675)
Co-authored-by: clydeps <U5yx99dok9>
2024-11-08 17:02:31 +13:00
David Woodhouse
2f77d31690 OTA: Fix IPv6 and multiple address support (#7414) 2024-11-08 16:38:13 +13:00
dependabot[bot]
3f123d7542 Bump pypa/gh-action-pypi-publish from 1.11.0 to 1.12.2 (#7730)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-11-08 12:42:36 +13:00
Clyde Stubbs
d189cc1fbe [lvgl] Fix id config for the lvgl component (Bugfix) (#7731)
Co-authored-by: clydeps <U5yx99dok9>
2024-11-07 23:39:01 +00:00
Ramil Valitov
c0658ffe2c [fix] deprecated legacy driver tsens (#7658)
Co-authored-by: luar123 <49960470+luar123@users.noreply.github.com>
2024-11-08 11:10:58 +13:00
Clyde Stubbs
248b0bc378 [lvgl] Allow multiple LVGL instances (#7712)
Co-authored-by: clydeps <U5yx99dok9>
2024-11-08 09:05:23 +13:00
Rodrigo Martín
80b4c26481 feat(MQTT): Add enable, disable and enable_on_boot (#7716) 2024-11-06 13:56:48 +13:00
Clyde Stubbs
5bb4d042e4 [spi_device] rename mode to spi_mode (#7724) 2024-11-05 18:54:47 -06:00
Jesse Hills
dcc537d0d4 [lvgl] Don't just throw key error if someone types a bad layout type (#7722)
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2024-11-06 08:45:40 +11:00
Clyde Stubbs
2dca3d79e4 [lvgl] Ensure images are configured before using them. (Bugfix) (#7721) 2024-11-05 11:32:18 +11:00
tomaszduda23
01497c891d datetime fix build_language_schema (#7710)
Co-authored-by: Tomasz Duda <tomaszduda23@gmai.com>
2024-11-04 10:22:16 +13:00
Samuel Sieb
77bb46ff3b handle bad pin schemas (#7711)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-11-01 20:54:34 +11:00
Jesse Hills
cefbfb75bd [esp32_ble] Add disconnect as a virtual function to `ESPBTClient` (#7705) 2024-10-31 05:46:35 -05:00
Clyde Stubbs
749b942132 [lvlg] fix tests (#7708) 2024-10-31 06:37:32 +00:00
Faidon Liambotis
a043022444 [font] Add support for "glyphsets" (#7429)
Co-authored-by: clydebarrow <2366188+clydebarrow@users.noreply.github.com>
2024-10-31 16:36:23 +13:00
Clyde Stubbs
8b7e061f3a [touchscreen] Calibration fixes (#7704) 2024-10-31 15:15:39 +13:00
Jesse Hills
74ea1b60e3 [CI] Fix webserver defines to be present based on platform, not just framework (#7703) 2024-10-31 11:37:54 +13:00
Clyde Stubbs
5a2fed3569 [spi] Add mosi pin checks for displays (#7702) 2024-10-30 22:28:18 +00:00
Jason Nagin
e85157db4b Add config for current temperature precision (#7699) 2024-10-31 08:34:33 +13:00
Clyde Stubbs
d3563e4e97 [sdl] Allow window to be resized. (#7698) 2024-10-31 08:30:46 +13:00
Kevin Ahrendt
765579dabb [es8311] Add es8311 dac component (#7693) 2024-10-31 08:29:24 +13:00
dependabot[bot]
6afd004ec5 Bump pypa/gh-action-pypi-publish from 1.10.3 to 1.11.0 (#7700)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-31 08:25:36 +13:00
Clyde Stubbs
ee3ee3a63b [http_request] Implement on_error trigger for requests (#7696) 2024-10-30 14:10:58 +13:00
Jordan Zucker
aae2ee2ecb Add in area and device to the prometheus labels (#7692) 2024-10-30 14:03:10 +13:00
Ilia Sotnikov
bac6880a1e fix: [climate] Allow substitutions in visual.temperature_step.{target_temperature,current_temperature} (#7679) 2024-10-29 16:32:55 -07:00
tomaszduda23
0982ab58ac fix build error (#7694)
Co-authored-by: Tomasz Duda <tomaszduda23@gmai.com>
2024-10-30 07:53:36 +13:00
Samuel Sieb
38dd566e0c remove use of delay (#7680)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-10-29 04:12:54 +00:00
tomaszduda23
71e1e3b5f8 let make new platform implementation in external components (#7615)
Co-authored-by: Tomasz Duda <tomaszduda23@gmai.com>
2024-10-29 16:58:36 +13:00
Rodrigo Martín
abbd7faa64 fix(WiFi): Fix strncpy missing NULL terminator [-Werror=stringop-truncation] (#7668) 2024-10-29 16:56:50 +13:00
Bonne Eggleston
aa0e155e22 Fixes modbus timing error (#7674) 2024-10-29 16:52:39 +13:00
Sean Brogan
0dab280440 Mopeka Pro Check improvement to allow user to configure the sensor reporting for lower quality readings (#7475) 2024-10-29 16:49:06 +13:00
Jordan Zucker
90b076eccd Add more prometheus metrics (#7683) 2024-10-29 16:43:02 +13:00
Jordan Zucker
444c0fc67f Add asdf to gitignore (and dockerignore) (#7686) 2024-10-29 16:09:22 +13:00
Satoshi YAMADA
302ba2874e Support W5500 SPI-Ethernet polling mode if framework is supported (#7503) 2024-10-29 16:08:08 +13:00
Clyde Stubbs
df750d0d11 [http_request] Add enum for status codes (#7690) 2024-10-29 16:05:58 +13:00
Clyde Stubbs
63e4d4b493 [font] Fix failure with bitmap fonts (#7691) 2024-10-29 13:56:32 +11:00
Clyde Stubbs
88627095fb [http_request] Always return defined server response status (#7689) 2024-10-29 11:12:32 +11:00
Clyde Stubbs
858d97ccef [bytebuffer] Rework ByteBuffer using templates (#7638) 2024-10-29 11:08:29 +13:00
Clyde Stubbs
22f30d42a6 [lvgl] Implement qrcode (#7623) 2024-10-29 11:05:51 +13:00
Clyde Stubbs
1e2497748d [rpi_dpi_rgb] Fix get_width and height (Bugfix) (#7675)
Co-authored-by: clydeps <U5yx99dok9>
2024-10-27 15:17:09 +13:00
SeByDocKy
34de2bbe99 gp8403 : Add the possibility to use substitution for channel selection (#7681) 2024-10-26 14:54:57 -07:00
Oleg Tarasov
21cb941bbe Add OpenTherm component (part 2.1: sensor platform) (#7529)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-10-25 15:00:28 +13:00
Clyde Stubbs
33fdbbe30c [image][online_image][animation] Fix transparency in RGB565 (#7631) 2024-10-25 11:05:25 +13:00
dependabot[bot]
09f9d91577 Bump actions/setup-python from 5.2.0 to 5.3.0 (#7670)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-10-25 10:57:09 +13:00
dependabot[bot]
34a8eaddb2 Bump actions/setup-python from 5.2.0 to 5.3.0 in /.github/actions/restore-python (#7671)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-25 10:56:48 +13:00
tomaszduda23
7dbda12008 [code-quality] weikai.h (#7601) 2024-10-25 10:55:58 +13:00
Kevin Ahrendt
4101d5dad1 [media_player] Add new media player conditions (#7667) 2024-10-25 10:26:39 +13:00
tomaszduda23
c20e1975d1 unified way how all platforms handle get_download_types (#7617)
Co-authored-by: Tomasz Duda <tomaszduda23@gmai.com>
2024-10-25 10:25:19 +13:00
Jesse Hills
4fa3c6915c Bump esphome-dashboard to 20241025.0 (#7669) 2024-10-25 08:10:30 +13:00
Jesse Hills
ca5c73d170 Support ignoring discovered devices from the dashboard (#7665) 2024-10-25 07:55:14 +13:00
Aaron Solochek
5b5c2fe71b updating ESP32 board definitions (#7650) 2024-10-24 13:25:53 +13:00
tomaszduda23
9acc21e81a unified way how all platforms handle copy_files (#7614)
Co-authored-by: Tomasz Duda <tomaszduda23@gmai.com>
2024-10-24 10:04:59 +13:00
Kevin Ahrendt
bff0e81ed3 [speaker, i2s_audio] Support audio_dac component, mute actions, and improved logging (#7664)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-10-24 09:37:38 +13:00
dependabot[bot]
2feffddc55 Bump actions/cache from 4.1.1 to 4.1.2 (#7660)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-24 08:06:53 +13:00
dependabot[bot]
4289e00ad0 Bump actions/cache from 4.1.1 to 4.1.2 in /.github/actions/restore-python (#7659)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-24 08:06:45 +13:00
Jesse Hills
574ee404d2 Merge branch 'release' into dev 2024-10-24 08:05:09 +13:00
Jesse Hills
9caf5f8b31 Merge pull request #7663 from esphome/bump-2024.10.2
2024.10.2
2024-10-24 08:04:29 +13:00
Jesse Hills
127acfde64 Bump version to 2024.10.2 2024-10-24 07:15:40 +13:00
Kevin Ahrendt
156ad773c9 [voice_assistant] Bugfix: Fix crash on start (#7662) 2024-10-24 07:15:40 +13:00
Clyde Stubbs
8d90d256bf [lvgl] Some properties were not templatable (Bugfix) (#7655) 2024-10-24 07:15:40 +13:00
Kyle Cascade
833565feb9 Humanized the missing MQTT log topic error message (#7634) 2024-10-24 07:15:40 +13:00
Kevin Ahrendt
fdebf04196 [voice_assistant] Bugfix: Fix crash on start (#7662) 2024-10-24 06:25:31 +13:00
Gábor Poczkodi
dd8d25e43f i2c_device (#7641) 2024-10-23 16:23:10 +13:00
Clyde Stubbs
68844c4869 [lvgl] Some properties were not templatable (Bugfix) (#7655) 2024-10-23 12:16:55 +13:00
Kyle Cascade
7c0543862a Humanized the missing MQTT log topic error message (#7634) 2024-10-22 17:11:23 +13:00
Rodrigo Martín
a932ca2f64 feat(MQTT): Add subscribe QoS to discovery (#7648) 2024-10-22 16:38:25 +13:00
Edward Firmo
2597975ae0 [rtttl] Add get_gain() (#7647) 2024-10-22 16:29:16 +13:00
Clyde Stubbs
6330177d24 [lvgl] Allow strings to be interpreted as integers (Bugfix) (#7652) 2024-10-22 16:10:09 +13:00
Clyde Stubbs
3ac730fb2f [lvgl] Fix rotation code for 90deg (Bugfix) (#7653) 2024-10-22 16:06:58 +13:00
Clyde Stubbs
ff48f53989 [image] Fix compile time problem with host image not using lvgl (#7654) 2024-10-22 16:05:39 +13:00
Clyde Stubbs
8bb4316956 [lvgl] light schema should require widget: not led: (Bugfix) (#7649) 2024-10-22 16:03:32 +13:00
Jesse Hills
40cdb778f5 Merge branch 'release' into dev 2024-10-22 14:00:31 +13:00
Jesse Hills
dfd174e1a5 Merge pull request #7651 from esphome/bump-2024.10.1
2024.10.1
2024-10-22 13:59:49 +13:00
Jesse Hills
735c04cd69 Bump version to 2024.10.1 2024-10-22 12:57:17 +13:00
Michael Hansen
d95b370998 Move setting global voice assistant to constructor (#7630)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-10-22 12:57:17 +13:00
Clyde Stubbs
3ebdd62c67 [lvgl] Remove states from style definitions (Bugfix) (#7645) 2024-10-22 12:57:17 +13:00
Clyde Stubbs
c26c96b8f4 [config] Ensure user-supplied build flags don't get silently overwritten (#7622) 2024-10-22 12:57:17 +13:00
Keith Burzinski
748256b3ee [wifi] Support custom MAC on Arduino, too (#7644) 2024-10-22 12:57:17 +13:00
Samuel Sieb
10791db82e auto-load preferences (#7642)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-10-22 12:57:17 +13:00
Lennart
3dd34f6628 Fix broken ibeacon_uuid config in ble_rssi (#7640) 2024-10-22 12:57:17 +13:00
Clyde Stubbs
7004053538 [config] Fix crash with empty substitutions block (#7612) 2024-10-22 12:57:17 +13:00
Michael Hansen
dc42427c60 Move setting global voice assistant to constructor (#7630)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-10-21 23:14:07 +00:00
Clyde Stubbs
40ad6befa8 [lvgl] Remove states from style definitions (Bugfix) (#7645) 2024-10-22 11:51:40 +13:00
Clyde Stubbs
612e2c1644 [lvgl] Defer display rotation reset until setup(). (Bugfix) (#7627) 2024-10-22 11:50:16 +13:00
Clyde Stubbs
c8d0cde329 [config] Ensure user-supplied build flags don't get silently overwritten (#7622) 2024-10-22 11:49:12 +13:00
Keith Burzinski
5e8794175d [wifi] Support custom MAC on Arduino, too (#7644) 2024-10-22 11:46:41 +13:00
Samuel Sieb
657527655d auto-load preferences (#7642)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-10-21 13:40:43 +13:00
Jesse Hills
f7543a7b8d Update Pull request template (#7620) 2024-10-21 11:28:52 +13:00
Lennart
43a020641b Fix broken ibeacon_uuid config in ble_rssi (#7640) 2024-10-21 08:16:08 +13:00
Shivam Maurya
c019ff34bc Bump bme68x_bsec2 version to 1.8.2610 (#7626) 2024-10-17 20:15:28 -05:00
guillempages
ef6ccddc0d [lvgl] Allow esphome::Image in lambda to update image source directly (#7624) 2024-10-18 07:23:37 +11:00
Clyde Stubbs
8bbe4efded [lvgl] Revise code generation to allow early widget creation (#7611) 2024-10-17 15:20:19 +13:00
tomaszduda23
f490585f66 [code-quality] udp component (#7602)
Co-authored-by: Tomasz Duda <tomaszduda23@gmai.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-10-17 12:38:02 +11:00
Clyde Stubbs
fcfc76b01b [lvgl] Roller and Dropdown enhancements; (#7608) 2024-10-17 14:03:48 +13:00
Clyde Stubbs
5ad68e926d [axs15231] Touchscreen driver (#7592) 2024-10-17 13:44:20 +13:00
Clyde Stubbs
56fa6fef85 [config] Fix crash with empty substitutions block (#7612) 2024-10-17 13:32:22 +13:00
Ramil Valitov
c9e5919739 [fix] ESP32-C6 BLE compile error (#7580)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-10-17 13:31:02 +13:00
functionpointer
0451b31f9e Bump arduino-mlx90393 to 1.0.2 (#7618) 2024-10-17 13:17:20 +13:00
Kevin Ahrendt
1c845e0ff8 [speaker, i2s_audio] I2S Speaker implementation using a ring buffer (#7605) 2024-10-17 11:47:11 +13:00
Rui Chen
22478ffb0f chore: bump platformio to 6.1.16 to support py3.13 build (#7590) 2024-10-16 17:26:48 +13:00
Rui Chen
c38cc128db chore: bump pyyaml to 6.0.2 to support py3.13 build (#7610) 2024-10-16 17:26:17 +13:00
Paul Blacknell
fa01149771 Add support for Analog Devices MAX17043 battery fuel gauge (#7522)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-10-16 16:28:24 +13:00
Clyde Stubbs
254522dd93 [qspi_dbi] Rename from qspi_amoled, add features (#7594)
Co-authored-by: clydeps <U5yx99dok9>
2024-10-16 16:26:50 +13:00
Clyde Stubbs
6a86d92781 [lvgl] Implement better software rotation (#7595) 2024-10-16 16:26:06 +13:00
Ramil Valitov
b274d6901a [fix] deprecated functions warnings for logger component with ESP IDF version 5.3.0+ (#7600) 2024-10-16 16:25:47 +13:00
Aleksandr Artemev
3ef31e55ca [display] filled_ring and filled_gauge methods added (#7420) 2024-10-16 16:25:05 +13:00
Seth Girvan
fb002ac3b0 Add TC74 temperature sensor (#7460)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-10-16 16:24:37 +13:00
Clyde Stubbs
de943908bd [automation] Implement all and any condition shortcuts (#7565) 2024-10-16 16:23:43 +13:00
tomaszduda23
b0a25872da [code-quality] statsd component (#7603)
Co-authored-by: Tomasz Duda <tomaszduda23@gmai.com>
2024-10-16 16:22:45 +13:00
Jesse Hills
403d450f47 Merge branch 'release' into dev 2024-10-16 16:19:08 +13:00
Jesse Hills
d6b96ad51d Merge pull request #7609 from esphome/bump-2024.10.0
2024.10.0
2024-10-16 16:18:27 +13:00
Jesse Hills
9b4b50a3a6 Bump version to 2024.10.0 2024-10-16 14:29:17 +13:00
Ramil Valitov
2cca26ada4 [fix] ESP32-C6: internal temperature reporting (#7579) 2024-10-15 06:59:23 +13:00
tomaszduda23
312799babf Update test_build_components (#7597)
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2024-10-14 14:31:37 +13:00
Jesse Hills
5bc5a9dcb6 Merge branch 'beta' into dev 2024-10-14 10:58:02 +13:00
Jesse Hills
ef87a6657a Merge pull request #7599 from esphome/bump-2024.10.0b2
2024.10.0b2
2024-10-14 10:57:15 +13:00
Clyde Stubbs
27e1233fc0 [CI] failures when installing using apt-get. (#7593) 2024-10-14 09:51:43 +13:00
Jesse Hills
d24ad2e0e7 Bump version to 2024.10.0b2 2024-10-14 09:31:16 +13:00
Niclas Larsson
dda27d9de4 Fix update sequence when update is set to false (#5225) (#7407) 2024-10-14 09:31:16 +13:00
Clyde Stubbs
f52136338d [touchscreen] Fix coordinates when using rotation (#7591) 2024-10-14 09:31:15 +13:00
RFDarter
bafb0ad688 [web_server] Event component grouping (#7586) 2024-10-14 09:31:15 +13:00
Samuel Sieb
b617b92758 fix uart settings check (#7573) 2024-10-14 09:31:15 +13:00
Niclas Larsson
39e922580a Fix update sequence when update is set to false (#5225) (#7407) 2024-10-14 09:17:37 +13:00
Clyde Stubbs
77d0bfc4bb [touchscreen] Fix coordinates when using rotation (#7591) 2024-10-14 09:10:48 +13:00
RFDarter
654cee6f83 [web_server] expose event compoent to REST (#7587) 2024-10-14 07:50:22 +13:00
RFDarter
cf14c02b8a [web_server] Event component grouping (#7586) 2024-10-14 07:50:13 +13:00
Pietro
42f6095960 [core][esp32_rmt_led_strip] Migrate ExternalRAMAllocator to RAMAllocator
And add psram flag to esp32_rmt_led_strip
Co-authored-by: guillempages <guillempages@users.noreply.github.com>
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2024-10-13 20:24:17 +11:00
Clyde Stubbs
f224984858 [CI] failures when installing using apt-get. (#7593) 2024-10-12 18:51:51 -05:00
Jesse Hills
efe4c5e3bc [light] Add `initial_state` configuration (#7577) 2024-10-11 13:13:32 -04:00
Ramil Valitov
cedb671f07 [fix] ESP32-C6 Reset Reasons (#7578) 2024-10-11 07:51:21 +13:00
dependabot[bot]
c18bd3ac81 Bump actions/upload-artifact from 4.4.2 to 4.4.3 (#7575)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-10 16:07:40 +13:00
Ilia Sotnikov
b08432bd0d Update pillow to 10.4.0 (#7566) 2024-10-10 13:44:07 +11:00
Samuel Sieb
4bac9707fe fix uart settings check (#7573) 2024-10-09 05:44:19 -05:00
Jesse Hills
7e16cda949 Merge branch 'beta' into dev 2024-10-09 17:48:32 +13:00
Jesse Hills
8a025a6617 Merge pull request #7572 from esphome/bump-2024.10.0b1
2024.10.0b1
2024-10-09 17:44:02 +13:00
Jesse Hills
1c05f5af03 Bump version to 2024.11.0-dev 2024-10-09 15:01:49 +13:00
Jesse Hills
4a9d3a3927 Bump version to 2024.10.0b1 2024-10-09 15:01:49 +13:00
dependabot[bot]
26694cb55e Bump actions/cache from 4.1.0 to 4.1.1 in /.github/actions/restore-python (#7571)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-09 14:51:43 +13:00
dependabot[bot]
94ad1237ce Bump actions/cache from 4.1.0 to 4.1.1 (#7570)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-09 14:51:31 +13:00
dependabot[bot]
69467ea6ff Bump actions/upload-artifact from 4.4.1 to 4.4.2 (#7569)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-09 14:51:23 +13:00
Clyde Stubbs
66f500e594 [template/binary_sensor] Implement condition: option as alternative to lambda. (#7561) 2024-10-09 14:49:33 +13:00
Clyde Stubbs
fc97a6d1e3 [lvgl] Fix text component (#7563) 2024-10-09 14:43:28 +13:00
Clyde Stubbs
1a567b6986 [cst816] Allow skipping i2c probe (#7557) 2024-10-09 14:41:58 +13:00
baldisos
9211aad524 Update radon_eye_listener.cpp for more possible variants (#7567) 2024-10-09 14:33:50 +13:00
dependabot[bot]
6139b933c5 Bump actions/cache from 4.0.2 to 4.1.0 (#7558)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-08 02:00:10 +00:00
dependabot[bot]
3804b3b759 Bump actions/cache from 4.0.2 to 4.1.0 in /.github/actions/restore-python (#7560)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-08 14:34:26 +13:00
dependabot[bot]
659239e8cd Bump actions/upload-artifact from 4.4.0 to 4.4.1 (#7559)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-08 14:34:15 +13:00
Clyde Stubbs
52e59d1dad [ili9xxx] Put display into sleep mode on shutdown. (#7555) 2024-10-08 14:28:59 +13:00
Clyde Stubbs
b8630363e0 [online_image] Bugfix: Use std::string instead of const char * (#7556) 2024-10-07 11:47:07 -05:00
esphomebot
1d91601094 Update webserver local assets to 20241007-025551 (#7553) 2024-10-07 03:22:17 +00:00
Curtis Malainey
ea23f49e90 nau7802: new component (#6291) 2024-10-07 16:08:56 +13:00
Ken Baker
b2bf2bc448 Add Initial NPI-19 pressure sensor support (#7181)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-10-07 15:59:13 +13:00
Ken Baker
5ad5ef5a42 Add Initial TE-M3200 pressure sensor support (#6862)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-10-07 15:58:28 +13:00
RFDarter
86a34f4b17 [web_server] v3 entity grouping (#6833)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-10-07 15:52:26 +13:00
Clyde Stubbs
6a2ed8241e [lvgl] Fix: allow full range of styles on dropdown list. (#7552) 2024-10-07 15:43:41 +13:00
YorkshireIoT
03a95ee05f Feature/add seeed grove gmxxx multichannel gas support (#4304)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-10-07 15:34:46 +13:00
Clyde Stubbs
81f6750211 [lvgl] Bugfixes #3 (#7472) 2024-10-07 13:27:08 +13:00
tomaszduda23
cbc03aae80 [code-quality] fix clang-tidy api (#7279) 2024-10-07 11:55:11 +13:00
tomaszduda23
390299894e [code-quality] fix clang-tidy md5 and hmac_md5 (#7325)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-10-07 11:53:49 +13:00
dependabot[bot]
fc7628cdea Bump docker/build-push-action from 6.7.0 to 6.9.0 in /.github/actions/build-image (#7511)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 10:34:38 +13:00
dependabot[bot]
fbd600f43f Bump pypa/gh-action-pypi-publish from 1.10.2 to 1.10.3 (#7541)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 10:34:17 +13:00
dependabot[bot]
239eadb895 Bump docker/setup-buildx-action from 3.6.1 to 3.7.1 in the docker-actions group across 1 directory (#7542)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-10-07 10:34:03 +13:00
Keith Burzinski
e87169805c [wifi] Replace `USE_ESP32_IGNORE_EFUSE_MAC_CRC with IDF's CONFIG_ESP_MAC_IGNORE_MAC_CRC_ERROR` (#7502) 2024-10-07 10:02:53 +13:00
Keith Burzinski
9f85d99a22 [audio_dac] [aic3204] Add new component + platform (#7505) 2024-10-07 09:59:42 +13:00
Keith Burzinski
56e305f986 [bedjet_codec] Remove `assert()` (#7543) 2024-10-07 09:01:43 +13:00
Keith Burzinski
1c0ee5ae6b [thermostat] Remove `assert()`s (#7544) 2024-10-07 09:01:11 +13:00
Keith Burzinski
949e61db8d [bang-bang] Remove `assert()` (#7533) 2024-10-07 09:00:09 +13:00
Tobias Hoff
e31a96bfe2 Allow use of all pulse count unit channels if needed. (#7550) 2024-10-07 08:53:57 +13:00
Samuel Sieb
6a8e88b1cc CSE7766 needs even parity (#7549) 2024-10-07 08:49:52 +13:00
guillempages
b3cff566eb [lvgl] Remap image to img in "set_style_*" (#7546) 2024-10-06 09:44:18 +11:00
guillempages
0a62106b7b [image] Use "puremagic" instead of "magic" python module (#7536) 2024-10-05 17:07:32 +10:00
Keith Burzinski
1cf4818640 [CI] Use a list when reading idedata for includes (#7535) 2024-10-04 21:07:49 +13:00
RFDarter
523eedbc51 [web_server] Expose detail=all on all components (#7531) 2024-10-03 13:34:12 +13:00
David Woodhouse
e57a1ff42d Fix parsing of µs time periods in config (#7495) 2024-10-03 07:54:12 +13:00
Jesse Hills
361b6ab961 [mics_4514] Move consts to consts.py (#7528) 2024-10-02 04:27:32 -05:00
Keith Burzinski
0d80286bb3 [esp32] Add `ignore_efuse_custom_mac` config var (#7527) 2024-10-02 03:27:46 -05:00
Keith Burzinski
d00e0eb2d6 [wifi] Fix error message when no custom MAC is set (#7515) 2024-10-02 02:33:35 +00:00
Keith Burzinski
215f26fbe4 [CI] Remove `sorted` from library include dirs (#7526) 2024-10-02 13:08:12 +13:00
Jesse Hills
68928aee7c Merge branch 'release' into dev 2024-10-01 16:42:26 +13:00
Jesse Hills
ffb0080fc1 Merge pull request #7516 from esphome/bump-2024.9.2
2024.9.2
2024-10-01 16:41:38 +13:00
Jesse Hills
f784e5c9f6 Bump version to 2024.9.2 2024-10-01 15:33:40 +13:00
Jesse Hills
748bc85bfe [rp2040] Always use maxgerhardt platform fork (#7514) 2024-10-01 15:33:40 +13:00
Nick Kinnan
050e2547ea Prevent rp2040 randomly breaking the build (#7507)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-10-01 15:33:40 +13:00
Jesse Hills
c2518cff89 [config_validation] Fix bug with extras on schemas (#7497) 2024-10-01 15:33:39 +13:00
Samuel Sieb
4332301dbb fix bl0906 reset energy action (#7488)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-10-01 15:33:39 +13:00
Jesse Hills
d5fa17c316 [rp2040] Always use maxgerhardt platform fork (#7514) 2024-10-01 13:37:08 +13:00
@RubenKelevra
c1a28ba5e2 tcs34725: Remove IR compensation and improve illuminance and color temperature handling in extreme conditions (#7492) 2024-10-01 11:03:42 +13:00
@RubenKelevra
01e03b76a7 tcs34725: optimize fetch time with burst read for RGB and clear values (#7494)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-10-01 11:00:40 +13:00
dependabot[bot]
507d27e84a Bump pypa/gh-action-pypi-publish from 1.10.1 to 1.10.2 (#7487)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-30 21:48:36 +02:00
Darren Griffin
01f5ca26dc Add OHF logo to README (#7509) 2024-09-30 18:49:13 +02:00
Nick Kinnan
20cb2e147f Make time dependency optional (#7425)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-30 16:27:22 +13:00
Nick Kinnan
49a3d385eb Prevent rp2040 randomly breaking the build (#7507)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-30 14:59:12 +13:00
zry98
023cb4937e Add support for Sharp GP2Y1010AU0F PM2.5 sensor (#6007)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-30 14:22:27 +13:00
Keith Burzinski
529ff4bd52 [wifi] Use custom MAC address if programmed (#7498) 2024-09-27 10:24:18 +12:00
victorclaessen
3df25a183a Add clean_session as configurable option to the MQTT component (#7501) 2024-09-27 09:57:51 +12:00
Clyde Stubbs
c55b4f5e1b [ch422g] Add support for pins 8-11; make input work. (#7467) 2024-09-27 09:51:08 +12:00
Kevin Ahrendt
3b1b1071f1 [core] add ring buffer destructor (#7500) 2024-09-27 09:25:20 +12:00
Jesse Hills
21fbbc5fb9 [config_validation] Fix bug with extras on schemas (#7497) 2024-09-26 00:34:27 +00:00
@RubenKelevra
b61577b68b tcs34725: Add check for Division by Zero (#7485) 2024-09-25 14:28:22 +12:00
@RubenKelevra
fa9df32979 tcs34725: fix color/clear channel percentage calculations on long exposures (#7493) 2024-09-25 14:27:14 +12:00
Jonathan Swoboda
fcce70d416 Add remote transmitter triggers (#7483)
Co-authored-by: Jonathan Swoboda <jonathan.swoboda>
2024-09-25 14:09:24 +12:00
Samuel Sieb
8e54a622d3 fix bl0906 reset energy action (#7488)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-09-25 12:50:44 +12:00
David Sichau
294fe8d970 Support inkplate 5 and 5 V2 (#7448)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-25 12:50:01 +12:00
Nick Kinnan
cc53eb42b2 Add CSE7766 reactive power (#7301) 2024-09-23 22:53:13 -05:00
dependabot[bot]
4ece4a389e Bump peter-evans/create-pull-request from 7.0.3 to 7.0.5 (#7469)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-23 21:31:38 +02:00
Keith Burzinski
2ff863deb3 [micro_wake_word] Workaround for failing IDF 5+ tests (#7484) 2024-09-23 18:35:26 +12:00
Keith Burzinski
402a6a9edb [esp32_improv] Add triggers for various states (#7461)
Co-authored-by: NP v/d Spek <github_mail@lumensoft.nl>
2024-09-22 23:54:31 -05:00
Jesse Hills
af612add24 Merge branch 'release' into dev 2024-09-23 12:02:32 +12:00
Jesse Hills
1f8037d5bc Merge pull request #7482 from esphome/bump-2024.9.1
2024.9.1
2024-09-23 12:01:43 +12:00
Jesse Hills
f314ad8a5b Bump version to 2024.9.1 2024-09-23 10:40:47 +12:00
Michael Hansen
66f9597d9e Copy active wake words to message (#7481) 2024-09-23 10:40:47 +12:00
Tarik2142
c287673947 add "fan_mode" and "swing_mode" to REST API (#7476) 2024-09-23 09:35:57 +12:00
Michael Hansen
5f7bde2a2c Copy active wake words to message (#7481) 2024-09-23 07:44:53 +12:00
Clyde Stubbs
8e5d7337c8 [st7701s] Fix initialisation race (#7462) 2024-09-19 16:18:51 +12:00
Michał Obrembski
fb7e7eb80b Add tca9555 GPIO driver (#7146)
Co-authored-by: Michal Obrembski <michal@obrembski.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-19 16:17:22 +12:00
Clyde Stubbs
6d24e9ebb5 [lvgl] Enhancements (#7453) 2024-09-19 16:17:04 +12:00
Pietro
ddde64a48d Added i2s_comm_fmt parameter to i2s speaker component (#7449)
Co-authored-by: PxPert <pxpert@pxpert.cloud>
2024-09-19 16:16:39 +12:00
Pavlo Dudnytskyi
446f7e0a7e Haier climate integration update (#7416)
Co-authored-by: Pavlo Dudnytskyi <pdudnytskyi@astrata.eu>
2024-09-19 16:09:27 +12:00
Edward Firmo
d0dc275e30 [nextion] Optionally skip connection handshake (#6905)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-19 16:08:15 +12:00
Andrey Bodrov
9699719305 openeth ethernet / qemu support (#7020) 2024-09-19 16:07:39 +12:00
Jesse Hills
1596a85e4f Merge branch 'release' into dev 2024-09-19 07:57:38 +12:00
Jesse Hills
6fde5e0fed Merge pull request #7466 from esphome/bump-2024.9.0
2024.9.0
2024-09-19 07:56:46 +12:00
Jesse Hills
34229af38a Bump version to 2024.9.0 2024-09-18 16:56:07 +12:00
Jesse Hills
373cb44078 Merge branch 'beta' into dev 2024-09-18 16:05:49 +12:00
Jesse Hills
3744c7876b Merge pull request #7465 from esphome/bump-2024.9.0b4
2024.9.0b4
2024-09-18 14:33:58 +12:00
Jesse Hills
a930b377b0 Bump version to 2024.9.0b4 2024-09-18 12:57:27 +12:00
Michael Hansen
571c0eb827 Add voice assistant methods for configuration (#7459)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-18 12:57:27 +12:00
Jesse Hills
749f664330 Dont replace project name spaces with underlines (#7455) 2024-09-18 12:57:27 +12:00
Michael Hansen
f87d9be60d Add voice assistant configuration messages (#7445) 2024-09-18 12:57:27 +12:00
Michael Hansen
5a3e1d5792 Add voice assistant methods for configuration (#7459)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-18 11:38:39 +12:00
dependabot[bot]
cb86749545 Bump peter-evans/create-pull-request from 7.0.2 to 7.0.3 (#7457)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-17 13:47:16 +12:00
Jesse Hills
857a3dcf72 Dont replace project name spaces with underlines (#7455) 2024-09-16 01:03:51 -05:00
Jesse Hills
435789a960 Bump pylint from 3.1.0 to 3.2.7 (#7438) 2024-09-16 17:21:42 +12:00
Jesse Hills
18b3fbbf6d Merge branch 'beta' into dev 2024-09-16 16:36:03 +12:00
Jesse Hills
8bd182d96c Merge pull request #7454 from esphome/bump-2024.9.0b3
2024.9.0b3
2024-09-16 16:35:26 +12:00
Jesse Hills
73e469ae52 [modbus_controller] Fix linting and formatting issues (#7441) 2024-09-16 13:43:45 +12:00
Michael Hansen
3835ad8c1f Add voice assistant configuration messages (#7445) 2024-09-16 13:40:45 +12:00
Jesse Hills
a63b9a9e0c Bump version to 2024.9.0b3 2024-09-16 13:17:06 +12:00
Jesse Hills
6483ceb6eb [docker] Bump git from 1:2.39.2-1.1 to 1:2.39.5-0+deb12u1 (#7452) 2024-09-16 13:17:06 +12:00
Michael Hansen
e7fe9b374f Add sample_bytes to media player supported format (#7451) 2024-09-16 13:17:06 +12:00
Jesse Hills
9014fa4bf9 Merge branch 'beta' into dev 2024-09-16 12:32:56 +12:00
Jesse Hills
bfde7fd9d7 [docker] Bump git from 1:2.39.2-1.1 to 1:2.39.5-0+deb12u1 (#7452) 2024-09-16 12:32:39 +12:00
Jesse Hills
3e7161ad41 Merge pull request #7450 from esphome/bump-2024.9.0b2
2024.9.0b2
2024-09-16 12:32:18 +12:00
Michael Hansen
857d79dc71 Add sample_bytes to media player supported format (#7451) 2024-09-15 23:46:54 +00:00
Clyde Stubbs
f652cd3851 [st7701s] Make use of IDF5.x to speed up display operations (#7447) 2024-09-16 10:42:45 +12:00
Jesse Hills
5d8fb7cdf4 Bump version to 2024.9.0b2 2024-09-16 10:01:34 +12:00
Tomer
80e3de94d3 Improve manufacturer data tracing to identify BLE devices a bit easie… (#7332) 2024-09-16 10:01:34 +12:00
Jesse Hills
7f00b5eb65 [voice-assistant] Dont error on `no_wake_word` timeout error with streaming wake word (#7435) 2024-09-16 10:01:34 +12:00
Oleg Tarasov
de19d25a3c Add OpenTherm component (part 1: communication layer and hub) (#6645)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-16 09:59:10 +12:00
Jesse Hills
cf4bfcdce8 [thermostat] Fix linting and formatting issues (#7442) 2024-09-13 05:03:25 -05:00
Jesse Hills
c702a3f3ee [animation] Fix linting and formatting issues (#7439) 2024-09-13 16:16:57 +12:00
Jesse Hills
e4c90489f7 [image] Fix linting and formatting issues (#7440) 2024-09-13 16:16:24 +12:00
Jesse Hills
08c0715a30 [tm1638] Fix linting and formatting issues (#7443) 2024-09-13 16:15:00 +12:00
J. Nick Koston
0df44b5df1 Bump recommended ESP-IDF to 4.4.8 (#7349) 2024-09-13 14:06:50 +12:00
dependabot[bot]
e315b4d939 Bump peter-evans/create-pull-request from 7.0.0 to 7.0.2 (#7437)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-13 13:22:28 +12:00
Tomer
78d0e0baae Improve manufacturer data tracing to identify BLE devices a bit easie… (#7332) 2024-09-13 12:56:04 +12:00
Paulus Schoutsen
323c641ecd Update codeql.yml 2024-09-12 00:09:25 -04:00
Paulus Schoutsen
6207510279 Update codeql.yml 2024-09-12 00:05:40 -04:00
Paulus Schoutsen
95a340d7a3 Update codeql.yml 2024-09-12 00:04:25 -04:00
Paulus Schoutsen
6f9e725a2c Update codeql.yml 2024-09-11 23:58:57 -04:00
Paulus Schoutsen
43f6793ad9 Create codeql.yml 2024-09-11 23:58:15 -04:00
Jesse Hills
cb7b4d9365 [voice-assistant] Dont error on `no_wake_word` timeout error with streaming wake word (#7435) 2024-09-11 21:08:41 -05:00
Jesse Hills
af1a909c27 Merge branch 'beta' into dev 2024-09-11 20:53:32 +12:00
Jesse Hills
9ed2ed8177 Merge pull request #7433 from esphome/bump-2024.9.0b1
2024.9.0b1
2024-09-11 20:52:49 +12:00
Jesse Hills
664b219387 Bump version to 2024.10.0-dev 2024-09-11 17:37:41 +12:00
Jesse Hills
63cda412f9 Bump version to 2024.9.0b1 2024-09-11 17:37:40 +12:00
Tercio Filho
625726c650 [Modbus Controller] Added preference to change command retries (#7312)
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-11 17:21:31 +12:00
ajwahab
955a909846 User configurable frame buffer. (#7360) 2024-09-11 17:20:30 +12:00
Rafael Treviño
e3ae8cd31e [uponor_smatrix] Modifies sending algorithm (#7326)
Co-authored-by: Rafa Treviño <rafael.trevino@bbva.com>
2024-09-11 17:16:52 +12:00
[pʲɵs]
04248b6840 [i2s_audio] Add more options to speakers and microphones (#7306)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-11 17:12:20 +12:00
ArkanStasarik
dbecade122 Implement all supported thermocouple types for MAX31856 (#7218)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2024-09-11 16:53:09 +12:00
NP v/d Spek
ffc2b58714 Move I2S config settings the the base i2sAudio files. Phase 1 (#7183)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-11 11:30:46 +12:00
David Woodhouse
39ad358b51 Enable IPv6 support for BK72xx (#7398)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-10 22:02:05 +00:00
David Woodhouse
7b90bfaec6 Bump LibreTiny recommended version to 1.7.0 (#7432) 2024-09-11 07:43:19 +12:00
David Woodhouse
7abbb0fb97 Pull in new AsyncTCP for IPv6 on BK72xx (#7431) 2024-09-11 07:42:46 +12:00
marcovaneck
de7d2c33e1 [dsmr] Add internal 'telegram' text_sensor to support bridging (#6841)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-10 20:22:58 +12:00
Clyde Stubbs
c8aed15157 [LVGL] Add color gradients (#7427) 2024-09-10 13:24:18 +12:00
Clyde Stubbs
dcfad31770 [rpi_dpi_rgb] Add bounce_buffer config for ESP-IDF 5.x (#7423) 2024-09-10 13:15:56 +12:00
David Woodhouse
f5c2921b85 [bl0942] Improve energy reporting (#7428) 2024-09-10 13:11:26 +12:00
David Woodhouse
b5e5741ffd Switch IPv6 platform check to use require_framework_version() (#7410) 2024-09-10 11:59:46 +12:00
David Woodhouse
d10feafa9b Add BK72xx support to require_framework_version() (#7409) 2024-09-10 11:58:57 +12:00
Jesse Hills
9f42b76de3 [gh-actions] Don't produce docker build summaries (#7430) 2024-09-10 11:57:42 +12:00
Jesse Hills
198bd3b41a Bump libssl-dev to 3.0.14-1~deb12u2 (#7426) 2024-09-10 10:35:39 +12:00
Anton Viktorov
c90dcfc0ca LTR-501, LTR-301, LTR-558 Series of Lite-On Light (ALS) and Proximity(PS) sensors (#6262)
Co-authored-by: root <root@LAOX1>
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-09-09 12:25:37 -05:00
David Woodhouse
7a93dde5d4 [libretiny] Report version 1.7.0 for 'dev' and 'latest' (#7415) 2024-09-09 17:05:19 +12:00
David Woodhouse
32995a352b libretiny: Allow specifying version of explicitly imported sources (#7408) 2024-09-09 17:05:09 +12:00
Clyde Stubbs
9722876ef6 [lvgl] Msgbox fixes and enhancements (#7380) 2024-09-09 15:59:09 +12:00
Michael Hansen
8bd46a43b9 Add voice assistant announce (#7377) 2024-09-09 12:54:20 +12:00
Adam DeMuri
18a1191e03 Add support for using BMP280 with SPI (#7053)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-09-05 17:08:02 +12:00
Jesse Hills
1548fa0811 [homeassistant-switch] Support different entity domains (#7331) 2024-09-04 20:09:49 -05:00
Markus
b496233425 Add StatsD component (#6642)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-05 12:57:44 +12:00
Jesse Hills
dc4e60526c [micro_wake_word] Remove duplicated download code (#7401) 2024-09-05 12:49:01 +12:00
David Woodhouse
71a7f6383f Support BL0942 calibration (#7299)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-05 12:08:39 +12:00
Jeff Cooper
e882cea47e Voice assist improvement - configurable conversation_id timeout (#7385) 2024-09-04 15:48:13 +12:00
dependabot[bot]
a7fd3b34aa Bump pypa/gh-action-pypi-publish from 1.10.0 to 1.10.1 (#7404)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-04 15:47:59 +12:00
dependabot[bot]
a96de54d46 Bump peter-evans/create-pull-request from 6.1.0 to 7.0.0 (#7405)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-04 15:45:40 +12:00
David Woodhouse
188faa6530 [bl0942] loop and overflow cleanup (#7358) 2024-09-04 15:38:47 +12:00
Sebastian Muszynski
1a71cc3047 Drop max BLE client connections limitation (#7088) 2024-09-04 12:02:33 +10:00
Jesse Hills
10ccc5f125 [api] Remove id from `MediaPlayerSupportedFormat` (#7406) 2024-09-04 12:55:41 +12:00
dependabot[bot]
c6e64a9ed3 Bump pypa/gh-action-pypi-publish from 1.9.0 to 1.10.0 (#7395)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-03 19:22:56 +12:00
Jesse Hills
565835cb59 Merge branch 'release' into dev 2024-09-03 16:38:57 +12:00
Jesse Hills
f2d8ab62dd Merge pull request #7400 from esphome/bump-2024.8.3
2024.8.3
2024-09-03 16:38:10 +12:00
Jesse Hills
cb4bede6d8 Bump version to 2024.8.3 2024-09-03 16:06:54 +12:00
Jesse Hills
39b2f30b16 Bump Dockerfile dependencies (#7386) 2024-09-03 16:06:54 +12:00
Jesse Hills
e18ae84031 Merge branch 'release' into dev 2024-09-03 13:38:01 +12:00
Jesse Hills
5cb1d18574 Merge pull request #7399 from esphome/bump-2024.8.2
2024.8.2
2024-09-03 13:37:13 +12:00
Kevin Ahrendt
f8ec5242c9 Better support for task blocking ring buffer reads and writes (#7390) 2024-09-03 12:47:54 +12:00
Tercio Filho
d6eeac0619 [modbus_controller] Allow duplicate command config (#7311) 2024-09-03 11:56:19 +12:00
Dan Greco
3b14b0efce [gree] Add support for YX1FF remote (#7298) 2024-09-03 10:35:54 +12:00
Jimmy Hedman
29f0b504b9 Bump rp2040 Arduino platform and framework (#7134) 2024-09-03 10:28:18 +12:00
Jimmy Hedman
01c50432c9 Bump mDNS and follow ruff's suggestions (#7308) 2024-09-03 10:16:59 +12:00
Jesse Hills
e5e06a12ef Bump version to 2024.8.2 2024-09-03 09:57:28 +12:00
Jesse Hills
c9c5ca28d2 [core] Only clean build files with esp-idf (#7388) 2024-09-03 09:57:28 +12:00
Jimmy Hedman
04ec6c5677 Enable IPv6 when manual IPv4 is enabled (#7381) 2024-09-03 09:57:28 +12:00
Jesse Hills
816b060edc [datetime] Fix templated args (#7368) 2024-09-03 09:57:28 +12:00
Mathieu Rene
91c7c43682 Fix build for esp32h2 using esp-idf 5.3 (#7393) 2024-09-03 09:26:10 +12:00
Jesse Hills
ca8e45cf4c [core] Only clean build files with esp-idf (#7388) 2024-09-02 19:11:21 +12:00
dependabot[bot]
854bafbd4a Bump actions/upload-artifact from 4.3.4 to 4.4.0 (#7379)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-09-02 14:33:58 +12:00
Jimmy Hedman
094c867fba Enable IPv6 when manual IPv4 is enabled (#7381) 2024-09-02 14:32:34 +12:00
Ludovic BOUÉ
fc930327b4 [rpi_dpi_rgb] Add enable_pin and reset_display method to driver (#7383)
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2024-09-02 12:30:13 +10:00
Andrzej Skowroński
6490fc9c62 CH422G support (#7356) 2024-09-02 11:56:35 +10:00
Jesse Hills
3a7aabb2eb Bump Dockerfile dependencies (#7386) 2024-09-02 10:36:18 +12:00
Clyde Stubbs
61223a3cc9 [font] Make display an auto-load, not a dependency (#7366)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-09-02 08:45:40 +12:00
tomaszduda23
ca2f25e73b update logs for bluetooth proxy (#7382) 2024-09-01 21:20:31 +10:00
Clyde Stubbs
ba6963cf72 [udp] Implement UDP sensor broadcast (#6865)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: clydebarrow <366188+clydebarrow@users.noreply.github.com>
2024-08-30 20:59:55 +12:00
Piotr Szulc
721b532d71 Tuya Number: allow restoring value of hidden datapoints (#7346) 2024-08-30 12:53:34 +12:00
Trevor Schirmer
a5d46ae9e5 Update MiCS Values (#7173)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-30 12:36:32 +12:00
tomaszduda23
f8e8bd2c24 [code-quality] fix clang-tidy web_server and web_server_base (#7286) 2024-08-30 12:03:44 +12:00
Mariusz Kryński
69f98e0f87 esp32_can: make queue lengths configurable (#7361) 2024-08-30 11:43:47 +12:00
Clyde Stubbs
87d801721b Add now required invert_colors option to test files referencing ili9xxx (#7367) 2024-08-30 11:20:01 +12:00
Clyde Stubbs
d754bdde1b [st7701s] Add delay feature in init sequences (#7343) 2024-08-30 08:27:35 +12:00
Clyde Stubbs
725e50348b [gt911] Add reset pin config (#7373) 2024-08-30 08:20:12 +12:00
dependabot[bot]
acb00c9c59 Bump actions/setup-python from 5.1.1 to 5.2.0 in /.github/actions/restore-python (#7376)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-30 08:17:34 +12:00
dependabot[bot]
bb6693a255 Bump actions/setup-python from 5.1.0 to 5.2.0 (#7375)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-30 08:17:28 +12:00
Clyde Stubbs
c09df3c05d [bytebuffer] Use existing bit_cast operations. (#7374) 2024-08-30 08:16:16 +12:00
Clyde Stubbs
f28418d0b4 [lvgl] Bug fixes (#7370) 2024-08-29 13:34:41 +12:00
Clyde Stubbs
1922f2bbee [platformio] Add environments for ESP-IDF 5.3 for development (#7371) 2024-08-29 12:55:37 +12:00
Aiden
0375072bdf Add support for BL0906 energy meter (#7339)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-29 12:52:49 +12:00
Mariusz Kryński
b3f03c07c6 esp32_can: suppress compiler warning (#7372) 2024-08-29 12:52:13 +12:00
Jesse Hills
4b2032a98e [datetime] Fix templated args (#7368) 2024-08-28 10:07:31 -07:00
Clyde Stubbs
d6df466237 [lvgl] Add lvgl.widget.focus action and related triggers. (#7315) 2024-08-28 16:29:41 +12:00
Jesse Hills
458a8970b6 Merge branch 'release' into dev 2024-08-28 13:38:38 +12:00
Jesse Hills
8b6c95f723 Merge pull request #7363 from esphome/bump-2024.8.1
2024.8.1
2024-08-28 13:37:48 +12:00
Jesse Hills
28eda4b220 Bump version to 2024.8.1 2024-08-28 12:54:31 +12:00
Jesse Hills
9975e8b544 [api] Fix sending the `once` flag on ha entity subscription (#7357) 2024-08-28 12:54:31 +12:00
Clyde Stubbs
c1774c42c2 [lvgl] Fix race condition involving numbers, switches etc. (#7345) 2024-08-28 12:54:31 +12:00
Clyde Stubbs
8677763492 [core] Clean build if the loaded integrations changed (#7344) 2024-08-28 12:54:31 +12:00
Clyde Stubbs
388abaf09f [lvgl] Bug fixes (#7338) 2024-08-28 12:54:31 +12:00
Angel Nunez Mencias
92ae506ffb Add WS2811 to esp32_rmt_led_strip (#7353) 2024-08-28 11:40:21 +12:00
Gilles van den Hoven
34cce0e920 [ili9xxx] Make invert_colors required (#7292)
Co-authored-by: Gilles van den Hoven <gilles0181@gmail.com>
Co-authored-by: clydebarrow <2366188+clydebarrow@users.noreply.github.com>
2024-08-27 22:07:32 +10:00
Angel Nunez Mencias
7e18a5c44f Add reset to esp32_rmt_led_strip (#7354) 2024-08-27 13:26:01 +12:00
Michael Hansen
5a707b558d Add supported formats to media player (#7318)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-27 11:38:49 +12:00
David Woodhouse
e10f8128c8 bl0942: Fix init sequence, add address and line_frequency options (#7250) 2024-08-27 10:41:09 +12:00
Jesse Hills
0f2064193f [api] Fix sending the `once` flag on ha entity subscription (#7357) 2024-08-27 10:20:26 +12:00
Jesse Hills
dc9c001056 [const] Move `CONF_LINE_FREQUENCY` to const.py (#7351) 2024-08-26 13:07:18 +12:00
Clyde Stubbs
60fced53c2 [lvgl] Bug fixes: (#7341) 2024-08-26 10:08:30 +12:00
Clyde Stubbs
71d6bbc7e6 [lvgl] Fix race condition involving numbers, switches etc. (#7345) 2024-08-26 10:03:25 +12:00
Clyde Stubbs
caaae59ea9 [ledc] Fix maximum brightness on ESP-IDF 5.1 (#7342)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-08-24 09:56:13 +00:00
Keith Burzinski
a01fea54a0 [ledc] Tweak fix in #6997 (#7336) 2024-08-24 02:32:08 -05:00
Clyde Stubbs
43f8f2fd2e [core] Clean build if the loaded integrations changed (#7344) 2024-08-23 20:09:40 +12:00
Rodrigo Martín
3c65cabe1d feat: Expand ByteBuffer (#7316)
Co-authored-by: clydebarrow <2366188+clydebarrow@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-23 07:30:22 +10:00
Clyde Stubbs
5cc8dbace4 [lvgl] Bug fixes (#7338) 2024-08-23 06:56:53 +12:00
Piotr Szulc
ab620acd4f Tuya Number: allow to set hidden datapoints (#7024)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-22 12:59:31 +12:00
Pieter Viljoen
11e155d866 Enable verbose mode from env ESPHOME_VERBOSE or --verbose (#6987) 2024-08-22 12:58:43 +12:00
Sebastian Muszynski
68272c39c0 Add output source priority "hybrid" (#7322) 2024-08-22 12:58:11 +12:00
Jesse Hills
da72bae94a Merge branch 'release' into dev 2024-08-21 17:32:54 +12:00
Jesse Hills
1f21e419aa Merge pull request #7329 from esphome/bump-2024.8.0
2024.8.0
2024-08-21 17:32:03 +12:00
Jesse Hills
5d4bf5f8e5 Bump version to 2024.8.0 2024-08-21 14:20:29 +12:00
Jesse Hills
b5a6d3aa9d Merge branch 'beta' into dev 2024-08-21 13:26:14 +12:00
Jesse Hills
813d517076 Merge pull request #7328 from esphome/bump-2024.8.0b4
2024.8.0b4
2024-08-21 13:25:37 +12:00
Jesse Hills
4ed6a64869 Bump version to 2024.8.0b4 2024-08-21 11:46:56 +12:00
NewoPL
aaae8f4a87 [rtttl] fix STOPPED state (#7323) 2024-08-21 11:46:56 +12:00
Sung-jin Brian Hong
436c6282da Fix waveshare 2.13" epaper stride calculation error (#7303)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-21 11:46:56 +12:00
NP v/d Spek
c043bbe598 add the ability to add more idf components to an existing setup (#7302)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-21 11:46:56 +12:00
Ali Jafri
8fae609316 Fix RP2040 Neopixel flickering issue (#7307) 2024-08-21 11:46:56 +12:00
NewoPL
848fd0442d [rtttl] fix STOPPED state (#7323) 2024-08-21 11:46:15 +12:00
Sung-jin Brian Hong
bd3d065a23 Fix waveshare 2.13" epaper stride calculation error (#7303)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-21 11:44:21 +12:00
tomaszduda23
fa497d06b0 [code-quality] fix clang-tidy cstddef (#7324) 2024-08-21 10:01:50 +12:00
tomaszduda23
3cbdf63f56 [code-quality] fix clang-tidy socket (#7285) 2024-08-20 10:53:15 +12:00
NP v/d Spek
30414667d0 add the ability to add more idf components to an existing setup (#7302)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-20 10:22:19 +12:00
Ali Jafri
1ffee9c4d2 Fix RP2040 Neopixel flickering issue (#7307) 2024-08-20 09:42:41 +12:00
Roving Ronin
b425912a80 Update const.py - Add missing UNIT_LITRE (#7317) 2024-08-20 09:18:06 +12:00
Jesse Hills
10147d8e0e Merge branch 'beta' into dev 2024-08-19 15:21:09 +12:00
Jesse Hills
c4d225a6f2 Merge pull request #7313 from esphome/bump-2024.8.0b3
2024.8.0b3
2024-08-19 15:20:32 +12:00
Jesse Hills
409e84090e Bump version to 2024.8.0b3 2024-08-19 13:09:59 +12:00
Jesse Hills
c96784f591 [microphone] Fix header includes (#7310) 2024-08-19 13:09:59 +12:00
NP v/d Spek
0f82114e64 [speaker] Fix header includes (#7304) 2024-08-19 13:09:59 +12:00
Clyde Stubbs
5c7d070307 [lvgl] Bug fixes (#7300) 2024-08-19 13:09:59 +12:00
Jesse Hills
7464b440c0 Revert "[validation] Allow `maybe_simple_value` to not have default key in complex value" (#7305) 2024-08-19 13:09:59 +12:00
Jesse Hills
baedd74c7a [microphone] Fix header includes (#7310) 2024-08-19 10:45:22 +12:00
NP v/d Spek
8b6d6fe661 [speaker] Fix header includes (#7304) 2024-08-19 10:45:10 +12:00
Clyde Stubbs
ac9417d469 [lvgl] Bug fixes (#7300) 2024-08-19 10:43:23 +12:00
Jesse Hills
56aa58780d Revert "[validation] Allow `maybe_simple_value` to not have default key in complex value" (#7305) 2024-08-18 03:27:03 -05:00
Jesse Hills
75899162b3 Merge branch 'beta' into dev 2024-08-17 08:08:42 +12:00
Jesse Hills
28bb0ddfeb Merge pull request #7297 from esphome/bump-2024.8.0b2
2024.8.0b2
2024-08-17 08:07:54 +12:00
Jesse Hills
e779a09586 Bump version to 2024.8.0b2 2024-08-16 13:38:06 +12:00
David Woodhouse
343650e37d [network] Always allow `enable_ipv6: false` (#7291)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-16 13:38:06 +12:00
Jesse Hills
2c47eb62a7 [validation] Allow `maybe_simple_value` to not have default key in complex value (#7294) 2024-08-16 13:38:06 +12:00
Gábor Kiss
033ab55206 Fix overflow in ESPColorCorrection object (#7268) 2024-08-16 13:38:06 +12:00
NP v/d Spek
e17c7124f4 fix some small rtttl issues (#6817)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-16 13:38:06 +12:00
Clyde Stubbs
e3bfbebb8f [api] Bump noise-c library version (#7288) 2024-08-16 13:38:06 +12:00
Samuel Sieb
bc20fd57fe remove extra number from pronto (#7263) 2024-08-16 13:38:05 +12:00
David Woodhouse
a7167ec3bf [network] Always allow `enable_ipv6: false` (#7291)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-16 13:32:00 +12:00
David Woodhouse
a0c54504cd Add HMAC-MD5 support for authenticating OTA updates (#7200)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-16 11:27:23 +12:00
Jesse Hills
c3668b9a4d [validation] Allow `maybe_simple_value` to not have default key in complex value (#7294) 2024-08-15 18:05:26 -05:00
Gábor Kiss
9001d1c0d4 Fix overflow in ESPColorCorrection object (#7268) 2024-08-16 10:35:00 +12:00
tomaszduda23
abb2669f0f [code-quality] fix clang-tidy captive_portal (#7280) 2024-08-16 09:16:06 +12:00
tomaszduda23
9713458368 [code-quality] fix clang-tidy improv_serial (#7283) 2024-08-15 17:17:38 +12:00
NP v/d Spek
5c31ab4060 fix some small rtttl issues (#6817)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-15 04:51:44 +00:00
tomaszduda23
965141fad7 [code-quality] fix clang-tidy wireguard (#7287) 2024-08-15 16:38:49 +12:00
Clyde Stubbs
ecd3d838c9 [api] Bump noise-c library version (#7288) 2024-08-15 15:35:03 +12:00
tomaszduda23
ce7adbae99 [code-quality] fix clang-tidy e131 (#7281) 2024-08-15 10:31:19 +12:00
tomaszduda23
1bc3ccd969 [code-quality] fix clang-tidy ota (#7282) 2024-08-15 10:30:29 +12:00
tomaszduda23
5646ec7f9c [code-quality] fix clang-tidy prometheus (#7284) 2024-08-15 09:41:29 +12:00
tomaszduda23
80a0f13722 [code-quality] fix performance-unnecessary-value-param (#7274) 2024-08-15 07:05:16 +10:00
Jesse Hills
fef592b6c6 Merge branch 'beta' into dev 2024-08-15 07:51:18 +12:00
Jesse Hills
b654dea55e Merge pull request #7278 from esphome/bump-2024.8.0b1
2024.8.0b1
2024-08-15 07:50:36 +12:00
Samuel Sieb
7133e08755 remove extra number from pronto (#7263) 2024-08-14 02:55:23 -05:00
Jesse Hills
7b233d6871 Bump version to 2024.8.0b1 2024-08-14 16:56:53 +12:00
Jesse Hills
350f17e48f Bump version to 2024.9.0-dev 2024-08-14 16:56:53 +12:00
Mike La Spina
ccf57488c5 Correct offset calibration (#7228)
Co-authored-by: descipher <mike.laspina@gelidus.ca>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-14 16:43:35 +12:00
NP v/d Spek
cf6ea7cb2c Implement the finish() method and action. implement the is_stopped condition (#7255) 2024-08-14 15:42:43 +12:00
Kevin Ahrendt
d6f130e35a [micro_wake_word] Bump ESPMicroSpeechFeatures version to 1.1.0 (#7249) 2024-08-14 15:40:07 +12:00
Philippe Wechsler
8f09382367 support illuminance for airthings wave plus device (#5203)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-14 14:25:45 +12:00
tomaszduda23
b2b23f2a4f [code-quality] fix readability-named-parameter (#7272) 2024-08-14 14:21:19 +12:00
Olivier ARCHER
8756b41b63 [mqtt] fix missing initializer in MQTTClientComponent::disable_discovery (#7271) 2024-08-14 14:19:46 +12:00
tomaszduda23
4cb174585c [code-quality] fix readability-braces-around-statements (#7273) 2024-08-14 14:14:29 +12:00
tomaszduda23
56e05998ef [code-quality] fix clang-tidy wake_on_lan (#7275) 2024-08-14 14:08:10 +12:00
Clyde Stubbs
bec2d42c79 Add color_filter_opa style property (#7276) 2024-08-14 14:06:13 +12:00
Clyde Stubbs
a0eff08f39 [lvgl] Rework events to avoid feedback loops (#7262) 2024-08-14 14:05:25 +12:00
Landon Rohatensky
a5fdcb31fc [homeassistant] Native number entity import and control (#6455)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-14 14:04:12 +12:00
Markus
1d25db491c [homeassistant] Native switch entity import and control (#7018)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-14 14:03:12 +12:00
PaoloTK
c5b1a8eb81 Add min and max brightness parameters for Light dim_relative Action (#6971) 2024-08-14 09:29:55 +12:00
Clyde Stubbs
68c56b3e03 Implement ByteBuffer (#6878) 2024-08-14 09:29:31 +12:00
Jesse Hills
0c567adf63 [CI] Dont run full CI on `build-image` action changes (#7270) 2024-08-14 08:13:09 +12:00
dependabot[bot]
9ec61cbff3 Bump docker/build-push-action from 6.6.1 to 6.7.0 in /.github/actions/build-image (#7269)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-14 08:12:56 +12:00
tomaszduda23
2e58297a16 [code-quality] fix clang-tidy wifi related (#7254) 2024-08-14 07:58:30 +12:00
tomaszduda23
f81ce2c707 [code-quality] fix clang-tidy mqtt (#7253) 2024-08-14 07:56:09 +12:00
tomaszduda23
4bd7ba0d30 [code-quality] Fix variable naming in base_light_effects (#7237) 2024-08-14 07:54:37 +12:00
tomaszduda23
9663b7d67c [code-quality] fix clang-tidy core optional (#7265) 2024-08-14 07:53:42 +12:00
tomaszduda23
b082a64d32 [code-quality] fix clang-tidy network (#7266) 2024-08-14 07:48:27 +12:00
tomaszduda23
c9979ad90c [code-quality] fix order in esphome/const.py (#7267) 2024-08-14 07:46:23 +12:00
Clyde Stubbs
3598560472 [lvgl] Add initial_focus for encoders (#7256) 2024-08-13 20:06:01 +12:00
guillempages
506e69addf [online_image] add option to show placeholder while downloading (#7083)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-13 19:44:43 +12:00
nkinnan
2a70ef05d1 [const] Add some units for future use and adjust case (#7260) 2024-08-13 18:48:12 +12:00
Jesse Hills
8696f922d1 [homeassistant] Add `HOME_ASSISTANT_IMPORT_CONTROL_SCHEMA` (#7259) 2024-08-13 17:33:16 +12:00
Jesse Hills
2b25daa199 [api] Add new flag to request state/attribute once from HA only (#7258) 2024-08-13 17:12:06 +12:00
Olivier ARCHER
ab51bbd8f7 [api] Error log when NONE Update command is sent (#7247)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-13 13:52:31 +12:00
RFDarter
390d5f2f93 [test][web_server] Rejig test for v3 (#7110) 2024-08-13 13:26:39 +12:00
tomaszduda23
8d106e97a2 [code-quality] fix clang-tidy web server (#7230)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-13 01:14:25 +00:00
juanluss31
fc146dabed Add support for LYWSD02MMC Xiaomi device (#7080) 2024-08-13 13:12:48 +12:00
tomaszduda23
8d5be27746 [code-quality] Apply ruff linting suggestions (#7239)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-13 12:47:18 +12:00
tomaszduda23
f24fd34d86 fix name conflict with zephyr macro (#7252) 2024-08-13 11:38:13 +12:00
tomaszduda23
64ee40d370 [code-quality] clang-tidy bedjet (#7251) 2024-08-13 11:33:51 +12:00
tomaszduda23
5f3f106283 [code-quality] add NOLINT haier_base (#7236) 2024-08-13 11:29:09 +12:00
NP v/d Spek
8148eae134 add windows script/setup.bat (#7140)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-08-13 11:16:42 +12:00
tomaszduda23
f13cf1f7a0 adjust to new python pre-commit hooks (#7178)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-12 16:52:09 +12:00
tomaszduda23
8a076cc906 fix build error (#7229) 2024-08-12 16:49:35 +12:00
dependabot[bot]
82c5cd18de Bump docker/build-push-action from 6.5.0 to 6.6.1 in /.github/actions/build-image (#7232)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-12 16:30:27 +12:00
tomaszduda23
e769804fe6 [code-quality] clang-tidy media_player (#7238) 2024-08-12 16:27:22 +12:00
David K.
f2e99fa319 [bme68x_bsec2_i2c] BME68X Temperature+Pressure+Humidity+Gas Sensor via BSEC2 (#4585)
* Added initial bme68x component

* Initialize all child sensors to nullptr

This was added to all other sensors in #3808

* Update BSEC2 and BME68x Libraries

Current versions from Bosch Sensortec

* Add myself to codeowners for bme68x_bsec

* Move constants to const.py, according to ci-custom checks

Move constants to const.py, according to ci-custom checks

* Update library dependencies

We'll stick with 1.4.2200 for now. 1.4.2200 is not on platform.io registry, use tag instead.

Update to 1.5.2400 needs some work due to multi instance support.

* Update BSEC2 to 1.6.2400

* Add consts to bme680x_bsec

Enable inclusion with external_components

* Update device class for pressure

* Update to use multisensor API

* Tidy up some constants

* Add tests

* Remove scd30 changes

* Import CONF_SAMPLE_RATE

* Pull BSEC config blob from repo based on config

* Rename component to `bme68x_bsec_i2c`

* Fix tests + codeowners

* Cleanup for review

* Rename using `bsec2`

* Apply suggestions from code review

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>

* Download file during validation stage, instead

* Make `dump_config()` only dump stuff

* Compile safely without sensor and text sensor headers

* Use `intf_ptr`

* Save state if measuring static IAQ, too

* Update CODEOWNERS

* Simplify esphome/components/bme68x_bsec2_i2c/__init__.py

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>

* Remove extraneous colon & imports

* Track & save the maximum accuracy value

* Polish up accuracy sensor handling

* Log static sensor, update `defines.h`

* Walruses make it better

* Add some logging of setup failures

* Update esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.cpp

Co-authored-by: Trevor North <trevor@freedisc.co.uk>

* Break out some things

* Update CODEOWNERS

* Update CODEOWNERS take 2

* Use `add_extra` in base schema

* Another walrus in the sensor

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>

---------

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Trevor North <trevor@freedisc.co.uk>
2024-08-11 23:14:58 -05:00
Clyde Stubbs
34d435c996 [lvgl] Implement default group for encoders (#7242)
Co-authored-by: clydeps <U5yx99dok9>
2024-08-12 15:56:54 +12:00
Flo
d04e706295 Allow project name and version as improv_serial identity (#7248)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-12 14:20:51 +12:00
Nis Wechselberg
442e765187 [sml] Fixed crashing sml parser (#7235) 2024-08-12 14:18:11 +12:00
Michael Davidson
15602b0664 Add text_align_to_string (#7243) 2024-08-12 08:06:29 +12:00
tomaszduda23
b43c5b851a add missing overrides (#7231) 2024-08-09 21:15:25 +10:00
Clyde Stubbs
a47a17d7e7 [lvgl] Fix set state on updates (#7227) 2024-08-08 20:24:10 +12:00
tomaszduda23
b71c03424e [code-quality] Organise time imports (#7219) 2024-08-08 17:02:55 +12:00
tomaszduda23
a3d5b69a9c [code-quality] NOLINT readability-identifier-naming (#7220) 2024-08-08 17:02:41 +12:00
dentra
3f1d2c0caf [mqtt] Add extended device info (#7194)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-08 16:49:37 +12:00
David Woodhouse
7fd65987d3 hx711: Check for DOUT going high after a reading (#7214) 2024-08-08 14:29:49 +12:00
tomaszduda23
24b6c1d3eb [code-quality] __attribute__((packed)) (#7221) 2024-08-07 19:30:49 -05:00
tomaszduda23
9a9757ddeb [code-quality] fix clang-tidy sprinkler (#7222)
* fix clang-tidy

* fix build error

* clang-tidy

* clang-tidy
2024-08-07 19:29:32 -05:00
tomaszduda23
4b91ef5123 [code-quality] Apply ruff linting suggestions to core (#7207) 2024-08-07 19:33:41 +12:00
tomaszduda23
2a8424a7f2 [code-quality] Organise logger imports (#7205) 2024-08-07 19:32:06 +12:00
tomaszduda23
132269c5b8 [code-quality] Apply ruff linting suggestions (#7206) 2024-08-07 19:31:44 +12:00
Jesse Hills
ddd8027238 [spi] Remove `SPIDelegateDummy` (#7215) 2024-08-07 06:33:12 +00:00
tomaszduda23
c348efa401 [code-quality] Organise base entities imports (#7208) 2024-08-07 15:49:51 +12:00
Jesse Hills
9b0c2234d8 [max31856] Use cv.frequency as validator (#7212) 2024-08-06 22:47:46 -05:00
Jesse Hills
73f786c606 [code-quality] Organise script imports (#7198) 2024-08-06 22:46:37 -05:00
iannisimo
1e63fddf36 [remote_transmitter] Change default carrier_frequency to valid value (#7176)
set current_carrier_frequency_ default value to esp-idf's default (38000)
2024-08-06 18:02:30 -05:00
Jesse Hills
da0dbe8753 Revert "Add null GPIO pin " (#6621) 2024-08-07 07:29:05 +12:00
Clyde Stubbs
eccc5a3ea3 [lvgl] Fix compile error when using encoder with buttons only. (#7203) 2024-08-07 07:15:28 +12:00
Jesse Hills
8667f51cf0 Move CONF_ITEMS/CONF_FONT/CONF_TEXT to const.py (#7204) 2024-08-07 07:15:15 +12:00
Mimoja
455df35e50 Update i2s_audio_speaker.cppi2s_audio/speaker: Fix fallthrough compiler warning (#7167) 2024-08-06 23:17:02 +12:00
guillempages
9188836f70 Add runtime online image support (#4710) 2024-08-06 23:08:06 +12:00
Jesse Hills
b0d9800817 [helpers] Set default flags of ExternalRAMAllocator to ALLOW_FAILURE (#7201) 2024-08-06 05:02:08 -05:00
Jesse Hills
e6b1780a31 Move `CONF_BACKGROUND_COLOR and CONF_FOREGROUND_COLOR` to const.py (#7202) 2024-08-06 04:39:47 -05:00
Clyde Stubbs
71ea2cec1f [lvgl] Final stage (#7184)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-06 03:56:48 +00:00
Nate Clark
7074fa06ae Adds MQTT component to Alarm Control panel component (#7188) 2024-08-06 15:53:52 +12:00
David Woodhouse
3ba9caa118 socket: socket::set_sockaddr() for IPv4 addresses in IPv6 builds (#7196) 2024-08-06 13:50:36 +12:00
Clyde Stubbs
6b141102d6 [lvgl] Stage 5 (#7191)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-06 13:17:29 +12:00
tomaszduda23
acaec41bb7 Remove outdated version block (#7177) 2024-08-06 11:40:34 +12:00
Daniel Kraft
f737ca6e28 hydreon_rgxx: Fix parsing of data line (#7192) 2024-08-06 09:17:02 +12:00
Kevin Ahrendt
e02319dcff [esp32_improv] Update Improv library to reference new repo/version (#7195) 2024-08-05 11:09:54 -05:00
Clyde Stubbs
d18bb34f87 [lvgl] Stage 4 (#7166) 2024-08-05 17:07:05 +12:00
Jesse Hills
87944f0c1b Add support for doing update entity refresh/check via API. (#7190) 2024-08-04 23:58:20 -05:00
Jesse Hills
38c25dec93 [code-quality] More portable shebangs (#7189)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-08-05 04:15:19 +00:00
Clyde Stubbs
81ac9391d1 [core] Eliminate nuisance messages from build_codeowners (#7185) 2024-08-05 14:04:06 +12:00
Olivier ARCHER
61c6581123 git ignore managed_components (#7180) 2024-08-02 23:00:18 +00:00
Björn Ebbinghaus
4a7570770b Implement 'round to nearest multiple' filter (#7142) 2024-08-01 18:58:59 -05:00
Jesse Hills
aedfb32482 Bump improv library to 1.2.4 (#7174) 2024-08-01 22:01:21 +00:00
SimoPk
a5f18dfe7f ade7953_spi wrong size specified in read_array call (#7172) 2024-08-01 22:39:54 +12:00
Jesse Hills
cb9906b921 [api] `homeassistant.action replaces homeassistant.service` (#7171) 2024-08-01 22:38:36 +12:00
Jesse Hills
144f1d3663 Merge branch 'release' into dev 2024-08-01 11:15:24 +12:00
Jesse Hills
546bfe6db5 Merge pull request #7168 from esphome/bump-2024.7.3
2024.7.3
2024-08-01 11:14:35 +12:00
Jesse Hills
0af10c58f5 Bump version to 2024.7.3 2024-08-01 07:51:23 +12:00
Kevin Ahrendt
5ac9d301ea [micro_wake_word] Fix VAD detection and modify detection computation (#7164) 2024-08-01 07:51:23 +12:00
RubyBailey
a70f926971 Fix for Mitsubishi units that only support cooling (#7143) 2024-08-01 07:51:23 +12:00
thevogoncoder
dfacf1bbfe Add delay after sending REG_READ_START (#7130)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-08-01 07:51:23 +12:00
Clyde Stubbs
3920029aff [lvgl] PR stage 3 (#7160)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-07-31 16:31:15 +12:00
Jesse Hills
8849443bf6 [update] Implement `update.perform action and update.is_available` condition (#7165)
* [update] Fix unimplemented yaml action/condition

* Add/update tests

---------

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-07-31 04:08:11 +00:00
Adam Allport
dd3dd7a136 fix: Add pin->setup(); to matrix_keypad.cpp (#7163) 2024-07-30 14:30:15 -07:00
Kevin Ahrendt
dff6884bed [micro_wake_word] Fix VAD detection and modify detection computation (#7164) 2024-07-31 08:57:51 +12:00
Jesse Hills
d7231fadb1 [touchscreen] Allow binary sensor to have multiple pages in config (#7112)
* [touchscreen] Allow binary sensor to have multiple pages in config

* Sort imports
2024-07-29 23:50:12 -05:00
Olivier ARCHER
caa2ea64e3 http_request watchdog as a component (#7161) 2024-07-30 13:45:19 +12:00
Jesse Hills
83bb7d0266 [code-quality] Organise bluetooth related imports (#7155) 2024-07-30 13:23:30 +12:00
FreeBear-nc
6e21d79bde [pid] Add get_min_integral() and get_max_integral() (#7162) 2024-07-30 13:15:27 +12:00
Clyde Stubbs
7c1aa771aa LVGL stage 2 (#7129)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-07-29 23:41:34 +00:00
dependabot[bot]
12e840ee88 Bump docker/setup-buildx-action from 3.5.0 to 3.6.1 in the docker-actions group (#7159)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-30 11:36:09 +12:00
RubyBailey
25c8676d80 Fix for Mitsubishi units that only support cooling (#7143) 2024-07-30 11:20:29 +12:00
FreeBear-nc
341fc65958 Add microAmp and milliAmp to defined units (#7157) 2024-07-30 08:05:25 +12:00
Jesse Hills
5b6b7c0d15 [code-quality] Organise esp32 imports (#7154) 2024-07-29 03:25:53 -05:00
Jesse Hills
24515546fd Move `CONF_ON_ERROR` to const.py (#7156) 2024-07-29 03:22:30 -05:00
Jesse Hills
b3728697cc Remove deprecated argument parser (#7151)
* Remove deprecated argument parser

* Add back removed argcomplete line
2024-07-29 03:13:57 -05:00
Jesse Hills
e64709c37e [code-quality] Organise core imports (#7149) 2024-07-29 14:07:44 +12:00
Jesse Hills
20c2246533 [code-quality] Organise wifi related imports (#7153) 2024-07-29 14:06:08 +12:00
Jesse Hills
acf690c87d [code-quality] Organise ethernet related imports (#7152) 2024-07-29 14:05:41 +12:00
Jesse Hills
adfec578cf Add `--version` handler to cli (#7150) 2024-07-28 20:13:09 -05:00
thevogoncoder
39c0019534 Add delay after sending REG_READ_START (#7130)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-07-25 14:06:23 +12:00
Jesse Hills
f61582f826 [dependabot] Group docker action bumps into single PR (#7133) 2024-07-25 13:19:33 +12:00
Jesse Hills
e343aca9bc Merge branch 'release' into dev 2024-07-25 12:48:28 +12:00
Jesse Hills
038f24fcea Merge pull request #7132 from esphome/bump-2024.7.2
2024.7.2
2024-07-25 12:47:33 +12:00
J. Nick Koston
d3f2434c57 Bump aioesphomeapi to 24.6.2 and cryptography to 43.0.0 (#7131) 2024-07-25 12:45:42 +12:00
Clyde Stubbs
23ffc3ddfb [lvgl] base implementation (#7116)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-07-25 11:12:04 +12:00
Jesse Hills
ad0118dd4a Bump version to 2024.7.2 2024-07-25 09:13:05 +12:00
dentra
7c24f1ba6d [http_request] Fix ESP-IDF follow redirect (#7101) 2024-07-25 09:13:05 +12:00
Jesse Hills
6e863305aa [http_request] Change default timeout to 4.5s (#7123) 2024-07-25 09:13:05 +12:00
Clyde Stubbs
75635956cd Give more info on import errors. (#7128) 2024-07-25 07:30:39 +12:00
dentra
1f3754684a [http_request] Allow configure buffer size on ESP-IDF (#7125)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-07-24 15:50:59 +12:00
esphomebot
da10de9ea8 Update webserver local assets to 20240724-013115 (#7126) 2024-07-24 01:57:02 +00:00
dentra
39de179e21 [http_request] Fix ESP-IDF follow redirect (#7101) 2024-07-24 12:12:59 +12:00
Clyde Stubbs
2cc14055cf Added ruff to pre-commit hooks (#7124) 2024-07-23 16:12:23 +12:00
Daniel
19a787c235 [fan] fix initial FanCall to properly set speed (#7113)
Speed settings were ignored for the first FanCall, if no speed has been restored before. This commit changes the behaviour to: set speed to 100%, iff current speed AND new speed are not set.
2024-07-22 21:53:31 -05:00
dependabot[bot]
e88e32bf23 Bump docker/setup-buildx-action from 3.4.0 to 3.5.0 (#7122)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23 14:21:03 +12:00
dependabot[bot]
f0d4b5f740 Bump docker/login-action from 3.2.0 to 3.3.0 (#7121)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23 14:20:54 +12:00
dependabot[bot]
2b2a83273f Bump docker/setup-qemu-action from 3.1.0 to 3.2.0 (#7120)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23 14:20:44 +12:00
Jesse Hills
ae476bb400 [http_request] Change default timeout to 4.5s (#7123) 2024-07-22 20:51:32 -05:00
dependabot[bot]
dc24eefe08 Bump docker/build-push-action from 6.4.1 to 6.5.0 in /.github/actions/build-image (#7119)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-23 13:01:45 +12:00
Aodren Auffrédou-Heinicke
f1aa254e48 APDS9306 Ambient Light Sensor (#6709)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
Co-authored-by: Mat931 <49403702+Mat931@users.noreply.github.com>
2024-07-22 17:29:54 +12:00
Jan-Philipp Benecke
5d5f3276e9 Inherit esp32_ble_beacon from esp32_ble (#6908)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-07-22 16:20:09 +12:00
Jesse Hills
172a358d01 Merge branch 'release' into dev 2024-07-22 14:09:49 +12:00
Jesse Hills
0ac549d208 Merge pull request #7114 from esphome/bump-2024.7.1
2024.7.1
2024-07-22 14:09:00 +12:00
Clyde Stubbs
8fc42694f6 [ili9xxx] Rework delay handling (#7115) 2024-07-22 13:42:25 +12:00
leejoow
0a7d883633 [modbus_controller] Add on_command_sent trigger (#7078)
Co-authored-by: Leo Schelvis <leo.schelvis@gmail.com>
2024-07-22 13:33:11 +12:00
Jesse Hills
41813b0a1f Bump version to 2024.7.1 2024-07-22 12:35:06 +12:00
irgendwienet
4690e227b8 Fixes sml parser to process extended length lists with a number of items that is dividable by 16 (#6148) 2024-07-22 12:35:06 +12:00
Olivier ARCHER
5bec0a6534 [http_request] allow basic auth for idf (#7086) 2024-07-22 12:35:06 +12:00
Lucio Tarantino
626ed815fb [heatpumpir] Fix BK72XX Compile error with IRremoteESP8266 (#6955) 2024-07-22 12:35:06 +12:00
Kevin Ahrendt
74aee1d453 revert bit shift to match previous behavior (#7109) 2024-07-22 12:35:06 +12:00
Alex Cortelyou
d187340fc4 Prevent rename from deleting new config (#7104) 2024-07-22 12:35:06 +12:00
irgendwienet
a464e46d4d Fixes sml parser to process extended length lists with a number of items that is dividable by 16 (#6148) 2024-07-22 11:42:09 +12:00
tomaszduda23
f322ec8f3d use cache to build tests for compoenents (#7059) 2024-07-22 11:33:26 +12:00
Olivier ARCHER
1f4829598a [http_request] allow basic auth for idf (#7086) 2024-07-22 11:29:09 +12:00
rnauber
40e79299d5 Feature/m5angle8: Add support for m5angle8 input device (#6799)
Co-authored-by: Richard Nauber <richard@nauber.dev>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-07-22 09:57:59 +12:00
Markus
368662969e Move MQTT ip discovery to deticated config option. (#6673) 2024-07-22 09:36:46 +12:00
Lucio Tarantino
fbc830176f [heatpumpir] Fix BK72XX Compile error with IRremoteESP8266 (#6955) 2024-07-22 09:16:51 +12:00
Jesse Hills
cfb20abb9f [code-quality] Tidy up some duplicate CONFIG_SCHEMA assignments (#7106) 2024-07-21 20:09:06 +00:00
Jesse Hills
43b818f2b1 [validation] Add `host to require_framework_version` (#7107) 2024-07-22 07:54:16 +12:00
Kevin Ahrendt
32b927de7e revert bit shift to match previous behavior (#7109) 2024-07-20 07:15:11 +12:00
tomaszduda23
c5b77f4590 [web_server] move v1 code to separate file (#7091) 2024-07-19 16:35:41 +12:00
Jesse Hills
0fb89d1869 [code-quality] Add some ruff configuration (#7103) 2024-07-18 18:26:21 -05:00
Alex Cortelyou
b32078a5fe Prevent rename from deleting new config (#7104) 2024-07-19 10:04:11 +12:00
dependabot[bot]
dd20c5eab0 Bump docker/build-push-action from 6.4.0 to 6.4.1 in /.github/actions/build-image (#7102)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-18 15:33:30 +12:00
Jesse Hills
0ef73c6dd6 Merge branch 'release' into dev 2024-07-17 16:19:42 +12:00
Jesse Hills
de0e549187 Merge pull request #7100 from esphome/bump-2024.7.0
2024.7.0
2024-07-17 16:18:45 +12:00
Jesse Hills
e15d0ee150 Bump version to 2024.7.0 2024-07-17 14:54:44 +12:00
Jesse Hills
331d556799 Merge branch 'beta' into dev 2024-07-17 11:52:14 +12:00
Jesse Hills
93e0c71c2f Merge pull request #7099 from esphome/bump-2024.7.0b4
2024.7.0b4
2024-07-17 11:51:22 +12:00
Jesse Hills
c512d5ebb6 Bump version to 2024.7.0b4 2024-07-17 11:15:19 +12:00
Jesse Hills
f153a7b0fd [ota] Print Arduino update errors (#7096) 2024-07-17 11:15:19 +12:00
Clyde Stubbs
10205e06cb Add host uart support for MacOS (#7095) 2024-07-16 09:06:27 +00:00
Jesse Hills
aa490e3726 Merge branch 'beta' into dev 2024-07-16 19:49:21 +12:00
Jesse Hills
de43c4e6ab Merge pull request #7097 from esphome/bump-2024.7.0b3
2024.7.0b3
2024-07-16 19:48:37 +12:00
Jesse Hills
193db50668 [ota] Print Arduino update errors (#7096) 2024-07-16 02:18:43 -05:00
NewoPL
659fdefccb [wifi] Hostname may not be set as expected on Arduino platform (#7050)
* bug #6014: workaround for not setting hostname on arduino plarform

* moving handle initailisation to ESPHOME_EVENT_ID_WIFI_STA_START callback
2024-07-16 01:28:23 -05:00
tomaszduda23
8980996b1a [CI] add web_server v1 test (#7090) 2024-07-16 17:14:33 +12:00
dependabot[bot]
0b3fe73b74 Bump docker/build-push-action from 6.3.0 to 6.4.0 in /.github/actions/build-image (#7089)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-16 17:13:02 +12:00
Jesse Hills
4af8230b4f Bump version to 2024.7.0b3 2024-07-16 16:51:13 +12:00
Jesse Hills
0bbefb5b2a [micro_wake_word] Allow simpler model config (#7094) 2024-07-16 16:51:13 +12:00
Jesse Hills
41baf70660 [i2s_audio] Allow config for primary/secondary i2s mode (#7092) 2024-07-16 16:51:13 +12:00
Keith Burzinski
eaf2bb70d9 [improv_serial] Fix linker error created in #6998 (#7082) 2024-07-16 16:51:13 +12:00
Jesse Hills
c910fdf7e5 [micro_wake_word] Allow simpler model config (#7094) 2024-07-15 23:29:45 -05:00
Jesse Hills
f1d19416be [i2s_audio] Allow config for primary/secondary i2s mode (#7092) 2024-07-15 23:28:41 -05:00
Keith Burzinski
07b78fea76 [CI] Add more `improv_serial` tests (#7081)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-07-14 20:32:10 +00:00
Keith Burzinski
896af84acc [improv_serial] Fix linker error created in #6998 (#7082) 2024-07-15 08:06:10 +12:00
tomaszduda23
44d609b205 [CI] compile entire web_server during tests (#7084) 2024-07-15 08:05:02 +12:00
Jesse Hills
72cbfd8fea Merge branch 'beta' into dev 2024-07-13 15:24:43 +12:00
Jesse Hills
71236b170d Merge pull request #7079 from esphome/bump-2024.7.0b2
2024.7.0b2
2024-07-13 15:24:07 +12:00
Jesse Hills
bb92ab01d7 Bump version to 2024.7.0b2 2024-07-13 09:46:08 +12:00
Anton Viktorov
316a0e1c96 LTR390 separate ALS and UV gain and resolution (#7026)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-07-13 09:46:08 +12:00
H. Árkosi Róbert
0c2f9b9dbb Bump HeatpumpIR, add protocols, remove IRremoteESP8266 (#6996) 2024-07-13 09:46:08 +12:00
kevdliu
c6c1d3a3ad Fix voice assistant crash when no speaker configured (#7075) 2024-07-13 09:46:08 +12:00
Eugen
fbab0aceb0 add ESP32-C6 support to esp32_can (#7063) 2024-07-13 09:46:08 +12:00
Tomi Junnila
54b77a1174 Add support for the Gree YAC1FB9 in climate_ir (#7056) 2024-07-13 09:46:08 +12:00
leejoow
a34cec217e Add default icon to restart button (#7076)
Co-authored-by: Leo Schelvis <leo.schelvis@gmail.com>
2024-07-13 09:46:08 +12:00
Sergey Dudanov
91bb38553d [climate-traits] improved performance (#7006) 2024-07-13 09:46:08 +12:00
Sergey Dudanov
531f33a158 [climate] fix dump output of unsupported features (#7005) 2024-07-13 09:46:08 +12:00
ttaborda
2d826768b0 Update mitsubishi.cpp (#6909)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-07-13 09:46:07 +12:00
Colm
d7f6d4436e Add braces to if statement to avoid compiler warning. (#7036) 2024-07-13 09:46:07 +12:00
esphomebot
bdd0a36aa3 Update webserver local assets to 20240704-081526 (#7041) 2024-07-13 09:46:07 +12:00
Jimmy Hedman
8a89dac5d5 [ethernet] Fix compile warning for IPv6 (#7048) 2024-07-13 09:46:07 +12:00
guillempages
8d28c53fd3 [http_request] Fix follow_redirects on arduino (#7054) 2024-07-13 09:46:07 +12:00
Z3LIFF
114476d8b1 Fix pmsa003i cold boot marked as failed on ESP32 et al (#7064) 2024-07-13 09:46:07 +12:00
Christian Ferbar
d1bfad9890 helpers.cpp: Fix GLIBCXX_RELEASE check < 8 (#7062) 2024-07-13 09:46:07 +12:00
Anton Viktorov
feae794787 LTR390 separate ALS and UV gain and resolution (#7026)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-07-13 09:42:41 +12:00
H. Árkosi Róbert
8a3f0e3b93 Bump HeatpumpIR, add protocols, remove IRremoteESP8266 (#6996) 2024-07-13 09:19:33 +12:00
kevdliu
4a80a09db3 Fix voice assistant crash when no speaker configured (#7075) 2024-07-12 09:32:31 +12:00
soeffi
7f83bcfdd9 jsn_sr04t component: AJ_SR04M compatibility mode in checksum calculation (#7044)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-07-12 09:30:45 +12:00
Eugen
99cba0ae7f add ESP32-C6 support to esp32_can (#7063) 2024-07-12 09:26:04 +12:00
Tomi Junnila
2e8a2fdbd4 Add support for the Gree YAC1FB9 in climate_ir (#7056) 2024-07-12 08:32:38 +12:00
leejoow
d209a2b45a Add default icon to restart button (#7076)
Co-authored-by: Leo Schelvis <leo.schelvis@gmail.com>
2024-07-12 08:20:58 +12:00
Sergey Dudanov
d071b05249 [climate-traits] improved performance (#7006) 2024-07-11 17:24:36 +12:00
Sergey Dudanov
66b36afe90 [climate] fix dump output of unsupported features (#7005) 2024-07-11 17:23:29 +12:00
Jesse Hills
c6b81eff9a Merge branch 'beta' into dev 2024-07-11 16:31:47 +12:00
Jesse Hills
04b268e319 Merge pull request #7073 from esphome/bump-2024.7.0b1
2024.7.0b1
2024-07-11 16:31:07 +12:00
ttaborda
5ac875545f Update mitsubishi.cpp (#6909)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-07-11 16:26:37 +12:00
Keith Burzinski
6e624ff797 [wifi] Fix EAP for IDF 5.1+, add test (#7061) 2024-07-11 16:21:24 +12:00
Colm
08b8ab837a Add braces to if statement to avoid compiler warning. (#7036) 2024-07-11 16:10:58 +12:00
esphomebot
1b57d8511b Update webserver local assets to 20240704-081526 (#7041) 2024-07-11 16:10:18 +12:00
Jimmy Hedman
ee4d5178d6 [ethernet] Fix compile warning for IPv6 (#7048) 2024-07-11 16:09:51 +12:00
guillempages
dea1e9a1e0 [http_request] Fix follow_redirects on arduino (#7054) 2024-07-11 16:08:51 +12:00
Z3LIFF
fa4fbf9d73 Fix pmsa003i cold boot marked as failed on ESP32 et al (#7064) 2024-07-11 16:01:14 +12:00
Christian Ferbar
fb6c2aef59 helpers.cpp: Fix GLIBCXX_RELEASE check < 8 (#7062) 2024-07-11 15:58:54 +12:00
Jesse Hills
6417f1f907 Bump version to 2024.7.0b1 2024-07-11 15:41:48 +12:00
Jesse Hills
d1b0e6b5fe Bump version to 2024.8.0-dev 2024-07-11 15:41:48 +12:00
Jimmy Hedman
2f669c99f8 Configure ap ip for RP2040 (#7065) 2024-07-11 13:32:17 +12:00
Pavlo Dudnytskyi
aa8c963c50 UART component support added for host platform (#6912)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Pavlo Dudnytskyi <pdudnytskyi@astrata.eu>
2024-07-11 13:30:55 +12:00
Kevin Ahrendt
2873c6bbaf [micro_wake_word] Version 2 (#7032) 2024-07-11 13:21:04 +12:00
MichD
2da939c81c Fix RC Switch protocol not transmitting correctly via IR (#5411) 2024-07-11 10:37:50 +12:00
dependabot[bot]
ee398441b6 Bump actions/setup-python from 5.1.0 to 5.1.1 in /.github/actions/restore-python (#7071)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-10 23:21:11 +02:00
tomaszduda23
894d81c577 [CI] Allow running specific target test(s) only (#7051) 2024-07-08 21:07:54 -05:00
Colm
4c6a17e304 Don't test for IPv6 addresses when min_ipv6_addr_count is 0 (#7037) 2024-07-06 19:02:41 +12:00
Pavlo Dudnytskyi
ddaa84683b Haier component update to support more protocol variations (#7040)
Co-authored-by: Pavlo Dudnytskyi <pdudnytskyi@astrata.eu>
2024-07-06 19:00:44 +12:00
leejoow
dd1e480142 Fix display of update state in webinterfae (#7045)
Co-authored-by: Leo Schelvis <leo.schelvis@gmail.com>
2024-07-06 16:57:30 +12:00
dependabot[bot]
6ca7b30f75 Bump actions/download-artifact from 4.1.7 to 4.1.8 (#7046)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-06 16:23:47 +12:00
dependabot[bot]
b0a3b5e080 Bump actions/upload-artifact from 4.3.3 to 4.3.4 (#7047)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-06 16:23:37 +12:00
dependabot[bot]
5fa54b0885 Bump docker/setup-qemu-action from 3.0.0 to 3.1.0 (#7039)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-05 13:27:46 +12:00
dependabot[bot]
803f3f2e13 Bump docker/build-push-action from 6.2.0 to 6.3.0 in /.github/actions/build-image (#7038)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-05 11:31:50 +12:00
dependabot[bot]
de19588d10 Bump docker/setup-buildx-action from 3.3.0 to 3.4.0 (#7043)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-07-05 11:22:06 +12:00
Jesse Hills
bc2bc13eb1 Merge branch 'release' into dev 2024-07-03 21:04:14 +12:00
Jesse Hills
6c96281a1d Merge pull request #7035 from esphome/bump-2024.6.6
2024.6.6
2024-07-03 21:03:25 +12:00
Jesse Hills
3727342bce Bump version to 2024.6.6 2024-07-03 20:14:27 +12:00
Jesse Hills
fc3f806555 [docker] Fix docker build error fall through (#7021) 2024-07-03 20:14:27 +12:00
Jesse Hills
c013c3bf61 [docker] Bump versions inside armv7 block (#7022) 2024-07-03 20:14:27 +12:00
Jesse Hills
849a98d5b4 Bump dockerfile dependencies (#7017) 2024-07-03 20:14:27 +12:00
Jesse Hills
dd1a72e4d9 Merge branch 'release' into dev 2024-07-03 20:05:10 +12:00
Jesse Hills
e4e404d54f Merge pull request #7034 from esphome/bump-2024.6.5
2024.6.5
2024-07-03 20:04:18 +12:00
lhy
ee6f2bfecb Fix compile errors on ESP32-C6 with W5500 SPI ethernet (#7030) 2024-07-03 20:03:54 +12:00
Jesse Hills
995db1d0e1 Bump version to 2024.6.5 2024-07-03 15:45:30 +12:00
Jesse Hills
5cb80619dd [wifi] Only set default ttls phase 2 on esp-idf (#7033)
* [wifi] Only set default ttls phase 2 on esp-idf

* Add eap arduino test
2024-07-03 15:45:30 +12:00
Keith Burzinski
0914dc7198 Move some consts for #4585 (#7023) 2024-07-03 15:45:30 +12:00
Jesse Hills
12f00a9d3d [mpr121] await register parented (#7014)
fixes https://github.com/esphome/issues/issues/5913
2024-07-03 15:45:30 +12:00
Jesse Hills
3fb9c93a24 [wifi] Only set default ttls phase 2 on esp-idf (#7033)
* [wifi] Only set default ttls phase 2 on esp-idf

* Add eap arduino test
2024-07-03 02:21:41 +00:00
Jesse Hills
d8f0dce08f [uptime] Add new timestamp type for uptime sensor (#7029)
* [uptime] Add new timestamp type for uptime sensor

* Remove debug logs
2024-07-01 21:29:49 -05:00
Keith Burzinski
5e6c69b930 [CI] Update tests to run against IDF 5.1 (#7011) 2024-07-02 14:07:36 +12:00
Keith Burzinski
83f9664efb [CI] Run all tests when a base test changes (#7010) 2024-07-02 14:06:33 +12:00
Andreas Fritiofson
582386d3a2 Make crc8 const-correct (#7027) 2024-07-02 13:47:56 +12:00
Keith Burzinski
7aaa5ce9c8 Move some consts for #4585 (#7023) 2024-07-01 06:20:59 +00:00
Kevin P. Fleming
5278ae4b5e 'uart' and 'improv_serial' need to understand non-UART logger configurations (#6998) 2024-07-01 11:52:05 +12:00
Jesse Hills
b89dea97d9 [docker] Fix docker build error fall through (#7021) 2024-07-01 11:51:51 +12:00
Jesse Hills
715184070d [docker] Bump versions inside armv7 block (#7022) 2024-07-01 11:17:44 +12:00
orland0m
6294c3b913 Enable devcontainer linters (#7019) 2024-07-01 11:06:59 +12:00
Jesse Hills
e9cf3623d1 Bump dockerfile dependencies (#7017) 2024-07-01 08:54:04 +12:00
Jesse Hills
d0ab2a16a6 [mpr121] await register parented (#7014)
fixes https://github.com/esphome/issues/issues/5913
2024-06-28 21:12:59 -05:00
Jesse Hills
1f5442f1ba Merge branch 'release' into dev 2024-06-27 18:40:44 +12:00
Jesse Hills
7b3d6747d5 Merge pull request #7004 from esphome/bump-2024.6.4
2024.6.4
2024-06-27 18:39:53 +12:00
Jesse Hills
7904d3b157 Bump version to 2024.6.4 2024-06-27 17:19:13 +12:00
Markus
3a48b10757 Fix LEDC 100% is not 100% duty with ESP32 IDF (#6997) 2024-06-27 17:19:12 +12:00
Keith Burzinski
0e50cac399 [ota-esphome] Merge configurations by port (#7001) 2024-06-27 17:19:12 +12:00
Jesse Hills
dc4a93f5d0 Revert "[CI] Update tests to run against IDF 5.1" (#7003) 2024-06-27 17:15:02 +12:00
Keith Burzinski
e23153d090 [CI] Remove old test yaml files (#7002) 2024-06-27 02:34:39 +00:00
Sergey Dudanov
9a26cdb336 [modbus_text_sensor] new default ANSI encoding type (#6975) 2024-06-27 13:50:25 +12:00
Markus
decf50ed49 Fix LEDC 100% is not 100% duty with ESP32 IDF (#6997) 2024-06-27 13:48:01 +12:00
Simone Rossetto
bfdf63055f Allow wireguard to bind to PPP interface (#6989)
Co-authored-by: Tim Lunn <tl@smlight.tech>
2024-06-27 13:42:16 +12:00
Keith Burzinski
cd7894ae8f [ota-esphome] Merge configurations by port (#7001) 2024-06-27 13:07:07 +12:00
Christiaan de Ridder
10504c4d68 Tuya invalid command 0x22 (#6980) 2024-06-27 11:03:55 +12:00
dependabot[bot]
192718fee6 Bump docker/build-push-action from 6.1.0 to 6.2.0 in /.github/actions/build-image (#6999)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-27 10:55:42 +12:00
Keith Burzinski
855d154439 [CI] Update tests to run against IDF 5.1 (#6992) 2024-06-27 10:55:05 +12:00
Keith Burzinski
300d48a55e [CI] Remove old test yamls (#6991) 2024-06-27 10:54:17 +12:00
Keith Burzinski
7174cf35dd [CI] Add more mdns and safe_mode tests (#6990) 2024-06-27 10:53:29 +12:00
Jesse Hills
0b3145a6df Merge branch 'release' into dev 2024-06-26 23:26:58 +12:00
Jesse Hills
04225d5717 Merge pull request #6994 from esphome/bump-2024.6.3
2024.6.3
2024-06-26 23:17:44 +12:00
Jesse Hills
86791422f0 Bump version to 2024.6.3 2024-06-26 22:41:48 +12:00
Sergey Dudanov
9c2af6318c [modbus-text-sensor] fix potential buffer overflow (#6993) 2024-06-26 22:41:48 +12:00
Samuel Sieb
c747d7d45d [dallas_temp] fix ds18s20 temp calc (#6988) 2024-06-26 22:41:48 +12:00
Petapton
bbd7c9cf86 Fix float encoding in modbus server (#6986) 2024-06-26 22:41:48 +12:00
Pieter Viljoen
169fb79c97 [ds1307] Initialize uninitialized struct members (#6985) 2024-06-26 22:41:48 +12:00
Kevin P. Fleming
1579dfeb80 Improve 'body' handling in http_request on_response triggers (#6968) 2024-06-26 22:41:48 +12:00
Keith Burzinski
d8a6d8594a [ota-esphome] Validate for multiple esphome ota instances (#6984) 2024-06-26 22:41:48 +12:00
Jesse Hills
7be071a0e9 [safe_mode] Set safe mode core data in disabled cases (#6983) 2024-06-26 22:41:47 +12:00
Sergey Dudanov
01bcf5fb97 [modbus-text-sensor] fix potential buffer overflow (#6993) 2024-06-26 22:38:11 +12:00
Samuel Sieb
91766afb64 [dallas_temp] fix ds18s20 temp calc (#6988) 2024-06-26 19:27:07 +12:00
Petapton
cc4f1c667e Fix float encoding in modbus server (#6986) 2024-06-26 12:08:16 +12:00
Pieter Viljoen
bc26de2d68 [ds1307] Initialize uninitialized struct members (#6985) 2024-06-26 11:54:02 +12:00
Kevin P. Fleming
0179358f9c Improve 'body' handling in http_request on_response triggers (#6968) 2024-06-26 11:50:54 +12:00
Keith Burzinski
d8a5c1ea0c [ota-esphome] Validate for multiple esphome ota instances (#6984) 2024-06-25 20:57:15 +00:00
H. Árkosi Róbert
fb9844463b Bump HeatpumpIR and IRremoteESP8266 (#6948) 2024-06-25 21:08:57 +12:00
Jesse Hills
481cf7384a [safe_mode] Set safe mode core data in disabled cases (#6983) 2024-06-25 09:07:19 +00:00
Markus
c9a0daf4b6 Do not build mDNS when mDNS is disabled via yaml (#6979) 2024-06-25 20:05:37 +12:00
Jesse Hills
8a25bedaf9 [external_files] Move common `download_content function to external_files.py` (#6982) 2024-06-25 00:42:55 -05:00
Jesse Hills
11b8e2e1af [core] Add script to extract actions, conditions, and pin_providers (#6929) 2024-06-24 23:43:30 -05:00
Jesse Hills
53cfa8d3a1 Merge branch 'release' into dev 2024-06-25 13:58:30 +12:00
Jesse Hills
0262a99274 Merge pull request #6981 from esphome/bump-2024.6.2
2024.6.2
2024-06-25 13:45:15 +12:00
Jesse Hills
09a947beaa Bump version to 2024.6.2 2024-06-25 08:57:38 +12:00
Sergey Dudanov
a6e1ef2dd1 [midea] fix fan speed compatibility with some models (#6978) 2024-06-25 08:57:38 +12:00
Samuel Sieb
c5aae8ee25 fix potential hang (#6976)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-06-25 08:57:38 +12:00
Brian Kaufman
5bd5b777a6 Await cg.get_variable in Update component (#6974) 2024-06-25 08:57:38 +12:00
Gábor Poczkodi
e39961f7f1 [http_request] memory leak fix (#6973) 2024-06-25 08:57:38 +12:00
Samuel Sieb
0d3cf5cb78 Onewire (#6967)
* retry scan

* setup pin and log retries

* fix retries

* remove retries

---------

Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-06-25 08:57:37 +12:00
Kevin P. Fleming
96d63de292 ESP-IDF 4.x expects seconds for esp_task_wdt_init(), not milliseconds. (#6964) 2024-06-25 08:57:37 +12:00
Kevin P. Fleming
ae2962259e Fix infinite loop in http_request for ESP-IDF. (#6963) 2024-06-25 08:57:37 +12:00
Jesse Hills
7dbc20b776 [update] Set entity_category to config & Publish state to logs (#6954) 2024-06-25 08:57:37 +12:00
Jesse Hills
a21dab334c [core] Fix package merging with lists of primitives (#6952) 2024-06-25 08:57:37 +12:00
Sergey Dudanov
78450da6f3 [midea] fix fan speed compatibility with some models (#6978) 2024-06-25 08:04:58 +12:00
Samuel Sieb
b1868123db fix potential hang (#6976)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-06-24 11:21:28 +00:00
Sergey Dudanov
f7af51b92c [haier] climate ID auto generation (#6949) 2024-06-24 18:22:07 +12:00
Brian Kaufman
7ee1406f64 Await cg.get_variable in Update component (#6974) 2024-06-24 04:54:30 +00:00
Gábor Poczkodi
0f49b58e0a [http_request] memory leak fix (#6973) 2024-06-24 16:32:20 +12:00
Samuel Sieb
17204baac0 allow template parameters (#6972) 2024-06-24 10:22:08 +12:00
Manuel Kasper
1e05bcaa61 [qspi_amoled] Fix clear/fill with rotation (#6960) 2024-06-23 01:10:22 +10:00
esphomebot
18690d51f5 Synchronise Device Classes from Home Assistant (#6966) 2024-06-22 13:27:47 +00:00
Samuel Sieb
2aacf14e96 Onewire (#6967)
* retry scan

* setup pin and log retries

* fix retries

* remove retries

---------

Co-authored-by: Samuel Sieb <samuel@sieb.net>
2024-06-22 11:57:27 +00:00
dependabot[bot]
9c5507ab46 Bump docker/build-push-action from 6.0.1 to 6.1.0 in /.github/actions/build-image (#6962)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-22 12:50:21 +02:00
Kevin P. Fleming
0a9703bff9 ESP-IDF 4.x expects seconds for esp_task_wdt_init(), not milliseconds. (#6964) 2024-06-21 21:28:11 +00:00
Kevin P. Fleming
67bd5db6d6 Fix infinite loop in http_request for ESP-IDF. (#6963) 2024-06-22 09:18:43 +12:00
Manuel Kasper
6c11f0bd51 [qspi_amoled] Fix display remaining blank after update() before setup completion (#6958) 2024-06-22 00:46:06 +10:00
Jesse Hills
e7556271e7 [update] Set entity_category to config & Publish state to logs (#6954) 2024-06-21 02:59:52 +00:00
Jesse Hills
8045b889d3 [core] Fix package merging with lists of primitives (#6952) 2024-06-20 20:09:00 -05:00
Jesse Hills
6f074d3692 [dooya] Flip bit timings (#6947) 2024-06-21 12:49:26 +12:00
Jesse Hills
b09781afa5 Merge branch 'release' into dev 2024-06-20 17:06:28 +12:00
Jesse Hills
1863523cfd Merge pull request #6946 from esphome/bump-2024.6.1
2024.6.1
2024-06-20 17:05:37 +12:00
Jesse Hills
a7a9eb6f71 Bump version to 2024.6.1 2024-06-20 15:59:27 +12:00
Jesse Hills
c868dae44a Bump esphome-dashboard to 20240620.0 (#6944) 2024-06-20 15:59:27 +12:00
Cossid
ad8cf69897 debug_libretiny - Fix typo (#6942) 2024-06-20 15:59:27 +12:00
Keith Burzinski
96f1a146a6 [CI] Add debug component test for LibreTiny (#6945) 2024-06-19 21:32:29 -05:00
Jesse Hills
775e03cfd9 Bump esphome-dashboard to 20240620.0 (#6944) 2024-06-20 02:12:38 +00:00
Cossid
80e5e19956 debug_libretiny - Fix typo (#6942) 2024-06-19 19:59:37 -05:00
Jesse Hills
8f16268572 Merge branch 'release' into dev 2024-06-20 08:27:35 +12:00
Jesse Hills
0fe18a6144 Merge pull request #6940 from esphome/bump-2024.6.0
2024.6.0
2024-06-20 08:26:41 +12:00
Jesse Hills
a6d1aa91de Bump version to 2024.6.0 2024-06-19 21:52:47 +12:00
Jesse Hills
ba11f2ab0c Merge branch 'beta' into dev 2024-06-19 18:22:52 +12:00
Jesse Hills
9747811b82 Merge pull request #6938 from esphome/bump-2024.6.0b5
2024.6.0b5
2024-06-19 18:19:14 +12:00
Jesse Hills
ff803aa108 Rename test files 2024-06-19 16:37:33 +12:00
Jesse Hills
8bac82f804 Bump version to 2024.6.0b5 2024-06-19 15:37:43 +12:00
Jesse Hills
6682451ee0 [network] Default ipv6 to false to always set the flags (#6937)
* [network] Default ipv6 to false to always set the flags

* Separate tests for ipv6 disabled and enabled

* Forgot other platforms wouldnt have the variable in config
2024-06-19 15:37:43 +12:00
dependabot[bot]
c17090c1e5 Bump docker/build-push-action from 6.0.0 to 6.0.1 in /.github/actions/build-image (#6934)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 15:37:43 +12:00
dependabot[bot]
acf69bb56f Bump docker/build-push-action from 5.4.0 to 6.0.0 in /.github/actions/build-image (#6927)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 15:37:43 +12:00
dependabot[bot]
fd7a212562 Bump pypa/gh-action-pypi-publish from 1.8.14 to 1.9.0 (#6926)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 15:37:43 +12:00
Jesse Hills
8567877f07 [network] Default ipv6 to false to always set the flags (#6937)
* [network] Default ipv6 to false to always set the flags

* Separate tests for ipv6 disabled and enabled

* Forgot other platforms wouldnt have the variable in config
2024-06-18 22:09:16 -05:00
peter--s
310f850ee4 Update cover.h for open() and close() compiler warnings (#6936) 2024-06-19 13:28:03 +12:00
Manuel Kasper
896cdab22d Fix garbled graphics on LILYGO T4-S3 display (#6910) 2024-06-19 05:53:01 +10:00
dependabot[bot]
ed6462fa00 Bump docker/build-push-action from 6.0.0 to 6.0.1 in /.github/actions/build-image (#6934)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 07:38:50 +12:00
dependabot[bot]
65b05af014 Bump peter-evans/create-pull-request from 6.0.5 to 6.1.0 (#6935)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-19 07:38:31 +12:00
dependabot[bot]
c18056bdda Bump docker/build-push-action from 5.4.0 to 6.0.0 in /.github/actions/build-image (#6927)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 19:16:10 +12:00
dependabot[bot]
65a79acfb9 Bump pypa/gh-action-pypi-publish from 1.8.14 to 1.9.0 (#6926)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-18 16:44:20 +12:00
Jesse Hills
18d331d284 Merge branch 'beta' into dev 2024-06-18 16:14:38 +12:00
Jesse Hills
c053a33fe8 Merge pull request #6930 from esphome/bump-2024.6.0b4
2024.6.0b4
2024-06-18 16:12:04 +12:00
Jesse Hills
ff07637dfd Bump version to 2024.6.0b4 2024-06-18 14:26:24 +12:00
Jesse Hills
43b5c2deb7 Rename legacy/modern to ota/factory (#6922)
* Rename legacy/modern to ota/factory

* Add modern/legacy in brackets
2024-06-18 14:26:24 +12:00
Jesse Hills
d27e7b3b70 [wifi] Fix some access point bugs related to esp-idf 4.4.7 (#6928)
* Set dhcp server range to only 10 IPs

* Change log level to errors to make it clearer

* We want to stop the dhcp server, not client
2024-06-18 14:26:24 +12:00
Giel van Schijndel
5dec62bf1e fix(dallas): make recovery time for 1-bit equal to that of 0-bit (#6763) 2024-06-18 14:26:24 +12:00
Faidon Liambotis
7d642147c1 uart: allow setting the UART id in final_validate_device_schema (#6923) 2024-06-18 14:22:50 +12:00
Jesse Hills
4c313bc198 Rename legacy/modern to ota/factory (#6922)
* Rename legacy/modern to ota/factory

* Add modern/legacy in brackets
2024-06-17 21:12:55 -05:00
Jesse Hills
a78b2d0128 [wifi] Fix some access point bugs related to esp-idf 4.4.7 (#6928)
* Set dhcp server range to only 10 IPs

* Change log level to errors to make it clearer

* We want to stop the dhcp server, not client
2024-06-17 20:07:43 -05:00
Keith Burzinski
f6848fe24d [CI] Introduce testing for IDF 5 (and other arbitrary framework versions) (#6802)
* Initial changes to support testing of additional framework versions

* Rename Arduino test files
2024-06-17 16:32:11 -05:00
Keith Burzinski
a59c9b4f77 [CI-esp32_hall] Remove IDF test (#6921) 2024-06-17 07:30:54 +00:00
Keith Burzinski
c30913ccde [CI-wireguard] Test file consolidation (#6920) 2024-06-17 07:23:24 +00:00
Keith Burzinski
41f810f828 [CI-http_request] Test fix for IDF 5+ (#6919) 2024-06-17 19:21:15 +12:00
Keith Burzinski
d604c8ae64 [CI-api] Test fix for IDF 5+ (#6918) 2024-06-17 07:18:04 +00:00
Keith Burzinski
67d8c7c691 [CI-a01nyub] Consolidate test files (#6917) 2024-06-17 07:14:19 +00:00
Keith Burzinski
015cd42a2e [CI-ethernet] Add/fix/organize/clean up ethernet component tests (#6916) 2024-06-17 07:06:25 +00:00
Giel van Schijndel
51c5d1714c fix(dallas): make recovery time for 1-bit equal to that of 0-bit (#6763) 2024-06-16 22:48:56 -07:00
Jesse Hills
1ff302b341 Merge branch 'beta' into dev 2024-06-17 16:29:58 +12:00
Jesse Hills
cfe28ce7a3 Merge pull request #6915 from esphome/bump-2024.6.0b3
2024.6.0b3
2024-06-17 16:27:24 +12:00
Jesse Hills
25a3db1637 Bump version to 2024.6.0b3 2024-06-17 15:35:53 +12:00
Jesse Hills
65638bf614 [mqtt] Fix datetime copy pasta (#6914) 2024-06-17 15:35:52 +12:00
Jesse Hills
1e66241b26 [ili9xxx] Fix init for GC9A01A (#6913) 2024-06-17 15:35:52 +12:00
esphomebot
eb50f0eafd Synchronise Device Classes from Home Assistant (#6904) 2024-06-17 15:35:52 +12:00
Jesse Hills
6b89763ad6 [mqtt] Fix datetime copy pasta (#6914) 2024-06-17 13:20:04 +12:00
Jesse Hills
253303f3a9 [ili9xxx] Fix init for GC9A01A (#6913) 2024-06-17 13:01:07 +12:00
Keith Burzinski
d49f2cbec8 IDF 5 fixes for #6802 (#6911) 2024-06-16 20:02:15 +12:00
Anton Viktorov
290816be11 VEML7700 Fix GCC build warnings (#6881) 2024-06-16 02:50:00 -05:00
Keith Burzinski
2fc43fa9c7 [micro_wake_word] Pin to esp-tflite-micro v1.3.1 (#6906) 2024-06-14 12:38:35 +12:00
Keith Burzinski
5adadeaa07 [esp32_camera] Use newer library version (for #6802) (#6809) 2024-06-13 10:42:08 +00:00
Keith Burzinski
761aae6f89 [CI] Allow clang-tidy to see IDF components (#6903)
* Allow clang-tidy to see IDF components

* Remove camera, add tflite-micro
2024-06-13 05:15:38 -05:00
esphomebot
b29e1acab8 Synchronise Device Classes from Home Assistant (#6904) 2024-06-13 19:24:36 +12:00
Jesse Hills
49d4260cfe Merge branch 'beta' into dev 2024-06-13 11:41:24 +12:00
Jesse Hills
4e8a7986cd Merge pull request #6902 from esphome/bump-2024.6.0b2
2024.6.0b2
2024-06-13 11:40:44 +12:00
Jesse Hills
3db71b98ae Bump version to 2024.6.0b2 2024-06-13 10:31:08 +12:00
Jesse Hills
73cb3ec852 Bump esphome-dashboard to 20240613.0 (#6901) 2024-06-13 10:31:08 +12:00
Jesse Hills
91e72fe121 [host] Execute host program when using run command (#6897) 2024-06-13 10:31:08 +12:00
Oliver Hihn
be486e0ca6 Add step_delay option to X9C component (#6890) 2024-06-13 10:31:07 +12:00
Jesse Hills
fdefc825bb [CI] Fix for sdl (#6892) 2024-06-13 10:31:07 +12:00
Jesse Hills
c4c46c206f Bump esphome-dashboard to 20240613.0 (#6901) 2024-06-13 10:12:36 +12:00
dependabot[bot]
8453d9a70d Bump actions/checkout from 4.1.6 to 4.1.7 (#6900)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-13 09:27:15 +12:00
Oliver Hihn
68dbf35b09 X9C step delay with units (#6898) 2024-06-12 11:14:03 -07:00
Jesse Hills
1a242f94db [host] Execute host program when using run command (#6897) 2024-06-12 09:20:46 +00:00
Oliver Hihn
df52bc3493 Add step_delay option to X9C component (#6890) 2024-06-12 09:09:26 +00:00
Jesse Hills
2044c7e4d4 [CI] Fix for sdl (#6892) 2024-06-12 19:58:56 +12:00
Jesse Hills
b401b5eca8 [CI] Update device class sync script for update entities (#6895) 2024-06-12 19:36:57 +12:00
Jesse Hills
67f41a0c72 Merge branch 'beta' into dev 2024-06-12 19:34:22 +12:00
Jesse Hills
8a83670f54 Merge pull request #6891 from esphome/bump-2024.6.0b1
2024.6.0b1
2024-06-12 19:28:36 +12:00
Jesse Hills
bd7e8fbf86 Bump version to 2024.7.0-dev 2024-06-12 14:16:43 +12:00
Jesse Hills
f9f98fa6c6 Bump version to 2024.6.0b1 2024-06-12 14:16:43 +12:00
Clyde Stubbs
f25c296303 [ili9xxx] Implement st7735 support (#6838) 2024-06-12 13:47:52 +12:00
Clyde Stubbs
bc408ad08c [display] SDL2 display driver for host platform (#6825) 2024-06-12 13:42:01 +12:00
Tudor Sandu
e2c1af199c Fix media_player.volume_set when media player is not started (#6859)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-06-12 01:39:01 +00:00
Clyde Stubbs
7c843437a7 [config] Early termination of validation steps on error (#6837) 2024-06-12 13:26:43 +12:00
Gábor Poczkodi
4bf7c97088 WebSocket overrides check_origin for reverse proxy configuration (#6845) 2024-06-12 13:19:18 +12:00
Clyde Stubbs
7b9fb57bb2 [config] Retain path information in validated configuration (#6785) 2024-06-12 13:15:57 +12:00
guillempages
699d00e218 [image] Make PIL import local (#6864) 2024-06-12 13:11:00 +12:00
Clyde Stubbs
e2784d077d [he60r] Don't publish state unless it has changed. [BUGFIX] (#6869) 2024-06-12 13:09:20 +12:00
Samuel Sieb
13fabf1cd8 change to new 1-wire platform (#6860)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-06-12 13:05:44 +12:00
NMartin354
7b60543afd [safe_mode] Allow user-defined interval for successful boot (#6882)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-06-12 12:38:20 +12:00
Daniel D'Abate
562700bd2c Climate IR LG - Support fan only mode and all "on" commands (#3712) 2024-06-11 17:04:25 -07:00
Peter Ericson
a64106e48c [waveshare_epaper] Add support for 13.3in-k (#6443) 2024-06-12 11:51:04 +12:00
Landon Rohatensky
c723fd1f80 [animation] Allow loading external url at build time (#6876) 2024-06-12 10:56:27 +12:00
Anton Sergunov
3a97244b83 [Deep sleep] Compilation error with IDF >= 5.* (#6879) 2024-06-12 10:42:20 +12:00
Pieter Viljoen
1f8449ec0e [Dockerfile] Sync platformio version with requirements.txt (#6888) 2024-06-12 10:38:26 +12:00
Jesse Hills
3cd2fb0843 [core] Update Entities (#6885) 2024-06-12 09:57:36 +12:00
esphomebot
7dc07c5632 Update webserver local assets to 20240610-230854 (#6886) 2024-06-10 23:33:42 +00:00
Jesse Hills
95e45dc12c Allow parse_json to return a boolean result (#6884)
* Allow parse_json to return a boolean result

* Remove pass variable
2024-06-10 22:40:56 +00:00
dependabot[bot]
51a8a7e875 Bump docker/build-push-action from 5.3.0 to 5.4.0 in /.github/actions/build-image (#6883)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-06-11 10:17:18 +12:00
Jesse Hills
dceab6ce29 [voice_assistant] Write less data to speaker each loop (#6877) 2024-06-10 15:22:55 +12:00
Jesse Hills
6de79d6cfb [i2s_speaker] A few fixes (#6872) 2024-06-10 15:22:41 +12:00
Jesse Hills
7b45498de6 [http_request] Add esp-idf and rp2040 support (#3256)
* Implement http_request component for esp-idf

* Fix ifdefs

* Lint

* clang

* Set else to fail with error message

* Use unique_ptr

* Fix

* Tidy up casting, explicit HttpResponse lifetime (#3265)

Co-authored-by: Daniel Cousens <dcousens@users.noreply.github.com>

* Remove unique_ptr wrapper

* Fix

* Use reference

* Add duration code into new split files

* Add config for tx/rx buffer on idf

* Fix

* Try reserve response data with rx buffer size

* Update http_request.h

* Move client cleanup to be earlier

* Move capture_response to bool on struct and remove global

* Fix returns

* Change quotes to brackets

* Rework http request

* Remove http request from old test yamls

* Update component tests

* Validate md5 length when hardcoded string

* Linting

* Add duration_ms to container

* More lint

* const

* Remove default arguments and add helper functions for get and post

* Add virtual destructor to HttpContainer

* Undo const HEADER_KEYS

* 🤦

* Update esphome/components/http_request/ota/ota_http_request.cpp

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>

* Update esphome/components/http_request/ota/ota_http_request.cpp

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>

* lint

* Move header keys inline

* Add missing WatchdogManagers

* CAPS

* Fix "follow redirects" string in config dump

* IDF 5+ fix

---------

Co-authored-by: Daniel Cousens <413395+dcousens@users.noreply.github.com>
Co-authored-by: Daniel Cousens <dcousens@users.noreply.github.com>
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-06-09 15:15:29 -05:00
Mischa Siekmann
618102fe8c fix: arduino media player still sets wrong state. (#6875) 2024-06-09 18:34:21 +12:00
esphomebot
38b7bed2fa Update webserver local assets to 20240608-093147 (#6874) 2024-06-08 09:55:57 +00:00
RFDarter
d77ea46157 [datetime] datetime-datetime strptime support value string without seconds (#6867) 2024-06-08 08:29:10 +12:00
Mischa Siekmann
8718e15a6a fix: arduino media player sets wrong state for announcements (#6849)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-06-08 07:43:22 +12:00
RFDarter
861a23d039 [datetime] Add logs on DateCall perform (#6868) 2024-06-08 07:37:05 +12:00
Pieter Viljoen
276eea2b69 [docker] Avoid unsafe git error when container user and file config volume permissions don't match (#6873) 2024-06-08 07:36:07 +12:00
Jesse Hills
ccab57fc58 [logger] Fix defines for development (#6870)
* [logger] Fix defines for development

* Set debugging flags for rp2040
2024-06-06 23:30:49 -05:00
Olivier ARCHER
8ef4aaa70e [ota] http_request update platform (#5586)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Edward Firmo <94725493+edwardtfn@users.noreply.github.com>
2024-06-06 14:35:28 +12:00
Clyde Stubbs
7143e9cd9e [config] Allow file: scheme for git external components (#6844) 2024-06-06 07:27:06 +12:00
zry98
cc217d8a83 [Tuya Climate] Support both datapoint and pins for active state (#6789) 2024-06-05 08:11:19 +00:00
Will Rouesnel
c52d5c0279 Add invert_position_report to tuya.cover (#6020) 2024-06-05 07:52:19 +00:00
svxa
f36a96c8e2 Add carrier_frequency option to remote_transmitter.transmit_aeha (#6792) 2024-06-05 00:35:19 -07:00
Nate Clark
594856899a [ethernet] Add config option to set arbitrary PHY register values (#6836) 2024-06-05 18:51:56 +12:00
Jesse Hills
f7742cdf19 Merge branch 'release' into dev 2024-06-05 16:39:19 +12:00
Jesse Hills
5b062a222c Merge pull request #6863 from esphome/bump-2024.5.5
2024.5.5
2024-06-05 16:38:27 +12:00
Jesse Hills
664ee56dc5 Bump version to 2024.5.5 2024-06-05 15:51:29 +12:00
Keith Burzinski
388b2c2de0 [improv_serial] Fix for IDF 4.4.7 (#6855) 2024-06-05 15:51:29 +12:00
Jesse Hills
ce4a3d9950 [i2s_speaker] Add buffer allocation failure checks (#6829) 2024-06-05 15:51:29 +12:00
Jesse Hills
ac9f57600d [voice_assistant] Half the microphone ringbuffer size (#6830) 2024-06-05 15:51:29 +12:00
Jesse Hills
69d38f6137 [ft5x06] Interrupt pin and code quality improvements (#6851)
Co-authored-by: Clyde Stubbs <2366188+clydebarrow@users.noreply.github.com>
2024-06-05 11:02:18 +10:00
Keith Burzinski
eb75778f84 [improv_serial] Fix for IDF 4.4.7 (#6855) 2024-06-04 03:18:20 +00:00
Keith Burzinski
2d56d8d84f [wireguard] Implement workaround for crash on IDF 5+ (#6846) 2024-06-04 15:10:44 +12:00
Clyde Stubbs
cdf83c5d8c Add host time platform; remove host support from sntp. (#6854) 2024-06-04 15:09:46 +12:00
Pieter Viljoen
78b48209aa Add Ethernet MAC address to ethernet_info (#6835) 2024-06-04 14:57:05 +12:00
Pieter Viljoen
05491e756b Avoid unsafe git error when container user and file config volume permissions don't match (#6843) 2024-06-04 13:34:47 +12:00
Jimmy Hedman
b8d2a6f574 [sntp] fix for ESP-IDF > 5.0 (#6769)
* Make sntp work with ESP-IDF >= 5.0

* Set operatingmode on other than ESP-IDF

---------

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-06-02 22:23:49 -05:00
Kevin P. Fleming
2353b2b5e1 Add messages when WiFi and Ethernet components set 'warning' flag. (#6850) 2024-06-02 10:40:50 +12:00
Simone Rossetto
2beb1f0336 Wireguard support for bk72 microcontrollers (#6842)
* Bump esp_wireguard to v0.4.1

* add support for bk72 microcontrollers (thanks to kuba2k2)
* fix compilation error using esp-idf v5 (thanks to kbx81)
* fix crash on vpn disconnection with alive tcp connection (thanks to jefftharris)

* Disable ipv6 for bk72 wireguard test

* Completely remove ipv6 entry from bk72 wg test
2024-05-31 21:36:51 -05:00
Pieter Viljoen
41e13fa6f4 Replace random non-ascii-print characters with standard substitutes (#6840) 2024-06-01 10:49:48 +10:00
Keith Burzinski
1f301df51d Fix log message in VA for IDF 5 (#6839) 2024-05-31 17:49:11 +12:00
NonaSuomy
2894a138e7 Update const.py added missing millimeter (#6834)
* Update const.py added missing millimeter

Added missing millimeter

* Fixed UNIT_MILLIMETER in multiple locations.
2024-05-31 05:13:11 +00:00
Anton Viktorov
8dfe1d5220 LTR-303, LTR-329, LTR-553, LTR-556, LTR-559, LTR-659 Series of Lite-On Light (ALS) and Proximity(PS) sensors (#6076)
* LTR303 and LTR329 light sensors

* LTR303 tidy up

* LTR303 unused var

* LTR303 tidy up + test

* LTR303 auto sensitivity mode

* LTR303 auto sensitivity mode tidy

* LTR303 State machine version

* LTR303 name fix

* publish split

* minor

* new definitions for LTR

* als-ps test

* als-ps test

* als-ps test

* ps options

* ps options

* trgger bug fixed

* trgger bug fixed

* Minor comments

* ltr303->ltr_als_ps

* codeowners, tests

* tidy up

* tidy up

* tidy up

* gain enum name fix

* auto gain fix

* tweaks

* new style tests

* als/ps separate init

* logd->logv

* reconfiguration count changed

* old-style tests removed

* const py

* ambient light const in vmel7700 and ltr390

* Update esphome/components/ltr_als_ps/ltr_als_ps.cpp

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>

* Apply suggestions from code review

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>

* remove commented code

---------

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-05-30 03:46:52 -05:00
Jesse Hills
dd27881336 [i2s_speaker] Add buffer allocation failure checks (#6829) 2024-05-30 03:01:39 -05:00
Jesse Hills
8aba890e69 [voice_assistant] Half the microphone ringbuffer size (#6830) 2024-05-30 03:00:09 -05:00
Jesse Hills
63fc8ab10a [core] Const-ify some Component fields (#6831) 2024-05-30 02:59:15 -05:00
Erdem
9de8eaff24 Fix DHT reading timing for SI7021 on ESP32 (#6604)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-30 17:31:09 +12:00
Michael Hansen
c130ddbe9c [micro_wake_word] Ensure model string is Path (#6826) 2024-05-30 13:58:13 +12:00
RFDarter
a7fc1a6298 [web_server] add entity sorting for v3 (#6445)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-30 13:54:20 +12:00
Jesse Hills
854d3f2e4a [voice_assistant] Timers (#6821)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-05-30 13:09:19 +12:00
dependabot[bot]
5ae32e81c3 Bump black from 24.4.0 to 24.4.2 (#6646)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-29 17:11:34 +12:00
dependabot[bot]
439fd94718 Bump peter-evans/create-pull-request from 6.0.4 to 6.0.5 (#6635)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-29 17:11:02 +12:00
dependabot[bot]
6d5d382f3d Bump pytest-cov from 4.1.0 to 5.0.0 (#6580)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-29 17:10:47 +12:00
dependabot[bot]
60433c5e64 Bump docker/login-action from 3.1.0 to 3.2.0 (#6823)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-29 17:09:13 +12:00
Keith Burzinski
bff24e2977 Fix a bunch of components for IDF 5 compatibility and #6802 (#6805) 2024-05-29 17:05:19 +12:00
Clyde Stubbs
ec3164f800 [wake_on_lan] Make component platform independent (#6815) 2024-05-29 16:36:49 +12:00
Frederik
2b691ad5ad Make SPI Ethernet (W5500) compatible with ESP-IDF v5 (#6778)
* change MAC PHY init order according to IDF examples

* add idfv5 specific w5500 config init

* esp_mac.h needs to be included directly starting with idf5

* Header fix

* Couple tweaks

---------

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2024-05-28 17:02:45 -05:00
DAVe3283
06996def72 Use uint8_t instead of uint32_t for 8-bit values on mitsubishi (#6824)
This solves some printf formatting issues on ESP-IDF and saves RAM on all platforms.
2024-05-28 20:44:47 +00:00
DAVe3283
db6f6f0cb7 Fix compile errors on ESP32-C6 with latest ESP-IDF (#6822)
* Use <cinttypes> PRI macros to fix ESP32-C6 compile

* Fix compile error on latest ESP-IDF framework & platform
2024-05-28 14:40:34 -05:00
pimdo
497cf8742f Make i2s_audio compatible with IDF 5+ (#6534)
* Update i2s_audio.cpp

Replace usage of I2S_NUM_MAX with I2S_NUM_1

* Update i2s_audio_microphone.cpp

Replace I2S_MCLK_MULTIPLE_DEFAULT with I2S_MCLK_MULTIPLE_256

* Update i2s_audio_speaker.cpp

Replace I2S_MCLK_MULTIPLE_DEFAULT with I2S_MCLK_MULTIPLE_256

* Update voice_assistant.cpp

Fix  msg.event_type format

* check SOC_I2S_NUM for c3

* use I2S_NUM_AUTO

* Update i2s_audio.cpp

* Couple tweaks

* Why did they take away I2S_NUM_MAX

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>

---------

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-28 01:42:59 +00:00
Jesse Hills
d2b35adcc8 Merge branch 'release' into dev 2024-05-28 12:51:22 +12:00
Jesse Hills
3fe2fc9b56 Merge pull request #6820 from esphome/bump-2024.5.4
2024.5.4
2024-05-28 12:50:30 +12:00
Jesse Hills
4cd4b168b4 Bump version to 2024.5.4 2024-05-28 08:29:19 +12:00
Gábor Poczkodi
f07479419c [helpers] Move Base64 string to cpp (#6819) 2024-05-28 08:29:19 +12:00
Jesse Hills
54b51269ab [web_server_base] Bump ESPAsyncWebServer-esphome to 3.2.2 (#6797)
Co-authored-by: Samuel Sieb <samuel-github@sieb.net>
2024-05-28 08:29:18 +12:00
Gábor Poczkodi
6e4fd428e7 [helpers] Move Base64 string to cpp (#6819) 2024-05-28 08:19:22 +12:00
august huber
e285196709 fix libretiny regression from #6715 (#6806) 2024-05-27 07:41:29 +12:00
august huber
17c6bf57cd [tuya] add support for extended services (#6808) 2024-05-27 07:40:38 +12:00
Sašo Domadenik
4125b48b86 Fix incorrect naming of the AdaFruit MagTag display. (#6810) 2024-05-27 07:23:00 +12:00
Jesse Hills
6d341ce4e7 [web_server_base] Bump ESPAsyncWebServer-esphome to 3.2.2 (#6797)
Co-authored-by: Samuel Sieb <samuel-github@sieb.net>
2024-05-27 07:15:05 +12:00
Jesse Hills
964410bd64 Merge branch 'release' into dev 2024-05-25 08:25:31 +12:00
Jesse Hills
d72ab25d46 Merge pull request #6804 from esphome/bump-2024.5.3
2024.5.3
2024-05-25 08:24:38 +12:00
Jesse Hills
af755380b7 Bump version to 2024.5.3 2024-05-25 08:14:39 +12:00
Jesse Hills
04db724295 [voice_assistant] Don't allocate buffers until starting the microphone for the first time (#6800) 2024-05-25 08:14:39 +12:00
Jesse Hills
863bee28d9 [voice_assistant] Don't allocate buffers until starting the microphone for the first time (#6800) 2024-05-25 07:42:24 +12:00
Edward Firmo
9d03f47233 [nextion] Add basic functions to Intelligent series (#6791) 2024-05-24 09:11:34 +12:00
polyfloyd
c2d67659f3 mpr121: Add GPIO support (#6776)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-24 09:08:28 +12:00
Pavlo Dudnytskyi
aed0593793 [haier] `text_sensor and button` platforms (#6780) 2024-05-24 09:07:39 +12:00
Jesse Hills
4ab7a5d964 [ledc] Change some logging lines from debug to verbose (#6796) 2024-05-23 00:04:33 -05:00
Penny Wood
7f9383c83b [sx1509] Output open drain pin mode (#6788) 2024-05-23 09:31:56 +12:00
Keith Burzinski
9a6fde21ee Add on_safe_mode trigger (#6790) 2024-05-23 07:43:13 +12:00
Jeroen van Oort
1ca7c2d7dd Add support for acting as Modbus server (#4874)
Co-authored-by: Jeroen van Oort <jeroen.vanoort@webparking.nl>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-22 16:17:32 +12:00
Keith Burzinski
76abf2200c Uncouple safe_mode from OTA (#6759) 2024-05-22 13:08:53 +12:00
Jesse Hills
83d3584173 Merge branch 'release' into dev 2024-05-21 12:30:00 +12:00
Jesse Hills
0ee4348777 Merge pull request #6786 from esphome/bump-2024.5.2
2024.5.2
2024-05-21 12:29:09 +12:00
Jesse Hills
fcdf36e991 Bump version to 2024.5.2 2024-05-21 11:07:20 +12:00
esphomebot
5eb8efd8b3 Update webserver local assets to 20240519-215627 (#6779) 2024-05-21 11:07:20 +12:00
Jesse Hills
cd0f557940 [remote_receiver] Add better error message for tolerance breaking change (#6784) 2024-05-21 11:07:20 +12:00
J. Nick Koston
efde677ca9 Fix DashboardEntries.all() call (#6783) 2024-05-21 11:07:20 +12:00
J. Nick Koston
2eebee1de7 Revert "Fix MQTT dashboard discovery (Exception in MqttStatusThread)." (#6782) 2024-05-21 11:07:20 +12:00
esphomebot
525c4891d5 Update webserver local assets to 20240519-215627 (#6779) 2024-05-21 10:55:56 +12:00
Anton Viktorov
ce6dc040da Tiny fix in automation.h - unused return value removed (#6760) 2024-05-21 10:54:38 +12:00
Jesse Hills
9de67feccd [remote_receiver] Add better error message for tolerance breaking change (#6784) 2024-05-21 10:53:16 +12:00
Clyde Stubbs
bad400e1cd [ili9xxx] Add 18bit mode selection and custom init sequence (#6745) 2024-05-21 09:18:13 +12:00
J. Nick Koston
59b1e9c1b0 Fix DashboardEntries.all() call (#6783) 2024-05-20 11:52:24 +00:00
J. Nick Koston
25ee24299a Revert "Fix MQTT dashboard discovery (Exception in MqttStatusThread)." (#6782) 2024-05-20 11:49:00 +00:00
Jesse Hills
81ef67cfbb Merge branch 'release' into dev 2024-05-20 19:50:39 +12:00
Jesse Hills
f235dcc096 Merge pull request #6781 from esphome/bump-2024.5.1
2024.5.1
2024-05-20 19:48:55 +12:00
Jesse Hills
d2d3db4b8c Bump version to 2024.5.1 2024-05-20 17:14:17 +12:00
Markus
ec6d86c8f5 Fix MQTT dashboard discovery (Exception in MqttStatusThread). (#6775) 2024-05-20 17:14:17 +12:00
Markus
7452879fb1 Fix Upload from Dashboard with MQTT discovery. (#6774)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-20 17:14:17 +12:00
esphomebot
4fc2f2284a Synchronise Device Classes from Home Assistant (#6768) 2024-05-20 17:14:17 +12:00
acshef
840f69ffe6 Add device_class to valve core config (#6765) 2024-05-20 17:14:17 +12:00
fodfodfod
b9bb3cd4be add rp2040 support to the wizard (#6239) 2024-05-20 12:42:30 +12:00
Markus
91e7a44c31 Fix MQTT dashboard discovery (Exception in MqttStatusThread). (#6775) 2024-05-20 11:52:14 +12:00
Markus
080f8bc86e Fix Upload from Dashboard with MQTT discovery. (#6774)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-19 20:33:20 +00:00
dependabot[bot]
a85d37a1cf Bump actions/checkout from 4.1.5 to 4.1.6 (#6764)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-20 08:12:32 +12:00
tomaszduda23
ba73187c1b separate deep_sleep component for each platform in different file (#6762)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-20 08:11:27 +12:00
tomaszduda23
4469ba4024 [tests] make test_build_components work with venv without installing esphome (#6761) 2024-05-19 11:47:23 +12:00
Sebastian Muszynski
70e0925f9a Fix pip3 install (#6771) 2024-05-19 11:31:36 +12:00
esphomebot
1164cb8610 Synchronise Device Classes from Home Assistant (#6768) 2024-05-18 07:15:52 +00:00
acshef
94b63d7bc2 Add device_class to valve core config (#6765) 2024-05-18 16:17:09 +12:00
Jesse Hills
df838b5788 [core] Remove references to deleted setup.py (#6757) 2024-05-16 22:33:33 +12:00
Edward Firmo
d410cc4f7b [nextion] Fix type on sprintf for IDF v5 (#6758) 2024-05-16 22:22:18 +12:00
Anton Viktorov
b06e0746f5 INA228/INA229, INA238/INA239, INA237 power/energy/charge monitor (I2C, SPI) (#6138)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-16 16:50:28 +12:00
Jesse Hills
034c196ad8 [core] Update some coroutine priorities (#6755) 2024-05-16 16:46:16 +12:00
Keith Burzinski
996f71c03c Fix wifi compile error on IDF 5.1+ (#6756) 2024-05-16 04:40:21 +00:00
Anton Viktorov
98cb6555df SPI and I2C for ENS160 (#6369) 2024-05-16 15:22:40 +12:00
Faidon Liambotis
0bb2773c64 Port wifi_component_esp32_arduino from tcpip_adapter to esp_netif (#6476)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-16 14:49:40 +12:00
Jesse Hills
7c243dafb3 [core] Fix some extends cases (#6748) 2024-05-16 14:11:54 +12:00
Mat931
247b2eee30 Add ADC multisampling (#6330) 2024-05-16 14:11:21 +12:00
Keith Burzinski
f46c499c4e Separate OTABackend from OTA component (#6459)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-16 14:01:09 +12:00
Jesse Hills
f91c31f093 [core] Fix running pylint via pre-commit from GUI apps (#6754) 2024-05-16 13:47:56 +12:00
Jesse Hills
a27c05483c [core] Move pylint config into pyproject.toml (#6739) 2024-05-16 13:47:36 +12:00
Jesse Hills
bf48ccaf22 [core] Move pytest config into pyproject.toml (#6740) 2024-05-16 13:20:12 +12:00
Jesse Hills
f2ef06d8b5 [core] Migrate to pyproject.toml (#6737) 2024-05-16 13:19:37 +12:00
Andrew McFague
f0ec900e48 Skip gpio validation (#5615) 2024-05-16 11:49:04 +12:00
Shawn Wilsher
7d804bf90f Fix Prometheus Output to Match Spec (#6032) 2024-05-16 11:39:57 +12:00
shxshxshxshx
2921831b55 WPA2 Enterprise - Explicitly set TTLS Phase 2 (#6436)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-16 11:37:53 +12:00
heggi
08509f7755 Mirage remote receiver & transmitter (#6479)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-16 11:35:17 +12:00
Daniel Mahaney
ebfccc64c7 fix rp2040_pio_led flicker and proper multi-strip support (#6194)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-16 11:33:52 +12:00
lbilger
8952719045 Allow one timing to cancel others (#6744)
Co-authored-by: Lars Bilger <lars.bilger@lht.dlh.de>
2024-05-16 11:33:27 +12:00
ius
073fb4c124 i2c: fix format string specifiers (#6746) 2024-05-16 11:33:15 +12:00
Mat931
46eee4a4f0 Add beken_spi_led_strip component (#6515)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-16 11:32:48 +12:00
Alex Boyd
773951d85e BedJet: expose the outlet temperature on the climate and as a sensor (#6633) 2024-05-16 11:31:08 +12:00
Jesse Hills
1f29023c92 Merge branch 'release' into dev 2024-05-15 18:29:15 +12:00
Jesse Hills
caa8c820de Merge pull request #6753 from esphome/bump-2024.5.0
2024.5.0
2024-05-15 18:27:28 +12:00
dependabot[bot]
9f1ba00b7c Bump esphome-dashboard from 20240412.0 to 20240429.1 (#6743)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-15 17:16:04 +12:00
Keith Burzinski
891f56b421 [tests] `test2.yaml` has become too large (#6750) 2024-05-15 17:14:19 +12:00
Jesse Hills
0d3adc8f0c Bump version to 2024.5.0 2024-05-15 17:08:43 +12:00
Jesse Hills
d7cb953994 Merge branch 'beta' into dev 2024-05-15 16:33:46 +12:00
Jesse Hills
ad0a1c5c35 Merge pull request #6751 from esphome/bump-2024.5.0b6
2024.5.0b6
2024-05-15 16:24:15 +12:00
Jesse Hills
5d2e3a7d8d Bump version to 2024.5.0b6 2024-05-15 13:14:15 +12:00
Jesse Hills
ebc3f0fe17 [adc] Fix 11db deprecation warning (#6749) 2024-05-15 13:14:15 +12:00
Jesse Hills
9a6e90af54 [adc] Fix 11db deprecation warning (#6749) 2024-05-15 12:51:01 +12:00
Jesse Hills
55e4532a88 Merge branch 'beta' into dev 2024-05-15 10:03:05 +12:00
Jesse Hills
bd8afa51cd Merge pull request #6741 from esphome/bump-2024.5.0b5
2024.5.0b5
2024-05-15 09:57:25 +12:00
Jesse Hills
db4aa0b679 Bump version to 2024.5.0b5 2024-05-15 07:37:22 +12:00
Mischa Siekmann
28a09cc0d0 Add ANNOUNCING state to media_player. (#6691) 2024-05-15 07:37:21 +12:00
Mischa Siekmann
128fad57b3 Voice-Assistant: Start-order change for VAD disabled: start va-pipeline when microphon… (#6391) 2024-05-15 07:37:21 +12:00
Mischa Siekmann
6f53607e5a Add ANNOUNCING state to media_player. (#6691) 2024-05-14 21:40:08 +12:00
Clyde Stubbs
d5eeab81d6 [config] Improve error reporting (#6736) 2024-05-14 21:31:03 +12:00
Jesse Hills
636037cec1 [core] Fix minor formatting issues (#6738) 2024-05-14 17:01:07 +12:00
Jesse Hills
7d791cbdfb [esp32_ble] Fix compilation error on esp32c6 (#6734) 2024-05-14 16:22:43 +12:00
Jesse Hills
036a666e36 [web_server] Minor python formatting (#6735) 2024-05-14 15:38:53 +12:00
Mischa Siekmann
921e56f2c6 Voice-Assistant: Start-order change for VAD disabled: start va-pipeline when microphon… (#6391) 2024-05-14 13:25:24 +12:00
Jesse Hills
c94f638c0b Merge branch 'beta' into dev 2024-05-14 11:49:01 +12:00
Jesse Hills
142c4a87d2 Merge pull request #6733 from esphome/bump-2024.5.0b4
2024.5.0b4
2024-05-14 11:38:00 +12:00
Jesse Hills
1e4d6ee344 Bump version to 2024.5.0b4 2024-05-14 10:02:22 +12:00
Jesse Hills
5afe0e5ec2 Fix ESPHOME_PROJECT_VERSION_30 (#6731) 2024-05-14 10:02:22 +12:00
dependabot[bot]
ba3fc4c5d0 Bump platformio from 6.1.13 to 6.1.15 (#6634)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-14 10:02:22 +12:00
Mischa Siekmann
694f75117e Set FEATURE_API_AUDIO flag also if the speaker component is not used (#6712) 2024-05-14 10:02:22 +12:00
Marcin Krasowski
4ec2ef27a8 fix(ltr390): stuck ALS values when configured for ALS+UV readings (#6723) 2024-05-14 10:02:21 +12:00
dependabot[bot]
2ac0821cab Bump pytest from 8.1.1 to 8.2.0 (#6732)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-14 09:58:43 +12:00
Jesse Hills
47b40505c2 Fix ESPHOME_PROJECT_VERSION_30 (#6731) 2024-05-14 09:42:53 +12:00
dependabot[bot]
eae97dbaa0 Bump platformio from 6.1.13 to 6.1.15 (#6634)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-14 07:11:59 +12:00
Ludovic BOUÉ
91007952e2 [CST816] Add support for Hynitron Microelectronics CST826 capacitive touch (#6682) 2024-05-13 20:21:06 +10:00
Mischa Siekmann
5ee4bf3802 Set FEATURE_API_AUDIO flag also if the speaker component is not used (#6712) 2024-05-13 16:05:13 +12:00
Jorge-Crespo-Celdran
a23d1631e1 time_based_cover.cpp with manual control fix (#6719) 2024-05-13 16:04:06 +12:00
Clyde Stubbs
dd81c83686 Typing hint and doc fixes (#6729) 2024-05-13 15:21:02 +12:00
Szewcson
13e3920c13 GDK101 support (#4703)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-13 13:36:10 +12:00
tomaszduda23
67ca60e2af separate debug component for each platform in different file (#6715)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-13 11:54:43 +12:00
Marcin Krasowski
61b65e2726 fix(ltr390): stuck ALS values when configured for ALS+UV readings (#6723) 2024-05-13 11:25:41 +12:00
Clyde Stubbs
1a45858904 Add pylint to git pre-commit hooks (#6726) 2024-05-13 09:56:55 +12:00
Jesse Hills
47a1710b1e Only cache docker images on dev branch (#6714) 2024-05-10 11:55:35 +12:00
Jesse Hills
ca5050d4a5 [github] Only save platformio cache for dev branch (#6711) 2024-05-10 11:04:32 +12:00
Jesse Hills
8280772b91 Add new Error type to skip prepending path (#6716) 2024-05-10 10:57:47 +12:00
Jesse Hills
026c3a69b8 Merge branch 'beta' into dev 2024-05-09 23:23:14 +12:00
Jesse Hills
448b4f5cb6 Merge pull request #6713 from esphome/bump-2024.5.0b3
2024.5.0b3
2024-05-09 23:04:30 +12:00
Jesse Hills
8ae8cd1168 Bump version to 2024.5.0b3 2024-05-09 21:55:34 +12:00
Jesse Hills
bd776baf8d [github] Fix digest artifact name (#6710) 2024-05-09 21:55:34 +12:00
Clyde Stubbs
819bb9f8bc [color] Fix crash when hex color parses as int, improve error reporting. (#6707) 2024-05-09 21:55:34 +12:00
Clyde Stubbs
26048d18ef [core] Ensure that a generated ID name is distinct from its type. (#6706) 2024-05-09 21:55:34 +12:00
Jesse Hills
78d1a50853 [github] Fix digest artifact name (#6710) 2024-05-09 21:25:48 +12:00
Jesse Hills
ca031287a1 Merge branch 'beta' into dev 2024-05-09 17:35:13 +12:00
Clyde Stubbs
5956bebcb7 [color] Fix crash when hex color parses as int, improve error reporting. (#6707) 2024-05-09 03:14:31 +00:00
Clyde Stubbs
afe81184a8 [core] Ensure that a generated ID name is distinct from its type. (#6706) 2024-05-09 15:08:30 +12:00
chbmuc
d0120cefd2 Add IRK support to ble_rssi (#6422)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-09 15:02:43 +12:00
J. Nick Koston
3ec4a66c9e Bump recommended ESP-IDF to 4.4.7 (#6703) 2024-05-09 13:45:10 +12:00
Nate Clark
819be76013 Add PHY register writes to enable external clock on Ethernet with RTL8201 (#6704)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2024-05-09 12:47:25 +12:00
Jesse Hills
72481006e4 [ethernet] Use constexpr instead of inline define for KSZ80XX_PC2R_REG_ADDR (#6705) 2024-05-09 12:25:57 +12:00
Mat931
487e171443 [remote_receiver, remote_transmitter] Improve error messages on the ESP32 (#6701) 2024-05-09 09:58:40 +12:00
Edward Firmo
e48d02495b [nextion] Replace flags to USE_ARDUINO (#6700) 2024-05-09 07:05:24 +12:00
Jesse Hills
7764ab2411 [github] Upgrade to actions/{upload,download}-artifact v4 (#6698) 2024-05-08 16:17:45 +12:00
Jesse Hills
225beb305d Merge branch 'beta' into dev 2024-05-08 14:09:30 +12:00
Jesse Hills
b7c6125a0b Bump version to 2024.6.0-dev 2024-05-08 13:22:05 +12:00
5514 changed files with 102886 additions and 71267 deletions

View File

@@ -7,28 +7,39 @@ Checks: >-
-boost-*,
-bugprone-easily-swappable-parameters,
-bugprone-implicit-widening-of-multiplication-result,
-bugprone-multi-level-implicit-pointer-conversion,
-bugprone-narrowing-conversions,
-bugprone-signed-char-misuse,
-bugprone-switch-missing-default-case,
-cert-dcl50-cpp,
-cert-err33-c,
-cert-err58-cpp,
-cert-oop57-cpp,
-cert-str34-c,
-clang-analyzer-optin.core.EnumCastOutOfRange,
-clang-analyzer-optin.cplusplus.UninitializedObject,
-clang-analyzer-osx.*,
-clang-diagnostic-delete-abstract-non-virtual-dtor,
-clang-diagnostic-delete-non-abstract-non-virtual-dtor,
-clang-diagnostic-deprecated-declarations,
-clang-diagnostic-ignored-optimization-argument,
-clang-diagnostic-missing-field-initializers,
-clang-diagnostic-shadow-field,
-clang-diagnostic-unused-const-variable,
-clang-diagnostic-unused-parameter,
-clang-diagnostic-vla-cxx-extension,
-concurrency-*,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-const-or-ref-data-members,
-cppcoreguidelines-avoid-do-while,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-macro-to-enum,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-missing-std-forward,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-owning-memory,
-cppcoreguidelines-prefer-member-initializer,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
@@ -40,7 +51,9 @@ Checks: >-
-cppcoreguidelines-pro-type-static-cast-downcast,
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-rvalue-reference-param-not-moved,
-cppcoreguidelines-special-member-functions,
-cppcoreguidelines-use-default-member-init,
-cppcoreguidelines-virtual-class-destructor,
-fuchsia-multiple-inheritance,
-fuchsia-overloaded-operator,
@@ -60,20 +73,32 @@ Checks: >-
-llvm-include-order,
-llvm-qualified-auto,
-llvmlibc-*,
-misc-non-private-member-variables-in-classes,
-misc-const-correctness,
-misc-include-cleaner,
-misc-no-recursion,
-misc-non-private-member-variables-in-classes,
-misc-unused-parameters,
-modernize-avoid-c-arrays,
-misc-use-anonymous-namespace,
-modernize-avoid-bind,
-modernize-avoid-c-arrays,
-modernize-concat-nested-namespaces,
-modernize-macro-to-enum,
-modernize-return-braced-init-list,
-modernize-type-traits,
-modernize-use-auto,
-modernize-use-constraints,
-modernize-use-default-member-init,
-modernize-use-equals-default,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
-modernize-use-nullptr,
-modernize-use-nodiscard,
-modernize-use-nullptr,
-modernize-use-trailing-return-type,
-mpi-*,
-objc-*,
-performance-enum-size,
-readability-avoid-nested-conditional-operator,
-readability-container-contains,
-readability-container-data-pointer,
-readability-convert-member-functions-to-static,
-readability-else-after-return,
@@ -82,11 +107,14 @@ Checks: >-
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-make-member-function-const,
-readability-named-parameter,
-readability-redundant-casting,
-readability-redundant-inline-specifier,
-readability-redundant-member-init,
-readability-redundant-string-init,
-readability-uppercase-literal-suffix,
-readability-use-anyofallof,
WarningsAsErrors: '*'
AnalyzeTemporaryDtors: false
FormatStyle: google
CheckOptions:
- key: google-readability-function-size.StatementThreshold

View File

@@ -1,7 +1,9 @@
{
"name": "ESPHome Dev",
"image": "ghcr.io/esphome/esphome-lint:dev",
"postCreateCommand": ["script/devcontainer-post-create"],
"postCreateCommand": [
"script/devcontainer-post-create"
],
"containerEnv": {
"DEVCONTAINER": "1",
"PIP_BREAK_SYSTEM_PACKAGES": "1",
@@ -27,6 +29,9 @@
"extensions": [
// python
"ms-python.python",
"ms-python.pylint",
"ms-python.flake8",
"ms-python.black-formatter",
"visualstudioexptteam.vscodeintellicode",
// yaml
"redhat.vscode-yaml",
@@ -38,9 +43,21 @@
"settings": {
"python.languageServer": "Pylance",
"python.pythonPath": "/usr/bin/python3",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.formatting.provider": "black",
"pylint.args": [
"--rcfile=${workspaceFolder}/pyproject.toml"
],
"flake8.args": [
"--config=${workspaceFolder}/.flake8"
],
"black-formatter.args": [
"--config",
"${workspaceFolder}/pyproject.toml"
],
"[python]": {
// VS will say "Value is not accepted" before building the devcontainer, but the warning
// should go away after build is completed.
"editor.defaultFormatter": "ms-python.black-formatter"
},
"editor.formatOnPaste": false,
"editor.formatOnSave": true,
"editor.formatOnType": true,

View File

@@ -75,6 +75,9 @@ target/
# pyenv
.python-version
# asdf
.tool-versions
# celery beat schedule file
celerybeat-schedule

42
.flake8 Normal file
View File

@@ -0,0 +1,42 @@
[flake8]
max-line-length = 120
# Following 4 for black compatibility
# E501: line too long
# W503: Line break occurred before a binary operator
# E203: Whitespace before ':'
# D202 No blank lines allowed after function docstring
# TODO fix flake8
# D100 Missing docstring in public module
# D101 Missing docstring in public class
# D102 Missing docstring in public method
# D103 Missing docstring in public function
# D104 Missing docstring in public package
# D105 Missing docstring in magic method
# D107 Missing docstring in __init__
# D200 One-line docstring should fit on one line with quotes
# D205 1 blank line required between summary line and description
# D209 Multi-line docstring closing quotes should be on a separate line
# D400 First line should end with a period
# D401 First line should be in imperative mood
ignore =
E501,
W503,
E203,
D202,
D100,
D101,
D102,
D103,
D104,
D105,
D107,
D200,
D205,
D209,
D400,
D401,
exclude = api_pb2.py

View File

@@ -7,11 +7,16 @@
- [ ] Bugfix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
- [ ] Code quality improvements to existing code or addition of tests
- [ ] Other
**Related issue or feature (if applicable):** fixes <link to issue>
**Related issue or feature (if applicable):**
**Pull request in [esphome-docs](https://github.com/esphome/esphome-docs) with documentation (if applicable):** esphome/esphome-docs#<esphome-docs PR number goes here>
- fixes <link to issue>
**Pull request in [esphome-docs](https://github.com/esphome/esphome-docs) with documentation (if applicable):**
- esphome/esphome-docs#<esphome-docs PR number goes here>
## Test Environment
@@ -23,12 +28,6 @@
- [ ] RTL87xx
## Example entry for `config.yaml`:
<!--
Supplying a configuration snippet, makes it easier for a maintainer to test
your PR. Furthermore, for new integrations, it gives an impression of how
the configuration would look like.
Note: Remove this section if this PR does not have an example entry.
-->
```yaml
# Example config.yaml

View File

@@ -34,16 +34,29 @@ runs:
echo $l >> $GITHUB_OUTPUT
done
# set cache-to only if dev branch
- id: cache-to
shell: bash
run: |-
if [[ "${{ github.ref }}" == "refs/heads/dev" ]]; then
echo "value=type=gha,mode=max" >> $GITHUB_OUTPUT
else
echo "value=" >> $GITHUB_OUTPUT
fi
- name: Build and push to ghcr by digest
id: build-ghcr
uses: docker/build-push-action@v5.3.0
uses: docker/build-push-action@v6.13.0
env:
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false
with:
context: .
file: ./docker/Dockerfile
platforms: ${{ inputs.platform }}
target: ${{ inputs.target }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: ${{ steps.cache-to.outputs.value }}
build-args: |
BASEIMGTYPE=${{ inputs.baseimg }}
BUILD_VERSION=${{ inputs.version }}
@@ -59,14 +72,17 @@ runs:
- name: Build and push to dockerhub by digest
id: build-dockerhub
uses: docker/build-push-action@v5.3.0
uses: docker/build-push-action@v6.13.0
env:
DOCKER_BUILD_SUMMARY: false
DOCKER_BUILD_RECORD_UPLOAD: false
with:
context: .
file: ./docker/Dockerfile
platforms: ${{ inputs.platform }}
target: ${{ inputs.target }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: ${{ steps.cache-to.outputs.value }}
build-args: |
BASEIMGTYPE=${{ inputs.baseimg }}
BUILD_VERSION=${{ inputs.version }}

View File

@@ -17,12 +17,12 @@ runs:
steps:
- name: Set up Python ${{ inputs.python-version }}
id: python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.4.0
with:
python-version: ${{ inputs.python-version }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache/restore@v4.0.2
uses: actions/cache/restore@v4.2.0
with:
path: venv
# yamllint disable-line rule:line-length

View File

@@ -13,6 +13,13 @@ updates:
schedule:
interval: daily
open-pull-requests-limit: 10
groups:
docker-actions:
applies-to: version-updates
patterns:
- "docker/setup-qemu-action"
- "docker/login-action"
- "docker/setup-buildx-action"
- package-ecosystem: github-actions
directory: "/.github/actions/build-image"
schedule:

View File

@@ -21,9 +21,9 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
- name: Set up Python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.4.0
with:
python-version: "3.11"

View File

@@ -37,18 +37,18 @@ jobs:
strategy:
fail-fast: false
matrix:
arch: [amd64, armv7, aarch64]
arch: [amd64, aarch64]
build_type: ["ha-addon", "docker", "lint"]
steps:
- uses: actions/checkout@v4.1.5
- uses: actions/checkout@v4.1.7
- name: Set up Python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.4.0
with:
python-version: "3.9"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.3.0
uses: docker/setup-buildx-action@v3.9.0
- name: Set up QEMU
uses: docker/setup-qemu-action@v3.0.0
uses: docker/setup-qemu-action@v3.4.0
- name: Set TAG
run: |

View File

@@ -9,9 +9,11 @@ on:
paths:
- "**"
- "!.github/workflows/*.yml"
- "!.github/actions/build-image/*"
- ".github/workflows/ci.yml"
- "!.yamllint"
- "!.github/dependabot.yml"
- "!docker/**"
merge_group:
permissions:
@@ -29,23 +31,23 @@ concurrency:
jobs:
common:
name: Create common environment
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
outputs:
cache-key: ${{ steps.cache-key.outputs.key }}
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
- name: Generate cache-key
id: cache-key
run: echo key="${{ hashFiles('requirements.txt', 'requirements_optional.txt', 'requirements_test.txt') }}" >> $GITHUB_OUTPUT
- name: Set up Python ${{ env.DEFAULT_PYTHON }}
id: python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.4.0
with:
python-version: ${{ env.DEFAULT_PYTHON }}
- name: Restore Python virtual environment
id: cache-venv
uses: actions/cache@v4.0.2
uses: actions/cache@v4.2.0
with:
path: venv
# yamllint disable-line rule:line-length
@@ -61,12 +63,12 @@ jobs:
black:
name: Check black
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
- name: Restore Python
uses: ./.github/actions/restore-python
with:
@@ -82,12 +84,12 @@ jobs:
flake8:
name: Check flake8
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
- name: Restore Python
uses: ./.github/actions/restore-python
with:
@@ -103,12 +105,12 @@ jobs:
pylint:
name: Check pylint
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
- name: Restore Python
uses: ./.github/actions/restore-python
with:
@@ -124,12 +126,12 @@ jobs:
pyupgrade:
name: Check pyupgrade
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
- name: Restore Python
uses: ./.github/actions/restore-python
with:
@@ -145,12 +147,12 @@ jobs:
ci-custom:
name: Run script/ci-custom
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
- name: Restore Python
uses: ./.github/actions/restore-python
with:
@@ -199,7 +201,7 @@ jobs:
- common
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
- name: Restore Python
uses: ./.github/actions/restore-python
with:
@@ -218,18 +220,18 @@ jobs:
. venv/bin/activate
pytest -vv --cov-report=xml --tb=native tests
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
token: ${{ secrets.CODECOV_TOKEN }}
clang-format:
name: Check clang-format
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
- name: Restore Python
uses: ./.github/actions/restore-python
with:
@@ -248,75 +250,9 @@ jobs:
run: script/ci-suggest-changes
if: always()
compile-tests-list:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
- name: Find all YAML test files
id: set-matrix
run: echo "matrix=$(ls tests/test*.yaml | jq -R -s -c 'split("\n")[:-1]')" >> $GITHUB_OUTPUT
validate-tests:
name: Validate YAML test ${{ matrix.file }}
runs-on: ubuntu-latest
needs:
- common
- compile-tests-list
strategy:
fail-fast: false
matrix:
file: ${{ fromJson(needs.compile-tests-list.outputs.matrix) }}
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
- name: Restore Python
uses: ./.github/actions/restore-python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache-key: ${{ needs.common.outputs.cache-key }}
- name: Run esphome config ${{ matrix.file }}
run: |
. venv/bin/activate
esphome config ${{ matrix.file }}
compile-tests:
name: Run YAML test ${{ matrix.file }}
runs-on: ubuntu-latest
needs:
- common
- black
- ci-custom
- clang-format
- flake8
- pylint
- pytest
- pyupgrade
- compile-tests-list
- validate-tests
strategy:
fail-fast: false
max-parallel: 2
matrix:
file: ${{ fromJson(needs.compile-tests-list.outputs.matrix) }}
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
- name: Restore Python
uses: ./.github/actions/restore-python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache-key: ${{ needs.common.outputs.cache-key }}
- name: Run esphome compile ${{ matrix.file }}
run: |
. venv/bin/activate
esphome compile ${{ matrix.file }}
clang-tidy:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
- black
@@ -358,27 +294,39 @@ jobs:
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
- name: Restore Python
uses: ./.github/actions/restore-python
with:
python-version: ${{ env.DEFAULT_PYTHON }}
cache-key: ${{ needs.common.outputs.cache-key }}
- name: Cache platformio
uses: actions/cache@v4.0.2
if: github.ref == 'refs/heads/dev'
uses: actions/cache@v4.2.0
with:
path: ~/.platformio
# yamllint disable-line rule:line-length
key: platformio-${{ matrix.pio_cache_key }}-${{ hashFiles('platformio.ini') }}
key: platformio-${{ matrix.pio_cache_key }}
- name: Install clang-tidy
run: sudo apt-get install clang-tidy-14
- name: Cache platformio
if: github.ref != 'refs/heads/dev'
uses: actions/cache/restore@v4.2.0
with:
path: ~/.platformio
key: platformio-${{ matrix.pio_cache_key }}
- name: Register problem matchers
run: |
echo "::add-matcher::.github/workflows/matchers/gcc.json"
echo "::add-matcher::.github/workflows/matchers/clang-tidy.json"
- name: Run 'pio run --list-targets -e esp32-idf-tidy'
if: matrix.name == 'Run script/clang-tidy for ESP32 IDF'
run: |
. venv/bin/activate
mkdir -p .temp
pio run --list-targets -e esp32-idf-tidy
- name: Run clang-tidy
run: |
. venv/bin/activate
@@ -393,7 +341,7 @@ jobs:
if: always()
list-components:
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
if: github.event_name == 'pull_request'
@@ -402,7 +350,7 @@ jobs:
count: ${{ steps.list-components.outputs.count }}
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
with:
# Fetch enough history so `git merge-base refs/remotes/origin/dev HEAD` works.
fetch-depth: 500
@@ -435,7 +383,7 @@ jobs:
test-build-components:
name: Component test ${{ matrix.file }}
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
- list-components
@@ -446,11 +394,13 @@ jobs:
matrix:
file: ${{ fromJson(needs.list-components.outputs.components) }}
steps:
- name: Install libsodium
run: sudo apt-get install libsodium-dev
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libsdl2-dev
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
- name: Restore Python
uses: ./.github/actions/restore-python
with:
@@ -467,7 +417,7 @@ jobs:
test-build-components-splitter:
name: Split components for testing into 20 groups maximum
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
- list-components
@@ -476,7 +426,7 @@ jobs:
matrix: ${{ steps.split.outputs.components }}
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
- name: Split components into 20 groups
id: split
run: |
@@ -485,7 +435,7 @@ jobs:
test-build-components-split:
name: Test split components
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
- list-components
@@ -500,11 +450,13 @@ jobs:
- name: List components
run: echo ${{ matrix.components }}
- name: Install libsodium
run: sudo apt-get install libsodium-dev
- name: Install dependencies
run: |
sudo apt-get update
sudo apt-get install libsdl2-dev
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
- name: Restore Python
uses: ./.github/actions/restore-python
with:
@@ -519,13 +471,15 @@ jobs:
- name: Compile config
run: |
. venv/bin/activate
mkdir build_cache
export PLATFORMIO_BUILD_CACHE_DIR=$PWD/build_cache
for component in ${{ matrix.components }}; do
./script/test_build_components -e compile -c $component
done
ci-status:
name: CI Status
runs-on: ubuntu-latest
runs-on: ubuntu-24.04
needs:
- common
- black
@@ -535,7 +489,6 @@ jobs:
- pylint
- pytest
- pyupgrade
- compile-tests
- clang-tidy
- list-components
- test-build-components

91
.github/workflows/codeql.yml vendored Normal file
View File

@@ -0,0 +1,91 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL Advanced"
on:
workflow_dispatch:
schedule:
- cron: "30 18 * * 4"
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
# - language: c-cpp
# build-mode: autobuild
- language: python
build-mode: none
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"

View File

@@ -19,7 +19,7 @@ jobs:
tag: ${{ steps.tag.outputs.tag }}
branch_build: ${{ steps.tag.outputs.branch_build }}
steps:
- uses: actions/checkout@v4.1.5
- uses: actions/checkout@v4.1.7
- name: Get tag
id: tag
# yamllint disable rule:line-length
@@ -51,9 +51,9 @@ jobs:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4.1.5
- uses: actions/checkout@v4.1.7
- name: Set up Python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.4.0
with:
python-version: "3.x"
- name: Set up python environment
@@ -61,9 +61,11 @@ jobs:
ESPHOME_NO_VENV: 1
run: script/setup
- name: Build
run: python setup.py sdist bdist_wheel
run: |-
pip3 install build
python3 -m build
- name: Publish
uses: pypa/gh-action-pypi-publish@v1.8.14
uses: pypa/gh-action-pypi-publish@v1.12.4
deploy-docker:
name: Build ESPHome ${{ matrix.platform }}
@@ -78,28 +80,27 @@ jobs:
matrix:
platform:
- linux/amd64
- linux/arm/v7
- linux/arm64
steps:
- uses: actions/checkout@v4.1.5
- uses: actions/checkout@v4.1.7
- name: Set up Python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.4.0
with:
python-version: "3.9"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.3.0
uses: docker/setup-buildx-action@v3.9.0
- name: Set up QEMU
if: matrix.platform != 'linux/amd64'
uses: docker/setup-qemu-action@v3.0.0
uses: docker/setup-qemu-action@v3.4.0
- name: Log in to docker hub
uses: docker/login-action@v3.1.0
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the GitHub container registry
uses: docker/login-action@v3.1.0
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}
@@ -132,10 +133,16 @@ jobs:
suffix: lint
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
uses: actions/upload-artifact@v4.3.3
uses: actions/upload-artifact@v4.6.0
with:
name: digests-${{ matrix.platform }}
name: digests-${{ steps.sanitize.outputs.name }}
path: /tmp/digests
retention-days: 1
@@ -166,27 +173,27 @@ jobs:
- ghcr
- dockerhub
steps:
- uses: actions/checkout@v4.1.5
- uses: actions/checkout@v4.1.7
- name: Download digests
uses: actions/download-artifact@v4.1.7
uses: actions/download-artifact@v4.1.8
with:
pattern: digests-*
path: /tmp/digests
merge-multiple: true
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3.3.0
uses: docker/setup-buildx-action@v3.9.0
- name: Log in to docker hub
if: matrix.registry == 'dockerhub'
uses: docker/login-action@v3.1.0
uses: docker/login-action@v3.3.0
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the GitHub container registry
if: matrix.registry == 'ghcr'
uses: docker/login-action@v3.1.0
uses: docker/login-action@v3.3.0
with:
registry: ghcr.io
username: ${{ github.actor }}

View File

@@ -17,7 +17,7 @@ jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9.0.0
- uses: actions/stale@v9.1.0
with:
days-before-pr-stale: 90
days-before-pr-close: 7
@@ -37,7 +37,7 @@ jobs:
close-issues:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v9.0.0
- uses: actions/stale@v9.1.0
with:
days-before-pr-stale: -1
days-before-pr-close: -1

View File

@@ -13,16 +13,16 @@ jobs:
if: github.repository == 'esphome/esphome'
steps:
- name: Checkout
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
- name: Checkout Home Assistant
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
with:
repository: home-assistant/core
path: lib/home-assistant
- name: Setup Python
uses: actions/setup-python@v5.1.0
uses: actions/setup-python@v5.4.0
with:
python-version: 3.12
@@ -36,7 +36,7 @@ jobs:
python ./script/sync-device_class.py
- name: Commit changes
uses: peter-evans/create-pull-request@v6.0.4
uses: peter-evans/create-pull-request@v7.0.6
with:
commit-message: "Synchronise Device Classes from Home Assistant"
committer: esphomebot <esphome@nabucasa.com>

View File

@@ -18,7 +18,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Check out code from GitHub
uses: actions/checkout@v4.1.5
uses: actions/checkout@v4.1.7
- name: Run yamllint
uses: frenck/action-yamllint@v1.5.0
with:

5
.gitignore vendored
View File

@@ -75,6 +75,9 @@ cov.xml
# pyenv
.python-version
# asdf
.tool-versions
# Environments
.env
.venv
@@ -138,3 +141,5 @@ sdkconfig.*
.tests/
/components
/managed_components

View File

@@ -2,14 +2,15 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: 24.2.0
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.5.4
hooks:
- id: black
args:
- --safe
- --quiet
files: ^((esphome|script|tests)/.+)?[^/]+\.py$
# Run the linter.
- id: ruff
args: [--fix]
# Run the formatter.
- id: ruff-format
- repo: https://github.com/PyCQA/flake8
rev: 6.1.0
hooks:
@@ -40,3 +41,10 @@ repos:
hooks:
- id: clang-format
types_or: [c, c++]
- repo: local
hooks:
- id: pylint
name: pylint
entry: python3 script/run-in-env.py pylint
language: system
types: [python]

View File

@@ -6,7 +6,7 @@
# the integration's code owner is automatically notified.
# Core Code
setup.py @esphome/core
pyproject.toml @esphome/core
esphome/*.py @esphome/core
esphome/core/* @esphome/core
@@ -24,6 +24,7 @@ esphome/components/ade7953_i2c/* @angelnu
esphome/components/ade7953_spi/* @angelnu
esphome/components/ads1118/* @solomondg1
esphome/components/ags10/* @mak-42
esphome/components/aic3204/* @kbx81
esphome/components/airthings_ble/* @jeromelaban
esphome/components/airthings_wave_base/* @jeromelaban @kpfleming @ncareau
esphome/components/airthings_wave_mini/* @ncareau
@@ -37,6 +38,7 @@ esphome/components/am43/sensor/* @buxtronix
esphome/components/analog_threshold/* @ianchi
esphome/components/animation/* @syndlex
esphome/components/anova/* @buxtronix
esphome/components/apds9306/* @aodrenah
esphome/components/api/* @OttoWinter
esphome/components/as5600/* @ammmze
esphome/components/as5600/sensor/* @ammmze
@@ -45,24 +47,37 @@ esphome/components/async_tcp/* @OttoWinter
esphome/components/at581x/* @X-Ryl669
esphome/components/atc_mithermometer/* @ahpohl
esphome/components/atm90e26/* @danieltwagner
esphome/components/atm90e32/* @circuitsetup @descipher
esphome/components/audio/* @kahrendt
esphome/components/audio_adc/* @kbx81
esphome/components/audio_dac/* @kbx81
esphome/components/axs15231/* @clydebarrow
esphome/components/b_parasite/* @rbaron
esphome/components/ballu/* @bazuchan
esphome/components/bang_bang/* @OttoWinter
esphome/components/bedjet/* @jhansche
esphome/components/bedjet/climate/* @jhansche
esphome/components/bedjet/fan/* @jhansche
esphome/components/bedjet/sensor/* @javawizard @jhansche
esphome/components/beken_spi_led_strip/* @Mat931
esphome/components/bh1750/* @OttoWinter
esphome/components/binary_sensor/* @esphome/core
esphome/components/bk72xx/* @kuba2k2
esphome/components/bl0906/* @athom-tech @jesserockz @tarontop
esphome/components/bl0939/* @ziceva
esphome/components/bl0940/* @tobias-
esphome/components/bl0942/* @dbuezas
esphome/components/bl0942/* @dbuezas @dwmw2
esphome/components/ble_client/* @buxtronix @clydebarrow
esphome/components/bluetooth_proxy/* @jesserockz
esphome/components/bme280_base/* @esphome/core
esphome/components/bme280_spi/* @apbodrov
esphome/components/bme680_bsec/* @trvrnrth
esphome/components/bme68x_bsec2/* @kbx81 @neffs
esphome/components/bme68x_bsec2_i2c/* @kbx81 @neffs
esphome/components/bmi160/* @flaviut
esphome/components/bmp280_base/* @ademuri
esphome/components/bmp280_i2c/* @ademuri
esphome/components/bmp280_spi/* @ademuri
esphome/components/bmp3xx/* @latonita
esphome/components/bmp3xx_base/* @latonita @martgras
esphome/components/bmp3xx_i2c/* @latonita
@@ -71,11 +86,13 @@ esphome/components/bmp581/* @kahrendt
esphome/components/bp1658cj/* @Cossid
esphome/components/bp5758d/* @Cossid
esphome/components/button/* @esphome/core
esphome/components/bytebuffer/* @clydebarrow
esphome/components/canbus/* @danielschramm @mvturnho
esphome/components/cap1188/* @mreditor97
esphome/components/captive_portal/* @OttoWinter
esphome/components/ccs811/* @habbie
esphome/components/cd74hc4067/* @asoehlke
esphome/components/ch422g/* @clydebarrow @jesterret
esphome/components/climate/* @esphome/core
esphome/components/climate_ir/* @glmnet
esphome/components/color_temperature/* @jesserockz
@@ -92,6 +109,7 @@ esphome/components/current_based/* @djwmarcx
esphome/components/dac7678/* @NickB1
esphome/components/daikin_arc/* @MagicBear
esphome/components/daikin_brc/* @hagak
esphome/components/dallas_temp/* @ssieb
esphome/components/daly_bms/* @s1lvi0
esphome/components/dashboard_import/* @esphome/core
esphome/components/datetime/* @jesserockz @rfdarter
@@ -109,8 +127,15 @@ esphome/components/ee895/* @Stock-M
esphome/components/ektf2232/touchscreen/* @jesserockz
esphome/components/emc2101/* @ellull
esphome/components/emmeti/* @E440QF
esphome/components/ens160/* @vincentscode
esphome/components/ens160/* @latonita
esphome/components/ens160_base/* @latonita @vincentscode
esphome/components/ens160_i2c/* @latonita
esphome/components/ens160_spi/* @latonita
esphome/components/ens210/* @itn3rd77
esphome/components/es7210/* @kahrendt
esphome/components/es7243e/* @kbx81
esphome/components/es8156/* @kbx81
esphome/components/es8311/* @kahrendt @kroimon
esphome/components/esp32/* @esphome/core
esphome/components/esp32_ble/* @Rapsssito @jesserockz
esphome/components/esp32_ble_client/* @jesserockz
@@ -123,6 +148,7 @@ esphome/components/esp32_rmt_led_strip/* @jesserockz
esphome/components/esp8266/* @esphome/core
esphome/components/ethernet_info/* @gtjadsonsantos
esphome/components/event/* @nohat
esphome/components/event_emitter/* @Rapsssito
esphome/components/exposure_notifications/* @OttoWinter
esphome/components/ezo/* @ssieb
esphome/components/ezo_pmp/* @carlos-sarmiento
@@ -135,45 +161,65 @@ esphome/components/fs3000/* @kahrendt
esphome/components/ft5x06/* @clydebarrow
esphome/components/ft63x6/* @gpambrozio
esphome/components/gcja5/* @gcormier
esphome/components/gdk101/* @Szewcson
esphome/components/globals/* @esphome/core
esphome/components/gp2y1010au0f/* @zry98
esphome/components/gp8403/* @jesserockz
esphome/components/gpio/* @esphome/core
esphome/components/gpio/one_wire/* @ssieb
esphome/components/gps/* @coogle
esphome/components/graph/* @synco
esphome/components/graphical_display_menu/* @MrMDavidson
esphome/components/gree/* @orestismers
esphome/components/grove_gas_mc_v2/* @YorkshireIoT
esphome/components/grove_tb6612fng/* @max246
esphome/components/growatt_solar/* @leeuwte
esphome/components/gt911/* @clydebarrow @jesserockz
esphome/components/haier/* @paveldn
esphome/components/haier/binary_sensor/* @paveldn
esphome/components/haier/button/* @paveldn
esphome/components/haier/sensor/* @paveldn
esphome/components/haier/switch/* @paveldn
esphome/components/haier/text_sensor/* @paveldn
esphome/components/havells_solar/* @sourabhjaiswal
esphome/components/hbridge/fan/* @WeekendWarrior
esphome/components/hbridge/light/* @DotNetDann
esphome/components/hbridge/switch/* @dwmw2
esphome/components/he60r/* @clydebarrow
esphome/components/heatpumpir/* @rob-deutsch
esphome/components/hitachi_ac424/* @sourabhjaiswal
esphome/components/hm3301/* @freekode
esphome/components/homeassistant/* @OttoWinter
esphome/components/hmac_md5/* @dwmw2
esphome/components/homeassistant/* @OttoWinter @esphome/core
esphome/components/homeassistant/number/* @landonr
esphome/components/homeassistant/switch/* @Links2004
esphome/components/honeywell_hih_i2c/* @Benichou34
esphome/components/honeywellabp/* @RubyBailey
esphome/components/honeywellabp2_i2c/* @jpfaff
esphome/components/host/* @esphome/core
esphome/components/host/* @clydebarrow @esphome/core
esphome/components/host/time/* @clydebarrow
esphome/components/hrxl_maxsonar_wr/* @netmikey
esphome/components/hte501/* @Stock-M
esphome/components/http_request/ota/* @oarcher
esphome/components/http_request/update/* @jesserockz
esphome/components/htu31d/* @betterengineering
esphome/components/hydreon_rgxx/* @functionpointer
esphome/components/hyt271/* @Philippe12
esphome/components/i2c/* @esphome/core
esphome/components/i2c_device/* @gabest11
esphome/components/i2s_audio/* @jesserockz
esphome/components/i2s_audio/media_player/* @jesserockz
esphome/components/i2s_audio/microphone/* @jesserockz
esphome/components/i2s_audio/speaker/* @jesserockz
esphome/components/i2s_audio/speaker/* @jesserockz @kahrendt
esphome/components/iaqcore/* @yozik04
esphome/components/ili9xxx/* @clydebarrow @nielsnl68
esphome/components/improv_base/* @esphome/core
esphome/components/improv_serial/* @esphome/core
esphome/components/ina226/* @Sergio303 @latonita
esphome/components/ina260/* @mreditor97
esphome/components/ina2xx_base/* @latonita
esphome/components/ina2xx_i2c/* @latonita
esphome/components/ina2xx_spi/* @latonita
esphome/components/inkbird_ibsth1_mini/* @fkirill
esphome/components/inkplate6/* @jesserockz
esphome/components/integration/* @OttoWinter
@@ -196,8 +242,14 @@ esphome/components/lightwaverf/* @max246
esphome/components/lilygo_t5_47/touchscreen/* @jesserockz
esphome/components/lock/* @esphome/core
esphome/components/logger/* @esphome/core
esphome/components/ltr390/* @sjtrny
esphome/components/logger/select/* @clydebarrow
esphome/components/ltr390/* @latonita @sjtrny
esphome/components/ltr501/* @latonita
esphome/components/ltr_als_ps/* @latonita
esphome/components/lvgl/* @clydebarrow
esphome/components/m5stack_8angle/* @rnauber
esphome/components/matrix_keypad/* @ssieb
esphome/components/max17043/* @blacknell
esphome/components/max31865/* @DAVe3283
esphome/components/max44009/* @berfenger
esphome/components/max6956/* @looping40
@@ -226,6 +278,7 @@ esphome/components/mics_4514/* @jesserockz
esphome/components/midea/* @dudanov
esphome/components/midea_ir/* @dudanov
esphome/components/mitsubishi/* @RubyBailey
esphome/components/mixer/speaker/* @kahrendt
esphome/components/mlx90393/* @functionpointer
esphome/components/mlx90614/* @jesserockz
esphome/components/mmc5603/* @benhoff
@@ -244,6 +297,7 @@ esphome/components/mopeka_std_check/* @Fabian-Schmidt
esphome/components/mpl3115a2/* @kbickar
esphome/components/mpu6886/* @fabaff
esphome/components/ms8607/* @e28eta
esphome/components/nau7802/* @cujomalainey
esphome/components/network/* @esphome/core
esphome/components/nextion/* @edwardtfn @senexcrenshaw
esphome/components/nextion/binary_sensor/* @senexcrenshaw
@@ -252,7 +306,11 @@ esphome/components/nextion/switch/* @senexcrenshaw
esphome/components/nextion/text_sensor/* @senexcrenshaw
esphome/components/nfc/* @jesserockz @kbx81
esphome/components/noblex/* @AGalfra
esphome/components/npi19/* @bakerkj
esphome/components/number/* @esphome/core
esphome/components/one_wire/* @ssieb
esphome/components/online_image/* @clydebarrow @guillempages
esphome/components/opentherm/* @olegtarasov
esphome/components/ota/* @esphome/core
esphome/components/output/* @esphome/core
esphome/components/pca6416a/* @Mat931
@@ -280,14 +338,14 @@ esphome/components/pvvx_mithermometer/* @pasiz
esphome/components/pylontech/* @functionpointer
esphome/components/qmp6988/* @andrewpc
esphome/components/qr_code/* @wjtje
esphome/components/qspi_amoled/* @clydebarrow
esphome/components/qspi_dbi/* @clydebarrow
esphome/components/qwiic_pir/* @kahrendt
esphome/components/radon_eye_ble/* @jeffeb3
esphome/components/radon_eye_rd200/* @jeffeb3
esphome/components/rc522/* @glmnet
esphome/components/rc522_i2c/* @glmnet
esphome/components/rc522_spi/* @glmnet
esphome/components/resistance_sampler/* @jesserockz
esphome/components/resampler/speaker/* @kahrendt
esphome/components/restart/* @esphome/core
esphome/components/rf_bridge/* @jesserockz
esphome/components/rgbct/* @jesserockz
@@ -297,12 +355,15 @@ esphome/components/rp2040_pwm/* @jesserockz
esphome/components/rpi_dpi_rgb/* @clydebarrow
esphome/components/rtl87xx/* @kuba2k2
esphome/components/rtttl/* @glmnet
esphome/components/safe_mode/* @jsuanet @paulmonigatti
esphome/components/safe_mode/* @jsuanet @kbx81 @paulmonigatti
esphome/components/scd4x/* @martgras @sjtrny
esphome/components/script/* @esphome/core
esphome/components/sdl/* @bdm310 @clydebarrow
esphome/components/sdm_meter/* @jesserockz @polyfaces
esphome/components/sdp3x/* @Azimath
esphome/components/seeed_mr24hpc1/* @limengdu
esphome/components/seeed_mr60bha2/* @limengdu
esphome/components/seeed_mr60fda2/* @limengdu
esphome/components/selec_meter/* @sourabhjaiswal
esphome/components/select/* @esphome/core
esphome/components/sen0321/* @notjj
@@ -328,7 +389,8 @@ esphome/components/smt100/* @piechade
esphome/components/sn74hc165/* @jesserockz
esphome/components/socket/* @esphome/core
esphome/components/sonoff_d1/* @anatoly-savchenkov
esphome/components/speaker/* @jesserockz
esphome/components/speaker/* @jesserockz @kahrendt
esphome/components/speaker/media_player/* @kahrendt @synesthesiam
esphome/components/spi/* @clydebarrow @esphome/core
esphome/components/spi_device/* @clydebarrow
esphome/components/spi_led_strip/* @clydebarrow
@@ -352,15 +414,20 @@ esphome/components/st7701s/* @clydebarrow
esphome/components/st7735/* @SenexCrenshaw
esphome/components/st7789v/* @kbx81
esphome/components/st7920/* @marsjan155
esphome/components/statsd/* @Links2004
esphome/components/substitutions/* @esphome/core
esphome/components/sun/* @OttoWinter
esphome/components/sun_gtil2/* @Mat931
esphome/components/switch/* @esphome/core
esphome/components/switch/binary_sensor/* @ssieb
esphome/components/t6615/* @tylermenezes
esphome/components/tc74/* @sethgirvan
esphome/components/tca9548a/* @andreashergert1984
esphome/components/tca9555/* @mobrembski
esphome/components/tcl112/* @glmnet
esphome/components/tee501/* @Stock-M
esphome/components/teleinfo/* @0hax
esphome/components/tem3200/* @bakerkj
esphome/components/template/alarm_control_panel/* @grahambrown11 @hwstar
esphome/components/template/datetime/* @rfdarter
esphome/components/template/event/* @nohat
@@ -391,9 +458,11 @@ esphome/components/tuya/switch/* @jesserockz
esphome/components/tuya/text_sensor/* @dentra
esphome/components/uart/* @esphome/core
esphome/components/uart/button/* @ssieb
esphome/components/udp/* @clydebarrow
esphome/components/ufire_ec/* @pvizeli
esphome/components/ufire_ise/* @pvizeli
esphome/components/ultrasonic/* @OttoWinter
esphome/components/update/* @jesserockz
esphome/components/uponor_smatrix/* @kroimon
esphome/components/valve/* @esphome/core
esphome/components/vbus/* @ssieb
@@ -401,7 +470,8 @@ esphome/components/veml3235/* @kbx81
esphome/components/veml7700/* @latonita
esphome/components/version/* @esphome/core
esphome/components/voice_assistant/* @jesserockz
esphome/components/wake_on_lan/* @willwill2will54
esphome/components/wake_on_lan/* @clydebarrow @willwill2will54
esphome/components/watchdog/* @oarcher
esphome/components/waveshare_epaper/* @clydebarrow
esphome/components/web_server_base/* @OttoWinter
esphome/components/web_server_idf/* @dentra
@@ -424,11 +494,13 @@ esphome/components/wl_134/* @hobbypunk90
esphome/components/x9c/* @EtienneMD
esphome/components/xgzp68xx/* @gcormier
esphome/components/xiaomi_hhccjcy10/* @fariouche
esphome/components/xiaomi_lywsd02mmc/* @juanluss31
esphome/components/xiaomi_lywsd03mmc/* @ahpohl
esphome/components/xiaomi_mhoc303/* @drug123
esphome/components/xiaomi_mhoc401/* @vevsvevs
esphome/components/xiaomi_rtcgq02lm/* @jesserockz
esphome/components/xl9535/* @mreditor97
esphome/components/xpt2046/touchscreen/* @nielsnl68 @numo68
esphome/components/xxtea/* @clydebarrow
esphome/components/zhlt01/* @cfeenstra1024
esphome/components/zio_ultrasonic/* @kahrendt

View File

@@ -1,12 +1,14 @@
# Contributing to ESPHome
# Contributing to ESPHome [![Discord Chat](https://img.shields.io/discord/429907082951524364.svg)](https://discord.gg/KhAMKrd) [![GitHub release](https://img.shields.io/github/release/esphome/esphome.svg)](https://GitHub.com/esphome/esphome/releases/)
For a detailed guide, please see https://esphome.io/guides/contributing.html#contributing-to-esphome
We welcome contributions to the ESPHome suite of code and documentation!
Things to note when contributing:
Please read our [contributing guide](https://esphome.io/guides/contributing.html) if you wish to contribute to the
project and be sure to join us on [Discord](https://discord.gg/KhAMKrd).
- Please test your changes :)
- If a new feature is added or an existing user-facing feature is changed, you should also
update the [docs](https://github.com/esphome/esphome-docs). See [contributing to esphome-docs](https://esphome.io/guides/contributing.html#contributing-to-esphomedocs)
for more information.
- Please also update the tests in the `tests/` folder. You can do so by just adding a line in one of the YAML files
which checks if your new feature compiles correctly.
**See also:**
[Documentation](https://esphome.io) -- [Issues](https://github.com/esphome/issues/issues) -- [Feature requests](https://github.com/esphome/feature-requests/issues)
---
[![ESPHome - A project from the Open Home Foundation](https://www.openhomefoundation.org/badges/esphome.png)](https://www.openhomefoundation.org/)

View File

@@ -1,9 +1,16 @@
# ESPHome [![Discord Chat](https://img.shields.io/discord/429907082951524364.svg)](https://discord.gg/KhAMKrd) [![GitHub release](https://img.shields.io/github/release/esphome/esphome.svg)](https://GitHub.com/esphome/esphome/releases/)
[![ESPHome Logo](https://esphome.io/_images/logo-text.png)](https://esphome.io/)
<a href="https://esphome.io/">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://esphome.io/_static/logo-text-on-dark.svg", alt="ESPHome Logo">
<img src="https://esphome.io/_static/logo-text-on-light.svg" alt="ESPHome Logo">
</picture>
</a>
**Documentation:** https://esphome.io/
---
For issues, please go to [the issue tracker](https://github.com/esphome/issues/issues).
[Documentation](https://esphome.io) -- [Issues](https://github.com/esphome/issues/issues) -- [Feature requests](https://github.com/esphome/feature-requests/issues)
For feature requests, please see [feature requests](https://github.com/esphome/feature-requests/issues).
---
[![ESPHome - A project from the Open Home Foundation](https://www.openhomefoundation.org/badges/esphome.png)](https://www.openhomefoundation.org/)

View File

@@ -29,33 +29,18 @@ RUN \
# Use pinned versions so that we get updates with build caching
&& apt-get install -y --no-install-recommends \
python3-pip=23.0.1+dfsg-1 \
python3-setuptools=66.1.1-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 \
git=1:2.39.2-1.1 \
curl=7.88.1-10+deb12u5 \
openssh-client=1:9.2p1-2+deb12u2 \
iputils-ping=3:20221126-1+deb12u1 \
git=1:2.39.5-0+deb12u1 \
curl=7.88.1-10+deb12u8 \
openssh-client=1:9.2p1-2+deb12u4 \
python3-cffi=1.15.1-5 \
libcairo2=1.16.0-7 \
libmagic1=1:5.44-3 \
patch=2.7.6-7; \
if [ "$TARGETARCH$TARGETVARIANT" = "armv7" ]; then \
apt-get install -y --no-install-recommends \
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 \
libssl-dev=3.0.11-1~deb12u2 \
libffi-dev=3.4.4-1 \
libopenjp2-7=2.5.0-2 \
libtiff6=4.5.0-6+deb12u1 \
cargo=0.66.0+ds1-1 \
pkg-config=1.8.1-1 \
gcc-arm-linux-gnueabihf=4:12.2.0-3; \
fi; \
rm -rf \
patch=2.7.6-7 \
&& rm -rf \
/tmp/* \
/var/{cache,log}/* \
/var/lib/apt/lists/*
@@ -66,22 +51,11 @@ ENV \
# Store globally installed pio libs in /piolibs
PLATFORMIO_GLOBALLIB_DIR=/piolibs
# Support legacy binaries on Debian multiarch system. There is no "correct" way
# to do this, other than using properly built toolchains...
# See: https://unix.stackexchange.com/questions/553743/correct-way-to-add-lib-ld-linux-so-3-in-debian
RUN \
if [ "$TARGETARCH$TARGETVARIANT" = "armv7" ]; then \
ln -s /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3 /lib/ld-linux.so.3; \
fi
RUN \
# Ubuntu python3-pip is missing wheel
if [ "$TARGETARCH$TARGETVARIANT" = "armv7" ]; then \
export PIP_EXTRA_INDEX_URL="https://www.piwheels.org/simple"; \
fi; \
pip3 install \
--break-system-packages --no-cache-dir \
platformio==6.1.13 \
# 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 \
@@ -91,14 +65,49 @@ RUN \
# 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 script/platformio_install_deps.py platformio.ini /
RUN --mount=type=tmpfs,target=/root/.cargo if [ "$TARGETARCH$TARGETVARIANT" = "armv7" ]; then \
export PIP_EXTRA_INDEX_URL="https://www.piwheels.org/simple"; \
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 \
&& /platformio_install_deps.py /platformio.ini --libraries
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+deb12u3
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
"
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 /
RUN /platformio_install_deps.py /platformio.ini --libraries
# Avoid unsafe git error when container user and file config volume permissions don't match
RUN git config --system --add safe.directory '*'
# ======================= docker-type image =======================
@@ -106,11 +115,7 @@ FROM base AS docker
# Copy esphome and install
COPY . /esphome
RUN if [ "$TARGETARCH$TARGETVARIANT" = "armv7" ]; then \
export PIP_EXTRA_INDEX_URL="https://www.piwheels.org/simple"; \
fi; \
pip3 install \
--break-system-packages --no-cache-dir --no-use-pep517 -e /esphome
RUN pip3 install --break-system-packages --no-cache-dir -e /esphome
# Settings for dashboard
ENV USERNAME="" PASSWORD=""
@@ -134,6 +139,18 @@ ENTRYPOINT ["/entrypoint.sh"]
CMD ["dashboard", "/config"]
ARG BUILD_VERSION=dev
# 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 =======================
@@ -156,16 +173,12 @@ COPY docker/ha-addon-rootfs/ /
# Copy esphome and install
COPY . /esphome
RUN if [ "$TARGETARCH$TARGETVARIANT" = "armv7" ]; then \
export PIP_EXTRA_INDEX_URL="https://www.piwheels.org/simple"; \
fi; \
pip3 install \
--break-system-packages --no-cache-dir --no-use-pep517 -e /esphome
RUN pip3 install --break-system-packages --no-cache-dir -e /esphome
# Labels
LABEL \
io.hass.name="ESPHome" \
io.hass.description="Manage and program ESP8266/ESP32 microcontrollers through YAML configuration files" \
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.type="addon" \
io.hass.version="${BUILD_VERSION}"
# io.hass.arch is inherited from addon-debian-base
@@ -180,27 +193,25 @@ ENV \
PLATFORMIO_CORE_DIR=/esphome/.temp/platformio
RUN \
apt-get update \
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 \
clang-tidy-14=1:14.0.6-12 \
patch=2.7.6-7 \
software-properties-common=0.99.30-4 \
nano=7.2-1 \
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 if [ "$TARGETARCH$TARGETVARIANT" = "armv7" ]; then \
export PIP_EXTRA_INDEX_URL="https://www.piwheels.org/simple"; \
fi; \
pip3 install \
--break-system-packages --no-cache-dir -r /requirements_test.txt
RUN pip3 install --break-system-packages --no-cache-dir -r /requirements_test.txt
VOLUME ["/esphome"]
WORKDIR /esphome

View File

@@ -1,22 +1,19 @@
#!/usr/bin/env python3
from dataclasses import dataclass
import subprocess
import argparse
from platform import machine
import shlex
from dataclasses import dataclass
import re
import shlex
import subprocess
import sys
CHANNEL_DEV = "dev"
CHANNEL_BETA = "beta"
CHANNEL_RELEASE = "release"
CHANNELS = [CHANNEL_DEV, CHANNEL_BETA, CHANNEL_RELEASE]
ARCH_AMD64 = "amd64"
ARCH_ARMV7 = "armv7"
ARCH_AARCH64 = "aarch64"
ARCHS = [ARCH_AMD64, ARCH_ARMV7, ARCH_AARCH64]
ARCHS = [ARCH_AMD64, ARCH_AARCH64]
TYPE_DOCKER = "docker"
TYPE_HA_ADDON = "ha-addon"
@@ -76,7 +73,6 @@ class DockerParams:
}[build_type]
platform = {
ARCH_AMD64: "linux/amd64",
ARCH_ARMV7: "linux/arm/v7",
ARCH_AARCH64: "linux/arm64",
}[arch]
target = {

View File

@@ -1,4 +1,4 @@
#!/bin/bash
#!/usr/bin/env bash
# If /cache is mounted, use that as PIO's coredir
# otherwise use path in /config (so that PIO packages aren't downloaded on each compile)

View File

@@ -1,12 +1,12 @@
# PYTHON_ARGCOMPLETE_OK
import argparse
from datetime import datetime
import functools
import logging
import os
import re
import sys
import time
from datetime import datetime
import argcomplete
@@ -18,34 +18,38 @@ from esphome.const import (
CONF_BAUD_RATE,
CONF_BROKER,
CONF_DEASSERT_RTS_DTR,
CONF_DISABLED,
CONF_ESPHOME,
CONF_LEVEL,
CONF_LOG_TOPIC,
CONF_LOGGER,
CONF_MDNS,
CONF_MQTT,
CONF_NAME,
CONF_OTA,
CONF_MQTT,
CONF_MDNS,
CONF_DISABLED,
CONF_PASSWORD,
CONF_PORT,
CONF_ESPHOME,
CONF_PLATFORM,
CONF_PLATFORMIO_OPTIONS,
CONF_PORT,
CONF_SUBSTITUTIONS,
CONF_TOPIC,
PLATFORM_BK72XX,
PLATFORM_RTL87XX,
PLATFORM_ESP32,
PLATFORM_ESP8266,
PLATFORM_RP2040,
PLATFORM_RTL87XX,
SECRETS_FILES,
)
from esphome.core import CORE, EsphomeError, coroutine
from esphome.helpers import 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.util import (
get_serial_ports,
list_yaml_files,
run_external_command,
run_external_process,
safe_print,
list_yaml_files,
get_serial_ports,
)
from esphome.log import color, setup_log, Fore
_LOGGER = logging.getLogger(__name__)
@@ -65,7 +69,7 @@ def choose_prompt(options, purpose: str = None):
f'Found multiple options{f" for {purpose}" if purpose else ""}, please choose one:'
)
for i, (desc, _) in enumerate(options):
safe_print(f" [{i+1}] {desc}")
safe_print(f" [{i + 1}] {desc}")
while True:
opt = input("(number): ")
@@ -94,8 +98,12 @@ def choose_upload_log_host(
options.append((f"Over The Air ({CORE.address})", CORE.address))
if default == "OTA":
return CORE.address
if show_mqtt and CONF_MQTT in CORE.config:
options.append((f"MQTT ({CORE.config['mqtt'][CONF_BROKER]})", "MQTT"))
if (
show_mqtt
and (mqtt_config := CORE.config.get(CONF_MQTT))
and mqtt_logging_enabled(mqtt_config)
):
options.append((f"MQTT ({mqtt_config[CONF_BROKER]})", "MQTT"))
if default == "OTA":
return "MQTT"
if default is not None:
@@ -105,6 +113,17 @@ def choose_upload_log_host(
return choose_prompt(options, purpose=purpose)
def mqtt_logging_enabled(mqtt_config):
log_topic = mqtt_config[CONF_LOG_TOPIC]
if log_topic is None:
return False
if CONF_TOPIC not in log_topic:
return False
if log_topic.get(CONF_LEVEL, None) == "NONE":
return False
return True
def get_port_type(port):
if port.startswith("/") or port.startswith("COM"):
return "SERIAL"
@@ -115,6 +134,7 @@ def get_port_type(port):
def run_miniterm(config, port):
import serial
from esphome import platformio_api
if CONF_LOGGER not in config:
@@ -330,23 +350,27 @@ def upload_program(config, args, host):
return 1 # Unknown target platform
if CONF_OTA not in config:
ota_conf = {}
for ota_item in config.get(CONF_OTA, []):
if ota_item[CONF_PLATFORM] == CONF_ESPHOME:
ota_conf = ota_item
break
if not ota_conf:
raise EsphomeError(
"Cannot upload Over the Air as the config does not include the ota: "
"component"
f"Cannot upload Over the Air as the {CONF_OTA} configuration is not present or does not include {CONF_PLATFORM}: {CONF_ESPHOME}"
)
from esphome import espota2
ota_conf = config[CONF_OTA]
remote_port = ota_conf[CONF_PORT]
remote_port = int(ota_conf[CONF_PORT])
password = ota_conf.get(CONF_PASSWORD, "")
if (
not is_ip_address(CORE.address) # 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 == "MQTT")
and (not args.device or args.device in ("MQTT", "OTA"))
):
from esphome import mqtt
@@ -372,7 +396,7 @@ def show_logs(config, args, port):
port = mqtt.get_esphome_device_ip(
config, args.username, args.password, args.client_id
)
)[0]
from esphome.components.api.client import run_logs
@@ -483,6 +507,15 @@ def command_run(args, config):
if exit_code != 0:
return exit_code
_LOGGER.info("Successfully compiled program.")
if CORE.is_host:
from esphome.platformio_api import get_idedata
idedata = get_idedata(config)
if idedata is None:
return 1
program_path = idedata.raw["prog_path"]
return run_external_process(program_path)
port = choose_upload_log_host(
default=args.device,
check_default=None,
@@ -582,9 +615,10 @@ def command_update_all(args):
def command_idedata(args, config):
from esphome import platformio_api
import json
from esphome import platformio_api
logging.disable(logging.INFO)
logging.disable(logging.WARNING)
@@ -681,7 +715,8 @@ def command_rename(args, config):
os.remove(new_path)
return 1
os.remove(CORE.config_path)
if CORE.config_path != new_path:
os.remove(CORE.config_path)
print(color(Fore.BOLD_GREEN, "SUCCESS"))
print()
@@ -714,11 +749,23 @@ POST_CONFIG_ACTIONS = {
def parse_args(argv):
options_parser = argparse.ArgumentParser(add_help=False)
options_parser.add_argument(
"-v", "--verbose", help="Enable verbose ESPHome logs.", action="store_true"
"-v",
"--verbose",
help="Enable verbose ESPHome logs.",
action="store_true",
default=get_bool_env("ESPHOME_VERBOSE"),
)
options_parser.add_argument(
"-q", "--quiet", help="Disable all ESPHome logs.", action="store_true"
)
options_parser.add_argument(
"-l",
"--log-level",
help="Set the log level.",
default=os.getenv("ESPHOME_LOG_LEVEL", "INFO"),
action="store",
choices=["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"],
)
options_parser.add_argument(
"--dashboard", help=argparse.SUPPRESS, action="store_true"
)
@@ -732,7 +779,14 @@ def parse_args(argv):
)
parser = argparse.ArgumentParser(
description=f"ESPHome v{const.__version__}", parents=[options_parser]
description=f"ESPHome {const.__version__}", parents=[options_parser]
)
parser.add_argument(
"--version",
action="version",
version=f"Version: {const.__version__}",
help="Print the ESPHome version and exit.",
)
mqtt_options = argparse.ArgumentParser(add_help=False)
@@ -933,67 +987,6 @@ def parse_args(argv):
# a deprecation warning).
arguments = argv[1:]
# On Python 3.9+ we can simply set exit_on_error=False in the constructor
def _raise(x):
raise argparse.ArgumentError(None, x)
# First, try new-style parsing, but don't exit in case of failure
try:
# duplicate parser so that we can use the original one to raise errors later on
current_parser = argparse.ArgumentParser(add_help=False, parents=[parser])
current_parser.set_defaults(deprecated_argv_suggestion=None)
current_parser.error = _raise
return current_parser.parse_args(arguments)
except argparse.ArgumentError:
pass
# Second, try compat parsing and rearrange the command-line if it succeeds
# Disable argparse's built-in help option and add it manually to prevent this
# parser from printing the help messagefor the old format when invoked with -h.
compat_parser = argparse.ArgumentParser(parents=[options_parser], add_help=False)
compat_parser.add_argument("-h", "--help", action="store_true")
compat_parser.add_argument("configuration", nargs="*")
compat_parser.add_argument(
"command",
choices=[
"config",
"compile",
"upload",
"logs",
"run",
"clean-mqtt",
"wizard",
"mqtt-fingerprint",
"version",
"clean",
"dashboard",
"vscode",
"update-all",
],
)
try:
compat_parser.error = _raise
result, unparsed = compat_parser.parse_known_args(argv[1:])
last_option = len(arguments) - len(unparsed) - 1 - len(result.configuration)
unparsed = [
"--device" if arg in ("--upload-port", "--serial-port") else arg
for arg in unparsed
]
arguments = (
arguments[0:last_option]
+ [result.command]
+ result.configuration
+ unparsed
)
deprecated_argv_suggestion = arguments
except argparse.ArgumentError:
# old-style parsing failed, don't suggest any argument
deprecated_argv_suggestion = None
# Finally, run the new-style parser again with the possibly swapped arguments,
# and let it error out if the command is unparsable.
parser.set_defaults(deprecated_argv_suggestion=deprecated_argv_suggestion)
argcomplete.autocomplete(parser)
return parser.parse_args(arguments)
@@ -1002,26 +995,17 @@ def run_esphome(argv):
args = parse_args(argv)
CORE.dashboard = args.dashboard
setup_log(
args.verbose,
args.quiet,
# Show timestamp for dashboard access logs
args.command == "dashboard",
)
if args.deprecated_argv_suggestion is not None and args.command != "vscode":
_LOGGER.warning(
"Calling ESPHome with the configuration before the command is deprecated "
"and will be removed in the future. "
)
_LOGGER.warning("Please instead use:")
_LOGGER.warning(" esphome %s", " ".join(args.deprecated_argv_suggestion))
# Override log level if verbose is set
if args.verbose:
args.log_level = "DEBUG"
elif args.quiet:
args.log_level = "CRITICAL"
if sys.version_info < (3, 8, 0):
_LOGGER.error(
"You're running ESPHome with Python <3.8. ESPHome is no longer compatible "
"with this Python version. Please reinstall ESPHome with Python 3.8+"
)
return 1
setup_log(
log_level=args.log_level,
# Show timestamp for dashboard access logs
include_timestamp=args.command == "dashboard",
)
if args.command in PRE_CONFIG_ACTIONS:
try:

View File

@@ -1,16 +1,18 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.const import (
CONF_ALL,
CONF_ANY,
CONF_AUTOMATION_ID,
CONF_CONDITION,
CONF_COUNT,
CONF_ELSE,
CONF_ID,
CONF_THEN,
CONF_TIME,
CONF_TIMEOUT,
CONF_TRIGGER_ID,
CONF_TYPE_ID,
CONF_TIME,
CONF_UPDATE_INTERVAL,
)
from esphome.schema_extractors import SCHEMA_EXTRACT, schema_extractor
@@ -73,6 +75,13 @@ def validate_potentially_and_condition(value):
return validate_condition(value)
def validate_potentially_or_condition(value):
if isinstance(value, list):
with cv.remove_prepend_path(["or"]):
return validate_condition({"or": value})
return validate_condition(value)
DelayAction = cg.esphome_ns.class_("DelayAction", Action, cg.Component)
LambdaAction = cg.esphome_ns.class_("LambdaAction", Action)
IfAction = cg.esphome_ns.class_("IfAction", Action)
@@ -166,6 +175,18 @@ async def or_condition_to_code(config, condition_id, template_arg, args):
return cg.new_Pvariable(condition_id, template_arg, conditions)
@register_condition("all", AndCondition, validate_condition_list)
async def all_condition_to_code(config, condition_id, template_arg, args):
conditions = await build_condition_list(config, template_arg, args)
return cg.new_Pvariable(condition_id, template_arg, conditions)
@register_condition("any", OrCondition, validate_condition_list)
async def any_condition_to_code(config, condition_id, template_arg, args):
conditions = await build_condition_list(config, template_arg, args)
return cg.new_Pvariable(condition_id, template_arg, conditions)
@register_condition("not", NotCondition, validate_potentially_and_condition)
async def not_condition_to_code(config, condition_id, template_arg, args):
condition = await build_condition(config, template_arg, args)
@@ -223,15 +244,21 @@ async def delay_action_to_code(config, action_id, template_arg, args):
IfAction,
cv.All(
{
cv.Required(CONF_CONDITION): validate_potentially_and_condition,
cv.Exclusive(
CONF_CONDITION, CONF_CONDITION
): validate_potentially_and_condition,
cv.Exclusive(CONF_ANY, CONF_CONDITION): validate_potentially_or_condition,
cv.Exclusive(CONF_ALL, CONF_CONDITION): validate_potentially_and_condition,
cv.Optional(CONF_THEN): validate_action_list,
cv.Optional(CONF_ELSE): validate_action_list,
},
cv.has_at_least_one_key(CONF_THEN, CONF_ELSE),
cv.has_at_least_one_key(CONF_CONDITION, CONF_ANY, CONF_ALL),
),
)
async def if_action_to_code(config, action_id, template_arg, args):
conditions = await build_condition(config[CONF_CONDITION], template_arg, args)
cond_conf = next(el for el in config if el in (CONF_ANY, CONF_ALL, CONF_CONDITION))
conditions = await build_condition(config[cond_conf], template_arg, args)
var = cg.new_Pvariable(action_id, template_arg, conditions)
if CONF_THEN in config:
actions = await build_action_list(config[CONF_THEN], template_arg, args)

View File

@@ -8,84 +8,86 @@
# want to break suddenly due to a rename (this file will get backports for features).
# pylint: disable=unused-import
from esphome.cpp_generator import ( # noqa
from esphome.cpp_generator import ( # noqa: F401
ArrayInitializer,
Expression,
LineComment,
MockObj,
MockObjClass,
Pvariable,
RawExpression,
RawStatement,
TemplateArguments,
StructInitializer,
ArrayInitializer,
safe_exp,
Statement,
LineComment,
progmem_array,
static_const_array,
statement,
variable,
with_local_variable,
new_variable,
Pvariable,
new_Pvariable,
StructInitializer,
TemplateArguments,
add,
add_global,
add_library,
add_build_flag,
add_define,
add_global,
add_library,
add_platformio_option,
get_variable,
get_variable_with_full_id,
process_lambda,
is_template,
new_Pvariable,
new_variable,
process_lambda,
progmem_array,
safe_exp,
statement,
static_const_array,
templatable,
MockObj,
MockObjClass,
variable,
with_local_variable,
)
from esphome.cpp_helpers import ( # noqa
gpio_pin_expression,
register_component,
from esphome.cpp_helpers import ( # noqa: F401
build_registry_entry,
build_registry_list,
extract_registry_entry_config,
register_parented,
gpio_pin_expression,
past_safe_mode,
register_component,
register_parented,
)
from esphome.cpp_types import ( # noqa
global_ns,
void,
nullptr,
float_,
double,
from esphome.cpp_types import ( # noqa: F401
NAN,
App,
Application,
Component,
ComponentPtr,
Controller,
EntityBase,
EntityCategory,
ESPTime,
GPIOPin,
InternalGPIOPin,
JsonObject,
JsonObjectConst,
Parented,
PollingComponent,
arduino_json_ns,
bool_,
const_char_ptr,
double,
esphome_ns,
float_,
global_ns,
gpio_Flags,
int16,
int32,
int64,
int_,
nullptr,
optional,
size_t,
std_ns,
std_shared_ptr,
std_string,
std_string_ref,
std_vector,
uint8,
uint16,
uint32,
uint64,
int16,
int32,
int64,
size_t,
const_char_ptr,
NAN,
esphome_ns,
App,
EntityBase,
Component,
ComponentPtr,
PollingComponent,
Application,
optional,
arduino_json_ns,
JsonObject,
JsonObjectConst,
Controller,
GPIOPin,
InternalGPIOPin,
gpio_Flags,
EntityCategory,
Parented,
ESPTime,
void,
)

View File

@@ -4,11 +4,11 @@ from esphome.const import (
STATE_CLASS_MEASUREMENT,
ICON_ARROW_EXPAND_VERTICAL,
DEVICE_CLASS_DISTANCE,
UNIT_MILLIMETER,
)
CODEOWNERS = ["@TH-Braemer"]
DEPENDENCIES = ["uart"]
UNIT_MILLIMETERS = "mm"
a02yyuw_ns = cg.esphome_ns.namespace("a02yyuw")
A02yyuwComponent = a02yyuw_ns.class_(
@@ -17,7 +17,7 @@ A02yyuwComponent = a02yyuw_ns.class_(
CONFIG_SCHEMA = sensor.sensor_schema(
A02yyuwComponent,
unit_of_measurement=UNIT_MILLIMETERS,
unit_of_measurement=UNIT_MILLIMETER,
icon=ICON_ARROW_EXPAND_VERTICAL,
accuracy_decimals=0,
state_class=STATE_CLASS_MEASUREMENT,

View File

@@ -1,11 +1,6 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import pins
from esphome.const import CONF_ANALOG, CONF_INPUT, CONF_NUMBER
from esphome.core import CORE
import esphome.codegen as cg
from esphome.components.esp32 import get_esp32_variant
from esphome.const import PLATFORM_ESP8266
from esphome.components.esp32.const import (
VARIANT_ESP32,
VARIANT_ESP32C2,
@@ -15,17 +10,40 @@ from esphome.components.esp32.const import (
VARIANT_ESP32S2,
VARIANT_ESP32S3,
)
import esphome.config_validation as cv
from esphome.const import CONF_ANALOG, CONF_INPUT, CONF_NUMBER, PLATFORM_ESP8266
from esphome.core import CORE
CODEOWNERS = ["@esphome/core"]
adc_ns = cg.esphome_ns.namespace("adc")
"""
From the below patch versions (and 5.2+) ADC_ATTEN_DB_11 is deprecated and replaced with ADC_ATTEN_DB_12.
4.4.7
5.0.5
5.1.3
5.2+
"""
ATTENUATION_MODES = {
"0db": cg.global_ns.ADC_ATTEN_DB_0,
"2.5db": cg.global_ns.ADC_ATTEN_DB_2_5,
"6db": cg.global_ns.ADC_ATTEN_DB_6,
"11db": cg.global_ns.ADC_ATTEN_DB_11,
"11db": adc_ns.ADC_ATTEN_DB_12_COMPAT,
"12db": adc_ns.ADC_ATTEN_DB_12_COMPAT,
"auto": "auto",
}
sampling_mode = adc_ns.enum("SamplingMode", is_class=True)
SAMPLING_MODES = {
"avg": sampling_mode.AVG,
"min": sampling_mode.MIN,
"max": sampling_mode.MAX,
}
adc1_channel_t = cg.global_ns.enum("adc1_channel_t")
adc2_channel_t = cg.global_ns.enum("adc2_channel_t")
@@ -90,11 +108,11 @@ ESP32_VARIANT_ADC1_PIN_TO_CHANNEL = {
6: adc1_channel_t.ADC1_CHANNEL_6,
},
VARIANT_ESP32H2: {
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,
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,
},
}

View File

@@ -1,302 +0,0 @@
#include "adc_sensor.h"
#include "esphome/core/helpers.h"
#include "esphome/core/log.h"
#ifdef USE_ESP8266
#ifdef USE_ADC_SENSOR_VCC
#include <Esp.h>
ADC_MODE(ADC_VCC)
#else
#include <Arduino.h>
#endif
#endif
#ifdef USE_RP2040
#ifdef CYW43_USES_VSYS_PIN
#include "pico/cyw43_arch.h"
#endif
#include <hardware/adc.h>
#endif
namespace esphome {
namespace adc {
static const char *const TAG = "adc";
// 13-bit for S2, 12-bit for all other ESP32 variants
#ifdef USE_ESP32
static const adc_bits_width_t ADC_WIDTH_MAX_SOC_BITS = static_cast<adc_bits_width_t>(ADC_WIDTH_MAX - 1);
#ifndef SOC_ADC_RTC_MAX_BITWIDTH
#if USE_ESP32_VARIANT_ESP32S2
static const int32_t SOC_ADC_RTC_MAX_BITWIDTH = 13;
#else
static const int32_t SOC_ADC_RTC_MAX_BITWIDTH = 12;
#endif
#endif
static const int ADC_MAX = (1 << SOC_ADC_RTC_MAX_BITWIDTH) - 1; // 4095 (12 bit) or 8191 (13 bit)
static const int ADC_HALF = (1 << SOC_ADC_RTC_MAX_BITWIDTH) >> 1; // 2048 (12 bit) or 4096 (13 bit)
#endif
#ifdef USE_RP2040
extern "C"
#endif
void
ADCSensor::setup() {
ESP_LOGCONFIG(TAG, "Setting up ADC '%s'...", this->get_name().c_str());
#if !defined(USE_ADC_SENSOR_VCC) && !defined(USE_RP2040)
pin_->setup();
#endif
#ifdef USE_ESP32
if (channel1_ != ADC1_CHANNEL_MAX) {
adc1_config_width(ADC_WIDTH_MAX_SOC_BITS);
if (!autorange_) {
adc1_config_channel_atten(channel1_, attenuation_);
}
} else if (channel2_ != ADC2_CHANNEL_MAX) {
if (!autorange_) {
adc2_config_channel_atten(channel2_, attenuation_);
}
}
// load characteristics for each attenuation
for (int32_t i = 0; i <= ADC_ATTEN_DB_11; i++) {
auto adc_unit = channel1_ != ADC1_CHANNEL_MAX ? ADC_UNIT_1 : ADC_UNIT_2;
auto cal_value = esp_adc_cal_characterize(adc_unit, (adc_atten_t) i, ADC_WIDTH_MAX_SOC_BITS,
1100, // default vref
&cal_characteristics_[i]);
switch (cal_value) {
case ESP_ADC_CAL_VAL_EFUSE_VREF:
ESP_LOGV(TAG, "Using eFuse Vref for calibration");
break;
case ESP_ADC_CAL_VAL_EFUSE_TP:
ESP_LOGV(TAG, "Using two-point eFuse Vref for calibration");
break;
case ESP_ADC_CAL_VAL_DEFAULT_VREF:
default:
break;
}
}
#endif // USE_ESP32
#ifdef USE_RP2040
static bool initialized = false;
if (!initialized) {
adc_init();
initialized = true;
}
#endif
ESP_LOGCONFIG(TAG, "ADC '%s' setup finished!", this->get_name().c_str());
}
void ADCSensor::dump_config() {
LOG_SENSOR("", "ADC Sensor", this);
#if defined(USE_ESP8266) || defined(USE_LIBRETINY)
#ifdef USE_ADC_SENSOR_VCC
ESP_LOGCONFIG(TAG, " Pin: VCC");
#else
LOG_PIN(" Pin: ", pin_);
#endif
#endif // USE_ESP8266 || USE_LIBRETINY
#ifdef USE_ESP32
LOG_PIN(" Pin: ", pin_);
if (autorange_) {
ESP_LOGCONFIG(TAG, " Attenuation: auto");
} else {
switch (this->attenuation_) {
case ADC_ATTEN_DB_0:
ESP_LOGCONFIG(TAG, " Attenuation: 0db");
break;
case ADC_ATTEN_DB_2_5:
ESP_LOGCONFIG(TAG, " Attenuation: 2.5db");
break;
case ADC_ATTEN_DB_6:
ESP_LOGCONFIG(TAG, " Attenuation: 6db");
break;
case ADC_ATTEN_DB_11:
ESP_LOGCONFIG(TAG, " Attenuation: 11db");
break;
default: // This is to satisfy the unused ADC_ATTEN_MAX
break;
}
}
#endif // USE_ESP32
#ifdef USE_RP2040
if (this->is_temperature_) {
ESP_LOGCONFIG(TAG, " Pin: Temperature");
} else {
#ifdef USE_ADC_SENSOR_VCC
ESP_LOGCONFIG(TAG, " Pin: VCC");
#else
LOG_PIN(" Pin: ", pin_);
#endif // USE_ADC_SENSOR_VCC
}
#endif // USE_RP2040
LOG_UPDATE_INTERVAL(this);
}
float ADCSensor::get_setup_priority() const { return setup_priority::DATA; }
void ADCSensor::update() {
float value_v = this->sample();
ESP_LOGV(TAG, "'%s': Got voltage=%.4fV", this->get_name().c_str(), value_v);
this->publish_state(value_v);
}
#ifdef USE_ESP8266
float ADCSensor::sample() {
#ifdef USE_ADC_SENSOR_VCC
int32_t raw = ESP.getVcc(); // NOLINT(readability-static-accessed-through-instance)
#else
int32_t raw = analogRead(this->pin_->get_pin()); // NOLINT
#endif
if (output_raw_) {
return raw;
}
return raw / 1024.0f;
}
#endif
#ifdef USE_ESP32
float ADCSensor::sample() {
if (!autorange_) {
int raw = -1;
if (channel1_ != ADC1_CHANNEL_MAX) {
raw = adc1_get_raw(channel1_);
} else if (channel2_ != ADC2_CHANNEL_MAX) {
adc2_get_raw(channel2_, ADC_WIDTH_MAX_SOC_BITS, &raw);
}
if (raw == -1) {
return NAN;
}
if (output_raw_) {
return raw;
}
uint32_t mv = esp_adc_cal_raw_to_voltage(raw, &cal_characteristics_[(int32_t) attenuation_]);
return mv / 1000.0f;
}
int raw11 = ADC_MAX, raw6 = ADC_MAX, raw2 = ADC_MAX, raw0 = ADC_MAX;
if (channel1_ != ADC1_CHANNEL_MAX) {
adc1_config_channel_atten(channel1_, ADC_ATTEN_DB_11);
raw11 = adc1_get_raw(channel1_);
if (raw11 < ADC_MAX) {
adc1_config_channel_atten(channel1_, ADC_ATTEN_DB_6);
raw6 = adc1_get_raw(channel1_);
if (raw6 < ADC_MAX) {
adc1_config_channel_atten(channel1_, ADC_ATTEN_DB_2_5);
raw2 = adc1_get_raw(channel1_);
if (raw2 < ADC_MAX) {
adc1_config_channel_atten(channel1_, ADC_ATTEN_DB_0);
raw0 = adc1_get_raw(channel1_);
}
}
}
} else if (channel2_ != ADC2_CHANNEL_MAX) {
adc2_config_channel_atten(channel2_, ADC_ATTEN_DB_11);
adc2_get_raw(channel2_, ADC_WIDTH_MAX_SOC_BITS, &raw11);
if (raw11 < ADC_MAX) {
adc2_config_channel_atten(channel2_, ADC_ATTEN_DB_6);
adc2_get_raw(channel2_, ADC_WIDTH_MAX_SOC_BITS, &raw6);
if (raw6 < ADC_MAX) {
adc2_config_channel_atten(channel2_, ADC_ATTEN_DB_2_5);
adc2_get_raw(channel2_, ADC_WIDTH_MAX_SOC_BITS, &raw2);
if (raw2 < ADC_MAX) {
adc2_config_channel_atten(channel2_, ADC_ATTEN_DB_0);
adc2_get_raw(channel2_, ADC_WIDTH_MAX_SOC_BITS, &raw0);
}
}
}
}
if (raw0 == -1 || raw2 == -1 || raw6 == -1 || raw11 == -1) {
return NAN;
}
uint32_t mv11 = esp_adc_cal_raw_to_voltage(raw11, &cal_characteristics_[(int32_t) ADC_ATTEN_DB_11]);
uint32_t mv6 = esp_adc_cal_raw_to_voltage(raw6, &cal_characteristics_[(int32_t) ADC_ATTEN_DB_6]);
uint32_t mv2 = esp_adc_cal_raw_to_voltage(raw2, &cal_characteristics_[(int32_t) ADC_ATTEN_DB_2_5]);
uint32_t mv0 = esp_adc_cal_raw_to_voltage(raw0, &cal_characteristics_[(int32_t) ADC_ATTEN_DB_0]);
// Contribution of each value, in range 0-2048 (12 bit ADC) or 0-4096 (13 bit ADC)
uint32_t c11 = std::min(raw11, ADC_HALF);
uint32_t c6 = ADC_HALF - std::abs(raw6 - ADC_HALF);
uint32_t c2 = ADC_HALF - std::abs(raw2 - ADC_HALF);
uint32_t c0 = std::min(ADC_MAX - raw0, ADC_HALF);
// max theoretical csum value is 4096*4 = 16384
uint32_t csum = c11 + c6 + c2 + c0;
// each mv is max 3900; so max value is 3900*4096*4, fits in unsigned32
uint32_t mv_scaled = (mv11 * c11) + (mv6 * c6) + (mv2 * c2) + (mv0 * c0);
return mv_scaled / (float) (csum * 1000U);
}
#endif // USE_ESP32
#ifdef USE_RP2040
float ADCSensor::sample() {
if (this->is_temperature_) {
adc_set_temp_sensor_enabled(true);
delay(1);
adc_select_input(4);
int32_t raw = adc_read();
adc_set_temp_sensor_enabled(false);
if (this->output_raw_) {
return raw;
}
return raw * 3.3f / 4096.0f;
} else {
uint8_t pin = this->pin_->get_pin();
#ifdef CYW43_USES_VSYS_PIN
if (pin == PICO_VSYS_PIN) {
// Measuring VSYS on Raspberry Pico W needs to be wrapped with
// `cyw43_thread_enter()`/`cyw43_thread_exit()` as discussed in
// https://github.com/raspberrypi/pico-sdk/issues/1222, since Wifi chip and
// VSYS ADC both share GPIO29
cyw43_thread_enter();
}
#endif // CYW43_USES_VSYS_PIN
adc_gpio_init(pin);
adc_select_input(pin - 26);
int32_t raw = adc_read();
#ifdef CYW43_USES_VSYS_PIN
if (pin == PICO_VSYS_PIN) {
cyw43_thread_exit();
}
#endif // CYW43_USES_VSYS_PIN
if (output_raw_) {
return raw;
}
float coeff = pin == PICO_VSYS_PIN ? 3.0 : 1.0;
return raw * 3.3f / 4096.0f * coeff;
}
}
#endif
#ifdef USE_LIBRETINY
float ADCSensor::sample() {
if (output_raw_) {
return analogRead(this->pin_->get_pin()); // NOLINT
}
return analogReadVoltage(this->pin_->get_pin()) / 1000.0f; // NOLINT
}
#endif // USE_LIBRETINY
#ifdef USE_ESP8266
std::string ADCSensor::unique_id() { return get_mac_address() + "-adc"; }
#endif
} // namespace adc
} // namespace esphome

View File

@@ -1,34 +1,63 @@
#pragma once
#include "esphome/core/component.h"
#include "esphome/core/hal.h"
#include "esphome/core/defines.h"
#include "esphome/components/sensor/sensor.h"
#include "esphome/components/voltage_sampler/voltage_sampler.h"
#include "esphome/core/component.h"
#include "esphome/core/hal.h"
#ifdef USE_ESP32
#include "driver/adc.h"
#include <esp_adc_cal.h>
#endif
#include "driver/adc.h"
#endif // USE_ESP32
namespace esphome {
namespace adc {
#ifdef USE_ESP32
// clang-format off
#if (ESP_IDF_VERSION_MAJOR == 4 && ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(4, 4, 7)) || \
(ESP_IDF_VERSION_MAJOR == 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 >= 2)) \
)
// clang-format on
static const adc_atten_t ADC_ATTEN_DB_12_COMPAT = ADC_ATTEN_DB_12;
#else
static const adc_atten_t ADC_ATTEN_DB_12_COMPAT = ADC_ATTEN_DB_11;
#endif
#endif // USE_ESP32
enum class SamplingMode : uint8_t { AVG = 0, MIN = 1, MAX = 2 };
const LogString *sampling_mode_to_str(SamplingMode mode);
class Aggregator {
public:
void add_sample(uint32_t value);
uint32_t aggregate();
Aggregator(SamplingMode mode);
protected:
SamplingMode mode_{SamplingMode::AVG};
uint32_t aggr_{0};
uint32_t samples_{0};
};
class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage_sampler::VoltageSampler {
public:
#ifdef USE_ESP32
/// Set the attenuation for this pin. Only available on the ESP32.
void set_attenuation(adc_atten_t attenuation) { attenuation_ = attenuation; }
void set_attenuation(adc_atten_t attenuation) { this->attenuation_ = attenuation; }
void set_channel1(adc1_channel_t channel) {
channel1_ = channel;
channel2_ = ADC2_CHANNEL_MAX;
this->channel1_ = channel;
this->channel2_ = ADC2_CHANNEL_MAX;
}
void set_channel2(adc2_channel_t channel) {
channel2_ = channel;
channel1_ = ADC1_CHANNEL_MAX;
this->channel2_ = channel;
this->channel1_ = ADC1_CHANNEL_MAX;
}
void set_autorange(bool autorange) { autorange_ = autorange; }
#endif
void set_autorange(bool autorange) { this->autorange_ = autorange; }
#endif // USE_ESP32
/// Update ADC values
void update() override;
@@ -38,24 +67,28 @@ class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage
/// `HARDWARE_LATE` setup priority
float get_setup_priority() const override;
void set_pin(InternalGPIOPin *pin) { this->pin_ = pin; }
void set_output_raw(bool output_raw) { output_raw_ = output_raw; }
void set_output_raw(bool output_raw) { this->output_raw_ = output_raw; }
void set_sample_count(uint8_t sample_count);
void set_sampling_mode(SamplingMode sampling_mode);
float sample() override;
#ifdef USE_ESP8266
std::string unique_id() override;
#endif
#endif // USE_ESP8266
#ifdef USE_RP2040
void set_is_temperature() { is_temperature_ = true; }
#endif
void set_is_temperature() { this->is_temperature_ = true; }
#endif // USE_RP2040
protected:
InternalGPIOPin *pin_;
bool output_raw_{false};
uint8_t sample_count_{1};
SamplingMode sampling_mode_{SamplingMode::AVG};
#ifdef USE_RP2040
bool is_temperature_{false};
#endif
#endif // USE_RP2040
#ifdef USE_ESP32
adc_atten_t attenuation_{ADC_ATTEN_DB_0};
@@ -66,8 +99,8 @@ class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage
esp_adc_cal_characteristics_t cal_characteristics_[SOC_ADC_ATTEN_NUM] = {};
#else
esp_adc_cal_characteristics_t cal_characteristics_[ADC_ATTEN_MAX] = {};
#endif
#endif
#endif // ESP_IDF_VERSION_MAJOR
#endif // USE_ESP32
};
} // namespace adc

View File

@@ -0,0 +1,79 @@
#include "adc_sensor.h"
#include "esphome/core/log.h"
namespace esphome {
namespace adc {
static const char *const TAG = "adc.common";
const LogString *sampling_mode_to_str(SamplingMode mode) {
switch (mode) {
case SamplingMode::AVG:
return LOG_STR("average");
case SamplingMode::MIN:
return LOG_STR("minimum");
case SamplingMode::MAX:
return LOG_STR("maximum");
}
return LOG_STR("unknown");
}
Aggregator::Aggregator(SamplingMode mode) {
this->mode_ = mode;
// set to max uint if mode is "min"
if (mode == SamplingMode::MIN) {
this->aggr_ = UINT32_MAX;
}
}
void Aggregator::add_sample(uint32_t value) {
this->samples_ += 1;
switch (this->mode_) {
case SamplingMode::AVG:
this->aggr_ += value;
break;
case SamplingMode::MIN:
if (value < this->aggr_) {
this->aggr_ = value;
}
break;
case SamplingMode::MAX:
if (value > this->aggr_) {
this->aggr_ = value;
}
}
}
uint32_t Aggregator::aggregate() {
if (this->mode_ == SamplingMode::AVG) {
if (this->samples_ == 0) {
return this->aggr_;
}
return (this->aggr_ + (this->samples_ >> 1)) / this->samples_; // NOLINT(clang-analyzer-core.DivideZero)
}
return this->aggr_;
}
void ADCSensor::update() {
float value_v = this->sample();
ESP_LOGV(TAG, "'%s': Got voltage=%.4fV", this->get_name().c_str(), value_v);
this->publish_state(value_v);
}
void ADCSensor::set_sample_count(uint8_t sample_count) {
if (sample_count != 0) {
this->sample_count_ = sample_count;
}
}
void ADCSensor::set_sampling_mode(SamplingMode sampling_mode) { this->sampling_mode_ = sampling_mode; }
float ADCSensor::get_setup_priority() const { return setup_priority::DATA; }
} // namespace adc
} // namespace esphome

View File

@@ -0,0 +1,166 @@
#ifdef USE_ESP32
#include "adc_sensor.h"
#include "esphome/core/log.h"
namespace esphome {
namespace adc {
static const char *const TAG = "adc.esp32";
static const adc_bits_width_t ADC_WIDTH_MAX_SOC_BITS = static_cast<adc_bits_width_t>(ADC_WIDTH_MAX - 1);
#ifndef SOC_ADC_RTC_MAX_BITWIDTH
#if USE_ESP32_VARIANT_ESP32S2
static const int32_t SOC_ADC_RTC_MAX_BITWIDTH = 13;
#else
static const int32_t SOC_ADC_RTC_MAX_BITWIDTH = 12;
#endif // USE_ESP32_VARIANT_ESP32S2
#endif // SOC_ADC_RTC_MAX_BITWIDTH
static const int ADC_MAX = (1 << SOC_ADC_RTC_MAX_BITWIDTH) - 1;
static const int ADC_HALF = (1 << SOC_ADC_RTC_MAX_BITWIDTH) >> 1;
void ADCSensor::setup() {
ESP_LOGCONFIG(TAG, "Setting up ADC '%s'...", this->get_name().c_str());
if (this->channel1_ != ADC1_CHANNEL_MAX) {
adc1_config_width(ADC_WIDTH_MAX_SOC_BITS);
if (!this->autorange_) {
adc1_config_channel_atten(this->channel1_, this->attenuation_);
}
} else if (this->channel2_ != ADC2_CHANNEL_MAX) {
if (!this->autorange_) {
adc2_config_channel_atten(this->channel2_, this->attenuation_);
}
}
for (int32_t i = 0; i <= ADC_ATTEN_DB_12_COMPAT; i++) {
auto adc_unit = this->channel1_ != ADC1_CHANNEL_MAX ? ADC_UNIT_1 : ADC_UNIT_2;
auto cal_value = esp_adc_cal_characterize(adc_unit, (adc_atten_t) i, ADC_WIDTH_MAX_SOC_BITS,
1100, // default vref
&this->cal_characteristics_[i]);
switch (cal_value) {
case ESP_ADC_CAL_VAL_EFUSE_VREF:
ESP_LOGV(TAG, "Using eFuse Vref for calibration");
break;
case ESP_ADC_CAL_VAL_EFUSE_TP:
ESP_LOGV(TAG, "Using two-point eFuse Vref for calibration");
break;
case ESP_ADC_CAL_VAL_DEFAULT_VREF:
default:
break;
}
}
}
void ADCSensor::dump_config() {
LOG_SENSOR("", "ADC Sensor", this);
LOG_PIN(" Pin: ", this->pin_);
if (this->autorange_) {
ESP_LOGCONFIG(TAG, " Attenuation: auto");
} else {
switch (this->attenuation_) {
case ADC_ATTEN_DB_0:
ESP_LOGCONFIG(TAG, " Attenuation: 0db");
break;
case ADC_ATTEN_DB_2_5:
ESP_LOGCONFIG(TAG, " Attenuation: 2.5db");
break;
case ADC_ATTEN_DB_6:
ESP_LOGCONFIG(TAG, " Attenuation: 6db");
break;
case ADC_ATTEN_DB_12_COMPAT:
ESP_LOGCONFIG(TAG, " Attenuation: 12db");
break;
default: // This is to satisfy the unused ADC_ATTEN_MAX
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_)));
LOG_UPDATE_INTERVAL(this);
}
float ADCSensor::sample() {
if (!this->autorange_) {
auto aggr = Aggregator(this->sampling_mode_);
for (uint8_t sample = 0; sample < this->sample_count_; sample++) {
int raw = -1;
if (this->channel1_ != ADC1_CHANNEL_MAX) {
raw = adc1_get_raw(this->channel1_);
} else if (this->channel2_ != ADC2_CHANNEL_MAX) {
adc2_get_raw(this->channel2_, ADC_WIDTH_MAX_SOC_BITS, &raw);
}
if (raw == -1) {
return NAN;
}
aggr.add_sample(raw);
}
if (this->output_raw_) {
return aggr.aggregate();
}
uint32_t mv =
esp_adc_cal_raw_to_voltage(aggr.aggregate(), &this->cal_characteristics_[(int32_t) this->attenuation_]);
return mv / 1000.0f;
}
int raw12 = ADC_MAX, raw6 = ADC_MAX, raw2 = ADC_MAX, raw0 = ADC_MAX;
if (this->channel1_ != ADC1_CHANNEL_MAX) {
adc1_config_channel_atten(this->channel1_, ADC_ATTEN_DB_12_COMPAT);
raw12 = adc1_get_raw(this->channel1_);
if (raw12 < ADC_MAX) {
adc1_config_channel_atten(this->channel1_, ADC_ATTEN_DB_6);
raw6 = adc1_get_raw(this->channel1_);
if (raw6 < ADC_MAX) {
adc1_config_channel_atten(this->channel1_, ADC_ATTEN_DB_2_5);
raw2 = adc1_get_raw(this->channel1_);
if (raw2 < ADC_MAX) {
adc1_config_channel_atten(this->channel1_, ADC_ATTEN_DB_0);
raw0 = adc1_get_raw(this->channel1_);
}
}
}
} else if (this->channel2_ != ADC2_CHANNEL_MAX) {
adc2_config_channel_atten(this->channel2_, ADC_ATTEN_DB_12_COMPAT);
adc2_get_raw(this->channel2_, ADC_WIDTH_MAX_SOC_BITS, &raw12);
if (raw12 < ADC_MAX) {
adc2_config_channel_atten(this->channel2_, ADC_ATTEN_DB_6);
adc2_get_raw(this->channel2_, ADC_WIDTH_MAX_SOC_BITS, &raw6);
if (raw6 < ADC_MAX) {
adc2_config_channel_atten(this->channel2_, ADC_ATTEN_DB_2_5);
adc2_get_raw(this->channel2_, ADC_WIDTH_MAX_SOC_BITS, &raw2);
if (raw2 < ADC_MAX) {
adc2_config_channel_atten(this->channel2_, ADC_ATTEN_DB_0);
adc2_get_raw(this->channel2_, ADC_WIDTH_MAX_SOC_BITS, &raw0);
}
}
}
}
if (raw0 == -1 || raw2 == -1 || raw6 == -1 || raw12 == -1) {
return NAN;
}
uint32_t mv12 = esp_adc_cal_raw_to_voltage(raw12, &this->cal_characteristics_[(int32_t) ADC_ATTEN_DB_12_COMPAT]);
uint32_t mv6 = esp_adc_cal_raw_to_voltage(raw6, &this->cal_characteristics_[(int32_t) ADC_ATTEN_DB_6]);
uint32_t mv2 = esp_adc_cal_raw_to_voltage(raw2, &this->cal_characteristics_[(int32_t) ADC_ATTEN_DB_2_5]);
uint32_t mv0 = esp_adc_cal_raw_to_voltage(raw0, &this->cal_characteristics_[(int32_t) ADC_ATTEN_DB_0]);
uint32_t c12 = std::min(raw12, ADC_HALF);
uint32_t c6 = ADC_HALF - std::abs(raw6 - ADC_HALF);
uint32_t c2 = ADC_HALF - std::abs(raw2 - ADC_HALF);
uint32_t c0 = std::min(ADC_MAX - raw0, ADC_HALF);
uint32_t csum = c12 + c6 + c2 + c0;
uint32_t mv_scaled = (mv12 * c12) + (mv6 * c6) + (mv2 * c2) + (mv0 * c0);
return mv_scaled / (float) (csum * 1000U);
}
} // namespace adc
} // namespace esphome
#endif // USE_ESP32

View File

@@ -0,0 +1,62 @@
#ifdef USE_ESP8266
#include "adc_sensor.h"
#include "esphome/core/helpers.h"
#include "esphome/core/log.h"
#ifdef USE_ADC_SENSOR_VCC
#include <Esp.h>
ADC_MODE(ADC_VCC)
#else
#include <Arduino.h>
#endif // USE_ADC_SENSOR_VCC
namespace esphome {
namespace adc {
static const char *const TAG = "adc.esp8266";
void ADCSensor::setup() {
ESP_LOGCONFIG(TAG, "Setting up ADC '%s'...", this->get_name().c_str());
#ifndef USE_ADC_SENSOR_VCC
this->pin_->setup();
#endif
}
void ADCSensor::dump_config() {
LOG_SENSOR("", "ADC Sensor", this);
#ifdef USE_ADC_SENSOR_VCC
ESP_LOGCONFIG(TAG, " Pin: VCC");
#else
LOG_PIN(" Pin: ", this->pin_);
#endif // USE_ADC_SENSOR_VCC
ESP_LOGCONFIG(TAG, " Samples: %i", this->sample_count_);
ESP_LOGCONFIG(TAG, " Sampling mode: %s", LOG_STR_ARG(sampling_mode_to_str(this->sampling_mode_)));
LOG_UPDATE_INTERVAL(this);
}
float ADCSensor::sample() {
auto aggr = Aggregator(this->sampling_mode_);
for (uint8_t sample = 0; sample < this->sample_count_; sample++) {
uint32_t raw = 0;
#ifdef USE_ADC_SENSOR_VCC
raw = ESP.getVcc(); // NOLINT(readability-static-accessed-through-instance)
#else
raw = analogRead(this->pin_->get_pin()); // NOLINT
#endif // USE_ADC_SENSOR_VCC
aggr.add_sample(raw);
}
if (this->output_raw_) {
return aggr.aggregate();
}
return aggr.aggregate() / 1024.0f;
}
std::string ADCSensor::unique_id() { return get_mac_address() + "-adc"; }
} // namespace adc
} // namespace esphome
#endif // USE_ESP8266

View File

@@ -0,0 +1,53 @@
#ifdef USE_LIBRETINY
#include "adc_sensor.h"
#include "esphome/core/log.h"
namespace esphome {
namespace adc {
static const char *const TAG = "adc.libretiny";
void ADCSensor::setup() {
ESP_LOGCONFIG(TAG, "Setting up ADC '%s'...", this->get_name().c_str());
#ifndef USE_ADC_SENSOR_VCC
this->pin_->setup();
#endif // !USE_ADC_SENSOR_VCC
}
void ADCSensor::dump_config() {
LOG_SENSOR("", "ADC Sensor", this);
#ifdef USE_ADC_SENSOR_VCC
ESP_LOGCONFIG(TAG, " Pin: VCC");
#else // USE_ADC_SENSOR_VCC
LOG_PIN(" Pin: ", this->pin_);
#endif // USE_ADC_SENSOR_VCC
ESP_LOGCONFIG(TAG, " Samples: %i", this->sample_count_);
ESP_LOGCONFIG(TAG, " Sampling mode: %s", LOG_STR_ARG(sampling_mode_to_str(this->sampling_mode_)));
LOG_UPDATE_INTERVAL(this);
}
float ADCSensor::sample() {
uint32_t raw = 0;
auto aggr = Aggregator(this->sampling_mode_);
if (this->output_raw_) {
for (uint8_t sample = 0; sample < this->sample_count_; sample++) {
raw = analogRead(this->pin_->get_pin()); // NOLINT
aggr.add_sample(raw);
}
return aggr.aggregate();
}
for (uint8_t sample = 0; sample < this->sample_count_; sample++) {
raw = analogReadVoltage(this->pin_->get_pin()); // NOLINT
aggr.add_sample(raw);
}
return aggr.aggregate() / 1000.0f;
}
} // namespace adc
} // namespace esphome
#endif // USE_LIBRETINY

View File

@@ -0,0 +1,96 @@
#ifdef USE_RP2040
#include "adc_sensor.h"
#include "esphome/core/log.h"
#ifdef CYW43_USES_VSYS_PIN
#include "pico/cyw43_arch.h"
#endif // CYW43_USES_VSYS_PIN
#include <hardware/adc.h>
namespace esphome {
namespace adc {
static const char *const TAG = "adc.rp2040";
void ADCSensor::setup() {
ESP_LOGCONFIG(TAG, "Setting up ADC '%s'...", this->get_name().c_str());
static bool initialized = false;
if (!initialized) {
adc_init();
initialized = true;
}
}
void ADCSensor::dump_config() {
LOG_SENSOR("", "ADC Sensor", this);
if (this->is_temperature_) {
ESP_LOGCONFIG(TAG, " Pin: Temperature");
} else {
#ifdef USE_ADC_SENSOR_VCC
ESP_LOGCONFIG(TAG, " Pin: VCC");
#else
LOG_PIN(" Pin: ", this->pin_);
#endif // USE_ADC_SENSOR_VCC
}
ESP_LOGCONFIG(TAG, " Samples: %i", this->sample_count_);
ESP_LOGCONFIG(TAG, " Sampling mode: %s", LOG_STR_ARG(sampling_mode_to_str(this->sampling_mode_)));
LOG_UPDATE_INTERVAL(this);
}
float ADCSensor::sample() {
uint32_t raw = 0;
auto aggr = Aggregator(this->sampling_mode_);
if (this->is_temperature_) {
adc_set_temp_sensor_enabled(true);
delay(1);
adc_select_input(4);
for (uint8_t sample = 0; sample < this->sample_count_; sample++) {
raw = adc_read();
aggr.add_sample(raw);
}
adc_set_temp_sensor_enabled(false);
if (this->output_raw_) {
return aggr.aggregate();
}
return aggr.aggregate() * 3.3f / 4096.0f;
}
uint8_t pin = this->pin_->get_pin();
#ifdef CYW43_USES_VSYS_PIN
if (pin == PICO_VSYS_PIN) {
// Measuring VSYS on Raspberry Pico W needs to be wrapped with
// `cyw43_thread_enter()`/`cyw43_thread_exit()` as discussed in
// https://github.com/raspberrypi/pico-sdk/issues/1222, since Wifi chip and
// VSYS ADC both share GPIO29
cyw43_thread_enter();
}
#endif // CYW43_USES_VSYS_PIN
adc_gpio_init(pin);
adc_select_input(pin - 26);
for (uint8_t sample = 0; sample < this->sample_count_; sample++) {
raw = adc_read();
aggr.add_sample(raw);
}
#ifdef CYW43_USES_VSYS_PIN
if (pin == PICO_VSYS_PIN) {
cyw43_thread_exit();
}
#endif // CYW43_USES_VSYS_PIN
if (this->output_raw_) {
return aggr.aggregate();
}
float coeff = pin == PICO_VSYS_PIN ? 3.0f : 1.0f;
return aggr.aggregate() * 3.3f / 4096.0f * coeff;
}
} // namespace adc
} // namespace esphome
#endif // USE_RP2040

View File

@@ -1,9 +1,9 @@
import logging
import esphome.codegen as cg
import esphome.config_validation as cv
import esphome.final_validate as fv
from esphome.core import CORE
from esphome.components import sensor, voltage_sampler
from esphome.components.esp32 import get_esp32_variant
import esphome.config_validation as cv
from esphome.const import (
CONF_ATTENUATION,
CONF_ID,
@@ -15,20 +15,45 @@ from esphome.const import (
STATE_CLASS_MEASUREMENT,
UNIT_VOLT,
)
from esphome.core import CORE
import esphome.final_validate as fv
from . import (
ATTENUATION_MODES,
ESP32_VARIANT_ADC1_PIN_TO_CHANNEL,
ESP32_VARIANT_ADC2_PIN_TO_CHANNEL,
SAMPLING_MODES,
adc_ns,
validate_adc_pin,
)
_LOGGER = logging.getLogger(__name__)
AUTO_LOAD = ["voltage_sampler"]
CONF_SAMPLES = "samples"
CONF_SAMPLING_MODE = "sampling_mode"
_attenuation = cv.enum(ATTENUATION_MODES, lower=True)
_sampling_mode = cv.enum(SAMPLING_MODES, lower=True)
def validate_config(config):
if config[CONF_RAW] and config.get(CONF_ATTENUATION, None) == "auto":
raise cv.Invalid("Automatic attenuation cannot be used when raw output is set")
if config.get(CONF_ATTENUATION, None) == "auto" and config.get(CONF_SAMPLES, 1) > 1:
raise cv.Invalid(
"Automatic attenuation cannot be used when multisampling is set"
)
if config.get(CONF_ATTENUATION) == "11db":
_LOGGER.warning(
"`attenuation: 11db` is deprecated, use `attenuation: 12db` instead"
)
# Alter value here so `config` command prints the recommended change
config[CONF_ATTENUATION] = _attenuation("12db")
return config
@@ -47,7 +72,6 @@ def final_validate_config(config):
return config
adc_ns = cg.esphome_ns.namespace("adc")
ADCSensor = adc_ns.class_(
"ADCSensor", sensor.Sensor, cg.PollingComponent, voltage_sampler.VoltageSampler
)
@@ -65,8 +89,10 @@ CONFIG_SCHEMA = cv.All(
cv.Required(CONF_PIN): validate_adc_pin,
cv.Optional(CONF_RAW, default=False): cv.boolean,
cv.SplitDefault(CONF_ATTENUATION, esp32="0db"): cv.All(
cv.only_on_esp32, cv.enum(ATTENUATION_MODES, lower=True)
cv.only_on_esp32, _attenuation
),
cv.Optional(CONF_SAMPLES, default=1): cv.int_range(min=1, max=255),
cv.Optional(CONF_SAMPLING_MODE, default="avg"): _sampling_mode,
}
)
.extend(cv.polling_component_schema("60s")),
@@ -90,6 +116,8 @@ async def to_code(config):
cg.add(var.set_pin(pin))
cg.add(var.set_output_raw(config[CONF_RAW]))
cg.add(var.set_sample_count(config[CONF_SAMPLES]))
cg.add(var.set_sampling_mode(config[CONF_SAMPLING_MODE]))
if attenuation := config.get(CONF_ATTENUATION):
if attenuation == "auto":

View File

@@ -11,6 +11,8 @@
#include "ade7880_registers.h"
#include "esphome/core/log.h"
#include <cinttypes>
namespace esphome {
namespace ade7880 {
@@ -156,7 +158,7 @@ void ADE7880::update() {
});
}
ESP_LOGD(TAG, "update took %u ms", millis() - start);
ESP_LOGD(TAG, "update took %" PRIu32 " ms", millis() - start);
}
void ADE7880::dump_config() {
@@ -176,9 +178,9 @@ void ADE7880::dump_config() {
LOG_SENSOR(" ", "Forward Active Energy", this->channel_a_->forward_active_energy);
LOG_SENSOR(" ", "Reverse Active Energy", this->channel_a_->reverse_active_energy);
ESP_LOGCONFIG(TAG, " Calibration:");
ESP_LOGCONFIG(TAG, " Current: %u", this->channel_a_->current_gain_calibration);
ESP_LOGCONFIG(TAG, " Voltage: %d", this->channel_a_->voltage_gain_calibration);
ESP_LOGCONFIG(TAG, " Power: %d", this->channel_a_->power_gain_calibration);
ESP_LOGCONFIG(TAG, " Current: %" PRId32, this->channel_a_->current_gain_calibration);
ESP_LOGCONFIG(TAG, " Voltage: %" PRId32, this->channel_a_->voltage_gain_calibration);
ESP_LOGCONFIG(TAG, " Power: %" PRId32, this->channel_a_->power_gain_calibration);
ESP_LOGCONFIG(TAG, " Phase Angle: %u", this->channel_a_->phase_angle_calibration);
}
@@ -192,9 +194,9 @@ void ADE7880::dump_config() {
LOG_SENSOR(" ", "Forward Active Energy", this->channel_b_->forward_active_energy);
LOG_SENSOR(" ", "Reverse Active Energy", this->channel_b_->reverse_active_energy);
ESP_LOGCONFIG(TAG, " Calibration:");
ESP_LOGCONFIG(TAG, " Current: %u", this->channel_b_->current_gain_calibration);
ESP_LOGCONFIG(TAG, " Voltage: %d", this->channel_b_->voltage_gain_calibration);
ESP_LOGCONFIG(TAG, " Power: %d", this->channel_b_->power_gain_calibration);
ESP_LOGCONFIG(TAG, " Current: %" PRId32, this->channel_b_->current_gain_calibration);
ESP_LOGCONFIG(TAG, " Voltage: %" PRId32, this->channel_b_->voltage_gain_calibration);
ESP_LOGCONFIG(TAG, " Power: %" PRId32, this->channel_b_->power_gain_calibration);
ESP_LOGCONFIG(TAG, " Phase Angle: %u", this->channel_b_->phase_angle_calibration);
}
@@ -208,9 +210,9 @@ void ADE7880::dump_config() {
LOG_SENSOR(" ", "Forward Active Energy", this->channel_c_->forward_active_energy);
LOG_SENSOR(" ", "Reverse Active Energy", this->channel_c_->reverse_active_energy);
ESP_LOGCONFIG(TAG, " Calibration:");
ESP_LOGCONFIG(TAG, " Current: %u", this->channel_c_->current_gain_calibration);
ESP_LOGCONFIG(TAG, " Voltage: %d", this->channel_c_->voltage_gain_calibration);
ESP_LOGCONFIG(TAG, " Power: %d", this->channel_c_->power_gain_calibration);
ESP_LOGCONFIG(TAG, " Current: %" PRId32, this->channel_c_->current_gain_calibration);
ESP_LOGCONFIG(TAG, " Voltage: %" PRId32, this->channel_c_->voltage_gain_calibration);
ESP_LOGCONFIG(TAG, " Power: %" PRId32, this->channel_c_->power_gain_calibration);
ESP_LOGCONFIG(TAG, " Phase Angle: %u", this->channel_c_->phase_angle_calibration);
}
@@ -218,7 +220,7 @@ void ADE7880::dump_config() {
ESP_LOGCONFIG(TAG, " Neutral:");
LOG_SENSOR(" ", "Current", this->channel_n_->current);
ESP_LOGCONFIG(TAG, " Calibration:");
ESP_LOGCONFIG(TAG, " Current: %u", this->channel_n_->current_gain_calibration);
ESP_LOGCONFIG(TAG, " Current: %" PRId32, this->channel_n_->current_gain_calibration);
}
LOG_I2C_DEVICE(this);

View File

@@ -1,5 +1,5 @@
import esphome.config_validation as cv
CONFIG_SCHEMA = CONFIG_SCHEMA = cv.invalid(
CONFIG_SCHEMA = cv.invalid(
"The ade7953 sensor component has been renamed to ade7953_i2c."
)

View File

@@ -1,6 +1,8 @@
#include "ade7953_base.h"
#include "esphome/core/log.h"
#include <cinttypes>
namespace esphome {
namespace ade7953_base {
@@ -105,7 +107,7 @@ void ADE7953::update() {
this->last_update_ = now;
// prevent DIV/0
pf = ADE_WATTSEC_POWER_FACTOR * (diff < 10 ? 10 : diff) / 1000;
ESP_LOGVV(TAG, "ADE7953::update() diff=%d pf=%f", diff, pf);
ESP_LOGVV(TAG, "ADE7953::update() diff=%" PRIu32 " pf=%f", diff, pf);
}
// Apparent power

View File

@@ -60,7 +60,7 @@ bool AdE7953Spi::ade_read_16(uint16_t reg, uint16_t *value) {
this->write_byte16(reg);
this->transfer_byte(0x80);
uint8_t recv[2];
this->read_array(recv, 4);
this->read_array(recv, 2);
*value = encode_uint16(recv[0], recv[1]);
this->disable();
return false;

View File

@@ -9,8 +9,6 @@ static const char *const TAG = "ads1115";
static const uint8_t ADS1115_REGISTER_CONVERSION = 0x00;
static const uint8_t ADS1115_REGISTER_CONFIG = 0x01;
static const uint8_t ADS1115_DATA_RATE_860_SPS = 0b111; // 3300_SPS for ADS1015
void ADS1115Component::setup() {
ESP_LOGCONFIG(TAG, "Setting up ADS1115...");
uint16_t value;
@@ -43,9 +41,9 @@ void ADS1115Component::setup() {
config |= 0b0000000100000000;
}
// Set data rate - 860 samples per second (we're in singleshot mode)
// Set data rate - 860 samples per second
// 0bxxxxxxxx100xxxxx
config |= ADS1115_DATA_RATE_860_SPS << 5;
config |= ADS1115_860SPS << 5;
// Set comparator mode - hysteresis
// 0bxxxxxxxxxxx0xxxx
@@ -77,7 +75,7 @@ void ADS1115Component::dump_config() {
}
}
float ADS1115Component::request_measurement(ADS1115Multiplexer multiplexer, ADS1115Gain gain,
ADS1115Resolution resolution) {
ADS1115Resolution resolution, ADS1115Samplerate samplerate) {
uint16_t config = this->prev_config_;
// Multiplexer
// 0bxBBBxxxxxxxxxxxx
@@ -89,6 +87,11 @@ float ADS1115Component::request_measurement(ADS1115Multiplexer multiplexer, ADS1
config &= 0b1111000111111111;
config |= (gain & 0b111) << 9;
// Sample rate
// 0bxxxxxxxxBBBxxxxx
config &= 0b1111111100011111;
config |= (samplerate & 0b111) << 5;
if (!this->continuous_mode_) {
// Start conversion
config |= 0b1000000000000000;
@@ -101,8 +104,54 @@ float ADS1115Component::request_measurement(ADS1115Multiplexer multiplexer, ADS1
}
this->prev_config_ = config;
// about 1.2 ms with 860 samples per second
delay(2);
// Delay calculated as: ceil((1000/SPS)+.5)
if (resolution == ADS1015_12_BITS) {
switch (samplerate) {
case ADS1115_8SPS:
delay(9);
break;
case ADS1115_16SPS:
delay(5);
break;
case ADS1115_32SPS:
delay(3);
break;
case ADS1115_64SPS:
case ADS1115_128SPS:
delay(2);
break;
default:
delay(1);
break;
}
} else {
switch (samplerate) {
case ADS1115_8SPS:
delay(126); // NOLINT
break;
case ADS1115_16SPS:
delay(63); // NOLINT
break;
case ADS1115_32SPS:
delay(32);
break;
case ADS1115_64SPS:
delay(17);
break;
case ADS1115_128SPS:
delay(9);
break;
case ADS1115_250SPS:
delay(5);
break;
case ADS1115_475SPS:
delay(3);
break;
case ADS1115_860SPS:
delay(2);
break;
}
}
// in continuous mode, conversion will always be running, rely on the delay
// to ensure conversion is taking place with the correct settings

View File

@@ -33,6 +33,17 @@ enum ADS1115Resolution {
ADS1015_12_BITS = 12,
};
enum ADS1115Samplerate {
ADS1115_8SPS = 0b000,
ADS1115_16SPS = 0b001,
ADS1115_32SPS = 0b010,
ADS1115_64SPS = 0b011,
ADS1115_128SPS = 0b100,
ADS1115_250SPS = 0b101,
ADS1115_475SPS = 0b110,
ADS1115_860SPS = 0b111
};
class ADS1115Component : public Component, public i2c::I2CDevice {
public:
void setup() override;
@@ -42,7 +53,8 @@ class ADS1115Component : public Component, public i2c::I2CDevice {
void set_continuous_mode(bool continuous_mode) { continuous_mode_ = continuous_mode; }
/// Helper method to request a measurement from a sensor.
float request_measurement(ADS1115Multiplexer multiplexer, ADS1115Gain gain, ADS1115Resolution resolution);
float request_measurement(ADS1115Multiplexer multiplexer, ADS1115Gain gain, ADS1115Resolution resolution,
ADS1115Samplerate samplerate);
protected:
uint16_t prev_config_{0};

View File

@@ -5,6 +5,7 @@ from esphome.const import (
CONF_GAIN,
CONF_MULTIPLEXER,
CONF_RESOLUTION,
CONF_SAMPLE_RATE,
DEVICE_CLASS_VOLTAGE,
STATE_CLASS_MEASUREMENT,
UNIT_VOLT,
@@ -43,6 +44,17 @@ RESOLUTION = {
"12_BITS": ADS1115Resolution.ADS1015_12_BITS,
}
ADS1115Samplerate = ads1115_ns.enum("ADS1115Samplerate")
SAMPLERATE = {
"8": ADS1115Samplerate.ADS1115_8SPS,
"16": ADS1115Samplerate.ADS1115_16SPS,
"32": ADS1115Samplerate.ADS1115_32SPS,
"64": ADS1115Samplerate.ADS1115_64SPS,
"128": ADS1115Samplerate.ADS1115_128SPS,
"250": ADS1115Samplerate.ADS1115_250SPS,
"475": ADS1115Samplerate.ADS1115_475SPS,
"860": ADS1115Samplerate.ADS1115_860SPS,
}
ADS1115Sensor = ads1115_ns.class_(
"ADS1115Sensor", sensor.Sensor, cg.PollingComponent, voltage_sampler.VoltageSampler
@@ -64,6 +76,9 @@ CONFIG_SCHEMA = (
cv.Optional(CONF_RESOLUTION, default="16_BITS"): cv.enum(
RESOLUTION, upper=True, space="_"
),
cv.Optional(CONF_SAMPLE_RATE, default="860"): cv.enum(
SAMPLERATE, string=True
),
}
)
.extend(cv.polling_component_schema("60s"))
@@ -79,3 +94,4 @@ async def to_code(config):
cg.add(var.set_multiplexer(config[CONF_MULTIPLEXER]))
cg.add(var.set_gain(config[CONF_GAIN]))
cg.add(var.set_resolution(config[CONF_RESOLUTION]))
cg.add(var.set_samplerate(config[CONF_SAMPLE_RATE]))

View File

@@ -8,7 +8,7 @@ namespace ads1115 {
static const char *const TAG = "ads1115.sensor";
float ADS1115Sensor::sample() {
return this->parent_->request_measurement(this->multiplexer_, this->gain_, this->resolution_);
return this->parent_->request_measurement(this->multiplexer_, this->gain_, this->resolution_, this->samplerate_);
}
void ADS1115Sensor::update() {
@@ -24,6 +24,7 @@ void ADS1115Sensor::dump_config() {
ESP_LOGCONFIG(TAG, " Multiplexer: %u", this->multiplexer_);
ESP_LOGCONFIG(TAG, " Gain: %u", this->gain_);
ESP_LOGCONFIG(TAG, " Resolution: %u", this->resolution_);
ESP_LOGCONFIG(TAG, " Sample rate: %u", this->samplerate_);
}
} // namespace ads1115

View File

@@ -21,6 +21,7 @@ class ADS1115Sensor : public sensor::Sensor,
void set_multiplexer(ADS1115Multiplexer multiplexer) { this->multiplexer_ = multiplexer; }
void set_gain(ADS1115Gain gain) { this->gain_ = gain; }
void set_resolution(ADS1115Resolution resolution) { this->resolution_ = resolution; }
void set_samplerate(ADS1115Samplerate samplerate) { this->samplerate_ = samplerate; }
float sample() override;
void dump_config() override;
@@ -29,6 +30,7 @@ class ADS1115Sensor : public sensor::Sensor,
ADS1115Multiplexer multiplexer_;
ADS1115Gain gain_;
ADS1115Resolution resolution_;
ADS1115Samplerate samplerate_;
};
} // namespace ads1115

View File

@@ -1,5 +1,7 @@
#include "ags10.h"
#include <cinttypes>
namespace esphome {
namespace ags10 {
static const char *const TAG = "ags10";
@@ -35,7 +37,7 @@ void AGS10Component::setup() {
auto resistance = this->read_resistance_();
if (resistance) {
ESP_LOGD(TAG, "AGS10 Sensor Resistance: 0x%08X", *resistance);
ESP_LOGD(TAG, "AGS10 Sensor Resistance: 0x%08" PRIX32, *resistance);
if (this->resistance_ != nullptr) {
this->resistance_->publish_state(*resistance);
}

View File

@@ -93,8 +93,9 @@ void AHT10Component::restart_read_() {
void AHT10Component::read_data_() {
uint8_t data[6];
if (this->read_count_ > 1)
if (this->read_count_ > 1) {
ESP_LOGD(TAG, "Read attempt %d at %ums", this->read_count_, (unsigned) (millis() - this->start_time_));
}
if (this->read(data, 6) != i2c::ERROR_OK) {
this->status_set_warning("AHT10 read failed, retrying soon");
this->restart_read_();
@@ -119,8 +120,9 @@ void AHT10Component::read_data_() {
return;
}
}
if (this->read_count_ > 1)
if (this->read_count_ > 1) {
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_humidity = ((data[1] << 16) | (data[2] << 8) | data[3]) >> 4;

View File

View File

@@ -0,0 +1,173 @@
#include "aic3204.h"
#include "esphome/core/defines.h"
#include "esphome/core/helpers.h"
#include "esphome/core/log.h"
namespace esphome {
namespace aic3204 {
static const char *const TAG = "aic3204";
#define ERROR_CHECK(err, msg) \
if (!(err)) { \
ESP_LOGE(TAG, msg); \
this->mark_failed(); \
return; \
}
void AIC3204::setup() {
ESP_LOGCONFIG(TAG, "Setting up AIC3204...");
// Set register page to 0
ERROR_CHECK(this->write_byte(AIC3204_PAGE_CTRL, 0x00), "Set page 0 failed");
// Initiate SW reset (PLL is powered off as part of reset)
ERROR_CHECK(this->write_byte(AIC3204_SW_RST, 0x01), "Software reset failed");
// *** Program clock settings ***
// Default is CODEC_CLKIN is from MCLK pin. Don't need to change this.
// MDAC*NDAC*FOSR*48Khz = mClk (24.576 MHz when the XMOS is expecting 48kHz audio)
// (See page 51 of https://www.ti.com/lit/ml/slaa557/slaa557.pdf)
// We do need MDAC*DOSR/32 >= the resource compute level for the processing block
// So here 2*128/32 = 8, which is equal to processing block 1 's resource compute
// See page 5 of https://www.ti.com/lit/an/slaa404c/slaa404c.pdf for the workflow
// for determining these settings.
// Power up NDAC and set to 2
ERROR_CHECK(this->write_byte(AIC3204_NDAC, 0x82), "Set NDAC failed");
// Power up MDAC and set to 2
ERROR_CHECK(this->write_byte(AIC3204_MDAC, 0x82), "Set MDAC failed");
// Program DOSR = 128
ERROR_CHECK(this->write_byte(AIC3204_DOSR, 0x80), "Set DOSR failed");
// Set Audio Interface Config: I2S, 32 bits, DOUT always driving
ERROR_CHECK(this->write_byte(AIC3204_CODEC_IF, 0x30), "Set CODEC_IF failed");
// For I2S Firmware only, set SCLK/MFP3 pin as Audio Data In
ERROR_CHECK(this->write_byte(AIC3204_SCLK_MFP3, 0x02), "Set SCLK/MFP3 failed");
ERROR_CHECK(this->write_byte(AIC3204_AUDIO_IF_4, 0x01), "Set AUDIO_IF_4 failed");
ERROR_CHECK(this->write_byte(AIC3204_AUDIO_IF_5, 0x01), "Set AUDIO_IF_5 failed");
// Program the DAC processing block to be used - PRB_P1
ERROR_CHECK(this->write_byte(AIC3204_DAC_SIG_PROC, 0x01), "Set DAC_SIG_PROC failed");
// *** Select Page 1 ***
ERROR_CHECK(this->write_byte(AIC3204_PAGE_CTRL, 0x01), "Set page 1 failed");
// Enable the internal AVDD_LDO:
ERROR_CHECK(this->write_byte(AIC3204_LDO_CTRL, 0x09), "Set LDO_CTRL failed");
// *** Program Analog Blocks ***
// Disable Internal Crude AVdd in presence of external AVdd supply or before powering up internal AVdd LDO
ERROR_CHECK(this->write_byte(AIC3204_PWR_CFG, 0x08), "Set PWR_CFG failed");
// Enable Master Analog Power Control
ERROR_CHECK(this->write_byte(AIC3204_LDO_CTRL, 0x01), "Set LDO_CTRL failed");
// Page 125: Common mode control register, set d6 to 1 to make the full chip common mode = 0.75 v
// We are using the internal AVdd regulator with a nominal output of 1.72 V (see LDO_CTRL_REGISTER on page 123)
// Page 86 says to only set the common mode voltage to 0.9 v if AVdd >= 1.8... but it isn't on our hardware
// We also adjust the HPL and HPR gains to -2dB gian later in this config flow compensate (see page 47)
// (All pages refer to the TLV320AIC3204 Application Reference Guide)
ERROR_CHECK(this->write_byte(AIC3204_CM_CTRL, 0x40), "Set CM_CTRL failed");
// *** Set PowerTune Modes ***
// Set the Left & Right DAC PowerTune mode to PTM_P3/4. Use Class-AB driver.
ERROR_CHECK(this->write_byte(AIC3204_PLAY_CFG1, 0x00), "Set PLAY_CFG1 failed");
ERROR_CHECK(this->write_byte(AIC3204_PLAY_CFG2, 0x00), "Set PLAY_CFG2 failed");
// Set the REF charging time to 40ms
ERROR_CHECK(this->write_byte(AIC3204_REF_STARTUP, 0x01), "Set REF_STARTUP failed");
// HP soft stepping settings for optimal pop performance at power up
// Rpop used is 6k with N = 6 and soft step = 20usec. This should work with 47uF coupling
// capacitor. Can try N=5,6 or 7 time constants as well. Trade-off delay vs “pop” sound.
ERROR_CHECK(this->write_byte(AIC3204_HP_START, 0x25), "Set HP_START failed");
// Route Left DAC to HPL
ERROR_CHECK(this->write_byte(AIC3204_HPL_ROUTE, 0x08), "Set HPL_ROUTE failed");
// Route Right DAC to HPR
ERROR_CHECK(this->write_byte(AIC3204_HPR_ROUTE, 0x08), "Set HPR_ROUTE failed");
// Route Left DAC to LOL
ERROR_CHECK(this->write_byte(AIC3204_LOL_ROUTE, 0x08), "Set LOL_ROUTE failed");
// Route Right DAC to LOR
ERROR_CHECK(this->write_byte(AIC3204_LOR_ROUTE, 0x08), "Set LOR_ROUTE failed");
// Unmute HPL and set gain to -2dB (see comment before configuring the AIC3204_CM_CTRL register)
ERROR_CHECK(this->write_byte(AIC3204_HPL_GAIN, 0x3e), "Set HPL_GAIN failed");
// Unmute HPR and set gain to -2dB (see comment before configuring the AIC3204_CM_CTRL register)
ERROR_CHECK(this->write_byte(AIC3204_HPR_GAIN, 0x3e), "Set HPR_GAIN failed");
// Unmute LOL and set gain to 0dB
ERROR_CHECK(this->write_byte(AIC3204_LOL_DRV_GAIN, 0x00), "Set LOL_DRV_GAIN failed");
// Unmute LOR and set gain to 0dB
ERROR_CHECK(this->write_byte(AIC3204_LOR_DRV_GAIN, 0x00), "Set LOR_DRV_GAIN failed");
// Power up HPL and HPR, LOL and LOR drivers
ERROR_CHECK(this->write_byte(AIC3204_OP_PWR_CTRL, 0x3C), "Set OP_PWR_CTRL failed");
// Wait for 2.5 sec for soft stepping to take effect before attempting power-up
this->set_timeout(2500, [this]() {
// *** Power Up DAC ***
// Select Page 0
ERROR_CHECK(this->write_byte(AIC3204_PAGE_CTRL, 0x00), "Set PAGE_CTRL failed");
// Power up the Left and Right DAC Channels. Route Left data to Left DAC and Right data to Right DAC.
// DAC Vol control soft step 1 step per DAC word clock.
ERROR_CHECK(this->write_byte(AIC3204_DAC_CH_SET1, 0xd4), "Set DAC_CH_SET1 failed");
// Set left and right DAC digital volume control
ERROR_CHECK(this->write_volume_(), "Set volume failed");
// Unmute left and right channels
ERROR_CHECK(this->write_mute_(), "Set mute failed");
});
}
void AIC3204::dump_config() {
ESP_LOGCONFIG(TAG, "AIC3204:");
LOG_I2C_DEVICE(this);
if (this->is_failed()) {
ESP_LOGE(TAG, "Communication with AIC3204 failed");
}
}
bool AIC3204::set_mute_off() {
this->is_muted_ = false;
return this->write_mute_();
}
bool AIC3204::set_mute_on() {
this->is_muted_ = true;
return this->write_mute_();
}
bool AIC3204::set_auto_mute_mode(uint8_t auto_mute_mode) {
this->auto_mute_mode_ = auto_mute_mode & 0x07;
ESP_LOGVV(TAG, "Setting auto_mute_mode to 0x%.2x", this->auto_mute_mode_);
return this->write_mute_();
}
bool AIC3204::set_volume(float volume) {
this->volume_ = clamp<float>(volume, 0.0, 1.0);
return this->write_volume_();
}
bool AIC3204::is_muted() { return this->is_muted_; }
float AIC3204::volume() { return this->volume_; }
bool AIC3204::write_mute_() {
uint8_t mute_mode_byte = this->auto_mute_mode_ << 4; // auto-mute control is bits 4-6
mute_mode_byte |= this->is_muted_ ? 0x0c : 0x00; // mute bits are 2-3
if (!this->write_byte(AIC3204_PAGE_CTRL, 0x00) || !this->write_byte(AIC3204_DAC_CH_SET2, mute_mode_byte)) {
ESP_LOGE(TAG, "Writing mute modes failed");
return false;
}
return true;
}
bool AIC3204::write_volume_() {
const int8_t dvc_min_byte = -127;
const int8_t dvc_max_byte = 48;
int8_t volume_byte = dvc_min_byte + (this->volume_ * (dvc_max_byte - dvc_min_byte));
volume_byte = clamp<int8_t>(volume_byte, dvc_min_byte, dvc_max_byte);
ESP_LOGVV(TAG, "Setting volume to 0x%.2x", volume_byte & 0xFF);
if ((!this->write_byte(AIC3204_PAGE_CTRL, 0x00)) || (!this->write_byte(AIC3204_DACL_VOL_D, volume_byte)) ||
(!this->write_byte(AIC3204_DACR_VOL_D, volume_byte))) {
ESP_LOGE(TAG, "Writing volume failed");
return false;
}
return true;
}
} // namespace aic3204
} // namespace esphome

View File

@@ -0,0 +1,88 @@
#pragma once
#include "esphome/components/audio_dac/audio_dac.h"
#include "esphome/components/i2c/i2c.h"
#include "esphome/core/component.h"
#include "esphome/core/defines.h"
#include "esphome/core/hal.h"
namespace esphome {
namespace aic3204 {
// TLV320AIC3204 Register Addresses
// Page 0
static const uint8_t AIC3204_PAGE_CTRL = 0x00; // Register 0 - Page Control
static const uint8_t AIC3204_SW_RST = 0x01; // Register 1 - Software Reset
static const uint8_t AIC3204_CLK_PLL1 = 0x04; // Register 4 - Clock Setting Register 1, Multiplexers
static const uint8_t AIC3204_CLK_PLL2 = 0x05; // Register 5 - Clock Setting Register 2, P and R values
static const uint8_t AIC3204_CLK_PLL3 = 0x06; // Register 6 - Clock Setting Register 3, J values
static const uint8_t AIC3204_NDAC = 0x0B; // Register 11 - NDAC Divider Value
static const uint8_t AIC3204_MDAC = 0x0C; // Register 12 - MDAC Divider Value
static const uint8_t AIC3204_DOSR = 0x0E; // Register 14 - DOSR Divider Value (LS Byte)
static const uint8_t AIC3204_NADC = 0x12; // Register 18 - NADC Divider Value
static const uint8_t AIC3204_MADC = 0x13; // Register 19 - MADC Divider Value
static const uint8_t AIC3204_AOSR = 0x14; // Register 20 - AOSR Divider Value
static const uint8_t AIC3204_CODEC_IF = 0x1B; // Register 27 - CODEC Interface Control
static const uint8_t AIC3204_AUDIO_IF_4 = 0x1F; // Register 31 - Audio Interface Setting Register 4
static const uint8_t AIC3204_AUDIO_IF_5 = 0x20; // Register 32 - Audio Interface Setting Register 5
static const uint8_t AIC3204_SCLK_MFP3 = 0x38; // Register 56 - SCLK/MFP3 Function Control
static const uint8_t AIC3204_DAC_SIG_PROC = 0x3C; // Register 60 - DAC Sig Processing Block Control
static const uint8_t AIC3204_ADC_SIG_PROC = 0x3D; // Register 61 - ADC Sig Processing Block Control
static const uint8_t AIC3204_DAC_CH_SET1 = 0x3F; // Register 63 - DAC Channel Setup 1
static const uint8_t AIC3204_DAC_CH_SET2 = 0x40; // Register 64 - DAC Channel Setup 2
static const uint8_t AIC3204_DACL_VOL_D = 0x41; // Register 65 - DAC Left Digital Vol Control
static const uint8_t AIC3204_DACR_VOL_D = 0x42; // Register 66 - DAC Right Digital Vol Control
static const uint8_t AIC3204_DRC_ENABLE = 0x44;
static const uint8_t AIC3204_ADC_CH_SET = 0x51; // Register 81 - ADC Channel Setup
static const uint8_t AIC3204_ADC_FGA_MUTE = 0x52; // Register 82 - ADC Fine Gain Adjust/Mute
// Page 1
static const uint8_t AIC3204_PWR_CFG = 0x01; // Register 1 - Power Config
static const uint8_t AIC3204_LDO_CTRL = 0x02; // Register 2 - LDO Control
static const uint8_t AIC3204_PLAY_CFG1 = 0x03; // Register 3 - Playback Config 1
static const uint8_t AIC3204_PLAY_CFG2 = 0x04; // Register 4 - Playback Config 2
static const uint8_t AIC3204_OP_PWR_CTRL = 0x09; // Register 9 - Output Driver Power Control
static const uint8_t AIC3204_CM_CTRL = 0x0A; // Register 10 - Common Mode Control
static const uint8_t AIC3204_HPL_ROUTE = 0x0C; // Register 12 - HPL Routing Select
static const uint8_t AIC3204_HPR_ROUTE = 0x0D; // Register 13 - HPR Routing Select
static const uint8_t AIC3204_LOL_ROUTE = 0x0E; // Register 14 - LOL Routing Selection
static const uint8_t AIC3204_LOR_ROUTE = 0x0F; // Register 15 - LOR Routing Selection
static const uint8_t AIC3204_HPL_GAIN = 0x10; // Register 16 - HPL Driver Gain
static const uint8_t AIC3204_HPR_GAIN = 0x11; // Register 17 - HPR Driver Gain
static const uint8_t AIC3204_LOL_DRV_GAIN = 0x12; // Register 18 - LOL Driver Gain Setting
static const uint8_t AIC3204_LOR_DRV_GAIN = 0x13; // Register 19 - LOR Driver Gain Setting
static const uint8_t AIC3204_HP_START = 0x14; // Register 20 - Headphone Driver Startup
static const uint8_t AIC3204_LPGA_P_ROUTE = 0x34; // Register 52 - Left PGA Positive Input Route
static const uint8_t AIC3204_LPGA_N_ROUTE = 0x36; // Register 54 - Left PGA Negative Input Route
static const uint8_t AIC3204_RPGA_P_ROUTE = 0x37; // Register 55 - Right PGA Positive Input Route
static const uint8_t AIC3204_RPGA_N_ROUTE = 0x39; // Register 57 - Right PGA Negative Input Route
static const uint8_t AIC3204_LPGA_VOL = 0x3B; // Register 59 - Left PGA Volume
static const uint8_t AIC3204_RPGA_VOL = 0x3C; // Register 60 - Right PGA Volume
static const uint8_t AIC3204_ADC_PTM = 0x3D; // Register 61 - ADC Power Tune Config
static const uint8_t AIC3204_AN_IN_CHRG = 0x47; // Register 71 - Analog Input Quick Charging Config
static const uint8_t AIC3204_REF_STARTUP = 0x7B; // Register 123 - Reference Power Up Config
class AIC3204 : public audio_dac::AudioDac, public Component, public i2c::I2CDevice {
public:
void setup() override;
void dump_config() override;
float get_setup_priority() const override { return setup_priority::DATA; }
bool set_mute_off() override;
bool set_mute_on() override;
bool set_auto_mute_mode(uint8_t auto_mute_mode);
bool set_volume(float volume) override;
bool is_muted() override;
float volume() override;
protected:
bool write_mute_();
bool write_volume_();
uint8_t auto_mute_mode_{0};
float volume_{0};
};
} // namespace aic3204
} // namespace esphome

View File

@@ -0,0 +1,52 @@
from esphome import automation
import esphome.codegen as cg
from esphome.components import i2c
from esphome.components.audio_dac import AudioDac
import esphome.config_validation as cv
from esphome.const import CONF_ID, CONF_MODE
CODEOWNERS = ["@kbx81"]
DEPENDENCIES = ["i2c"]
aic3204_ns = cg.esphome_ns.namespace("aic3204")
AIC3204 = aic3204_ns.class_("AIC3204", AudioDac, cg.Component, i2c.I2CDevice)
SetAutoMuteAction = aic3204_ns.class_("SetAutoMuteAction", automation.Action)
CONFIG_SCHEMA = (
cv.Schema(
{
cv.GenerateID(): cv.declare_id(AIC3204),
}
)
.extend(cv.COMPONENT_SCHEMA)
.extend(i2c.i2c_device_schema(0x18))
)
SET_AUTO_MUTE_ACTION_SCHEMA = cv.maybe_simple_value(
{
cv.GenerateID(): cv.use_id(AIC3204),
cv.Required(CONF_MODE): cv.templatable(cv.int_range(max=7, min=0)),
},
key=CONF_MODE,
)
@automation.register_action(
"aic3204.set_auto_mute_mode", SetAutoMuteAction, SET_AUTO_MUTE_ACTION_SCHEMA
)
async def aic3204_set_volume_to_code(config, action_id, template_arg, args):
paren = await cg.get_variable(config[CONF_ID])
var = cg.new_Pvariable(action_id, template_arg, paren)
template_ = await cg.templatable(config.get(CONF_MODE), args, int)
cg.add(var.set_auto_mute_mode(template_))
return var
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config)
await i2c.register_i2c_device(var, config)

View File

@@ -0,0 +1,23 @@
#pragma once
#include "esphome/core/automation.h"
#include "esphome/core/component.h"
#include "aic3204.h"
namespace esphome {
namespace aic3204 {
template<typename... Ts> class SetAutoMuteAction : public Action<Ts...> {
public:
explicit SetAutoMuteAction(AIC3204 *aic3204) : aic3204_(aic3204) {}
TEMPLATABLE_VALUE(uint8_t, auto_mute_mode)
void play(Ts... x) override { this->aic3204_->set_auto_mute_mode(this->auto_mute_mode_.value(x...)); }
protected:
AIC3204 *aic3204_;
};
} // namespace aic3204
} // namespace esphome

View File

@@ -14,8 +14,6 @@ void AirthingsWavePlus::read_sensors(uint8_t *raw_value, uint16_t value_len) {
ESP_LOGD(TAG, "version = %d", value->version);
if (value->version == 1) {
ESP_LOGD(TAG, "ambient light = %d", value->ambientLight);
if (this->humidity_sensor_ != nullptr) {
this->humidity_sensor_->publish_state(value->humidity / 2.0f);
}
@@ -43,6 +41,10 @@ void AirthingsWavePlus::read_sensors(uint8_t *raw_value, uint16_t value_len) {
if ((this->tvoc_sensor_ != nullptr) && this->is_valid_voc_value_(value->voc)) {
this->tvoc_sensor_->publish_state(value->voc);
}
if (this->illuminance_sensor_ != nullptr) {
this->illuminance_sensor_->publish_state(value->ambientLight);
}
} else {
ESP_LOGE(TAG, "Invalid payload version (%d != 1, newer version or not a Wave Plus?)", value->version);
}
@@ -68,6 +70,7 @@ void AirthingsWavePlus::dump_config() {
LOG_SENSOR(" ", "Radon", this->radon_sensor_);
LOG_SENSOR(" ", "Radon Long Term", this->radon_long_term_sensor_);
LOG_SENSOR(" ", "CO2", this->co2_sensor_);
LOG_SENSOR(" ", "Illuminance", this->illuminance_sensor_);
}
AirthingsWavePlus::AirthingsWavePlus() {

View File

@@ -22,6 +22,7 @@ class AirthingsWavePlus : public airthings_wave_base::AirthingsWaveBase {
void set_radon(sensor::Sensor *radon) { radon_sensor_ = radon; }
void set_radon_long_term(sensor::Sensor *radon_long_term) { radon_long_term_sensor_ = radon_long_term; }
void set_co2(sensor::Sensor *co2) { co2_sensor_ = co2; }
void set_illuminance(sensor::Sensor *illuminance) { illuminance_sensor_ = illuminance; }
protected:
bool is_valid_radon_value_(uint16_t radon);
@@ -32,6 +33,7 @@ class AirthingsWavePlus : public airthings_wave_base::AirthingsWaveBase {
sensor::Sensor *radon_sensor_{nullptr};
sensor::Sensor *radon_long_term_sensor_{nullptr};
sensor::Sensor *co2_sensor_{nullptr};
sensor::Sensor *illuminance_sensor_{nullptr};
struct WavePlusReadings {
uint8_t version;

View File

@@ -12,6 +12,9 @@ from esphome.const import (
CONF_CO2,
UNIT_BECQUEREL_PER_CUBIC_METER,
UNIT_PARTS_PER_MILLION,
CONF_ILLUMINANCE,
UNIT_LUX,
DEVICE_CLASS_ILLUMINANCE,
)
DEPENDENCIES = airthings_wave_base.DEPENDENCIES
@@ -45,6 +48,12 @@ CONFIG_SCHEMA = airthings_wave_base.BASE_SCHEMA.extend(
device_class=DEVICE_CLASS_CARBON_DIOXIDE,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_ILLUMINANCE): sensor.sensor_schema(
unit_of_measurement=UNIT_LUX,
accuracy_decimals=0,
device_class=DEVICE_CLASS_ILLUMINANCE,
state_class=STATE_CLASS_MEASUREMENT,
),
}
)
@@ -62,3 +71,6 @@ async def to_code(config):
if config_co2 := config.get(CONF_CO2):
sens = await sensor.new_sensor(config_co2)
cg.add(var.set_co2(sens))
if config_illuminance := config.get(CONF_ILLUMINANCE):
sens = await sensor.new_sensor(config_illuminance)
cg.add(var.set_illuminance(sens))

View File

@@ -1,14 +1,17 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation
from esphome.automation import maybe_simple_id
from esphome.core import CORE, coroutine_with_priority
import esphome.codegen as cg
from esphome.components import mqtt, web_server
import esphome.config_validation as cv
from esphome.const import (
CONF_CODE,
CONF_ID,
CONF_MQTT_ID,
CONF_ON_STATE,
CONF_TRIGGER_ID,
CONF_CODE,
CONF_WEB_SERVER,
)
from esphome.core import CORE, coroutine_with_priority
from esphome.cpp_helpers import setup_entity
CODEOWNERS = ["@grahambrown11", "@hwstar"]
@@ -75,65 +78,72 @@ AlarmControlPanelCondition = alarm_control_panel_ns.class_(
"AlarmControlPanelCondition", automation.Condition
)
ALARM_CONTROL_PANEL_SCHEMA = cv.ENTITY_BASE_SCHEMA.extend(
{
cv.GenerateID(): cv.declare_id(AlarmControlPanel),
cv.Optional(CONF_ON_STATE): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(StateTrigger),
}
),
cv.Optional(CONF_ON_TRIGGERED): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(TriggeredTrigger),
}
),
cv.Optional(CONF_ON_ARMING): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(ArmingTrigger),
}
),
cv.Optional(CONF_ON_PENDING): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(PendingTrigger),
}
),
cv.Optional(CONF_ON_ARMED_HOME): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(ArmedHomeTrigger),
}
),
cv.Optional(CONF_ON_ARMED_NIGHT): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(ArmedNightTrigger),
}
),
cv.Optional(CONF_ON_ARMED_AWAY): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(ArmedAwayTrigger),
}
),
cv.Optional(CONF_ON_DISARMED): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(DisarmedTrigger),
}
),
cv.Optional(CONF_ON_CLEARED): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(ClearedTrigger),
}
),
cv.Optional(CONF_ON_CHIME): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(ChimeTrigger),
}
),
cv.Optional(CONF_ON_READY): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(ReadyTrigger),
}
),
}
ALARM_CONTROL_PANEL_SCHEMA = (
cv.ENTITY_BASE_SCHEMA.extend(web_server.WEBSERVER_SORTING_SCHEMA)
.extend(cv.MQTT_COMMAND_COMPONENT_SCHEMA)
.extend(
{
cv.GenerateID(): cv.declare_id(AlarmControlPanel),
cv.OnlyWith(CONF_MQTT_ID, "mqtt"): cv.declare_id(
mqtt.MQTTAlarmControlPanelComponent
),
cv.Optional(CONF_ON_STATE): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(StateTrigger),
}
),
cv.Optional(CONF_ON_TRIGGERED): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(TriggeredTrigger),
}
),
cv.Optional(CONF_ON_ARMING): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(ArmingTrigger),
}
),
cv.Optional(CONF_ON_PENDING): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(PendingTrigger),
}
),
cv.Optional(CONF_ON_ARMED_HOME): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(ArmedHomeTrigger),
}
),
cv.Optional(CONF_ON_ARMED_NIGHT): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(ArmedNightTrigger),
}
),
cv.Optional(CONF_ON_ARMED_AWAY): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(ArmedAwayTrigger),
}
),
cv.Optional(CONF_ON_DISARMED): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(DisarmedTrigger),
}
),
cv.Optional(CONF_ON_CLEARED): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(ClearedTrigger),
}
),
cv.Optional(CONF_ON_CHIME): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(ChimeTrigger),
}
),
cv.Optional(CONF_ON_READY): automation.validate_automation(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(ReadyTrigger),
}
),
}
)
)
ALARM_CONTROL_PANEL_ACTION_SCHEMA = maybe_simple_id(
@@ -185,6 +195,11 @@ async def setup_alarm_control_panel_core_(var, config):
for conf in config.get(CONF_ON_READY, []):
trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var)
await automation.build_automation(trigger, [], conf)
if web_server_config := config.get(CONF_WEB_SERVER):
await web_server.add_entity_config(var, web_server_config)
if mqtt_id := config.get(CONF_MQTT_ID):
mqtt_ = cg.new_Pvariable(mqtt_id, var)
await mqtt.register_mqtt_component(mqtt_, config)
async def register_alarm_control_panel(var, config):

View File

@@ -72,10 +72,9 @@ void AlarmControlPanelCall::validate_() {
this->state_.reset();
return;
}
if (state == ACP_STATE_DISARMED &&
!(this->parent_->is_state_armed(this->parent_->get_state()) ||
this->parent_->get_state() == ACP_STATE_PENDING || this->parent_->get_state() == ACP_STATE_ARMING ||
this->parent_->get_state() == ACP_STATE_TRIGGERED)) {
if (state == ACP_STATE_DISARMED && !this->parent_->is_state_armed(this->parent_->get_state()) &&
this->parent_->get_state() != ACP_STATE_PENDING && this->parent_->get_state() != ACP_STATE_ARMING &&
this->parent_->get_state() != ACP_STATE_TRIGGERED) {
ESP_LOGW(TAG, "Cannot disarm when not armed");
this->state_.reset();
return;

View File

@@ -1,20 +1,10 @@
import logging
from esphome import automation, core
from esphome.components import font
import esphome.components.image as espImage
from esphome.components.image import CONF_USE_TRANSPARENCY
import esphome.config_validation as cv
from esphome import automation
import esphome.codegen as cg
from esphome.const import (
CONF_FILE,
CONF_ID,
CONF_RAW_DATA_ID,
CONF_REPEAT,
CONF_RESIZE,
CONF_TYPE,
)
from esphome.core import CORE, HexInt
import esphome.components.image as espImage
import esphome.config_validation as cv
from esphome.const import CONF_ID, CONF_REPEAT
_LOGGER = logging.getLogger(__name__)
@@ -22,6 +12,7 @@ AUTO_LOAD = ["image"]
CODEOWNERS = ["@syndlex"]
DEPENDENCIES = ["display"]
MULTI_CONF = True
MULTI_CONF_NO_DEFAULT = True
CONF_LOOP = "loop"
CONF_START_FRAME = "start_frame"
@@ -43,52 +34,19 @@ SetFrameAction = animation_ns.class_(
"AnimationSetFrameAction", automation.Action, cg.Parented.template(Animation_)
)
def validate_cross_dependencies(config):
"""
Validate fields whose possible values depend on other fields.
For example, validate that explicitly transparent image types
have "use_transparency" set to True.
Also set the default value for those kind of dependent fields.
"""
image_type = config[CONF_TYPE]
is_transparent_type = image_type in ["TRANSPARENT_BINARY", "RGBA"]
# If the use_transparency option was not specified, set the default depending on the image type
if CONF_USE_TRANSPARENCY not in config:
config[CONF_USE_TRANSPARENCY] = is_transparent_type
if is_transparent_type and not config[CONF_USE_TRANSPARENCY]:
raise cv.Invalid(f"Image type {image_type} must always be transparent.")
return config
ANIMATION_SCHEMA = cv.Schema(
cv.All(
{
cv.Required(CONF_ID): cv.declare_id(Animation_),
cv.Required(CONF_FILE): cv.file_,
cv.Optional(CONF_RESIZE): cv.dimensions,
cv.Optional(CONF_TYPE, default="BINARY"): cv.enum(
espImage.IMAGE_TYPE, upper=True
),
# Not setting default here on purpose; the default depends on the image type,
# and thus will be set in the "validate_cross_dependencies" validator.
cv.Optional(CONF_USE_TRANSPARENCY): cv.boolean,
cv.Optional(CONF_LOOP): cv.All(
{
cv.Optional(CONF_START_FRAME, default=0): cv.positive_int,
cv.Optional(CONF_END_FRAME): cv.positive_int,
cv.Optional(CONF_REPEAT): cv.positive_int,
}
),
cv.GenerateID(CONF_RAW_DATA_ID): cv.declare_id(cg.uint8),
},
validate_cross_dependencies,
)
CONFIG_SCHEMA = espImage.IMAGE_SCHEMA.extend(
{
cv.Required(CONF_ID): cv.declare_id(Animation_),
cv.Optional(CONF_LOOP): cv.All(
{
cv.Optional(CONF_START_FRAME, default=0): cv.positive_int,
cv.Optional(CONF_END_FRAME): cv.positive_int,
cv.Optional(CONF_REPEAT): cv.positive_int,
}
),
},
)
CONFIG_SCHEMA = cv.All(font.validate_pillow_installed, ANIMATION_SCHEMA)
NEXT_FRAME_SCHEMA = automation.maybe_simple_id(
{
@@ -122,175 +80,26 @@ async def animation_action_to_code(config, action_id, template_arg, args):
async def to_code(config):
from PIL import Image
(
prog_arr,
width,
height,
image_type,
trans_value,
frame_count,
) = await espImage.write_image(config, all_frames=True)
path = CORE.relative_config_path(config[CONF_FILE])
try:
image = Image.open(path)
except Exception as e:
raise core.EsphomeError(f"Could not load image file {path}: {e}")
width, height = image.size
frames = image.n_frames
if CONF_RESIZE in config:
new_width_max, new_height_max = config[CONF_RESIZE]
ratio = min(new_width_max / width, new_height_max / height)
width, height = int(width * ratio), int(height * ratio)
else:
if width > 500 or height > 500:
_LOGGER.warning(
'The image "%s" you requested is very big. Please consider'
" using the resize parameter.",
path,
)
transparent = config[CONF_USE_TRANSPARENCY]
if config[CONF_TYPE] == "GRAYSCALE":
data = [0 for _ in range(height * width * frames)]
pos = 0
for frameIndex in range(frames):
image.seek(frameIndex)
frame = image.convert("LA", dither=Image.Dither.NONE)
if CONF_RESIZE in config:
frame = frame.resize([width, height])
pixels = list(frame.getdata())
if len(pixels) != height * width:
raise core.EsphomeError(
f"Unexpected number of pixels in {path} frame {frameIndex}: ({len(pixels)} != {height*width})"
)
for pix, a in pixels:
if transparent:
if pix == 1:
pix = 0
if a < 0x80:
pix = 1
data[pos] = pix
pos += 1
elif config[CONF_TYPE] == "RGBA":
data = [0 for _ in range(height * width * 4 * frames)]
pos = 0
for frameIndex in range(frames):
image.seek(frameIndex)
frame = image.convert("RGBA")
if CONF_RESIZE in config:
frame = frame.resize([width, height])
pixels = list(frame.getdata())
if len(pixels) != height * width:
raise core.EsphomeError(
f"Unexpected number of pixels in {path} frame {frameIndex}: ({len(pixels)} != {height*width})"
)
for pix in pixels:
data[pos] = pix[0]
pos += 1
data[pos] = pix[1]
pos += 1
data[pos] = pix[2]
pos += 1
data[pos] = pix[3]
pos += 1
elif config[CONF_TYPE] == "RGB24":
data = [0 for _ in range(height * width * 3 * frames)]
pos = 0
for frameIndex in range(frames):
image.seek(frameIndex)
frame = image.convert("RGBA")
if CONF_RESIZE in config:
frame = frame.resize([width, height])
pixels = list(frame.getdata())
if len(pixels) != height * width:
raise core.EsphomeError(
f"Unexpected number of pixels in {path} frame {frameIndex}: ({len(pixels)} != {height*width})"
)
for r, g, b, a in pixels:
if transparent:
if r == 0 and g == 0 and b == 1:
b = 0
if a < 0x80:
r = 0
g = 0
b = 1
data[pos] = r
pos += 1
data[pos] = g
pos += 1
data[pos] = b
pos += 1
elif config[CONF_TYPE] in ["RGB565", "TRANSPARENT_IMAGE"]:
data = [0 for _ in range(height * width * 2 * frames)]
pos = 0
for frameIndex in range(frames):
image.seek(frameIndex)
frame = image.convert("RGBA")
if CONF_RESIZE in config:
frame = frame.resize([width, height])
pixels = list(frame.getdata())
if len(pixels) != height * width:
raise core.EsphomeError(
f"Unexpected number of pixels in {path} frame {frameIndex}: ({len(pixels)} != {height*width})"
)
for r, g, b, a in pixels:
R = r >> 3
G = g >> 2
B = b >> 3
rgb = (R << 11) | (G << 5) | B
if transparent:
if rgb == 0x0020:
rgb = 0
if a < 0x80:
rgb = 0x0020
data[pos] = rgb >> 8
pos += 1
data[pos] = rgb & 0xFF
pos += 1
elif config[CONF_TYPE] in ["BINARY", "TRANSPARENT_BINARY"]:
width8 = ((width + 7) // 8) * 8
data = [0 for _ in range((height * width8 // 8) * frames)]
for frameIndex in range(frames):
image.seek(frameIndex)
if transparent:
alpha = image.split()[-1]
has_alpha = alpha.getextrema()[0] < 0xFF
frame = image.convert("1", dither=Image.Dither.NONE)
if CONF_RESIZE in config:
frame = frame.resize([width, height])
if transparent:
alpha = alpha.resize([width, height])
for x, y in [(i, j) for i in range(width) for j in range(height)]:
if transparent and has_alpha:
if not alpha.getpixel((x, y)):
continue
elif frame.getpixel((x, y)):
continue
pos = x + y * width8 + (height * width8 * frameIndex)
data[pos // 8] |= 0x80 >> (pos % 8)
else:
raise core.EsphomeError(
f"Animation f{config[CONF_ID]} has not supported type {config[CONF_TYPE]}."
)
rhs = [HexInt(x) for x in data]
prog_arr = cg.progmem_array(config[CONF_RAW_DATA_ID], rhs)
var = cg.new_Pvariable(
config[CONF_ID],
prog_arr,
width,
height,
frames,
espImage.IMAGE_TYPE[config[CONF_TYPE]],
frame_count,
image_type,
trans_value,
)
cg.add(var.set_transparency(transparent))
if loop_config := config.get(CONF_LOOP):
start = loop_config[CONF_START_FRAME]
end = loop_config.get(CONF_END_FRAME, frames)
end = loop_config.get(CONF_END_FRAME, frame_count)
count = loop_config.get(CONF_REPEAT, -1)
cg.add(var.set_loop(start, end, count))

View File

@@ -6,8 +6,8 @@ namespace esphome {
namespace animation {
Animation::Animation(const uint8_t *data_start, int width, int height, uint32_t animation_frame_count,
image::ImageType type)
: Image(data_start, width, height, type),
image::ImageType type, image::Transparency transparent)
: Image(data_start, width, height, type, transparent),
animation_data_start_(data_start),
current_frame_(0),
animation_frame_count_(animation_frame_count),
@@ -62,7 +62,7 @@ void Animation::set_frame(int frame) {
}
void Animation::update_data_start_() {
const uint32_t image_size = image_type_to_width_stride(this->width_, this->type_) * this->height_;
const uint32_t image_size = this->get_width_stride() * this->height_;
this->data_start_ = this->animation_data_start_ + image_size * this->current_frame_;
}

View File

@@ -8,7 +8,8 @@ namespace animation {
class Animation : public image::Image {
public:
Animation(const uint8_t *data_start, int width, int height, uint32_t animation_frame_count, image::ImageType type);
Animation(const uint8_t *data_start, int width, int height, uint32_t animation_frame_count, image::ImageType type,
image::Transparency transparent);
uint32_t get_animation_frame_count() const;
int get_current_frame() const;

View File

@@ -0,0 +1,4 @@
# Based on this datasheet:
# https://www.mouser.ca/datasheet/2/678/AVGO_S_A0002854364_1-2574547.pdf
CODEOWNERS = ["@aodrenah"]

View File

@@ -0,0 +1,152 @@
// Based on this datasheet:
// https://www.mouser.ca/datasheet/2/678/AVGO_S_A0002854364_1-2574547.pdf
#include "apds9306.h"
#include "esphome/core/helpers.h"
#include "esphome/core/log.h"
namespace esphome {
namespace apds9306 {
static const char *const TAG = "apds9306";
enum { // APDS9306 registers
APDS9306_MAIN_CTRL = 0x00,
APDS9306_ALS_MEAS_RATE = 0x04,
APDS9306_ALS_GAIN = 0x05,
APDS9306_PART_ID = 0x06,
APDS9306_MAIN_STATUS = 0x07,
APDS9306_CLEAR_DATA_0 = 0x0A, // LSB
APDS9306_CLEAR_DATA_1 = 0x0B,
APDS9306_CLEAR_DATA_2 = 0x0C, // MSB
APDS9306_ALS_DATA_0 = 0x0D, // LSB
APDS9306_ALS_DATA_1 = 0x0E,
APDS9306_ALS_DATA_2 = 0x0F, // MSB
APDS9306_INT_CFG = 0x19,
APDS9306_INT_PERSISTENCE = 0x1A,
APDS9306_ALS_THRES_UP_0 = 0x21, // LSB
APDS9306_ALS_THRES_UP_1 = 0x22,
APDS9306_ALS_THRES_UP_2 = 0x23, // MSB
APDS9306_ALS_THRES_LOW_0 = 0x24, // LSB
APDS9306_ALS_THRES_LOW_1 = 0x25,
APDS9306_ALS_THRES_LOW_2 = 0x26, // MSB
APDS9306_ALS_THRES_VAR = 0x27
};
#define APDS9306_ERROR_CHECK(func, error) \
if (!(func)) { \
ESP_LOGE(TAG, error); \
this->mark_failed(); \
return; \
}
#define APDS9306_WARNING_CHECK(func, warning) \
if (!(func)) { \
ESP_LOGW(TAG, warning); \
this->status_set_warning(); \
return; \
}
#define APDS9306_WRITE_BYTE(reg, value) \
ESP_LOGV(TAG, "Writing 0x%02x to 0x%02x", value, reg); \
if (!this->write_byte(reg, value)) { \
ESP_LOGE(TAG, "Failed writing 0x%02x to 0x%02x", value, reg); \
this->mark_failed(); \
return; \
}
void APDS9306::setup() {
ESP_LOGCONFIG(TAG, "Setting up APDS9306...");
uint8_t id;
if (!this->read_byte(APDS9306_PART_ID, &id)) { // Part ID register
this->error_code_ = COMMUNICATION_FAILED;
this->mark_failed();
return;
}
if (id != 0xB1 && id != 0xB3) { // 0xB1 for APDS9306 0xB3 for APDS9306-065
this->error_code_ = WRONG_ID;
this->mark_failed();
return;
}
// ALS resolution and measurement, see datasheet or init.py for options
uint8_t als_meas_rate = ((this->bit_width_ & 0x07) << 4) | (this->measurement_rate_ & 0x07);
APDS9306_WRITE_BYTE(APDS9306_ALS_MEAS_RATE, als_meas_rate);
// ALS gain, see datasheet or init.py for options
uint8_t als_gain = (this->gain_ & 0x07);
APDS9306_WRITE_BYTE(APDS9306_ALS_GAIN, als_gain);
// Set to standby mode
APDS9306_WRITE_BYTE(APDS9306_MAIN_CTRL, 0x00);
// Check for data, clear main status
uint8_t status;
APDS9306_WARNING_CHECK(this->read_byte(APDS9306_MAIN_STATUS, &status), "Reading MAIN STATUS failed.");
// Set to active mode
APDS9306_WRITE_BYTE(APDS9306_MAIN_CTRL, 0x02);
ESP_LOGCONFIG(TAG, "APDS9306 setup complete");
}
void APDS9306::dump_config() {
LOG_SENSOR("", "APDS9306", this);
LOG_I2C_DEVICE(this);
if (this->is_failed()) {
switch (this->error_code_) {
case COMMUNICATION_FAILED:
ESP_LOGE(TAG, "Communication with APDS9306 failed!");
break;
case WRONG_ID:
ESP_LOGE(TAG, "APDS9306 has invalid id!");
break;
default:
ESP_LOGE(TAG, "Setting up APDS9306 registers failed!");
break;
}
}
ESP_LOGCONFIG(TAG, " Gain: %u", AMBIENT_LIGHT_GAIN_VALUES[this->gain_]);
ESP_LOGCONFIG(TAG, " Measurement rate: %u", MEASUREMENT_RATE_VALUES[this->measurement_rate_]);
ESP_LOGCONFIG(TAG, " Measurement Resolution/Bit width: %d", MEASUREMENT_BIT_WIDTH_VALUES[this->bit_width_]);
LOG_UPDATE_INTERVAL(this);
}
void APDS9306::update() {
// Check for new data
uint8_t status;
APDS9306_WARNING_CHECK(this->read_byte(APDS9306_MAIN_STATUS, &status), "Reading MAIN STATUS failed.");
this->status_clear_warning();
status &= 0b00001000;
if (!status) { // No new data
return;
}
// Set to standby mode
APDS9306_WRITE_BYTE(APDS9306_MAIN_CTRL, 0x00);
// Clear MAIN STATUS
APDS9306_WARNING_CHECK(this->read_byte(APDS9306_MAIN_STATUS, &status), "Reading MAIN STATUS failed.");
uint8_t als_data[3];
APDS9306_WARNING_CHECK(this->read_bytes(APDS9306_ALS_DATA_0, als_data, 3), "Reading ALS data has failed.");
// Set to active mode
APDS9306_WRITE_BYTE(APDS9306_MAIN_CTRL, 0x02);
uint32_t light_level = 0x00 | encode_uint24(als_data[2], als_data[1], als_data[0]);
float lux = ((float) light_level / AMBIENT_LIGHT_GAIN_VALUES[this->gain_]) *
(100.0f / MEASUREMENT_RATE_VALUES[this->measurement_rate_]);
ESP_LOGD(TAG, "Got illuminance=%.1flx from", lux);
this->publish_state(lux);
}
} // namespace apds9306
} // namespace esphome

View File

@@ -0,0 +1,66 @@
// Based on this datasheet:
// https://www.mouser.ca/datasheet/2/678/AVGO_S_A0002854364_1-2574547.pdf
#pragma once
#include "esphome/components/i2c/i2c.h"
#include "esphome/components/sensor/sensor.h"
#include "esphome/core/component.h"
namespace esphome {
namespace apds9306 {
enum MeasurementBitWidth : uint8_t {
MEASUREMENT_BIT_WIDTH_20 = 0,
MEASUREMENT_BIT_WIDTH_19 = 1,
MEASUREMENT_BIT_WIDTH_18 = 2,
MEASUREMENT_BIT_WIDTH_17 = 3,
MEASUREMENT_BIT_WIDTH_16 = 4,
MEASUREMENT_BIT_WIDTH_13 = 5,
};
static const uint8_t MEASUREMENT_BIT_WIDTH_VALUES[] = {20, 19, 18, 17, 16, 13};
enum MeasurementRate : uint8_t {
MEASUREMENT_RATE_25 = 0,
MEASUREMENT_RATE_50 = 1,
MEASUREMENT_RATE_100 = 2,
MEASUREMENT_RATE_200 = 3,
MEASUREMENT_RATE_500 = 4,
MEASUREMENT_RATE_1000 = 5,
MEASUREMENT_RATE_2000 = 6,
};
static const uint16_t MEASUREMENT_RATE_VALUES[] = {25, 50, 100, 200, 500, 1000, 2000};
enum AmbientLightGain : uint8_t {
AMBIENT_LIGHT_GAIN_1 = 0,
AMBIENT_LIGHT_GAIN_3 = 1,
AMBIENT_LIGHT_GAIN_6 = 2,
AMBIENT_LIGHT_GAIN_9 = 3,
AMBIENT_LIGHT_GAIN_18 = 4,
};
static const uint8_t AMBIENT_LIGHT_GAIN_VALUES[] = {1, 3, 6, 9, 18};
class APDS9306 : public sensor::Sensor, public PollingComponent, public i2c::I2CDevice {
public:
void setup() override;
float get_setup_priority() const override { return setup_priority::BUS; }
void dump_config() override;
void update() override;
void set_bit_width(MeasurementBitWidth bit_width) { this->bit_width_ = bit_width; }
void set_measurement_rate(MeasurementRate measurement_rate) { this->measurement_rate_ = measurement_rate; }
void set_ambient_light_gain(AmbientLightGain gain) { this->gain_ = gain; }
protected:
enum ErrorCode {
NONE = 0,
COMMUNICATION_FAILED,
WRONG_ID,
} error_code_{NONE};
MeasurementBitWidth bit_width_;
MeasurementRate measurement_rate_;
AmbientLightGain gain_;
};
} // namespace apds9306
} // namespace esphome

View File

@@ -0,0 +1,95 @@
# Based on this datasheet:
# https://www.mouser.ca/datasheet/2/678/AVGO_S_A0002854364_1-2574547.pdf
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import i2c, sensor
from esphome.const import (
CONF_GAIN,
DEVICE_CLASS_ILLUMINANCE,
ICON_LIGHTBULB,
STATE_CLASS_MEASUREMENT,
UNIT_LUX,
)
DEPENDENCIES = ["i2c"]
CONF_APDS9306_ID = "apds9306_id"
CONF_BIT_WIDTH = "bit_width"
CONF_MEASUREMENT_RATE = "measurement_rate"
apds9306_ns = cg.esphome_ns.namespace("apds9306")
APDS9306 = apds9306_ns.class_(
"APDS9306", sensor.Sensor, cg.PollingComponent, i2c.I2CDevice
)
MeasurementBitWidth = apds9306_ns.enum("MeasurementBitWidth")
MeasurementRate = apds9306_ns.enum("MeasurementRate")
AmbientLightGain = apds9306_ns.enum("AmbientLightGain")
MEASUREMENT_BIT_WIDTHS = {
20: MeasurementBitWidth.MEASUREMENT_BIT_WIDTH_20,
19: MeasurementBitWidth.MEASUREMENT_BIT_WIDTH_19,
18: MeasurementBitWidth.MEASUREMENT_BIT_WIDTH_18,
17: MeasurementBitWidth.MEASUREMENT_BIT_WIDTH_17,
16: MeasurementBitWidth.MEASUREMENT_BIT_WIDTH_16,
13: MeasurementBitWidth.MEASUREMENT_BIT_WIDTH_13,
}
MEASUREMENT_RATES = {
25: MeasurementRate.MEASUREMENT_RATE_25,
50: MeasurementRate.MEASUREMENT_RATE_50,
100: MeasurementRate.MEASUREMENT_RATE_100,
200: MeasurementRate.MEASUREMENT_RATE_200,
500: MeasurementRate.MEASUREMENT_RATE_500,
1000: MeasurementRate.MEASUREMENT_RATE_1000,
2000: MeasurementRate.MEASUREMENT_RATE_2000,
}
AMBIENT_LIGHT_GAINS = {
1: AmbientLightGain.AMBIENT_LIGHT_GAIN_1,
3: AmbientLightGain.AMBIENT_LIGHT_GAIN_3,
6: AmbientLightGain.AMBIENT_LIGHT_GAIN_6,
9: AmbientLightGain.AMBIENT_LIGHT_GAIN_9,
18: AmbientLightGain.AMBIENT_LIGHT_GAIN_18,
}
def _validate_measurement_rate(value):
value = cv.positive_time_period_milliseconds(value)
return cv.enum(MEASUREMENT_RATES, int=True)(value.total_milliseconds)
CONFIG_SCHEMA = (
sensor.sensor_schema(
APDS9306,
unit_of_measurement=UNIT_LUX,
accuracy_decimals=1,
device_class=DEVICE_CLASS_ILLUMINANCE,
state_class=STATE_CLASS_MEASUREMENT,
icon=ICON_LIGHTBULB,
)
.extend(
{
cv.Optional(CONF_GAIN, default="1"): cv.enum(AMBIENT_LIGHT_GAINS, int=True),
cv.Optional(CONF_BIT_WIDTH, default="18"): cv.enum(
MEASUREMENT_BIT_WIDTHS, int=True
),
cv.Optional(
CONF_MEASUREMENT_RATE, default="100ms"
): _validate_measurement_rate,
}
)
.extend(cv.polling_component_schema("60s"))
.extend(i2c.i2c_device_schema(0x52))
)
async def to_code(config):
var = await sensor.new_sensor(config)
await cg.register_component(var, config)
await i2c.register_i2c_device(var, config)
cg.add(var.set_bit_width(config[CONF_BIT_WIDTH]))
cg.add(var.set_measurement_rate(config[CONF_MEASUREMENT_RATE]))
cg.add(var.set_ambient_light_gain(config[CONF_GAIN]))

View File

@@ -1,25 +1,27 @@
import base64
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation
from esphome.automation import Condition
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.const import (
CONF_ACTION,
CONF_ACTIONS,
CONF_DATA,
CONF_DATA_TEMPLATE,
CONF_EVENT,
CONF_ID,
CONF_KEY,
CONF_ON_CLIENT_CONNECTED,
CONF_ON_CLIENT_DISCONNECTED,
CONF_PASSWORD,
CONF_PORT,
CONF_REBOOT_TIMEOUT,
CONF_SERVICE,
CONF_VARIABLES,
CONF_SERVICES,
CONF_TRIGGER_ID,
CONF_EVENT,
CONF_TAG,
CONF_ON_CLIENT_CONNECTED,
CONF_ON_CLIENT_DISCONNECTED,
CONF_TRIGGER_ID,
CONF_VARIABLES,
)
from esphome.core import coroutine_with_priority
@@ -63,40 +65,51 @@ def validate_encryption_key(value):
return value
CONFIG_SCHEMA = cv.Schema(
ACTIONS_SCHEMA = automation.validate_automation(
{
cv.GenerateID(): cv.declare_id(APIServer),
cv.Optional(CONF_PORT, default=6053): cv.port,
cv.Optional(CONF_PASSWORD, default=""): cv.string_strict,
cv.Optional(
CONF_REBOOT_TIMEOUT, default="15min"
): cv.positive_time_period_milliseconds,
cv.Optional(CONF_SERVICES): automation.validate_automation(
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(UserServiceTrigger),
cv.Exclusive(CONF_SERVICE, group_of_exclusion=CONF_ACTION): cv.valid_name,
cv.Exclusive(CONF_ACTION, group_of_exclusion=CONF_ACTION): cv.valid_name,
cv.Optional(CONF_VARIABLES, default={}): cv.Schema(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(UserServiceTrigger),
cv.Required(CONF_SERVICE): cv.valid_name,
cv.Optional(CONF_VARIABLES, default={}): cv.Schema(
{
cv.validate_id_name: cv.one_of(
*SERVICE_ARG_NATIVE_TYPES, lower=True
),
}
),
cv.validate_id_name: cv.one_of(*SERVICE_ARG_NATIVE_TYPES, lower=True),
}
),
cv.Optional(CONF_ENCRYPTION): cv.Schema(
{
cv.Required(CONF_KEY): validate_encryption_key,
}
),
cv.Optional(CONF_ON_CLIENT_CONNECTED): automation.validate_automation(
single=True
),
cv.Optional(CONF_ON_CLIENT_DISCONNECTED): automation.validate_automation(
single=True
),
}
).extend(cv.COMPONENT_SCHEMA)
},
cv.All(
cv.has_exactly_one_key(CONF_SERVICE, CONF_ACTION),
cv.rename_key(CONF_SERVICE, CONF_ACTION),
),
)
CONFIG_SCHEMA = cv.All(
cv.Schema(
{
cv.GenerateID(): cv.declare_id(APIServer),
cv.Optional(CONF_PORT, default=6053): cv.port,
cv.Optional(CONF_PASSWORD, default=""): cv.string_strict,
cv.Optional(
CONF_REBOOT_TIMEOUT, default="15min"
): cv.positive_time_period_milliseconds,
cv.Exclusive(
CONF_SERVICES, 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.Required(CONF_KEY): validate_encryption_key,
}
),
cv.Optional(CONF_ON_CLIENT_CONNECTED): automation.validate_automation(
single=True
),
cv.Optional(CONF_ON_CLIENT_DISCONNECTED): automation.validate_automation(
single=True
),
}
).extend(cv.COMPONENT_SCHEMA),
cv.rename_key(CONF_SERVICES, CONF_ACTIONS),
)
@coroutine_with_priority(40.0)
@@ -108,7 +121,7 @@ async def to_code(config):
cg.add(var.set_password(config[CONF_PASSWORD]))
cg.add(var.set_reboot_timeout(config[CONF_REBOOT_TIMEOUT]))
for conf in config.get(CONF_SERVICES, []):
for conf in config.get(CONF_ACTIONS, []):
template_args = []
func_args = []
service_arg_names = []
@@ -119,7 +132,7 @@ async def to_code(config):
service_arg_names.append(name)
templ = cg.TemplateArguments(*template_args)
trigger = cg.new_Pvariable(
conf[CONF_TRIGGER_ID], templ, conf[CONF_SERVICE], service_arg_names
conf[CONF_TRIGGER_ID], templ, conf[CONF_ACTION], service_arg_names
)
cg.add(var.register_user_service(trigger))
await automation.build_automation(trigger, func_args, conf)
@@ -142,7 +155,7 @@ async def to_code(config):
decoded = base64.b64decode(encryption_config[CONF_KEY])
cg.add(var.set_noise_psk(list(decoded)))
cg.add_define("USE_API_NOISE")
cg.add_library("esphome/noise-c", "0.1.4")
cg.add_library("esphome/noise-c", "0.1.6")
else:
cg.add_define("USE_API_PLAINTEXT")
@@ -152,28 +165,43 @@ async def to_code(config):
KEY_VALUE_SCHEMA = cv.Schema({cv.string: cv.templatable(cv.string_strict)})
HOMEASSISTANT_SERVICE_ACTION_SCHEMA = cv.Schema(
{
cv.GenerateID(): cv.use_id(APIServer),
cv.Required(CONF_SERVICE): cv.templatable(cv.string),
cv.Optional(CONF_DATA, default={}): KEY_VALUE_SCHEMA,
cv.Optional(CONF_DATA_TEMPLATE, default={}): KEY_VALUE_SCHEMA,
cv.Optional(CONF_VARIABLES, default={}): cv.Schema(
{cv.string: cv.returning_lambda}
),
}
HOMEASSISTANT_ACTION_ACTION_SCHEMA = cv.All(
cv.Schema(
{
cv.GenerateID(): cv.use_id(APIServer),
cv.Exclusive(CONF_SERVICE, group_of_exclusion=CONF_ACTION): cv.templatable(
cv.string
),
cv.Exclusive(CONF_ACTION, group_of_exclusion=CONF_ACTION): cv.templatable(
cv.string
),
cv.Optional(CONF_DATA, default={}): KEY_VALUE_SCHEMA,
cv.Optional(CONF_DATA_TEMPLATE, default={}): KEY_VALUE_SCHEMA,
cv.Optional(CONF_VARIABLES, default={}): cv.Schema(
{cv.string: cv.returning_lambda}
),
}
),
cv.has_exactly_one_key(CONF_SERVICE, CONF_ACTION),
cv.rename_key(CONF_SERVICE, CONF_ACTION),
)
@automation.register_action(
"homeassistant.action",
HomeAssistantServiceCallAction,
HOMEASSISTANT_ACTION_ACTION_SCHEMA,
)
@automation.register_action(
"homeassistant.service",
HomeAssistantServiceCallAction,
HOMEASSISTANT_SERVICE_ACTION_SCHEMA,
HOMEASSISTANT_ACTION_ACTION_SCHEMA,
)
async def homeassistant_service_to_code(config, action_id, template_arg, args):
serv = await cg.get_variable(config[CONF_ID])
var = cg.new_Pvariable(action_id, template_arg, serv, False)
templ = await cg.templatable(config[CONF_SERVICE], args, None)
templ = await cg.templatable(config[CONF_ACTION], args, None)
cg.add(var.set_service(templ))
for key, value in config[CONF_DATA].items():
templ = await cg.templatable(value, args, None)

View File

@@ -48,6 +48,7 @@ service APIConnection {
rpc date_command (DateCommandRequest) returns (void) {}
rpc time_command (TimeCommandRequest) returns (void) {}
rpc datetime_command (DateTimeCommandRequest) returns (void) {}
rpc update_command (UpdateCommandRequest) returns (void) {}
rpc subscribe_bluetooth_le_advertisements(SubscribeBluetoothLEAdvertisementsRequest) returns (void) {}
rpc bluetooth_device_request(BluetoothDeviceRequest) returns (void) {}
@@ -61,6 +62,8 @@ service APIConnection {
rpc unsubscribe_bluetooth_le_advertisements(UnsubscribeBluetoothLEAdvertisementsRequest) returns (void) {}
rpc subscribe_voice_assistant(SubscribeVoiceAssistantRequest) returns (void) {}
rpc voice_assistant_get_configuration(VoiceAssistantConfigurationRequest) returns (VoiceAssistantConfigurationResponse) {}
rpc voice_assistant_set_configuration(VoiceAssistantSetConfiguration) returns (void) {}
rpc alarm_control_panel_command (AlarmControlPanelCommandRequest) returns (void) {}
}
@@ -685,6 +688,7 @@ message SubscribeHomeAssistantStateResponse {
option (source) = SOURCE_SERVER;
string entity_id = 1;
string attribute = 2;
bool once = 3;
}
message HomeAssistantStateResponse {
@@ -1105,6 +1109,19 @@ enum MediaPlayerCommand {
MEDIA_PLAYER_COMMAND_MUTE = 3;
MEDIA_PLAYER_COMMAND_UNMUTE = 4;
}
enum MediaPlayerFormatPurpose {
MEDIA_PLAYER_FORMAT_PURPOSE_DEFAULT = 0;
MEDIA_PLAYER_FORMAT_PURPOSE_ANNOUNCEMENT = 1;
}
message MediaPlayerSupportedFormat {
option (ifdef) = "USE_MEDIA_PLAYER";
string format = 1;
uint32 sample_rate = 2;
uint32 num_channels = 3;
MediaPlayerFormatPurpose purpose = 4;
uint32 sample_bytes = 5;
}
message ListEntitiesMediaPlayerResponse {
option (id) = 63;
option (source) = SOURCE_SERVER;
@@ -1120,6 +1137,8 @@ message ListEntitiesMediaPlayerResponse {
EntityCategory entity_category = 7;
bool supports_pause = 8;
repeated MediaPlayerSupportedFormat supported_formats = 9;
}
message MediaPlayerStateResponse {
option (id) = 64;
@@ -1147,6 +1166,9 @@ message MediaPlayerCommandRequest {
bool has_media_url = 6;
string media_url = 7;
bool has_announcement = 8;
bool announcement = 9;
}
// ==================== BLUETOOTH ====================
@@ -1359,6 +1381,7 @@ message BluetoothConnectionsFreeResponse {
uint32 free = 1;
uint32 limit = 2;
repeated uint64 allocated = 3;
}
message BluetoothGATTErrorResponse {
@@ -1514,6 +1537,72 @@ message VoiceAssistantAudio {
bool end = 2;
}
enum VoiceAssistantTimerEvent {
VOICE_ASSISTANT_TIMER_STARTED = 0;
VOICE_ASSISTANT_TIMER_UPDATED = 1;
VOICE_ASSISTANT_TIMER_CANCELLED = 2;
VOICE_ASSISTANT_TIMER_FINISHED = 3;
}
message VoiceAssistantTimerEventResponse {
option (id) = 115;
option (source) = SOURCE_CLIENT;
option (ifdef) = "USE_VOICE_ASSISTANT";
VoiceAssistantTimerEvent event_type = 1;
string timer_id = 2;
string name = 3;
uint32 total_seconds = 4;
uint32 seconds_left = 5;
bool is_active = 6;
}
message VoiceAssistantAnnounceRequest {
option (id) = 119;
option (source) = SOURCE_CLIENT;
option (ifdef) = "USE_VOICE_ASSISTANT";
string media_id = 1;
string text = 2;
}
message VoiceAssistantAnnounceFinished {
option (id) = 120;
option (source) = SOURCE_SERVER;
option (ifdef) = "USE_VOICE_ASSISTANT";
bool success = 1;
}
message VoiceAssistantWakeWord {
string id = 1;
string wake_word = 2;
repeated string trained_languages = 3;
}
message VoiceAssistantConfigurationRequest {
option (id) = 121;
option (source) = SOURCE_CLIENT;
option (ifdef) = "USE_VOICE_ASSISTANT";
}
message VoiceAssistantConfigurationResponse {
option (id) = 122;
option (source) = SOURCE_SERVER;
option (ifdef) = "USE_VOICE_ASSISTANT";
repeated VoiceAssistantWakeWord available_wake_words = 1;
repeated string active_wake_words = 2;
uint32 max_active_wake_words = 3;
}
message VoiceAssistantSetConfiguration {
option (id) = 123;
option (source) = SOURCE_CLIENT;
option (ifdef) = "USE_VOICE_ASSISTANT";
repeated string active_wake_words = 1;
}
// ==================== ALARM CONTROL PANEL ====================
enum AlarmControlPanelState {
@@ -1815,3 +1904,51 @@ message DateTimeCommandRequest {
fixed32 key = 1;
fixed32 epoch_seconds = 2;
}
// ==================== UPDATE ====================
message ListEntitiesUpdateResponse {
option (id) = 116;
option (source) = SOURCE_SERVER;
option (ifdef) = "USE_UPDATE";
string object_id = 1;
fixed32 key = 2;
string name = 3;
string unique_id = 4;
string icon = 5;
bool disabled_by_default = 6;
EntityCategory entity_category = 7;
string device_class = 8;
}
message UpdateStateResponse {
option (id) = 117;
option (source) = SOURCE_SERVER;
option (ifdef) = "USE_UPDATE";
option (no_delay) = true;
fixed32 key = 1;
bool missing_state = 2;
bool in_progress = 3;
bool has_progress = 4;
float progress = 5;
string current_version = 6;
string latest_version = 7;
string title = 8;
string release_summary = 9;
string release_url = 10;
}
enum UpdateCommand {
UPDATE_COMMAND_NONE = 0;
UPDATE_COMMAND_UPDATE = 1;
UPDATE_COMMAND_CHECK = 2;
}
message UpdateCommandRequest {
option (id) = 118;
option (source) = SOURCE_CLIENT;
option (ifdef) = "USE_UPDATE";
option (no_delay) = true;
fixed32 key = 1;
UpdateCommand command = 2;
}

View File

@@ -1,4 +1,5 @@
#include "api_connection.h"
#ifdef USE_API
#include <cerrno>
#include <cinttypes>
#include <utility>
@@ -179,6 +180,7 @@ void APIConnection::loop() {
SubscribeHomeAssistantStateResponse resp;
resp.entity_id = it.entity_id;
resp.attribute = it.attribute.value();
resp.once = it.once;
if (this->send_subscribe_home_assistant_state_response(resp)) {
state_subs_at_++;
}
@@ -1002,7 +1004,11 @@ bool APIConnection::send_media_player_state(media_player::MediaPlayer *media_pla
MediaPlayerStateResponse resp{};
resp.key = media_player->get_object_id_hash();
resp.state = static_cast<enums::MediaPlayerState>(media_player->state);
media_player::MediaPlayerState report_state = media_player->state == media_player::MEDIA_PLAYER_STATE_ANNOUNCING
? media_player::MEDIA_PLAYER_STATE_PLAYING
: media_player->state;
resp.state = static_cast<enums::MediaPlayerState>(report_state);
resp.volume = media_player->volume;
resp.muted = media_player->is_muted();
return this->send_media_player_state_response(resp);
@@ -1021,6 +1027,16 @@ bool APIConnection::send_media_player_info(media_player::MediaPlayer *media_play
auto traits = media_player->get_traits();
msg.supports_pause = traits.get_supports_pause();
for (auto &supported_format : traits.get_supported_formats()) {
MediaPlayerSupportedFormat media_format;
media_format.format = supported_format.format;
media_format.sample_rate = supported_format.sample_rate;
media_format.num_channels = supported_format.num_channels;
media_format.purpose = static_cast<enums::MediaPlayerFormatPurpose>(supported_format.purpose);
media_format.sample_bytes = supported_format.sample_bytes;
msg.supported_formats.push_back(media_format);
}
return this->send_list_entities_media_player_response(msg);
}
void APIConnection::media_player_command(const MediaPlayerCommandRequest &msg) {
@@ -1038,6 +1054,9 @@ void APIConnection::media_player_command(const MediaPlayerCommandRequest &msg) {
if (msg.has_media_url) {
call.set_media_url(msg.media_url);
}
if (msg.has_announcement) {
call.set_announcement(msg.announcement);
}
call.perform();
}
#endif
@@ -1186,6 +1205,61 @@ void APIConnection::on_voice_assistant_audio(const VoiceAssistantAudio &msg) {
voice_assistant::global_voice_assistant->on_audio(msg);
}
};
void APIConnection::on_voice_assistant_timer_event_response(const VoiceAssistantTimerEventResponse &msg) {
if (voice_assistant::global_voice_assistant != nullptr) {
if (voice_assistant::global_voice_assistant->get_api_connection() != this) {
return;
}
voice_assistant::global_voice_assistant->on_timer_event(msg);
}
};
void APIConnection::on_voice_assistant_announce_request(const VoiceAssistantAnnounceRequest &msg) {
if (voice_assistant::global_voice_assistant != nullptr) {
if (voice_assistant::global_voice_assistant->get_api_connection() != this) {
return;
}
voice_assistant::global_voice_assistant->on_announce(msg);
}
}
VoiceAssistantConfigurationResponse APIConnection::voice_assistant_get_configuration(
const VoiceAssistantConfigurationRequest &msg) {
VoiceAssistantConfigurationResponse resp;
if (voice_assistant::global_voice_assistant != nullptr) {
if (voice_assistant::global_voice_assistant->get_api_connection() != this) {
return resp;
}
auto &config = voice_assistant::global_voice_assistant->get_configuration();
for (auto &wake_word : config.available_wake_words) {
VoiceAssistantWakeWord resp_wake_word;
resp_wake_word.id = wake_word.id;
resp_wake_word.wake_word = wake_word.wake_word;
for (const auto &lang : wake_word.trained_languages) {
resp_wake_word.trained_languages.push_back(lang);
}
resp.available_wake_words.push_back(std::move(resp_wake_word));
}
for (auto &wake_word_id : config.active_wake_words) {
resp.active_wake_words.push_back(wake_word_id);
}
resp.max_active_wake_words = config.max_active_wake_words;
}
return resp;
}
void APIConnection::voice_assistant_set_configuration(const VoiceAssistantSetConfiguration &msg) {
if (voice_assistant::global_voice_assistant != nullptr) {
if (voice_assistant::global_voice_assistant->get_api_connection() != this) {
return;
}
voice_assistant::global_voice_assistant->on_set_configuration(msg.active_wake_words);
}
}
#endif
@@ -1271,6 +1345,64 @@ bool APIConnection::send_event_info(event::Event *event) {
}
#endif
#ifdef USE_UPDATE
bool APIConnection::send_update_state(update::UpdateEntity *update) {
if (!this->state_subscription_)
return false;
UpdateStateResponse resp{};
resp.key = update->get_object_id_hash();
resp.missing_state = !update->has_state();
if (update->has_state()) {
resp.in_progress = update->state == update::UpdateState::UPDATE_STATE_INSTALLING;
if (update->update_info.has_progress) {
resp.has_progress = true;
resp.progress = update->update_info.progress;
}
resp.current_version = update->update_info.current_version;
resp.latest_version = update->update_info.latest_version;
resp.title = update->update_info.title;
resp.release_summary = update->update_info.summary;
resp.release_url = update->update_info.release_url;
}
return this->send_update_state_response(resp);
}
bool APIConnection::send_update_info(update::UpdateEntity *update) {
ListEntitiesUpdateResponse msg;
msg.key = update->get_object_id_hash();
msg.object_id = update->get_object_id();
if (update->has_own_name())
msg.name = update->get_name();
msg.unique_id = get_default_unique_id("update", update);
msg.icon = update->get_icon();
msg.disabled_by_default = update->is_disabled_by_default();
msg.entity_category = static_cast<enums::EntityCategory>(update->get_entity_category());
msg.device_class = update->get_device_class();
return this->send_list_entities_update_response(msg);
}
void APIConnection::update_command(const UpdateCommandRequest &msg) {
update::UpdateEntity *update = App.get_update_by_key(msg.key);
if (update == nullptr)
return;
switch (msg.command) {
case enums::UPDATE_COMMAND_UPDATE:
update->perform();
break;
case enums::UPDATE_COMMAND_CHECK:
update->check();
break;
case enums::UPDATE_COMMAND_NONE:
ESP_LOGE(TAG, "UPDATE_COMMAND_NONE not handled. Check client is sending the correct command");
break;
default:
ESP_LOGW(TAG, "Unknown update command: %" PRIu32, msg.command);
break;
}
}
#endif
bool APIConnection::send_log_message(int level, const char *tag, const char *line) {
if (this->log_subscription_ < level)
return false;
@@ -1437,3 +1569,4 @@ void APIConnection::on_fatal_error() {
} // namespace api
} // namespace esphome
#endif

View File

@@ -1,12 +1,13 @@
#pragma once
#include "esphome/core/defines.h"
#ifdef USE_API
#include "api_frame_helper.h"
#include "api_pb2.h"
#include "api_pb2_service.h"
#include "api_server.h"
#include "esphome/core/application.h"
#include "esphome/core/component.h"
#include "esphome/core/defines.h"
#include <vector>
@@ -150,6 +151,11 @@ class APIConnection : public APIServerConnection {
void on_voice_assistant_response(const VoiceAssistantResponse &msg) override;
void on_voice_assistant_event_response(const VoiceAssistantEventResponse &msg) override;
void on_voice_assistant_audio(const VoiceAssistantAudio &msg) override;
void on_voice_assistant_timer_event_response(const VoiceAssistantTimerEventResponse &msg) override;
void on_voice_assistant_announce_request(const VoiceAssistantAnnounceRequest &msg) override;
VoiceAssistantConfigurationResponse voice_assistant_get_configuration(
const VoiceAssistantConfigurationRequest &msg) override;
void voice_assistant_set_configuration(const VoiceAssistantSetConfiguration &msg) override;
#endif
#ifdef USE_ALARM_CONTROL_PANEL
@@ -163,6 +169,12 @@ class APIConnection : public APIServerConnection {
bool send_event_info(event::Event *event);
#endif
#ifdef USE_UPDATE
bool send_update_state(update::UpdateEntity *update);
bool send_update_info(update::UpdateEntity *update);
void update_command(const UpdateCommandRequest &msg) override;
#endif
void on_disconnect_response(const DisconnectResponse &value) override;
void on_ping_response(const PingResponse &value) override {
// we initiated ping
@@ -257,3 +269,4 @@ class APIConnection : public APIServerConnection {
} // namespace api
} // namespace esphome
#endif

View File

@@ -1,5 +1,5 @@
#include "api_frame_helper.h"
#ifdef USE_API
#include "esphome/core/log.h"
#include "esphome/core/hal.h"
#include "esphome/core/helpers.h"
@@ -1028,3 +1028,4 @@ APIError APIPlaintextFrameHelper::shutdown(int how) {
} // namespace api
} // namespace esphome
#endif

View File

@@ -5,7 +5,7 @@
#include <vector>
#include "esphome/core/defines.h"
#ifdef USE_API
#ifdef USE_API_NOISE
#include "noise/protocol.h"
#endif
@@ -190,3 +190,4 @@ class APIPlaintextFrameHelper : public APIFrameHelper {
} // namespace api
} // namespace esphome
#endif

View File

@@ -387,6 +387,18 @@ template<> const char *proto_enum_to_string<enums::MediaPlayerCommand>(enums::Me
}
#endif
#ifdef HAS_PROTO_MESSAGE_DUMP
template<> const char *proto_enum_to_string<enums::MediaPlayerFormatPurpose>(enums::MediaPlayerFormatPurpose value) {
switch (value) {
case enums::MEDIA_PLAYER_FORMAT_PURPOSE_DEFAULT:
return "MEDIA_PLAYER_FORMAT_PURPOSE_DEFAULT";
case enums::MEDIA_PLAYER_FORMAT_PURPOSE_ANNOUNCEMENT:
return "MEDIA_PLAYER_FORMAT_PURPOSE_ANNOUNCEMENT";
default:
return "UNKNOWN";
}
}
#endif
#ifdef HAS_PROTO_MESSAGE_DUMP
template<>
const char *proto_enum_to_string<enums::BluetoothDeviceRequestType>(enums::BluetoothDeviceRequestType value) {
switch (value) {
@@ -475,6 +487,22 @@ template<> const char *proto_enum_to_string<enums::VoiceAssistantEvent>(enums::V
}
#endif
#ifdef HAS_PROTO_MESSAGE_DUMP
template<> const char *proto_enum_to_string<enums::VoiceAssistantTimerEvent>(enums::VoiceAssistantTimerEvent value) {
switch (value) {
case enums::VOICE_ASSISTANT_TIMER_STARTED:
return "VOICE_ASSISTANT_TIMER_STARTED";
case enums::VOICE_ASSISTANT_TIMER_UPDATED:
return "VOICE_ASSISTANT_TIMER_UPDATED";
case enums::VOICE_ASSISTANT_TIMER_CANCELLED:
return "VOICE_ASSISTANT_TIMER_CANCELLED";
case enums::VOICE_ASSISTANT_TIMER_FINISHED:
return "VOICE_ASSISTANT_TIMER_FINISHED";
default:
return "UNKNOWN";
}
}
#endif
#ifdef HAS_PROTO_MESSAGE_DUMP
template<> const char *proto_enum_to_string<enums::AlarmControlPanelState>(enums::AlarmControlPanelState value) {
switch (value) {
case enums::ALARM_STATE_DISARMED:
@@ -551,6 +579,20 @@ template<> const char *proto_enum_to_string<enums::ValveOperation>(enums::ValveO
}
}
#endif
#ifdef HAS_PROTO_MESSAGE_DUMP
template<> const char *proto_enum_to_string<enums::UpdateCommand>(enums::UpdateCommand value) {
switch (value) {
case enums::UPDATE_COMMAND_NONE:
return "UPDATE_COMMAND_NONE";
case enums::UPDATE_COMMAND_UPDATE:
return "UPDATE_COMMAND_UPDATE";
case enums::UPDATE_COMMAND_CHECK:
return "UPDATE_COMMAND_CHECK";
default:
return "UNKNOWN";
}
}
#endif
bool HelloRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) {
case 2: {
@@ -3079,6 +3121,16 @@ void SubscribeHomeAssistantStatesRequest::dump_to(std::string &out) const {
out.append("SubscribeHomeAssistantStatesRequest {}");
}
#endif
bool SubscribeHomeAssistantStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) {
case 3: {
this->once = value.as_bool();
return true;
}
default:
return false;
}
}
bool SubscribeHomeAssistantStateResponse::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
switch (field_id) {
case 1: {
@@ -3096,6 +3148,7 @@ bool SubscribeHomeAssistantStateResponse::decode_length(uint32_t field_id, Proto
void SubscribeHomeAssistantStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_string(1, this->entity_id);
buffer.encode_string(2, this->attribute);
buffer.encode_bool(3, this->once);
}
#ifdef HAS_PROTO_MESSAGE_DUMP
void SubscribeHomeAssistantStateResponse::dump_to(std::string &out) const {
@@ -3108,6 +3161,10 @@ void SubscribeHomeAssistantStateResponse::dump_to(std::string &out) const {
out.append(" attribute: ");
out.append("'").append(this->attribute).append("'");
out.append("\n");
out.append(" once: ");
out.append(YESNO(this->once));
out.append("\n");
out.append("}");
}
#endif
@@ -5078,6 +5135,74 @@ void ButtonCommandRequest::dump_to(std::string &out) const {
out.append("}");
}
#endif
bool MediaPlayerSupportedFormat::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) {
case 2: {
this->sample_rate = value.as_uint32();
return true;
}
case 3: {
this->num_channels = value.as_uint32();
return true;
}
case 4: {
this->purpose = value.as_enum<enums::MediaPlayerFormatPurpose>();
return true;
}
case 5: {
this->sample_bytes = value.as_uint32();
return true;
}
default:
return false;
}
}
bool MediaPlayerSupportedFormat::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
switch (field_id) {
case 1: {
this->format = value.as_string();
return true;
}
default:
return false;
}
}
void MediaPlayerSupportedFormat::encode(ProtoWriteBuffer buffer) const {
buffer.encode_string(1, this->format);
buffer.encode_uint32(2, this->sample_rate);
buffer.encode_uint32(3, this->num_channels);
buffer.encode_enum<enums::MediaPlayerFormatPurpose>(4, this->purpose);
buffer.encode_uint32(5, this->sample_bytes);
}
#ifdef HAS_PROTO_MESSAGE_DUMP
void MediaPlayerSupportedFormat::dump_to(std::string &out) const {
__attribute__((unused)) char buffer[64];
out.append("MediaPlayerSupportedFormat {\n");
out.append(" format: ");
out.append("'").append(this->format).append("'");
out.append("\n");
out.append(" sample_rate: ");
sprintf(buffer, "%" PRIu32, this->sample_rate);
out.append(buffer);
out.append("\n");
out.append(" num_channels: ");
sprintf(buffer, "%" PRIu32, this->num_channels);
out.append(buffer);
out.append("\n");
out.append(" purpose: ");
out.append(proto_enum_to_string<enums::MediaPlayerFormatPurpose>(this->purpose));
out.append("\n");
out.append(" sample_bytes: ");
sprintf(buffer, "%" PRIu32, this->sample_bytes);
out.append(buffer);
out.append("\n");
out.append("}");
}
#endif
bool ListEntitiesMediaPlayerResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) {
case 6: {
@@ -5114,6 +5239,10 @@ bool ListEntitiesMediaPlayerResponse::decode_length(uint32_t field_id, ProtoLeng
this->icon = value.as_string();
return true;
}
case 9: {
this->supported_formats.push_back(value.as_message<MediaPlayerSupportedFormat>());
return true;
}
default:
return false;
}
@@ -5137,6 +5266,9 @@ void ListEntitiesMediaPlayerResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_bool(6, this->disabled_by_default);
buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
buffer.encode_bool(8, this->supports_pause);
for (auto &it : this->supported_formats) {
buffer.encode_message<MediaPlayerSupportedFormat>(9, it, true);
}
}
#ifdef HAS_PROTO_MESSAGE_DUMP
void ListEntitiesMediaPlayerResponse::dump_to(std::string &out) const {
@@ -5174,6 +5306,12 @@ void ListEntitiesMediaPlayerResponse::dump_to(std::string &out) const {
out.append(" supports_pause: ");
out.append(YESNO(this->supports_pause));
out.append("\n");
for (const auto &it : this->supported_formats) {
out.append(" supported_formats: ");
it.dump_to(out);
out.append("\n");
}
out.append("}");
}
#endif
@@ -5253,6 +5391,14 @@ bool MediaPlayerCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt val
this->has_media_url = value.as_bool();
return true;
}
case 8: {
this->has_announcement = value.as_bool();
return true;
}
case 9: {
this->announcement = value.as_bool();
return true;
}
default:
return false;
}
@@ -5289,6 +5435,8 @@ void MediaPlayerCommandRequest::encode(ProtoWriteBuffer buffer) const {
buffer.encode_float(5, this->volume);
buffer.encode_bool(6, this->has_media_url);
buffer.encode_string(7, this->media_url);
buffer.encode_bool(8, this->has_announcement);
buffer.encode_bool(9, this->announcement);
}
#ifdef HAS_PROTO_MESSAGE_DUMP
void MediaPlayerCommandRequest::dump_to(std::string &out) const {
@@ -5323,6 +5471,14 @@ void MediaPlayerCommandRequest::dump_to(std::string &out) const {
out.append(" media_url: ");
out.append("'").append(this->media_url).append("'");
out.append("\n");
out.append(" has_announcement: ");
out.append(YESNO(this->has_announcement));
out.append("\n");
out.append(" announcement: ");
out.append(YESNO(this->announcement));
out.append("\n");
out.append("}");
}
#endif
@@ -6274,6 +6430,10 @@ bool BluetoothConnectionsFreeResponse::decode_varint(uint32_t field_id, ProtoVar
this->limit = value.as_uint32();
return true;
}
case 3: {
this->allocated.push_back(value.as_uint64());
return true;
}
default:
return false;
}
@@ -6281,6 +6441,9 @@ bool BluetoothConnectionsFreeResponse::decode_varint(uint32_t field_id, ProtoVar
void BluetoothConnectionsFreeResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_uint32(1, this->free);
buffer.encode_uint32(2, this->limit);
for (auto &it : this->allocated) {
buffer.encode_uint64(3, it, true);
}
}
#ifdef HAS_PROTO_MESSAGE_DUMP
void BluetoothConnectionsFreeResponse::dump_to(std::string &out) const {
@@ -6295,6 +6458,13 @@ void BluetoothConnectionsFreeResponse::dump_to(std::string &out) const {
sprintf(buffer, "%" PRIu32, this->limit);
out.append(buffer);
out.append("\n");
for (const auto &it : this->allocated) {
out.append(" allocated: ");
sprintf(buffer, "%llu", it);
out.append(buffer);
out.append("\n");
}
out.append("}");
}
#endif
@@ -6839,6 +7009,269 @@ void VoiceAssistantAudio::dump_to(std::string &out) const {
out.append("}");
}
#endif
bool VoiceAssistantTimerEventResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) {
case 1: {
this->event_type = value.as_enum<enums::VoiceAssistantTimerEvent>();
return true;
}
case 4: {
this->total_seconds = value.as_uint32();
return true;
}
case 5: {
this->seconds_left = value.as_uint32();
return true;
}
case 6: {
this->is_active = value.as_bool();
return true;
}
default:
return false;
}
}
bool VoiceAssistantTimerEventResponse::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
switch (field_id) {
case 2: {
this->timer_id = value.as_string();
return true;
}
case 3: {
this->name = value.as_string();
return true;
}
default:
return false;
}
}
void VoiceAssistantTimerEventResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_enum<enums::VoiceAssistantTimerEvent>(1, this->event_type);
buffer.encode_string(2, this->timer_id);
buffer.encode_string(3, this->name);
buffer.encode_uint32(4, this->total_seconds);
buffer.encode_uint32(5, this->seconds_left);
buffer.encode_bool(6, this->is_active);
}
#ifdef HAS_PROTO_MESSAGE_DUMP
void VoiceAssistantTimerEventResponse::dump_to(std::string &out) const {
__attribute__((unused)) char buffer[64];
out.append("VoiceAssistantTimerEventResponse {\n");
out.append(" event_type: ");
out.append(proto_enum_to_string<enums::VoiceAssistantTimerEvent>(this->event_type));
out.append("\n");
out.append(" timer_id: ");
out.append("'").append(this->timer_id).append("'");
out.append("\n");
out.append(" name: ");
out.append("'").append(this->name).append("'");
out.append("\n");
out.append(" total_seconds: ");
sprintf(buffer, "%" PRIu32, this->total_seconds);
out.append(buffer);
out.append("\n");
out.append(" seconds_left: ");
sprintf(buffer, "%" PRIu32, this->seconds_left);
out.append(buffer);
out.append("\n");
out.append(" is_active: ");
out.append(YESNO(this->is_active));
out.append("\n");
out.append("}");
}
#endif
bool VoiceAssistantAnnounceRequest::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
switch (field_id) {
case 1: {
this->media_id = value.as_string();
return true;
}
case 2: {
this->text = value.as_string();
return true;
}
default:
return false;
}
}
void VoiceAssistantAnnounceRequest::encode(ProtoWriteBuffer buffer) const {
buffer.encode_string(1, this->media_id);
buffer.encode_string(2, this->text);
}
#ifdef HAS_PROTO_MESSAGE_DUMP
void VoiceAssistantAnnounceRequest::dump_to(std::string &out) const {
__attribute__((unused)) char buffer[64];
out.append("VoiceAssistantAnnounceRequest {\n");
out.append(" media_id: ");
out.append("'").append(this->media_id).append("'");
out.append("\n");
out.append(" text: ");
out.append("'").append(this->text).append("'");
out.append("\n");
out.append("}");
}
#endif
bool VoiceAssistantAnnounceFinished::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) {
case 1: {
this->success = value.as_bool();
return true;
}
default:
return false;
}
}
void VoiceAssistantAnnounceFinished::encode(ProtoWriteBuffer buffer) const { buffer.encode_bool(1, this->success); }
#ifdef HAS_PROTO_MESSAGE_DUMP
void VoiceAssistantAnnounceFinished::dump_to(std::string &out) const {
__attribute__((unused)) char buffer[64];
out.append("VoiceAssistantAnnounceFinished {\n");
out.append(" success: ");
out.append(YESNO(this->success));
out.append("\n");
out.append("}");
}
#endif
bool VoiceAssistantWakeWord::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
switch (field_id) {
case 1: {
this->id = value.as_string();
return true;
}
case 2: {
this->wake_word = value.as_string();
return true;
}
case 3: {
this->trained_languages.push_back(value.as_string());
return true;
}
default:
return false;
}
}
void VoiceAssistantWakeWord::encode(ProtoWriteBuffer buffer) const {
buffer.encode_string(1, this->id);
buffer.encode_string(2, this->wake_word);
for (auto &it : this->trained_languages) {
buffer.encode_string(3, it, true);
}
}
#ifdef HAS_PROTO_MESSAGE_DUMP
void VoiceAssistantWakeWord::dump_to(std::string &out) const {
__attribute__((unused)) char buffer[64];
out.append("VoiceAssistantWakeWord {\n");
out.append(" id: ");
out.append("'").append(this->id).append("'");
out.append("\n");
out.append(" wake_word: ");
out.append("'").append(this->wake_word).append("'");
out.append("\n");
for (const auto &it : this->trained_languages) {
out.append(" trained_languages: ");
out.append("'").append(it).append("'");
out.append("\n");
}
out.append("}");
}
#endif
void VoiceAssistantConfigurationRequest::encode(ProtoWriteBuffer buffer) const {}
#ifdef HAS_PROTO_MESSAGE_DUMP
void VoiceAssistantConfigurationRequest::dump_to(std::string &out) const {
out.append("VoiceAssistantConfigurationRequest {}");
}
#endif
bool VoiceAssistantConfigurationResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) {
case 3: {
this->max_active_wake_words = value.as_uint32();
return true;
}
default:
return false;
}
}
bool VoiceAssistantConfigurationResponse::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
switch (field_id) {
case 1: {
this->available_wake_words.push_back(value.as_message<VoiceAssistantWakeWord>());
return true;
}
case 2: {
this->active_wake_words.push_back(value.as_string());
return true;
}
default:
return false;
}
}
void VoiceAssistantConfigurationResponse::encode(ProtoWriteBuffer buffer) const {
for (auto &it : this->available_wake_words) {
buffer.encode_message<VoiceAssistantWakeWord>(1, it, true);
}
for (auto &it : this->active_wake_words) {
buffer.encode_string(2, it, true);
}
buffer.encode_uint32(3, this->max_active_wake_words);
}
#ifdef HAS_PROTO_MESSAGE_DUMP
void VoiceAssistantConfigurationResponse::dump_to(std::string &out) const {
__attribute__((unused)) char buffer[64];
out.append("VoiceAssistantConfigurationResponse {\n");
for (const auto &it : this->available_wake_words) {
out.append(" available_wake_words: ");
it.dump_to(out);
out.append("\n");
}
for (const auto &it : this->active_wake_words) {
out.append(" active_wake_words: ");
out.append("'").append(it).append("'");
out.append("\n");
}
out.append(" max_active_wake_words: ");
sprintf(buffer, "%" PRIu32, this->max_active_wake_words);
out.append(buffer);
out.append("\n");
out.append("}");
}
#endif
bool VoiceAssistantSetConfiguration::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
switch (field_id) {
case 1: {
this->active_wake_words.push_back(value.as_string());
return true;
}
default:
return false;
}
}
void VoiceAssistantSetConfiguration::encode(ProtoWriteBuffer buffer) const {
for (auto &it : this->active_wake_words) {
buffer.encode_string(1, it, true);
}
}
#ifdef HAS_PROTO_MESSAGE_DUMP
void VoiceAssistantSetConfiguration::dump_to(std::string &out) const {
__attribute__((unused)) char buffer[64];
out.append("VoiceAssistantSetConfiguration {\n");
for (const auto &it : this->active_wake_words) {
out.append(" active_wake_words: ");
out.append("'").append(it).append("'");
out.append("\n");
}
out.append("}");
}
#endif
bool ListEntitiesAlarmControlPanelResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) {
case 6: {
@@ -8266,6 +8699,262 @@ void DateTimeCommandRequest::dump_to(std::string &out) const {
out.append("}");
}
#endif
bool ListEntitiesUpdateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) {
case 6: {
this->disabled_by_default = value.as_bool();
return true;
}
case 7: {
this->entity_category = value.as_enum<enums::EntityCategory>();
return true;
}
default:
return false;
}
}
bool ListEntitiesUpdateResponse::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
switch (field_id) {
case 1: {
this->object_id = value.as_string();
return true;
}
case 3: {
this->name = value.as_string();
return true;
}
case 4: {
this->unique_id = value.as_string();
return true;
}
case 5: {
this->icon = value.as_string();
return true;
}
case 8: {
this->device_class = value.as_string();
return true;
}
default:
return false;
}
}
bool ListEntitiesUpdateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
switch (field_id) {
case 2: {
this->key = value.as_fixed32();
return true;
}
default:
return false;
}
}
void ListEntitiesUpdateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_string(1, this->object_id);
buffer.encode_fixed32(2, this->key);
buffer.encode_string(3, this->name);
buffer.encode_string(4, this->unique_id);
buffer.encode_string(5, this->icon);
buffer.encode_bool(6, this->disabled_by_default);
buffer.encode_enum<enums::EntityCategory>(7, this->entity_category);
buffer.encode_string(8, this->device_class);
}
#ifdef HAS_PROTO_MESSAGE_DUMP
void ListEntitiesUpdateResponse::dump_to(std::string &out) const {
__attribute__((unused)) char buffer[64];
out.append("ListEntitiesUpdateResponse {\n");
out.append(" object_id: ");
out.append("'").append(this->object_id).append("'");
out.append("\n");
out.append(" key: ");
sprintf(buffer, "%" PRIu32, this->key);
out.append(buffer);
out.append("\n");
out.append(" name: ");
out.append("'").append(this->name).append("'");
out.append("\n");
out.append(" unique_id: ");
out.append("'").append(this->unique_id).append("'");
out.append("\n");
out.append(" icon: ");
out.append("'").append(this->icon).append("'");
out.append("\n");
out.append(" disabled_by_default: ");
out.append(YESNO(this->disabled_by_default));
out.append("\n");
out.append(" entity_category: ");
out.append(proto_enum_to_string<enums::EntityCategory>(this->entity_category));
out.append("\n");
out.append(" device_class: ");
out.append("'").append(this->device_class).append("'");
out.append("\n");
out.append("}");
}
#endif
bool UpdateStateResponse::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) {
case 2: {
this->missing_state = value.as_bool();
return true;
}
case 3: {
this->in_progress = value.as_bool();
return true;
}
case 4: {
this->has_progress = value.as_bool();
return true;
}
default:
return false;
}
}
bool UpdateStateResponse::decode_length(uint32_t field_id, ProtoLengthDelimited value) {
switch (field_id) {
case 6: {
this->current_version = value.as_string();
return true;
}
case 7: {
this->latest_version = value.as_string();
return true;
}
case 8: {
this->title = value.as_string();
return true;
}
case 9: {
this->release_summary = value.as_string();
return true;
}
case 10: {
this->release_url = value.as_string();
return true;
}
default:
return false;
}
}
bool UpdateStateResponse::decode_32bit(uint32_t field_id, Proto32Bit value) {
switch (field_id) {
case 1: {
this->key = value.as_fixed32();
return true;
}
case 5: {
this->progress = value.as_float();
return true;
}
default:
return false;
}
}
void UpdateStateResponse::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key);
buffer.encode_bool(2, this->missing_state);
buffer.encode_bool(3, this->in_progress);
buffer.encode_bool(4, this->has_progress);
buffer.encode_float(5, this->progress);
buffer.encode_string(6, this->current_version);
buffer.encode_string(7, this->latest_version);
buffer.encode_string(8, this->title);
buffer.encode_string(9, this->release_summary);
buffer.encode_string(10, this->release_url);
}
#ifdef HAS_PROTO_MESSAGE_DUMP
void UpdateStateResponse::dump_to(std::string &out) const {
__attribute__((unused)) char buffer[64];
out.append("UpdateStateResponse {\n");
out.append(" key: ");
sprintf(buffer, "%" PRIu32, this->key);
out.append(buffer);
out.append("\n");
out.append(" missing_state: ");
out.append(YESNO(this->missing_state));
out.append("\n");
out.append(" in_progress: ");
out.append(YESNO(this->in_progress));
out.append("\n");
out.append(" has_progress: ");
out.append(YESNO(this->has_progress));
out.append("\n");
out.append(" progress: ");
sprintf(buffer, "%g", this->progress);
out.append(buffer);
out.append("\n");
out.append(" current_version: ");
out.append("'").append(this->current_version).append("'");
out.append("\n");
out.append(" latest_version: ");
out.append("'").append(this->latest_version).append("'");
out.append("\n");
out.append(" title: ");
out.append("'").append(this->title).append("'");
out.append("\n");
out.append(" release_summary: ");
out.append("'").append(this->release_summary).append("'");
out.append("\n");
out.append(" release_url: ");
out.append("'").append(this->release_url).append("'");
out.append("\n");
out.append("}");
}
#endif
bool UpdateCommandRequest::decode_varint(uint32_t field_id, ProtoVarInt value) {
switch (field_id) {
case 2: {
this->command = value.as_enum<enums::UpdateCommand>();
return true;
}
default:
return false;
}
}
bool UpdateCommandRequest::decode_32bit(uint32_t field_id, Proto32Bit value) {
switch (field_id) {
case 1: {
this->key = value.as_fixed32();
return true;
}
default:
return false;
}
}
void UpdateCommandRequest::encode(ProtoWriteBuffer buffer) const {
buffer.encode_fixed32(1, this->key);
buffer.encode_enum<enums::UpdateCommand>(2, this->command);
}
#ifdef HAS_PROTO_MESSAGE_DUMP
void UpdateCommandRequest::dump_to(std::string &out) const {
__attribute__((unused)) char buffer[64];
out.append("UpdateCommandRequest {\n");
out.append(" key: ");
sprintf(buffer, "%" PRIu32, this->key);
out.append(buffer);
out.append("\n");
out.append(" command: ");
out.append(proto_enum_to_string<enums::UpdateCommand>(this->command));
out.append("\n");
out.append("}");
}
#endif
} // namespace api
} // namespace esphome

View File

@@ -156,6 +156,10 @@ enum MediaPlayerCommand : uint32_t {
MEDIA_PLAYER_COMMAND_MUTE = 3,
MEDIA_PLAYER_COMMAND_UNMUTE = 4,
};
enum MediaPlayerFormatPurpose : uint32_t {
MEDIA_PLAYER_FORMAT_PURPOSE_DEFAULT = 0,
MEDIA_PLAYER_FORMAT_PURPOSE_ANNOUNCEMENT = 1,
};
enum BluetoothDeviceRequestType : uint32_t {
BLUETOOTH_DEVICE_REQUEST_TYPE_CONNECT = 0,
BLUETOOTH_DEVICE_REQUEST_TYPE_DISCONNECT = 1,
@@ -191,6 +195,12 @@ enum VoiceAssistantEvent : uint32_t {
VOICE_ASSISTANT_TTS_STREAM_START = 98,
VOICE_ASSISTANT_TTS_STREAM_END = 99,
};
enum VoiceAssistantTimerEvent : uint32_t {
VOICE_ASSISTANT_TIMER_STARTED = 0,
VOICE_ASSISTANT_TIMER_UPDATED = 1,
VOICE_ASSISTANT_TIMER_CANCELLED = 2,
VOICE_ASSISTANT_TIMER_FINISHED = 3,
};
enum AlarmControlPanelState : uint32_t {
ALARM_STATE_DISARMED = 0,
ALARM_STATE_ARMED_HOME = 1,
@@ -221,6 +231,11 @@ enum ValveOperation : uint32_t {
VALVE_OPERATION_IS_OPENING = 1,
VALVE_OPERATION_IS_CLOSING = 2,
};
enum UpdateCommand : uint32_t {
UPDATE_COMMAND_NONE = 0,
UPDATE_COMMAND_UPDATE = 1,
UPDATE_COMMAND_CHECK = 2,
};
} // namespace enums
@@ -825,6 +840,7 @@ class SubscribeHomeAssistantStateResponse : public ProtoMessage {
public:
std::string entity_id{};
std::string attribute{};
bool once{false};
void encode(ProtoWriteBuffer buffer) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP
void dump_to(std::string &out) const override;
@@ -832,6 +848,7 @@ class SubscribeHomeAssistantStateResponse : public ProtoMessage {
protected:
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
};
class HomeAssistantStateResponse : public ProtoMessage {
public:
@@ -1254,6 +1271,22 @@ class ButtonCommandRequest : public ProtoMessage {
protected:
bool decode_32bit(uint32_t field_id, Proto32Bit value) override;
};
class MediaPlayerSupportedFormat : public ProtoMessage {
public:
std::string format{};
uint32_t sample_rate{0};
uint32_t num_channels{0};
enums::MediaPlayerFormatPurpose purpose{};
uint32_t sample_bytes{0};
void encode(ProtoWriteBuffer buffer) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP
void dump_to(std::string &out) const override;
#endif
protected:
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
};
class ListEntitiesMediaPlayerResponse : public ProtoMessage {
public:
std::string object_id{};
@@ -1264,6 +1297,7 @@ class ListEntitiesMediaPlayerResponse : public ProtoMessage {
bool disabled_by_default{false};
enums::EntityCategory entity_category{};
bool supports_pause{false};
std::vector<MediaPlayerSupportedFormat> supported_formats{};
void encode(ProtoWriteBuffer buffer) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP
void dump_to(std::string &out) const override;
@@ -1298,6 +1332,8 @@ class MediaPlayerCommandRequest : public ProtoMessage {
float volume{0.0f};
bool has_media_url{false};
std::string media_url{};
bool has_announcement{false};
bool announcement{false};
void encode(ProtoWriteBuffer buffer) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP
void dump_to(std::string &out) const override;
@@ -1588,6 +1624,7 @@ class BluetoothConnectionsFreeResponse : public ProtoMessage {
public:
uint32_t free{0};
uint32_t limit{0};
std::vector<uint64_t> allocated{};
void encode(ProtoWriteBuffer buffer) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP
void dump_to(std::string &out) const override;
@@ -1773,6 +1810,93 @@ class VoiceAssistantAudio : public ProtoMessage {
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
};
class VoiceAssistantTimerEventResponse : public ProtoMessage {
public:
enums::VoiceAssistantTimerEvent event_type{};
std::string timer_id{};
std::string name{};
uint32_t total_seconds{0};
uint32_t seconds_left{0};
bool is_active{false};
void encode(ProtoWriteBuffer buffer) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP
void dump_to(std::string &out) const override;
#endif
protected:
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
};
class VoiceAssistantAnnounceRequest : public ProtoMessage {
public:
std::string media_id{};
std::string text{};
void encode(ProtoWriteBuffer buffer) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP
void dump_to(std::string &out) const override;
#endif
protected:
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
};
class VoiceAssistantAnnounceFinished : public ProtoMessage {
public:
bool success{false};
void encode(ProtoWriteBuffer buffer) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP
void dump_to(std::string &out) const override;
#endif
protected:
bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
};
class VoiceAssistantWakeWord : public ProtoMessage {
public:
std::string id{};
std::string wake_word{};
std::vector<std::string> trained_languages{};
void encode(ProtoWriteBuffer buffer) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP
void dump_to(std::string &out) const override;
#endif
protected:
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
};
class VoiceAssistantConfigurationRequest : public ProtoMessage {
public:
void encode(ProtoWriteBuffer buffer) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP
void dump_to(std::string &out) const override;
#endif
protected:
};
class VoiceAssistantConfigurationResponse : public ProtoMessage {
public:
std::vector<VoiceAssistantWakeWord> available_wake_words{};
std::vector<std::string> active_wake_words{};
uint32_t max_active_wake_words{0};
void encode(ProtoWriteBuffer buffer) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP
void dump_to(std::string &out) const override;
#endif
protected:
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
};
class VoiceAssistantSetConfiguration : public ProtoMessage {
public:
std::vector<std::string> active_wake_words{};
void encode(ProtoWriteBuffer buffer) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP
void dump_to(std::string &out) const override;
#endif
protected:
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
};
class ListEntitiesAlarmControlPanelResponse : public ProtoMessage {
public:
std::string object_id{};
@@ -2105,6 +2229,61 @@ class DateTimeCommandRequest : public ProtoMessage {
protected:
bool decode_32bit(uint32_t field_id, Proto32Bit value) override;
};
class ListEntitiesUpdateResponse : public ProtoMessage {
public:
std::string object_id{};
uint32_t key{0};
std::string name{};
std::string unique_id{};
std::string icon{};
bool disabled_by_default{false};
enums::EntityCategory entity_category{};
std::string device_class{};
void encode(ProtoWriteBuffer buffer) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP
void dump_to(std::string &out) const override;
#endif
protected:
bool decode_32bit(uint32_t field_id, Proto32Bit value) override;
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
};
class UpdateStateResponse : public ProtoMessage {
public:
uint32_t key{0};
bool missing_state{false};
bool in_progress{false};
bool has_progress{false};
float progress{0.0f};
std::string current_version{};
std::string latest_version{};
std::string title{};
std::string release_summary{};
std::string release_url{};
void encode(ProtoWriteBuffer buffer) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP
void dump_to(std::string &out) const override;
#endif
protected:
bool decode_32bit(uint32_t field_id, Proto32Bit value) override;
bool decode_length(uint32_t field_id, ProtoLengthDelimited value) override;
bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
};
class UpdateCommandRequest : public ProtoMessage {
public:
uint32_t key{0};
enums::UpdateCommand command{};
void encode(ProtoWriteBuffer buffer) const override;
#ifdef HAS_PROTO_MESSAGE_DUMP
void dump_to(std::string &out) const override;
#endif
protected:
bool decode_32bit(uint32_t field_id, Proto32Bit value) override;
bool decode_varint(uint32_t field_id, ProtoVarInt value) override;
};
} // namespace api
} // namespace esphome

View File

@@ -484,6 +484,31 @@ bool APIServerConnectionBase::send_voice_assistant_audio(const VoiceAssistantAud
return this->send_message_<VoiceAssistantAudio>(msg, 106);
}
#endif
#ifdef USE_VOICE_ASSISTANT
#endif
#ifdef USE_VOICE_ASSISTANT
#endif
#ifdef USE_VOICE_ASSISTANT
bool APIServerConnectionBase::send_voice_assistant_announce_finished(const VoiceAssistantAnnounceFinished &msg) {
#ifdef HAS_PROTO_MESSAGE_DUMP
ESP_LOGVV(TAG, "send_voice_assistant_announce_finished: %s", msg.dump().c_str());
#endif
return this->send_message_<VoiceAssistantAnnounceFinished>(msg, 120);
}
#endif
#ifdef USE_VOICE_ASSISTANT
#endif
#ifdef USE_VOICE_ASSISTANT
bool APIServerConnectionBase::send_voice_assistant_configuration_response(
const VoiceAssistantConfigurationResponse &msg) {
#ifdef HAS_PROTO_MESSAGE_DUMP
ESP_LOGVV(TAG, "send_voice_assistant_configuration_response: %s", msg.dump().c_str());
#endif
return this->send_message_<VoiceAssistantConfigurationResponse>(msg, 122);
}
#endif
#ifdef USE_VOICE_ASSISTANT
#endif
#ifdef USE_ALARM_CONTROL_PANEL
bool APIServerConnectionBase::send_list_entities_alarm_control_panel_response(
const ListEntitiesAlarmControlPanelResponse &msg) {
@@ -609,6 +634,24 @@ bool APIServerConnectionBase::send_date_time_state_response(const DateTimeStateR
#endif
#ifdef USE_DATETIME_DATETIME
#endif
#ifdef USE_UPDATE
bool APIServerConnectionBase::send_list_entities_update_response(const ListEntitiesUpdateResponse &msg) {
#ifdef HAS_PROTO_MESSAGE_DUMP
ESP_LOGVV(TAG, "send_list_entities_update_response: %s", msg.dump().c_str());
#endif
return this->send_message_<ListEntitiesUpdateResponse>(msg, 116);
}
#endif
#ifdef USE_UPDATE
bool APIServerConnectionBase::send_update_state_response(const UpdateStateResponse &msg) {
#ifdef HAS_PROTO_MESSAGE_DUMP
ESP_LOGVV(TAG, "send_update_state_response: %s", msg.dump().c_str());
#endif
return this->send_message_<UpdateStateResponse>(msg, 117);
}
#endif
#ifdef USE_UPDATE
#endif
bool APIServerConnectionBase::read_message(uint32_t msg_size, uint32_t msg_type, uint8_t *msg_data) {
switch (msg_type) {
case 1: {
@@ -1093,6 +1136,61 @@ bool APIServerConnectionBase::read_message(uint32_t msg_size, uint32_t msg_type,
ESP_LOGVV(TAG, "on_date_time_command_request: %s", msg.dump().c_str());
#endif
this->on_date_time_command_request(msg);
#endif
break;
}
case 115: {
#ifdef USE_VOICE_ASSISTANT
VoiceAssistantTimerEventResponse msg;
msg.decode(msg_data, msg_size);
#ifdef HAS_PROTO_MESSAGE_DUMP
ESP_LOGVV(TAG, "on_voice_assistant_timer_event_response: %s", msg.dump().c_str());
#endif
this->on_voice_assistant_timer_event_response(msg);
#endif
break;
}
case 118: {
#ifdef USE_UPDATE
UpdateCommandRequest msg;
msg.decode(msg_data, msg_size);
#ifdef HAS_PROTO_MESSAGE_DUMP
ESP_LOGVV(TAG, "on_update_command_request: %s", msg.dump().c_str());
#endif
this->on_update_command_request(msg);
#endif
break;
}
case 119: {
#ifdef USE_VOICE_ASSISTANT
VoiceAssistantAnnounceRequest msg;
msg.decode(msg_data, msg_size);
#ifdef HAS_PROTO_MESSAGE_DUMP
ESP_LOGVV(TAG, "on_voice_assistant_announce_request: %s", msg.dump().c_str());
#endif
this->on_voice_assistant_announce_request(msg);
#endif
break;
}
case 121: {
#ifdef USE_VOICE_ASSISTANT
VoiceAssistantConfigurationRequest msg;
msg.decode(msg_data, msg_size);
#ifdef HAS_PROTO_MESSAGE_DUMP
ESP_LOGVV(TAG, "on_voice_assistant_configuration_request: %s", msg.dump().c_str());
#endif
this->on_voice_assistant_configuration_request(msg);
#endif
break;
}
case 123: {
#ifdef USE_VOICE_ASSISTANT
VoiceAssistantSetConfiguration msg;
msg.decode(msg_data, msg_size);
#ifdef HAS_PROTO_MESSAGE_DUMP
ESP_LOGVV(TAG, "on_voice_assistant_set_configuration: %s", msg.dump().c_str());
#endif
this->on_voice_assistant_set_configuration(msg);
#endif
break;
}
@@ -1421,6 +1519,19 @@ void APIServerConnection::on_date_time_command_request(const DateTimeCommandRequ
this->datetime_command(msg);
}
#endif
#ifdef USE_UPDATE
void APIServerConnection::on_update_command_request(const UpdateCommandRequest &msg) {
if (!this->is_connection_setup()) {
this->on_no_setup_connection();
return;
}
if (!this->is_authenticated()) {
this->on_unauthenticated_access();
return;
}
this->update_command(msg);
}
#endif
#ifdef USE_BLUETOOTH_PROXY
void APIServerConnection::on_subscribe_bluetooth_le_advertisements_request(
const SubscribeBluetoothLEAdvertisementsRequest &msg) {
@@ -1570,6 +1681,35 @@ void APIServerConnection::on_subscribe_voice_assistant_request(const SubscribeVo
this->subscribe_voice_assistant(msg);
}
#endif
#ifdef USE_VOICE_ASSISTANT
void APIServerConnection::on_voice_assistant_configuration_request(const VoiceAssistantConfigurationRequest &msg) {
if (!this->is_connection_setup()) {
this->on_no_setup_connection();
return;
}
if (!this->is_authenticated()) {
this->on_unauthenticated_access();
return;
}
VoiceAssistantConfigurationResponse ret = this->voice_assistant_get_configuration(msg);
if (!this->send_voice_assistant_configuration_response(ret)) {
this->on_fatal_error();
}
}
#endif
#ifdef USE_VOICE_ASSISTANT
void APIServerConnection::on_voice_assistant_set_configuration(const VoiceAssistantSetConfiguration &msg) {
if (!this->is_connection_setup()) {
this->on_no_setup_connection();
return;
}
if (!this->is_authenticated()) {
this->on_unauthenticated_access();
return;
}
this->voice_assistant_set_configuration(msg);
}
#endif
#ifdef USE_ALARM_CONTROL_PANEL
void APIServerConnection::on_alarm_control_panel_command_request(const AlarmControlPanelCommandRequest &msg) {
if (!this->is_connection_setup()) {

View File

@@ -244,6 +244,24 @@ class APIServerConnectionBase : public ProtoService {
bool send_voice_assistant_audio(const VoiceAssistantAudio &msg);
virtual void on_voice_assistant_audio(const VoiceAssistantAudio &value){};
#endif
#ifdef USE_VOICE_ASSISTANT
virtual void on_voice_assistant_timer_event_response(const VoiceAssistantTimerEventResponse &value){};
#endif
#ifdef USE_VOICE_ASSISTANT
virtual void on_voice_assistant_announce_request(const VoiceAssistantAnnounceRequest &value){};
#endif
#ifdef USE_VOICE_ASSISTANT
bool send_voice_assistant_announce_finished(const VoiceAssistantAnnounceFinished &msg);
#endif
#ifdef USE_VOICE_ASSISTANT
virtual void on_voice_assistant_configuration_request(const VoiceAssistantConfigurationRequest &value){};
#endif
#ifdef USE_VOICE_ASSISTANT
bool send_voice_assistant_configuration_response(const VoiceAssistantConfigurationResponse &msg);
#endif
#ifdef USE_VOICE_ASSISTANT
virtual void on_voice_assistant_set_configuration(const VoiceAssistantSetConfiguration &value){};
#endif
#ifdef USE_ALARM_CONTROL_PANEL
bool send_list_entities_alarm_control_panel_response(const ListEntitiesAlarmControlPanelResponse &msg);
#endif
@@ -303,6 +321,15 @@ class APIServerConnectionBase : public ProtoService {
#endif
#ifdef USE_DATETIME_DATETIME
virtual void on_date_time_command_request(const DateTimeCommandRequest &value){};
#endif
#ifdef USE_UPDATE
bool send_list_entities_update_response(const ListEntitiesUpdateResponse &msg);
#endif
#ifdef USE_UPDATE
bool send_update_state_response(const UpdateStateResponse &msg);
#endif
#ifdef USE_UPDATE
virtual void on_update_command_request(const UpdateCommandRequest &value){};
#endif
protected:
bool read_message(uint32_t msg_size, uint32_t msg_type, uint8_t *msg_data) override;
@@ -370,6 +397,9 @@ class APIServerConnection : public APIServerConnectionBase {
#ifdef USE_DATETIME_DATETIME
virtual void datetime_command(const DateTimeCommandRequest &msg) = 0;
#endif
#ifdef USE_UPDATE
virtual void update_command(const UpdateCommandRequest &msg) = 0;
#endif
#ifdef USE_BLUETOOTH_PROXY
virtual void subscribe_bluetooth_le_advertisements(const SubscribeBluetoothLEAdvertisementsRequest &msg) = 0;
#endif
@@ -404,6 +434,13 @@ class APIServerConnection : public APIServerConnectionBase {
#ifdef USE_VOICE_ASSISTANT
virtual void subscribe_voice_assistant(const SubscribeVoiceAssistantRequest &msg) = 0;
#endif
#ifdef USE_VOICE_ASSISTANT
virtual VoiceAssistantConfigurationResponse voice_assistant_get_configuration(
const VoiceAssistantConfigurationRequest &msg) = 0;
#endif
#ifdef USE_VOICE_ASSISTANT
virtual void voice_assistant_set_configuration(const VoiceAssistantSetConfiguration &msg) = 0;
#endif
#ifdef USE_ALARM_CONTROL_PANEL
virtual void alarm_control_panel_command(const AlarmControlPanelCommandRequest &msg) = 0;
#endif
@@ -468,6 +505,9 @@ class APIServerConnection : public APIServerConnectionBase {
#ifdef USE_DATETIME_DATETIME
void on_date_time_command_request(const DateTimeCommandRequest &msg) override;
#endif
#ifdef USE_UPDATE
void on_update_command_request(const UpdateCommandRequest &msg) override;
#endif
#ifdef USE_BLUETOOTH_PROXY
void on_subscribe_bluetooth_le_advertisements_request(const SubscribeBluetoothLEAdvertisementsRequest &msg) override;
#endif
@@ -502,6 +542,12 @@ class APIServerConnection : public APIServerConnectionBase {
#ifdef USE_VOICE_ASSISTANT
void on_subscribe_voice_assistant_request(const SubscribeVoiceAssistantRequest &msg) override;
#endif
#ifdef USE_VOICE_ASSISTANT
void on_voice_assistant_configuration_request(const VoiceAssistantConfigurationRequest &msg) override;
#endif
#ifdef USE_VOICE_ASSISTANT
void on_voice_assistant_set_configuration(const VoiceAssistantSetConfiguration &msg) override;
#endif
#ifdef USE_ALARM_CONTROL_PANEL
void on_alarm_control_panel_command_request(const AlarmControlPanelCommandRequest &msg) override;
#endif

View File

@@ -1,4 +1,5 @@
#include "api_server.h"
#ifdef USE_API
#include <cerrno>
#include "api_connection.h"
#include "esphome/components/network/util.h"
@@ -334,6 +335,13 @@ void APIServer::on_event(event::Event *obj, const std::string &event_type) {
}
#endif
#ifdef USE_UPDATE
void APIServer::on_update(update::UpdateEntity *obj) {
for (auto &c : this->clients_)
c->send_update_state(obj);
}
#endif
float APIServer::get_setup_priority() const { return setup_priority::AFTER_WIFI; }
void APIServer::set_port(uint16_t port) { this->port_ = port; }
APIServer *global_api_server = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
@@ -352,8 +360,18 @@ void APIServer::subscribe_home_assistant_state(std::string entity_id, optional<s
.entity_id = std::move(entity_id),
.attribute = std::move(attribute),
.callback = std::move(f),
.once = false,
});
}
void APIServer::get_home_assistant_state(std::string entity_id, optional<std::string> attribute,
std::function<void(std::string)> f) {
this->state_subs_.push_back(HomeAssistantStateSubscription{
.entity_id = std::move(entity_id),
.attribute = std::move(attribute),
.callback = std::move(f),
.once = true,
});
};
const std::vector<APIServer::HomeAssistantStateSubscription> &APIServer::get_state_subs() const {
return this->state_subs_;
}
@@ -386,3 +404,4 @@ void APIServer::on_alarm_control_panel_update(alarm_control_panel::AlarmControlP
} // namespace api
} // namespace esphome
#endif

View File

@@ -1,5 +1,7 @@
#pragma once
#include "esphome/core/defines.h"
#ifdef USE_API
#include "api_noise_context.h"
#include "api_pb2.h"
#include "api_pb2_service.h"
@@ -7,7 +9,6 @@
#include "esphome/core/automation.h"
#include "esphome/core/component.h"
#include "esphome/core/controller.h"
#include "esphome/core/defines.h"
#include "esphome/core/log.h"
#include "list_entities.h"
#include "subscribe_state.h"
@@ -102,6 +103,9 @@ class APIServer : public Component, public Controller {
#ifdef USE_EVENT
void on_event(event::Event *obj, const std::string &event_type) override;
#endif
#ifdef USE_UPDATE
void on_update(update::UpdateEntity *obj) override;
#endif
bool is_connected() const;
@@ -109,10 +113,13 @@ class APIServer : public Component, public Controller {
std::string entity_id;
optional<std::string> attribute;
std::function<void(std::string)> callback;
bool once;
};
void subscribe_home_assistant_state(std::string entity_id, optional<std::string> attribute,
std::function<void(std::string)> f);
void get_home_assistant_state(std::string entity_id, optional<std::string> attribute,
std::function<void(std::string)> f);
const std::vector<HomeAssistantStateSubscription> &get_state_subs() const;
const std::vector<UserServiceDescriptor *> &get_user_services() const { return this->user_services_; }
@@ -147,3 +154,4 @@ template<typename... Ts> class APIConnectedCondition : public Condition<Ts...> {
} // namespace api
} // namespace esphome
#endif

View File

@@ -1,12 +1,11 @@
from __future__ import annotations
import asyncio
import logging
from datetime import datetime
from typing import Any
import logging
from typing import TYPE_CHECKING, Any
from aioesphomeapi import APIClient
from aioesphomeapi.api_pb2 import SubscribeLogsResponse
from aioesphomeapi.log_runner import async_run
from esphome.const import CONF_KEY, CONF_PASSWORD, CONF_PORT, __version__
@@ -14,6 +13,12 @@ from esphome.core import CORE
from . import CONF_ENCRYPTION
if TYPE_CHECKING:
from aioesphomeapi.api_pb2 import (
SubscribeLogsResponse, # pylint: disable=no-name-in-module
)
_LOGGER = logging.getLogger(__name__)

View File

@@ -1,9 +1,9 @@
#pragma once
#include <map>
#include "user_services.h"
#include "api_server.h"
#ifdef USE_API
#include "user_services.h"
namespace esphome {
namespace api {
@@ -105,7 +105,7 @@ class CustomAPIDevice {
/** Subscribe to the state (or attribute state) of an entity from Home Assistant.
*
* Usage:
*å
*
* ```cpp
* void setup() override {
* subscribe_homeassistant_state(&CustomNativeAPI::on_state_changed, "sensor.weather_forecast");
@@ -216,3 +216,4 @@ class CustomAPIDevice {
} // namespace api
} // namespace esphome
#endif

View File

@@ -1,10 +1,10 @@
#pragma once
#include "api_server.h"
#ifdef USE_API
#include "api_pb2.h"
#include "esphome/core/helpers.h"
#include "esphome/core/automation.h"
#include "api_pb2.h"
#include "api_server.h"
#include <vector>
namespace esphome {
@@ -81,3 +81,4 @@ template<typename... Ts> class HomeAssistantServiceCallAction : public Action<Ts
} // namespace api
} // namespace esphome
#endif

View File

@@ -1,4 +1,5 @@
#include "list_entities.h"
#ifdef USE_API
#include "api_connection.h"
#include "esphome/core/application.h"
#include "esphome/core/log.h"
@@ -98,6 +99,10 @@ bool ListEntitiesIterator::on_alarm_control_panel(alarm_control_panel::AlarmCont
#ifdef USE_EVENT
bool ListEntitiesIterator::on_event(event::Event *event) { return this->client_->send_event_info(event); }
#endif
#ifdef USE_UPDATE
bool ListEntitiesIterator::on_update(update::UpdateEntity *update) { return this->client_->send_update_info(update); }
#endif
} // namespace api
} // namespace esphome
#endif

View File

@@ -1,9 +1,9 @@
#pragma once
#include "esphome/core/defines.h"
#ifdef USE_API
#include "esphome/core/component.h"
#include "esphome/core/component_iterator.h"
#include "esphome/core/defines.h"
namespace esphome {
namespace api {
@@ -75,6 +75,9 @@ class ListEntitiesIterator : public ComponentIterator {
#endif
#ifdef USE_EVENT
bool on_event(event::Event *event) override;
#endif
#ifdef USE_UPDATE
bool on_update(update::UpdateEntity *update) override;
#endif
bool on_end() override;
@@ -84,3 +87,4 @@ class ListEntitiesIterator : public ComponentIterator {
} // namespace api
} // namespace esphome
#endif

View File

@@ -1,4 +1,5 @@
#include "subscribe_state.h"
#ifdef USE_API
#include "api_connection.h"
#include "esphome/core/log.h"
@@ -77,7 +78,11 @@ bool InitialStateIterator::on_alarm_control_panel(alarm_control_panel::AlarmCont
return this->client_->send_alarm_control_panel_state(a_alarm_control_panel);
}
#endif
#ifdef USE_UPDATE
bool InitialStateIterator::on_update(update::UpdateEntity *update) { return this->client_->send_update_state(update); }
#endif
InitialStateIterator::InitialStateIterator(APIConnection *client) : client_(client) {}
} // namespace api
} // namespace esphome
#endif

View File

@@ -1,10 +1,10 @@
#pragma once
#include "esphome/core/defines.h"
#ifdef USE_API
#include "esphome/core/component.h"
#include "esphome/core/component_iterator.h"
#include "esphome/core/controller.h"
#include "esphome/core/defines.h"
namespace esphome {
namespace api {
@@ -72,6 +72,9 @@ class InitialStateIterator : public ComponentIterator {
#endif
#ifdef USE_EVENT
bool on_event(event::Event *event) override { return true; };
#endif
#ifdef USE_UPDATE
bool on_update(update::UpdateEntity *update) override;
#endif
protected:
APIConnection *client_;
@@ -79,3 +82,4 @@ class InitialStateIterator : public ComponentIterator {
} // namespace api
} // namespace esphome
#endif

View File

@@ -1,13 +1,13 @@
# Dummy integration to allow relying on AsyncTCP
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.core import CORE, coroutine_with_priority
from esphome.const import (
PLATFORM_BK72XX,
PLATFORM_ESP32,
PLATFORM_ESP8266,
PLATFORM_BK72XX,
PLATFORM_RTL87XX,
)
from esphome.core import CORE, coroutine_with_priority
CODEOWNERS = ["@OttoWinter"]
@@ -22,7 +22,7 @@ CONFIG_SCHEMA = cv.All(
async def to_code(config):
if CORE.is_esp32 or CORE.is_libretiny:
# https://github.com/esphome/AsyncTCP/blob/master/library.json
cg.add_library("esphome/AsyncTCP-esphome", "2.1.3")
cg.add_library("esphome/AsyncTCP-esphome", "2.1.4")
elif CORE.is_esp8266:
# https://github.com/esphome/ESPAsyncTCP
cg.add_library("esphome/ESPAsyncTCP-esphome", "2.0.0")

View File

@@ -1,34 +1,34 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import sensor, spi
import esphome.config_validation as cv
from esphome.const import (
CONF_ID,
CONF_REACTIVE_POWER,
CONF_VOLTAGE,
CONF_CURRENT,
CONF_FORWARD_ACTIVE_ENERGY,
CONF_FREQUENCY,
CONF_ID,
CONF_LINE_FREQUENCY,
CONF_POWER,
CONF_POWER_FACTOR,
CONF_FREQUENCY,
CONF_FORWARD_ACTIVE_ENERGY,
CONF_REACTIVE_POWER,
CONF_REVERSE_ACTIVE_ENERGY,
CONF_VOLTAGE,
DEVICE_CLASS_CURRENT,
DEVICE_CLASS_ENERGY,
DEVICE_CLASS_POWER,
DEVICE_CLASS_POWER_FACTOR,
DEVICE_CLASS_VOLTAGE,
ICON_LIGHTBULB,
ICON_CURRENT_AC,
ICON_LIGHTBULB,
STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL_INCREASING,
UNIT_AMPERE,
UNIT_HERTZ,
UNIT_VOLT,
UNIT_AMPERE,
UNIT_WATT,
UNIT_VOLT_AMPS_REACTIVE,
UNIT_WATT,
UNIT_WATT_HOURS,
)
CONF_LINE_FREQUENCY = "line_frequency"
CONF_METER_CONSTANT = "meter_constant"
CONF_PL_CONST = "pl_const"
CONF_GAIN_PGA = "gain_pga"

View File

@@ -0,0 +1,7 @@
import esphome.codegen as cg
CODEOWNERS = ["@circuitsetup", "@descipher"]
atm90e32_ns = cg.esphome_ns.namespace("atm90e32")
CONF_ATM90E32_ID = "atm90e32_id"

View File

@@ -132,10 +132,77 @@ void ATM90E32Component::update() {
this->status_clear_warning();
}
void ATM90E32Component::restore_calibrations_() {
if (enable_offset_calibration_) {
this->pref_.load(&this->offset_phase_);
}
};
void ATM90E32Component::run_offset_calibrations() {
// Run the calibrations and
// Setup voltage and current calibration offsets for PHASE A
this->offset_phase_[PHASEA].voltage_offset_ = calibrate_voltage_offset_phase(PHASEA);
this->phase_[PHASEA].voltage_offset_ = this->offset_phase_[PHASEA].voltage_offset_;
this->write16_(ATM90E32_REGISTER_UOFFSETA, this->phase_[PHASEA].voltage_offset_); // C Voltage offset
this->offset_phase_[PHASEA].current_offset_ = calibrate_current_offset_phase(PHASEA);
this->phase_[PHASEA].current_offset_ = this->offset_phase_[PHASEA].current_offset_;
this->write16_(ATM90E32_REGISTER_IOFFSETA, this->phase_[PHASEA].current_offset_); // C Current offset
// Setup voltage and current calibration offsets for PHASE B
this->offset_phase_[PHASEB].voltage_offset_ = calibrate_voltage_offset_phase(PHASEB);
this->phase_[PHASEB].voltage_offset_ = this->offset_phase_[PHASEB].voltage_offset_;
this->write16_(ATM90E32_REGISTER_UOFFSETB, this->phase_[PHASEB].voltage_offset_); // C Voltage offset
this->offset_phase_[PHASEB].current_offset_ = calibrate_current_offset_phase(PHASEB);
this->phase_[PHASEB].current_offset_ = this->offset_phase_[PHASEB].current_offset_;
this->write16_(ATM90E32_REGISTER_IOFFSETB, this->phase_[PHASEB].current_offset_); // C Current offset
// Setup voltage and current calibration offsets for PHASE C
this->offset_phase_[PHASEC].voltage_offset_ = calibrate_voltage_offset_phase(PHASEC);
this->phase_[PHASEC].voltage_offset_ = this->offset_phase_[PHASEC].voltage_offset_;
this->write16_(ATM90E32_REGISTER_UOFFSETC, this->phase_[PHASEC].voltage_offset_); // C Voltage offset
this->offset_phase_[PHASEC].current_offset_ = calibrate_current_offset_phase(PHASEC);
this->phase_[PHASEC].current_offset_ = this->offset_phase_[PHASEC].current_offset_;
this->write16_(ATM90E32_REGISTER_IOFFSETC, this->phase_[PHASEC].current_offset_); // C Current offset
this->pref_.save(&this->offset_phase_);
ESP_LOGI(TAG, "PhaseA Vo=%5d PhaseB Vo=%5d PhaseC Vo=%5d", this->offset_phase_[PHASEA].voltage_offset_,
this->offset_phase_[PHASEB].voltage_offset_, this->offset_phase_[PHASEC].voltage_offset_);
ESP_LOGI(TAG, "PhaseA Io=%5d PhaseB Io=%5d PhaseC Io=%5d", this->offset_phase_[PHASEA].current_offset_,
this->offset_phase_[PHASEB].current_offset_, this->offset_phase_[PHASEC].current_offset_);
}
void ATM90E32Component::clear_offset_calibrations() {
// Clear the calibrations and
this->offset_phase_[PHASEA].voltage_offset_ = 0;
this->phase_[PHASEA].voltage_offset_ = this->offset_phase_[PHASEA].voltage_offset_;
this->write16_(ATM90E32_REGISTER_UOFFSETA, this->phase_[PHASEA].voltage_offset_); // C Voltage offset
this->offset_phase_[PHASEA].current_offset_ = 0;
this->phase_[PHASEA].current_offset_ = this->offset_phase_[PHASEA].current_offset_;
this->write16_(ATM90E32_REGISTER_IOFFSETA, this->phase_[PHASEA].current_offset_); // C Current offset
this->offset_phase_[PHASEB].voltage_offset_ = 0;
this->phase_[PHASEB].voltage_offset_ = this->offset_phase_[PHASEB].voltage_offset_;
this->write16_(ATM90E32_REGISTER_UOFFSETB, this->phase_[PHASEB].voltage_offset_); // C Voltage offset
this->offset_phase_[PHASEB].current_offset_ = 0;
this->phase_[PHASEB].current_offset_ = this->offset_phase_[PHASEB].current_offset_;
this->write16_(ATM90E32_REGISTER_IOFFSETB, this->phase_[PHASEB].current_offset_); // C Current offset
this->offset_phase_[PHASEC].voltage_offset_ = 0;
this->phase_[PHASEC].voltage_offset_ = this->offset_phase_[PHASEC].voltage_offset_;
this->write16_(ATM90E32_REGISTER_UOFFSETC, this->phase_[PHASEC].voltage_offset_); // C Voltage offset
this->offset_phase_[PHASEC].current_offset_ = 0;
this->phase_[PHASEC].current_offset_ = this->offset_phase_[PHASEC].current_offset_;
this->write16_(ATM90E32_REGISTER_IOFFSETC, this->phase_[PHASEC].current_offset_); // C Current offset
this->pref_.save(&this->offset_phase_);
ESP_LOGI(TAG, "PhaseA Vo=%5d PhaseB Vo=%5d PhaseC Vo=%5d", this->offset_phase_[PHASEA].voltage_offset_,
this->offset_phase_[PHASEB].voltage_offset_, this->offset_phase_[PHASEC].voltage_offset_);
ESP_LOGI(TAG, "PhaseA Io=%5d PhaseB Io=%5d PhaseC Io=%5d", this->offset_phase_[PHASEA].current_offset_,
this->offset_phase_[PHASEB].current_offset_, this->offset_phase_[PHASEC].current_offset_);
}
void ATM90E32Component::setup() {
ESP_LOGCONFIG(TAG, "Setting up ATM90E32 Component...");
this->spi_setup();
if (this->enable_offset_calibration_) {
uint32_t hash = fnv1_hash(App.get_friendly_name());
this->pref_ = global_preferences->make_preference<Calibration[3]>(hash, true);
this->restore_calibrations_();
}
uint16_t mmode0 = 0x87; // 3P4W 50Hz
if (line_freq_ == 60) {
mmode0 |= 1 << 12; // sets 12th bit to 1, 60Hz
@@ -167,27 +234,12 @@ void ATM90E32Component::setup() {
this->write16_(ATM90E32_REGISTER_SSTARTTH, 0x1D4C); // All Reactive Startup Power Threshold - 50%
this->write16_(ATM90E32_REGISTER_PPHASETH, 0x02EE); // Each Phase Active Phase Threshold - 0.002A/0.00032 = 750
this->write16_(ATM90E32_REGISTER_QPHASETH, 0x02EE); // Each phase Reactive Phase Threshold - 10%
// Setup voltage and current calibration offsets for PHASE A
this->phase_[PHASEA].voltage_offset_ = calibrate_voltage_offset_phase(PHASEA);
this->write16_(ATM90E32_REGISTER_UOFFSETA, this->phase_[PHASEA].voltage_offset_); // A Voltage offset
this->phase_[PHASEA].current_offset_ = calibrate_current_offset_phase(PHASEA);
this->write16_(ATM90E32_REGISTER_IOFFSETA, this->phase_[PHASEA].current_offset_); // A Current offset
// Setup voltage and current gain for PHASE A
this->write16_(ATM90E32_REGISTER_UGAINA, this->phase_[PHASEA].voltage_gain_); // A Voltage rms gain
this->write16_(ATM90E32_REGISTER_IGAINA, this->phase_[PHASEA].ct_gain_); // A line current gain
// Setup voltage and current calibration offsets for PHASE B
this->phase_[PHASEB].voltage_offset_ = calibrate_voltage_offset_phase(PHASEB);
this->write16_(ATM90E32_REGISTER_UOFFSETB, this->phase_[PHASEB].voltage_offset_); // B Voltage offset
this->phase_[PHASEB].current_offset_ = calibrate_current_offset_phase(PHASEB);
this->write16_(ATM90E32_REGISTER_IOFFSETB, this->phase_[PHASEB].current_offset_); // B Current offset
// Setup voltage and current gain for PHASE B
this->write16_(ATM90E32_REGISTER_UGAINB, this->phase_[PHASEB].voltage_gain_); // B Voltage rms gain
this->write16_(ATM90E32_REGISTER_IGAINB, this->phase_[PHASEB].ct_gain_); // B line current gain
// Setup voltage and current calibration offsets for PHASE C
this->phase_[PHASEC].voltage_offset_ = calibrate_voltage_offset_phase(PHASEC);
this->write16_(ATM90E32_REGISTER_UOFFSETC, this->phase_[PHASEC].voltage_offset_); // C Voltage offset
this->phase_[PHASEC].current_offset_ = calibrate_current_offset_phase(PHASEC);
this->write16_(ATM90E32_REGISTER_IOFFSETC, this->phase_[PHASEC].current_offset_); // C Current offset
// Setup voltage and current gain for PHASE C
this->write16_(ATM90E32_REGISTER_UGAINC, this->phase_[PHASEC].voltage_gain_); // C Voltage rms gain
this->write16_(ATM90E32_REGISTER_IGAINC, this->phase_[PHASEC].ct_gain_); // C line current gain

View File

@@ -1,9 +1,12 @@
#pragma once
#include "esphome/core/component.h"
#include "atm90e32_reg.h"
#include "esphome/components/sensor/sensor.h"
#include "esphome/components/spi/spi.h"
#include "atm90e32_reg.h"
#include "esphome/core/application.h"
#include "esphome/core/component.h"
#include "esphome/core/helpers.h"
#include "esphome/core/preferences.h"
namespace esphome {
namespace atm90e32 {
@@ -20,7 +23,6 @@ class ATM90E32Component : public PollingComponent,
void dump_config() override;
float get_setup_priority() const override;
void update() override;
void set_voltage_sensor(int phase, sensor::Sensor *obj) { this->phase_[phase].voltage_sensor_ = obj; }
void set_current_sensor(int phase, sensor::Sensor *obj) { this->phase_[phase].current_sensor_ = obj; }
void set_power_sensor(int phase, sensor::Sensor *obj) { this->phase_[phase].power_sensor_ = obj; }
@@ -48,9 +50,11 @@ class ATM90E32Component : public PollingComponent,
void set_line_freq(int freq) { line_freq_ = freq; }
void set_current_phases(int phases) { current_phases_ = phases; }
void set_pga_gain(uint16_t gain) { pga_gain_ = gain; }
void run_offset_calibrations();
void clear_offset_calibrations();
void set_enable_offset_calibration(bool flag) { enable_offset_calibration_ = flag; }
uint16_t calibrate_voltage_offset_phase(uint8_t /*phase*/);
uint16_t calibrate_current_offset_phase(uint8_t /*phase*/);
int32_t last_periodic_millis = millis();
protected:
@@ -83,10 +87,11 @@ class ATM90E32Component : public PollingComponent,
float get_chip_temperature_();
bool get_publish_interval_flag_() { return publish_interval_flag_; };
void set_publish_interval_flag_(bool flag) { publish_interval_flag_ = flag; };
void restore_calibrations_();
struct ATM90E32Phase {
uint16_t voltage_gain_{7305};
uint16_t ct_gain_{27961};
uint16_t voltage_gain_{0};
uint16_t ct_gain_{0};
uint16_t voltage_offset_{0};
uint16_t current_offset_{0};
float voltage_{0};
@@ -114,13 +119,21 @@ class ATM90E32Component : public PollingComponent,
uint32_t cumulative_reverse_active_energy_{0};
} phase_[3];
struct Calibration {
uint16_t voltage_offset_{0};
uint16_t current_offset_{0};
} offset_phase_[3];
ESPPreferenceObject pref_;
sensor::Sensor *freq_sensor_{nullptr};
sensor::Sensor *chip_temperature_sensor_{nullptr};
uint16_t pga_gain_{0x15};
int line_freq_{60};
int current_phases_{3};
bool publish_interval_flag_{true};
bool publish_interval_flag_{false};
bool peak_current_signed_{false};
bool enable_offset_calibration_{false};
};
} // namespace atm90e32

View File

@@ -1,5 +1,7 @@
#pragma once
#include <cinttypes>
namespace esphome {
namespace atm90e32 {

View File

@@ -0,0 +1,43 @@
import esphome.codegen as cg
from esphome.components import button
import esphome.config_validation as cv
from esphome.const import CONF_ID, ENTITY_CATEGORY_CONFIG, ICON_CHIP, ICON_SCALE
from .. import atm90e32_ns
from ..sensor import ATM90E32Component
CONF_RUN_OFFSET_CALIBRATION = "run_offset_calibration"
CONF_CLEAR_OFFSET_CALIBRATION = "clear_offset_calibration"
ATM90E32CalibrationButton = atm90e32_ns.class_(
"ATM90E32CalibrationButton",
button.Button,
)
ATM90E32ClearCalibrationButton = atm90e32_ns.class_(
"ATM90E32ClearCalibrationButton",
button.Button,
)
CONFIG_SCHEMA = {
cv.GenerateID(CONF_ID): cv.use_id(ATM90E32Component),
cv.Optional(CONF_RUN_OFFSET_CALIBRATION): button.button_schema(
ATM90E32CalibrationButton,
entity_category=ENTITY_CATEGORY_CONFIG,
icon=ICON_SCALE,
),
cv.Optional(CONF_CLEAR_OFFSET_CALIBRATION): button.button_schema(
ATM90E32ClearCalibrationButton,
entity_category=ENTITY_CATEGORY_CONFIG,
icon=ICON_CHIP,
),
}
async def to_code(config):
parent = await cg.get_variable(config[CONF_ID])
if run_offset := config.get(CONF_RUN_OFFSET_CALIBRATION):
b = await button.new_button(run_offset)
await cg.register_parented(b, parent)
if clear_offset := config.get(CONF_CLEAR_OFFSET_CALIBRATION):
b = await button.new_button(clear_offset)
await cg.register_parented(b, parent)

View File

@@ -0,0 +1,20 @@
#include "atm90e32_button.h"
#include "esphome/core/log.h"
namespace esphome {
namespace atm90e32 {
static const char *const TAG = "atm90e32.button";
void ATM90E32CalibrationButton::press_action() {
ESP_LOGI(TAG, "Running offset calibrations, Note: CTs and ACVs must be 0 during this process...");
this->parent_->run_offset_calibrations();
}
void ATM90E32ClearCalibrationButton::press_action() {
ESP_LOGI(TAG, "Offset calibrations cleared.");
this->parent_->clear_offset_calibrations();
}
} // namespace atm90e32
} // namespace esphome

View File

@@ -0,0 +1,27 @@
#pragma once
#include "esphome/core/component.h"
#include "esphome/components/atm90e32/atm90e32.h"
#include "esphome/components/button/button.h"
namespace esphome {
namespace atm90e32 {
class ATM90E32CalibrationButton : public button::Button, public Parented<ATM90E32Component> {
public:
ATM90E32CalibrationButton() = default;
protected:
void press_action() override;
};
class ATM90E32ClearCalibrationButton : public button::Button, public Parented<ATM90E32Component> {
public:
ATM90E32ClearCalibrationButton() = default;
protected:
void press_action() override;
};
} // namespace atm90e32
} // namespace esphome

View File

@@ -1,21 +1,22 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import sensor, spi
import esphome.config_validation as cv
from esphome.const import (
CONF_ID,
CONF_REACTIVE_POWER,
CONF_VOLTAGE,
CONF_APPARENT_POWER,
CONF_CURRENT,
CONF_FORWARD_ACTIVE_ENERGY,
CONF_FREQUENCY,
CONF_ID,
CONF_LINE_FREQUENCY,
CONF_PHASE_A,
CONF_PHASE_ANGLE,
CONF_PHASE_B,
CONF_PHASE_C,
CONF_PHASE_ANGLE,
CONF_POWER,
CONF_POWER_FACTOR,
CONF_APPARENT_POWER,
CONF_FREQUENCY,
CONF_FORWARD_ACTIVE_ENERGY,
CONF_REACTIVE_POWER,
CONF_REVERSE_ACTIVE_ENERGY,
CONF_VOLTAGE,
DEVICE_CLASS_CURRENT,
DEVICE_CLASS_ENERGY,
DEVICE_CLASS_POWER,
@@ -23,13 +24,13 @@ from esphome.const import (
DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_VOLTAGE,
ENTITY_CATEGORY_DIAGNOSTIC,
ICON_LIGHTBULB,
ICON_CURRENT_AC,
ICON_LIGHTBULB,
STATE_CLASS_MEASUREMENT,
STATE_CLASS_TOTAL_INCREASING,
UNIT_AMPERE,
UNIT_DEGREES,
UNIT_CELSIUS,
UNIT_DEGREES,
UNIT_HERTZ,
UNIT_VOLT,
UNIT_VOLT_AMPS_REACTIVE,
@@ -37,7 +38,8 @@ from esphome.const import (
UNIT_WATT_HOURS,
)
CONF_LINE_FREQUENCY = "line_frequency"
from . import atm90e32_ns
CONF_CHIP_TEMPERATURE = "chip_temperature"
CONF_GAIN_PGA = "gain_pga"
CONF_CURRENT_PHASES = "current_phases"
@@ -46,6 +48,7 @@ CONF_GAIN_CT = "gain_ct"
CONF_HARMONIC_POWER = "harmonic_power"
CONF_PEAK_CURRENT = "peak_current"
CONF_PEAK_CURRENT_SIGNED = "peak_current_signed"
CONF_ENABLE_OFFSET_CALIBRATION = "enable_offset_calibration"
UNIT_DEG = "degrees"
LINE_FREQS = {
"50HZ": 50,
@@ -61,7 +64,6 @@ PGA_GAINS = {
"4X": 0x2A,
}
atm90e32_ns = cg.esphome_ns.namespace("atm90e32")
ATM90E32Component = atm90e32_ns.class_(
"ATM90E32Component", cg.PollingComponent, spi.SPIDevice
)
@@ -164,6 +166,7 @@ CONFIG_SCHEMA = (
),
cv.Optional(CONF_GAIN_PGA, default="2X"): cv.enum(PGA_GAINS, upper=True),
cv.Optional(CONF_PEAK_CURRENT_SIGNED, default=False): cv.boolean,
cv.Optional(CONF_ENABLE_OFFSET_CALIBRATION, default=False): cv.boolean,
}
)
.extend(cv.polling_component_schema("60s"))
@@ -227,3 +230,4 @@ async def to_code(config):
cg.add(var.set_current_phases(config[CONF_CURRENT_PHASES]))
cg.add(var.set_pga_gain(config[CONF_GAIN_PGA]))
cg.add(var.set_peak_current_signed(config[CONF_PEAK_CURRENT_SIGNED]))
cg.add(var.set_enable_offset_calibration(config[CONF_ENABLE_OFFSET_CALIBRATION]))

View File

@@ -0,0 +1,121 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.const import CONF_BITS_PER_SAMPLE, CONF_NUM_CHANNELS, CONF_SAMPLE_RATE
import esphome.final_validate as fv
CODEOWNERS = ["@kahrendt"]
audio_ns = cg.esphome_ns.namespace("audio")
AudioFile = audio_ns.struct("AudioFile")
AudioFileType = audio_ns.enum("AudioFileType", is_class=True)
AUDIO_FILE_TYPE_ENUM = {
"NONE": AudioFileType.NONE,
"WAV": AudioFileType.WAV,
"MP3": AudioFileType.MP3,
"FLAC": AudioFileType.FLAC,
}
CONF_MIN_BITS_PER_SAMPLE = "min_bits_per_sample"
CONF_MAX_BITS_PER_SAMPLE = "max_bits_per_sample"
CONF_MIN_CHANNELS = "min_channels"
CONF_MAX_CHANNELS = "max_channels"
CONF_MIN_SAMPLE_RATE = "min_sample_rate"
CONF_MAX_SAMPLE_RATE = "max_sample_rate"
CONFIG_SCHEMA = cv.All(
cv.Schema({}),
)
AUDIO_COMPONENT_SCHEMA = cv.Schema(
{
cv.Optional(CONF_BITS_PER_SAMPLE): cv.int_range(8, 32),
cv.Optional(CONF_NUM_CHANNELS): cv.int_range(1, 2),
cv.Optional(CONF_SAMPLE_RATE): cv.int_range(8000, 48000),
}
)
_UNDEF = object()
def set_stream_limits(
min_bits_per_sample: int = _UNDEF,
max_bits_per_sample: int = _UNDEF,
min_channels: int = _UNDEF,
max_channels: int = _UNDEF,
min_sample_rate: int = _UNDEF,
max_sample_rate: int = _UNDEF,
):
def set_limits_in_config(config):
if min_bits_per_sample is not _UNDEF:
config[CONF_MIN_BITS_PER_SAMPLE] = min_bits_per_sample
if max_bits_per_sample is not _UNDEF:
config[CONF_MAX_BITS_PER_SAMPLE] = max_bits_per_sample
if min_channels is not _UNDEF:
config[CONF_MIN_CHANNELS] = min_channels
if max_channels is not _UNDEF:
config[CONF_MAX_CHANNELS] = max_channels
if min_sample_rate is not _UNDEF:
config[CONF_MIN_SAMPLE_RATE] = min_sample_rate
if max_sample_rate is not _UNDEF:
config[CONF_MAX_SAMPLE_RATE] = max_sample_rate
return set_limits_in_config
def final_validate_audio_schema(
name: str,
*,
audio_device: str,
bits_per_sample: int,
channels: int,
sample_rate: int,
):
def validate_audio_compatiblity(audio_config):
audio_schema = {}
try:
cv.int_range(
min=audio_config.get(CONF_MIN_BITS_PER_SAMPLE),
max=audio_config.get(CONF_MAX_BITS_PER_SAMPLE),
)(bits_per_sample)
except cv.Invalid as exc:
raise cv.Invalid(
f"Invalid configuration for the {name} component. The {CONF_BITS_PER_SAMPLE} {str(exc)}"
) from exc
try:
cv.int_range(
min=audio_config.get(CONF_MIN_CHANNELS),
max=audio_config.get(CONF_MAX_CHANNELS),
)(channels)
except cv.Invalid as exc:
raise cv.Invalid(
f"Invalid configuration for the {name} component. The {CONF_NUM_CHANNELS} {str(exc)}"
) from exc
try:
cv.int_range(
min=audio_config.get(CONF_MIN_SAMPLE_RATE),
max=audio_config.get(CONF_MAX_SAMPLE_RATE),
)(sample_rate)
return cv.Schema(audio_schema, extra=cv.ALLOW_EXTRA)(audio_config)
except cv.Invalid as exc:
raise cv.Invalid(
f"Invalid configuration for the {name} component. The {CONF_SAMPLE_RATE} {str(exc)}"
) from exc
return cv.Schema(
{
cv.Required(audio_device): fv.id_declaration_match_schema(
validate_audio_compatiblity
)
},
extra=cv.ALLOW_EXTRA,
)
async def to_code(config):
cg.add_library("esphome/esp-audio-libs", "1.1.1")

View File

@@ -0,0 +1,67 @@
#include "audio.h"
namespace esphome {
namespace audio {
// Euclidean's algorithm for finding the greatest common divisor
static uint32_t gcd(uint32_t a, uint32_t b) {
while (b != 0) {
uint32_t t = b;
b = a % b;
a = t;
}
return a;
}
AudioStreamInfo::AudioStreamInfo(uint8_t bits_per_sample, uint8_t channels, uint32_t sample_rate)
: bits_per_sample_(bits_per_sample), channels_(channels), sample_rate_(sample_rate) {
this->ms_sample_rate_gcd_ = gcd(1000, this->sample_rate_);
this->bytes_per_sample_ = (this->bits_per_sample_ + 7) / 8;
}
uint32_t AudioStreamInfo::frames_to_microseconds(uint32_t frames) const {
return (frames * 1000000 + (this->sample_rate_ >> 1)) / this->sample_rate_;
}
uint32_t AudioStreamInfo::frames_to_milliseconds_with_remainder(uint32_t *total_frames) const {
uint32_t unprocessable_frames = *total_frames % (this->sample_rate_ / this->ms_sample_rate_gcd_);
uint32_t frames_for_ms_calculation = *total_frames - unprocessable_frames;
uint32_t playback_ms = (frames_for_ms_calculation * 1000) / this->sample_rate_;
*total_frames = unprocessable_frames;
return playback_ms;
}
bool AudioStreamInfo::operator==(const AudioStreamInfo &rhs) const {
return (this->bits_per_sample_ == rhs.get_bits_per_sample()) && (this->channels_ == rhs.get_channels()) &&
(this->sample_rate_ == rhs.get_sample_rate());
}
const char *audio_file_type_to_string(AudioFileType file_type) {
switch (file_type) {
#ifdef USE_AUDIO_FLAC_SUPPORT
case AudioFileType::FLAC:
return "FLAC";
#endif
#ifdef USE_AUDIO_MP3_SUPPORT
case AudioFileType::MP3:
return "MP3";
#endif
case AudioFileType::WAV:
return "WAV";
default:
return "unknown";
}
}
void scale_audio_samples(const int16_t *audio_samples, int16_t *output_buffer, int16_t scale_factor,
size_t samples_to_scale) {
// Note the assembly dsps_mulc function has audio glitches if the input and output buffers are the same.
for (int i = 0; i < samples_to_scale; i++) {
int32_t acc = (int32_t) audio_samples[i] * (int32_t) scale_factor;
output_buffer[i] = (int16_t) (acc >> 15);
}
}
} // namespace audio
} // namespace esphome

View File

@@ -0,0 +1,139 @@
#pragma once
#include "esphome/core/defines.h"
#include <cstddef>
#include <cstdint>
namespace esphome {
namespace audio {
class AudioStreamInfo {
/* Class to respresent important parameters of the audio stream that also provides helper function to convert between
* various audio related units.
*
* - An audio sample represents a unit of audio for one channel.
* - A frame represents a unit of audio with a sample for every channel.
*
* In gneneral, converting between bytes, samples, and frames shouldn't result in rounding errors so long as frames
* are used as the main unit when transferring audio data. Durations may result in rounding for certain sample rates;
* e.g., 44.1 KHz. The ``frames_to_milliseconds_with_remainder`` function should be used for accuracy, as it takes
* into account the remainder rather than just ignoring any rounding.
*/
public:
AudioStreamInfo()
: AudioStreamInfo(16, 1, 16000){}; // Default values represent ESPHome's audio components historical values
AudioStreamInfo(uint8_t bits_per_sample, uint8_t channels, uint32_t sample_rate);
uint8_t get_bits_per_sample() const { return this->bits_per_sample_; }
uint8_t get_channels() const { return this->channels_; }
uint32_t get_sample_rate() const { return this->sample_rate_; }
/// @brief Convert bytes to duration in milliseconds.
/// @param bytes Number of bytes to convert
/// @return Duration in milliseconds that will store `bytes` bytes of audio. May round down for certain sample rates
/// or values of `bytes`.
uint32_t bytes_to_ms(size_t bytes) const {
return bytes * 1000 / (this->sample_rate_ * this->bytes_per_sample_ * this->channels_);
}
/// @brief Convert bytes to frames.
/// @param bytes Number of bytes to convert
/// @return Audio frames that will store `bytes` bytes.
uint32_t bytes_to_frames(size_t bytes) const { return (bytes / (this->bytes_per_sample_ * this->channels_)); }
/// @brief Convert bytes to samples.
/// @param bytes Number of bytes to convert
/// @return Audio samples that will store `bytes` bytes.
uint32_t bytes_to_samples(size_t bytes) const { return (bytes / this->bytes_per_sample_); }
/// @brief Converts frames to bytes.
/// @param frames Number of frames to convert.
/// @return Number of bytes that will store `frames` frames of audio.
size_t frames_to_bytes(uint32_t frames) const { return frames * this->bytes_per_sample_ * this->channels_; }
/// @brief Converts samples to bytes.
/// @param samples Number of samples to convert.
/// @return Number of bytes that will store `samples` samples of audio.
size_t samples_to_bytes(uint32_t samples) const { return samples * this->bytes_per_sample_; }
/// @brief Converts duration to frames.
/// @param ms Duration in milliseconds
/// @return Audio frames that will store `ms` milliseconds of audio. May round down for certain sample rates.
uint32_t ms_to_frames(uint32_t ms) const { return (ms * this->sample_rate_) / 1000; }
/// @brief Converts duration to samples.
/// @param ms Duration in milliseconds
/// @return Audio samples that will store `ms` milliseconds of audio. May round down for certain sample rates.
uint32_t ms_to_samples(uint32_t ms) const { return (ms * this->channels_ * this->sample_rate_) / 1000; }
/// @brief Converts duration to bytes. May round down for certain sample rates.
/// @param ms Duration in milliseconds
/// @return Bytes that will store `ms` milliseconds of audio. May round down for certain sample rates.
size_t ms_to_bytes(uint32_t ms) const {
return (ms * this->bytes_per_sample_ * this->channels_ * this->sample_rate_) / 1000;
}
/// @brief Computes the duration, in microseconds, the given amount of frames represents.
/// @param frames Number of audio frames
/// @return Duration in microseconds `frames` respresents. May be slightly inaccurate due to integer divison rounding
/// for certain sample rates.
uint32_t frames_to_microseconds(uint32_t frames) const;
/// @brief Computes the duration, in milliseconds, the given amount of frames represents. Avoids
/// accumulating rounding errors by updating `frames` with the remainder after converting.
/// @param frames Pointer to uint32_t with the number of audio frames. Replaced with the remainder.
/// @return Duration in milliseconds `frames` represents. Always less than or equal to the actual value due to
/// rounding.
uint32_t frames_to_milliseconds_with_remainder(uint32_t *frames) const;
// Class comparison operators
bool operator==(const AudioStreamInfo &rhs) const;
bool operator!=(const AudioStreamInfo &rhs) const { return !operator==(rhs); }
protected:
uint8_t bits_per_sample_;
uint8_t channels_;
uint32_t sample_rate_;
// The greatest common divisor between 1000 ms = 1 second and the sample rate. Used to avoid accumulating error when
// converting from frames to duration. Computed at construction.
uint32_t ms_sample_rate_gcd_;
// Conversion factor derived from the number of bits per sample. Assumes audio data is aligned to the byte. Computed
// at construction.
size_t bytes_per_sample_;
};
enum class AudioFileType : uint8_t {
NONE = 0,
#ifdef USE_AUDIO_FLAC_SUPPORT
FLAC,
#endif
#ifdef USE_AUDIO_MP3_SUPPORT
MP3,
#endif
WAV,
};
struct AudioFile {
const uint8_t *data;
size_t length;
AudioFileType file_type;
};
/// @brief Helper function to convert file type to a const char string
/// @param file_type
/// @return const char pointer to the readable file type
const char *audio_file_type_to_string(AudioFileType file_type);
/// @brief Scales Q15 fixed point audio samples. Scales in place if audio_samples == output_buffer.
/// @param audio_samples PCM int16 audio samples
/// @param output_buffer Buffer to store the scaled samples
/// @param scale_factor Q15 fixed point scaling factor
/// @param samples_to_scale Number of samples to scale
void scale_audio_samples(const int16_t *audio_samples, int16_t *output_buffer, int16_t scale_factor,
size_t samples_to_scale);
} // namespace audio
} // namespace esphome

View File

@@ -0,0 +1,361 @@
#include "audio_decoder.h"
#ifdef USE_ESP32
#include "esphome/core/hal.h"
namespace esphome {
namespace audio {
static const uint32_t DECODING_TIMEOUT_MS = 50; // The decode function will yield after this duration
static const uint32_t READ_WRITE_TIMEOUT_MS = 20; // Timeout for transferring audio data
static const uint32_t MAX_POTENTIALLY_FAILED_COUNT = 10;
AudioDecoder::AudioDecoder(size_t input_buffer_size, size_t output_buffer_size) {
this->input_transfer_buffer_ = AudioSourceTransferBuffer::create(input_buffer_size);
this->output_transfer_buffer_ = AudioSinkTransferBuffer::create(output_buffer_size);
}
AudioDecoder::~AudioDecoder() {
#ifdef USE_AUDIO_MP3_SUPPORT
if (this->audio_file_type_ == AudioFileType::MP3) {
esp_audio_libs::helix_decoder::MP3FreeDecoder(this->mp3_decoder_);
}
#endif
}
esp_err_t AudioDecoder::add_source(std::weak_ptr<RingBuffer> &input_ring_buffer) {
if (this->input_transfer_buffer_ != nullptr) {
this->input_transfer_buffer_->set_source(input_ring_buffer);
return ESP_OK;
}
return ESP_ERR_NO_MEM;
}
esp_err_t AudioDecoder::add_sink(std::weak_ptr<RingBuffer> &output_ring_buffer) {
if (this->output_transfer_buffer_ != nullptr) {
this->output_transfer_buffer_->set_sink(output_ring_buffer);
return ESP_OK;
}
return ESP_ERR_NO_MEM;
}
#ifdef USE_SPEAKER
esp_err_t AudioDecoder::add_sink(speaker::Speaker *speaker) {
if (this->output_transfer_buffer_ != nullptr) {
this->output_transfer_buffer_->set_sink(speaker);
return ESP_OK;
}
return ESP_ERR_NO_MEM;
}
#endif
esp_err_t AudioDecoder::start(AudioFileType audio_file_type) {
if ((this->input_transfer_buffer_ == nullptr) || (this->output_transfer_buffer_ == nullptr)) {
return ESP_ERR_NO_MEM;
}
this->audio_file_type_ = audio_file_type;
this->potentially_failed_count_ = 0;
this->end_of_file_ = false;
switch (this->audio_file_type_) {
#ifdef USE_AUDIO_FLAC_SUPPORT
case AudioFileType::FLAC:
this->flac_decoder_ = make_unique<esp_audio_libs::flac::FLACDecoder>();
this->free_buffer_required_ =
this->output_transfer_buffer_->capacity(); // We'll revise this after reading the header
break;
#endif
#ifdef USE_AUDIO_MP3_SUPPORT
case AudioFileType::MP3:
this->mp3_decoder_ = esp_audio_libs::helix_decoder::MP3InitDecoder();
this->free_buffer_required_ = 1152 * sizeof(int16_t) * 2; // samples * size per sample * channels
break;
#endif
case AudioFileType::WAV:
this->wav_decoder_ = make_unique<esp_audio_libs::wav_decoder::WAVDecoder>();
this->wav_decoder_->reset();
this->free_buffer_required_ = 1024;
break;
case AudioFileType::NONE:
default:
return ESP_ERR_NOT_SUPPORTED;
break;
}
return ESP_OK;
}
AudioDecoderState AudioDecoder::decode(bool stop_gracefully) {
if (stop_gracefully) {
if (this->output_transfer_buffer_->available() == 0) {
if (this->end_of_file_) {
// The file decoder indicates it reached the end of file
return AudioDecoderState::FINISHED;
}
if (!this->input_transfer_buffer_->has_buffered_data()) {
// If all the internal buffers are empty, the decoding is done
return AudioDecoderState::FINISHED;
}
}
}
if (this->potentially_failed_count_ > MAX_POTENTIALLY_FAILED_COUNT) {
if (stop_gracefully) {
// No more new data is going to come in, so decoding is done
return AudioDecoderState::FINISHED;
}
return AudioDecoderState::FAILED;
}
FileDecoderState state = FileDecoderState::MORE_TO_PROCESS;
uint32_t decoding_start = millis();
while (state == FileDecoderState::MORE_TO_PROCESS) {
// Transfer decoded out
if (!this->pause_output_) {
size_t bytes_written = this->output_transfer_buffer_->transfer_data_to_sink(pdMS_TO_TICKS(READ_WRITE_TIMEOUT_MS));
if (this->audio_stream_info_.has_value()) {
this->accumulated_frames_written_ += this->audio_stream_info_.value().bytes_to_frames(bytes_written);
this->playback_ms_ +=
this->audio_stream_info_.value().frames_to_milliseconds_with_remainder(&this->accumulated_frames_written_);
}
} else {
// If paused, block to avoid wasting CPU resources
delay(READ_WRITE_TIMEOUT_MS);
}
// Verify there is enough space to store more decoded audio and that the function hasn't been running too long
if ((this->output_transfer_buffer_->free() < this->free_buffer_required_) ||
(millis() - decoding_start > DECODING_TIMEOUT_MS)) {
return AudioDecoderState::DECODING;
}
// Decode more audio
size_t bytes_read = this->input_transfer_buffer_->transfer_data_from_source(pdMS_TO_TICKS(READ_WRITE_TIMEOUT_MS));
if ((this->potentially_failed_count_ > 0) && (bytes_read == 0)) {
// Failed to decode in last attempt and there is no new data
if (this->input_transfer_buffer_->free() == 0) {
// The input buffer is full. Since it previously failed on the exact same data, we can never recover
state = FileDecoderState::FAILED;
} else {
// Attempt to get more data next time
state = FileDecoderState::IDLE;
}
} else if (this->input_transfer_buffer_->available() == 0) {
// No data to decode, attempt to get more data next time
state = FileDecoderState::IDLE;
} else {
switch (this->audio_file_type_) {
#ifdef USE_AUDIO_FLAC_SUPPORT
case AudioFileType::FLAC:
state = this->decode_flac_();
break;
#endif
#ifdef USE_AUDIO_MP3_SUPPORT
case AudioFileType::MP3:
state = this->decode_mp3_();
break;
#endif
case AudioFileType::WAV:
state = this->decode_wav_();
break;
case AudioFileType::NONE:
default:
state = FileDecoderState::IDLE;
break;
}
}
if (state == FileDecoderState::POTENTIALLY_FAILED) {
++this->potentially_failed_count_;
} else if (state == FileDecoderState::END_OF_FILE) {
this->end_of_file_ = true;
} else if (state == FileDecoderState::FAILED) {
return AudioDecoderState::FAILED;
} else if (state == FileDecoderState::MORE_TO_PROCESS) {
this->potentially_failed_count_ = 0;
}
}
return AudioDecoderState::DECODING;
}
#ifdef USE_AUDIO_FLAC_SUPPORT
FileDecoderState AudioDecoder::decode_flac_() {
if (!this->audio_stream_info_.has_value()) {
// Header hasn't been read
auto result = this->flac_decoder_->read_header(this->input_transfer_buffer_->get_buffer_start(),
this->input_transfer_buffer_->available());
if (result == esp_audio_libs::flac::FLAC_DECODER_HEADER_OUT_OF_DATA) {
return FileDecoderState::POTENTIALLY_FAILED;
}
if (result != esp_audio_libs::flac::FLAC_DECODER_SUCCESS) {
// Couldn't read FLAC header
return FileDecoderState::FAILED;
}
size_t bytes_consumed = this->flac_decoder_->get_bytes_index();
this->input_transfer_buffer_->decrease_buffer_length(bytes_consumed);
this->free_buffer_required_ = flac_decoder_->get_output_buffer_size_bytes();
if (this->output_transfer_buffer_->capacity() < this->free_buffer_required_) {
// Output buffer is not big enough
if (!this->output_transfer_buffer_->reallocate(this->free_buffer_required_)) {
// Couldn't reallocate output buffer
return FileDecoderState::FAILED;
}
}
this->audio_stream_info_ =
audio::AudioStreamInfo(this->flac_decoder_->get_sample_depth(), this->flac_decoder_->get_num_channels(),
this->flac_decoder_->get_sample_rate());
return FileDecoderState::MORE_TO_PROCESS;
}
uint32_t output_samples = 0;
auto result = this->flac_decoder_->decode_frame(
this->input_transfer_buffer_->get_buffer_start(), this->input_transfer_buffer_->available(),
reinterpret_cast<int16_t *>(this->output_transfer_buffer_->get_buffer_end()), &output_samples);
if (result == esp_audio_libs::flac::FLAC_DECODER_ERROR_OUT_OF_DATA) {
// Not an issue, just needs more data that we'll get next time.
return FileDecoderState::POTENTIALLY_FAILED;
}
size_t bytes_consumed = this->flac_decoder_->get_bytes_index();
this->input_transfer_buffer_->decrease_buffer_length(bytes_consumed);
if (result > esp_audio_libs::flac::FLAC_DECODER_ERROR_OUT_OF_DATA) {
// Corrupted frame, don't retry with current buffer content, wait for new sync
return FileDecoderState::POTENTIALLY_FAILED;
}
// We have successfully decoded some input data and have new output data
this->output_transfer_buffer_->increase_buffer_length(
this->audio_stream_info_.value().samples_to_bytes(output_samples));
if (result == esp_audio_libs::flac::FLAC_DECODER_NO_MORE_FRAMES) {
return FileDecoderState::END_OF_FILE;
}
return FileDecoderState::MORE_TO_PROCESS;
}
#endif
#ifdef USE_AUDIO_MP3_SUPPORT
FileDecoderState AudioDecoder::decode_mp3_() {
// Look for the next sync word
int buffer_length = (int) this->input_transfer_buffer_->available();
int32_t offset =
esp_audio_libs::helix_decoder::MP3FindSyncWord(this->input_transfer_buffer_->get_buffer_start(), buffer_length);
if (offset < 0) {
// New data may have the sync word
this->input_transfer_buffer_->decrease_buffer_length(buffer_length);
return FileDecoderState::POTENTIALLY_FAILED;
}
// Advance read pointer to match the offset for the syncword
this->input_transfer_buffer_->decrease_buffer_length(offset);
uint8_t *buffer_start = this->input_transfer_buffer_->get_buffer_start();
buffer_length = (int) this->input_transfer_buffer_->available();
int err = esp_audio_libs::helix_decoder::MP3Decode(this->mp3_decoder_, &buffer_start, &buffer_length,
(int16_t *) this->output_transfer_buffer_->get_buffer_end(), 0);
size_t consumed = this->input_transfer_buffer_->available() - buffer_length;
this->input_transfer_buffer_->decrease_buffer_length(consumed);
if (err) {
switch (err) {
case esp_audio_libs::helix_decoder::ERR_MP3_OUT_OF_MEMORY:
// Intentional fallthrough
case esp_audio_libs::helix_decoder::ERR_MP3_NULL_POINTER:
return FileDecoderState::FAILED;
break;
default:
// Most errors are recoverable by moving on to the next frame, so mark as potentailly failed
return FileDecoderState::POTENTIALLY_FAILED;
break;
}
} else {
esp_audio_libs::helix_decoder::MP3FrameInfo mp3_frame_info;
esp_audio_libs::helix_decoder::MP3GetLastFrameInfo(this->mp3_decoder_, &mp3_frame_info);
if (mp3_frame_info.outputSamps > 0) {
int bytes_per_sample = (mp3_frame_info.bitsPerSample / 8);
this->output_transfer_buffer_->increase_buffer_length(mp3_frame_info.outputSamps * bytes_per_sample);
if (!this->audio_stream_info_.has_value()) {
this->audio_stream_info_ =
audio::AudioStreamInfo(mp3_frame_info.bitsPerSample, mp3_frame_info.nChans, mp3_frame_info.samprate);
}
}
}
return FileDecoderState::MORE_TO_PROCESS;
}
#endif
FileDecoderState AudioDecoder::decode_wav_() {
if (!this->audio_stream_info_.has_value()) {
// Header hasn't been processed
esp_audio_libs::wav_decoder::WAVDecoderResult result = this->wav_decoder_->decode_header(
this->input_transfer_buffer_->get_buffer_start(), this->input_transfer_buffer_->available());
if (result == esp_audio_libs::wav_decoder::WAV_DECODER_SUCCESS_IN_DATA) {
this->input_transfer_buffer_->decrease_buffer_length(this->wav_decoder_->bytes_processed());
this->audio_stream_info_ = audio::AudioStreamInfo(
this->wav_decoder_->bits_per_sample(), this->wav_decoder_->num_channels(), this->wav_decoder_->sample_rate());
this->wav_bytes_left_ = this->wav_decoder_->chunk_bytes_left();
this->wav_has_known_end_ = (this->wav_bytes_left_ > 0);
return FileDecoderState::MORE_TO_PROCESS;
} else if (result == esp_audio_libs::wav_decoder::WAV_DECODER_WARNING_INCOMPLETE_DATA) {
// Available data didn't have the full header
return FileDecoderState::POTENTIALLY_FAILED;
} else {
return FileDecoderState::FAILED;
}
} else {
if (!this->wav_has_known_end_ || (this->wav_bytes_left_ > 0)) {
size_t bytes_to_copy = this->input_transfer_buffer_->available();
if (this->wav_has_known_end_) {
bytes_to_copy = std::min(bytes_to_copy, this->wav_bytes_left_);
}
bytes_to_copy = std::min(bytes_to_copy, this->output_transfer_buffer_->free());
if (bytes_to_copy > 0) {
std::memcpy(this->output_transfer_buffer_->get_buffer_end(), this->input_transfer_buffer_->get_buffer_start(),
bytes_to_copy);
this->input_transfer_buffer_->decrease_buffer_length(bytes_to_copy);
this->output_transfer_buffer_->increase_buffer_length(bytes_to_copy);
if (this->wav_has_known_end_) {
this->wav_bytes_left_ -= bytes_to_copy;
}
}
return FileDecoderState::IDLE;
}
}
return FileDecoderState::END_OF_FILE;
}
} // namespace audio
} // namespace esphome
#endif

View File

@@ -0,0 +1,135 @@
#pragma once
#ifdef USE_ESP32
#include "audio.h"
#include "audio_transfer_buffer.h"
#include "esphome/core/defines.h"
#include "esphome/core/helpers.h"
#include "esphome/core/ring_buffer.h"
#ifdef USE_SPEAKER
#include "esphome/components/speaker/speaker.h"
#endif
#include "esp_err.h"
// esp-audio-libs
#ifdef USE_AUDIO_FLAC_SUPPORT
#include <flac_decoder.h>
#endif
#ifdef USE_AUDIO_MP3_SUPPORT
#include <mp3_decoder.h>
#endif
#include <wav_decoder.h>
namespace esphome {
namespace audio {
enum class AudioDecoderState : uint8_t {
DECODING = 0, // More data is available to decode
FINISHED, // All file data has been decoded and transferred
FAILED, // Encountered an error
};
// Only used within the AudioDecoder class; conveys the state of the particular file type decoder
enum class FileDecoderState : uint8_t {
MORE_TO_PROCESS, // Successsfully read a file chunk and more data is available to decode
IDLE, // Not enough data to decode, waiting for more to be transferred
POTENTIALLY_FAILED, // Decoder encountered a potentially recoverable error if more file data is available
FAILED, // Decoder encoutnered an uncrecoverable error
END_OF_FILE, // The specific file decoder knows its the end of the file
};
class AudioDecoder {
/*
* @brief Class that facilitates decoding an audio file.
* The audio file is read from a ring buffer source, decoded, and sent to an audio sink (ring buffer or speaker
* component).
* Supports wav, flac, and mp3 formats.
*/
public:
/// @brief Allocates the input and output transfer buffers
/// @param input_buffer_size Size of the input transfer buffer in bytes.
/// @param output_buffer_size Size of the output transfer buffer in bytes.
AudioDecoder(size_t input_buffer_size, size_t output_buffer_size);
/// @brief Deallocates the MP3 decoder (the flac and wav decoders are deallocated automatically)
~AudioDecoder();
/// @brief Adds a source ring buffer for raw file data. Takes ownership of the ring buffer in a shared_ptr.
/// @param input_ring_buffer weak_ptr of a shared_ptr of the sink ring buffer to transfer ownership
/// @return ESP_OK if successsful, ESP_ERR_NO_MEM if the transfer buffer wasn't allocated
esp_err_t add_source(std::weak_ptr<RingBuffer> &input_ring_buffer);
/// @brief Adds a sink ring buffer for decoded audio. Takes ownership of the ring buffer in a shared_ptr.
/// @param output_ring_buffer weak_ptr of a shared_ptr of the sink ring buffer to transfer ownership
/// @return ESP_OK if successsful, ESP_ERR_NO_MEM if the transfer buffer wasn't allocated
esp_err_t add_sink(std::weak_ptr<RingBuffer> &output_ring_buffer);
#ifdef USE_SPEAKER
/// @brief Adds a sink speaker for decoded audio.
/// @param speaker pointer to speaker component
/// @return ESP_OK if successsful, ESP_ERR_NO_MEM if the transfer buffer wasn't allocated
esp_err_t add_sink(speaker::Speaker *speaker);
#endif
/// @brief Sets up decoding the file
/// @param audio_file_type AudioFileType of the file
/// @return ESP_OK if successful, ESP_ERR_NO_MEM if the transfer buffers fail to allocate, or ESP_ERR_NOT_SUPPORTED if
/// the format isn't supported.
esp_err_t start(AudioFileType audio_file_type);
/// @brief Decodes audio from the ring buffer source and writes to the sink.
/// @param stop_gracefully If true, it indicates the file source is finished. The decoder will decode all the
/// reamining data and then finish.
/// @return AudioDecoderState
AudioDecoderState decode(bool stop_gracefully);
/// @brief Gets the audio stream information, if it has been decoded from the files header
/// @return optional<AudioStreamInfo> with the audio information. If not available yet, returns no value.
const optional<audio::AudioStreamInfo> &get_audio_stream_info() const { return this->audio_stream_info_; }
/// @brief Returns the duration of audio (in milliseconds) decoded and sent to the sink
/// @return Duration of decoded audio in milliseconds
uint32_t get_playback_ms() const { return this->playback_ms_; }
/// @brief Pauses sending resampled audio to the sink. If paused, it will continue to process internal buffers.
/// @param pause_state If true, audio data is not sent to the sink.
void set_pause_output_state(bool pause_state) { this->pause_output_ = pause_state; }
protected:
std::unique_ptr<esp_audio_libs::wav_decoder::WAVDecoder> wav_decoder_;
#ifdef USE_AUDIO_FLAC_SUPPORT
FileDecoderState decode_flac_();
std::unique_ptr<esp_audio_libs::flac::FLACDecoder> flac_decoder_;
#endif
#ifdef USE_AUDIO_MP3_SUPPORT
FileDecoderState decode_mp3_();
esp_audio_libs::helix_decoder::HMP3Decoder mp3_decoder_;
#endif
FileDecoderState decode_wav_();
std::unique_ptr<AudioSourceTransferBuffer> input_transfer_buffer_;
std::unique_ptr<AudioSinkTransferBuffer> output_transfer_buffer_;
AudioFileType audio_file_type_{AudioFileType::NONE};
optional<AudioStreamInfo> audio_stream_info_{};
size_t free_buffer_required_{0};
size_t wav_bytes_left_{0};
uint32_t potentially_failed_count_{0};
bool end_of_file_{false};
bool wav_has_known_end_{false};
bool pause_output_{false};
uint32_t accumulated_frames_written_{0};
uint32_t playback_ms_{0};
};
} // namespace audio
} // namespace esphome
#endif

View File

@@ -0,0 +1,308 @@
#include "audio_reader.h"
#ifdef USE_ESP_IDF
#include "esphome/core/defines.h"
#include "esphome/core/hal.h"
#include "esphome/core/helpers.h"
#if CONFIG_MBEDTLS_CERTIFICATE_BUNDLE
#include "esp_crt_bundle.h"
#endif
namespace esphome {
namespace audio {
static const uint32_t READ_WRITE_TIMEOUT_MS = 20;
// The number of times the http read times out with no data before throwing an error
static const uint32_t ERROR_COUNT_NO_DATA_READ_TIMEOUT = 100;
static const size_t HTTP_STREAM_BUFFER_SIZE = 2048;
static const uint8_t MAX_REDIRECTION = 5;
// Some common HTTP status codes - borrowed from http_request component accessed 20241224
enum HttpStatus {
HTTP_STATUS_OK = 200,
HTTP_STATUS_NO_CONTENT = 204,
HTTP_STATUS_PARTIAL_CONTENT = 206,
/* 3xx - Redirection */
HTTP_STATUS_MULTIPLE_CHOICES = 300,
HTTP_STATUS_MOVED_PERMANENTLY = 301,
HTTP_STATUS_FOUND = 302,
HTTP_STATUS_SEE_OTHER = 303,
HTTP_STATUS_NOT_MODIFIED = 304,
HTTP_STATUS_TEMPORARY_REDIRECT = 307,
HTTP_STATUS_PERMANENT_REDIRECT = 308,
/* 4XX - CLIENT ERROR */
HTTP_STATUS_BAD_REQUEST = 400,
HTTP_STATUS_UNAUTHORIZED = 401,
HTTP_STATUS_FORBIDDEN = 403,
HTTP_STATUS_NOT_FOUND = 404,
HTTP_STATUS_METHOD_NOT_ALLOWED = 405,
HTTP_STATUS_NOT_ACCEPTABLE = 406,
HTTP_STATUS_LENGTH_REQUIRED = 411,
/* 5xx - Server Error */
HTTP_STATUS_INTERNAL_ERROR = 500
};
AudioReader::~AudioReader() { this->cleanup_connection_(); }
esp_err_t AudioReader::add_sink(const std::weak_ptr<RingBuffer> &output_ring_buffer) {
if (current_audio_file_ != nullptr) {
// A transfer buffer isn't ncessary for a local file
this->file_ring_buffer_ = output_ring_buffer.lock();
return ESP_OK;
}
if (this->output_transfer_buffer_ != nullptr) {
this->output_transfer_buffer_->set_sink(output_ring_buffer);
return ESP_OK;
}
return ESP_ERR_INVALID_STATE;
}
esp_err_t AudioReader::start(AudioFile *audio_file, AudioFileType &file_type) {
file_type = AudioFileType::NONE;
this->current_audio_file_ = audio_file;
this->file_current_ = audio_file->data;
file_type = audio_file->file_type;
return ESP_OK;
}
esp_err_t AudioReader::start(const std::string &uri, AudioFileType &file_type) {
file_type = AudioFileType::NONE;
this->cleanup_connection_();
if (uri.empty()) {
return ESP_ERR_INVALID_ARG;
}
esp_http_client_config_t client_config = {};
client_config.url = uri.c_str();
client_config.cert_pem = nullptr;
client_config.disable_auto_redirect = false;
client_config.max_redirection_count = 10;
client_config.event_handler = http_event_handler;
client_config.user_data = this;
client_config.buffer_size = HTTP_STREAM_BUFFER_SIZE;
client_config.keep_alive_enable = true;
client_config.timeout_ms = 5000; // Shouldn't trigger watchdog resets if caller runs in a task
#if CONFIG_MBEDTLS_CERTIFICATE_BUNDLE
if (uri.find("https:") != std::string::npos) {
client_config.crt_bundle_attach = esp_crt_bundle_attach;
}
#endif
this->client_ = esp_http_client_init(&client_config);
if (this->client_ == nullptr) {
return ESP_FAIL;
}
esp_err_t err = esp_http_client_open(this->client_, 0);
if (err != ESP_OK) {
this->cleanup_connection_();
return err;
}
int64_t header_length = esp_http_client_fetch_headers(this->client_);
if (header_length < 0) {
this->cleanup_connection_();
return ESP_FAIL;
}
int status_code = esp_http_client_get_status_code(this->client_);
if ((status_code < HTTP_STATUS_OK) || (status_code > HTTP_STATUS_PERMANENT_REDIRECT)) {
this->cleanup_connection_();
return ESP_FAIL;
}
ssize_t redirect_count = 0;
while ((esp_http_client_set_redirection(this->client_) == ESP_OK) && (redirect_count < MAX_REDIRECTION)) {
err = esp_http_client_open(this->client_, 0);
if (err != ESP_OK) {
this->cleanup_connection_();
return ESP_FAIL;
}
header_length = esp_http_client_fetch_headers(this->client_);
if (header_length < 0) {
this->cleanup_connection_();
return ESP_FAIL;
}
status_code = esp_http_client_get_status_code(this->client_);
if ((status_code < HTTP_STATUS_OK) || (status_code > HTTP_STATUS_PERMANENT_REDIRECT)) {
this->cleanup_connection_();
return ESP_FAIL;
}
++redirect_count;
}
if (this->audio_file_type_ == AudioFileType::NONE) {
// Failed to determine the file type from the header, fallback to using the url
char url[500];
err = esp_http_client_get_url(this->client_, url, 500);
if (err != ESP_OK) {
this->cleanup_connection_();
return err;
}
std::string url_string = str_lower_case(url);
if (str_endswith(url_string, ".wav")) {
file_type = AudioFileType::WAV;
}
#ifdef USE_AUDIO_MP3_SUPPORT
else if (str_endswith(url_string, ".mp3")) {
file_type = AudioFileType::MP3;
}
#endif
#ifdef USE_AUDIO_FLAC_SUPPORT
else if (str_endswith(url_string, ".flac")) {
file_type = AudioFileType::FLAC;
}
#endif
else {
file_type = AudioFileType::NONE;
this->cleanup_connection_();
return ESP_ERR_NOT_SUPPORTED;
}
} else {
file_type = this->audio_file_type_;
}
this->no_data_read_count_ = 0;
this->output_transfer_buffer_ = AudioSinkTransferBuffer::create(this->buffer_size_);
if (this->output_transfer_buffer_ == nullptr) {
return ESP_ERR_NO_MEM;
}
return ESP_OK;
}
AudioReaderState AudioReader::read() {
if (this->client_ != nullptr) {
return this->http_read_();
} else if (this->current_audio_file_ != nullptr) {
return this->file_read_();
}
return AudioReaderState::FAILED;
}
AudioFileType AudioReader::get_audio_type(const char *content_type) {
#ifdef USE_AUDIO_MP3_SUPPORT
if (strcasecmp(content_type, "mp3") == 0 || strcasecmp(content_type, "audio/mp3") == 0 ||
strcasecmp(content_type, "audio/mpeg") == 0) {
return AudioFileType::MP3;
}
#endif
if (strcasecmp(content_type, "audio/wav") == 0) {
return AudioFileType::WAV;
}
#ifdef USE_AUDIO_FLAC_SUPPORT
if (strcasecmp(content_type, "audio/flac") == 0 || strcasecmp(content_type, "audio/x-flac") == 0) {
return AudioFileType::FLAC;
}
#endif
return AudioFileType::NONE;
}
esp_err_t AudioReader::http_event_handler(esp_http_client_event_t *evt) {
// Based on https://github.com/maroc81/WeatherLily/tree/main/main/net accessed 20241224
AudioReader *this_reader = (AudioReader *) evt->user_data;
switch (evt->event_id) {
case HTTP_EVENT_ON_HEADER:
if (strcasecmp(evt->header_key, "Content-Type") == 0) {
this_reader->audio_file_type_ = get_audio_type(evt->header_value);
}
break;
default:
break;
}
return ESP_OK;
}
AudioReaderState AudioReader::file_read_() {
size_t remaining_bytes = this->current_audio_file_->length - (this->file_current_ - this->current_audio_file_->data);
if (remaining_bytes > 0) {
size_t bytes_written = this->file_ring_buffer_->write_without_replacement(this->file_current_, remaining_bytes,
pdMS_TO_TICKS(READ_WRITE_TIMEOUT_MS));
this->file_current_ += bytes_written;
return AudioReaderState::READING;
}
return AudioReaderState::FINISHED;
}
AudioReaderState AudioReader::http_read_() {
this->output_transfer_buffer_->transfer_data_to_sink(pdMS_TO_TICKS(READ_WRITE_TIMEOUT_MS));
if (esp_http_client_is_complete_data_received(this->client_)) {
if (this->output_transfer_buffer_->available() == 0) {
this->cleanup_connection_();
return AudioReaderState::FINISHED;
}
} else {
size_t bytes_to_read = this->output_transfer_buffer_->free();
int received_len =
esp_http_client_read(this->client_, (char *) this->output_transfer_buffer_->get_buffer_end(), bytes_to_read);
if (received_len > 0) {
this->output_transfer_buffer_->increase_buffer_length(received_len);
this->no_data_read_count_ = 0;
} else if (received_len < 0) {
// HTTP read error
this->cleanup_connection_();
return AudioReaderState::FAILED;
} else {
if (bytes_to_read > 0) {
// Read timed out
++this->no_data_read_count_;
if (this->no_data_read_count_ >= ERROR_COUNT_NO_DATA_READ_TIMEOUT) {
// Timed out with no data read too many times, so the http read has failed
this->cleanup_connection_();
return AudioReaderState::FAILED;
}
delay(READ_WRITE_TIMEOUT_MS);
}
}
}
return AudioReaderState::READING;
}
void AudioReader::cleanup_connection_() {
if (this->client_ != nullptr) {
esp_http_client_close(this->client_);
esp_http_client_cleanup(this->client_);
this->client_ = nullptr;
}
}
} // namespace audio
} // namespace esphome
#endif

Some files were not shown because too many files have changed in this diff Show More