Compare commits

..

2324 Commits

Author SHA1 Message Date
Jesse Hills
288e3c3e3e Merge pull request #3909 from esphome/bump-2022.10.0b2
2022.10.0b2
2022-10-15 09:12:58 +13:00
Jesse Hills
a84378c6c2 Bump version to 2022.10.0b2 2022-10-15 08:37:11 +13:00
Jesse Hills
b6073408f4 Remove address type map from bluetooth proxy (#3905) 2022-10-15 08:37:11 +13:00
Frédéric Jouault
b2d91ac5de Send true and not RSSI in ble_presence (#3904) 2022-10-15 08:37:11 +13:00
Sergey Dudanov
8bf34e09f4 Modbus QWORD fix (#3856) 2022-10-15 08:37:11 +13:00
Guillermo Ruffino
be914f2c15 fix never calling preset change trigger (#3864)
Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2022-10-15 08:37:11 +13:00
Jesse Hills
a6c999dea0 Merge pull request #3900 from esphome/bump-2022.10.0b1
2022.10.0b1
2022-10-13 09:50:04 +13:00
Jesse Hills
f422fabab4 Bump version to 2022.10.0b1 2022-10-13 09:18:46 +13:00
Jesse Hills
01b130ec59 Merge branch 'dev' into bump-2022.10.0b1 2022-10-13 09:18:46 +13:00
definitio
48a1797e72 Do not require CS pin for ST7789V (#3888)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-10-13 08:26:28 +13:00
Jesse Hills
b34d24735a Send GATT error events to HA (#3884) 2022-10-12 22:22:07 +13:00
Chris Feenstra
fe38b36c26 Add support for ZHLT01 heatpump IR protocol (#3655)
Co-authored-by: Chris Feenstra <chris@cfeenstra.nl>
2022-10-12 15:29:57 +13:00
cstaahl
03fca8d91e Fix pulse_meter filter logic (#3321) 2022-10-12 15:26:35 +13:00
RoboMagus
9f9980e338 Add ble RSSI sensor for connected devices (#3860) 2022-10-12 15:23:56 +13:00
Quentin Smith
19900b004b Fix type annotation on extract_registry_entry_config (#3623)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-10-12 15:15:03 +13:00
Gustavo Ambrozio
a8ff0a8913 Exposing coordinates from touchscreen binary sensor (#3891) 2022-10-11 12:22:13 +13:00
RoboMagus
45861456f1 Fix default unit for ble_rssi sensor (#3874) 2022-10-11 12:03:54 +13:00
RoboMagus
44b335e7e3 Correctly set ble_write UUIDs based on their lengths. (#3885) 2022-10-11 12:02:53 +13:00
Jesse Hills
de23bbace2 Update webserver index file (#3896) 2022-10-11 12:01:41 +13:00
RoboMagus
edff9ae322 Proxy friendly host url resolution for use_address with path. (#3653) 2022-10-11 12:01:31 +13:00
NP v/d Spek
3c2766448d Refactor xpt2046 to be a touchscreen platform (#3793) 2022-10-11 10:10:22 +13:00
Jesse Hills
786c8b6cfe Add new sensor device classes (#3895) 2022-10-11 09:54:58 +13:00
Jesse Hills
fd57b21aff Dont add wifi block to yaml if discovered device uses ethernet (#3882) 2022-10-07 15:35:48 +13:00
Jesse Hills
6087183a0c Bump esphome-dashboard to 20221007.0 (#3881) 2022-10-07 15:20:13 +13:00
Jesse Hills
01b7c4200e Add network type to mdns service message (#3880) 2022-10-07 14:42:28 +13:00
dependabot[bot]
7171286c3c Bump pylint from 2.15.2 to 2.15.3 (#3870)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-06 14:57:07 +13:00
Jesse Hills
d220d41182 Bump python min to 3.9 (#3871) 2022-10-05 20:09:27 +13:00
Jesse Hills
c3a8972550 Add min_version to esphome config (#3866) 2022-10-05 16:30:56 +13:00
dependabot[bot]
263b603188 Bump pyupgrade from 2.37.3 to 3.0.0 (#3867)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-10-05 16:29:49 +13:00
Javier Peletier
584b722e7e Fix time/automation (cron) wdt crash when time jumps ahead too much (#3844) 2022-10-05 14:52:45 +13:00
Javier Peletier
05edfd0e82 Add cg.with_local_variable (#3577) 2022-10-05 11:50:03 +13:00
Jesse Hills
16249c02a5 Bump CI to python 3.9 (#3869) 2022-10-05 11:21:13 +13:00
Guillermo Ruffino
e8ff36d1f3 fix dump preset string type (#3863) 2022-10-04 10:50:33 +13:00
Jesse Hills
ed443c6153 Bluetooth Proxy active connections (#3817) 2022-10-04 10:45:06 +13:00
Keith Burzinski
f4a84765cd Add display GPIO setup instruction for Aliexpress display (#3851) 2022-09-30 19:10:53 +13:00
J. Nick Koston
106de3530d Add support for parsing the short local name in the tracker (#3854) 2022-09-30 09:15:30 +13:00
Michael Davidson
8095db6715 Thermostat remove deprecated config (#3643)
* Raise errors for all the now deprecated options

* Fix CONF_DEFAULT_PRESET detection

* Stop attempting to set the non-existent normal_config

* Add support for default presets

* Fix correct detection of Two Point temperature mode

* Fix lint issues

* Fix tests

* Generate correct yaml for equivalent configurations

* Remove debug code

* Only set default preset if the thermostat does not have state to restore

* Add restore_default_preset_on_boot option
If set to True then the default_preset will be applied on every boot. If False (Default) state will be restored from memory as per prior versions

* Apply lint suggestions

* Switch from restore_default_preset_on_boot to an enum for startup_behavior
This gives better self-documentation as well as the option for extending to other options down the track

* Lint fixes

* Rename startup_behavior to on_boot_restore_from
This removes any issues with different English locales

* Fix comparable_preset yaml output alignment

* Add dump of on_boot_restore_from setting

Co-authored-by: Keith Burzinski <kbx81x@gmail.com>
2022-09-25 21:59:04 -05:00
Guillermo Ruffino
ce2e161b08 Bump dashboard to 20220925.0 (#3846) 2022-09-25 18:16:30 -03:00
Jesse Hills
6ef93452f5 Revert "fix spi timing issues" (#3838) 2022-09-22 07:38:31 +12:00
Jesse Hills
3de0b601bf Merge pull request #3835 from esphome/bump-2022.9.0b5
2022.9.0b5
2022-09-21 15:23:41 +12:00
Jesse Hills
91560ae4e9 Bump version to 2022.9.0b5 2022-09-21 12:38:55 +12:00
Guillermo Ruffino
fd6135aebb Bump dashboard to 20220920.1 (#3834) 2022-09-21 12:38:55 +12:00
Guillermo Ruffino
68ea59f3ae Bump dashboard to 20220920.1 (#3834) 2022-09-21 12:32:53 +12:00
Jesse Hills
e5fe5d1249 Merge pull request #3833 from esphome/bump-2022.9.0b4
2022.9.0b4
2022-09-21 09:09:20 +12:00
Jesse Hills
9a69769a7e Dont fail fast on CI for docker (#3832) 2022-09-21 07:54:35 +12:00
Jesse Hills
63b42f3608 Bump version to 2022.9.0b4 2022-09-21 07:36:39 +12:00
Paulus Schoutsen
d56107e97f Bump dashboard to 20220920.0 (#3831) 2022-09-21 07:36:39 +12:00
Guillermo Ruffino
33f296e05b Fix-esphome-validation-line-number (#3815) 2022-09-21 07:36:39 +12:00
Paulus Schoutsen
3572c62315 Bump dashboard to 20220920.0 (#3831) 2022-09-21 07:35:46 +12:00
Jesse Hills
97e067a277 Merge pull request #3829 from esphome/bump-2022.9.0b3
2022.9.0b3
2022-09-20 19:28:27 +12:00
Guillermo Ruffino
1444cddda9 Fix-esphome-validation-line-number (#3815) 2022-09-20 17:23:55 +12:00
Jesse Hills
5f56cf3128 Bump version to 2022.9.0b3 2022-09-20 17:14:51 +12:00
Paulus Schoutsen
5c4e83ebdc Bump dashboard to 20220919.1 (#3828) 2022-09-20 17:14:51 +12:00
Keith Burzinski
91f1c25fcc Make sprinkler reset_resume() method public (#3824) 2022-09-20 17:14:51 +12:00
h3ndrik
47a7a239ae [BME280] raise standby time (#3804) 2022-09-20 17:14:51 +12:00
Samuel Sieb
fb9984e21f split pronto codes if they are too long (#3812)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2022-09-20 17:14:51 +12:00
Paulus Schoutsen
b2db524366 Bump dashboard to 20220919.1 (#3828) 2022-09-20 17:13:59 +12:00
Keith Burzinski
ab8674a5c7 Make sprinkler reset_resume() method public (#3824) 2022-09-20 13:02:55 +12:00
Geek_cat
d1c85fc3fa Allow CORS for web_server (#3819) 2022-09-20 13:01:00 +12:00
h3ndrik
55ad45e3ee [BME280] raise standby time (#3804) 2022-09-19 07:25:59 +12:00
pawel3410
f6e5a8cb2a Fix mcp23s17 addressing beyond 3 (#3797) 2022-09-15 18:19:41 -07:00
Samuel Sieb
7a91ca9809 split pronto codes if they are too long (#3812)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2022-09-16 07:27:50 +12:00
Jesse Hills
71dd04b09e Merge pull request #3809 from esphome/bump-2022.9.0b2
2022.9.0b2
2022-09-15 13:35:54 +12:00
Jesse Hills
7deabbb512 Bump version to 2022.9.0b2 2022-09-15 13:02:40 +12:00
Azimath
625a575e49 Remove floating point calculation from ac_dimmer ISR (#3770) 2022-09-15 13:02:39 +12:00
Jesse Hills
df4d0da221 Initialize all child sensors to nullptr (#3808) 2022-09-15 13:02:39 +12:00
RoboMagus
6b23b7cad7 Unify 'nullptr' initalization of class members; (#3805) 2022-09-15 13:02:39 +12:00
Guillermo Ruffino
cea7deab91 Sim800l add calls, multiline sms and ussd (#3630)
Co-authored-by: Matus Ivanecky <matus.ivanecky@gmail.com>
Co-authored-by: Matus Ivanecky <maty535@users.noreply.github.com>
2022-09-15 13:02:39 +12:00
RoboMagus
c61abf6aca null initialize total sensor for pulse counter (#3803)
* null initialize total sensor.

* pedantic styling fix

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2022-09-15 13:02:39 +12:00
Azimath
917bbc669c Remove floating point calculation from ac_dimmer ISR (#3770) 2022-09-15 11:54:33 +12:00
Jesse Hills
0ac4c055de Initialize all child sensors to nullptr (#3808) 2022-09-15 11:53:22 +12:00
RoboMagus
78b55d86e9 Unify 'nullptr' initalization of class members; (#3805) 2022-09-15 11:53:02 +12:00
Guillermo Ruffino
aaf50fc2e6 Sim800l add calls, multiline sms and ussd (#3630)
Co-authored-by: Matus Ivanecky <matus.ivanecky@gmail.com>
Co-authored-by: Matus Ivanecky <maty535@users.noreply.github.com>
2022-09-15 07:43:03 +12:00
RoboMagus
6a8f4e92df null initialize total sensor for pulse counter (#3803)
* null initialize total sensor.

* pedantic styling fix

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2022-09-14 10:01:28 -03:00
Jesse Hills
6d267fda01 Merge pull request #3802 from esphome/bump-2022.9.0b1
2022.9.0b1
2022-09-14 17:27:01 +12:00
Jesse Hills
88943103a2 Bump version to 2022.10.0-dev 2022-09-14 17:02:22 +12:00
Jesse Hills
e557dc7208 Bump version to 2022.9.0b1 2022-09-14 17:02:22 +12:00
Jesse Hills
3558806b0e Merge branch 'dev' into bump-2022.9.0b1 2022-09-14 17:02:21 +12:00
Ignacio Hernandez-Ros
f1e8cc2cf0 fix spi timing issues (#3763) 2022-09-14 16:53:51 +12:00
Pascal Vizeli
6236db1a27 Add uFire ISE sensor (#3789)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-09-14 16:51:20 +12:00
Jesse Hills
f4b0917239 Allow ble tracker to subscribe to ota start and stop the scanning (#3800) 2022-09-14 16:49:20 +12:00
Aleš Komárek
a5e3cd1a42 Add Prometheus Service Discovery for online devices (#3788) 2022-09-14 15:22:59 +12:00
Jesse Hills
b3cca5dcb6 Add stop action for ble scanning (#3799) 2022-09-14 14:57:45 +12:00
Jonathan V
49465223a4 esp32_ble_tracker continuous and one shot scanning modes (#3649)
Co-authored-by: Jonathan Valdez <@jonofmac>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-09-14 11:10:12 +12:00
dependabot[bot]
15f0e54cbf Bump frenck/action-yamllint from 1.2.0 to 1.3.0 (#3798)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-14 09:57:43 +12:00
Pascal Vizeli
ed8f343aad Remove status_set_error from ufire_ec (#3792) 2022-09-13 11:17:33 +12:00
Jordan W. Cobb
cbd8d70431 Add support for TM1638 Led and Key component (#3340) 2022-09-12 08:30:15 -07:00
dependabot[bot]
9ff187c3f8 Bump zeroconf from 0.39.0 to 0.39.1 (#3782)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-12 10:32:33 +12:00
Carlos Garcia Saura
be473b97c4 [MPU6050] Support devices with WHOAMI 0x98 (#3784) 2022-09-12 10:32:07 +12:00
anatoly-savchenkov
9a5f865eea Add Factory Reset button and switch (#3724)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-09-12 10:23:46 +12:00
dependabot[bot]
790280ace9 Bump pylint from 2.15.0 to 2.15.2 (#3785)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-12 10:16:18 +12:00
David Buezas
8ba207fc7f Add support for BL0942 voltage, current, energy and power Sensor (#3777) 2022-09-12 09:36:09 +12:00
Keilin Bickar
d66b2a1778 Add support for MPL3115A2 Pressure/Altitude and Temperature Sensor (#3371)
* Add support for mpl3115a2

* Add codeowner

* Linter/test updates

* Minor changes

* Made pressure/altitude exclusive

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-09-09 00:18:02 -05:00
Pascal Vizeli
e3f2562047 u-fire EC sensor (#3774)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-09-08 22:30:07 +12:00
Philippe FOUQUET
f77118a90c Add support to tm1621 display (#3737)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-09-08 11:40:27 +12:00
Jesse Hills
635851807a Fix HA addon auth using HA credentials (#3758) 2022-09-06 16:41:23 +12:00
Jesse Hills
89fd367297 YAML linting (#3779) 2022-09-06 15:48:01 +12:00
Jesse Hills
c317422ed7 Move crc16 to helpers (#3780) 2022-09-06 12:57:21 +12:00
Jesse Hills
614eb81ad7 Remove unneeded line (spi component adds it) (#3778) 2022-09-06 11:54:32 +12:00
Avirsaam
219c5953f1 Update modbus_controller.cpp (#3768) 2022-09-05 12:50:27 +12:00
dependabot[bot]
5d712c73ea Bump pytest from 7.1.1 to 7.1.3 (#3766)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-04 20:24:26 +12:00
Andrey Yantsen
7097b7677e Add the same docker tags as used in HA (#3752) 2022-09-04 20:23:54 +12:00
anatoly-savchenkov
7a4cf13e0c Ignore NaN states in the integration component (#3767) 2022-09-04 19:21:17 +12:00
NP v/d Spek
4788a6182e I found some issue in the ili9341 driver (#3756) 2022-09-02 15:46:51 +12:00
dependabot[bot]
e3dad7c632 Bump black from 22.6.0 to 22.8.0 (#3760)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-02 13:42:04 +12:00
RoboMagus
1b4156646e Esp32 pulsecounter optional pcnt (#3691)
Co-authored-by: RoboMagus <->
2022-09-02 13:22:34 +12:00
dependabot[bot]
2650441013 Bump pylint from 2.14.5 to 2.15.0 (#3746)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-08-31 17:01:36 +12:00
dependabot[bot]
71697df2b6 Bump aioesphomeapi from 10.11.0 to 10.13.0 (#3740)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-31 16:53:36 +12:00
Fabian Berthold
acd55b9601 Add sum type to binary_sensor_map (#3541) 2022-08-31 16:52:16 +12:00
yuhei mukoyama
0907de8662 Add AEHA IR Protocol (#3726) 2022-08-31 16:43:33 +12:00
Wouter van der Wal
15eb9605a8 ibeacon support for the ble_rssi sensor (#3745) 2022-08-31 16:42:48 +12:00
Joe
6d5cb866db Add BedJet Fan child component (#3735) 2022-08-31 13:53:18 +12:00
Keith Burzinski
768490089e Add IP101 support to Ethernet component (#3751) 2022-08-31 13:45:30 +12:00
Jesse Hills
4d66fab360 Tidy up switch schemas (#3754) 2022-08-31 13:43:46 +12:00
Jesse Hills
bd6bc283b6 Remove unnecessary schema extension on template button (#3753) 2022-08-31 11:45:06 +12:00
anatoly-savchenkov
3120a0ba83 Captive portal show nearby WiFi with no ssid configured (#3748) 2022-08-31 10:19:43 +12:00
andyboeh
b2199d5464 mcp23017: read output latch registers during setup (#3744) 2022-08-31 10:07:40 +12:00
Jan Grewe
84bac8356a Add Prometheus metrics relabeling (#3734)
Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2022-08-30 10:55:55 +12:00
Frank Riley
2819166539 Support high update rates and fix several bugs in the cse7766 component. (#3675) 2022-08-25 16:12:45 +12:00
MrEditor97
8fa18ca7c7 Support for MCP9600 Thermocouple Amplifier (#3700)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-08-25 15:49:31 +12:00
NP v/d Spek
63290a265c add color compare operator's (#3730) 2022-08-25 13:41:52 +12:00
Jesse Hills
b854e17995 Initial bluetooth_proxy support (#3736) 2022-08-25 07:13:44 +12:00
Samuel Sieb
5dec9d88f6 add log messages for bad pronto codes (#3738)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2022-08-23 13:26:36 +12:00
Mike Ryan
3d0a85ee78 Add bitmap font support (#3573)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-08-19 10:49:52 +12:00
Keith Burzinski
ac3cdf487f Fix SPI HW selection for ESP32 variants (#3728) 2022-08-19 07:55:10 +12:00
Sebastian Lövdahl
a47e92f2bc Let favicon be cached (#3729) 2022-08-19 07:54:10 +12:00
Keith Burzinski
fc15ddfa91 Add dps310 sensor support (#3704)
Co-authored-by: Greg Arnold <greg@arnoldassociates.com>
2022-08-19 07:49:35 +12:00
Jesse Hills
d546ef941f Add final validate for i2c with mix/max frequency (#3727)
Co-authored-by: MrEditor97 <mr.samuel.hughes@gmail.com>
2022-08-18 11:04:50 +12:00
Stijn Tintel
b4bbe3d7b5 wifi: support 802.11k and 802.11v (#3600) 2022-08-17 21:10:43 +12:00
functionpointer
5561d4eaeb hydreon_rgxx: Support lens_bad, em_sat and temperature (#3642) 2022-08-17 16:07:33 +12:00
Samuel Sieb
0f6dab394a fix grow password setting (#3722)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2022-08-16 20:41:46 -07:00
Samuel Sieb
43539f2dbf Send CR also for commands for sim800l (#3719) 2022-08-17 10:35:44 +12:00
Ignacio Hernandez-Ros
df6830110d Improve OTA error messages adding return codes (#3698) 2022-08-16 21:51:05 +12:00
Jesse Hills
1a98e882dc Merge pull request #3718 from esphome/bump-2022.8.0b3
2022.8.0b3
2022-08-16 15:16:37 +12:00
Jesse Hills
c943d84036 Bump version to 2022.8.0b3 2022-08-16 14:47:48 +12:00
rbaron
d07a6704d5 Makes ble_client.ble_write's action value templatable (#3715) 2022-08-16 14:47:48 +12:00
rbaron
8cfcd5904c Fixes BLE remote address type when connecting (#3702) 2022-08-16 14:47:48 +12:00
buxtronix
fb8846bb45 Only trigger ble_client on_connect after discovering services (#3710) 2022-08-16 14:47:48 +12:00
anatoly-savchenkov
0d0733dd94 Webui small fixes (#3713) 2022-08-16 14:47:47 +12:00
rbaron
1a524a5a50 Makes ble_client.ble_write's action value templatable (#3715) 2022-08-16 14:40:58 +12:00
rbaron
1a2288cccf Fixes BLE remote address type when connecting (#3702) 2022-08-15 15:09:33 +12:00
buxtronix
8df27d4c3f Only trigger ble_client on_connect after discovering services (#3710) 2022-08-15 15:06:05 +12:00
puuu
0688deca6b Add support for pvvx mithermometer display via ble client (#3333)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-08-15 10:56:25 +12:00
anatoly-savchenkov
01a4443b6c Webui small fixes (#3713) 2022-08-15 10:28:29 +12:00
Samuel Sieb
e008b054cb support modifying the apds9960 settings (#3708)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-08-15 10:16:56 +12:00
Jesse Hills
a67d58948d Merge pull request #3714 from esphome/bump-2022.8.0b2
2022.8.0b2
2022-08-15 09:08:44 +12:00
Jesse Hills
84c051d097 Bump version to 2022.8.0b2 2022-08-15 08:23:35 +12:00
NP v/d Spek
b918abfd54 add gradient color V2.0 (#3709) 2022-08-15 08:23:35 +12:00
Peter Galantha
7f41b7cd93 Add state_class total (#3608)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-08-15 08:23:35 +12:00
Jesse Hills
4759b4fe2e Add vector include (#3707) 2022-08-15 08:23:35 +12:00
anatoly-savchenkov
e2c8e69d12 Improve Web view for Climate components (#3706) 2022-08-15 08:23:35 +12:00
NP v/d Spek
1cf213dad8 add gradient color V2.0 (#3709) 2022-08-15 08:21:08 +12:00
Peter Galantha
aeb81e547b Add state_class total (#3608)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-08-11 14:00:09 +12:00
Jesse Hills
479f7703a2 Add vector include (#3707) 2022-08-11 13:57:42 +12:00
anatoly-savchenkov
c7dc396b6d Improve Web view for Climate components (#3706) 2022-08-11 13:32:55 +12:00
Jesse Hills
917e8e155c Merge pull request #3705 from esphome/bump-2022.8.0b1
2022.8.0b1
2022-08-10 15:45:17 +12:00
Jesse Hills
80e3030811 Bump version to 2022.9.0-dev 2022-08-10 15:26:02 +12:00
Jesse Hills
a97e3d827d Bump version to 2022.8.0b1 2022-08-10 15:26:02 +12:00
RoboMagus
029014d9d6 Add priority to on_shutdown trigger (#3644) 2022-08-10 13:10:49 +12:00
dependabot[bot]
e4c2922536 Bump pylint from 2.14.4 to 2.14.5 (#3697)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-10 12:34:56 +12:00
dependabot[bot]
7133ae6aaa Bump flake8 from 4.0.1 to 5.0.4 (#3703)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-10 09:21:25 +12:00
dependabot[bot]
2f7f0ff3a1 Bump pytest-mock from 3.8.1 to 3.8.2 (#3622)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-10 08:03:42 +12:00
dependabot[bot]
df853bf61e Bump zeroconf from 0.38.7 to 0.39.0 (#3694)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-09 19:19:13 +12:00
dependabot[bot]
f0ac753f9b Bump pytest-asyncio from 0.18.3 to 0.19.0 (#3695)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-09 19:16:49 +12:00
Adrián Panella
4d56a975e6 Create feedback cover component (#3253) 2022-08-09 17:21:27 +12:00
dependabot[bot]
d56c53c848 Bump aioesphomeapi from 10.10.0 to 10.11.0 (#3669)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-09 13:53:30 +12:00
dependabot[bot]
f83b16320d Bump pyupgrade from 2.34.0 to 2.37.3 (#3670)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-08-09 13:53:18 +12:00
anatoly-savchenkov
ac10e27f08 [Nextion] Add on_page trigger (#3673) 2022-08-09 12:44:20 +12:00
NP v/d Spek
34df7a6072 add gradient color (#3687) 2022-08-09 12:29:41 +12:00
Keith Burzinski
e2cddf1005 Sprinkler controller component (#2249)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-08-09 12:19:42 +12:00
Ian Blais
ced423748e Adding support for Whynter ARC-14S/SH Air Conditioners (#3641) 2022-08-09 10:49:03 +12:00
davestubbs
77fb02729e Added support for setting the current animation frame (#3681) 2022-08-09 10:28:05 +12:00
Joe
fef39b9fbe Refactor BedJet climate into Hub component (#3522) 2022-08-09 10:14:37 +12:00
Jesse Hills
02810105fb Add helpers to switch python for schema and codegen (#3693)
* Add helpers to switch python for schema and codegen

* Add icon back
2022-08-07 22:01:17 -05:00
rbaron
baad92515b Introduces ble_client.ble_write Action (#3398) 2022-08-08 12:59:55 +12:00
dentra
a12c6b5f35 Fix panic abort when BLEClient reconnects (#3594) 2022-08-08 07:57:43 +12:00
Keith Burzinski
522646c64d Extend ST7789V component to support additional displays (#3651)
Co-authored-by: definitio <37266727+definitio@users.noreply.github.com>
2022-08-08 07:54:48 +12:00
anatoly-savchenkov
4791093e48 Add get_ap() method to WiFi (#3684) 2022-08-08 07:51:09 +12:00
Donovan Baarda
599a455150 Add a soft reset in setup() for bme280. (#3615) 2022-08-08 07:50:15 +12:00
Samuel Sieb
2deef16ebe fix sx1509 use of pullup and pulldown (#3689)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2022-08-08 07:39:41 +12:00
RoboMagus
989b7be99b Pass optional args to 'new_Pvariable' when creating new entities (#3690) 2022-08-08 07:31:50 +12:00
Derek M
cd473e1395 Adding option to report signal strength on pvvx_mithermometer (#3688)
Co-authored-by: doolbneerg <doolbneerg@outlook.com>
2022-08-08 07:30:30 +12:00
Jesse Hills
e246ebfb2e Remove old unused code in mcp23xxx_base (#3685) 2022-08-07 09:56:52 +12:00
Borys Pierov
8546ae56da Allow GPIO20 for ESP32 (#3680) 2022-08-04 07:30:19 +12:00
Sybren A. Stüvel
9e227b0192 Upgrade rweather/Crypto from 0.2.0 to 0.4.0 (#3593)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-08-03 07:58:03 +12:00
Samuel Sieb
ba7737e9f8 dalybms: support changing the address (#3676) 2022-08-03 07:48:02 +12:00
Jesse Hills
98aa3d51ed Show changes from python linting (#3677) 2022-08-03 07:27:45 +12:00
Samuel Sieb
e7cfb5492e Use correct struct members. (#3672) 2022-08-02 17:09:17 +12:00
Samuel Sieb
9ed136dc3a Use application/json instead of text/json (#3671) 2022-08-02 17:07:32 +12:00
Bryan Berg
9217216723 Add CO device class to binary_sensor (#3656) 2022-08-02 11:32:02 +12:00
RoboMagus
936c408a58 List webserver service on MDNS if enabled. (#3662) 2022-08-02 11:31:06 +12:00
Samuel Sieb
54427eac9a Update inkbird_ibsth1_mini.cpp (#3664) 2022-08-01 13:08:19 +12:00
Samuel Sieb
e809488cc0 Remove deprecated adc init call. (#3667) 2022-08-01 09:44:58 +12:00
DAVe3283
ed26c57d99 Rework NaN handling in sensor filters (#3610)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-07-28 16:39:11 +12:00
piechade
2a49811f6e Add support for SMT100 Soil Moisture Sensor (#3654)
Co-authored-by: Dennis Piecha <d.piecha@ymail.com>
2022-07-28 11:22:49 +12:00
Peter Galantha
c95acd2568 update packages: nginx-light-1.18.0-6.1+deb11u2 nano-5.4-2+deb11u1 (#3631) 2022-07-25 16:04:21 +12:00
Samuel Sieb
6a4e0cf667 add option to publish initial state of binary sensors (#3636)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2022-07-25 15:55:32 +12:00
RoboMagus
04f4dd8a22 Add 'set_total_pulses' action to 'pulse_counter' sensor. (#3640) 2022-07-25 14:20:15 +12:00
Javier Peletier
f33d829ce9 FIX: NVS preferences being written even if unchanged (#3647) 2022-07-25 10:10:37 +12:00
RoboMagus
578671ea94 Fix configuration constants in core. (#3652) 2022-07-25 08:23:55 +12:00
Javier Peletier
d10300c330 modbus: fix queue deduplicator erasing custom commands (#3650) 2022-07-25 08:06:18 +12:00
Andreas Hergert
e0555e140f Improvement pipsolar crc (#3316)
Co-authored-by: Andreas <andreas.hergert@otrs.com>
2022-07-07 12:54:19 +12:00
Luca Adrian L
093989406f Added more sensor device classes (#3624) 2022-07-07 11:32:38 +12:00
dab0g
cdb16f08f6 Update dfplayer condition function name (#3619) 2022-07-04 09:22:04 +12:00
dependabot[bot]
53139c293b Bump pytest-mock from 3.7.0 to 3.8.1 (#3616) 2022-07-01 14:54:37 +02:00
dependabot[bot]
6a8bdcc315 Bump pylint from 2.14.3 to 2.14.4 (#3617) 2022-07-01 14:54:13 +02:00
dependabot[bot]
fe535939a3 Bump colorama from 0.4.4 to 0.4.5 (#3614) 2022-06-30 12:42:35 +02:00
dependabot[bot]
09e6c11d73 Bump black from 22.3.0 to 22.6.0 (#3613) 2022-06-30 12:42:28 +02:00
dependabot[bot]
8112bdfaa8 Bump pyupgrade from 2.32.1 to 2.34.0 (#3591)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-06-30 11:59:53 +02:00
marshn
f7db9aaa9f Fix slow_pwm output glitch (#3601) 2022-06-30 11:28:19 +02:00
Javier Peletier
435f972357 fix EDict to dict mapping in helpers.py (#3599) 2022-06-30 11:24:24 +02:00
dependabot[bot]
f82b46c16b Bump zeroconf from 0.38.4 to 0.38.7 (#3562)
Bumps [zeroconf](https://github.com/jstasiak/python-zeroconf) from 0.38.4 to 0.38.7.
- [Release notes](https://github.com/jstasiak/python-zeroconf/releases)
- [Commits](https://github.com/jstasiak/python-zeroconf/compare/0.38.4...0.38.7)

---
updated-dependencies:
- dependency-name: zeroconf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-30 11:06:22 +02:00
Jesse Hills
bca96f91b2 Remove min_save_interval from intergration and total_daily_energy (#3498) 2022-06-30 16:47:56 +12:00
Benoit3
6f83a49c63 #3358 Correct temperature validity detection issue in some conditions of pu… (#3545)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-06-29 21:30:44 +02:00
André Klitzing
72cce391ab Fix some typos found by codespell (#3598) 2022-06-27 18:02:46 -03:00
Jesse Hills
28d2949ebe Add github-actions to dependabot (#3595) 2022-06-23 07:51:05 +12:00
Sven Serlier
c4a0015997 Update actions (#3592)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-06-23 07:50:55 +12:00
Jesse Hills
f564be6aea Do two substitutions passes to allow substitutions inside substitutions (#3583) 2022-06-22 08:21:32 +12:00
dependabot[bot]
988f15e6af Bump aioesphomeapi from 10.8.2 to 10.10.0 (#3590)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-06-21 17:19:41 +12:00
Zimmermann Zsolt
37b6d442bd Correcting ESP32 flash save/load key calculation algorithm (#3416)
Co-authored-by: Otto Winter <otto@otto-winter.com>
Co-authored-by: Dr. Zimmermann Zsolt <cina@storage1.cina.hu>
2022-06-21 17:17:51 +12:00
Nick B
fb2467f6f0 DAC7678 support (#3441)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-06-21 17:12:15 +12:00
dependabot[bot]
29045b0435 Bump pylint from 2.13.9 to 2.14.3 (#3589)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-06-21 16:27:33 +12:00
Jesse Hills
311a48c64e Bump platformio to 6.0.2 (#3566) 2022-06-21 11:53:51 +12:00
Mateus Demboski
01b3815f27 Map LOLIN C3 mini board pins (#3587) 2022-06-21 11:33:20 +12:00
Joe
b0d1c801bd Fix 2 small issues in BLEClient (#3544) 2022-06-21 11:31:17 +12:00
RoboMagus
5aaac06f5b RestoringGlobalsComponent: Store value on shutdown (#3586) 2022-06-21 11:27:53 +12:00
RoboMagus
34adbf0588 Fix / Reverse order shutdown (#3585) 2022-06-21 11:26:34 +12:00
Jesse Hills
0a4213182e Merge branch 'release' into dev 2022-06-21 07:18:41 +12:00
Sergey Dudanov
b0c0258e70 Media Player: added play_media action (#3579)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-06-20 12:17:20 +12:00
kahrendt
8110e591d0 Fix wrong type for voc_state*_ in sgp4x component (#3581)
Co-authored-by: Martin <25747549+martgras@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-06-20 11:27:00 +12:00
ShellAddicted
fe05d7aec1 Fix: Make MQTT over TLS actually work (#3580) 2022-06-20 11:17:58 +12:00
lkomurcu
57f5884070 Move gas mbus config option being a define to being a build flag since its used in external libraries. (#3575) 2022-06-20 07:39:40 +12:00
Jesse Hills
f329c74a15 Merge pull request #3578 from esphome/bump-2022.6.1
2022.6.1
2022-06-18 22:31:45 +12:00
Jesse Hills
7c86f3fa9e Bump version to 2022.6.1 2022-06-18 17:25:52 +12:00
Sergey Dudanov
203b8b01bf Media Player: added triggers (#3576) 2022-06-18 17:25:51 +12:00
Benjamin Klotz
8a1034a92f Bugfix for ExternalRAMAllocator copy constructor (#3571) 2022-06-18 17:25:51 +12:00
Jesse Hills
aa0c2dedd9 Setup the mute pin if configured (#3568) 2022-06-18 17:25:51 +12:00
Sergey Dudanov
d045908e05 Media Player: added triggers (#3576) 2022-06-18 17:21:42 +12:00
Guillermo Ruffino
f002a23d2d Language schema 202204 (#3492) 2022-06-17 13:46:20 +12:00
gazoodle
29d6d0a906 Fix modbus user-defined function handling (#3527) 2022-06-17 13:35:25 +12:00
Benjamin Klotz
c8b58b5c23 Bugfix for ExternalRAMAllocator copy constructor (#3571) 2022-06-17 13:32:43 +12:00
Jesse Hills
01bfafc5f1 Setup the mute pin if configured (#3568) 2022-06-17 13:30:21 +12:00
Jesse Hills
8c9948bb56 Merge pull request #3567 from esphome/bump-2022.6.0
2022.6.0
2022-06-16 12:59:26 +12:00
Jesse Hills
2d1abaa68e Bump version to 2022.6.0 2022-06-16 11:31:38 +12:00
Jesse Hills
664a3df0b4 Merge branch 'beta' into bump-2022.6.0 2022-06-16 11:31:38 +12:00
Jesse Hills
9ff893881c Merge pull request #3560 from esphome/bump-2022.6.0b4
2022.6.0b4
2022-06-14 22:42:06 +12:00
Jesse Hills
94f6c6861a Bump version to 2022.6.0b4 2022-06-14 20:41:46 +12:00
Martin
b1d614e6c4 Bm3xx: Fix typo (#3559) 2022-06-14 20:41:46 +12:00
André Klitzing
7fceb070e5 Fix compilation with ESP32-S3 (#3543)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-06-14 20:41:46 +12:00
Martin
06440d0202 Bm3xx: Fix typo (#3559) 2022-06-14 20:38:09 +12:00
André Klitzing
0ecf9f4f2f Fix compilation with ESP32-S3 (#3543)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-06-14 20:36:38 +12:00
Jesse Hills
5c7c0834c0 Merge pull request #3554 from esphome/bump-2022.6.0b3
2022.6.0b3
2022-06-13 17:06:45 +12:00
Jesse Hills
f3a25de11d Bump version to 2022.6.0b3 2022-06-13 13:32:43 +12:00
Jesse Hills
041bef8bcd Implement media player volume actions (#3551) 2022-06-13 13:32:43 +12:00
Jesse Hills
8998c5f6dd Implement media player volume actions (#3551) 2022-06-13 13:28:55 +12:00
Jesse Hills
6e83790308 Merge pull request #3540 from esphome/bump-2022.6.0b2
2022.6.0b2
2022-06-09 21:16:23 +12:00
Jesse Hills
d2d4eb4eae Bump version to 2022.6.0b2 2022-06-09 20:27:22 +12:00
Viktor Nagy
5942a3898c Nextion brightness setting requires an assignment (#3533) 2022-06-09 20:27:22 +12:00
Samuel Sieb
93421f0fa7 publish fan speed count for discovery (#3537)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2022-06-09 20:27:22 +12:00
RoboMagus
3a9ab50dd2 Refactor vl53l0x to remove code from header. (#3536) 2022-06-09 16:24:56 +12:00
Viktor Nagy
5abd91d6d5 Nextion brightness setting requires an assignment (#3533) 2022-06-09 16:20:05 +12:00
Samuel Sieb
c3da42516b publish fan speed count for discovery (#3537)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2022-06-09 15:27:04 +12:00
Jesse Hills
6cb5cd48c2 Merge pull request #3535 from esphome/bump-2022.6.0b1
2022.6.0b1
2022-06-08 23:26:21 +12:00
Jesse Hills
ec1fae6883 Bump version to 2022.7.0-dev 2022-06-08 22:46:20 +12:00
Jesse Hills
746fd1122f Bump version to 2022.6.0b1 2022-06-08 22:46:20 +12:00
Jesse Hills
9663760ec5 Merge branch 'dev' into bump-2022.6.0b1 2022-06-08 22:46:20 +12:00
Wolfgang Tremmel
a3d73d1e23 RG15 data is float/double, not int (#3512)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-06-08 22:34:50 +12:00
Jesse Hills
d63e14a4b6 Implement the media player actions (#3534) 2022-06-08 22:33:21 +12:00
DAVe3283
03944e6cd8 Fix bogus reading on no communication with MAX31865 (#3505) 2022-06-08 09:58:32 +12:00
Maurice Makaay
0d1028be2e Cleanup deprecated EntityBase::hash_base() (#3525)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2022-06-08 09:13:11 +12:00
VitaliyKurokhtin
6a85259e4d Block Tuya light from reacting to dp changes if transitioning (#3076) 2022-06-07 23:07:08 +12:00
Maurice Makaay
ebca936b7e Fix percentage validation for wrong data type input (#3524)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2022-06-07 23:00:27 +12:00
Nicholas Peters
31c4551890 Fix sdp3x error checking (#3531) 2022-06-07 22:43:46 +12:00
Samuel Sieb
dd470d4197 support rotated ILI9341 (ILI9342) (#3526)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2022-06-07 22:42:13 +12:00
Maurice Makaay
612822490b Fix endless 'WiFi Unknown connection status 0' loop (#3530)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2022-06-07 12:08:29 +12:00
Maurice Makaay
f8969605e8 Suppress first rotary encoder event (#3532)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2022-06-07 11:36:54 +12:00
Carlos Garcia Saura
dd24ffa24e Correct ADC auto-range for ESP32-S2 variant (13 bit adc) (#3158)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-06-03 16:07:35 +12:00
guillempages
d0dda48932 Add display_type property to DisplayBuffer (#3430)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-06-03 15:39:04 +12:00
Eric van Blokland
6349b5f654 Added RC6 protocol support (#3514) 2022-06-03 15:37:04 +12:00
Joe
a6ff02a3cf Refactor clock syncing (#3503)
* Expose `send_local_time()` as public, for use in lambdas.
  This will send the current time configured in `time_id`.
* Add a new `set_clock()` public method, separate from time_id.
  This allows setting the clock manually, without syncing from a Time
  Component. Again this can only be called from ESPHome; i.e.,
  generally from a lambda.
2022-06-03 13:53:20 +12:00
jimtng
4f57bf786b Add mqtt.on_connect and mqtt.on_disconnect triggers (#3520) 2022-06-03 13:51:50 +12:00
Jesse Hills
6221f6d47d Implement Media Player and I2S Media player (#3487) 2022-06-02 17:00:17 +12:00
Wolfgang Tremmel
a922efeafa Change rain intensity sensor string (#3511) 2022-05-31 16:49:18 +12:00
jimtng
5aa42e5e66 Add variable substitutions for !include (#3510) 2022-05-31 16:45:18 +12:00
Joe
708672ec7e [BedJet] Add configurable heating strategy (#3519)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-05-31 15:45:01 +12:00
Jan Grewe
d2cefbf224 Allow Prometheus component to export internal components (#3508)
Co-authored-by: Jan Grewe <jan.grewe@flixbus.com>
2022-05-31 07:29:57 +12:00
Michael Davidson
adb7aa6950 Thermostat preset with modes (#3298)
* Rework HOME/AWAY support to being driven via a map of ClimatePreset/ThermostatClimateTargetTempConfig
This opens up to theoretically being able to support other presets (ECO, SLEEP, etc)

* Add support for additional presets
Configuration takes the form;
```
climate:
  platform: preset
  ...
  preset:
    [eco | away | boost | comfort | home | sleep | activity]:
      default_target_temperature_low: 20
      default_target_temperature_high: 24
```

These will be available in the Home Assistant UI and, like the existing Home/Away config will reset the temperature in line with these defaults when selected. The existing away_config/home_config is still respected (although preset->home/preset->away will be applied after them and override them if both styles are specified)

* Add support for specifying MODE, FAN_MODE and SWING_MODE on a preset
When switching presets these will implicitly flow through to the controller. However calls to climate.control which specify any of these will take precedence even when changing the mode (think of the preset version as the default for that preset)

* Add `preset_change` mode trigger
When defined this trigger will fire when the preset for the thermostat has been changed. The intent of this is similar to `auto_mode` - it's not intended to be used to control the preset's state (eg. communicate with the physical thermostat) but instead might be used to update a visual indicator, for instance.

* Apply lint, clang-format, and clang-tidy fixes

* Additional clang-format fixes

* Wrap log related strings in LOG_STR_ARG

* Add support for custom presets
This also changes the configuration syntax to;
```yaml
  preset:
    # Standard preset
    - name: [eco | away | boost | comfort | home | sleep | activity]
      default_target_temperature_low: 20
      ...
    # Custom preset
    - name: My custom preset
      default_target_temperature_low: 18
```

For the end user there is no difference between a custom and built in preset. For developers custom presets are set via `climate.control` `custom_preset` property instead of the `preset`

* Lint/clang-format/clang-tidy fixes

* Additional lint/clang-format/clang-tidy fixes

* Clang-tidy changes

* Sort imports

* Improve configuration validation for presets
- Unify temperature validation across default, away, and preset configuration
- Validate modes for presets have the required actions

* Trigger a refresh after changing internals of the thermostat

* Apply formatting fixes

* Validate mode, fan_mode, and swing_mode on presets

* Add preset temperature validation against visual min/max configuration

* Apply code formatting fixes

* Fix preset temperature validation
2022-05-24 22:44:26 -05:00
Jesse Hills
77f322166e Merge pull request #3499 from esphome/bump-2022.5.1
2022.5.1
2022-05-25 07:29:42 +12:00
Jesse Hills
f3f6e54818 Bump version to 2022.5.1 2022-05-24 21:56:18 +12:00
Martin
fb0fec1f25 esp32: fix NVS (#3497) 2022-05-24 21:56:18 +12:00
Jesse Hills
b66af9fb4d Add missing import to bedjet (#3490) 2022-05-24 21:56:18 +12:00
user897943
6617d576a7 Update bedjet_const.h to remove blank spaces before speed steps, fixes Unknown Error when using climate.set_fan_mode in HA (#3476) 2022-05-24 21:56:18 +12:00
Wumpf
cd35ead890 [scd4x] Fix not passing arguments to templatable value for perform_forced_calibration (#3495) 2022-05-24 13:00:06 +12:00
joseph douce
9dc804ee27 Output a true RMS voltage % (#3494) 2022-05-24 12:52:54 +12:00
Martin
a8ceeaa7b0 esp32: fix NVS (#3497) 2022-05-23 20:56:26 +12:00
Sergey Dudanov
7092f7663e midea: New power_toggle action. Auto-use remote transmitter. (#3496) 2022-05-23 20:51:45 +12:00
Jesse Hills
d9d2edeb08 Fix compile issues on windows (#3491) 2022-05-19 21:21:42 +12:00
Jesse Hills
dda1ddcb26 Add missing import to bedjet (#3490) 2022-05-19 16:23:40 +12:00
Keilin Bickar
f0c890f160 Remove deprecated fan speeds (#3397)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-05-19 12:50:44 +12:00
gazoodle
4f52d43347 add support user-defined modbus functions (#3461) 2022-05-19 12:49:12 +12:00
Martin
0ed7db979b Add support for SGP41 (#3382)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-05-19 12:47:33 +12:00
myml
9c78049359 feat: esp32-camera add stream event (#3285) 2022-05-19 12:23:50 +12:00
user897943
7882105661 Update bedjet_const.h to remove blank spaces before speed steps, fixes Unknown Error when using climate.set_fan_mode in HA (#3476) 2022-05-19 10:25:42 +12:00
Dave T
c000e1d6dd Ili9341 8bit indexed mode pt1 (#2490) 2022-05-19 10:23:00 +12:00
Jesse Hills
420dacb22d Merge pull request #3488 from esphome/bump-2022.5.0
2022.5.0
2022-05-18 16:56:16 +12:00
Jesse Hills
ae2f6ad4d1 Bump version to 2022.5.0 2022-05-18 16:30:20 +12:00
Jesse Hills
2c28d79bf8 Merge branch 'beta' into bump-2022.5.0 2022-05-18 16:30:19 +12:00
Jesse Hills
c5069edc78 Merge pull request #3484 from esphome/bump-2022.5.0b4
2022.5.0b4
2022-05-17 23:42:51 +12:00
Jesse Hills
282d9e138c Revert adding spaces 2022-05-17 23:31:55 +12:00
Jesse Hills
72fcf2cbe1 Bump version to 2022.5.0b4 2022-05-17 23:23:37 +12:00
Samuel Sieb
6f49f5465b Retry Tuya init commands (#3482)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2022-05-17 23:23:33 +12:00
Martin
17b8bd8316 ESP32: Only save to NVS if data was changed (#3479) 2022-05-17 23:16:33 +12:00
Samuel Sieb
9b6b9c1fa2 Retry Tuya init commands (#3482)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2022-05-17 20:15:02 +12:00
Martin
609a2ca592 ESP32: Only save to NVS if data was changed (#3479) 2022-05-17 10:59:36 +12:00
[pʲɵs]
6dabf24bf3 MQTT cover: send state even if position is available (#3473) 2022-05-16 15:35:27 +12:00
Jesse Hills
7e88938932 Merge pull request #3478 from esphome/bump-2022.5.0b3
2022.5.0b3
2022-05-16 13:42:05 +12:00
Jesse Hills
c707e64685 Bump version to 2022.5.0b3 2022-05-16 13:07:12 +12:00
Jesse Hills
a639690716 Mark improv_serial and ESP-IDF usb based serial on c3/s2/s3 unsupported (#3477) 2022-05-16 13:07:12 +12:00
[pʲɵs]
01222dbab7 Increase JSON buffer size on overflow (#3475) 2022-05-16 13:07:12 +12:00
Jesse Hills
93e2506279 Mark improv_serial and ESP-IDF usb based serial on c3/s2/s3 unsupported (#3477) 2022-05-16 13:05:20 +12:00
Maxim Ocheretianko
f62d5d3b9d Add Tuya select (#3469) 2022-05-16 07:49:40 +12:00
Maxim Ocheretianko
0665acd190 Tuya status gpio support (#3466) 2022-05-16 07:44:14 +12:00
[pʲɵs]
fea05e9d33 Increase JSON buffer size on overflow (#3475) 2022-05-15 19:53:43 +12:00
dependabot[bot]
7a03c7d56f Bump pylint from 2.13.8 to 2.13.9 (#3470)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.13.8 to 2.13.9.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.13.8...v2.13.9)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-15 19:46:36 +12:00
dependabot[bot]
2dc2aec954 Bump esptool from 3.3 to 3.3.1 (#3468)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-13 13:44:24 +12:00
Dave T
39c6c2417a Remove duplicate convert_to_8bit_color_ function. (#2469)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-05-12 22:18:51 +12:00
Jesse Hills
ff72d6a146 Merge pull request #3465 from esphome/bump-2022.5.0b2
2022.5.0b2
2022-05-12 22:15:21 +12:00
Jesse Hills
603d0d0c7c Bump version to 2022.5.0b2 2022-05-12 17:00:14 +12:00
Brian Kaufman
28883f711b Update captive portal canHandle function (#3360) 2022-05-12 17:00:13 +12:00
Michael Davidson
e914828add Make custom_fan and custom_preset templatable as per documentation (#3330) 2022-05-12 17:00:13 +12:00
James Szalay
c1480029fb Use heat mode for heat. Move EXT HT to custom presets. (#3437)
* Use heat mode for heat. Move EXT HT to custom presets.

* Fix syntax error.
2022-05-12 17:00:13 +12:00
Niclas Larsson
40f622949e Shelly dimmer: Use unique_ptr to handle the lifetime of stm32_t (#3400)
Co-authored-by: Martin <25747549+martgras@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-05-12 17:00:13 +12:00
Maurice Makaay
63096ac2bc On epoch sync, restore local TZ (#3462)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2022-05-12 17:00:13 +12:00
Brian Kaufman
03d5a0ec1d Update captive portal canHandle function (#3360) 2022-05-12 16:57:50 +12:00
Michael Davidson
1c873e0034 Make custom_fan and custom_preset templatable as per documentation (#3330) 2022-05-12 16:54:45 +12:00
swifty99
bcb47c306c Tcs34725 automatic sampling settings for improved dynamics and accuracy (#3258)
Co-authored-by: Daniel Cousens <413395+dcousens@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-05-12 16:53:33 +12:00
James Szalay
01c4d3c225 Use heat mode for heat. Move EXT HT to custom presets. (#3437)
* Use heat mode for heat. Move EXT HT to custom presets.

* Fix syntax error.
2022-05-12 15:26:14 +12:00
Niclas Larsson
c2aaae4818 Shelly dimmer: Use unique_ptr to handle the lifetime of stm32_t (#3400)
Co-authored-by: Martin <25747549+martgras@users.noreply.github.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-05-12 10:26:51 +12:00
Maurice Makaay
3f678e218d On epoch sync, restore local TZ (#3462)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2022-05-12 09:25:00 +12:00
Jesse Hills
c2a59cb476 Merge pull request #3460 from esphome/bump-2022.5.0b1
2022.5.0b1
2022-05-11 15:51:44 +12:00
Jesse Hills
f8a1bd4e79 Bump version to 2022.6.0-dev 2022-05-11 12:50:42 +12:00
Jesse Hills
d6e039a1d1 Bump version to 2022.5.0b1 2022-05-11 12:50:42 +12:00
Jesse Hills
0f1a7c2b69 Merge branch 'dev' into bump-2022.5.0b1 2022-05-11 12:50:41 +12:00
Jesse Hills
40ad9f4911 Add deep_sleep.allow YAML action (#3459) 2022-05-11 12:47:50 +12:00
Ruben De Smet
4116caff6a Implement allow_deep_sleep (#3282) 2022-05-11 11:44:52 +12:00
Otto Winter
0b69f72315 Enable api transport encryption for new projects (#3142)
* Enable api transport encryption for new projects

* Format
2022-05-11 11:38:05 +12:00
Maurice Makaay
c569f5ddcf Code cleanup fixes for the number component (#3458)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2022-05-11 11:02:49 +12:00
Maurice Makaay
62f9e181e0 Code cleanup fixes for the select component (#3457)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2022-05-11 10:58:28 +12:00
Otto Winter
235a97ea10 Make retry scheduler efficient (#3225) 2022-05-11 07:54:00 +12:00
MFlasskamp
e541ae400c Esp32c3 deepsleep fix (#3454) 2022-05-10 22:03:59 +12:00
Massimo Cetra
4822abde86 Fix BLE280 setup when the sensor is marked as failed. (#3396) 2022-05-10 22:03:40 +12:00
Jesse Hills
b7e52812f8 Fix tests (#3455) 2022-05-10 22:02:58 +12:00
LuBeDa
69118120d9 added prev_frame for animation (#3427) 2022-05-10 21:56:29 +12:00
Dennis
7cba0c6fb0 Fix cover set position by force pushing position_id datapoint (simila… (#3435) 2022-05-10 21:42:31 +12:00
Felix Storm
5fac67ce15 CAN bus: on_frame remote_transmission_request (#3376) 2022-05-10 21:39:18 +12:00
Matthew Garrett
98c733108e PMSX003: Add support for specifying the update interval and spinning down (#3053)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-05-10 21:35:43 +12:00
Martin
782186e13d extend scd4x (#3409)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-05-10 21:25:44 +12:00
George
4e1f6518e8 Delonghi Penguino PAC W120HP ir support (#3124) 2022-05-10 21:22:22 +12:00
Andre Lengwenus
53e0fe8e51 Add SML (Smart Message Language) platform for energy meters (#2396)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-05-10 21:05:49 +12:00
Martin
0e547390da add support for Sen5x sensor series (#3383)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-05-10 20:15:02 +12:00
Martin
86b52df839 tca9548a fix channel selection (#3417) 2022-05-10 17:17:55 +12:00
MFlasskamp
d685fdf54a mask deprecated adc_gpio_init() for esp32-s2 (#3445) 2022-05-10 17:16:16 +12:00
Maurice Makaay
d9caab4108 Number enhancement (#3429)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-05-10 16:58:56 +12:00
Maurice Makaay
44b68f140e Select enhancement (#3423)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2022-05-10 16:41:16 +12:00
Unai
3a3d97dfa7 Add SERIAL_JTAG/CDC logger option for ESP-IDF platform for ESP32-S2/S3/C3 (#3105)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-05-10 13:28:22 +12:00
MFlasskamp
47898b527c Esp32c3 deepsleep fix (#3433) 2022-05-09 20:32:14 +12:00
dependabot[bot]
a35f36ad39 Bump pylint from 2.13.5 to 2.13.8 (#3432)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-09 20:28:21 +12:00
dependabot[bot]
d13a397f8e Bump pyupgrade from 2.32.0 to 2.32.1 (#3452)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-09 19:44:54 +12:00
Jesse Hills
df999723f8 Force using name substitution when adopting a device (#3451) 2022-05-09 19:43:09 +12:00
Jesse Hills
8236e840a7 Fix spi transfer with miso pin defined on espidf (#3450) 2022-05-09 19:24:27 +12:00
dependabot[bot]
e5b3625f73 Bump click from 8.1.2 to 8.1.3 (#3426)
Bumps [click](https://github.com/pallets/click) from 8.1.2 to 8.1.3.
- [Release notes](https://github.com/pallets/click/releases)
- [Changelog](https://github.com/pallets/click/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/click/compare/8.1.2...8.1.3)

---
updated-dependencies:
- dependency-name: click
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-09 19:22:47 +12:00
Jesse Hills
2e4645310b Also rename yaml filename with rename command (#3447) 2022-05-09 19:16:46 +12:00
Ingo Theiss
50a32b387e Add ENS210 Humidity & Temperature sensor component (#2942)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-05-09 17:23:38 +12:00
rainero84
2059283707 Early pin init (#3439)
* Added early_pin_init configuration parameter for ESP8266 platform

* Added #include to core

* Updated test3.yaml to include early_pin_init parameter

Co-authored-by: Rainer Oellermann <ro@playplaycode.com>
2022-05-09 17:21:43 +12:00
Patrick van der Leer
8e3af515c9 Waveshare epaper 7in5 v2alt (#3276)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-05-09 17:17:36 +12:00
Paulus Schoutsen
6f88f0ea3f Bump dashboard to 20220508.0 (#3448) 2022-05-09 17:17:21 +12:00
Jens-Christian Skibakk
d2f37cf3f9 Support for Arduino 2 and serial port on ESP32-S2 and ESP32-C3 (#3436) 2022-05-09 16:17:22 +12:00
Paulus Schoutsen
7c30d6254e Add rename command handler (#3443) 2022-05-09 13:53:34 +12:00
Jesse Hills
64fb39a653 Add help text to rename command (#3442) 2022-05-09 10:18:24 +12:00
Dan Jackson
91895aa70c Allow wifi output_power down to 8.5dB (#3405) 2022-05-03 19:09:06 +12:00
LuBeDa
68dfaf238b added RGB565 image type (#3229)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-04-27 08:41:10 +12:00
Trevor North
ebf13a0ba0 Queue sensor publishes so we don't block for too long (#3422) 2022-04-27 07:51:22 +12:00
code-review-doctor
2bff9937b7 Fix issue probably-meant-fstring found at https://codereview.doctor (#3415) 2022-04-27 07:43:35 +12:00
Jesse Hills
256395c28d Add duration device class for sensors (#3421) 2022-04-26 21:02:08 +12:00
quentin9696
3346bc8bba feat: add openssh-client on docker image (#1681) (#3319)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-04-26 10:09:49 +12:00
Martin
6fe22a7e62 SPS30: Add fan action (#3410)
* Add fan action to SPS30

* add codeowner
2022-04-26 09:50:36 +12:00
Jesse Hills
757b98748b Add "esphome rename" command (#3403)
* Add "esphome rename" command

* Only open file once

* Update esphome/__main__.py

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>

* Add final return

* Use match.group consistently

* Validate name characters

* Add whitespace to regex so it is only replacing exact match

* Validate yaml config file after manipulation

Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2022-04-21 22:08:01 -07:00
I. Tomita
7a778f3f33 Add support for BL0939 (Sonoff Dual R3 V2 powermeter) (#3300) 2022-04-21 10:11:25 +12:00
Jesse Hills
993044c870 Merge pull request #3408 from esphome/bump-2022.4.0
2022.4.0
2022-04-21 07:42:58 +12:00
Jesse Hills
a8c1b63edb Bump version to 2022.4.0 2022-04-20 17:06:08 +12:00
Jesse Hills
db7d946e1b Merge branch 'beta' into bump-2022.4.0 2022-04-20 17:06:08 +12:00
Jesse Hills
41d9059a2f Merge pull request #3407 from esphome/bump-2022.4.0b4
2022.4.0b4
2022-04-20 16:55:11 +12:00
Jesse Hills
e26e0d7c01 Bump version to 2022.4.0b4 2022-04-20 16:35:43 +12:00
Jesse Hills
ad41c07a1f Dont require {} for wifi ap with defaults (#3404) 2022-04-20 16:35:42 +12:00
James Duke
9576d246ee Add support for Mopeka Pro+ Residential sensor (#3393)
* Add support for Pro+ Residential sensor (enum)

The Mopeka Pro+ Residential sensor is very similar to the Pro sensor, but includes a longer range antenna, and maybe hardware? The Pro+ identifies itself with 0x08 sensor type.

* Add logic to support Pro+ Residential sensor

* Fix formatting
2022-04-20 12:50:24 +12:00
parats15
988d3ea8ba Multi conf for Teleinfo component (#3401) 2022-04-20 12:46:55 +12:00
Jesse Hills
0767b92b62 Dont require {} for wifi ap with defaults (#3404) 2022-04-20 06:56:09 +12:00
Jesse Hills
5732f3b044 Merge pull request #3402 from esphome/bump-2022.4.0b3
2022.4.0b3
2022-04-19 15:31:05 +12:00
Jesse Hills
712115b6ce Bump version to 2022.4.0b3 2022-04-19 12:33:38 +12:00
rnauber
9283559c6b Shelly Dimmer: Delete obsolete LICENSE.txt (#3394) 2022-04-19 12:33:38 +12:00
Michel van de Wetering
6b393438e9 Fix power_delivered/produced_phase sensor deviceclass in DSMR (#3395) 2022-04-19 12:33:38 +12:00
rnauber
2064abe16d Shelly Dimmer: Delete obsolete LICENSE.txt (#3394) 2022-04-19 08:43:34 +12:00
Michel van de Wetering
b605982f94 Fix power_delivered/produced_phase sensor deviceclass in DSMR (#3395) 2022-04-19 08:42:02 +12:00
Jesse Hills
343b9ab455 Merge pull request #3390 from esphome/bump-2022.4.0b2
2022.4.0b2
2022-04-14 15:37:31 +12:00
Jesse Hills
dcb226b202 Bump version to 2022.4.0b2 2022-04-14 13:48:35 +12:00
Janez Troha
2243021b58 Allocate smaller amount of buffer for JSON (#3384) 2022-04-14 13:48:35 +12:00
rnauber
d5134e88b1 Add support for Shelly Dimmer 2 (#2954)
Co-authored-by: Niclas Larsson <niclas@edgesystems.se>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Jernej Kos <jernej@kos.mx>
Co-authored-by: Richard Nauber <richard@nauber.dev>
2022-04-14 13:48:35 +12:00
matthias882
c59adf612f Changes accuracy of single cell voltage (#3387) 2022-04-14 13:48:35 +12:00
Janez Troha
93b628d9a8 Allocate smaller amount of buffer for JSON (#3384) 2022-04-14 13:42:43 +12:00
Joe
6bac551d9f Add BedJet BLE climate component (#2452) 2022-04-14 13:16:13 +12:00
rnauber
70a35656e4 Add support for Shelly Dimmer 2 (#2954)
Co-authored-by: Niclas Larsson <niclas@edgesystems.se>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Jernej Kos <jernej@kos.mx>
Co-authored-by: Richard Nauber <richard@nauber.dev>
2022-04-14 13:13:51 +12:00
Jesse Hills
047c18eac0 Add default object_id_generator for mqtt (#3389) 2022-04-14 11:25:31 +12:00
matthias882
b4a86ce6cf Changes accuracy of single cell voltage (#3387) 2022-04-14 09:36:16 +12:00
Jesse Hills
a82d8ea0c3 Merge pull request #3381 from esphome/bump-2022.4.0b1
2022.4.0b1
2022-04-13 16:14:08 +12:00
Jesse Hills
b778eed419 Bump version to 2022.5.0-dev 2022-04-13 13:42:28 +12:00
Jesse Hills
ad57faa9a9 Bump version to 2022.4.0b1 2022-04-13 13:42:28 +12:00
Jesse Hills
a9b5e8d036 Merge branch 'dev' into bump-2022.4.0b1 2022-04-13 13:42:27 +12:00
Jesse Hills
8be704e591 Allow specifying deep sleep wakup clock time (#3312) 2022-04-13 12:55:26 +12:00
Jesse Hills
b622a8fa58 Move PN532OnTagTrigger to nfc::NfcOnTagTrigger (#3379) 2022-04-13 12:26:55 +12:00
Jesse Hills
a519e5c475 Fix silent config errors (#3380) 2022-04-13 12:26:25 +12:00
Martin
d620b6dd5e Refactor Sensirion Sensors (#3374)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-04-13 10:19:48 +12:00
Janez Troha
99335d986e Use correct http defines (#3378)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-04-13 10:14:21 +12:00
cvwillegen
7895cd92cd Remote base pronto receive (#2826)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-04-13 07:39:38 +12:00
anatoly-savchenkov
8b2c032da6 Add Sonoff D1 Dimmer support (#2775)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-04-12 17:03:32 +12:00
Jesse Hills
da336247eb Add Xiaomi RTCGQ02LM - Mi Motion Sensor 2 (#3186) 2022-04-12 16:19:16 +12:00
andrewpc
dabd27d4be Addition of Deep Sleep RTC pin definition for ESP32-S2 (#3303) 2022-04-12 12:45:54 +12:00
functionpointer
fdda47db6e Add integration hydreon_rgxx for rain sensors by Hydreon (#2711)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-04-11 14:50:56 +12:00
Jesse Hills
efa6fd03e5 Make home_assistant imported sensors internal by default (#3372) 2022-04-11 12:45:15 +12:00
rrooggiieerr
9e3e34acf5 Add cover toggle support to endstop cover (#3358) 2022-04-11 10:55:45 +12:00
calco88
a2d0c1bf18 Fix HM3301 AQI int8 overflow (#3361) 2022-04-11 10:14:53 +12:00
dependabot[bot]
7663716ae8 Bump pylint from 2.13.4 to 2.13.5 (#3363)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 09:23:47 +12:00
dependabot[bot]
c2cacb3478 Bump voluptuous from 0.13.0 to 0.13.1 (#3364)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 09:23:13 +12:00
dependabot[bot]
84666b54b9 Bump pyupgrade from 2.31.1 to 2.32.0 (#3366)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-11 09:22:54 +12:00
RadekHvizdos
2b91c23bf3 Extend mcp3204 to support 8 channels (mcp3208 variant) (#3332) 2022-04-11 08:44:11 +12:00
Samuel Sieb
3297267a16 Fix SHTC3 sensor detection (#3365)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2022-04-11 08:42:31 +12:00
Keilin Bickar
a9e653724c Add parameter to control i2c stop signal at endTransmission (#3370) 2022-04-11 08:38:29 +12:00
djwlindenaar
5e79a1f500 Implement newer RTU protocol of Growatt inverters (#3315)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Daniel Lindenaar <daniel-git@lindenaar.eu>
2022-04-11 08:06:11 +12:00
Tim Smeets
d4ff98680a Add support for Electrolux heatpump and bump arduino-heatpumpir version (#3353)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-04-08 08:04:00 +12:00
Jesse Hills
ba8d255cb4 Allow on_value_range for sensor and number to be templated (#3359) 2022-04-05 22:06:36 +12:00
dependabot[bot]
06f4ad922c Bump black from 22.1.0 to 22.3.0 (#3357)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-04-05 11:50:51 +02:00
dependabot[bot]
bff06e448b Bump pyupgrade from 2.31.0 to 2.31.1 (#3292)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-04-04 20:06:42 +02:00
dependabot[bot]
d48ffa2913 Bump tzlocal from 4.1 to 4.2 (#3356)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-04 19:39:45 +02:00
dependabot[bot]
d97c3a7e01 Bump voluptuous from 0.12.2 to 0.13.0 (#3355)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-04 19:37:35 +02:00
Otto Winter
0b1161f7ef Bump docker dependencies (#3354) 2022-04-04 19:21:43 +02:00
dependabot[bot]
061e1a471d Bump pytest from 7.0.1 to 7.1.1 (#3313)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-04 19:13:11 +02:00
dependabot[bot]
a39d874600 Bump pytest-asyncio from 0.18.2 to 0.18.3 (#3335)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-04 19:13:06 +02:00
dependabot[bot]
de96376565 Bump pylint from 2.12.2 to 2.13.4 (#3348)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-04 19:11:04 +02:00
dependabot[bot]
c54c20ab3c Bump click from 8.0.4 to 8.1.2 (#3351)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-04-04 19:10:53 +02:00
Michiel van Turnhout
70fafa473b Tm1637 binarysensor (#2792)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-04-04 11:42:10 +12:00
Felix Storm
2e436eae6b CAN bus: support remote transmission request flag for canbus.send (#3193)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-04-04 11:15:51 +12:00
Andrew J.Swan
fd7e861ff5 Added a function to load custom characters in LCD display (#3279)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-04-04 11:13:59 +12:00
Martin
792108686c Add mqtt for idf (#2930)
Co-authored-by: Flaviu Tamas <me@flaviutamas.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-04-04 11:07:20 +12:00
Branden Cash
fa1b5117fd feat: support ble_client that use security w/o pin codes (#3320) 2022-04-04 09:35:48 +12:00
Adrián Panella
b0bd9e0a34 protobuf: fix incomplete 64 bits implementation (#3341) 2022-04-04 08:38:44 +12:00
Guillermo Ruffino
05dc97099a New vscode schema gen (#3336) 2022-04-03 19:30:22 +12:00
Ian Reinhart Geiser
9de61fcf58 Define touchscreen support when in use. (#3296) 2022-04-01 16:46:39 +13:00
Jesse Hills
fc7348d46d Merge pull request #3346 from esphome/bump-2022.3.2
2022.3.2
2022-03-30 13:28:58 +13:00
Jesse Hills
8be2456c7e Bump version to 2022.3.2 2022-03-30 08:15:50 +13:00
Jesse Hills
bb5f7249a6 Actually increase request memory for json parsing (#3331) 2022-03-30 08:15:50 +13:00
Jesse Hills
7f7175b184 Publish custom data when modbus number lambda fills vector (#3295) 2022-03-29 22:22:11 +13:00
Dan Jackson
cf5c640ae4 Change beginning of file comments to avoid creating doxygen tag for esphome namespace (#3314) 2022-03-29 22:05:38 +13:00
Jesse Hills
6b9371d105 Actually increase request memory for json parsing (#3331) 2022-03-28 17:04:25 +13:00
Otto Winter
9a82057303 Font allow using google fonts directly (#3243) 2022-03-28 12:07:48 +13:00
Stanislav Meduna
48584e94c4 Allow to set user defined characters on LCD (#3322) 2022-03-24 19:37:48 +13:00
Jesse Hills
fc94a5d0ee Merge pull request #3324 from esphome/bump-2022.3.1
2022.3.1
2022-03-24 16:45:14 +13:00
dependabot[bot]
d8024a5928 Bump esptool from 3.2 to 3.3 (#3327)
Bumps [esptool](https://github.com/espressif/esptool) from 3.2 to 3.3.
- [Release notes](https://github.com/espressif/esptool/releases)
- [Commits](https://github.com/espressif/esptool/compare/v3.2...v3.3)

---
updated-dependencies:
- dependency-name: esptool
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-24 14:29:43 +13:00
H. Árkosi Róbert
2034ab4f6c increase delay for Ethernet module warm up (#3326) 2022-03-24 14:28:21 +13:00
Jesse Hills
24029cc918 Bump version to 2022.3.1 2022-03-23 12:26:02 +13:00
Jesse Hills
9a9d5964ee Add small delay before setting up app in safe mode (#3323) 2022-03-23 12:26:02 +13:00
Jesse Hills
4e4a512107 Reserve less memory for json (#3289) 2022-03-23 12:26:02 +13:00
Jesse Hills
0729ed538e Webserver utilize Component Iterator to not overload eventstream (#3310) 2022-03-23 12:26:01 +13:00
wysiwyng
24b75b7ed6 Fix WDT reset during dallas search algorithm (#3293) 2022-03-23 12:26:01 +13:00
Jesse Hills
58b70b42dd Add small delay before setting up app in safe mode (#3323) 2022-03-23 11:12:22 +13:00
Jesse Hills
1496bc1b07 Reserve less memory for json (#3289) 2022-03-23 09:46:25 +13:00
Jesse Hills
bfbf88b2ea Webserver utilize Component Iterator to not overload eventstream (#3310) 2022-03-23 09:45:05 +13:00
wysiwyng
e621b938e3 Fix WDT reset during dallas search algorithm (#3293) 2022-03-16 20:33:05 +01:00
Jesse Hills
ec3618ecb8 Merge pull request #3304 from esphome/bump-2022.3.0
2022.3.0
2022-03-16 23:38:01 +13:00
Jesse Hills
792a24f38d Bump version to 2022.3.0 2022-03-16 22:32:24 +13:00
Jesse Hills
652e8a015b Merge branch 'beta' into bump-2022.3.0 2022-03-16 22:32:24 +13:00
Jesse Hills
59e6e798dd Merge pull request #3302 from esphome/bump-2022.3.0b2
2022.3.0b2
2022-03-16 15:38:32 +13:00
Jesse Hills
e5c2dbc7ec Bump version to 2022.3.0b2 2022-03-16 14:06:00 +13:00
Jesse Hills
756f71c382 Allow custom register type for modbus number (#3202) 2022-03-16 14:06:00 +13:00
Jesse Hills
b7535693fa Add helper overloads for hex print 16-bit (#3297) 2022-03-16 14:06:00 +13:00
stegm
06a3505698 Add optimistic config flag to modbus select. (#3267) 2022-03-16 14:06:00 +13:00
Jesse Hills
0372d17a11 Allow custom register type for modbus number (#3202) 2022-03-16 13:43:05 +13:00
Jesse Hills
4525588116 Add helper overloads for hex print 16-bit (#3297) 2022-03-16 13:35:37 +13:00
rbaron
68e957c147 Adds support for b-parasite's v2 BLE protocol (#3290) 2022-03-16 11:05:29 +13:00
andrewpc
99f5ed1461 Add support for QMP6988 Pressure sensor (#3192) 2022-03-15 08:09:17 +13:00
Rai-Rai
59f67796dc Fixed wrong comment (#3286) 2022-03-14 08:00:00 +13:00
stegm
aafdfa933e Add optimistic config flag to modbus select. (#3267) 2022-03-10 08:40:43 +13:00
Otto Winter
3208c8ed1e Bump docker dependencies (#3281) 2022-03-09 13:48:02 +01:00
dependabot[bot]
6bf733e24e Bump click from 8.0.3 to 8.0.4 (#3248)
Bumps [click](https://github.com/pallets/click) from 8.0.3 to 8.0.4.
- [Release notes](https://github.com/pallets/click/releases)
- [Changelog](https://github.com/pallets/click/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/click/compare/8.0.3...8.0.4)

---
updated-dependencies:
- dependency-name: click
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-09 13:27:56 +01:00
dependabot[bot]
65d3e8fbfc Bump zeroconf from 0.38.3 to 0.38.4 (#3257)
Bumps [zeroconf](https://github.com/jstasiak/python-zeroconf) from 0.38.3 to 0.38.4.
- [Release notes](https://github.com/jstasiak/python-zeroconf/releases)
- [Commits](https://github.com/jstasiak/python-zeroconf/compare/0.38.3...0.38.4)

---
updated-dependencies:
- dependency-name: zeroconf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-09 13:27:33 +01:00
dependabot[bot]
a29d65d47c Bump pytest-asyncio from 0.18.1 to 0.18.2 (#3262)
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.18.1 to 0.18.2.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.18.1...v0.18.2)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-09 13:27:15 +01:00
Jesse Hills
efa8f0730d Merge pull request #3278 from esphome/bump-2022.3.0b1
2022.3.0b1
2022-03-09 20:57:07 +13:00
Jesse Hills
0af1edefff Bump version to 2022.4.0-dev 2022-03-09 20:07:50 +13:00
Jesse Hills
023d26f521 Bump version to 2022.3.0b1 2022-03-09 20:07:50 +13:00
Jesse Hills
5068619f1b Merge branch 'dev' into bump-2022.3.0b1 2022-03-09 20:07:49 +13:00
wilberforce
5b2457af0b Add visual step/min/max for webserver climate (#3275) 2022-03-09 10:28:16 +13:00
Jesse Hills
900b4f1af9 Bump esphome-dashboard to 20220309.0 (#3277) 2022-03-09 10:27:54 +13:00
JasperPlant
4c22a98b0b Add entity_category_diagnostics to SGP30 baseline sensors (#3272) 2022-03-08 15:21:13 +13:00
wilberforce
3b8ca80900 Webserver v2 (#2688)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-03-08 15:02:24 +13:00
Jesse Hills
1ef6fd8fb0 Merge pull request #3261 from esphome/bump-2022.2.6
2022.2.6
2022-03-02 22:54:51 +13:00
Jesse Hills
942b0de7fd Bump version to 2022.2.6 2022-03-02 17:07:08 +13:00
Jesse Hills
859cca49d1 Only get free memory size from internal (#3259) 2022-03-02 17:07:08 +13:00
Jesse Hills
dc6eff83ea Only get free memory size from internal (#3259) 2022-03-02 16:44:35 +13:00
Jesse Hills
38ff66debd Remove stray define (#3260) 2022-03-02 16:32:45 +13:00
Sean Brogan
1d2e0f74ea Add Mopeka BLE and Mopeka Pro Check BLE Sensor (#2618)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-03-01 11:30:33 +13:00
Jesse Hills
8f7ff25624 Merge pull request #3252 from esphome/bump-2022.2.5
2022.2.5
2022-02-24 07:28:56 +13:00
Jesse Hills
97aca8e54c Bump version to 2022.2.5 2022-02-23 11:20:48 +13:00
Nicholas Peters
95acf19067 Fix regression caused by TSL2591 auto gain (#3249) 2022-02-23 11:20:48 +13:00
Martin Weinelt
3d0899aa58 Respect ESPHOME_USE_SUBPROCESS in esp32 post_build script (#3246) 2022-02-23 11:20:48 +13:00
Jesse Hills
bf60e40d0b Add optional display page for touchscreen binary sensors (#3247) 2022-02-23 11:05:53 +13:00
RubyBailey
c9094ca537 Add sensor support: Honeywell ABP (SPI version) (#3164)
Co-authored-by: RubyBailey <ruby_bailey11@hotmail.com>
2022-02-22 11:22:30 +01:00
Jesse Hills
68b3fd6b8f Store platform as uppercase (#3251) 2022-02-22 13:54:23 +13:00
Nicholas Peters
9323b3a248 Fix regression caused by TSL2591 auto gain (#3249) 2022-02-22 13:53:24 +13:00
Jesse Hills
b55e9329d9 Fix template button after abstract press_action (#3250) 2022-02-22 13:47:16 +13:00
Micha Nordmann
a5b4105971 support for waveshare 7.50in-hd-b (#3239) 2022-02-22 07:35:04 +13:00
Arturo Casal
d1feaa935d Add device support: MCP4728 (#3174)
* Added MCP4728 output component.

* Added tests to test1.yaml

* Added codeowners

* Lint fixes

* Implemented code review changes

* Lint fixes

* Added i2c communication check on setup()

* Fixed tests

* Lint fix

* Update esphome/components/mcp4728/mcp4728_output.cpp

Changed log function

Co-authored-by: Otto Winter <otto@otto-winter.com>

Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-02-21 12:47:03 +01:00
Martin Weinelt
6919930aaa Respect ESPHOME_USE_SUBPROCESS in esp32 post_build script (#3246) 2022-02-21 14:05:13 +13:00
EdJoPaTo
69633826bb Implement send_first_at for exponential_moving_average (#3240) 2022-02-21 13:13:06 +13:00
Niorix
771162bfb1 light: add RESTORE_AND_OFF/RESTORE_AND_ON LightRestoreMode (#3238) 2022-02-21 12:52:14 +13:00
Fabian Affolter
ba785e29e9 Add support for MPU-6886 (#3183) 2022-02-21 12:23:26 +13:00
Jesse Hills
138d6e505b Merge pull request #3245 from esphome/bump-2022.2.4
2022.2.4
2022-02-21 10:54:54 +13:00
Jesse Hills
2748e6ba29 Bump version to 2022.2.4 2022-02-21 10:17:25 +13:00
Jesse Hills
dbd4e927d8 Fix fatal erroring in addon startup script (#3244) 2022-02-21 10:17:24 +13:00
Jesse Hills
e73d47918f Fix lilygo touchscreen rotation (#3221) 2022-02-21 10:17:24 +13:00
Tyler Bules
b881bc071e ESP32-C3 deep sleep fix (#3066) 2022-02-21 10:17:24 +13:00
Otto Winter
1d0395d1c7 Improve ESP8266 iram usage (#3223) 2022-02-21 10:17:24 +13:00
Otto Winter
616c787e37 Fix ESP8266 climate memaccess warning (#3226) 2022-02-21 10:17:24 +13:00
Otto Winter
0c4de2bc97 Publish NAN when dallas conversion failed (#3227) 2022-02-21 10:17:24 +13:00
Jesse Hills
2c7b104f4a Fix fatal erroring in addon startup script (#3244) 2022-02-21 10:01:00 +13:00
Jesse Hills
78951c197a Fix lilygo touchscreen rotation (#3221) 2022-02-21 09:58:53 +13:00
cstaahl
07c1cf7137 Pulse meter internal filter mode (#3082)
Co-authored-by: Paul Daumlechner <paul.daumlechner@live.de>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-02-21 09:32:35 +13:00
Otto Winter
d26141151a Button code cleanup (#3242) 2022-02-21 09:17:51 +13:00
Otto Winter
f59dbe4a88 Add copy integration (#3241) 2022-02-21 09:13:37 +13:00
Otto Winter
8dae7f8225 Bump esphome-dashboard from 20220209.0 to 20220219.0 (#3231) 2022-02-19 15:57:52 +01:00
Otto Winter
5811389891 BH1750 dynamically calculate options (#3214)
* BH1750 dynamically calculate options

* Fix tests

* Fix NAN

* Convert setup to new-style

* Add myself as codeowner
2022-02-19 15:49:20 +01:00
Otto Winter
debcaf6fb7 Add ESP32C3 and ESP32S2 support to dashboard (#3152)
* Add ESP32C3 and ESP32S2 support to dashboard

* Format

* Fix tests
2022-02-19 15:47:50 +01:00
Tyler Bules
b8d10a62c2 ESP32-C3 deep sleep fix (#3066) 2022-02-19 15:13:48 +01:00
Otto Winter
d2b209234f Improve ESP8266 iram usage (#3223) 2022-02-19 15:09:17 +01:00
Otto Winter
34c9d8be50 Lint trailing whitespace (#3230) 2022-02-19 14:46:27 +01:00
Otto Winter
ae57ad0c81 Fix warning in test1.yaml (#3228) 2022-02-19 14:42:54 +01:00
Otto Winter
0c1520dd9c Fix ESP8266 climate memaccess warning (#3226) 2022-02-19 14:11:45 +01:00
Otto Winter
d594f43ebd Publish NAN when dallas conversion failed (#3227) 2022-02-19 14:11:01 +01:00
Oxan van Leeuwen
125c693e3f Add ESP32 variant config validator function (#3088)
* Add esp32_variant config validator function

* Drop unused is_esp32c3 function

Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-02-19 11:41:34 +01:00
mknjc
ad2f857e15 [miscale] Add flag to clear last impedance reading if the newly received reading only contains weight (#3132) 2022-02-19 10:59:53 +01:00
Peter Valkov
e445d6aada Fix for api disconnect detection. (#2909)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-02-19 10:36:19 +01:00
Arturo Casal
88fbb0ffbb Add sensor support: MAX44009 (#3125)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-02-19 09:49:45 +01:00
Borys Pierov
231908fe9f Implement text_sensor based on ble_client (#3079)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-02-19 09:45:32 +01:00
ImSorryButWho
f137cc10f4 Remote magiquest protocol (#2963)
Co-authored-by: Aaron Hertz <aaron@rockforest.org>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-02-18 22:22:41 +01:00
Jesse Hills
c2f5ac9eba Merge pull request #3220 from esphome/bump-2022.2.3
2022.2.3
2022-02-18 12:06:19 +13:00
Jesse Hills
5764c988af Bump version to 2022.2.3 2022-02-18 11:51:56 +13:00
dependabot[bot]
ccc2fbfd67 Bump platformio from 5.2.4 to 5.2.5 (#3188)
* Bump platformio from 5.2.4 to 5.2.5

Bumps [platformio](https://github.com/platformio/platformio) from 5.2.4 to 5.2.5.
- [Release notes](https://github.com/platformio/platformio/releases)
- [Changelog](https://github.com/platformio/platformio-core/blob/develop/HISTORY.rst)
- [Commits](https://github.com/platformio/platformio/commits)

---
updated-dependencies:
- dependency-name: platformio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update requirements.txt

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-02-18 11:51:56 +13:00
Michael Labuschke
1a8f8adc2a Read all cell voltages from DalyBMS (#3203)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-02-18 11:00:03 +13:00
Jesse Hills
7a242bb4ed Binary Sensor codegen tidyup (#3217) 2022-02-18 10:39:59 +13:00
Jesse Hills
10b4adb8e6 Merge pull request #3219 from esphome/bump-2022.2.2
2022.2.2
2022-02-18 10:36:33 +13:00
Jesse Hills
3b8bb09ae3 Add class as first positional arg to sensor_schema (#3216) 2022-02-18 10:27:20 +13:00
Jesse Hills
83b7181bcb Bump version to 2022.2.2 2022-02-18 10:16:11 +13:00
Jesse Hills
8886b7e141 Add LONG LONG flag for arduinojson (#3212) 2022-02-18 10:16:11 +13:00
Otto Winter
7dcc4d030b Fix platformio docker version mismstch (#3215) 2022-02-18 10:16:11 +13:00
Stewart
b9398897c1 Set entity-category to diagnostic for debug component (#3209)
Co-authored-by: Stewart Morgan <stewart@arnos-vale.net>
Co-authored-by: root <root@build.servers.arnos-vale.net>
2022-02-18 10:16:11 +13:00
Jesse Hills
140db85d21 Add LONG LONG flag for arduinojson (#3212) 2022-02-18 10:11:22 +13:00
mipa87
ccce4b19e8 Fix pm1006 polling component definition (#3210) 2022-02-17 21:47:31 +01:00
Adrián Panella
8cb9be7560 Analog threshold (#3190)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-02-18 09:14:10 +13:00
Otto Winter
953f0569fb Docker ha-addon switch to nginx-light (#3218) 2022-02-17 12:07:36 +01:00
Otto Winter
34c229fd33 Fix platformio docker version mismstch (#3215) 2022-02-17 11:56:14 +01:00
Roi Tagar
958ad0d750 HttpRequestComponent::get_string - avoid copy (#2988) 2022-02-17 17:03:54 +13:00
wilberforce
36ddd9dd69 Simplify captive portal to compressed single page (#2872) 2022-02-17 17:02:10 +13:00
Felix Storm
38259c96c9 CAN bus: support bit mask for on_frame can_id (#3196) 2022-02-17 17:00:31 +13:00
Felix Storm
c054fb8a2c CAN bus: read all queued messages (#3194) 2022-02-17 17:00:14 +13:00
Otto Winter
5a0b8328d8 ESP8266 early init for pins (#3144) 2022-02-17 16:59:46 +13:00
Jesse Hills
ffa19426d7 Remove redundant name from binary_sensor constructor (#3213) 2022-02-17 16:56:44 +13:00
Stewart
c123804294 Set entity-category to diagnostic for debug component (#3209)
Co-authored-by: Stewart Morgan <stewart@arnos-vale.net>
Co-authored-by: root <root@build.servers.arnos-vale.net>
2022-02-17 13:53:26 +13:00
Otto Winter
4e24551b90 Docker move deps install into base (#3207) 2022-02-16 22:25:04 +01:00
Jesse Hills
657b1c60ae Merge pull request #3208 from esphome/bump-2022.2.1
2022.2.1
2022-02-17 08:00:12 +13:00
Jesse Hills
dc54b17778 Bump version to 2022.2.1 2022-02-17 07:36:14 +13:00
Stewart
1fb214165b Fix missed ARDUINO_VERSION_CODE to USE_ARDUINO_VERSION_CODE changes (#3206)
Co-authored-by: Stewart Morgan <stewart@arnos-vale.net>
2022-02-17 07:36:14 +13:00
Stewart
51cb5da7f0 Fix missed ARDUINO_VERSION_CODE to USE_ARDUINO_VERSION_CODE changes (#3206)
Co-authored-by: Stewart Morgan <stewart@arnos-vale.net>
2022-02-16 16:50:10 +01:00
Jesse Hills
81b2fd78f5 Merge pull request #3204 from esphome/bump-2022.2.0
2022.2.0
2022-02-16 21:12:45 +13:00
Jesse Hills
69002fb1e6 Bump version to 2022.2.0 2022-02-16 20:13:14 +13:00
Jesse Hills
75332a752d Merge branch 'beta' into bump-2022.2.0 2022-02-16 20:13:13 +13:00
Jesse Hills
b528f48417 Merge pull request #3201 from esphome/bump-2022.2.0b3
2022.2.0b3
2022-02-16 11:10:31 +13:00
Jesse Hills
ec7a79049a Bump version to 2022.2.0b3 2022-02-16 09:45:05 +13:00
Jesse Hills
6ddad6b299 Update HA addon token (#3200) 2022-02-16 09:45:05 +13:00
Maurice Makaay
16dc7762f9 Fix strlcpy() uses to make long SSIDs and passwords work (#3199)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2022-02-16 09:45:05 +13:00
Jesse Hills
41f84447cc Update HA addon token (#3200) 2022-02-16 09:11:46 +13:00
Maurice Makaay
ce073a704b Fix strlcpy() uses to make long SSIDs and passwords work (#3199)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2022-02-16 08:54:21 +13:00
Guillermo Ruffino
113232ebb6 add sim800l diagnostics (#3136) 2022-02-15 17:01:50 +13:00
Jesse Hills
dc0ed8857f Merge pull request #3198 from esphome/bump-2022.2.0b2
2022.2.0b2
2022-02-15 12:48:34 +13:00
Jesse Hills
bb6b77bd98 Bump version to 2022.2.0b2 2022-02-15 12:00:12 +13:00
Jesse Hills
dcc80f9032 Allow framework version validator to be maximum version (#3197) 2022-02-15 12:00:12 +13:00
Otto Winter
dd554bcdf4 Make generating combined binary output verbose (#3127) 2022-02-15 12:00:12 +13:00
Jesse Hills
f376a39e55 Clamp rotary_encoder restored value to min and max (#3184) 2022-02-15 12:00:12 +13:00
dependabot[bot]
8dcc9d6b66 Bump aioesphomeapi from 10.8.1 to 10.8.2 (#3182) 2022-02-15 12:00:11 +13:00
Jesse Hills
a13a1225b7 Allow framework version validator to be maximum version (#3197) 2022-02-15 11:57:47 +13:00
dependabot[bot]
0ec84be5da Bump pytest from 7.0.0 to 7.0.1 (#3189) 2022-02-11 22:23:06 +01:00
dependabot[bot]
b1cefb7e3e Bump pytest-asyncio from 0.18.0 to 0.18.1 (#3187)
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.18.0 to 0.18.1.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.18.0...v0.18.1)

---
updated-dependencies:
- dependency-name: pytest-asyncio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-11 13:58:10 +01:00
dependabot[bot]
cc0c1c08b9 Bump platformio from 5.2.4 to 5.2.5 (#3188)
* Bump platformio from 5.2.4 to 5.2.5

Bumps [platformio](https://github.com/platformio/platformio) from 5.2.4 to 5.2.5.
- [Release notes](https://github.com/platformio/platformio/releases)
- [Changelog](https://github.com/platformio/platformio-core/blob/develop/HISTORY.rst)
- [Commits](https://github.com/platformio/platformio/commits)

---
updated-dependencies:
- dependency-name: platformio
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

* Update requirements.txt

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2022-02-11 13:57:46 +01:00
Otto Winter
3a67884451 Improve dallas timing (#3181)
* Improve dallas timing

* Format
2022-02-11 09:06:06 +01:00
Otto Winter
72e716cdf1 Make generating combined binary output verbose (#3127) 2022-02-11 21:06:00 +13:00
Jesse Hills
40e06c9819 Raise minimum python version to 3.8 (#3176) 2022-02-10 09:55:11 +01:00
Jesse Hills
ad6c5ff11d Clamp rotary_encoder restored value to min and max (#3184) 2022-02-09 23:12:05 +01:00
dependabot[bot]
335512e232 Bump aioesphomeapi from 10.8.1 to 10.8.2 (#3182) 2022-02-09 20:13:02 +01:00
Otto Winter
2622e59b0b Remove spurious Zeroconf instance from api client (#3143) 2022-02-09 14:57:00 +01:00
Otto Winter
35e6a13cd1 Remove unused obj attribute from AssignmentExpression (#3145) 2022-02-09 14:56:42 +01:00
Jesse Hills
a576c9f21f Merge pull request #3180 from esphome/bump-2022.2.0b1
2022.2.0b1
2022-02-10 00:20:46 +13:00
Jesse Hills
b48490badc Bump version to 2022.3.0-dev 2022-02-09 23:47:36 +13:00
Jesse Hills
71a438e2cb Bump version to 2022.2.0b1 2022-02-09 23:47:36 +13:00
Jesse Hills
272d6f2a8b Merge branch 'dev' into bump-2022.2.0b1 2022-02-09 23:47:36 +13:00
Jesse Hills
5c22065135 Change most references from hassio to ha-addon (#3178) 2022-02-09 23:46:20 +13:00
Borys Pierov
e7dd6c52ac Allow to set manufacturer data for BLEAdvertising (#3179) 2022-02-09 23:29:32 +13:00
dependabot[bot]
3bf042dce9 Bump pytest-asyncio from 0.17.2 to 0.18.0 (#3168)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-09 12:57:12 +13:00
Jesse Hills
09ed1aed93 Merge pull request #3177 from esphome/bump-2022.1.4
2022.1.4
2022-02-09 12:42:47 +13:00
Jesse Hills
53d3718028 Bump version to 2022.1.4 2022-02-09 11:54:41 +13:00
Jesse Hills
2b5dce5232 Try fix canbus config validation (#3173) 2022-02-09 11:54:40 +13:00
Otto Winter
9ad84150aa Enable mDNS during OTA safe mode (#3146) 2022-02-09 11:54:40 +13:00
dependabot[bot]
64f798d4b2 Bump pytest from 6.2.5 to 7.0.0 (#3163)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-02-09 11:42:44 +13:00
Jesse Hills
f43e04e15a Try fix canbus config validation (#3173) 2022-02-09 11:42:00 +13:00
Jesse Hills
88d72f8c9a Fix files CI after merging (#3175) 2022-02-09 08:04:44 +13:00
Andrej Komelj
9826726a72 Implement MQTT discovery object_id generator (#3114) 2022-02-08 22:58:38 +13:00
Jesse Hills
c66d0550e8 Inkplate 6 PLUS (#3013) 2022-02-08 22:56:56 +13:00
mckaymatthew
4aeacfd16e Add max9611 High Side Current Shunt ADC (#2705)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-02-08 22:56:40 +13:00
stegm
58fa63ad88 Add Select for modbus (#3032)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-02-08 22:27:22 +13:00
Jesse Hills
94f944dc9c Add Lilygo t5 4.7 Touchscreen (#3084) 2022-02-08 21:50:25 +13:00
Ashton Kemerling
116ddbdd01 Add require response option for BLE binary output (#3091) 2022-02-08 21:30:31 +13:00
Jesse Hills
1c0697b5d4 Dont warn on nonnull comparisons (#3123) 2022-02-08 21:28:12 +13:00
Otto Winter
434ca47ea0 Enable mDNS during OTA safe mode (#3146) 2022-02-08 21:21:52 +13:00
functionpointer
397ef72b16 MLX90393 three-axis magnetometer (#2770)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-02-08 20:42:11 +13:00
Jonas Bergler
7ca9245735 wifi_info, reduce polling interval (#3165)
Co-authored-by: Jonas Bergler <jbergler@meraki.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-02-08 20:27:39 +13:00
Jesse Hills
69856286e8 Text sensor schema generator similar to sensor (#3172) 2022-02-08 17:23:45 +13:00
Jeff Eberl
ad43d6a5bc Added RadonEye RD200 Component (#3119)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-02-08 16:32:37 +13:00
mknjc
1e5004f495 [debug] Refactor debug sensors to use the normal sensor model. (#3162) 2022-02-08 12:45:27 +13:00
Otto Winter
253161d3d0 Fix copy_file_if_changed src permissions copied too (#3161) 2022-02-07 21:26:16 +01:00
Jesse Hills
ab47e201c7 Bump improv library to 1.2.1 (#3160) 2022-02-04 19:15:00 +13:00
Samuel Sieb
42984fa72a Handle Tuya multi-datapoint messages (#3159)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2022-02-04 15:50:42 +13:00
Franck Nijhof
e7864a28a1 Add device class support to Switch (#3012)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-02-04 09:04:48 +13:00
Keilin Bickar
21803607e7 Add new Lock core component (#2958)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-02-04 07:24:31 +13:00
Jesse Hills
c0523590b4 Merge pull request #3154 from esphome/bump-2022.1.3
2022.1.3
2022-02-03 07:17:52 +13:00
Jesse Hills
c7f091ab10 Bump version to 2022.1.3 2022-02-02 22:16:24 +13:00
Jesse Hills
7479e0aada Fix backwards string case helpers (#3126) 2022-02-02 22:16:16 +13:00
Otto Winter
62b366a5ec Fix ESP32C3 toolchain requires stdarg import in helpers (#3151) 2022-02-01 13:05:59 +01:00
dependabot[bot]
2b39988707 Bump black from 21.12b0 to 22.1.0 (#3147)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto winter <otto@otto-winter.com>
2022-02-01 10:26:37 +01:00
Otto Winter
f9e7291050 Bump pre-commit flake8 from 3.8.4 to 4.0.1 (#3149) 2022-02-01 10:22:43 +01:00
Otto Winter
4de642ff28 Bump esp-idf framework version from 4.3.0 to 4.3.2 (#3120) 2022-01-31 07:59:56 +01:00
Otto Winter
0384efcfc2 Disable platformio ldf for build (#3130) 2022-01-31 14:27:10 +13:00
Jesse Hills
bf91443f38 Improv_serial scan and send wifi networks list (#3116) 2022-01-31 11:08:20 +13:00
Jesse Hills
4a5970b4af Fix backwards string case helpers (#3126) 2022-01-31 10:58:27 +13:00
dependabot[bot]
e3fd68c849 Bump pytest-mock from 3.6.1 to 3.7.0 (#3128) 2022-01-29 13:27:41 +01:00
Otto Winter
df0de2fc2d Bump docker dependencies (#3131) 2022-01-29 13:04:15 +01:00
Matt Hamilton
0c3568fad5 Add support for Waveshare 7.5in-bv2 (#3121) 2022-01-29 00:37:47 +13:00
Oxan van Leeuwen
976f5d91ed Logically group and document helper functions (#3112) 2022-01-27 20:35:42 +13:00
drug123
0f3d4d9a47 Add Xiaomi MHOC303 sensor e-ink clock (#3115) 2022-01-27 12:54:29 +13:00
Otto Winter
ad1f4429c9 Fix lint for TSL2591 (#3118) 2022-01-26 13:50:43 +01:00
Martin
7590d5eacb set adc width to 13 bits for esp32-s2 (#3117) 2022-01-26 13:33:59 +01:00
Nicholas Peters
c5974b8833 TSL2591 automatic gain control (#3071) 2022-01-26 22:48:51 +13:00
Otto Winter
511c8de6f3 ESP8266 Set recommended framework to 3.0.2 (#2606) 2022-01-26 22:41:57 +13:00
Wouter van der Wal
a718ac7ee0 Add qr code support for displays (#2952)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-01-26 22:20:45 +13:00
Jesse Hills
ef832becf1 Create base touchscreen component and refactor ektf2232 (#3083)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-01-26 16:26:46 +13:00
micronen
3a62455948 Add Heap Sensors - free/max block/fragmentation (#1578)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: Otto winter <otto@otto-winter.com>
2022-01-25 19:18:41 +01:00
Zebble
297824e2d7 Add support for additional colors on GROW R503 (#3087) 2022-01-25 17:18:36 +01:00
Jimmy Hedman
d92f297bc0 Add IPv6 support for ESP-IDF framework (#2953)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-01-25 09:55:33 +01:00
guillempages
7a0827e3d0 Configurable HTTP redirect following (#3100)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-01-25 09:53:22 +01:00
Joshua Spence
ef256a64b8 Fix config merging with null (#3113) 2022-01-25 09:24:59 +01:00
Dav-id
1de941e837 Esp32cam full control (#3090) 2022-01-25 11:53:47 +13:00
Joshua Spence
28b65cb810 Perform merges when substituting dict keys (#3062) 2022-01-25 11:46:42 +13:00
Martin
6ff3942e8b [TCS34725] remove duplicated endian conversion (#3037)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-01-25 11:41:14 +13:00
Rebbe Pod
ef5d959788 Add increment_day function to ESPTime (#2955) 2022-01-24 21:54:46 +01:00
Jesse Hills
5bbee1a1fe Merge pull request #3111 from esphome/bump-2022.1.2
2022.1.2
2022-01-25 09:36:20 +13:00
Oxan van Leeuwen
6a2c58fcc0 Implement output button (#3109) 2022-01-25 09:30:48 +13:00
Jesse Hills
bdb9546ca3 Bump version to 2022.1.2 2022-01-25 09:11:20 +13:00
Plácido Revilla
46af4cad6e Set the wrapped single light in light partition to internal (#3092) 2022-01-25 09:11:19 +13:00
Martin
76a238912b [modbus_controller] fix incorrect start address for number write (#3073) 2022-01-25 09:11:19 +13:00
Oxan van Leeuwen
4e6bdb31ac Make CallbackManager invocable (#3089) 2022-01-25 08:57:26 +13:00
Oxan van Leeuwen
80d03a631e Force braces around multi-line statements (#3094)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-01-25 08:56:36 +13:00
Martin
6b27f2d2cf Remove unused polling_component_schema from modbus number (#3108) 2022-01-25 08:44:20 +13:00
dependabot[bot]
7cb6729fa7 Bump aioesphomeapi from 10.8.0 to 10.8.1 (#3110)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-25 08:37:35 +13:00
Oxan van Leeuwen
2f46267994 Add cv.require_esphome_version helper (#3103) 2022-01-24 20:10:27 +01:00
Oxan van Leeuwen
cdda648360 Generate ARDUINO_VERSION_CODE in Python code (#3101)
Co-authored-by: Otto winter <otto@otto-winter.com>
2022-01-24 10:34:34 +01:00
Oxan van Leeuwen
f2d677d51a Fix path to extra_scripts in platformio.ini (#3093) 2022-01-24 16:03:34 +13:00
Oxan van Leeuwen
c2ee0f0864 Rename WEBSERVER_PORT define to USE_WEBSERVER_PORT (#3102) 2022-01-24 00:34:38 +01:00
Oxan van Leeuwen
2a84db7f85 Refactor fan platform to resemble climate/cover platforms (#2848)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: rob-deutsch <robzyb+altgithub@gmail.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-01-23 22:21:54 +13:00
VitaliyKurokhtin
8187a4bce9 Command retain option for MQTT component (#3078) 2022-01-23 21:05:37 +13:00
Oxan van Leeuwen
97681d142e Enable readability-redundant-access-specifiers check (#3096)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-01-23 20:47:22 +13:00
Oxan van Leeuwen
b2430097f2 Enable readability-named-parameter check (#3098)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-01-23 20:39:07 +13:00
Oxan van Leeuwen
7da12a878f Enable readability-redundant-member-init check (#3097) 2022-01-23 20:34:43 +13:00
Oxan van Leeuwen
a31700e16f Enable readability-qualified-auto check (#3095) 2022-01-23 20:29:58 +13:00
Oxan van Leeuwen
7854522792 Enable readability-const-return-type check (#3099) 2022-01-23 20:28:00 +13:00
Pavel Skuratovich
a6a9ebfde2 slow_pwm: allow to restart a cycle on state change (#3004)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-01-22 23:08:55 +01:00
Plácido Revilla
c6cbe2748e Set the wrapped single light in light partition to internal (#3092) 2022-01-22 21:04:36 +01:00
Joshua Spence
f9a7f00843 Add restore_mode to fan component (#3051) 2022-01-22 20:41:58 +01:00
William Charlton
f0b183a552 Wake-on-LAN button (#3030)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: William Charlton <will.charlton1@icloud.com>
2022-01-23 00:13:46 +13:00
Jesse Hills
338ada5c9f Allow multiple configs for cd74hc4067 (#3085) 2022-01-22 19:33:15 +13:00
Jimmy Hedman
ef88f9923f Implement IPv6 sockets for lwIP (#3015)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-01-21 10:08:54 +01:00
Jesse Hills
6f8c7d9ec4 Add ektf2232 touchscreen support (#3027) 2022-01-21 15:45:49 +13:00
dependabot[bot]
ec769ccf72 Bump aioesphomeapi from 10.6.0 to 10.8.0 (#3081)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-21 00:09:12 +01:00
Jesse Hills
045952939e Support simple transparent pngs for display (#3035) 2022-01-21 11:16:18 +13:00
Jesse Hills
1c51cac5ba Add initial_run to regular lambda light effect (#3059) 2022-01-21 11:09:07 +13:00
buxtronix
ea11462e1e AM43: autoload "sensor" to avoid compile errors (#3077) 2022-01-20 13:33:42 +01:00
Otto Winter
62f9736b1d API: Expect a name for connections (#2533) 2022-01-20 12:03:32 +01:00
Jesse Hills
1f8a1f0046 Bump improv library version (#3072) 2022-01-20 15:21:44 +13:00
cwitting
172507acb5 Fix calibration parameter for bme680 humidity calculation (#3069) 2022-01-20 10:53:52 +13:00
Martin
434ab65c16 [modbus_controller] fix incorrect start address for number write (#3073) 2022-01-20 09:19:24 +13:00
Jesse Hills
909a526967 Merge pull request #3075 from esphome/bump-2022.1.1
2022.1.1
2022-01-20 09:08:57 +13:00
Jesse Hills
cd6f4fb93f Bump version to 2022.1.1 2022-01-20 08:34:18 +13:00
Jesse Hills
c19458696e Add *.py.script files to distributions (#3074) 2022-01-20 08:34:18 +13:00
Jesse Hills
cb5f793ede Add *.py.script files to distributions (#3074) 2022-01-20 08:33:13 +13:00
Jesse Hills
318b930e9f Merge pull request #3070 from esphome/bump-2022.1.0
2022.1.0
2022-01-19 19:43:54 +13:00
Jesse Hills
9296a078a7 Bump version to 2022.1.0 2022-01-19 16:08:27 +13:00
Jesse Hills
5dc776e55f Merge pull request #3068 from esphome/bump-2022.1.0b4
2022.1.0b4
2022-01-19 07:40:37 +13:00
Jesse Hills
72d60f30f7 Bump version to 2022.1.0b4 2022-01-18 15:49:31 +13:00
Oxan van Leeuwen
869743a742 Fail hard if no random bytes available for encryption (#3067) 2022-01-18 15:49:31 +13:00
Martin
7b03e07908 [modbus_controller] add missing skip_updates (#3063) 2022-01-18 15:49:31 +13:00
Paulus Schoutsen
348f880e15 bump dashboard to 20220116.0 (#3061) 2022-01-18 15:49:31 +13:00
Oxan van Leeuwen
737188ae50 Fail hard if no random bytes available for encryption (#3067) 2022-01-18 14:29:57 +13:00
dependabot[bot]
db21731b14 Bump pytest-asyncio from 0.17.0 to 0.17.2 (#3064)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-18 00:19:08 +01:00
Martin
cdb4fa2487 [modbus_controller] add missing skip_updates (#3063) 2022-01-18 09:05:13 +13:00
Paulus Schoutsen
514204f0d4 bump dashboard to 20220116.0 (#3061) 2022-01-18 08:44:18 +13:00
Jesse Hills
ead597d0fb Merge pull request #3060 from esphome/bump-2022.1.0b3
2022.1.0b3
2022-01-17 13:13:40 +13:00
Jesse Hills
afbf989715 Bump version to 2022.1.0b3 2022-01-17 12:40:07 +13:00
Jesse Hills
01b62a16c3 Add number setting to web_server/rest_api (#3055) 2022-01-17 12:40:07 +13:00
Oxan van Leeuwen
c5eba04517 Remove deprecated attribute from virtual entity methods (#3056) 2022-01-17 12:40:07 +13:00
Oxan van Leeuwen
282313ab52 Rename post_build scripts to fix codeowners script (#3057) 2022-01-17 12:40:07 +13:00
Ohad Lutzky
d274545e77 Disable caching for binary download (#3054) 2022-01-17 12:40:07 +13:00
Jesse Hills
45ac577c4d Add number setting to web_server/rest_api (#3055) 2022-01-17 12:31:44 +13:00
Oxan van Leeuwen
09402fdb22 Fix argument order in gitpod config file (#3058) 2022-01-16 23:40:27 +01:00
Oxan van Leeuwen
89e7448007 Remove deprecated attribute from virtual entity methods (#3056) 2022-01-16 23:40:15 +01:00
dependabot[bot]
1ea6f957bc Bump pytest-asyncio from 0.16.0 to 0.17.0 (#3047)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-01-16 23:19:21 +01:00
Oxan van Leeuwen
f44fca0a4b Rename post_build scripts to fix codeowners script (#3057) 2022-01-17 11:15:11 +13:00
Ohad Lutzky
52d2f62a57 Disable caching for binary download (#3054) 2022-01-17 11:14:45 +13:00
Jesse Hills
d3fda37615 Merge pull request #3042 from esphome/bump-2022.1.0b2
2022.1.0b2
2022-01-13 22:21:45 +13:00
Jesse Hills
cbe3092404 Bump version to 2022.1.0b2 2022-01-13 21:28:45 +13:00
Paulus Schoutsen
6dfe3039d0 Bump dashboard to 20220113.2 (#3041) 2022-01-13 21:28:45 +13:00
Paulus Schoutsen
d6009453df Add factory to download name (#3040) 2022-01-13 21:28:45 +13:00
Paulus Schoutsen
2a8668ea60 Bump dashboard to 20220113.2 (#3041) 2022-01-12 23:22:19 -08:00
Paulus Schoutsen
cc0d433621 Add factory to download name (#3040) 2022-01-13 19:35:30 +13:00
Jesse Hills
c81323ef91 Merge pull request #3039 from esphome/bump-2022.1.0b1
2022.1.0b1
2022-01-13 12:12:07 +13:00
Jesse Hills
1fe89fb364 Bump version to 2022.2.0-dev 2022-01-13 11:02:08 +13:00
Jesse Hills
961c27f1c2 Bump version to 2022.1.0b1 2022-01-13 11:02:07 +13:00
Jesse Hills
fe4a14e6cc Merge branch 'dev' into bump-2022.1.0b1 2022-01-13 11:02:07 +13:00
Jesse Hills
ee58ad1ac0 Bump esphome-dashboard to 20220113.1 (#3038) 2022-01-13 10:52:57 +13:00
Jesse Hills
c0ff899812 Generate basic config for esphome-web devices (#3036) 2022-01-12 19:37:56 +13:00
Oxan van Leeuwen
d9c938de33 Introduce big- and little-endian integer types (#2997) 2022-01-12 16:50:03 +13:00
Martin
56547b3d50 [Modbus_controller] Fix duplicate cmd check (#3031) 2022-01-12 16:38:13 +13:00
Sympatron GmbH
5026bc7a78 Native ESP32 CAN support (#1629)
Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-01-12 08:54:35 +13:00
Andreas Soehlke
27364ee72c Add cd74hc4067 multiplexer (#2431)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: asoehlke <git@soehlke.de>
2022-01-11 16:59:57 +13:00
Jesse Hills
ece71a0228 Run post scripts for factory binaries for flashing (#3003)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-01-11 15:24:26 +13:00
Oxan van Leeuwen
073828235f Deprecate virtual methods to set entity properties (#3021) 2022-01-10 13:32:39 +01:00
Stefan Grufman
41bcc8c0f4 Nexa 433MHz RF protocol (#2037)
Co-authored-by: Stefan Grufman <stefan.grufman@gmail.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-01-10 23:35:39 +13:00
Chris Nussbaum
a0ea2aae6e Add an action for pzemac to reset the total energy (#2480) 2022-01-10 23:13:39 +13:00
Jeffrey Borg
f34b46a621 Fix heatpumpir codegen min/max temperatures (#3025) 2022-01-10 16:48:05 +13:00
Lubos Horacek
7217a4f7a4 Fix display picture for nextion display (#3018) 2022-01-10 14:08:38 +13:00
Oxan van Leeuwen
6383eca54a Clean-up random helper functions (#3022) 2022-01-10 13:50:26 +13:00
Martin
e55bd1e559 [Modbus_controller] Fix binary sensor lambda (#3020) 2022-01-10 12:29:29 +13:00
MiKuBB
9e8b701dea Adding sdm_meter ability to report total power (#2959) 2022-01-10 12:23:01 +13:00
rsumner
a4431abea8 MCP3204 4-channel 12-bit ADC component (#2895)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-01-10 12:04:48 +13:00
Kamil Trzciński
5844c1767b Extend esp32_camera with requester to improve performance (#2813) 2022-01-10 11:58:49 +13:00
Sergey Dudanov
9a70bfa471 New Midea IR component, improvements and fixes (#2847)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-01-10 11:47:19 +13:00
Valentin Ochs
b406c6403c Create new kalman_combinator component (#2965) 2022-01-09 23:44:36 +01:00
Oxan van Leeuwen
499625f266 Convert is_callable to a backport of std::is_invocable (#3023) 2022-01-10 11:07:37 +13:00
Martin
6b773553fc Add turn_on/off trigger to slow_pwm (#2921)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-01-09 19:49:57 +01:00
Joshua Spence
15fe049a99 Add restore_mode to output switch (#3016)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2022-01-09 19:47:00 +01:00
stegm
e4555f6997 Fix register ranges in modbus controller (#2981) 2022-01-09 16:24:23 +01:00
Otto Winter
470071e0b0 Bump docker dependencies (#3019) 2022-01-08 14:15:05 +01:00
Jesse Hills
ea1be8e7bf Add MCP47A1 DAC output (#3014) 2022-01-08 21:35:55 +13:00
stegm
84a830195f Fix offset bug in modbus text sensor. (#3006) 2022-01-06 16:40:22 +01:00
Oxan van Leeuwen
e62c3e00c1 Bump PlatformIO to 5.2.4 and zeroconf to 0.37.0 (#3007) 2022-01-06 16:36:23 +01:00
Oxan van Leeuwen
07e790f900 Drop uint{32,64}_to_string() helper functions (#3009) 2022-01-06 16:36:11 +01:00
Oxan van Leeuwen
640142fc0c Introduce str_lower_case() and str_upper_case() helpers (#3008) 2022-01-06 16:35:59 +01:00
Oxan van Leeuwen
5c339d4597 Convert clamp() helper to backport of std::clamp() (#3010) 2022-01-07 00:56:10 +13:00
Oxan van Leeuwen
a4931f5d78 Clean-up reverse_bits helpers (#3011) 2022-01-07 00:54:58 +13:00
Martin
5e1e543b06 Add support for BMP388 / BMP 390 pressure and temperature sensor (#2716) 2022-01-06 15:01:50 +13:00
Pavel Skuratovich
df929f9445 Fix SlowPWM output switch at the end of period (#2984) 2022-01-05 21:31:11 +01:00
Oxan van Leeuwen
d8e719d1c4 Support clang-tidy for ESP32 variants (#3001) 2022-01-05 21:30:15 +01:00
mknjc
3067e482fc atc mithermometer: Add possibility to report signal strength (#3000) 2022-01-05 16:43:37 +13:00
Martin
ed5930e934 SGP40 - Reduce delay in measurement (#2996) 2022-01-05 10:05:19 +13:00
Oxan van Leeuwen
ffea3597f4 Set correct include_dir in platformio.ini (#2999) 2022-01-04 21:59:34 +01:00
Oxan van Leeuwen
193d3e0206 Fix clang-tidy with multiple ESP32 toolchains installed (#2998) 2022-01-05 08:34:17 +13:00
Gonzalo Paniagua Javier
c8f4fbb7dd Honor user set values for col/row start for INITR_MINI_160X80. (#2976)
If the caller sets a value for colstart and/or rowstart when using the INITR_MINI_160X80 model, use those values instead of the default 24 and 0.

After this patch devices with a 160x80 TFT like the m5stick C can set row/col start (26, 1 for m5stick) and avoid garbage lines showing in the display.
2022-01-04 11:02:53 +01:00
Snōwball
c855bc31b4 Add bl0940 component used by e.g. tuya devices (#1904)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-01-04 10:38:58 +01:00
Martin
b924b179ab Modbus: add binary output (#2931)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-01-04 10:19:18 +01:00
Jesse Hills
3df0fee3de Dont validate baud_rate for sim800l platform (#2945) 2022-01-04 10:16:40 +01:00
Jesse Hills
b601560e81 Apply --no-use-pep517 for docker images (#2985) 2022-01-04 10:16:02 +01:00
Oxan van Leeuwen
e5775cf812 Introduce bit_cast() backport (#2991) 2022-01-04 10:14:57 +01:00
Igor Scheller
26dd1f8532 Set UTF-8 encoding and version for prometheus /metrics (#2993) 2022-01-04 10:14:38 +01:00
Oxan van Leeuwen
5143a5b5c5 Use to_string() from STL when available (#2992) 2022-01-03 23:30:03 +01:00
Stefan Agner
15ce27992e Support ISR based pulse counter on ESP32-C3 (#2983) 2022-01-04 11:06:43 +13:00
Oxan van Leeuwen
dbc2812022 Improve PSRAM support (#2884) 2022-01-04 10:35:15 +13:00
Martin
dce3713f12 Fix HTTPRequestComponent::get_string return value (#2987)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-01-03 19:40:05 +01:00
Christopher Masto
f849d45bb6 Add logging for some Nextion errors that didn't have any (#2957) 2022-01-03 19:09:25 +01:00
arunderwood
8ad06fb9ea Add SH1107_128x64 to the ssd1306 component (#2967) 2022-01-03 19:08:16 +01:00
David Buezas
9124d9d6e6 Change unset ESPHOME_LOG_LEVEL fallback to NONE (#2982)
Co-authored-by: David Buezas <david.buezas@klarna.com>
2022-01-03 18:58:35 +01:00
Martin
45ebe51e4f Modbus: fix response parsing error for coil write (#2986) 2022-01-03 18:28:28 +01:00
Martin
407661d56b Fix compile error for idf projects with ArduinoJson 6 (#2979)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2022-01-03 18:19:01 +01:00
Paulus Schoutsen
998d4229af Use template path (#2961) 2022-01-03 08:57:09 -08:00
Stefan Agner
a02d2e2e11 Explicitly use overloaded begin() for I2C master initialization (#2978)
Arduino 2.0.1 and newer support slave and master mode. The two modes
have a begin() method with different signature:

```
// Slave Begin
bool TwoWire::begin(uint8_t addr, int sdaPin, int sclPin, uint32_t frequency)

// Master Begin
bool TwoWire::begin(int sdaPin, int sclPin, uint32_t frequency)
```

Use type casting to make sure that overloaded method for master mode
is used.
2022-01-03 16:37:21 +01:00
Stefan Agner
72fa68849f Don't use pyproject.toml for esphome build (#2980) 2022-01-03 22:11:28 +13:00
Jesse Hills
33f17f75a0 Upgrade ArduinoJson to 6.18.5 and migrate code (#2844) 2022-01-01 22:31:43 +13:00
MrEditor97
23edb18d7e INA260 Current and Power Sensor support (#2788) 2021-12-31 22:08:49 +13:00
arunderwood
07ff3a853f Add pin aliases for featheresp32-s2 (#2970) 2021-12-31 20:11:28 +13:00
Sebastian Raff
2cf36bdb46 Fix switch log state if inverted (#2960) 2021-12-30 16:05:31 +13:00
Jesse Hills
50848c2f4d Merge pull request #2966 from esphome/bump-2021.12.3
2021.12.3
2021-12-30 14:54:49 +13:00
Jesse Hills
d32633b3c7 Update curl package version in docker (#2939) 2021-12-30 14:32:29 +13:00
Jesse Hills
b37739eec2 Bump version to 2021.12.3 2021-12-30 13:58:47 +13:00
Jesse Hills
28f87dc804 Remove -e for hassio images (#2964) 2021-12-30 13:58:47 +13:00
Jesse Hills
41879e41e6 Workaround installing as editable package not working (#2936) 2021-12-30 13:58:47 +13:00
Jesse Hills
fc0a6546a2 Only allow internal pins for dht sensor (#2940) 2021-12-30 13:58:47 +13:00
Jesse Hills
ffd4280d6c Require arduino in webserver for better validation (#2941) 2021-12-30 13:58:46 +13:00
Jesse Hills
f859b346a6 Remove -e for hassio images (#2964) 2021-12-30 10:42:22 +13:00
marsjan155
cb0677cafe ST7920 ESP32 fix (#2962)
Co-authored-by: Marcin Depa <m.depa91@gmail.com>
2021-12-30 10:34:30 +13:00
Daniel Hyles
c6956527d1 Remove Content-Length header from camera snapshot response (#2860)
* Update camera_web_server.cpp

Removed the duplicated CONTENT_LENGTH header

* Update camera_web_server.cpp

* Update camera_web_server.cpp
2021-12-28 09:32:17 +13:00
Jesse Hills
72c6bfaa50 Revert "Disable nightly dev build" (#2944) 2021-12-23 09:38:43 +13:00
Jesse Hills
7927b5f624 Workaround installing as editable package not working (#2936) 2021-12-23 08:43:17 +13:00
Jesse Hills
b7aad39daf Only allow internal pins for dht sensor (#2940) 2021-12-23 08:31:56 +13:00
Jesse Hills
f48de6dd43 Disable nightly dev build (#2943) 2021-12-22 23:02:58 +13:00
Jesse Hills
79d73d8f8b Add option to load docker image when building (#2938) 2021-12-22 20:49:04 +13:00
Jesse Hills
cc5947467f Require arduino in webserver for better validation (#2941) 2021-12-22 20:08:54 +13:00
George
e152f128c8 Change HDC1080 init instruction failure from error to warning (#2927)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-12-22 15:35:01 +13:00
Jesse Hills
99bd808ebe Update curl package version in docker (#2939) 2021-12-22 15:27:34 +13:00
Jan Čermák
beb5f3dc9d bang_bang: respect set cool- and heat-only modes (#2926) 2021-12-22 15:27:16 +13:00
Jesse Hills
f5c3b3446f Support inkplate10 (#2937) 2021-12-22 12:56:52 +13:00
Jesse Hills
db3b955b0f Merge pull request #2932 from esphome/bump-2021.12.2
2021.12.2
2021-12-21 12:45:27 +13:00
jsuanet
f431c7402f Add shutdown and safe_mode button (#2918)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Jos Suanet <jos@suanet.net>
2021-12-20 22:25:36 +01:00
Jesse Hills
5516f65971 Bump version to 2021.12.2 2021-12-21 08:24:08 +13:00
Oxan van Leeuwen
9471df0a1b Fix MQTT button press action (#2917) 2021-12-21 08:24:07 +13:00
Oxan van Leeuwen
6d39f64be7 Don't disable idle task WDT when it's not enabled (#2856) 2021-12-21 08:24:07 +13:00
Oxan van Leeuwen
4907e6f6d7 Fix MQTT button press action (#2917) 2021-12-21 08:19:20 +13:00
Jonas De Kegel
1ccee86705 Fix tm1637 bootloop (#2929) 2021-12-20 18:06:04 +01:00
Jonas De Kegel
542fb2175b Support inverted tm1637 display (#2878)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-12-20 09:30:35 +01:00
Frank Langtind
6ec9cfb044 Add Tuya Number support (#2765) 2021-12-20 14:35:10 +13:00
Benny de Leeuw
66e0ff8392 Add growatt modbus sensor (#2922)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-12-20 14:30:23 +13:00
Martin
1fb0a7109d Modbus: use multiply for publishing number (#2916) 2021-12-15 22:38:23 +13:00
Jesse Hills
b89d0a9a73 Merge pull request #2915 from esphome/bump-2021.12.1
2021.12.1
2021-12-15 16:36:39 +13:00
Jesse Hills
4bb779d9a5 Bump version to 2021.12.1 2021-12-15 14:57:32 +13:00
wilberforce
386a5b6362 Allow button POST on press from web server (#2913) 2021-12-15 14:57:32 +13:00
Oxan van Leeuwen
e32a999cd0 Set text sensor state property to filter output (#2893) 2021-12-15 14:57:32 +13:00
sveip
192eb49589 ESP32 CAM add Automatic Exposure Control option (#2892)
Co-authored-by: Peter <psv@tsat.net>
Co-authored-by: Carlos Garcia Saura <CarlosGS@users.noreply.github.com>
2021-12-15 07:46:43 +13:00
Petr Vraník
5d70ff702b quantile filter support (#2900)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: pvranik <petr.vranik@mgm-tp.com>
2021-12-15 07:43:42 +13:00
jddonovan
a7b05db2a1 Adding Pascal unit to constants (#2914) 2021-12-15 07:39:50 +13:00
wilberforce
45e346cf1b Allow button POST on press from web server (#2913) 2021-12-14 15:08:01 +13:00
dependabot[bot]
80e2bfada3 Bump black from 21.11b1 to 21.12b0 (#2879)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-12-13 19:15:49 +01:00
Martin
16e7bd0388 fix multi-line comment warning/error (#2891) 2021-12-13 19:15:22 +01:00
Oxan van Leeuwen
b3fb35783e Set text sensor state property to filter output (#2893) 2021-12-13 15:21:09 +13:00
myhomeiot
a79c6aa9e0 Added access to ble_scan_result_evt_param as get_scan_result (#2854) 2021-12-13 13:08:18 +13:00
Martin
4bb58b2de9 Add gpio 12 to strapping pin list (#2902) 2021-12-13 11:03:08 +13:00
Jesse Hills
4e10881331 Log the actual value in modbus number (#2901) 2021-12-13 10:28:19 +13:00
Ben Owen
cec4a81e14 Add reset_duration option for waveshare epaper HAT rev 2.1 (#1481)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-12-13 10:27:11 +13:00
Carlos Garcia Saura
da45923d05 Turn verbose a debug statement in bme280 (#2906) 2021-12-13 09:32:37 +13:00
Carlos Garcia Saura
31a61b598b Reduce timing noise in duty_cycle (#2881) 2021-12-13 09:30:47 +13:00
tony
9c0506592b Add light.on_state trigger (#2868) 2021-12-13 09:19:57 +13:00
Oxan van Leeuwen
beeb0c7c5a Introduce hex parsing & formatting helper functions (#2882) 2021-12-13 09:15:23 +13:00
Martin
b2f05faee0 Move i2c scan to setup (#2869)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-12-13 09:12:50 +13:00
Jesse Hills
bfbc6a4bad Merge pull request #2907 from esphome/bump-2021.12.0
2021.12.0
2021-12-12 07:59:37 +13:00
Jesse Hills
8c9e0e552d Bump version to 2021.12.0 2021-12-12 07:10:51 +13:00
Jesse Hills
8aaf9fd83f Merge pull request #2905 from esphome/bump-2021.12.0b6
2021.12.0b6
2021-12-11 21:54:49 +13:00
Jesse Hills
08057720b8 Bump version to 2021.12.0b6 2021-12-11 21:07:07 +13:00
Jesse Hills
bfaa648837 Bump esphome-dashboard to 20211211.0 (#2904) 2021-12-11 21:07:07 +13:00
Keith Burzinski
d504daef91 Fix for two points setting when fan_only_cooling is disabled (#2903)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Keith Burzinski <kburzinski@kbx-mbp2021.ad.kbx81.net>
2021-12-11 21:07:07 +13:00
Jesse Hills
8375e1d64d Bump esphome-dashboard to 20211211.0 (#2904) 2021-12-11 21:03:41 +13:00
Keith Burzinski
cf5193d3e5 Fix for two points setting when fan_only_cooling is disabled (#2903)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: Keith Burzinski <kburzinski@kbx-mbp2021.ad.kbx81.net>
2021-12-11 20:03:22 +13:00
Jesse Hills
b8d3ef2f49 Merge pull request #2899 from esphome/bump-2021.12.0b5
2021.12.0b5
2021-12-10 10:55:55 +13:00
Jesse Hills
3bf6320030 Bump version to 2021.12.0b5 2021-12-10 09:55:48 +13:00
Guillermo Ruffino
708b928c73 Modbus number/output use write single (#2896)
Co-authored-by: Martin <25747549+martgras@users.noreply.github.com>
2021-12-10 09:55:48 +13:00
Jesse Hills
649366ff44 Fix published state for modbus number (#2894) 2021-12-10 09:55:47 +13:00
Jesse Hills
e5c9e87fad Merge pull request #2890 from esphome/bump-2021.12.0b4
2021.12.0b4
2021-12-10 09:50:29 +13:00
Guillermo Ruffino
c490388e80 Modbus number/output use write single (#2896)
Co-authored-by: Martin <25747549+martgras@users.noreply.github.com>
2021-12-10 09:44:43 +13:00
Jesse Hills
24ec5a6e9d Fix published state for modbus number (#2894) 2021-12-10 09:32:34 +13:00
Jesse Hills
f3d9d707b6 Bump version to 2021.12.0b4 2021-12-08 12:58:14 +13:00
Jesse Hills
090e10730c Bump esphome-dashboard to 20211208.0 (#2887) 2021-12-08 12:58:14 +13:00
Jesse Hills
fbc84861c7 Use new platform component config blocks for wizard (#2885) 2021-12-08 12:58:14 +13:00
Carlos Garcia Saura
e763469af8 Feed watchdog while setting up OTA (#2876) 2021-12-08 12:58:14 +13:00
Oxan van Leeuwen
6df1d5222d Drop unused xSemaphoreWait define (#2888) 2021-12-08 12:46:36 +13:00
Jesse Hills
58fb7a02f6 Bump esphome-dashboard to 20211208.0 (#2887) 2021-12-08 12:42:50 +13:00
Jesse Hills
3d51ac8df0 Use new platform component config blocks for wizard (#2885) 2021-12-08 09:22:03 +13:00
Oxan van Leeuwen
6fe4ff7f85 Drop len parameter from parse_number() (#2883) 2021-12-08 08:46:25 +13:00
Jesse Hills
3c0c514e44 Merge pull request #2880 from esphome/bump-2021.12.0b3
2021.12.0b3
2021-12-07 15:27:08 +13:00
Yuval Brik
2253d4bc16 Support different run duration for non-timer wakeup (#2861) 2021-12-06 23:30:27 +01:00
Carlos Garcia Saura
e5cc19de43 Feed watchdog while setting up OTA (#2876) 2021-12-06 23:26:06 +01:00
Jesse Hills
ed5e2dd332 Bump version to 2021.12.0b3 2021-12-07 07:47:48 +13:00
Jesse Hills
09b7c6f550 Bump esphome-dashboard to 20211207.0 (#2877) 2021-12-07 07:47:48 +13:00
Oxan van Leeuwen
df315a1f51 Feed watchdog when no component loops (#2857) 2021-12-07 07:47:48 +13:00
Jesse Hills
7ee4bb621c Allow wizard to specify secrets (#2875) 2021-12-07 07:47:48 +13:00
Jesse Hills
24874f4c3c Adopt using wifi secrets that should exist at this point (#2874) 2021-12-07 07:47:48 +13:00
Jesse Hills
c128880033 Add endpoint to fetch secrets keys (#2873) 2021-12-07 07:47:48 +13:00
Massimiliano Ravelli
a66e94a0b0 Ignore already stopped dhcp for ethernet (#2862)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-12-07 07:47:48 +13:00
Oxan van Leeuwen
56870ed4a8 Fix MCP23x17 not disabling pullup after config change (#2855) 2021-12-07 07:47:48 +13:00
Martin
3ac720df47 SPS30 : fix i2c read size (#2866) 2021-12-07 07:47:48 +13:00
Carlos Garcia Saura
1bc757ad06 ADC: Turn verbose the debugging "got voltage" (#2863) 2021-12-07 07:47:48 +13:00
Martin
f72abc6f3d tlc59208f : fix compilation error (#2867) 2021-12-07 07:47:48 +13:00
Jesse Hills
5ac88de985 Bump esphome-dashboard to 20211206.0 (#2870) 2021-12-07 07:47:48 +13:00
Jesse Hills
5404617d43 Bump esphome-dashboard to 20211207.0 (#2877) 2021-12-07 07:41:40 +13:00
Oxan van Leeuwen
12467a18e6 Feed watchdog when no component loops (#2857) 2021-12-07 07:24:20 +13:00
Jesse Hills
1db7043a4d Allow wizard to specify secrets (#2875) 2021-12-06 20:58:51 +13:00
Jesse Hills
49932747b3 Adopt using wifi secrets that should exist at this point (#2874) 2021-12-06 20:57:56 +13:00
Jesse Hills
55db190875 Add endpoint to fetch secrets keys (#2873) 2021-12-06 20:15:34 +13:00
Massimiliano Ravelli
71fe2f7ed3 Ignore already stopped dhcp for ethernet (#2862)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-12-06 20:01:50 +13:00
Oxan van Leeuwen
ffc112c9d0 Don't disable idle task WDT when it's not enabled (#2856) 2021-12-06 20:01:14 +13:00
Oxan van Leeuwen
d3e48e296f Fix MCP23x17 not disabling pullup after config change (#2855) 2021-12-06 19:59:50 +13:00
Martin
14f6ae75ea SPS30 : fix i2c read size (#2866) 2021-12-06 19:58:26 +13:00
Carlos Garcia Saura
c84efe64d3 ADC: Turn verbose the debugging "got voltage" (#2863) 2021-12-06 19:56:53 +13:00
Martin
10e89a7dbb tlc59208f : fix compilation error (#2867) 2021-12-06 19:54:46 +13:00
Jesse Hills
ef44acbf10 Bump esphome-dashboard to 20211206.0 (#2870) 2021-12-06 19:42:49 +13:00
dependabot[bot]
06da540ab0 Bump pylint from 2.12.1 to 2.12.2 (#2858)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-12-05 13:29:08 +01:00
Jesse Hills
0826b367d6 Merge pull request #2853 from esphome/bump-2021.12.0b2
2021.12.0b2
2021-12-03 08:07:30 +13:00
Jesse Hills
329bf861d6 Bump version to 2021.12.0b2 2021-12-03 07:54:34 +13:00
Oxan van Leeuwen
9dcd3d18a0 Update ota_component.cpp (#2852) 2021-12-03 07:54:34 +13:00
Oxan van Leeuwen
40c017fd54 Update ota_component.cpp (#2852) 2021-12-03 07:52:56 +13:00
Jesse Hills
db66cd88b6 Merge pull request #2851 from esphome/bump-2021.12.0b1
2021.12.0b1
2021-12-02 21:32:43 +13:00
Jesse Hills
f0bcf81a98 Add a simple helper to remap values (#2850) 2021-12-02 09:23:11 +01:00
Jesse Hills
86c205fe43 Remove blank line 2021-12-02 21:08:11 +13:00
Jesse Hills
6a0b343289 Bump version to 2022.1.0-dev 2021-12-02 19:38:49 +13:00
Jesse Hills
c6414138c7 Bump version to 2021.12.0b1 2021-12-02 19:38:49 +13:00
Jesse Hills
36b355eb82 Merge branch 'dev' into bump-2021.12.0b1 2021-12-02 19:38:44 +13:00
Martin
9ca4e8f32a modbus_controller: bugfix: enable overriding calculated register size (#2845)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-12-02 15:45:11 +13:00
Alexandre-Jacques St-Jacques
1b88b7a166 Fix wifi not working with manual_ip using esp-idf (#2849) 2021-12-02 15:33:48 +13:00
Paul Nicholls
caf352ff06 Tuya Cover improvements (#2637) 2021-12-02 15:26:56 +13:00
Oxan van Leeuwen
54106179a1 Set ESP32 watchdog to loop task (#2846) 2021-12-02 09:05:42 +13:00
Oxan van Leeuwen
607601b3a4 Enable a bunch of clang-tidy checks (#2149) 2021-12-02 09:03:51 +13:00
Oxan van Leeuwen
f58828cb82 Support setting manual_ip under networks option (#2839) 2021-12-02 08:55:27 +13:00
Leon Loopik
11330af05f Expand uart invert feature to ESP8266 (#1727) 2021-12-01 20:31:04 +01:00
Oxan van Leeuwen
fbe1bca1b9 Fix compilation using subprocesses (#2834) 2021-12-01 17:37:24 +01:00
Mark Dietzer
24a5325db3 Declare arch_get_cpu_cycle_count for esp8266 as IRAM (#2843) 2021-12-01 10:01:15 +01:00
Yuval Brik
1ec3140759 ESP32 Deep Sleep: correct level value (#2812)
Upon registering for ESP32 deep sleep, DeepSleepComponent::begin_sleep
calculates the level value to wake up on.
As part of PR #2303, the level was changed to be based on `inverted`
instead of `!inverted`:
Before:
1e8e471dec/esphome/components/deep_sleep/deep_sleep_component.cpp (L76)
After:
2b04152482/esphome/components/deep_sleep/deep_sleep_component.cpp (L80)

The level argument to `esp_sleep_enable_ext0_wakeup(pin, level)` [0]
should be 0 when the inverted property is true (low triggers wakeup),
and 1 when inverted property is false (high triggers wakeup).

Also revert the changes of #2644.

[0]
https://docs.espressif.com/projects/esp-idf/en/latest/esp32/api-reference/system/sleep_modes.html#_CPPv428esp_sleep_enable_ext0_wakeup10gpio_num_ti
2021-12-01 09:38:58 +01:00
Oxan van Leeuwen
ca8db7696e Don't enable namespace comment clang-tidy check twice (#2830) 2021-12-01 17:21:19 +13:00
Oxan van Leeuwen
c9190574a9 Fix CI check for Windows line endings (#2831) 2021-12-01 17:14:25 +13:00
Oxan van Leeuwen
bfeb0b3639 Add problem matcher for Python formatting errors (#2833) 2021-12-01 17:12:14 +13:00
Oxan van Leeuwen
cbc1334b8d Fix compile warning in Tuya automations (#2837) 2021-12-01 17:11:21 +13:00
mechanarchy
08cbb97ec9 Allow Git credentials to be loaded from secrets (#2825) 2021-12-01 17:10:25 +13:00
Jesse Hills
5719cc1a24 Bump esphome-dashboard to 20211201.0 (#2842) 2021-12-01 16:54:30 +13:00
Jesse Hills
d9513e5ff2 Number mode (#2838) 2021-12-01 08:11:38 +13:00
puuu
b5a0e8b2c0 Implement unit_of_measurement for number component (#2804)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-11-30 16:20:59 +01:00
Jesse Hills
b32b918936 Button device class (#2835) 2021-11-30 16:18:21 +01:00
dependabot[bot]
0f47ffd908 Bump aioesphomeapi from 10.2.0 to 10.6.0 (#2840) 2021-11-30 16:17:48 +01:00
Carlos Garcia Saura
cd018ad3a5 Burst read for BME280, to reduce spurious spikes (#2809) 2021-11-30 16:12:52 +01:00
Adrián Panella
24dfecb6f0 cse7766: add energy sensor (#2822) 2021-11-30 16:08:00 +01:00
Oxan van Leeuwen
ab027a6ae2 Fix too-broad matcher for custom CI script (#2829) 2021-11-30 09:35:52 +01:00
Keith Burzinski
556d071e7f Fix 8266 SPI Clock Polarity Setting (#2836) 2021-11-30 19:30:45 +13:00
dentra
939fb313df Tuya text_sensor and raw data usage (#1812) 2021-11-30 08:08:52 +13:00
Jesse Hills
b5639a6472 Add support for button entities (#2824) 2021-11-30 08:00:51 +13:00
definitio
f50e40e0b8 Fix custom mode_state_topic (#2827) 2021-11-29 18:09:09 +01:00
mechanarchy
6f07421911 Optionally show internal components on the web server (#2627)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-11-29 16:52:20 +01:00
Maurice Makaay
adf48246a9 Improve DSMR read timeout handling (#2699) 2021-11-29 16:40:53 +01:00
Jesse Hills
7be9291b13 Merge pull request #2821 from esphome/bump-2021.11.4
2021.11.4
2021-11-29 13:23:47 +13:00
Jesse Hills
ea9e75039b Bump version to 2021.11.4 2021-11-29 10:18:49 +13:00
Conclusio
a5fb036011 Add delay to improve stability (#2793) 2021-11-29 10:18:48 +13:00
Dave T
e55506f9db Correct bitmask for third color (blue) scaling. (#2817) 2021-11-29 10:18:48 +13:00
Carlos Garcia Saura
50ec1d0445 Fix compilation error for WPA enterprise in ESP-IDF (#2815) 2021-11-29 10:18:48 +13:00
Oxan van Leeuwen
3d5e1d8d91 Fix parsing of multiple values in EZO sensor (#2814)
Co-authored-by: Lydia Sevelt <LydiaSevelt@gmail.com>
2021-11-29 10:18:48 +13:00
Oxan van Leeuwen
db2128a344 Fix parsing numbers in Anova (#2816) 2021-11-29 10:18:48 +13:00
anatoly-savchenkov
cae283dc86 Fixed data type inside fast_random_8() routine (#2818) 2021-11-29 08:31:15 +13:00
Conclusio
7afcb0fb04 Add delay to improve stability (#2793) 2021-11-29 08:13:42 +13:00
Dave T
10f830c3ef Correct bitmask for third color (blue) scaling. (#2817) 2021-11-29 08:12:40 +13:00
Carlos Garcia Saura
7a5c3aa7ed Fix compilation error for WPA enterprise in ESP-IDF (#2815) 2021-11-29 08:06:53 +13:00
Oxan van Leeuwen
2b50406856 Fix parsing of multiple values in EZO sensor (#2814)
Co-authored-by: Lydia Sevelt <LydiaSevelt@gmail.com>
2021-11-29 08:02:10 +13:00
Oxan van Leeuwen
10a2a7e0fc Fix parsing numbers in Anova (#2816) 2021-11-29 08:00:29 +13:00
Oxan van Leeuwen
7a564b222d Make clang-tidy suggest stdint.h int types (#2820) 2021-11-29 07:59:30 +13:00
Jesse Hills
21db43db06 Merge pull request #2808 from esphome/bump-2021.11.3
2021.11.3
2021-11-28 00:01:16 +13:00
Jesse Hills
5009b3029f Bump version to 2021.11.3 2021-11-27 21:13:01 +13:00
Maurice Makaay
57a029189c Add missing nvs_flash_init() to ESP32 preferences code (#2805)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-11-27 21:13:01 +13:00
Maurice Makaay
671d68bc2c Add missing nvs_flash_init() to ESP32 preferences code (#2805)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-11-26 21:25:58 +01:00
Oxan van Leeuwen
5946c37925 Fix usage of deprecated climate method in anova (#2801) 2021-11-26 09:16:39 +01:00
Martin
17a37b1de9 Modbus_controller: Add custom command. (#2680) 2021-11-26 12:48:52 +13:00
Adrián Panella
e7827a6997 total_daily_energy: allow to disable restore mode (#2795) 2021-11-25 22:35:36 +01:00
Jesse Hills
2347e043a9 Cancel previous workflows for PRs and branches (#2800) 2021-11-25 22:02:39 +01:00
Oxan van Leeuwen
00965fe19e Consistently format errors in CI scripts (#2762) 2021-11-26 09:54:11 +13:00
Oxan van Leeuwen
9681dfb458 Correct constant for dynamic I2S bus in NeoPixelBus (#2797) 2021-11-26 09:37:27 +13:00
Oxan van Leeuwen
5e631bc6ba Only match GCC warnings from ESPHome source files in CI (#2756) 2021-11-26 09:36:42 +13:00
Oxan van Leeuwen
b5f660398c Add map filter for text sensors (#2761) 2021-11-26 09:35:33 +13:00
Oxan van Leeuwen
d50bdf619f Cache virtualenv instead of pip cache between CI runs (#2759) 2021-11-26 09:29:10 +13:00
Oxan van Leeuwen
4e448b21ff Drop obsolete comment from CI workflow file (#2758) 2021-11-26 09:27:53 +13:00
Oxan van Leeuwen
2a78c2970d Fix CI cache key for test3.yaml compile (#2757) 2021-11-26 09:27:34 +13:00
Jesse Hills
0cb715bb76 Merge pull request #2799 from esphome/bump-2021.11.2
2021.11.2
2021-11-26 09:25:37 +13:00
Jesse Hills
7d03823afd Bump version to 2021.11.2 2021-11-26 09:02:54 +13:00
Oxan van Leeuwen
8e1c9f5042 Fix parsing numbers from null-terminated buffers (#2755) 2021-11-26 09:02:54 +13:00
Samuel Sieb
980b7cda8f Remove floating point ops from the ISR (#2751)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2021-11-26 09:02:53 +13:00
Kamil Trzciński
3a72dd5cb6 esp32_camera_web_server: Improve support for MotionEye (#2777) 2021-11-26 09:02:53 +13:00
Dave T
3178243811 Fix frame scaling for animated gifs (#2750) 2021-11-26 09:02:53 +13:00
Maurice Makaay
d30e2f2a4f Allow UART debug configuration with no after: definition (#2753) 2021-11-26 09:02:53 +13:00
Oxan van Leeuwen
3637be251e Fix parsing numbers from null-terminated buffers (#2755) 2021-11-26 09:00:49 +13:00
dependabot[bot]
2aea27d272 Bump pylint from 2.11.1 to 2.12.1 (#2798) 2021-11-25 20:34:11 +01:00
Maurice Makaay
ceb9b1d1ff Allow empty UART debug: option, logging in hex format by default (#2771)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Maurice Makaay <account-github@makaay.nl>
2021-11-25 11:51:56 +13:00
Martin
ccfa1e23f0 Add support for sdp8xx (#2779) 2021-11-25 11:28:19 +13:00
rsumner
290da8df2d Fix LEDC resolution calculation on ESP32-C3/S2/S3 (#2794)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-11-25 11:22:51 +13:00
Martin
4b1d73791d remove LEDC_HIGH_SPEED_MODE for C3, S2, S3 (#2791) 2021-11-25 08:06:08 +13:00
Jesse Hills
7e8012c1a0 Allow specifying the dashboard bind address (#2787) 2021-11-25 07:59:32 +13:00
Maurice Makaay
15cd602e8b Add support for P1 Data Request pin control (#2676) 2021-11-23 09:34:10 +01:00
krunkel
598f5b241f Remove unnecessary write in AHT10 update (#2675) 2021-11-23 09:26:16 +01:00
dependabot[bot]
335e69e6cd Bump black from 21.10b0 to 21.11b1 (#2760) 2021-11-23 09:24:28 +01:00
Paul Monigatti
05fe5db030 Relax the icon validator to allow non-mdi icons (#2764) 2021-11-23 09:21:14 +01:00
Andreas Hergert
710096b1c6 Fixed wrong setup of tc9548a (#2766) 2021-11-23 09:20:55 +01:00
Dave T
07b882c801 Fix distorted gif frames when resizing (#2774) 2021-11-23 09:20:36 +01:00
cvwillegen
3e5331a263 Prettier date time display after time sync (#2778) 2021-11-23 09:20:20 +01:00
Oxan van Leeuwen
897277992b Introduce str_snprintf helper function (#2780) 2021-11-23 20:30:49 +13:00
Samuel Sieb
1424091ee5 Remove floating point ops from the ISR (#2751)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2021-11-22 12:11:36 +13:00
Kamil Trzciński
61ec16cdfc esp32_camera_web_server: Improve support for MotionEye (#2777) 2021-11-22 12:09:11 +13:00
Dave T
e5cb5756aa Fix frame scaling for animated gifs (#2750) 2021-11-18 23:20:32 +01:00
Maurice Makaay
9e1c3e8f01 Allow UART debug configuration with no after: definition (#2753) 2021-11-18 22:41:26 +01:00
Martin
448e1690aa Add retry handler (#2721)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-11-18 11:59:40 +13:00
Martin
8267f01ccd Remove arduino dependency from hm3301 (#2745) 2021-11-18 08:03:46 +13:00
Sergey V. DUDANOV
6f9439e1bc Fix byte order in NEC protocol implementation (#2534) 2021-11-17 18:35:50 +01:00
spattinson
06994c0dfc Change LUT for ttgo t5 2.13inch to improve partial refresh (#2475) 2021-11-17 18:28:36 +01:00
Maurice Makaay
dee5d639e2 Add max_telegram_length option to dsmr (#2674)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-11-17 18:24:02 +01:00
Jesse Hills
df6730be55 Move to use improv lib from platformio (#2741) 2021-11-17 18:23:17 +01:00
Jesse Hills
6226dae05c Merge pull request #2744 from esphome/bump-2021.11.1
2021.11.1
2021-11-17 23:45:43 +13:00
Jesse Hills
9c6a475a6e Bump version to 2021.11.1 2021-11-17 23:31:38 +13:00
Franck Nijhof
8294d10d5b Re-instate device class update for binary sensors (#2743) 2021-11-17 23:31:38 +13:00
Evgeny
67558bec47 Fix HM3301 AQI index calculator (#2739) 2021-11-17 23:31:38 +13:00
Franck Nijhof
6c1ef398bb Re-instate device class update for binary sensors (#2743) 2021-11-17 23:28:31 +13:00
Jesse Hills
84873d4074 Merge pull request #2742 from esphome/bump-2021.11.0
2021.11.0
2021-11-17 22:18:29 +13:00
Jesse Hills
58a0b28a39 Bump version to 2021.11.0 2021-11-17 21:58:30 +13:00
Evgeny
0469e19f54 Fix HM3301 AQI index calculator (#2739) 2021-11-17 09:52:40 +01:00
Jesse Hills
dbcfa7b599 Remove duplicated const data in esp8266 boards (#2740) 2021-11-17 16:22:38 +13:00
Jesse Hills
b37d3a66cc Merge pull request #2738 from esphome/bump-2021.11.0b9
2021.11.0b9
2021-11-17 10:27:41 +13:00
Jesse Hills
7e495a5e27 Bump version to 2021.11.0b9 2021-11-17 08:00:26 +13:00
rotarykite
c41547fd4a Fix senseair component uart read timeout (#2658)
Co-authored-by: DAVe3283 <DAVe3283+GitHub@gmail.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Chua Jun Chieh <junchieh.chua@softspace.com.my>
2021-11-17 08:00:26 +13:00
Ryan Hoffman
0d47d41c85 Use as_reversed_hex_array in ble_sensor to fix UUID parsing (#2737)
#1627 renamed as_hex_array to as_reversed_hex_array but forgot to rename these users.
2021-11-17 08:00:26 +13:00
rotarykite
df68403b6d Fix senseair component uart read timeout (#2658)
Co-authored-by: DAVe3283 <DAVe3283+GitHub@gmail.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Chua Jun Chieh <junchieh.chua@softspace.com.my>
2021-11-17 07:57:03 +13:00
Ryan Hoffman
57bdc2b885 Add ble_client binary_output (#2200)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-11-17 07:30:42 +13:00
Ryan Hoffman
f565ff5def Use as_reversed_hex_array in ble_sensor to fix UUID parsing (#2737)
#1627 renamed as_hex_array to as_reversed_hex_array but forgot to rename these users.
2021-11-16 18:53:36 +01:00
H. Árkosi Róbert
8ece639987 Change log level from DEBUG to INFO for sniffing services (#2736)
Sniffing for codes only happens if the user deliberately asked for it with the related service through HA - to find out the codes present in the air. The resulted data shouldn't be printed out only in debug mode, as this is information required to be known on demand for later use, not actually a debug info. Changing log level from DEBUG to INFO for sniffing services has two benefits:
- no need to run firmware with DEBUG enabled for occasional sniffing with devices in production (no need to flash back and forth with different log levels set just for this reason)
- if the user still wants DEBUG enabled, sniffed data appears in different color, it's easier to find between the lines.
2021-11-16 23:28:12 +13:00
Jan Harkes
b35f509784 Allow for subsecond sampling of hmc5883l (#2735) 2021-11-16 09:16:43 +01:00
Jesse Hills
41a3a17456 Merge pull request #2734 from esphome/bump-2021.11.0b8
2021.11.0b8
2021-11-16 13:50:10 +13:00
Jesse Hills
cbbafbcca2 Bump version to 2021.11.0b8 2021-11-16 12:53:56 +13:00
Jesse Hills
c75566b374 Fix zeroconf time comparisons (#2733)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-11-16 12:53:56 +13:00
Jesse Hills
f1954df573 Fix zeroconf time comparisons (#2733)
Co-authored-by: J. Nick Koston <nick@koston.org>
2021-11-16 12:47:06 +13:00
Jesse Hills
7279f1fcc1 Merge pull request #2732 from esphome/bump-2021.11.0b7
2021.11.0b7
2021-11-16 12:19:07 +13:00
Jesse Hills
d7432f7c10 Bump version to 2021.11.0b7 2021-11-16 11:05:51 +13:00
Jesse Hills
b0a0a153f3 Improv serial/checksum changes (#2731)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-11-16 11:05:51 +13:00
Jesse Hills
9e4fa5dcf1 Improv serial/checksum changes (#2731)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-11-16 11:02:45 +13:00
Jesse Hills
024632dbd0 Merge pull request #2730 from esphome/bump-2021.11.0b6
2021.11.0b6
2021-11-16 10:53:11 +13:00
Jesse Hills
0a545a28b9 Bump version to 2021.11.0b6 2021-11-16 09:59:00 +13:00
Jesse Hills
0f2df59998 Add zeroconf as a direct dependency and lock the version (#2729) 2021-11-16 09:58:59 +13:00
Jesse Hills
0809673ba9 Add zeroconf as a direct dependency and lock the version (#2729) 2021-11-16 09:53:52 +13:00
cvwillegen
b386284180 Ignore secrets.yaml on command line (#2715) 2021-11-15 20:06:55 +01:00
Krzysztof Białek
515519bc87 Provide an option to select MQTT unique_id generator (#2701)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-11-15 15:49:18 +01:00
Oxan van Leeuwen
5404163be0 Clean-up MAC address helpers (#2713) 2021-11-15 15:48:16 +01:00
Jesse Hills
29a7d32f77 Merge pull request #2725 from esphome/bump-2021.11.0b5
2021.11.0b5
2021-11-15 13:42:59 +13:00
Jesse Hills
687a7e9b2f Bump version to 2021.11.0b5 2021-11-15 12:02:18 +13:00
Alexandre-Jacques St-Jacques
09e8782318 Remove unnecessary duplicate touch_pad_filter_start (#2724) 2021-11-15 12:02:18 +13:00
Alexandre-Jacques St-Jacques
0b193eee43 Remove unnecessary duplicate touch_pad_filter_start (#2724) 2021-11-15 11:58:22 +13:00
Jesse Hills
f2aea02210 Merge pull request #2723 from esphome/bump-2021.11.0b4
2021.11.0b4
2021-11-15 11:42:59 +13:00
Jesse Hills
194f922312 Bump version to 2021.11.0b4 2021-11-15 11:03:40 +13:00
Jesse Hills
fea3c48098 Fix indentation of write_lambda for modbus_controller number (#2722) 2021-11-15 11:03:39 +13:00
Sergey V. DUDANOV
c2f57baec2 RemoteTransmitter fix. Bug from version 2021.10. Some changes. (#2706) 2021-11-15 11:03:39 +13:00
Oxan van Leeuwen
f4a140e126 Feed WDT between doing ESP32 touchpad measurements (#2720) 2021-11-15 11:03:39 +13:00
Oxan van Leeuwen
ab506b09fe Restore InterruptLock on wifi-less ESP8266 (#2712) 2021-11-15 11:03:39 +13:00
Krzysztof Białek
87e1cdeedb Allow setting custom command_topic for Select and Number components (#2714) 2021-11-15 11:03:39 +13:00
Jesse Hills
81a36146ef Bump ESPAsyncWebServer to 2.1.0 (#2686) 2021-11-15 11:03:39 +13:00
Jesse Hills
7333123ba4 Fix indentation of write_lambda for modbus_controller number (#2722) 2021-11-15 10:59:48 +13:00
Sergey V. DUDANOV
d99c5ed890 RemoteTransmitter fix. Bug from version 2021.10. Some changes. (#2706) 2021-11-15 10:40:35 +13:00
Oxan van Leeuwen
04740fbcbb Install test requirements in lint Docker image (#2719) 2021-11-15 10:04:43 +13:00
Oxan van Leeuwen
6a7440f7d3 Feed WDT between doing ESP32 touchpad measurements (#2720) 2021-11-15 09:45:25 +13:00
Oxan van Leeuwen
14299bb2cc Drop unused constants from const.py (#2718) 2021-11-15 08:07:58 +13:00
Oxan van Leeuwen
66cebfc992 Restore InterruptLock on wifi-less ESP8266 (#2712) 2021-11-15 08:05:11 +13:00
Maurice Makaay
108b8e6705 Fix rom/rtc.h deprecation compile warning for debug component (#2520) 2021-11-14 16:17:13 +01:00
Clifford Roche
4eaa6afa4d Add greeyac protocol to IR Climate / HeatpumpIR (#2694) 2021-11-14 16:11:21 +01:00
Krzysztof Białek
f643a46bbf Allow setting custom command_topic for Select and Number components (#2714) 2021-11-14 14:59:34 +01:00
Sergey V. DUDANOV
aae63a7ff3 Add climate on_state trigger (#2707) 2021-11-13 15:42:15 +01:00
NeoAcheron
582567696e pmsx003: add support for PMS5003S device (#2710) 2021-11-13 15:14:23 +01:00
Jesse Hills
2e0c89409d Bump ESPAsyncWebServer to 2.1.0 (#2686) 2021-11-13 21:22:32 +13:00
Jesse Hills
7fa4a68a27 Merge pull request #2704 from esphome/bump-2021.11.0b3
2021.11.0b3
2021-11-12 17:21:58 +13:00
Jesse Hills
f1c5e2ef81 Bump version to 2021.11.0b3 2021-11-12 16:12:31 +13:00
lcavalli
b526155cce Update device classes for binary sensors (#2703) 2021-11-12 16:12:31 +13:00
Jesse Hills
62c3f301e7 Only allow prometheus when using arduino (#2697) 2021-11-12 16:12:31 +13:00
Jesse Hills
38cb988809 Remove my.ha links from improv (#2695) 2021-11-12 16:12:31 +13:00
lcavalli
7bb7456a8b Update device classes for binary sensors (#2703) 2021-11-12 13:17:10 +13:00
Jesse Hills
0372e12b81 Defines tidy (#2696)
* Move webserver defines inside arduino block

* Move esp8266 flash define

* Move prometheus define
2021-11-11 10:56:54 +01:00
Jesse Hills
a6873c1520 Only allow prometheus when using arduino (#2697) 2021-11-11 10:56:35 +01:00
Jesse Hills
f11220da3a Remove my.ha links from improv (#2695) 2021-11-11 15:15:37 +13:00
Jesse Hills
b976ac54c8 Merge pull request #2693 from esphome/bump-2021.11.0b2
2021.11.0b2
2021-11-11 12:52:35 +13:00
Jesse Hills
78026e766f Bump version to 2021.11.0b2 2021-11-11 12:25:41 +13:00
Oxan van Leeuwen
b4cd8d21a5 Enable addressable light power supply based on raw values (#2690) 2021-11-11 12:25:41 +13:00
Maurice Makaay
7552893311 Uart debugging support (#2478)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
Co-authored-by: Maurice Makaay <account-github@makaay.nl>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-11-11 12:25:41 +13:00
Carlos Garcia Saura
21c896d8f8 [remote_transmitter] accurate pulse timing for ESP8266 (#2476) 2021-11-11 12:25:40 +13:00
Jesse Hills
4b7fe202ec Fix template number initial value being NaN (#2692) 2021-11-11 12:25:40 +13:00
Oxan van Leeuwen
bb9793d5b7 Enable addressable light power supply based on raw values (#2690) 2021-11-11 11:53:25 +13:00
Maurice Makaay
e99af991ec Uart debugging support (#2478)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
Co-authored-by: Maurice Makaay <account-github@makaay.nl>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-11-11 11:34:17 +13:00
Carlos Garcia Saura
abf3708cc2 [remote_transmitter] accurate pulse timing for ESP8266 (#2476) 2021-11-11 11:28:45 +13:00
Jesse Hills
4395d6156d Fix template number initial value being NaN (#2692) 2021-11-10 23:24:48 +01:00
Jesse Hills
9f4519210f Merge pull request #2691 from esphome/bump-2021.11.0b1
2021.11.0b1
2021-11-11 11:05:45 +13:00
Jesse Hills
b0506afa5b Merge branch 'beta' into bump-2021.11.0b1 2021-11-11 10:48:23 +13:00
Jesse Hills
8cbb379898 Remove import (not sure how it got there) 2021-11-11 10:35:18 +13:00
Jesse Hills
04ba53c870 Bump version to 2021.12.0-dev 2021-11-11 10:10:05 +13:00
Jesse Hills
b226215593 Bump version to 2021.11.0b1 2021-11-11 10:10:05 +13:00
Jesse Hills
19970729a9 Merge branch 'dev' into bump-2021.11.0b1 2021-11-11 10:10:04 +13:00
anatoly-savchenkov
f310cacd41 [ms5611] Re-implement conversion from ADC readings to sensor values (#2665) 2021-11-10 22:01:47 +01:00
Jesse Hills
5ff7c8418c Implement Improv via Serial component (#2423)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-11-11 08:55:45 +13:00
Laszlo Gazdag
0bdb48bcac Make OTA function switchable in web_server component (#2685)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-11-11 08:31:22 +13:00
Oxan van Leeuwen
99c775d8cb Introduce encode_value/decode_value() template functions (#2662) 2021-11-10 19:44:01 +01:00
Oxan van Leeuwen
4d43396835 Clean-up string sanitation helpers (#2660) 2021-11-10 19:42:41 +01:00
TVDLoewe
92321e219a Max7219digit multiline (#1622)
Co-authored-by: Otto winter <otto@otto-winter.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-11-11 07:41:04 +13:00
Oxan van Leeuwen
c422b2fb0b Introduce byteswap helpers (#2661)
* Backport std::byteswap() in helpers.h

* Introduce convert_big_endian() function

* Use convert_big_endian() in i2c byte swap functions
2021-11-10 19:40:18 +01:00
Otto Winter
8aa72f4c1e Neopixelbus redo method definitions (#2616) 2021-11-11 07:35:31 +13:00
Oxan van Leeuwen
d8e33c5a69 Add repeat action for automations (#2538)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-11-11 07:30:07 +13:00
Oxan van Leeuwen
15f9677d33 Introduce parse_number() helper function (#2659) 2021-11-11 07:15:06 +13:00
Carlos Garcia Saura
219b225ac0 [ESP32 ADC] Add option for raw uncalibrated output (#2663) 2021-11-10 19:12:57 +01:00
Oxan van Leeuwen
2ac232e634 Add missing hal.h include in esp32_camera_web_server (#2689) 2021-11-10 19:09:10 +01:00
Sam Hughes
710866ff4e CAP1188 Capacitive Touch Sensor Support (#2653) 2021-11-10 18:52:49 +01:00
Martin
662773b075 modbus_controller: remove hard coded register size (#2654) 2021-11-10 16:24:44 +13:00
Carlos Garcia Saura
875b803483 Remove "delay_microseconds_accurate()" and improve systemwide delayMicroseconds() (#2497) 2021-11-10 16:22:00 +13:00
Guillermo Ruffino
6e5cfac927 fix rc switch protocol 6 (#2672) 2021-11-10 16:15:15 +13:00
Duncan Findlay
97eaf3d4a1 Set up output_switch at priority DATA instead of HARDWARE. (#2648) 2021-11-10 16:12:20 +13:00
cvwillegen
366552a969 Remote base add pronto protocol (#2619) 2021-11-10 16:11:35 +13:00
Guillermo Ruffino
57b07441a1 fix esp32 rmt receiver item array length (#2671) 2021-11-10 13:15:02 +13:00
Kamil Trzciński
fb57ab0add Add esp32_camera_web_server: to expose mjpg/jpg images (#2237)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-11-10 13:10:07 +13:00
Jesse Hills
d6717c0032 Fix dashboard imports for adoption (#2684) 2021-11-10 08:38:20 +13:00
ychieux
f72389147d SSD1306_base: Add support for 64x32 size and fix flip functions (#2682)
* Add support for SSD1306 OLED display 0.42inch 64x32 and fix a typo in __init__.py preventing flip functions to operate as intended

* convert tab to spaces

* fix typo on filename for __init__.py
2021-11-09 18:47:19 +01:00
Jesse Hills
a509f6ccd2 Fix when package url has no branch/ref (#2683) 2021-11-09 17:14:08 +13:00
Martin
add484a2ea Fix gpio validation for esp32 variants (#2609)
Co-authored-by: Otto Winter <otto@otto-winter.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-11-09 07:29:28 +13:00
Paul Monigatti
a17a6d5346 Add HA Entity Category support to MQTT (#2678) 2021-11-08 10:03:30 +01:00
Maurice Makaay
be9439f10d Fix for encrypted DSMR regression (#2679)
Co-authored-by: Maurice Makaay <account-github@makaay.nl>
2021-11-07 20:39:16 -03:00
Maurice Makaay
96a50f5c6b Add SPI lib for ESP8266 and only add lib for ESP32 when using Arduino (#2677)
* Add SPI lib for ESP8266 and only add lib for ESP32 when using Arduino

* Make inclusion of the SPI library unconditional

As suggested by @Oxan. Because the component requires Arduino anyway, there is no need to make the inclusion conditional.

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>

* Fix Python lint issue

Co-authored-by: Maurice Makaay <account-github@makaay.nl>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-11-07 19:31:41 +01:00
Jesse Hills
3c0414c420 Add Entity categories for Home Assistant (#2636) 2021-11-08 07:24:52 +13:00
Maurice Makaay
b450d4c734 Fix CRC error during DSMR chunked message reading (#2622)
* DSMR chunk size from 50 to 500

* Still a few CRC errors with 500, upping to 1024.

* Adding timers to measure how long processing DSMR takes

* Handle chunked output from smart meter.

* Cleaning up and commenting the new chunk handling code

* Remove debug code.

* Fixing clang-tidy issues.

* Implementing chunked reading support for encrypted telegrams.

* Remove redundant extra delay for encrypted reader

* Beware not to flush crypted telegram headers

* Use insane data timeout for testing

* Improve logging

* Make clang-tidy happy

Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
Co-authored-by: Maurice Makaay <account-github@makaay.nl>
2021-11-06 18:52:04 -03:00
Guillermo Ruffino
d536509a63 Allow esp8266 to compile with no wifi (#2664) 2021-11-05 10:52:38 +13:00
Tim Niemueller
11f1e28139 Make per-loop display clearing optional (#2626)
Currently, in each loop during DisplayBuffer::update_() the display is
cleared by calling DisplayBuffer::clear().

This prevents more efficient display usages that do not render the
screen in each loop, but only if necessary. This can be helpful, for
example, if images are rendered. This would cause the loop time to be
exceeded frequently.

This change adds a new optional flag "auto_clear" that can be used to
control the clearing behavior. If unset, the DisplayBuffer defaults to
enabled auto clearing, the current behavior and thus backward compatible.

This flag applies to displays that use DisplayBuffer.

Example excerpt:
globals:
  - id: state
    type: bool
    restore_value: no
    initial_value: "false"
  - id: state_processed
    type: bool
    restore_value: no
    initial_value: "false"

switch:
  - platform: template
    name: "State"
    id: state_switch
    lambda: |-
      return id(state);
    turn_on_action:
      - globals.set:
          id: state
          value: "true"
      - globals.set:
          id: state_processed
          value: "false"
    turn_off_action:
      - globals.set:
          id: state
          value: "false"
      - globals.set:
          id: state_processed
          value: "false"

display:
  - platform: ili9341
    # ...
    auto_clear_enabled: false
    lambda: |-
      if (!id(state_processed)) {
        it.fill(COLOR_WHITE);
        if (id(state)) {
          it.image(80, 20, id(image1));
        } else {
          it.image(80, 20, id(image2));
        }
        id(state_processed) = true;
      }

Co-authored-by: Tim Niemueller <timdn@google.com>
2021-11-03 17:56:09 +01:00
niklasweber
379c3e98f5 Add restore_mode to rotary_encoder (#2643) 2021-11-03 07:32:24 +13:00
dependabot[bot]
5ea77894b7 Bump black from 21.9b0 to 21.10b0 (#2650)
Bumps [black](https://github.com/psf/black) from 21.9b0 to 21.10b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-11-01 21:03:23 +01:00
Carlos Garcia Saura
d54b4e7c44 Fix for noise in pulse_counter and duty_cycle components (#2646) 2021-11-02 08:27:57 +13:00
Jesse Hills
d8b3af3815 Expose webserver_port to the native API (#2640) 2021-11-01 09:33:04 +13:00
Otto Winter
2b04152482 Fix deep sleep invert_wakeup mode (#2644) 2021-10-31 16:07:06 +01:00
Paul Monigatti
331a3ac387 Add option to use MQTT abbreviations (#2641) 2021-10-31 15:34:08 +13:00
Geoffrey Van Landeghem
7eee3cdc7f convert SCD30 into Component, polls dataready register (#2308)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-10-31 15:29:22 +13:00
dependabot[bot]
b12c7432e0 Bump tzlocal from 4.0.2 to 4.1 (#2645) 2021-10-30 20:12:57 +02:00
Ed
696643d037 BH1750: Fix a too high default H-res2 mode value (#2536) 2021-10-29 11:51:57 +13:00
dependabot[bot]
7e54f97003 Bump aioesphomeapi from 10.1.0 to 10.2.0 (#2642)
Bumps [aioesphomeapi](https://github.com/esphome/aioesphomeapi) from 10.1.0 to 10.2.0.
- [Release notes](https://github.com/esphome/aioesphomeapi/releases)
- [Commits](https://github.com/esphome/aioesphomeapi/compare/v10.1.0...v10.2.0)

---
updated-dependencies:
- dependency-name: aioesphomeapi
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-28 21:24:48 +02:00
Arturo Casal
77dbf84e55 Add support for CSE7761 sensor (#2546)
* Add CSE7761 sensor support

* CSE7761: Added test at test3.yaml

* CSE7761: changed string style

* CSE7761: fixed cpp lint

* CSE7761: Added codeowners

* Lots of code cleanup

* Revert incorrect setup_priority suggestion

* Added error log in read with retries.

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>

* Improved log messages

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-10-28 20:58:48 +02:00
Martin
2350c5054c use update_interval for sntp synchronization (#2563)
* use update_interval for sntp synchronization

* revert  override of default interval
2021-10-28 20:57:39 +02:00
Jesse Hills
73accf747f Allow cloning/fetching Github PR branches in external_components (#2639) 2021-10-29 07:12:05 +13:00
Alex Iribarren
0d3e6b2c4c Expose web_server port via the API (#2467) 2021-10-28 11:46:55 +13:00
dependabot[bot]
b3d7cc637b Bump aioesphomeapi from 10.0.3 to 10.1.0 (#2638)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-28 09:17:30 +13:00
Sean Brogan
2147bcbc29 Remove autoload of xiaomi_ble and ruuvi_ble (#2617) 2021-10-28 09:16:12 +13:00
niklasweber
980c2d4cae Add publish_initial_value option to rotary encoder (#2503) 2021-10-28 08:09:37 +13:00
Jesse Hills
d2ebfd2833 Merge pull request #2634 from esphome/bump-2021.10.3
2021.10.3
2021-10-27 11:21:08 +13:00
Jesse Hills
bd782fc828 Bump version to 2021.10.3 2021-10-27 10:49:11 +13:00
Jesse Hills
23560e608c Fix select.set using lambda (#2633) 2021-10-27 10:49:10 +13:00
Jan Čermák
f1377b560e Fix pin number validation for sn74hc595 (#2621) 2021-10-27 10:49:10 +13:00
Martin
72108684ea fix modbus output (#2630) 2021-10-27 10:49:10 +13:00
Jesse Hills
c6adaaea97 Remove power and energy from sensors that are not true power (#2628) 2021-10-27 10:49:10 +13:00
Otto Winter
91999a38ca Fix glue code missing micros() (#2623) 2021-10-27 10:49:10 +13:00
0hax
b34eed125d Teleinfo ptec (#2599)
* teleinfo: handle historical mode correctly.

In historical mode, tags like PTEC leads to an issue where we detect a
timestamp wheras this is not possible in historical mode.

PTEC teleinfo tag looks like:
    PTEC HP..
Instead of the usual format
    IINST1 001 I

This make our data parsing fails.

While at here, make sure we continue parsing other tags even if parsing
one of the tag fails.

Signed-off-by: 0hax <0hax@protonmail.com>

* teleinfo: fix compilation with loglevel set to debug.

Signed-off-by: 0hax <0hax@protonmail.com>
2021-10-27 10:49:10 +13:00
Stefan Agner
2abe09529a Autodetect flash size (#2615) 2021-10-27 10:49:10 +13:00
Otto Winter
9aaaf4dd4b Bump platform-espressif8266 from 2.6.2 to 2.6.3 (#2620) 2021-10-27 10:49:09 +13:00
Andreas Hergert
cbfbcf7f1b fixed dependency for pca9685 component (#2614)
Co-authored-by: Otto Winter <otto@otto-winter.com>
Co-authored-by: Andreas <andreas.hergert@otrs.com>
2021-10-27 10:49:09 +13:00
dependabot[bot]
68316cbcf9 Bump esptool from 3.1 to 3.2 (#2632) 2021-10-26 22:14:44 +02:00
dependabot[bot]
2f4b9263c3 Bump tzlocal from 4.0.1 to 4.0.2 (#2631) 2021-10-26 22:12:37 +02:00
Jesse Hills
c2623a08e3 Fix select.set using lambda (#2633) 2021-10-27 08:27:51 +13:00
Jan Čermák
9f625ee7d1 Fix pin number validation for sn74hc595 (#2621) 2021-10-26 18:10:45 +02:00
Martin
2f85c27a05 fix modbus output (#2630) 2021-10-26 11:30:25 +02:00
Otto Winter
c612a3bf60 Constrain GH Actions workflows permissions (#2625) 2021-10-26 10:55:27 +02:00
Jesse Hills
a01f5f5cf1 Remove power and energy from sensors that are not true power (#2628) 2021-10-26 10:55:20 +02:00
Oxan van Leeuwen
87328686a0 Allow setting URL as platform_version (#2598) 2021-10-26 10:55:09 +02:00
Martin
81c11ba1f7 relax max entities checking (#2629) 2021-10-26 08:53:47 +13:00
Otto Winter
49b17c5a2d Switch issue-close-app to GH Actions and workflow cleanup (#2624) 2021-10-23 21:58:04 +02:00
Otto Winter
de06a781ff ESP8266 disable PIO LDF (#2608) 2021-10-23 19:44:55 +02:00
Otto Winter
8e77e3c685 Fix glue code missing micros() (#2623) 2021-10-23 19:25:53 +02:00
0hax
a687b083ae Teleinfo ptec (#2599)
* teleinfo: handle historical mode correctly.

In historical mode, tags like PTEC leads to an issue where we detect a
timestamp wheras this is not possible in historical mode.

PTEC teleinfo tag looks like:
    PTEC HP..
Instead of the usual format
    IINST1 001 I

This make our data parsing fails.

While at here, make sure we continue parsing other tags even if parsing
one of the tag fails.

Signed-off-by: 0hax <0hax@protonmail.com>

* teleinfo: fix compilation with loglevel set to debug.

Signed-off-by: 0hax <0hax@protonmail.com>
2021-10-23 19:01:23 +02:00
Stefan Agner
b9e5c7eb35 Autodetect flash size (#2615) 2021-10-23 13:25:46 +02:00
Otto Winter
1a6a063e04 Move default build path to .esphome directory (#2586) 2021-10-23 12:38:57 +02:00
Otto Winter
d85b7a6bd0 Bump platform-espressif8266 from 2.6.2 to 2.6.3 (#2620) 2021-10-23 12:37:50 +02:00
Andreas Hergert
1c4700f447 fixed dependency for pca9685 component (#2614)
Co-authored-by: Otto Winter <otto@otto-winter.com>
Co-authored-by: Andreas <andreas.hergert@otrs.com>
2021-10-22 18:52:47 +02:00
Otto Winter
c7651dc40d Merge pull request #2613 from esphome/bump-2021.10.2
2021.10.2
2021-10-22 18:35:28 +02:00
Otto winter
eda1c471ad Bump version to 2021.10.2 2021-10-22 18:26:24 +02:00
Andreas Hergert
c7ef18fbc4 Bugfix tca9548a and idf refactor anh (#2612)
Co-authored-by: Andreas Hergert <andreas.hergert@otrs.com>
2021-10-22 18:26:23 +02:00
Otto Winter
901ec918b1 Fix ESP8266 OTA compression only starting framework v2.7.0 (#2610) 2021-10-22 18:26:23 +02:00
Otto Winter
6bdae55ee1 Fix compiler warnings and update platformio line filter (#2607) 2021-10-22 18:26:23 +02:00
Otto Winter
dfb96e4b7f Add owner to all libraries used (#2604) 2021-10-22 18:26:22 +02:00
Otto Winter
ff2c316b18 Re-raise keyboardinterrupt (#2603) 2021-10-22 18:26:22 +02:00
Otto Winter
5be52f71f9 Add OTA upload compression for ESP8266 (#2601) 2021-10-22 18:26:22 +02:00
Otto Winter
42873dd37c Bump noise-c from 0.1.3 to 0.1.4 (#2602) 2021-10-22 18:26:21 +02:00
Otto Winter
f93e7d4e3a Fix socket connection closed not detected (#2587) 2021-10-22 18:26:21 +02:00
Oxan van Leeuwen
bbcd523967 Fix validation of addressable light IDs (#2588) 2021-10-22 18:26:21 +02:00
dependabot[bot]
68cbe58d00 Bump esphome-dashboard from 20211021.0 to 20211021.1 (#2594)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-22 18:26:12 +02:00
Oxan van Leeuwen
115bca98f1 Fix old-style arduino_version on ESP8266 and with magic values (#2591) 2021-10-22 18:24:48 +02:00
Oxan van Leeuwen
ed0b34b2fe Fix pin/component switchup in SX1509 pin configuration (#2593) 2021-10-22 18:24:48 +02:00
Oxan van Leeuwen
ab34401421 Fix PlatformIO version for latest Arduino framework (#2590) 2021-10-22 18:24:48 +02:00
Otto Winter
eed0c18d65 Fix HeatpumpIR pin (#2585) 2021-10-22 18:24:47 +02:00
Andreas Hergert
83400d0417 Bugfix tca9548a and idf refactor anh (#2612)
Co-authored-by: Andreas Hergert <andreas.hergert@otrs.com>
2021-10-22 18:20:57 +02:00
Otto Winter
77a6461c9d Fix ESP8266 OTA compression only starting framework v2.7.0 (#2610) 2021-10-22 17:23:31 +02:00
Otto Winter
6db9d1122f Fix compiler warnings and update platformio line filter (#2607) 2021-10-22 16:52:43 +02:00
Otto Winter
83bef85415 Add owner to all libraries used (#2604) 2021-10-22 14:14:14 +02:00
Otto Winter
b5b3914bbf Re-raise keyboardinterrupt (#2603) 2021-10-22 14:14:07 +02:00
Otto Winter
0d90ef94ae Add OTA upload compression for ESP8266 (#2601) 2021-10-22 13:02:55 +02:00
Otto Winter
c08b21b7cd Bump noise-c from 0.1.3 to 0.1.4 (#2602) 2021-10-22 12:12:07 +02:00
Paul Monigatti
be3cb9ef00 Add EntityBase properties to ESP32 Camera (#2600) 2021-10-22 12:10:29 +02:00
Oxan van Leeuwen
f7b3f52731 Limit hostnames to 31 characters (#2531) 2021-10-22 12:09:47 +02:00
Otto Winter
9220d9fc52 Fix socket connection closed not detected (#2587) 2021-10-22 10:46:44 +02:00
Otto Winter
68c8547067 Add IDF support to dallas (#2578) 2021-10-21 22:48:28 +02:00
dependabot[bot]
1468acfced Bump tzlocal from 3.0 to 4.0.1 (#2553)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-10-21 22:46:05 +02:00
dependabot[bot]
b141aea4c0 Bump aioesphomeapi from 10.0.0 to 10.0.3 (#2595)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-21 20:54:12 +02:00
Jesse Hills
a88c022406 Logging a proper url allows terminals to make it clickable (#2554) 2021-10-21 20:53:06 +02:00
dependabot[bot]
5389382798 Bump paho-mqtt from 1.6.0 to 1.6.1 (#2596)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-21 20:09:29 +02:00
Otto Winter
4765173778 Update docker base images (#2583) 2021-10-21 20:07:44 +02:00
Oxan van Leeuwen
07a9cb910f Fix validation of addressable light IDs (#2588) 2021-10-21 20:07:37 +02:00
dependabot[bot]
f408f074c4 Bump platformio from 5.2.1 to 5.2.2 (#2569)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-10-21 20:01:27 +02:00
dependabot[bot]
f1f2640d0e Bump esphome-dashboard from 20211021.0 to 20211021.1 (#2594)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-21 20:01:03 +02:00
Oxan van Leeuwen
27d7d7ca69 Fix old-style arduino_version on ESP8266 and with magic values (#2591) 2021-10-21 19:56:47 +02:00
Oxan van Leeuwen
c0fc5b48ae Fix pin/component switchup in SX1509 pin configuration (#2593) 2021-10-21 19:55:19 +02:00
Oxan van Leeuwen
8735d3b83e Fix PlatformIO version for latest Arduino framework (#2590) 2021-10-21 18:59:49 +02:00
Otto Winter
ca59dd1302 Fix HeatpumpIR pin (#2585) 2021-10-21 18:57:03 +02:00
Otto Winter
eccdef8211 Fix mDNS ESP8266 log not included (#2589) 2021-10-21 18:53:08 +02:00
Maurice Makaay
f2ebfe7aef Add mDNS config dump (#2576) 2021-10-21 16:02:28 +02:00
Otto Winter
cac5b356db ESP32 ADC use factory calibration data (#2574) 2021-10-21 16:01:33 +02:00
Otto Winter
e5a38ce748 Merge pull request #2580 from esphome/bump-2021.10.1
2021.10.1
2021-10-21 15:31:26 +02:00
Otto Winter
7d9d9fcf36 Fix platformio_install_deps no longer installing all lib_deps (#2584) 2021-10-21 15:29:53 +02:00
Otto Winter
156104d5f5 Fix platformio_install_deps no longer installing all lib_deps (#2584) 2021-10-21 15:29:32 +02:00
Otto Winter
f0aba6ceb2 Fix platformio version in Dockerfile doesn't match requirements (#2582) 2021-10-21 14:53:22 +02:00
Otto Winter
c248ba4043 Fix platformio version in Dockerfile doesn't match requirements (#2582) 2021-10-21 14:53:08 +02:00
Otto Winter
ab07ee57c6 Fix ESP8266 dallas GPIO16 INPUT_PULLUP (#2581) 2021-10-21 14:39:55 +02:00
Otto Winter
c615dc573a Fix ESP8266 dallas GPIO16 INPUT_PULLUP (#2581) 2021-10-21 14:39:36 +02:00
Otto winter
eae3d72a4d Bump version to 2021.10.1 2021-10-21 14:23:08 +02:00
Otto Winter
7b8d826704 Fix ESP8266 OTA adds unnecessary Update library (#2579) 2021-10-21 14:23:07 +02:00
Otto Winter
e7baa42e63 Arduino global delay/millis/... symbols workaround (#2575) 2021-10-21 14:23:07 +02:00
Otto Winter
2f32833a22 Fix wifi ble coexistence check (#2573) 2021-10-21 14:23:07 +02:00
Otto Winter
f6935a4b4b Fix ESP8266 GPIO0 Pullup Validation (#2572) 2021-10-21 14:23:06 +02:00
Maurice Makaay
332c9e891b Fix MDNS for ESP8266 devices (#2571)
Co-authored-by: Maurice Makaay <account-github@makaay.nl>
Co-authored-by: Otto winter <otto@otto-winter.com>
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-10-21 14:23:06 +02:00
Otto Winter
1caabb6419 Fix ESP8266 OTA adds unnecessary Update library (#2579) 2021-10-21 14:20:57 +02:00
Otto Winter
f41f7994a3 Arduino global delay/millis/... symbols workaround (#2575) 2021-10-21 14:20:23 +02:00
Otto Winter
e39f314e7a Fix wifi ble coexistence check (#2573) 2021-10-21 12:24:01 +02:00
Otto Winter
7f34561e53 Fix ESP8266 GPIO0 Pullup Validation (#2572) 2021-10-21 12:23:37 +02:00
Maurice Makaay
34606b0f1f Fix MDNS for ESP8266 devices (#2571)
Co-authored-by: Maurice Makaay <account-github@makaay.nl>
Co-authored-by: Otto winter <otto@otto-winter.com>
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-10-21 12:23:21 +02:00
dependabot[bot]
c51b509501 Bump paho-mqtt from 1.5.1 to 1.6.0 (#2568)
Bumps [paho-mqtt](https://github.com/eclipse/paho.mqtt.python) from 1.5.1 to 1.6.0.
- [Release notes](https://github.com/eclipse/paho.mqtt.python/releases)
- [Changelog](https://github.com/eclipse/paho.mqtt.python/blob/master/ChangeLog.txt)
- [Commits](https://github.com/eclipse/paho.mqtt.python/commits)

---
updated-dependencies:
- dependency-name: paho-mqtt
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-20 22:59:46 +02:00
Jesse Hills
b91ee4847f Merge pull request #2570 from esphome/bump-2021.10.0
2021.10.0
2021-10-21 08:37:26 +13:00
Jesse Hills
625463d871 Bump version to 2021.10.0 2021-10-21 07:57:10 +13:00
Jesse Hills
6433a01e07 Merge pull request #2567 from esphome/bump-2021.10.0b11
2021.10.0b11
2021-10-21 07:47:22 +13:00
Jesse Hills
56cc31e8e7 Bump version to 2021.10.0b11 2021-10-21 07:32:27 +13:00
Otto Winter
3af297aa76 Revert nextion clang-tidy changes (#2566) 2021-10-21 07:32:27 +13:00
Otto Winter
996ec59d28 Move running process log line to debug level (#2565) 2021-10-21 07:32:26 +13:00
Jesse Hills
95593eeeab Bump esphome-dashboard to 20211021.0 (#2564) 2021-10-21 07:32:20 +13:00
Jesse Hills
dad244fb7a A few esp32_ble_server/improv fixes (#2562) 2021-10-21 07:31:55 +13:00
Otto Winter
15b5968418 Revert nextion clang-tidy changes (#2566) 2021-10-21 07:31:13 +13:00
Otto Winter
64a45dc6a6 Move running process log line to debug level (#2565) 2021-10-20 20:15:09 +02:00
Jesse Hills
7cfede5b83 Bump esphome-dashboard to 20211021.0 (#2564) 2021-10-21 07:08:34 +13:00
Jesse Hills
e4d17e0b15 A few esp32_ble_server/improv fixes (#2562) 2021-10-21 06:45:10 +13:00
Carlos Garcia Saura
e79f7ce290 [ESP32] ADC auto-range setting (#2541) 2021-10-20 19:44:51 +02:00
Jesse Hills
adb5d27d95 Merge pull request #2561 from esphome/bump-2021.10.0b10
2021.10.0b10
2021-10-20 17:28:37 +13:00
Jesse Hills
8456a8cecb Bump version to 2021.10.0b10 2021-10-20 16:39:24 +13:00
Jesse Hills
b9f66373c1 Bump esphome-dashboard to 20211020.1 (#2559) 2021-10-20 16:39:16 +13:00
Jesse Hills
9ac365feef Fix HA addon so it does not have logout button (#2558) 2021-10-20 16:38:46 +13:00
Jesse Hills
bcc77c73e1 Bump esphome-dashboard to 20211020.1 (#2559) 2021-10-20 16:17:00 +13:00
Jesse Hills
8b11e5aeb1 Fix HA addon so it does not have logout button (#2558) 2021-10-20 13:25:00 +13:00
Jesse Hills
43bbd58a44 Merge pull request #2557 from esphome/bump-2021.10.0b9
2021.10.0b9
2021-10-20 11:18:40 +13:00
Jesse Hills
7feffa64f3 Bump version to 2021.10.0b9 2021-10-20 11:00:02 +13:00
Jesse Hills
ea0977abb4 Bump dashboard to 20211020.0 (#2556) 2021-10-20 10:59:53 +13:00
Jesse Hills
cb48394e8a Bump dashboard to 20211020.0 (#2556) 2021-10-20 10:53:49 +13:00
Jesse Hills
4c83dc7c28 Merge pull request #2555 from esphome/bump-2021.10.0b8
2021.10.0b8
2021-10-20 10:30:59 +13:00
Jesse Hills
e10ab1da78 Bump version to 2021.10.0b8 2021-10-20 10:14:30 +13:00
Martin
1b0e60374b ignore exception when not waiting for a response (#2552) 2021-10-20 10:14:30 +13:00
Oxan van Leeuwen
3a760fbb44 Fix ADC pin validation on ESP32-C3 (#2551) 2021-10-20 10:14:30 +13:00
Martin
f5441a87e3 ignore exception when not waiting for a response (#2552) 2021-10-20 10:10:24 +13:00
dependabot[bot]
e2a812fa4b Bump pytest-asyncio from 0.15.1 to 0.16.0 (#2547)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-19 20:28:48 +02:00
Oxan van Leeuwen
5b5ead872b Fix ADC pin validation on ESP32-C3 (#2551) 2021-10-19 12:56:49 +02:00
Jesse Hills
6ef57a2973 Merge pull request #2550 from esphome/bump-2021.10.0b7
2021.10.0b7
2021-10-19 16:22:29 +13:00
Jesse Hills
3e9c7f2e9f Bump version to 2021.10.0b7 2021-10-19 15:47:31 +13:00
Jesse Hills
430598b7a1 Bump dashboard to 20211019.0 (#2549) 2021-10-19 15:47:26 +13:00
Jesse Hills
03cfd78c59 Bump dashboard to 20211019.0 (#2549) 2021-10-19 15:16:39 +13:00
Jesse Hills
91611b09b4 Merge pull request #2545 from esphome/bump-2021.10.0b6
2021.10.0b6
2021-10-18 21:41:22 +13:00
Jesse Hills
ecd115851f Bump version to 2021.10.0b6 2021-10-18 21:26:36 +13:00
Maurice Makaay
4a1e50fed1 OTA firmware MD5 check + password support for esp-idf (#2507)
Co-authored-by: Maurice Makaay <account-github@makaay.nl>
2021-10-18 21:26:36 +13:00
Jesse Hills
d6d037047b Merge pull request #2544 from esphome/bump-2021.10.0b5
2021.10.0b5
2021-10-18 16:37:43 +13:00
Jesse Hills
b5734c2b20 Bump version to 2021.10.0b5 2021-10-18 15:31:01 +13:00
Oxan van Leeuwen
723fb7eaac Autodetect ESP32 variant (#2530)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-10-18 15:31:01 +13:00
Jesse Hills
63a9acaa19 Fix Bluetooth setup_priorities (#2458)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-10-18 15:31:00 +13:00
Jesse Hills
0524f8c677 Fix const used for IDF recommended version (#2542) 2021-10-18 15:31:00 +13:00
Otto Winter
70b62f272e Only show timestamp for dashboard access logs (#2540) 2021-10-18 15:31:00 +13:00
Oxan van Leeuwen
ced11bc707 Autodetect ESP32 variant (#2530)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-10-18 13:36:18 +13:00
Jesse Hills
6b9c084162 Fix Bluetooth setup_priorities (#2458)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-10-18 09:56:31 +13:00
Jesse Hills
644ce2a26c Fix const used for IDF recommended version (#2542) 2021-10-18 09:55:35 +13:00
Otto Winter
5425e45851 Only show timestamp for dashboard access logs (#2540) 2021-10-18 08:01:51 +13:00
Jesse Hills
f0089b7940 Merge pull request #2539 from esphome/bump-2021.10.0b4
2021.10.0b4
2021-10-17 21:17:54 +13:00
Jesse Hills
4b44280d53 Bump version to 2021.10.0b4 2021-10-17 20:34:07 +13:00
Paulus Schoutsen
f045382d20 Bump dashboard to 20211015.0 (#2525)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-10-17 20:34:03 +13:00
Jesse Hills
db3fa1ade7 Allow downloading all bin files from backend in dashboard (#2514)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-10-17 20:28:43 +13:00
Oxan van Leeuwen
f83950fd75 Fix bitshift on read in ADE7953 (#2537) 2021-10-17 20:28:43 +13:00
Oxan van Leeuwen
4dd1bf920d Replace framework version_hint with source option (#2529) 2021-10-17 20:28:43 +13:00
Martin
98755f3621 Fix bug in register name definition (#2526) 2021-10-17 20:28:43 +13:00
Keith Burzinski
c3a8a044b9 Fix Nextion HTTPClient error for ESP32 (#2524) 2021-10-17 20:28:42 +13:00
Martin
15b5ea43a7 Add pressure compensation during runtime (#2493)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-10-17 20:28:42 +13:00
Paulus Schoutsen
12fce7a08d Bump dashboard to 20211015.0 (#2525)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-10-17 20:26:59 +13:00
Jesse Hills
0991ab3543 Allow downloading all bin files from backend in dashboard (#2514)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-10-17 19:54:09 +13:00
Oxan van Leeuwen
65d2b37496 Fix bitshift on read in ADE7953 (#2537) 2021-10-17 19:53:49 +13:00
Oxan van Leeuwen
94d518a418 Replace framework version_hint with source option (#2529) 2021-10-15 22:07:05 +02:00
Carlos Garcia Saura
7cca673902 [esp-idf fix] increase FreeRTOS ticker loop from 100Hz to 1kHz (#2527)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-10-15 22:06:49 +02:00
Maurice Makaay
384f8d97d8 OTA firmware MD5 check + password support for esp-idf (#2507)
Co-authored-by: Maurice Makaay <account-github@makaay.nl>
2021-10-15 22:06:32 +02:00
Oxan van Leeuwen
c82d5d63e3 Move TemplatableValue helper class to automation.h (#2511) 2021-10-15 22:05:11 +02:00
dependabot[bot]
653a3d5d11 Bump aioesphomeapi from 9.1.5 to 10.0.0 (#2508)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-10-15 22:05:04 +02:00
Tom Matheussen
884b7201de Continue ethernet setup if hostname fails (#2430) 2021-10-15 20:46:58 +02:00
Carlos Garcia Saura
85d2f24447 Clarify statement at the cmd wizard tool, for new users (#2519)
* Clarify next steps for the install wizard

* Update wizard.py

* Link to relevant section of guide

* Formatting

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-10-15 19:51:42 +02:00
dependabot[bot]
935992bcb3 Bump pyyaml from 5.4.1 to 6.0 (#2521)
Bumps [pyyaml](https://github.com/yaml/pyyaml) from 5.4.1 to 6.0.
- [Release notes](https://github.com/yaml/pyyaml/releases)
- [Changelog](https://github.com/yaml/pyyaml/blob/master/CHANGES)
- [Commits](https://github.com/yaml/pyyaml/compare/5.4.1...6.0)

---
updated-dependencies:
- dependency-name: pyyaml
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-15 19:38:09 +02:00
Dmitriy Lopatko
dc15d1c8ec use no hold master mode for si7021/htu21d (#2528) 2021-10-15 16:52:03 +02:00
Martin
6beb9e568a Fix bug in register name definition (#2526) 2021-10-15 20:27:56 +13:00
Keith Burzinski
7178f10bda Fix Nextion HTTPClient error for ESP32 (#2524) 2021-10-15 20:26:26 +13:00
Jesse Hills
ec683fc227 Merge pull request #2523 from esphome/bump-2021.10.0b3
2021.10.0b3
2021-10-15 10:15:26 +13:00
Jesse Hills
d4e65eb82a Bump version to 2021.10.0b3 2021-10-15 09:42:44 +13:00
Paul Monigatti
10c6601b0a Revert "Added test for bme680_bsec" (#2518)
This reverts commit 7f6a50d291 due to BSEC library license restrictions.
2021-10-15 09:42:44 +13:00
Oxan van Leeuwen
73940bc1bd Don't define UART_SELECTION_UART2 when UART2 is unavailable (#2512) 2021-10-15 09:42:43 +13:00
Paul Monigatti
9b7fb829f9 Fix: Color modes not being correctly used in light partitions (#2513) 2021-10-15 09:42:43 +13:00
Dmitriy Lopatko
c51d8c9021 add missing include in sgp30 (#2517) 2021-10-15 09:42:43 +13:00
Paul Monigatti
d8a6dfe5ce Fix BME680_BSEC compilation issue with ESP32 (#2516) 2021-10-15 09:42:43 +13:00
Oxan van Leeuwen
5f7cef0b06 Disallow using UART2 for logger on ESP-32 variants that lack it (#2510) 2021-10-15 09:42:43 +13:00
Paul Monigatti
48ff2ffc68 Fix: Light flash not restoring previous LightState (#2383)
* Update light state when transformer has finished

* Revert writing direct to output

* Correct handling of zero-length light transformers

* Allow transformers to handle zero-length transitions, and check more boundary conditions when transitioning back to start state

* Removed log.h

* Fixed race condition between LightFlashTransformer.apply() and is_finished()

* clang-format

* Step progress from 0.0f to 1.0f at t=start_time for zero-length transforms to avoid divide-by-zero
2021-10-15 09:42:43 +13:00
Oxan van Leeuwen
b3b9ccd314 Fix light state remaining on after turn off with transition (#2509) 2021-10-15 09:42:43 +13:00
Paul Monigatti
1308236429 Revert "Added test for bme680_bsec" (#2518)
This reverts commit 7f6a50d291 due to BSEC library license restrictions.
2021-10-14 12:31:52 +02:00
Oxan van Leeuwen
63d6b610b8 Don't define UART_SELECTION_UART2 when UART2 is unavailable (#2512) 2021-10-14 11:25:10 +02:00
Martin
8823024509 Add pressure compensation during runtime (#2493)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-10-14 11:24:57 +02:00
Paul Monigatti
4896f870f0 Fix: Color modes not being correctly used in light partitions (#2513) 2021-10-14 21:04:50 +13:00
Dmitriy Lopatko
7e482901d9 add missing include in sgp30 (#2517) 2021-10-14 21:00:53 +13:00
Paul Monigatti
07b309e65d Fix BME680_BSEC compilation issue with ESP32 (#2516) 2021-10-14 20:58:35 +13:00
Oxan van Leeuwen
6bbb5e9b56 Disallow using UART2 for logger on ESP-32 variants that lack it (#2510) 2021-10-14 09:21:43 +13:00
Paul Monigatti
867fecd157 Fix: Light flash not restoring previous LightState (#2383)
* Update light state when transformer has finished

* Revert writing direct to output

* Correct handling of zero-length light transformers

* Allow transformers to handle zero-length transitions, and check more boundary conditions when transitioning back to start state

* Removed log.h

* Fixed race condition between LightFlashTransformer.apply() and is_finished()

* clang-format

* Step progress from 0.0f to 1.0f at t=start_time for zero-length transforms to avoid divide-by-zero
2021-10-13 21:59:52 +02:00
Oxan van Leeuwen
05388d2dfc Fix light state remaining on after turn off with transition (#2509) 2021-10-14 08:53:00 +13:00
Maurice Makaay
e06b6d7140 Add ESP32 IDF as a test env for PRs (#2494)
Co-authored-by: Maurice Makaay <account-github@makaay.nl>
2021-10-14 08:22:57 +13:00
Carlos Garcia Saura
859e508392 change millis() to micros() in feed_wdt for 3ms check (#2492) 2021-10-13 18:50:27 +02:00
razorback16
534ce11d54 TCS34725 BugFix and GA factor (#2445)
- Fixed endianness bug on tcs34725 data read
- Fixed lux adjustments based on gain, integration time and GA factor
- Added glass attenuation factor to allow using this sensor behind
  semi transparent glass

Co-authored-by: Razorback16 <razorback16@users.noreply.github.com>
2021-10-13 18:45:41 +02:00
Jesse Hills
e63c7b483b Merge pull request #2505 from esphome/bump-2021.10.0b2
2021.10.0b2
2021-10-13 22:45:29 +13:00
Jesse Hills
f57980b069 Bump version to 2021.10.0b2 2021-10-13 22:30:29 +13:00
Jesse Hills
7006aa0d2a Merge branch 'dev' into beta 2021-10-13 22:11:53 +13:00
Jesse Hills
bb86db869a Fix bad merge 2021-10-13 22:09:38 +13:00
Jesse Hills
4c4dd23e15 Merge branch 'release' into dev 2021-10-13 22:05:18 +13:00
Jesse Hills
8051c1ca99 Merge pull request #2504 from esphome/bump-2021.10.0b1
2021.10.0b1
2021-10-13 21:38:41 +13:00
Jesse Hills
fe5a6847b5 Bump version to 2021.11.0-dev 2021-10-13 16:40:46 +13:00
Jesse Hills
a779592414 Bump version to 2021.10.0b1 2021-10-13 16:40:46 +13:00
Jesse Hills
112215848d Merge branch 'dev' into bump-2021.10.0b1 2021-10-13 16:40:46 +13:00
Sergio Mayoral Martínez
3dee057826 Add throttle_average sensor filter (#2485) 2021-10-13 11:35:30 +13:00
Jesse Hills
4406a08fa7 Allow multiple pn532_spi entries (#2489) 2021-10-13 09:06:52 +13:00
Rafael Treviño
c33077bc61 Improves ct_clamp component accuracy (#2283)
Co-authored-by: Rafa Treviño <rafael.trevino@bbva.com>
2021-10-13 08:42:51 +13:00
Jesse Hills
34db9d9ef2 Add optional timeout for wait_until action (#2282) 2021-10-13 08:23:24 +13:00
Oxan van Leeuwen
1184bbc976 Reduce IRAM usage in test3 (#2499) 2021-10-13 08:22:38 +13:00
Rob Deutsch
a3eb2a7ee0 Added heatpumpir support (#1343)
Co-authored-by: Otto winter <otto@otto-winter.com>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-10-13 07:38:19 +13:00
Maurice Makaay
d13134135b Fix LoadProhibited crash for logger baud_rate 0 (#2498)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-10-12 13:51:41 +02:00
Chris Nussbaum
b4f57972fb Add on_open and on_closed triggers to cover (#2488) 2021-10-12 15:39:21 +13:00
Jesse Hills
6a5eb43454 Update Airthings BLE (#2453) 2021-10-12 11:56:47 +13:00
Dave T
04ec1c8b56 Consolidate CONF_RAW_DATA_ID to const.py (#2491) 2021-10-12 00:14:04 +02:00
niklasweber
d7ad155885 Fix reset on http_request without network connection (#2474)
* Fix reset problem when http_request is sent without network connection (#2501)

* Fix format
2021-10-12 00:11:04 +02:00
Jan Čermák
85461a752a Fix color temperature persistence on CWWW lights (#2486) 2021-10-11 23:56:35 +02:00
Dave T
039fbc677d Replace deprecated COLOR_BLACK constant (#2487) 2021-10-11 23:44:05 +02:00
dependabot[bot]
ea56a39e11 Bump esphome-dashboard from 20211006.0 to 20211011.1 (#2484)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-11 17:21:04 +02:00
dependabot[bot]
55e9560e74 Bump platformio from 5.2.0 to 5.2.1 (#2482)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-11 16:58:51 +02:00
dependabot[bot]
3cb4b4ca03 Bump flake8 from 3.9.2 to 4.0.1 (#2483)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-11 16:52:42 +02:00
dependabot[bot]
11d2866755 Bump click from 8.0.1 to 8.0.3 (#2481)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-11 16:45:27 +02:00
Jesse Hills
2c517e3e8c Use arduino btStart for arduino framework (#2457) 2021-10-11 10:38:45 +13:00
definitio
42739f0b22 Add configuration for climate topics (#2473) 2021-10-10 17:55:22 +02:00
definitio
a1f9b0d7f2 Add configuration for cover topics (#2472) 2021-10-10 17:54:07 +02:00
Chris Nussbaum
c3b8c84131 Fix below freezing temperature for Inkbird sensors (#2466) 2021-10-10 10:53:58 +02:00
Paul Monigatti
471b82f727 EntityBase Refactor (#2418)
* Renamed Nameable to EntityBase (cpp)

* Renamed NAMEABLE_SCHEMA to ENTITY_BASE_SCHEMA (Python)

* Renamed cg.Nameable to cg.EntityBase (Python)

* Remove redundant use of CONF_NAME from esp32_touch

* Remove redundant use of CONF_NAME from mcp3008

* Updated test

* Moved EntityBase from Component.h and Component.cpp

* Added icon property to EntityBase

* Added CONF_ICON to ENTITY_BASE_SCHEMA and added setup_entity function to cpp_helpers

* Added MQTT component getters for icon and disabled_by_default

* Lint

* Removed icon field from MQTT components

* Code generation now uses setup_entity to setENTITY_BASE_SCHEMA fields

* Removed unused import

* Added cstdint include

* Optimisation: don't set icon if it is empty

* Remove icon from NumberTraits and SelectTraits

* Removed unused import

* Integration and Total Daily Energy sensors now inherit icons from their parents during code generation

* Minor comment correction

* Removed redundant icon-handling code from sensor, switch, and text_sensor

* Update esphome/components/tsl2591/tsl2591.h

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>

* Added icon property to binary sensor, climate, cover, and fan component tests

* Added icons for Binary Sensor, Climate, Cover, Fan, and Light  to API

* Consolidated EntityBase fields in MQTT components

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-10-10 10:37:05 +02:00
Nate Lust
92b85f98e8 Sgp40 fix (#2462)
* Sample from SGP40 sensor at the appropriate interval

The spg40 sensor must be sampled at 1Hz for the VOC index algorithm
to work correctly. This commit introduces a on device timer to
sample correctly seperately from updating the public state of the
component.

* Add missing configuration values for SGP40

The SGP40 component was not printing all of it's configuration in
dump_config, add in the missing store_baseline value.

* Address review comments

* Format according to clang-tidy

* Attempt 2 at clang tidy
2021-10-10 10:33:04 +02:00
definitio
c092d92d45 Fix cover state (#2468) 2021-10-10 10:31:15 +02:00
Ryan Mounce
e514a1fcd4 Use enum for Tuya fan direction datapoint (#2471)
Fix regression from PR2059. Tested with Arlec DCF5242HA.
2021-10-10 10:28:37 +02:00
davidmonro
a1b28cb36e atm90e32: make the total_increasing class sensors actually be increasing totals. (#2459)
Co-authored-by: David Monro <david.monro@anu.edu.au>
2021-10-09 17:44:16 +02:00
Maurice Makaay
3f2d9abfe6 Correct I2C read() return val check in bh1750 component. (#2465)
Co-authored-by: Maurice Makaay <account-github@makaay.nl>
2021-10-09 10:30:21 +02:00
Otto Winter
f3ec4b514d Merge pull request #2461 from esphome/bump-2021.9.3
2021.9.3
2021-10-08 10:37:52 +02:00
Otto winter
fc5798fa71 Bump version to 2021.9.3 2021-10-07 22:05:30 +02:00
Otto Winter
95d7ad543f API encryption switch to libsodium backend (#2456) 2021-10-07 22:05:26 +02:00
Jesse Hills
d9b2903d78 Add log line to show if API encryption is being used (#2450) 2021-10-07 22:04:55 +02:00
dependabot[bot]
32a664eedc Bump aioesphomeapi from 9.1.2 to 9.1.4 (#2443) 2021-10-07 22:04:16 +02:00
dependabot[bot]
e7477890cf Bump aioesphomeapi from 9.1.1 to 9.1.2 (#2426)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-07 22:03:52 +02:00
Otto Winter
9bf72ff05f Re-enable TCP nodelay for ESP32 (#2390) 2021-10-07 22:03:05 +02:00
Martin
5461f87ff0 I2c fix (#2460) 2021-10-07 21:18:00 +02:00
Otto Winter
1c58b17235 API encryption switch to libsodium backend (#2456) 2021-10-06 22:36:12 +02:00
Alex Iribarren
d34a1c3ed6 Add timestamp to ESPHome dashboard/cli logs (#2455) 2021-10-07 08:56:07 +13:00
Jesse Hills
22e3bc7cfe Add id() for restoring global (#2454) 2021-10-06 22:35:11 +13:00
Paul Monigatti
955c96731e Add Safe Mode Restart Switch (#2437) 2021-10-06 20:44:48 +13:00
Otto Winter
54a173dbf1 I2C re-introduce very verbose logging (#2446) 2021-10-06 11:57:23 +13:00
Jesse Hills
9ff8240802 Bump esphome-dashboard to 20211006.0 (#2451) 2021-10-06 11:45:01 +13:00
Alex Iribarren
7bbb5213f3 Only ping once every two seconds (#2448) 2021-10-06 11:44:48 +13:00
dependabot[bot]
b8b30599ee Bump aioesphomeapi from 9.1.4 to 9.1.5 (#2449)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-06 11:29:30 +13:00
Jesse Hills
e083d7f4d0 Add log line to show if API encryption is being used (#2450) 2021-10-06 11:26:18 +13:00
Martin
a57580b5ab Fix compilation error (#2447) 2021-10-05 17:56:32 +02:00
dependabot[bot]
e22f1fc044 Bump pytest-cov from 2.12.1 to 3.0.0 (#2444) 2021-10-05 14:50:18 +02:00
dependabot[bot]
e09ee8f23d Bump aioesphomeapi from 9.1.2 to 9.1.4 (#2443) 2021-10-05 14:49:55 +02:00
Paul Monigatti
6ec546a6a4 Improved validation for Addressable Light Partition Segments (#2439)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-10-05 12:00:23 +13:00
NMC
877367677b Add support for Airthing Wave Mini (#2440) 2021-10-05 11:56:34 +13:00
Otto Winter
8be4086224 Always upload using esptool (#2433) 2021-10-04 16:59:15 +02:00
Otto Winter
871d3b66fb Fix restoring globals (#2442) 2021-10-04 16:15:25 +02:00
Otto Winter
87358e8843 Fix esp32 no longer has Hash internal lib (#2441) 2021-10-04 16:14:51 +02:00
Maurice Makaay
5c06cd8eb3 Fix I2C recovery ESP32 esp-idf (#2438)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-10-04 12:33:25 +02:00
Stefan Agner
46b4c970d1 Fix socket abstraction for ESP-IDF v4 (#2434) 2021-10-03 22:21:45 +02:00
Stefan Agner
49f46a7cdd Use size_t to fix comparision using RISC-V toolchain (#2436) 2021-10-03 21:55:19 +02:00
Stefan Agner
1627dff166 Disable dependency finder on ESP32 (#2435) 2021-10-03 21:53:40 +02:00
Maurice Makaay
cee08debff Hotfix for ESP8266 OTA issue: ERROR Error binary size (#2432)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-10-03 16:15:01 +02:00
Otto Winter
912793eddf Convert time to use tzdata (#2425) 2021-10-03 14:10:53 +02:00
Keith Burzinski
eaa5200a35 Thermostat publish state fix (#2427) 2021-10-03 14:10:43 +02:00
cvwillegen
a7687c3e17 Add local MAC address to WiFi info (#2428) 2021-10-03 13:27:59 +02:00
Maurice Makaay
932e0469f7 Fix ESP32 esp-idf OTA updates (#2424)
* WIP on separating out the OTA backends.

* Split off the individual OTA backends.

* Cleanup the three backends, split into .h and .cpp.

* After successfull flashing, activate the new boot partition.

* Fix linting issues.

* Minor cleanup

Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-10-02 16:02:01 +02:00
dependabot[bot]
15ab8918af Bump aioesphomeapi from 9.1.1 to 9.1.2 (#2426)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-10-02 15:20:12 +02:00
Maurice Makaay
d0dfc94a61 Fix I2C recovery on Arduino (#2412)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-10-01 12:53:37 +02:00
Maurice Makaay
5a2984d03a Fix attach_interrupt(...) for esp-idf framework (#2416)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-10-01 10:11:07 +02:00
Maurice Makaay
c89018a431 Option to ignore CRC for EFuse MAC address (#2399)
* Accept changes as proposed by black.

* Added test and implemented optional correctly.

* Disable PHY RF full calibration (because it calls the breaking MAC retrieval function).

* Disable CONFIG_ESP32_PHY_CALIBRATION_AND_DATA_STORAGE instead of enable, dummy!

* Rename CONF_IGNORE_EFUSE_MAC_CRC to CONF_ESP32_IGNORE_EFUSE_MAC_CRC.

* Removed unused import.

* Fix ordering of constants.

* Moved all MAC address logic to core helpers.

* Use pretty MAC address for the log.

* Use standard MAC formatter function for debug component.

* Fix clang-formatting.

* Fix clang-formatting.

* Brought wording of comments in line with other function-describing comments.

* Processed code review by @OttoWinter

* Add USE_ESP32_IGNORE_EFUSE_MAC_CRC to defines.h

Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-09-30 18:08:15 +02:00
Oxan van Leeuwen
1031ea4313 Fix line endings normalization (#2407)
* Strip CRLF line endings from modbus controller files

* Normalize all line endings to LF
2021-09-30 18:07:28 +02:00
Oxan van Leeuwen
5b0fbbaada Replace std::move() with const references where possible (#2421)
* Replace std::move() with const references where possible

* Fix formatting
2021-09-30 16:25:08 +02:00
Oxan van Leeuwen
0e4f1ac40d Fix default environment for clang-tidy (#2420)
* Drop unnecessary platformio call from script/lint-cpp

* Default environment for clang-tidy to esp32-tidy
2021-09-30 16:24:02 +02:00
Andy Allsopp
946db3fd50 Add viewport meta tag to web server layout (#2419)
* Update web_server.cpp

Added viewport meta tag to web_server.cpp in order to better control layout on mobile browsers. Adds 70 characters. Vastly improves accessibility on mobile devices.

* Update web_server.cpp

split line to meet clang format requirement.

* Update web_server.cpp

Reworked line break for clangtidy
2021-09-30 13:03:30 +02:00
WeekendWarrior1
3dfc8d4291 String manipulation filters for text sensors (#2393)
* initial text sensor filter POC

* fixed verbose logging

* add append, prepend, substitute filters

* add to lower, get to upper working without dummy

* clang lint

* more linting...

* std::move append and prepend filters

* fix verbose filter::input logging

* value.c_str() in input print

* lambda filter verbose log fix

* correct log tag, neaten to upper and to lower

* add on_raw_value automation/trigger
2021-09-29 23:25:06 +02:00
Oxan van Leeuwen
4f5e4f3b86 Move #ifdef to after header include (#2417)
defines.h needs to be included first.

Fixes esphome/issues#2490.
2021-09-29 23:21:52 +02:00
Jesse Hills
505d1d78fb Remove default initializations from tuya cover (#2415) 2021-09-29 12:19:19 +13:00
Otto Winter
7af1c04493 Bump debian base to 5.1.0 / 20210902 (#2413) 2021-09-28 23:16:00 +02:00
Otto Winter
855c98d815 Fix tuya cover lint checks (#2414) 2021-09-28 23:15:52 +02:00
Marek Marczykowski-Górecki
c26ea7e4e0 Tuya: add cover component (#2279) 2021-09-29 10:02:13 +13:00
irtimaled
c39ac9edfe Support HSV-based color support on tuya light (#2400)
* fix: stop tuya light state getting reset

* fix typo

* Support for HSV color in Tuya

* Clamp formatting
2021-09-28 22:19:17 +02:00
Stephen Tierney
af04f565cf Add support for SCD4X (#2217)
* Initial commit

* clang-format fixes

* Update CODEOWNERS

* clang-format fixes

* Fix merge error

* Fix missing return

Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-28 22:10:25 +02:00
Paul Monigatti
2b9054d3b2 Initialised ESPPreferenceObject::backend_ to nullptr (#2411) 2021-09-28 16:26:46 +02:00
Jesse Hills
c83ecf764d Merge pull request #2410 from esphome/bump-2021.9.2
2021.9.2
2021-09-28 16:04:19 +13:00
Jesse Hills
a2485a18cb Bump version to 2021.9.2 2021-09-28 15:41:58 +13:00
Jesse Hills
8ef2ad17b5 Fix lint issues in web_server_base (#2409) 2021-09-28 15:41:51 +13:00
Otto Winter
4579f78bf9 Merge pull request from GHSA-48mj-p7x2-5jfm 2021-09-28 15:39:41 +13:00
Sergey V. DUDANOV
1853407645 Midea fix (#2395) 2021-09-28 15:36:23 +13:00
Otto Winter
cb5efc1c42 Bump aioesphomeapi to 9.1.1 (#2350) 2021-09-28 15:35:03 +13:00
Jesse Hills
2234f6aacf Fix lint issues in web_server_base (#2409) 2021-09-28 15:33:30 +13:00
Otto Winter
be965a60eb Merge pull request from GHSA-48mj-p7x2-5jfm
* Move web_server auth to web_server_base

* Fix

* Fix

* Add middleware system
2021-09-28 13:53:38 +13:00
Oxan van Leeuwen
5596751c2c Add str_sprintf function that returns std::string (#2408) 2021-09-28 10:24:55 +13:00
Paulus Schoutsen
6417d8132d bump dashboard to 20210927.0 (#2405) 2021-09-27 23:08:21 +02:00
0hax
5624fafb3a Fix handling of timestamps in Teleinfo component. (#2392)
* teleinfo: avoid a buffer overflow.

When reading tag or values, data is written to the buffer even if the
size if bigger than the buffer. Add a new 'max_len' argument to
get_field() to avoid this error.

Signed-off-by: 0hax <0hax@protonmail.com>

* teleinfo: read extra timestamp field for some tags.

Some tags has an extra timestamp field that need to be read before the
actual data.
The code is inspired by Jpsy work:

29339c14f9

Signed-off-by: 0hax <0hax@protonmail.com>

* teleinfo: increase MAX_BUF_SIZE to suffice for 3-phase Linky in Standard mode.

* teleinfo: handle DATE tag correctly.

The DATE tag is special due its format and need to be handled
separately.
Fix from DrCoolzic.

Signed-off-by: 0hax <0hax@protonmail.com>

Co-authored-by: Jörg Wagner <jwagner@digilog.de>
2021-09-27 22:32:08 +02:00
Daniel Müller
2eb5f89d82 Add cover toggle support (#1809)
* Add cover toggle support

Step through open/stop/close/stop sequence with every toggle

* Move the cover toggle logic to perform()

* Add clang-tidy CI suggestion

* Implement cover toggle action as cover trait

* Handle toggle correctly if cover fully closed on POR

* Fix CI finding

* Add deprecated warning

* Don't add already deprecated interface

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>

* Don't add already deprecated interface

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>

* Don't add already deprecated interface

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>

Co-authored-by: Mueller, Daniel <daniel.mueller@karlstorz.com>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-09-27 22:31:15 +02:00
Marcos Pérez Ferro
e30f17f64f Add Current based cover (#1439)
* Adding first version of current_base cover. No Interlock yet.

* simplifying code

* Implementing malfunction protection

* Adding test

* Fixing too long lines

* Fixing test sensor names

* Adding missing id's in ade7953 tests

* Adding code owners as requested

* Fixing issue setting position when stop reached

* Fixing issue setting position when stop reached

* Black formatting

* Fixing format issues

* Fix for concurrent changes

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-09-27 22:22:45 +02:00
irtimaled
1ba560dc9e fix: stop tuya light state getting reset (#2401)
* fix: stop tuya light state getting reset

* fix typo
2021-09-27 21:54:51 +02:00
Maurice Makaay
8c86a18dc6 Add missing include for defines.h. (#2403)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-09-27 21:53:47 +02:00
Christian Taedcke
b2d516c70a ccs811: Skip reading data if it is not available (#2404)
On bootup the ccs811 reports that no data is available. No error flag
is set in that case. The current implementation ignores this, reads
and publishes the invalid data, which is 0xFDFD for both tvoc and co2
in my case.
This commit fixes this and does not read and publish invalid data.
2021-09-27 21:53:05 +02:00
Otto Winter
45940b0514 Dashboard node import and render in browser (#2374) 2021-09-27 10:10:53 -07:00
Otto Winter
97e76d64d6 Re-enable TCP nodelay for ESP32 (#2390) 2021-09-27 11:40:28 +02:00
Jesse Hills
756c6721e9 Fix NDEF URI casing (#2397) 2021-09-27 11:11:27 +13:00
JonasEr
4c390d9f9f Extend nfc ndef records with Text (#2191)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-09-27 09:38:08 +13:00
Sergey V. DUDANOV
0d0954d74b Midea fix (#2395) 2021-09-27 09:32:33 +13:00
Martin
7672ba2c8d Modbus controller (#1779)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-27 09:27:24 +13:00
WeekendWarrior1
4d28afc153 add fan.cycle_speed action (#2329) 2021-09-27 08:32:46 +13:00
irtimaled
7246f42a8e Tuya rgb support (#2278)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-26 21:34:06 +13:00
irtimaled
bdcffc7ba9 fix: Setting Tuya string DP value (#2394) 2021-09-26 21:27:43 +13:00
rbaron
95a6715b2b Adds light sensor support for b-parasites (#2391) 2021-09-25 13:16:27 +02:00
Otto Winter
5342edf04a Misc fixes for esp-idf (#2386) 2021-09-25 10:05:32 +02:00
Otto Winter
d344b1ca0e Fix arduino esp32 wifi v2 (#2389) 2021-09-25 10:04:57 +02:00
Otto Winter
278863d027 Fix some issues with wifi driver after IDF refactor (#2387) 2021-09-25 09:16:32 +02:00
Otto Winter
8503e08ee6 Fix InterruptLock on ESP-IDF (#2388) 2021-09-25 09:14:07 +02:00
Otto Winter
aec02afcdc Fix clang-tidy header filter (#2385)
* Fix clang-tidy header filter

* Allow private members

* Fix clang-tidy detections

* Run clang-format

* Fix remaining detections

* Fix graph

* Run clang-format
2021-09-24 18:02:28 +02:00
Maurice Makaay
52dd79691b Read unencrypted DSMR telegrams in chunks (#2382)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-09-24 14:15:22 +02:00
dependabot[bot]
aea2491fa4 Bump voluptuous from 0.12.1 to 0.12.2 (#2381) 2021-09-23 23:36:19 +02:00
Christian Taedcke
963b28181f Always execute i2c bus recovery on setup (#2379) 2021-09-23 20:11:40 +02:00
Christian Taedcke
210a9a4162 Fix esp-idf pinmask bit-shift overflow (#2380) 2021-09-23 18:24:29 +02:00
Otto Winter
a27a884191 Add missing MockObj operators (#2378) 2021-09-23 11:53:10 +02:00
Paul Monigatti
17dcba8f8a Fix: Pin flags code generation returning FLAG_NONE (#2377)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-23 11:19:17 +02:00
Paul Monigatti
ea6a7a22ff Fix ESP8266 ADC (#2376) 2021-09-23 10:45:41 +02:00
Stijn Tintel
5ddba719c5 Fix ir_climate on ESP32-C3 (#2314)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-22 20:13:24 +02:00
Otto Winter
b398d826c1 Fix two i2c error code return errors (#2375) 2021-09-22 20:07:43 +02:00
Philipp Riederer
edb557f79e ledc: do not try to write_state to an uninitialized output (#1732)
Co-authored-by: Philipp Tölke <ptoelke@tecracer.de>
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-22 19:50:19 +02:00
dependabot[bot]
f463cd98f8 Bump tzlocal from 2.1 to 3.0 (#2294)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-22 19:50:11 +02:00
Martin
262d69308d fix i2c scanning eror for Arduino (#2364) 2021-09-22 19:08:42 +02:00
Oxan van Leeuwen
0406e27100 Don't generate IDs with the name of loaded integrations (#2373) 2021-09-22 19:07:57 +02:00
Oxan van Leeuwen
ed3ad615d8 Fix compilation due to incompatibility between #1237 and IDF changes (#2372) 2021-09-22 14:07:39 +02:00
ZJY
66761ff340 Add SSD1305 support to SSD1306 integration along with few new options (#1902)
* Add serveral options for SSD1306 integration
* Add SSD1305 support
  (SSD1305 is similar to SSD1306, it seems SSD1305 has
  brightness and color register but does not have charge pump)
* Add some description when manipulating registers
* Add flip, offset and invert option to get more compatibility
  with various display modules
* Fix typo `setup_ssd1036' -> `setup_ssd1306'

* Add SSD1306 brightness validation tip

* Add more description, limit offset range

* Changes according to linter

* Fix test

* Raise error instead of using warning

* Fix wrong logic

* Remove logger

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

* Remove logging import

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

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-22 13:47:41 +02:00
Gustavo Ambrozio
8bebf138ee Wifi scan results (#1605)
* adding a scan results wifi text sensor

* Code comment

* Adding scan results to test

* Removing redundant call

* linting

* Better method to update wifi info

Co-authored-by: Otto Winter <otto@otto-winter.com>

* Getting loop back

At least for now.

* Trying out suggestion again

* Applying cr suggestions

Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-09-22 13:44:09 +02:00
wifwucite
fd836e982e Mqtt topics to support numeric fan speed (#1859)
* numeric speed added

* when dumping config for MQTT components log a note when skipped due to is_internal

* added new topics to paython code validation/generation

* reformatted with black

* formatting corrected

* use dump_config_ mechanism to skip internal components

* use dump_config_ mechanism to skip internal components

* style issues resolved

* do_dump_config removed

* formatting fixed

* formatting fixed

* Drop parent dump_config() calls

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-09-22 13:42:58 +02:00
Trevor North
e32722db70 Allow sloppy datapoint message length (#1982)
This allows datapoint update messages to be handled even if the overall
message is longer than required (likely that it contains trailing empty
bytes).

The specific type handling will read only the expected data lengths so
we only need to hard bail if we have too little data not too much.
2021-09-22 13:29:05 +02:00
Stephen Tierney
b20760c93c Add support for LTR390 (#1505)
* Add support for ltr390

* Fix linting errors

* Fix more linting errors

* Linting fixes continued

* Linting forever

* Another one

* Fix regression and linting

* Fix narrowing conversion

* Add test and bugfix

* Add codeowners

* Update CODEOWNERS

* Update sensor defs

* Reformatted with black

* Fixed device class import

* Update CODEOWNERS

* Update CODEOWNERS

* Adding all config options

As requested https://github.com/esphome/esphome/pull/1505#discussion_r597326897

* Moving test to different config file

test1.yml runs out of memory

* Update according to comments

* Add safety clause to reading modes

* Fix clang-tidy complaint

* Revert change to i2c component

* Fix for changes in dev

* Revert "Revert change to i2c component"

This reverts commit 2810df59e9.

Co-authored-by: Otto winter <otto@otto-winter.com>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-09-22 13:24:19 +02:00
Jesse Hills
654e31124e Correctly invert the float output state (#2368) 2021-09-22 22:59:03 +12:00
Stanislav Meduna
8e36e1b92e ili9341: use larger SPI transfers (#1628)
The original version uses write_byte to tranfer every byte of
the display buffer which is quite extensive as every byte needs
to be waited for in the SPI driver.

This patch prepares transfers in 64-byte chunks. The result is
a visible faster redraw of the display.

Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-22 12:43:17 +02:00
Tommy van der Vorst
9fe7b08874 Add support for Waveshare 7.5 inch (C) bichromatic display (black-and-white only for now) (#1844)
* Add support for Waveshare 7.5 inch (B) bichromatic display (black-and-white only for now)

* Use drawing commands specific to bichromatic displays

* Fix inaccurate comment

* Fix merge error

* Formatting

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-09-22 12:39:41 +02:00
Robert Resch
f1364d4af4 Combine code of xiaomi_miscale and xiaomi_miscale2 (#2266)
* Combine xiaomi_miscale and xiaomi_miscale2

* check if message contains impedance

* auto detect scale version

* remove xiaomi_miscale2

* fix lint errors

* Apply suggestions from code review

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>

* Apply suggestions from code review on old code

* Fix clang-tidy warnings

Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-09-22 12:12:55 +02:00
Silvio
ed593544d8 Add support for Daly Smart BMS (#2156)
* Add support for Daly Smart BMS

* Fix clang-format and python lint

* Fix const declaration

* Add code owner

* Fix malloc with std::vector

* Fix with suggestions

* Revert "Fix with suggestions"

This reverts commit bc618f20cf.

* Fix last commit

* Fix Python Lint

* Fix typo

* Use std::vector instead pointer and fix loop

* Fix typo

* Add test configuration to test3.yaml

* Fix test3.yaml

* Fix uart in test3.yaml
2021-09-22 12:03:42 +02:00
Niccolò Maggioni
0929a0f8aa Discard senseair commands echoes & fix calibration result check (#2358) 2021-09-22 11:15:51 +02:00
Paul Monigatti
13b3412b45 Fix Dallas parent not being set (#2369) 2021-09-22 11:12:42 +02:00
Maurice Makaay
888e315553 Fix OTA crash during reading of new bin file. (#2366)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-09-22 10:37:46 +02:00
Otto Winter
11daabc9c2 Fix docker pio settings not applied (#2370) 2021-09-22 10:32:39 +02:00
WeekendWarrior1
40e0100c1e add = to default font glpyh list (#2361) 2021-09-22 16:57:16 +12:00
Paul Monigatti
c51352d04d Allow non-addressable lights in light partitions (#2256) 2021-09-22 13:59:21 +12:00
Paul Monigatti
c8a8acd46e Fix ESP8266 preference loading (#2367) 2021-09-22 13:55:49 +12:00
Otto Winter
bbac1534a3 Fix ESP8266 preferences not set up (#2362) 2021-09-21 21:59:11 +02:00
Oxan van Leeuwen
637b55bfbf Allow compilation against IDF from repository (#2355)
* Fix src_filter in platformio.ini after src_dir change

* Add -Wno-nonnull-compare to platformio.ini as well

* Create default sdkconfig for static analysis

* Add more compiler flags to clang ignore list

* Clean-up platformio.ini

* Remove unnecessary blank line

* Fix accidentally dropped library

* Don't gitignore sdkconfig.defaults

Co-authored-by: Otto winter <otto@otto-winter.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-21 17:12:17 +02:00
Maurice Makaay
92a24d52be Fix OTA password mismatch error. (#2363)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-09-21 17:11:58 +02:00
Alex
491f8cc611 Configurable Flash Write Interval (#2119)
Co-authored-by: Alex <33379584+alexyao2015@users.noreply.github.com>
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-21 13:47:51 +02:00
Oxan van Leeuwen
71fc61117b Fix duplicate defines and restore alphabetical order (#2352) 2021-09-21 16:52:01 +12:00
Otto Winter
24f445dade Fix src_filter in platformio.ini after src_dir change (#2353) 2021-09-21 16:37:13 +12:00
Otto Winter
7c884329eb Fix MDNS not registered (#2359) 2021-09-21 16:34:56 +12:00
Martin
bac58bba4d fixes compilation error in rtttl (#2357)
Compilation error for millis() and delay() after #2303
2021-09-20 22:13:46 +02:00
Otto Winter
250bf3f054 CI cache only restore from direct matches (#2351) 2021-09-20 13:14:05 +02:00
Otto Winter
e65a7d887f Bump aioesphomeapi to 9.1.1 (#2350) 2021-09-20 12:02:37 +02:00
Otto Winter
ac0d921413 ESP-IDF support and generic target platforms (#2303)
* Socket refactor and SSL

* esp-idf temp

* Fixes

* Echo component and noise

* Add noise API transport support

* Updates

* ESP-IDF

* Complete

* Fixes

* Fixes

* Versions update

* New i2c APIs

* Complete i2c refactor

* SPI migration

* Revert ESP Preferences migration, too complex for now

* OTA support

* Remove echo again

* Remove ssl again

* GPIOFlags updates

* Rename esphal and ICACHE_RAM_ATTR

* Make ESP32 arduino compilable again

* Fix GPIO flags

* Complete pin registry refactor and fixes

* Fixes to make test1 compile

* Remove sdkconfig file

* Ignore sdkconfig file

* Fixes in reviewing

* Make test2 compile

* Make test4 compile

* Make test5 compile

* Run clang-format

* Fix lint errors

* Use esp-idf APIs instead of btStart

* Another round of fixes

* Start implementing ESP8266

* Make test3 compile

* Guard esp8266 code

* Lint

* Reformat

* Fixes

* Fixes v2

* more fixes

* ESP-IDF tidy target

* Convert ARDUINO_ARCH_ESPxx

* Update WiFiSignalSensor

* Update time ifdefs

* OTA needs millis from hal

* RestartSwitch needs delay from hal

* ESP-IDF Uart

* Fix OTA blank password

* Allow setting sdkconfig

* Fix idf partitions and allow setting sdkconfig from yaml

* Re-add read/write compat APIs and fix esp8266 uart

* Fix esp8266 store log strings in flash

* Fix ESP32 arduino preferences not initialized

* Update ifdefs

* Change how sdkconfig change is detected

* Add checks to ci-custom and fix them

* Run clang-format

* Add esp-idf clang-tidy target and fix errors

* Fixes from clang-tidy idf round 2

* Fixes from compiling tests with esp-idf

* Run clang-format

* Switch test5.yaml to esp-idf

* Implement ESP8266 Preferences

* Lint

* Re-do PIO package version selection a bit

* Fix arduinoespressif32 package version

* Fix unit tests

* Lint

* Lint fixes

* Fix readv/writev not defined

* Fix graphing component

* Re-add all old options from core/config.py

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-20 11:47:51 +02:00
Oxan van Leeuwen
1e8e471dec Introduce call_dump_config() indirection (#2325) 2021-09-20 11:16:31 +02:00
Otto Winter
2d7f8b3bdf Install python requirements after apt ones for better caching (#2349)
* Install python requirements after apt ones for better caching

* Fix buildkit caching works differently
2021-09-20 10:31:48 +02:00
Oxan van Leeuwen
7452ef23b1 Add ESPHOME_VERSION_CODE define (#2324) 2021-09-20 20:16:59 +12:00
Christian Taedcke
9ebe075f9b Add deep sleep wakeup from touch (#1238) (#2281) 2021-09-20 20:12:32 +12:00
Aljaž Srebrnič
3052c64dd7 Add invert_colors option for st7735 (#2327) 2021-09-20 20:08:08 +12:00
Otto Winter
5e345783bd Fix docker release deploy push flag (#2348) 2021-09-20 09:55:18 +02:00
poptix
81685573e1 Properly calculate negative temperatures in sm300d2 (#2335)
Co-authored-by: Matt Hallacy <github@poptix.net>
2021-09-20 19:44:18 +12:00
synco
945ed5d3bd Added graphing component (#2109)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: Synco Reynders <synco@deviceware.co.nz>
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-20 19:29:47 +12:00
Otto Winter
fff5ba03c2 Also run docker CI when requirements change (#2347) 2021-09-20 09:29:09 +02:00
besteru
82eca13d7b Fix error reporting for DHT bit read loop (#2344) 2021-09-20 09:14:44 +02:00
synco
5f21b925da Calculating the AC only component of the samples (#1906)
Co-authored-by: Synco Reynders <synco@deviceware.co.nz>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-20 09:12:50 +02:00
Otto Winter
272ceadbb0 Redo docker build system with buildkit+multi-stage and cache pio packages (#2338) 2021-09-20 09:07:38 +02:00
Jesse Hills
d26c2b1a44 Merge pull request #2346 from esphome/bump-2021.9.1
2021.9.1
2021-09-20 14:56:48 +12:00
Oxan van Leeuwen
8bda8e5393 Clean-up sensor integration (#2275) 2021-09-20 14:34:59 +12:00
Jesse Hills
954b8a0cff Bump version to 2021.9.1 2021-09-20 14:16:57 +12:00
Otto Winter
7c17e72db4 Add readv and writev for more efficient API packets (#2342) 2021-09-20 14:16:56 +12:00
Oxan van Leeuwen
d180aee57f Apply color brightness to addressable light effects (#2321) 2021-09-20 14:16:56 +12:00
Oxan van Leeuwen
e3ffecefc0 Cease using deprecated Cover methods in automations (#2326) 2021-09-20 14:16:56 +12:00
Oxan van Leeuwen
4c61cf153c Light transition fixes (#2320) 2021-09-20 14:16:56 +12:00
Paul Monigatti
c78fb90e2f Fix MQTT discovery for sensor state_class (#2331) 2021-09-20 14:16:39 +12:00
Otto Winter
a990898256 Add readv and writev for more efficient API packets (#2342) 2021-09-20 10:33:10 +12:00
Luca Gugelmann
c60c618204 Fix SPIDevice::write_byte16 to actually take a 16 bit argument (#2345) 2021-09-20 09:19:20 +12:00
Stefan Rado
53bd197c44 Add eco mode to tuya climate component (#1860)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-20 09:17:43 +12:00
dependabot[bot]
dbb195691b Bump pylint from 2.10.2 to 2.11.1 (#2334)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-19 19:22:28 +02:00
Oxan van Leeuwen
50da630811 Apply color brightness to addressable light effects (#2321) 2021-09-19 18:46:26 +02:00
Kamil Trzciński
30eca885c9 Add esp8266_disable_ssl_support: config option (#2236) 2021-09-19 18:46:17 +02:00
Oxan van Leeuwen
f76685fccf Cease using deprecated Cover methods in automations (#2326) 2021-09-19 18:31:31 +02:00
Oxan van Leeuwen
68d547595e Light transition fixes (#2320) 2021-09-19 18:31:20 +02:00
Paul Monigatti
64341d1d18 Fix MQTT discovery for sensor state_class (#2331) 2021-09-19 18:30:41 +02:00
Otto Winter
2e49039c01 Reduce stale/lock gh actions interval (#2341) 2021-09-19 14:20:35 +02:00
Jesse Hills
321504cf29 Merge pull request #2328 from esphome/bump-2021.9.0
2021.9.0
2021-09-16 09:40:29 +12:00
Jesse Hills
0f4a7bf1f5 Bump version to 2021.9.0 2021-09-16 09:12:01 +12:00
Jesse Hills
711e74a12b Merge branch 'beta' into bump-2021.9.0 2021-09-16 09:12:01 +12:00
Matthew Mazzanti
8f3a739da7 Allow transforms and flashes to not update remote_values (#2313) 2021-09-16 05:59:58 +12:00
Oxan van Leeuwen
aed140d802 Fix typo 2021-09-15 19:13:30 +02:00
Oxan van Leeuwen
c69b88bb55 Fix platformio.ini parser used by container build 2021-09-15 19:10:51 +02:00
Oxan van Leeuwen
c6dc8a11e2 Add namespace to all PlatformIO library references (#2296)
* Remove unnecessary duplication in platformio.ini

* Add namespace to all platformio library references

* Add cmake-build-* to gitignore

They're generated by the CLion add-on for each PlatformIO environment.
Listing them all separately seems nonsensical.
2021-09-15 19:01:31 +02:00
dependabot[bot]
6366ff6421 Bump black from 21.8b0 to 21.9b0 (#2305) 2021-09-15 18:02:41 +02:00
dependabot[bot]
607ddaa632 Bump aioesphomeapi from 9.0.0 to 9.1.0 (#2306) 2021-09-15 18:02:28 +02:00
Guillermo Ruffino
d281e59f3a ac_dimmer increase gate time for robotdyn (#1708)
* ac_dimmer increate gate time for robotdyn

* add explanation on longer gate enable time
2021-09-15 08:40:52 -03:00
Stefan Rado
2db8c42e1d Support direct relay state feedback for tuya climate component (#1668)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-15 20:23:35 +12:00
Jesse Hills
aa8eb2c92a Merge pull request #2319 from esphome/bump-2021.9.0b5
2021.9.0b5
2021-09-15 19:51:55 +12:00
Jesse Hills
b422a63b2a Bump version to 2021.9.0b5 2021-09-15 19:01:54 +12:00
Jesse Hills
ad5f2cd748 Start a wifi scan after saving station details (#2315) 2021-09-15 19:01:54 +12:00
Maurice Makaay
efae363739 Fix aioesphomeapi API logger with explicit api.port in the YAML. (#2310) 2021-09-15 19:01:54 +12:00
Jesse Hills
2d79d21c50 Simple time.sleep in place of threading wait due to upgraded zeroconf (#2307) 2021-09-15 19:01:54 +12:00
jsuanet
3b9d126322 Fix unit of measurement fields for DSMR power consumed/delivered fields (#2304)
Co-authored-by: Jos Suanet <jos@suanet.net>
2021-09-15 19:01:54 +12:00
Jesse Hills
0ea77de98c Start a wifi scan after saving station details (#2315) 2021-09-15 19:00:51 +12:00
Maurice Makaay
19014331d8 Fix aioesphomeapi API logger with explicit api.port in the YAML. (#2310) 2021-09-15 08:48:27 +02:00
Jesse Hills
b276ac0588 Simple time.sleep in place of threading wait due to upgraded zeroconf (#2307) 2021-09-15 16:39:13 +12:00
Guillermo Ruffino
de33cbd7e7 Dsmr updates (#2157)
* add option to use check_crc

* ignore newline before ( in parsing

* add gas delivered text for raw sensor

* fix compile issue when not listing any sensor

* make gas_mbus_id configurable

* update dsmr lib for clang
2021-09-14 22:14:49 -03:00
JonasEr
103ba4c696 Bug fix of NFC message & records becoming inaccessible in on_tag lambdas (#2309) 2021-09-15 10:06:43 +12:00
jsuanet
5a90b83f63 Fix unit of measurement fields for DSMR power consumed/delivered fields (#2304)
Co-authored-by: Jos Suanet <jos@suanet.net>
2021-09-15 09:22:45 +12:00
Oxan van Leeuwen
716039e452 Use standard version of make_unique when available (#2292) 2021-09-14 14:27:35 +02:00
Jesse Hills
896654aaef Merge pull request #2302 from esphome/bump-2021.9.0b4
2021.9.0b4
2021-09-14 23:23:51 +12:00
Jesse Hills
5fad38f65f Bump version to 2021.9.0b4 2021-09-14 23:07:08 +12:00
Jesse Hills
89f2ea5725 Fix binary strobe (#2301) 2021-09-14 23:07:07 +12:00
Jesse Hills
a32ad33b4e Allow simple hostname for sntp servers (#2300) 2021-09-14 23:07:07 +12:00
Otto Winter
a328fff5a7 Fix api noise explicit reject (#2297) 2021-09-14 23:07:07 +12:00
Otto Winter
233783c76c API Noise logging (#2298) 2021-09-14 23:07:07 +12:00
Otto Winter
39a18fb358 Bump platformio to 5.2.0 (#2291) 2021-09-14 23:07:02 +12:00
Jas Strong
460a144ca8 t6615: tolerate sensor dropping commands (#2255)
The Amphenol T6615 has a built-in calibration system which means that
the sensor could go away for a couple of seconds to figure itself out.
While this is happening, commands are silently dropped.

This caused the previous version of this code to lock up completely,
since there was no way for the command_ state machine to tick back to
the NONE state.

Instead of just breaking the state machine, which might be harmful on
a multi-core or multi-threaded device, add a timestamp and only break
the lock if it's been more than a second since the command was issued.

The command usually doesn't take more than a few milliseconds to
complete, so this should not affect things unduly.

While we're at it, rewrite the rx side to be more robust against
bytes going missing.

Instead of reading in the data essentially inline, read into a buffer
and process it when enough has been read to make progress.

If data stops coming when we expect it to, or the data is malformed,
have a timeout that sends a new command.

Co-authored-by: jas <jas@asspa.in>
2021-09-14 23:06:13 +12:00
Oxan van Leeuwen
23ead416d5 Suppress excessive warnings about deprecated Fan interfaces (#2270) 2021-09-14 23:06:13 +12:00
Oxan van Leeuwen
1b5f11bbee Only try compat parsing after regular parsing fails (#2269) 2021-09-14 23:06:13 +12:00
Jesse Hills
4cc2817fcd Fix binary strobe (#2301) 2021-09-14 22:59:15 +12:00
Jesse Hills
d437cc915c Allow simple hostname for sntp servers (#2300) 2021-09-14 22:40:45 +12:00
Otto Winter
dd3f2f6c7e Fix api noise explicit reject (#2297) 2021-09-14 11:53:49 +02:00
Otto Winter
5f61897bec Add stale/lock bots (#2299) 2021-09-14 10:35:37 +02:00
dependabot[bot]
c5d26a5b4a Bump click from 7.1.2 to 8.0.1 (#1824)
Bumps [click](https://github.com/pallets/click) from 7.1.2 to 8.0.1.
- [Release notes](https://github.com/pallets/click/releases)
- [Changelog](https://github.com/pallets/click/blob/main/CHANGES.rst)
- [Commits](https://github.com/pallets/click/compare/7.1.2...8.0.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-14 10:26:49 +02:00
Otto Winter
855112dfc3 API Noise logging (#2298) 2021-09-14 09:53:37 +02:00
Jesse Hills
0da97289e6 Merge pull request #2295 from esphome/bump-2021.9.0b3
2021.9.0b3
2021-09-14 07:47:20 +12:00
Otto Winter
b9767bdcbc Bump platformio to 5.2.0 (#2291) 2021-09-13 21:16:13 +02:00
Jesse Hills
91f12a50cf Bump version to 2021.9.0b3 2021-09-14 07:13:00 +12:00
Otto Winter
e92a9d1d9e Fix API socket issues (#2288)
* Fix API socket issues

* Fix compile error against beta

* Format
2021-09-14 07:13:00 +12:00
Oxan van Leeuwen
4eb51ab4d6 Disable automatic usage of SNTP servers from DHCP (#2273) 2021-09-14 07:12:59 +12:00
Oxan van Leeuwen
e6b0a0ca2b Clean-up sensor integration (#2275) 2021-09-13 18:58:49 +02:00
Oxan van Leeuwen
924df1e7de Run clang-tidy against Arduino 3 (#2146)
* Add macros header with more usable Arduino version defines

* Change Arduino version checking to use our version defines

* Add missing ESP8266 check

* Rename Arduino version macro to ARDUINO_VERSION_CODE

* Upgrade clang-tidy to use Arduino 3

* Fix clang-tidy warnings

* Upgrade NeoPixelBus to upstream 2.6.7

* Use Arduino-version-appropriate API to set redirect flags

* Remove now unnecessary CLANG_TIDY ifdefs

* Add preprocessor hackery to avoid including pgmspace.h

* Bump base image to 4.1.1 and update lint

* Fix nfctag

* Fix make_unique ambiguous

* Fix ignore name

* Fix ambiguous v2

* Remove unused begin

* Cast time_t to prevent issues on platforms where time_t is 32bit

Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-13 18:55:04 +02:00
Otto Winter
ed7983af41 Fix API socket issues (#2288)
* Fix API socket issues

* Fix compile error against beta

* Format
2021-09-13 18:52:53 +02:00
Oxan van Leeuwen
40c474cd83 Run clang-tidy against ESP32 (#2147)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-13 18:11:27 +02:00
Otto Winter
a2d2863c72 Revert "Bump tzlocal from 2.1 to 3.0 (#2154)" (#2289)
This reverts commit e0cff214b2.
2021-09-13 17:22:24 +02:00
Oxan van Leeuwen
133a17d6eb Add esphal.h include to inkplate6 component (#2286) 2021-09-13 16:55:01 +02:00
Oxan van Leeuwen
fe47ddc27a Convert st7735.h to use LF line endings (#2287) 2021-09-13 16:39:35 +02:00
Tercio Filho
aad03f1bf5 Fix issue #2054. PZEM004T Component doesn't set the module address. (#1784) 2021-09-13 15:36:01 +02:00
Otto Winter
a4867a00ea Activate owning-memory clang-tidy check (#1891)
* Activate owning-memory clang-tidy check

* Lint

* Lint

* Fix issue with new NfcTag constructor

* Update pointers for number and select

* Add back the NOLINT to display buffer

* Fix merge

* DSMR fixes

* Nextion fixes

* Fix pipsolar

* Fix lwip socket

* Format

* Change socket fix

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-13 11:31:02 +02:00
dependabot[bot]
e0cff214b2 Bump tzlocal from 2.1 to 3.0 (#2154)
Bumps [tzlocal](https://github.com/regebro/tzlocal) from 2.1 to 3.0.
- [Release notes](https://github.com/regebro/tzlocal/releases)
- [Changelog](https://github.com/regebro/tzlocal/blob/master/CHANGES.txt)
- [Commits](https://github.com/regebro/tzlocal/compare/2.1...3.0)

---
updated-dependencies:
- dependency-name: tzlocal
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-13 11:25:28 +02:00
James Braid
c6109024aa Fix SM300D2 sensor component routines so they correctly read the sensor output (#2159) 2021-09-13 11:23:59 +02:00
Alex
4e308f551c Fix devcontainer scripts on Windows (#2239) 2021-09-13 10:08:06 +02:00
Kamil Trzciński
8a2b1d9359 Expose select on Frontend web_server: (#2245) 2021-09-13 10:06:28 +02:00
Jas Strong
63a186bdf9 t6615: tolerate sensor dropping commands (#2255)
The Amphenol T6615 has a built-in calibration system which means that
the sensor could go away for a couple of seconds to figure itself out.
While this is happening, commands are silently dropped.

This caused the previous version of this code to lock up completely,
since there was no way for the command_ state machine to tick back to
the NONE state.

Instead of just breaking the state machine, which might be harmful on
a multi-core or multi-threaded device, add a timestamp and only break
the lock if it's been more than a second since the command was issued.

The command usually doesn't take more than a few milliseconds to
complete, so this should not affect things unduly.

While we're at it, rewrite the rx side to be more robust against
bytes going missing.

Instead of reading in the data essentially inline, read into a buffer
and process it when enough has been read to make progress.

If data stops coming when we expect it to, or the data is malformed,
have a timeout that sends a new command.

Co-authored-by: jas <jas@asspa.in>
2021-09-13 09:54:48 +02:00
Oxan van Leeuwen
d594a6fcbc Store strings only used for logging in flash (#2274)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-09-13 09:48:52 +02:00
Oxan van Leeuwen
e18dfdd656 Suppress excessive warnings about deprecated Fan interfaces (#2270) 2021-09-13 09:39:18 +02:00
Oxan van Leeuwen
3aa107142b Only try compat parsing after regular parsing fails (#2269) 2021-09-13 09:37:11 +02:00
Oxan van Leeuwen
0cd24c629a Compatibility with clang-tidy v14 (#2272) 2021-09-13 09:35:55 +02:00
Oxan van Leeuwen
f31e0532c4 Untangle core headers (part 1) (#2276) 2021-09-13 09:33:29 +02:00
irtimaled
f0b6aabc96 Support inverting color temperature on tuya lights (#2277) 2021-09-13 09:33:20 +02:00
Oxan van Leeuwen
97a18717e6 Disable automatic usage of SNTP servers from DHCP (#2273) 2021-09-13 12:44:39 +12:00
Oxan van Leeuwen
ede1de9021 Drop obsolete comments from CONTRIBUTING.md (#2271) 2021-09-12 22:04:35 +02:00
Jesse Hills
f1a8d957f8 Merge pull request #2267 from esphome/bump-2021.9.0b2
2021.9.0b2
2021-09-10 22:13:54 +12:00
Jesse Hills
9821a3442b Bump version to 2021.9.0b2 2021-09-10 21:34:38 +12:00
poptix
87842e097b sm300d2: Accept (undocumented) 0x80 checksum offset. (#2263)
Co-authored-by: Matt Hallacy <github@poptix.net>
2021-09-10 21:34:38 +12:00
Jesse Hills
7dd40e2014 Fix a few ESP32-C3 compiler issues (#2265)
* Fix using Serial when using ESP32-C3 standard pins

* Force type for std::min in pn532

* Fix variable size where size_t is different on exp32-c3
2021-09-10 21:34:38 +12:00
poptix
3d71e2e189 sm300d2: Accept (undocumented) 0x80 checksum offset. (#2263)
Co-authored-by: Matt Hallacy <github@poptix.net>
2021-09-10 21:05:25 +12:00
Jesse Hills
affaaf7d2c Fix a few ESP32-C3 compiler issues (#2265)
* Fix using Serial when using ESP32-C3 standard pins

* Force type for std::min in pn532

* Fix variable size where size_t is different on exp32-c3
2021-09-10 12:10:28 +12:00
Jesse Hills
a719998220 Merge pull request #2262 from esphome/bump-2021.9.0b1
2021.9.0b1
2021-09-09 11:40:33 +12:00
Jesse Hills
bad161a5c1 Bump version to 2021.10.0-dev 2021-09-09 10:28:34 +12:00
Jesse Hills
09a6fdf1c7 Bump version to 2021.9.0b1 2021-09-09 10:28:34 +12:00
Stephen Tierney
d2616cbdfc PMSA003i Update state_class and async (#2216)
* Update component (state_class and async)

* No need to specify empty device class

* Remove unused import

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-09 10:14:08 +12:00
Keith Burzinski
faf1c8bee8 SGP40 sensor start-up fix (#2178) 2021-09-09 09:42:35 +12:00
Peter van Dijk
f09aca4865 pm1006: add support for sending a measurement request (#2214) 2021-09-09 09:35:00 +12:00
Jesse Hills
cc52f37933 Revert "Dont dump legacy fields (#2241)" (#2259)
This reverts commit 97eba1eecc.
2021-09-09 09:29:08 +12:00
Otto Winter
e5051eefbc API encryption (#2254) 2021-09-09 09:22:47 +12:00
Peter van Dijk
9e5cd0da51 ccs811: publish firmware version; log bootloader and HW version; fix a bug (#2006) 2021-09-09 09:19:43 +12:00
Sergey V. DUDANOV
4e120a291e Midea support v2 (#2188) 2021-09-09 09:10:02 +12:00
Otto Winter
2790d72bff Convert API to use sockets (#2253)
* Socket component

* Lint

* Lint

* Fix esp8266 missing INADDR_ANY

* API convert to sockets and frame helper

* Fix compile error

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-09-08 12:52:57 +02:00
Otto Winter
e44f447d85 Fix socket not setting callbacks early enough (#2260) 2021-09-08 12:02:32 +02:00
Jesse Hills
4356581db0 Remove removesuffix 2021-09-08 19:51:20 +12:00
Jesse Hills
f87a701b28 Bump dashboard to 20210908.0 and fix card names for yml (#2258) 2021-09-08 17:14:12 +12:00
Jesse Hills
fa2eb46cd6 Allow .yml files to show up in the dashboard (#2257) 2021-09-08 16:11:09 +12:00
Otto Winter
f924e80f43 Socket component (#2250) 2021-09-08 15:41:42 +12:00
Chris Nussbaum
6180ee8065 Template sensors always publish on update interval (#2224)
Co-authored-by: Chris Nussbaum <chris.nussbaum@protolabs.com>
2021-09-08 15:36:49 +12:00
wifwucite
1be106c0b5 Fix fan speed restore issue on boot (#1867) 2021-09-08 15:30:17 +12:00
dgtal1
b0533db2eb Add new trigger to fan component on_speed_set (#2246) 2021-09-08 15:15:57 +12:00
Otto Winter
dba502c756 Logger prevent recursive logging (#2251) 2021-09-08 08:57:20 +12:00
Oxan van Leeuwen
d9cb64b893 Add device classes new in HA 2021.9 (#2248) 2021-09-07 10:12:26 +12:00
Kamil Trzciński
2d91e6b977 template: select: fix initial_value cannot be used with lambda (#2244) 2021-09-07 08:00:08 +12:00
Alex
4a6f1f150a Fix runtime exception due to dict typing (#2243) 2021-09-06 14:48:28 +12:00
Peter van Dijk
7f76f3726f LOG_UPDATE_INTERVAL: correctly report "never" (#2240) 2021-09-06 14:47:13 +12:00
Jesse Hills
e2d97b6f36 Light: include ON_OFF capability to BRIGHTNESS ColorMode (#2204) 2021-09-06 08:57:58 +12:00
Jesse Hills
2a653642f5 Fix encoding bug (#2242) 2021-09-06 08:57:37 +12:00
Jesse Hills
97eba1eecc Dont dump legacy fields (#2241) 2021-09-06 08:36:55 +12:00
Jesse Hills
ff6bed54c6 Remove last_reset_type and convert all those sensors to TOTAL_INCREASING (#2233) 2021-09-06 08:30:47 +12:00
Jesse Hills
f9b0666adf Allow using a git source for a package (#2193) 2021-09-06 08:23:06 +12:00
Jesse Hills
ca12b8aa56 Move to use zeroconf library instead of inline copy (#2192) 2021-09-06 08:22:15 +12:00
Christian Ferbar
77508f7e44 Fix UARTComponent hardware vs software UART0 conflict (#2229)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-09-04 14:49:34 +12:00
Oxan van Leeuwen
54de0ca0da Reject template select/number/switches that don't handle user input (#2230) 2021-09-04 14:46:53 +12:00
Oxan van Leeuwen
f364788c03 Expose WHITE/CWWW/RGBCT color modes over MQTT (#2231) 2021-09-04 14:32:33 +12:00
DAVe3283
00aaf84c37 Fix uptime's state_class (esphome/issues#2337) (#2205) 2021-09-03 16:58:30 +12:00
Kamil Trzciński
b01bc76dc5 mqtt_sensor: properly send state_class via MQTT (#2228) 2021-09-03 16:37:18 +12:00
dependabot[bot]
910f812737 Bump pylint from 2.9.6 to 2.10.2 (#2197)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.9.6 to 2.10.2.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.9.6...v2.10.2)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-09-03 16:20:42 +12:00
Chris Nussbaum
a4d024f43d Add is_on and is_off conditions for the fan component (#2225)
Co-authored-by: Chris Nussbaum <chris.nussbaum@protolabs.com>
2021-09-02 12:16:11 +12:00
Alex
9937ad7fa0 Cleanup flash transitions (#2227) 2021-09-02 11:56:40 +12:00
Petko Bordjukov
edcd88123d iBeacon support for ble_presence (#1627) 2021-09-02 11:46:15 +12:00
Alex
ea1b5e19f0 Add transitions to light flash (#2201) 2021-08-31 14:18:16 +12:00
Jesse Hills
54337befc2 Fix some lint errors in pylint 2.10.2 (#2226) 2021-08-31 14:00:58 +12:00
Jérôme Laban
140ef791aa Support for the AirThings Wave Plus (#1656)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-08-31 14:00:30 +12:00
dependabot[bot]
58350b6c99 Bump pytest from 6.2.4 to 6.2.5 (#2223)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-31 11:10:52 +12:00
dependabot[bot]
f186ff8b46 Bump black from 21.7b0 to 21.8b0 (#2222)
Bumps [black](https://github.com/psf/black) from 21.7b0 to 21.8b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-31 10:40:06 +12:00
WeekendWarrior1
03190611bb Add H-Bridge fan component (#2212)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-08-31 10:10:22 +12:00
Guillermo Ruffino
37f322585e Glmnet schema 202105 (#2220) 2021-08-31 06:48:19 +12:00
Marcio Granzotto Rodrigues
9218e85bd6 Remove footer validation for fujitsu_general (#2196) 2021-08-31 06:03:30 +12:00
Jesse Hills
f923ba87c0 Bump dashboard to 20210826.0 (#2211) 2021-08-30 09:41:14 +12:00
Oxan van Leeuwen
fac49896df Update known boards (#2190) 2021-08-30 09:41:05 +12:00
Paul Monigatti
56225701f9 Fix Packages when using MQTT (#2210) 2021-08-30 09:27:38 +12:00
Alessandro Campolo
b5de43b225 cs_pin made optional for ili9341 (#2219) 2021-08-30 09:07:06 +12:00
Jesse Hills
b955527f6c Fix css/js file loading for webserver when esphome not executed form config directory (#2207) 2021-08-26 15:34:39 +12:00
marsjan155
94b28102f5 Add st7920 display, (#1440)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-08-26 14:33:03 +12:00
WeekendWarrior1
de871862a8 Optionally set direction on fan.turn_on action (#2171)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-08-26 10:25:24 +12:00
Jesse Hills
3be56fd502 Fix SDM energy units to be KILO... (#2206) 2021-08-26 09:27:00 +12:00
Jesse Hills
5086cd716f Merge pull request #2203 from esphome/bump-2021.8.2
2021.8.2
2021-08-25 19:59:13 +12:00
Jesse Hills
4937af0cd9 Bump version to 2021.8.2 2021-08-25 19:46:55 +12:00
Jesse Hills
877a5fda41 Revert "Light: include ON_OFF capability to BRIGHTNESS ColorMode (#2186)" (#2202)
This reverts commit b0fa317302.
2021-08-25 19:46:54 +12:00
Jesse Hills
39cd2838df Revert "Light: include ON_OFF capability to BRIGHTNESS ColorMode (#2186)" (#2202)
This reverts commit b0fa317302.
2021-08-25 19:38:51 +12:00
Stephan Peijnik-Steinwender
565473c90c ST7789V: Make backlight_pin optional (#2180) 2021-08-24 22:57:53 +12:00
Jesse Hills
1fac91a659 Merge pull request #2199 from esphome/bump-2021.8.1
2021.8.1
2021-08-24 14:40:24 +12:00
Jesse Hills
0a4837c1f0 Bump version to 2021.8.1 2021-08-24 14:26:28 +12:00
mtl010957
e7404183a0 Internally all temperature units are Celsius so just send it directly (#1840) 2021-08-24 14:26:28 +12:00
Samuel Sieb
44f8dcfb6e Fix template select lambda (#2198) 2021-08-24 14:26:27 +12:00
Chris Nussbaum
481e0e98f8 Tuya fan component uses enum datapoint type for speed instead of integer (#2182)
Co-authored-by: Chris Nussbaum <chris.nussbaum@protolabs.com>
2021-08-24 14:26:27 +12:00
puuu
9de40c26eb mqtt_light: remove legacy API config that is not compatible with HA 2021.8 (#2183) 2021-08-24 14:26:27 +12:00
Oxan van Leeuwen
ad953f02d1 Fix addressable light control without transitions & effects with transitions (#2187) 2021-08-24 14:26:27 +12:00
puuu
3869e56521 Light: include ON_OFF capability to BRIGHTNESS ColorMode (#2186) 2021-08-24 14:26:27 +12:00
Jesse Hills
63d87b17aa Fix pypi download url (#2177) 2021-08-24 14:26:27 +12:00
mtl010957
ed68a0e773 Internally all temperature units are Celsius so just send it directly (#1840) 2021-08-24 13:38:59 +12:00
Samuel Sieb
e2640c8368 Fix template select lambda (#2198) 2021-08-24 13:26:59 +12:00
Chris Nussbaum
eff626248f Tuya fan component uses enum datapoint type for speed instead of integer (#2182)
Co-authored-by: Chris Nussbaum <chris.nussbaum@protolabs.com>
2021-08-24 13:20:39 +12:00
puuu
ce29a3b07a mqtt_light: remove legacy API config that is not compatible with HA 2021.8 (#2183) 2021-08-24 13:18:40 +12:00
Otto Winter
1b89174558 Store source package in Component for debugging (#2070) 2021-08-24 06:49:19 +12:00
Oxan van Leeuwen
1c1ad32610 Add deprecated attribute to some deprecated types/methods (#2185) 2021-08-24 06:48:12 +12:00
Jesse Hills
71237e2f76 Fix template select log message mentioning number (#2194) 2021-08-23 21:21:30 +12:00
Oxan van Leeuwen
518c271eba Fix addressable light control without transitions & effects with transitions (#2187) 2021-08-23 20:44:24 +12:00
Oxan van Leeuwen
d71996e58d Reduce static RAM usage (#2140) 2021-08-23 20:43:54 +12:00
Oxan van Leeuwen
2f33cd2db5 Remove double scheduling from addressable lights (#1963) 2021-08-23 20:00:38 +12:00
Oxan van Leeuwen
5ec9bb0fb5 Clean-up constant definitions (#2148) 2021-08-23 19:21:30 +12:00
Oxan van Leeuwen
8cc3cbb22e Add macros header with more usable Arduino version defines (#2145) 2021-08-23 19:19:21 +12:00
puuu
b0fa317302 Light: include ON_OFF capability to BRIGHTNESS ColorMode (#2186) 2021-08-21 22:26:24 +12:00
Jesse Hills
5cb56bc677 Set SDM voltage state class to measurement (#2181) 2021-08-19 21:28:58 +12:00
Jesse Hills
21f8fd9fa5 Fix pypi download url (#2177) 2021-08-18 15:39:57 +12:00
Jesse Hills
2100ef63a9 Bump version to 2021.9.0-dev 2021-08-18 15:19:25 +12:00
Jesse Hills
29db77c9c9 Merge branch 'release' into dev 2021-08-18 15:17:33 +12:00
Jesse Hills
2e59ad90cc Fix docker release for new tags without v 2021-08-18 15:10:44 +12:00
Jesse Hills
1b8c9edcde Merge pull request #2176 from esphome/bump-2021.8.0
2021.8.0
2021-08-18 15:03:48 +12:00
Jesse Hills
d4c2a85f9c Bump version to v2021.8.0 2021-08-18 14:25:10 +12:00
Jesse Hills
8c75b87e94 Merge pull request #2175 from esphome/bump-1.21.0b3
1.21.0b3
2021-08-18 11:37:39 +12:00
Jesse Hills
409d4b9d47 Bump version to v1.21.0b3 2021-08-18 11:11:39 +12:00
Jesse Hills
4e3b95d120 Add new total_increasing state-class for Home Assistant 2021.9+ (#2166) 2021-08-18 11:11:39 +12:00
Jesse Hills
61a9c9fa33 Remove specified accuracy_decimals from total_daily_energy (#2174) 2021-08-18 11:11:39 +12:00
Jesse Hills
9c605f2d46 Send dirty states when screen wakes up (#2167) 2021-08-18 11:11:39 +12:00
Franck Nijhof
44bb5a89c8 Add Gas device class to DSMR component (#2169) 2021-08-18 11:11:39 +12:00
Daniel Hyles
cbdb96f105 Add a dummy color temp (#2161) 2021-08-18 11:11:39 +12:00
Oxan van Leeuwen
9ee3463d07 Initialize color temperature to value within range if possible (#2168) 2021-08-18 11:11:39 +12:00
Jesse Hills
f0b14055b6 Add new total_increasing state-class for Home Assistant 2021.9+ (#2166) 2021-08-18 11:04:13 +12:00
Jesse Hills
fbd9e87b51 Remove specified accuracy_decimals from total_daily_energy (#2174) 2021-08-18 10:32:19 +12:00
Jesse Hills
edb3b77916 Send dirty states when screen wakes up (#2167) 2021-08-18 10:22:00 +12:00
Chris Nussbaum
ebaa84617f Total daily energy methods (#2163)
Co-authored-by: Chris Nussbaum <chris.nussbaum@protolabs.com>
2021-08-18 07:16:02 +12:00
Franck Nijhof
8eb18995cb Add device class update to binary sensor (#2170) 2021-08-17 21:44:05 +12:00
Franck Nijhof
ebabf0e7d8 Add Gas device class to DSMR component (#2169) 2021-08-17 21:43:51 +12:00
Maurice Makaay
607e1f823d Minor code cleanup in light components (#2162)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-08-17 20:12:29 +12:00
Daniel Hyles
3b52a306cd Add a dummy color temp (#2161) 2021-08-17 20:05:37 +12:00
Oxan van Leeuwen
0c370d5897 Initialize color temperature to value within range if possible (#2168) 2021-08-17 14:02:38 +12:00
Jesse Hills
8bf0448f41 Merge pull request #2160 from esphome/bump-1.21.0b2
1.21.0b2
2021-08-16 14:22:28 +12:00
Jesse Hills
14e04eb231 Bump version to v1.21.0b2 2021-08-16 12:32:48 +12:00
Otto Winter
1be9bac3a9 Fix native API log level enum values (#2151) 2021-08-16 12:32:48 +12:00
Keith Burzinski
02b5a3efb8 Thermostat delayed fan mode fix (#2158) 2021-08-16 12:32:48 +12:00
puuu
bd457f64d8 let sensors announce its state_class via mqtt (#2155) 2021-08-16 12:32:48 +12:00
Oxan van Leeuwen
9efeea14f2 Always send all light state values in API (#2150) 2021-08-16 12:32:48 +12:00
Otto Winter
9b48ff5775 Fix native API log level enum values (#2151) 2021-08-16 11:57:50 +12:00
Keith Burzinski
117b58ebe6 Thermostat delayed fan mode fix (#2158) 2021-08-16 09:31:48 +12:00
puuu
303b699005 let sensors announce its state_class via mqtt (#2155) 2021-08-16 07:59:29 +12:00
Oxan van Leeuwen
9173da0416 Always send all light state values in API (#2150) 2021-08-16 07:40:34 +12:00
Jesse Hills
d2cd65f5db Merge pull request #2144 from esphome/bump-1.21.0b1
1.21.0b1
2021-08-11 22:09:43 +12:00
Jesse Hills
2735f96516 Fix bad merge again 2021-08-11 21:54:24 +12:00
Jesse Hills
6847645782 Fix bad merge conflict 2021-08-11 21:45:04 +12:00
Jesse Hills
b0bc898278 Bump version to v1.21.0b1 2021-08-11 21:27:39 +12:00
Jesse Hills
c0f6af7213 Merge branch 'dev' into bump-1.21.0b1 2021-08-11 21:26:26 +12:00
Jesse Hills
5edebaf468 Bump version to v1.22.0-dev 2021-08-11 19:48:46 +12:00
Oxan van Leeuwen
d436409153 Support multiple configuration directories for update-all subcommand (#1925) 2021-08-11 17:21:57 +12:00
Branimir Lambov
8c41fc2b1d Support for the DKE screen version of LilyGo-TTGO-T5 V2.3 (#1969)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-08-11 17:14:17 +12:00
Oxan van Leeuwen
46f17bea66 Modular light transformers (#2124) 2021-08-11 16:51:35 +12:00
Stefan Agner
11477dbc03 Fix format warning in Tuya component (#1954) 2021-08-11 16:50:05 +12:00
buxtronix
947c104eff Support for AM43 BLE blind motors (#1744)
Co-authored-by: Ben Buxton <bb@cactii.net>
Co-authored-by: Otto Winter <otto@otto-winter.com>
Co-authored-by: Stefan Agner <stefan@agner.ch>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: René Klomp <rene@klomp.ws>
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: Geoff Davis <geoff@geoffdavis.com>
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Co-authored-by: dentra <dentra@users.noreply.github.com>
Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
Co-authored-by: Franck Nijhof <frenck@frenck.nl>
Co-authored-by: Barry Loong <loongyh@users.noreply.github.com>
Co-authored-by: Sergey V. DUDANOV <sergey.dudanov@gmail.com>
Co-authored-by: Balazs Scheidler <bazsi77@gmail.com>
2021-08-11 16:07:10 +12:00
Stefan Agner
e5366dbbe7 Add deassert_rts_dtr option to force RTS/DTR low when using miniterm (#2089) 2021-08-11 07:55:36 +12:00
Andreas Hergert
d3375193a9 Feature pipsolar anh (#1664)
Co-authored-by: Andreas Hergert <andreas.hergert@otrs.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-08-11 07:48:32 +12:00
Chris Nussbaum
6144ce1fe0 Break the Tuya set_datapoint_value method into separate methods per datapoint type (#2059)
Co-authored-by: Chris Nussbaum <chris.nussbaum@protolabs.com>
Co-authored-by: Trevor North <trevor@freedisc.co.uk>
2021-08-11 07:44:31 +12:00
Dave T
1771e673d2 Warn if underscore character is used in hostname (#2079)
* Prevent underscore character being used in 'name'.

* Restrict underscores in hostnames, not all names.

* Use hostname validator for node name.

* Allow underscore in hostname but warn once.

* Add renaming instructions link to warning.

* Point underscore warning to FAQ section

Co-authored-by: Otto Winter <otto@otto-winter.com>

Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-08-10 14:14:42 +02:00
Jesse Hills
d258e06fd7 Add rgbct and color_temperature light platforms (#2138)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-08-10 21:28:56 +12:00
Otto Winter
854f4a8896 Format dev temp idedata (#2142) 2021-08-10 11:14:04 +02:00
Stefan Agner
f94c221a9a Increase task wdt timeout for ESP32/ESP32-C3 (#2096) 2021-08-10 11:10:52 +02:00
Stephen Tierney
6a2f0f5143 Add support for PMSA003i (#1501)
Co-authored-by: Otto Winter <otto@otto-winter.com>
Co-authored-by: steve <steve@Hackintosh.local>
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-08-10 11:00:16 +02:00
WJCarpenter
183e2a8471 Support component tsl2591 (#2131)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: WJCarpenter <bill@carpenter.org>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-08-10 10:48:06 +02:00
Oxan van Leeuwen
c6c2842bdb Always abort on allocation when out-of-memory (#2129)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-08-10 10:46:46 +02:00
Guillermo Ruffino
f26767b65e Dsmr component (#1881)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-08-10 10:32:16 +02:00
Keith Burzinski
98d32876b5 Thermostat enhancements 2 (#2114) 2021-08-10 10:16:44 +02:00
Trammell Hudson
e5d0f3c036 waveshare_epaper: add support for ttgo t5 b74 variant display (#1869)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-08-10 10:09:46 +02:00
Adrián Panella
cc15aaacbb RFC: status_led: allow to share single light (#1974)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-08-10 09:55:34 +02:00
Oxan van Leeuwen
553df1d57b Don't mark COLOR_* constants as static in header (#2141) 2021-08-10 09:53:48 +02:00
Tom Matheussen
b92311402a Adds CGPR1 - Qingping Motion & Ambient light sensor support (#1675)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-08-10 17:06:04 +12:00
Jesse Hills
93796491af Allow entities to be disabled by default in HA (#2113)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-08-10 13:45:31 +12:00
Oxan van Leeuwen
c038cf27a7 Don't discard cold/warm white brightness in constant brightness mode (#2136) 2021-08-10 13:30:29 +12:00
Otto Winter
1f42d32eb5 Fix some issues with deprecated argv syntax detection (#2127) 2021-08-10 13:27:21 +12:00
Adrián Panella
06bde559da Add Dish Network protocol (#2117)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-08-10 13:26:42 +12:00
Keith Burzinski
922f7167f5 Add new Toshiba AC unit protocol (#1987) 2021-08-10 13:25:11 +12:00
Keith Burzinski
90c0d3e12f Add Toshiba AC generic IR remote protocol (#2019) 2021-08-10 13:21:10 +12:00
Oxan van Leeuwen
bf5f846fc6 Refactor clang-tidy script to use actual compiler flags and includes (#2133)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-08-09 22:43:18 +02:00
Oxan van Leeuwen
926bcc71ae Only compile protobuf dumping when very verbose logging is enabled (#2139) 2021-08-09 22:32:06 +02:00
Jesse Hills
ea4a458214 Removed unused arguments from rgbww code (#2137) 2021-08-09 16:44:52 +12:00
Jesse Hills
b3ae3e1feb Tidy HA addon (#1937) 2021-08-09 10:30:19 +12:00
buxtronix
fe7af21c91 Anova fahrenheit support (#2126)
Co-authored-by: Ben Buxton <bb@cactii.net>
2021-08-09 08:05:36 +12:00
Sourabh Jaiswal
29f72037fe Added support for Hitachi AC424 remote type (#2101) 2021-08-08 10:59:52 -03:00
Oxan van Leeuwen
1d6b4bfcef Don't stop effects if brightness goes to zero (#2134) 2021-08-07 23:24:47 +12:00
Stefan Agner
5bfac5ec09 Allow multiple unnamed libraries (#2132) 2021-08-07 23:16:34 +12:00
Oxan van Leeuwen
dfffaace26 Drop legacy esphomeyaml command wrapper code (#2130) 2021-08-07 23:15:32 +12:00
Oxan van Leeuwen
1d5f628c7a Add support for ESP8266 Arduino v3.0.1 (#2128) 2021-08-07 23:14:57 +12:00
Jesse Hills
cb8a6f66fa Add state classes to pvvx_mithermometer (#2125) 2021-08-05 12:05:36 +12:00
Oxan van Leeuwen
cb21c7c18d Fix crash when using addressable_set with out-of-range indices (#2120) 2021-08-05 11:30:32 +12:00
Oxan van Leeuwen
0d104776bc Various follow-up fixes to color mode changes (#2118) 2021-08-05 11:28:39 +12:00
Otto Winter
5f27757039 Merge pull request #2123 from esphome/bump-1.20.4
1.20.4
2021-08-04 17:54:53 +02:00
Otto winter
532907219b Bump version to v1.20.4 2021-08-04 17:46:10 +02:00
Otto Winter
eeaba74553 Fix external components not refreshing with default or high refresh time (#2122) 2021-08-04 17:46:10 +02:00
brambo123
dd637582a4 Fix time.on_time triggering if time jumped back (#1806)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-08-04 17:46:10 +02:00
Carlos Garcia Saura
b0d12aeea1 [duty_cycle] initialize two missing variables (#2088) 2021-08-04 17:46:09 +02:00
Łukasz Śliwiński
bdbd813455 Use proper schema for the analog pin shorthand (#2103)
The wrong error message is displayed like:
> GPIO17 (TOUT) is an analog-only pin on the ESP8266.
in case of the analog pin validation because the method `shorthand_analog_pin` uses wrong `GPIO_FULL_INPUT_PIN_SCHEMA` instead of `GPIO_FULL_ANALOG_PIN_SCHEMA`.
2021-08-04 17:46:09 +02:00
Paul Monigatti
a6fac2b175 Fix min/max keys in MQTT Number to match Home Assistant (#2102) 2021-08-04 17:46:09 +02:00
Guillermo Ruffino
5ce923ea90 fix diplay trigger missing base class (#2099) 2021-08-04 17:46:08 +02:00
Otto Winter
29f0508dc2 Fix PID climate breaks when restoring old modes (#2086) 2021-08-04 17:46:08 +02:00
Otto Winter
3ffa59f0cd Fix climate restore schema changed resulting in invalid restore (#2068)
Co-authored-by: Stefan Agner <stefan@agner.ch>
2021-08-04 17:46:08 +02:00
WeekendWarrior1
790d6ef94c Move configure_rmt() into setup() (#2028) 2021-08-04 17:46:08 +02:00
WeekendWarrior1
7828f48b9a Correctly invert esp32 RMT TX (#2022) 2021-08-04 17:46:07 +02:00
Otto Winter
768c71830b Fix external components not refreshing with default or high refresh time (#2122) 2021-08-04 17:33:17 +02:00
Oxan van Leeuwen
ceb0564ebf Fix mixup between ColorMode and ColorCapability (#2121) 2021-08-04 12:32:42 +12:00
Oxan van Leeuwen
20f7eb7327 Add version argument to ESPDEPRECATED macro (#2116) 2021-08-04 10:43:01 +12:00
Oxan van Leeuwen
441d5bd44d Migrate COLOR constants to Color class & disallow implicit conversions to Color (#2093)
Co-authored-by: Xo Wang <xo@geekshavefeelings.com>
2021-08-04 09:21:57 +12:00
brambo123
9fa19df2ff Fix time.on_time triggering if time jumped back (#1806)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-08-03 19:56:23 +02:00
Rob Gridley
39f64f597e Add SM16703 to supported FastLED chipsets (#1751)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-08-03 16:56:29 +02:00
Brett Profitt
160429eb24 Add support for Waveshare E-Paper 4.2" B V2 (#1610)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-08-03 16:41:53 +02:00
Andreas Hergert
6516c64e67 Add min_save_interval to total_energy/integration for memory wear (#1665)
Co-authored-by: Andreas Hergert <andreas.hergert@otrs.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-08-03 16:41:34 +02:00
dependabot[bot]
4c8a703084 Bump esptool from 2.8 to 3.1 (#1839)
Bumps [esptool](https://github.com/espressif/esptool) from 2.8 to 3.1.
- [Release notes](https://github.com/espressif/esptool/releases)
- [Commits](https://github.com/espressif/esptool/compare/v2.8...v3.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-08-03 08:49:45 +02:00
Keith Burzinski
335210d788 Thermostat enhancements and code clean-up (#2073) 2021-08-02 11:08:24 +02:00
Jesse Hills
9b04e657db Fix import (#2108) 2021-08-02 20:53:34 +12:00
Jesse Hills
f7311aa025 Dont force 0 state instead of min_power unless explicit config set (#2107) 2021-08-02 20:33:00 +12:00
John "Warthog9" Hawley
fb24e55c8d pmsx003: add standard particle, particle counts (#1694) 2021-08-02 10:32:08 +02:00
Carlos Garcia Saura
b58ca46a46 [duty_cycle] initialize two missing variables (#2088) 2021-08-02 10:28:25 +02:00
Jesse Hills
76991cdcc4 Add select entities and implement template select (#2067)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-08-02 20:00:51 +12:00
John K. Luebs
69c7cf783e Fix missing include in light_traits.h (#2105) 2021-08-02 07:13:46 +12:00
Otto Winter
f751c3828e Fix MQTT light include (#2104)
Fixes https://github.com/esphome/issues/issues/2285
2021-08-01 12:33:10 +02:00
Otto Winter
5c65f9f9ad Convert sensor_schema to use kwargs (#2094)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-08-01 12:21:32 +02:00
Eric Severance
81ae6709e4 Fix parity bit calculation for ESP8266SoftwareSerial (#1873) 2021-08-01 20:56:05 +12:00
Łukasz Śliwiński
593a3d48fb Use proper schema for the analog pin shorthand (#2103)
The wrong error message is displayed like:
> GPIO17 (TOUT) is an analog-only pin on the ESP8266.
in case of the analog pin validation because the method `shorthand_analog_pin` uses wrong `GPIO_FULL_INPUT_PIN_SCHEMA` instead of `GPIO_FULL_ANALOG_PIN_SCHEMA`.
2021-08-01 00:37:48 +12:00
Paul Monigatti
a8b90283d8 Fix min/max keys in MQTT Number to match Home Assistant (#2102) 2021-07-31 23:20:10 +12:00
Guillermo Ruffino
80076f935d fix diplay trigger missing base class (#2099) 2021-07-30 16:55:26 +12:00
Jesse Hills
9fbb3659a6 Merge pull request #2098 from esphome/bump-1.20.3
1.20.3
2021-07-30 15:46:22 +12:00
Jesse Hills
fee446c28a Bump version to v1.20.3 2021-07-30 11:00:10 +12:00
Jesse Hills
1d56f0b035 Set pulse meter total to use state class measurement and last reset type auto (#2097) 2021-07-30 11:00:10 +12:00
Otto Winter
34e8979d40 Convert more code to async-def syntax (#2095) 2021-07-30 10:54:10 +12:00
Jesse Hills
2966a62429 Set pulse meter total to use state class measurement and last reset type auto (#2097) 2021-07-30 10:53:33 +12:00
Oxan van Leeuwen
5983ccc55c Color mode implementation (#2012) 2021-07-29 19:11:56 +02:00
Kodey Converse
de382b704c Add device class support to MQTT cover (#2092) 2021-07-29 16:08:48 +02:00
Otto Winter
16dbbfabc6 Add demo integration (#2085) 2021-07-29 11:50:55 +02:00
Otto Winter
af8d04818d Pull ESP32 Wifi fixes from arduino-esp32 (#2069) 2021-07-29 11:44:19 +02:00
Mike Meessen
ee19ef1aac Add support for the HRXL MaxSonar WR series sensors (#2020) 2021-07-29 11:37:31 +02:00
Tyler Menezes
5e2d4e332a Add T6615 (#1170)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-07-29 11:24:36 +02:00
rnauber
c6c857dfff Add support for the TLC5947 24-Channel, 12-Bit PWM LED Driver (#2066)
Co-authored-by: Richard Nauber <richard@nauber.dev>
2021-07-29 11:16:04 +02:00
Nicholas Peters
8dbac20f8b Add SDP3x sensor (#2064)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-07-29 10:57:52 +02:00
Jesse Hills
341fddb9aa Merge pull request #2091 from esphome/bump-1.20.2
1.20.2
2021-07-29 20:42:05 +12:00
Jesse Hills
456824669f Bump version to v1.20.2 2021-07-29 19:51:17 +12:00
Jesse Hills
62f3039d82 Use sensor_schema for total_daily_energy (#2090)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-07-29 19:51:17 +12:00
Jesse Hills
be4c718859 HLW8012 - Dump energy sensor config (#2082) 2021-07-29 19:51:17 +12:00
Jesse Hills
c2f9ed7c59 Bump esphome dashboard to 20210728.0 (#2081) 2021-07-29 19:51:17 +12:00
John K. Luebs
bfac6607d1 More Tuya MCU robustness (#2080) 2021-07-29 19:51:17 +12:00
Jesse Hills
513066ba52 Use sensor_schema for total_daily_energy (#2090)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-07-29 19:46:15 +12:00
Jesse Hills
316777f757 HLW8012 - Dump energy sensor config (#2082) 2021-07-29 07:53:54 +12:00
Stefan Agner
246950159d Bump ESPAsyncWebServer-esphome to 1.3.0 (#2075) 2021-07-28 21:24:10 +02:00
Otto Winter
31d6a54b06 Fix PID climate breaks when restoring old modes (#2086) 2021-07-28 21:23:41 +02:00
dependabot[bot]
5c3a6164bb Bump pylint from 2.9.5 to 2.9.6 (#2087) 2021-07-28 21:23:24 +02:00
Oxan van Leeuwen
1652914d39 Make light.addressable_set color parameters behave as documented & consistent with elsewhere (#2009) 2021-07-28 19:49:43 +02:00
Otto Winter
618cfd9ec5 Add sensor monetary device_class (#2083) 2021-07-28 15:34:18 +02:00
Peter van Dijk
f97cfe9916 pm1006: add rx-only support (#2038) 2021-07-28 10:41:21 +02:00
Jesse Hills
b9259a0238 Bump esphome dashboard to 20210728.0 (#2081) 2021-07-28 15:18:31 +12:00
John K. Luebs
5abbe385c5 More Tuya MCU robustness (#2080) 2021-07-28 14:01:15 +12:00
Jesse Hills
e43dcded62 Merge pull request #2074 from esphome/bump-1.20.1
1.20.1
2021-07-27 11:00:48 +12:00
Jesse Hills
887081fd71 Bump version to v1.20.1 2021-07-27 09:43:05 +12:00
Otto Winter
71ded24fce Fix MQTT climate custom fan modes without regular ones (#2071) 2021-07-27 09:43:05 +12:00
Chris Nussbaum
1e2a9e8348 Couple more updates for the Tuya component (#2065)
Co-authored-by: Chris Nussbaum <chris.nussbaum@protolabs.com>
2021-07-27 09:43:05 +12:00
buxtronix
64a3aa7092 Log warning about lack of support for Anova nano (#2063)
Co-authored-by: Ben Buxton <bb@cactii.net>
2021-07-27 09:43:05 +12:00
carstenschroeder
fda8dd4ce3 Fixes new auto mode COOL and HEAT after #1994 (#2053) 2021-07-27 09:43:04 +12:00
Sergey V. DUDANOV
1efabd27d8 midea_ac: fix presets implementation (#2054) 2021-07-27 09:43:04 +12:00
Maurice Makaay
caa651e55b Accept change as proposed by black. (#2055) 2021-07-27 09:43:04 +12:00
Otto Winter
b0a3891498 Fix MQTT climate custom fan modes without regular ones (#2071) 2021-07-27 07:46:13 +12:00
Otto Winter
2a9e3d84fd Fix climate restore schema changed resulting in invalid restore (#2068)
Co-authored-by: Stefan Agner <stefan@agner.ch>
2021-07-26 15:19:50 +02:00
Oxan van Leeuwen
a3dcac62f9 Fix a bunch of typos (#2058)
Co-authored-by: Stefan Agner <stefan@agner.ch>
Co-authored-by: Otto Winter <otto@otto-winter.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-07-26 14:48:57 +02:00
Chris Nussbaum
6b535b11f8 Couple more updates for the Tuya component (#2065)
Co-authored-by: Chris Nussbaum <chris.nussbaum@protolabs.com>
2021-07-26 21:39:03 +12:00
Stefan Agner
d9f09a7523 Initial ESP32-C3-DevKitM-1 board support (#2062)
Co-authored-by: Stijn Tintel <stijn@linux-ipv6.be>
2021-07-26 11:10:56 +02:00
Stefan Agner
159744e09e Support library override using named library with repository (#2056) 2021-07-26 10:50:45 +02:00
Stefan Agner
c2637a76f7 Print BLE 128-bit UUIDs according to spec (#2061)
Since the iterator integer counts the bytes backwards we need to
use the complement to 15.
2021-07-26 10:49:38 +02:00
buxtronix
237edd75d1 Log warning about lack of support for Anova nano (#2063)
Co-authored-by: Ben Buxton <bb@cactii.net>
2021-07-26 10:41:54 +02:00
WeekendWarrior1
a34d5e3901 Move configure_rmt() into setup() (#2028) 2021-07-26 09:32:08 +02:00
WeekendWarrior1
1dd43a75f2 Correctly invert esp32 RMT TX (#2022) 2021-07-26 09:20:02 +02:00
Trevor North
1f5cbca509 Merge build flags from platformio_options (#1651) 2021-07-26 08:59:18 +02:00
Oxan van Leeuwen
3749c11f21 Fix clang-format script behaviour without -i + code cleanup (#2002)
Co-authored-by: Stefan Agner <stefan@agner.ch>
2021-07-26 09:54:32 +12:00
Stefan Agner
66cdb761dc Fix minor build issues with Arduino ESP32 2.0.0-rc1 (#2057) 2021-07-24 21:55:25 +12:00
Stefan Agner
f0d9ad6a4e Add TAG to all compile units (#2060)
When using static TAG is only valid in the current compile unit. For
some reason it seems that the current ESP8266/ESP32 compiler use the
instance from ble.cpp, but it seems that this causes issues with newer
compiler leading to compile time errors like this:
In file included from /root/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal-log.h:164,
                 from /root/.platformio/packages/framework-arduinoespressif32/cores/esp32/esp32-hal.h:71,
                 from /root/.platformio/packages/framework-arduinoespressif32/cores/esp32/Arduino.h:36,
                 from src/esphome/core/esphal.h:3,
                 from src/esphome/core/helpers.h:10,
                 from src/esphome/components/esp32_ble/ble_uuid.h:3,
                 from src/esphome/components/esp32_ble/ble_advertising.cpp:5:
src/esphome/components/esp32_ble/ble_advertising.cpp: In member function 'void esphome::esp32_ble::BLEAdvertising::start()':
src/esphome/components/esp32_ble/ble_advertising.cpp:64:14: error: 'TAG' was not declared in this scope
     ESP_LOGE(TAG, "esp_ble_gap_config_adv_data failed (Advertising): %d", err);
              ^~~
2021-07-24 03:53:59 +12:00
carstenschroeder
03e317d052 Fixes new auto mode COOL and HEAT after #1994 (#2053) 2021-07-22 14:39:57 +02:00
Sergey V. DUDANOV
ba461e51a8 midea_ac: fix presets implementation (#2054) 2021-07-22 14:39:21 +02:00
Maurice Makaay
80949521b6 Accept change as proposed by black. (#2055) 2021-07-22 14:37:42 +02:00
Sourabh Jaiswal
acbb8e9fd0 Added support for Selec Energy Meter (#1993)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-07-22 15:31:28 +12:00
Pasi Suominen
90394a50df Added support for pvvx_mithermometer sensor (#1546)
Co-authored-by: Pasi Suominen <pasiz@pasizdesk.pasiz.net>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-07-22 15:21:08 +12:00
Jesse Hills
5379794f16 Add test5 back to CI (#2052) 2021-07-22 13:24:01 +12:00
Keith Burzinski
0a32321c85 Thermostat fixes+updates 1 (#2032)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-07-22 09:09:31 +12:00
dependabot[bot]
c9062599df Bump pylint from 2.9.4 to 2.9.5 (#2050)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.9.4 to 2.9.5.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.9.4...v2.9.5)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-22 08:58:41 +12:00
Jesse Hills
10a6e9b4ee Merge pull request #2051 from esphome/bump-1.20.0
1.20.0
2021-07-22 08:32:30 +12:00
Jesse Hills
4b8ec44262 Bump version to v1.20.0 2021-07-22 07:55:49 +12:00
Jesse Hills
bd74ed4bc0 Merge branch 'beta' into bump-1.20.0 2021-07-22 07:55:49 +12:00
dependabot[bot]
fc42f14448 Bump pylint from 2.8.2 to 2.9.4 (#2047)
* Bump pylint from 2.8.2 to 2.9.4

Bumps [pylint](https://github.com/PyCQA/pylint) from 2.8.2 to 2.9.4.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/main/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/v2.8.2...v2.9.4)

---
updated-dependencies:
- dependency-name: pylint
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

* Fix up functionality needed for latest pylint (#2049)

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Sean Vig <sean.v.775@gmail.com>
2021-07-21 14:40:09 +12:00
Jesse Hills
d01f296420 Merge pull request #2048 from esphome/bump-1.20.0b6
1.20.0b6
2021-07-21 11:35:27 +12:00
Jesse Hills
27112e2ace Bump version to v1.20.0b6 2021-07-21 10:52:48 +12:00
Sean Vig
837930234f Remove superfluous polling on ADS1115 (#2015) 2021-07-21 10:52:48 +12:00
Jesse Hills
e19aa3bbe0 Adding last_reset_type to sensors that should support it. (#2039) 2021-07-21 10:52:48 +12:00
Oxan van Leeuwen
35b5c1ed56 Fix white value transition for addressable lights (#2045) 2021-07-21 10:52:48 +12:00
Sean Vig
3e65e6c69a Remove superfluous polling on ADS1115 (#2015) 2021-07-21 09:35:45 +12:00
Jesse Hills
3b3297d269 Adding last_reset_type to sensors that should support it. (#2039) 2021-07-21 09:20:20 +12:00
Oxan van Leeuwen
fc0deb642a Fix white value transition for addressable lights (#2045) 2021-07-21 08:42:03 +12:00
Stefan Agner
9f2b2f51ff Esp32 c3 support (#2035) 2021-07-20 11:12:22 +02:00
Jesse Hills
c9d93ff685 Merge pull request #2044 from esphome/bump-1.20.0b5
1.20.0b5
2021-07-20 17:27:53 +12:00
Jesse Hills
fa72990a63 Bump version to v1.20.0b5 2021-07-20 17:09:58 +12:00
Otto Winter
e5afb1c4ea ESP32 ADC use esp-idf (#2024)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-07-20 17:09:57 +12:00
Sean Vig
73ead5f328 Correct ADS1115 handling of multiple sensors in continuous mode (#2016)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-07-20 17:09:57 +12:00
Paulus Schoutsen
5c57b51378 Bump dashboard to 20210719.0 (#2043) 2021-07-20 17:09:57 +12:00
Sergey V. DUDANOV
e25935ef21 midea_ac: Fix turbo mode. Preset BOOST. (#2029) 2021-07-20 17:09:57 +12:00
Jesse Hills
c7a52c3894 Add restore_value to template number (#2041) 2021-07-20 17:09:57 +12:00
Otto Winter
01a4b4e82f ESP32 ADC use esp-idf (#2024)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-07-20 17:05:56 +12:00
Sean Vig
766866197b Correct ADS1115 handling of multiple sensors in continuous mode (#2016)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-07-20 17:05:25 +12:00
Paulus Schoutsen
9b5a3cbcd3 Bump dashboard to 20210719.0 (#2043) 2021-07-19 21:44:39 -07:00
Sergey V. DUDANOV
d2ed3b9bec midea_ac: Fix turbo mode. Preset BOOST. (#2029) 2021-07-20 16:26:07 +12:00
Jesse Hills
99d2db42cd Add restore_value to template number (#2041) 2021-07-20 15:40:42 +12:00
Jesse Hills
7619507e6c Convert Arduino boolean to bool (#2042) 2021-07-20 15:31:54 +12:00
Jesse Hills
53a4689ed1 Merge pull request #2040 from esphome/bump-1.20.0b4
1.20.0b4
2021-07-20 12:29:15 +12:00
Jesse Hills
0a82e6e792 Bump version to v1.20.0b4 2021-07-20 10:28:23 +12:00
Jesse Hills
98855e4123 Number and Template Number updates (#2036)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-07-20 10:28:22 +12:00
Jesse Hills
71d9d64a02 Number and Template Number updates (#2036)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-07-20 08:22:49 +12:00
Jesse Hills
6a09d7c49b Merge pull request #2034 from esphome/bump-1.20.0b3
1.20.0b3
2021-07-19 08:44:04 +12:00
Jesse Hills
46e50ba53f Bump version to v1.20.0b3 2021-07-19 08:28:58 +12:00
Otto Winter
f1e3ff2ed2 Improve external components error messages (#2026) 2021-07-19 08:28:58 +12:00
Otto Winter
7787fa8f29 Dashboard disable assets caching (#2025) 2021-07-19 08:28:58 +12:00
Otto Winter
70902029f8 GH Actions CI use GHCR (#2027) 2021-07-19 08:28:58 +12:00
Otto Winter
4f9a56c884 Refactor docker build system and workflows (#2023) 2021-07-19 08:28:53 +12:00
Sean Vig
3715ba030b Fix ethernet component hostname handling (#2010)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-07-19 08:25:08 +12:00
dependabot[bot]
2e49fd7b48 Bump black from 21.6b0 to 21.7b0 (#2031)
Bumps [black](https://github.com/psf/black) from 21.6b0 to 21.7b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

---
updated-dependencies:
- dependency-name: black
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-19 08:09:00 +12:00
Otto Winter
06912b492f Improve external components error messages (#2026) 2021-07-16 10:23:08 +02:00
Otto Winter
442e58b07a Dashboard disable assets caching (#2025) 2021-07-16 10:22:42 +02:00
Otto Winter
799f04efc0 GH Actions CI use GHCR (#2027) 2021-07-15 21:51:52 +02:00
Otto Winter
cc7dbeada6 Refactor docker build system and workflows (#2023) 2021-07-15 21:30:04 +02:00
Sean Vig
45d368e3a1 Always tick mdns in ethernet component (#2018) 2021-07-15 16:12:48 +12:00
Sean Vig
628a94bad3 Fix ethernet component hostname handling (#2010)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-07-15 15:45:41 +12:00
Jesse Hills
0c93be97a9 Merge pull request #2017 from esphome/bump-1.20.0b2
1.20.0b2
2021-07-15 14:59:08 +12:00
Jesse Hills
54eb6070fb Bump version to v1.20.0b2 2021-07-15 13:55:58 +12:00
SenexCrenshaw
4dbf1c521e Nextion upload and sensors (#1464)
Co-authored-by: Senex Crenshaw <senexcrenshaw@gmail.com>
2021-07-15 13:55:58 +12:00
SenexCrenshaw
0651716b96 Nextion upload and sensors (#1464)
Co-authored-by: Senex Crenshaw <senexcrenshaw@gmail.com>
2021-07-15 12:51:15 +12:00
Jesse Hills
f30b8f6b3c Merge pull request #2014 from esphome/bump-1.20.0b1
1.20.0b1
2021-07-15 08:17:04 +12:00
Jesse Hills
0992609bf4 Bump version to v1.21.0-dev 2021-07-15 07:45:05 +12:00
Jesse Hills
18c08f24ad Bump version to v1.20.0b1 2021-07-15 07:45:05 +12:00
Jesse Hills
a7f53aea0e Merge branch 'dev' into bump-1.20.0b1 2021-07-15 07:45:05 +12:00
St4n
c399905675 [Teleinfo] do not stop parsing frame if there is only a CRC error (#1999)
Co-authored-by: Stephane Angot <s.angot@meetic-corp.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-07-14 21:21:39 +12:00
Stefan Agner
5cb0c11feb Introduce clamp as a template function (#1953) 2021-07-14 17:08:18 +12:00
WeekendWarrior1
08b67e7aea catch 0.0 in float set_level pre-adjustment (#2013) 2021-07-14 14:43:30 +12:00
Jesse Hills
07ae8ec553 Remove a whole bunch of deprecated/removed stuff (#1981) 2021-07-14 14:42:16 +12:00
Sourabh Jaiswal
04c3a43c17 Added support for havells_solar sensor (#1988)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-07-14 13:05:51 +12:00
dependabot[bot]
b632344596 Bump black from 21.5b1 to 21.6b0 (#2011)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-13 11:39:04 +02:00
Oxan van Leeuwen
fb8ec79a52 Color brightness fixes (#2008) 2021-07-13 12:28:29 +12:00
Huub Eikens
7dd16df846 Sgp30 sensor improvements (#1510)
Co-authored-by: Umberto73 <huub@eikens.com>
Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2021-07-13 09:21:54 +12:00
Otto Winter
551e9c6111 Bang bang climate new mode meanings (#1996) 2021-07-12 22:56:55 +02:00
Mikko Tervala
cc9f0b3f47 Add support for IBS-TH1 External Sensor (#1983) 2021-07-13 08:55:53 +12:00
monkeyclass
d77c3abdc0 Fixed lolin32 lite key (#2001)
Co-authored-by: monkeyclass <oliver_reinholdt@hotmail.com>
2021-07-13 07:37:34 +12:00
Jesse Hills
dd37a4e04c Add Number entities (from Home Assistant) (#1971)
Co-authored-by: Oxan van Leeuwen <oxan@oxanvanleeuwen.nl>
2021-07-13 07:20:12 +12:00
Oxan van Leeuwen
1f5c79bd17 Fix deprecation message for old climate swing mode methods (#2003) 2021-07-11 16:51:24 +12:00
Maurice Makaay
623570a117 Add state callback to ota component (#1816)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2021-07-11 07:52:19 +12:00
carstenschroeder
cdbc146e5d Climate modes COOL and HEAT are auto modes (#1994) 2021-07-10 11:37:55 +02:00
Otto Winter
7ae611256a Improve climate mode code docs (#1995)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-07-10 11:23:04 +02:00
dependabot[bot]
b62c47fede Bump pytest-asyncio from 0.14.0 to 0.15.1 (#1793)
Bumps [pytest-asyncio](https://github.com/pytest-dev/pytest-asyncio) from 0.14.0 to 0.15.1.
- [Release notes](https://github.com/pytest-dev/pytest-asyncio/releases)
- [Commits](https://github.com/pytest-dev/pytest-asyncio/compare/v0.14.0...v0.15.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-09 23:28:37 +02:00
dependabot[bot]
99f497c3b8 Bump pytest-cov from 2.11.1 to 2.12.1 (#1855)
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.11.1 to 2.12.1.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.11.1...v2.12.1)

---
updated-dependencies:
- dependency-name: pytest-cov
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-09 23:28:28 +02:00
dependabot[bot]
4f88c2489b Bump protobuf from 3.17.0 to 3.17.3 (#1986)
Bumps [protobuf](https://github.com/protocolbuffers/protobuf) from 3.17.0 to 3.17.3.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/master/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.17.0...v3.17.3)

---
updated-dependencies:
- dependency-name: protobuf
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-09 23:27:08 +02:00
Michael Gorven
294ba1fca7 Support custom fan modes in mqtt_climate (#1989)
Co-authored-by: Michael Gorven <michael@gorven.za.net>
2021-07-09 23:25:27 +02:00
Jesse Hills
be61b38a2c Allow WiFi AP to use device name (#1990) 2021-07-09 00:39:37 +12:00
Oxan van Leeuwen
f9797825ad Change color model to fix white channel issues (#1895) 2021-07-08 21:37:47 +12:00
Oxan van Leeuwen
fd4b7d4588 Don't try compat parsing for "esphome version" (#1966) 2021-07-06 10:17:36 +12:00
Jesse Hills
062cedc200 remote_receiver: use config parent receiver for registering dumpers (#1980) 2021-07-06 10:15:29 +12:00
WeekendWarrior1
79b9d0579d Add stepper.set_acceleration and stepper.set_deceleration to stepper component (#1977) 2021-07-05 13:22:43 +12:00
buxtronix
ab31117bf3 Anova ble component (#1752)
Co-authored-by: Ben Buxton <bb@cactii.net>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-07-05 11:59:12 +12:00
Adrián Panella
d31040f5d8 hlw8012: fix constants for BL0937 (#1973)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-07-05 11:09:09 +12:00
dependabot[bot]
52d19fa43d Bump pytest-mock from 3.5.1 to 3.6.1 (#1754)
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.5.1 to 3.6.1.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.5.1...v3.6.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-07-05 10:27:13 +12:00
Martin Weinelt
8ca34f7098 Bump hypothesis from 5.21.0 to 5.49.0 (#1753) 2021-07-05 10:10:59 +12:00
Oxan van Leeuwen
4c4099966a Fix invalid escape sequences in regex (#1814) 2021-07-05 10:04:18 +12:00
Paul Doidge
86ac7f3a59 Time Based Cover: Fixed apparent race condition on ESP32 chips (#1984) 2021-07-05 07:39:18 +12:00
Trevor North
9e400a7857 Fix tuya fan speed send (#1978) 2021-07-04 23:47:22 +12:00
Otto Winter
d5278351da Rename master branch to release (#1976) 2021-07-02 15:42:36 +02:00
definitio
36861595f1 Add device_class support for MQTT integration (#1832) 2021-07-01 15:36:01 +02:00
Frederik Gladhorn
d604321f37 Simplify initializing glyph_data (#1970)
Make it easier to read the initialization with zeros, no loop required.
2021-06-30 20:36:48 +02:00
bazuchan
964ab65497 Climate component for Ballu air conditioners with remote model YKR-K/002E (#1939) 2021-06-28 16:26:30 -03:00
Jesse Hills
3b940b1c04 Set is_valid to true straight away when min_length is 0 (#1960) 2021-06-25 07:09:07 +12:00
Jesse Hills
a91e6a6bdf Merge pull request #1959 from esphome/bump-1.19.4
1.19.4
2021-06-24 13:31:01 +12:00
Jesse Hills
8600620305 Bump version to v1.19.4 2021-06-24 12:49:45 +12:00
Jesse Hills
96721f305f Bump dashboard to 20210623.0 (#1958) 2021-06-24 12:49:45 +12:00
Otto Winter
2bf70d7d00 Compat argv parsing improvements (#1952) 2021-06-24 12:49:45 +12:00
Otto Winter
1d8c170f48 Add climate preset NONE again (#1951) 2021-06-24 12:49:45 +12:00
Otto Winter
6009c7edb4 Disallow power_save_mode NONE if used together with BLE (#1950) 2021-06-24 12:49:44 +12:00
Otto Winter
e3f36c033e API raise minor version for climate changes (#1947) 2021-06-24 12:49:44 +12:00
Otto Winter
d4eb0f1655 Rework climate traits (#1941)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-24 12:49:36 +12:00
Jesse Hills
5fca480921 Bump dashboard to 20210623.0 (#1958) 2021-06-24 12:38:59 +12:00
Oxan van Leeuwen
7051f897bc Validate color temperature values for RGBWW/CWWW lights (#1957)
Check if the color temperature of the cold white channel is colder (less) than
the warm white channel.
2021-06-24 00:07:27 +02:00
Otto Winter
2cb3015a28 Compat argv parsing improvements (#1952) 2021-06-23 20:27:08 +02:00
Otto Winter
d0859a7d33 Add climate preset NONE again (#1951) 2021-06-23 20:25:19 +02:00
Jesse Hills
e20ec00071 Merge pull request #1956 from esphome/bump-1.19.3
1.19.3
2021-06-23 20:16:42 +12:00
Jesse Hills
150114d774 Bump version to v1.19.3 2021-06-23 19:39:37 +12:00
Jesse Hills
89dfa5ea82 Bump esphome-dashboard to 20210622.0 (#1955) 2021-06-23 19:39:31 +12:00
Jesse Hills
61ebc629f6 Bump esphome-dashboard to 20210622.0 (#1955) 2021-06-22 22:15:11 -07:00
Stefan Agner
32f2da77f8 More VSCode devcontainer improvements (#1934) 2021-06-22 16:37:05 +02:00
Otto Winter
bfca3f242a Disallow power_save_mode NONE if used together with BLE (#1950) 2021-06-22 10:53:10 +02:00
Stefan Agner
3dfff2930a Improve DHT read timings (#1901)
Make sure that the initial rising edge is properly detected even if
timing is somewhat off.

Set MCU start signal to 1ms for AM2302.
2021-06-22 10:07:14 +02:00
Paulus Schoutsen
027e0de48e Bump dashboard to 20210621.0 (#1946) 2021-06-22 16:17:46 +12:00
Otto Winter
c811141a4f API raise minor version for climate changes (#1947) 2021-06-21 22:02:18 +02:00
Otto Winter
871c0ee2a5 Rework climate traits (#1941)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-21 21:17:01 +02:00
Jesse Hills
b8a7741c61 Update generation script to add const (#1945) 2021-06-21 21:27:35 +12:00
Jesse Hills
97aa930ad2 Merge pull request #1943 from esphome/bump-1.19.2
1.19.2
2021-06-21 14:59:11 +12:00
Jesse Hills
2a5def10e7 Bump version to v1.19.2 2021-06-21 14:40:05 +12:00
Jesse Hills
969834e037 Fix bad climate control enum (#1942) 2021-06-21 14:40:05 +12:00
Jesse Hills
d73a44c504 Allow wifi setup to proceed when there is no sta or ap (#1931) 2021-06-21 14:40:05 +12:00
Sergey V. DUDANOV
8aec092ab6 Fix midea_ac query frame (#1940) 2021-06-21 14:40:05 +12:00
Chris Nussbaum
4fa959ba45 Don't send Tuya commands while currently receiving a message (#1886)
Co-authored-by: Chris Nussbaum <chris.nussbaum@protolabs.com>
2021-06-21 14:40:05 +12:00
Jesse Hills
b6011b9353 Fix bad climate control enum (#1942) 2021-06-21 14:17:38 +12:00
Jesse Hills
40a5005d94 Allow wifi setup to proceed when there is no sta or ap (#1931) 2021-06-21 09:00:16 +12:00
Sergey V. DUDANOV
c5eba21ff6 Fix midea_ac query frame (#1940) 2021-06-21 08:59:12 +12:00
Jesse Hills
4891cfef56 Add data sizes to tuya log message (#1938) 2021-06-18 15:50:56 +12:00
Chris Nussbaum
4395664547 Don't send Tuya commands while currently receiving a message (#1886)
Co-authored-by: Chris Nussbaum <chris.nussbaum@protolabs.com>
2021-06-18 14:58:39 +12:00
Keith Burzinski
04d926af39 Add variable bit width for Samsung protocol (#1927) 2021-06-18 13:54:46 +12:00
Stefan Agner
f9a31c1abb Fix error print in script/helpers.py (#1935) 2021-06-18 13:49:25 +12:00
Jesse Hills
b43712d78d Merge pull request #1936 from esphome/bump-1.19.1
1.19.1
2021-06-18 12:10:30 +12:00
Jesse Hills
01904a0f10 Bump version to v1.19.1 2021-06-18 11:52:02 +12:00
Jesse Hills
dd875e7529 Replace CLIMATE_MODE_AUTO with CLIMATE_MODE_HEAT_COOL in most cases (#1933) 2021-06-18 11:52:02 +12:00
Otto Winter
f1dcf0f0b8 Improve config final validation (#1917) 2021-06-18 11:52:02 +12:00
Sergey V. DUDANOV
a045d001bf Fix: midea_ac: fixed query status frame (#1922) 2021-06-18 11:52:01 +12:00
Paulus Schoutsen
066c1022d0 Update dashboard to 20210617.0 (#1930) 2021-06-18 11:52:01 +12:00
Jesse Hills
dca1c0f160 Replace CLIMATE_MODE_AUTO with CLIMATE_MODE_HEAT_COOL in most cases (#1933) 2021-06-18 11:48:40 +12:00
Otto Winter
2419bc3678 Improve config final validation (#1917) 2021-06-18 07:54:14 +12:00
Sergey V. DUDANOV
c19b3ecd43 Fix: midea_ac: fixed query status frame (#1922) 2021-06-18 07:39:13 +12:00
Paulus Schoutsen
ef1e91d838 Update dashboard to 20210617.0 (#1930) 2021-06-18 07:35:54 +12:00
Barry Loong
e5929225eb Fix typo in test3.yaml (#1928) 2021-06-17 21:39:59 +12:00
Jesse Hills
59c192becc Merge pull request #1923 from esphome/bump-1.19.0
1.19.0
2021-06-17 06:09:09 +12:00
Jesse Hills
a800816750 Merge branch 'beta' into bump-1.19.0 2021-06-17 05:59:02 +12:00
Jesse Hills
99d9ab4e40 Merge pull request #1926 from esphome/bump-1.19.0b7
1.19.0b7
2021-06-17 05:55:09 +12:00
Jesse Hills
f310ca1b74 Bump version to v1.19.0b7 2021-06-17 05:40:55 +12:00
Franck Nijhof
f763daa577 Fix update-all from dashboard (#1924) 2021-06-17 05:40:55 +12:00
Franck Nijhof
607c3ae651 Fix update-all from dashboard (#1924) 2021-06-17 05:39:04 +12:00
Jesse Hills
970563e07b Bump version to v1.19.0 2021-06-16 21:00:51 +12:00
Jesse Hills
e006045f59 Merge pull request #1921 from esphome/bump-1.19.0b6
1.19.0b6
2021-06-16 15:42:43 +12:00
Jesse Hills
fff3645901 Bump version to v1.19.0b6 2021-06-16 13:51:31 +12:00
Jesse Hills
a5383fd208 Shorten the ble name to prevent crash with long device names (#1920) 2021-06-16 13:51:31 +12:00
Jesse Hills
5591832b50 Shorten the ble name to prevent crash with long device names (#1920) 2021-06-16 13:49:06 +12:00
Jesse Hills
9ce3a2059f Merge pull request #1919 from esphome/bump-1.19.0b5
1.19.0b5
2021-06-16 09:45:10 +12:00
Jesse Hills
69e6cf2c0c Bump version to v1.19.0b5 2021-06-16 09:06:50 +12:00
Paulus Schoutsen
28635124f9 Bump dashboard to 20210615.0 (#1918) 2021-06-16 09:06:50 +12:00
Paulus Schoutsen
25b116048c Bump dashboard to 20210615.0 (#1918) 2021-06-16 09:04:17 +12:00
Jesse Hills
035be87a83 Merge pull request #1914 from esphome/bump-1.19.0b4
1.19.0b4
2021-06-15 20:47:38 +12:00
Jesse Hills
e8bdbc45a9 Bump version to v1.19.0b4 2021-06-15 20:26:53 +12:00
Guillermo Ruffino
429caccefa fixes compatibility with esphome cfg vscode (#1911) 2021-06-15 20:26:53 +12:00
Paulus Schoutsen
744ca1af7c Bump frontend to 20210614.0 (#1912) 2021-06-15 20:26:52 +12:00
Jesse Hills
106f0d611f Validate that either networks, ap, or improv is set up (#1910) 2021-06-15 20:26:52 +12:00
Jesse Hills
d826416684 Allow no networks or AP to be set. (#1908)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-06-15 20:26:52 +12:00
Guillermo Ruffino
24ba9eba46 fixes compatibility with esphome cfg vscode (#1911) 2021-06-15 20:20:24 +12:00
Otto Winter
424c34225f Run script/setup in devcontainer instead of pip install (#1913) 2021-06-15 20:19:21 +12:00
Paulus Schoutsen
d781f3a11b Bump frontend to 20210614.0 (#1912) 2021-06-15 20:18:27 +12:00
Stefan Agner
a80f9ed336 Support ESP8266 Arduino 3.0.0 (#1897)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-06-15 08:50:58 +02:00
Otto Winter
92bbedfa5a Fix #1908 mutating input parameter 2021-06-15 08:48:18 +02:00
Jesse Hills
86710ed483 Validate that either networks, ap, or improv is set up (#1910) 2021-06-15 13:16:43 +12:00
Jesse Hills
da7eb9ac90 Allow no networks or AP to be set. (#1908)
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
2021-06-15 11:05:10 +12:00
dentra
c411043681 Adds support cpp to vscode (#1828)
Co-authored-by: Stefan Agner <stefan@agner.ch>
2021-06-15 10:45:22 +12:00
Oxan van Leeuwen
93f8ee7e60 Fix non-const global (#1907) 2021-06-15 09:12:06 +12:00
Oxan van Leeuwen
0efc1f06f2 Split files in light component (#1893) 2021-06-14 18:01:56 +02:00
Jesse Hills
81959804df Merge pull request #1900 from esphome/bump-1.19.0b3
1.19.0b3
2021-06-12 11:15:03 +12:00
Jesse Hills
75b524ddc4 Fix formatting from cherry-pick conflict 2021-06-12 11:07:58 +12:00
Jesse Hills
f599c36272 Bump version to v1.19.0b3 2021-06-12 11:03:09 +12:00
Paulus Schoutsen
9bb64315f3 Add new wizard + allow installing firmware over webserial (#1887) 2021-06-12 11:03:09 +12:00
Jesse Hills
575badc690 Move esp32_ble_server to its own component (#1898) 2021-06-12 11:02:59 +12:00
Jesse Hills
4b91cfb7f9 Ensure wifi is in at least station mode before starting improv (#1899) 2021-06-12 11:01:54 +12:00
Paulus Schoutsen
9ad9d64ac7 Add new wizard + allow installing firmware over webserial (#1887) 2021-06-12 10:49:05 +12:00
Jesse Hills
5a2cfa2798 Move esp32_ble_server to its own component (#1898) 2021-06-12 08:31:15 +12:00
Jesse Hills
eb24da7c82 Ensure wifi is in at least station mode before starting improv (#1899) 2021-06-11 23:28:00 +12:00
Oxan van Leeuwen
f93e261d75 Convert st7735.cpp to use Unix line separators (#1894) 2021-06-11 08:33:12 +12:00
Stefan Agner
501f88ca86 Avoid non-const globals and enable clang-tidy check (#1892) 2021-06-11 08:19:44 +12:00
Otto Winter
360effcb72 Activate some clang-tidy checks (#1884) 2021-06-10 13:04:40 +02:00
Otto Winter
eb9bd69405 Configure clang-format for consistent pointer alignment (#1890) 2021-06-10 12:55:20 +02:00
Jesse Hills
11b8210e36 Update ambiguous command (#1889) 2021-06-10 21:13:18 +12:00
Jesse Hills
a57a842f7b Merge pull request #1888 from esphome/bump-1.19.0b2
1.19.0b2
2021-06-10 17:50:38 +12:00
Jesse Hills
a8c253a2a5 Bump version to v1.19.0b2 2021-06-10 17:17:52 +12:00
Geoff Davis
8b737aabd9 Add support for waveshare_epaper 1.54v2 (#1843)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-10 17:17:52 +12:00
Jesse Hills
0db4815f3d BLE loop use (#1882) 2021-06-10 17:17:52 +12:00
Oxan van Leeuwen
139db58a66 Simplify LightCall validation (#1874) 2021-06-10 17:17:52 +12:00
Geoff Davis
d23376b81e Add support for waveshare_epaper 1.54v2 (#1843)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-10 14:05:27 +12:00
Jesse Hills
99d90845b5 BLE loop use (#1882) 2021-06-10 14:04:39 +12:00
Oxan van Leeuwen
ea0127e42b Simplify LightCall validation (#1874) 2021-06-09 17:01:05 +02:00
Jesse Hills
c32fec7432 Merge pull request #1883 from esphome/bump-1.19.0b1
1.19.0b1
2021-06-09 19:25:57 +12:00
Jesse Hills
8bd23dd457 Bump version to v1.19.0b1 2021-06-09 18:59:06 +12:00
Jesse Hills
97a12c0169 Bump version to v1.20.0-dev 2021-06-09 17:23:42 +12:00
René Klomp
635916737b Update total_pulses_ at every detected pulse (#1875) 2021-06-09 16:48:51 +12:00
Jesse Hills
65c50e4f01 Add platform and board to mdns response when API is used (#1871) 2021-06-09 14:23:48 +12:00
Jesse Hills
5cf18235e3 Allow setting creator project name and version into code (#1872) 2021-06-09 13:04:00 +12:00
Stefan Agner
b80f3fdec9 Fix Clang 11 finds (#1880) 2021-06-09 08:47:43 +12:00
Jesse Hills
0426be9280 Fixes for BLE/improv (#1878) 2021-06-09 08:45:51 +12:00
Otto Winter
7c678659d4 Remove explain changes section from PR template (#1876) 2021-06-08 22:23:23 +02:00
Stefan Agner
13fe9e83fa Use Clang 11 (#1846) 2021-06-08 22:16:17 +02:00
Otto Winter
4711f36a1f Bump base image to 3.4.0 (#1879) 2021-06-08 22:03:04 +02:00
Otto Winter
01e2a51132 Implement versioning for esphome/esphome-lint docker images (#1877) 2021-06-08 21:28:19 +02:00
Jesse Hills
a70a205ace Improv - BLE WiFi provisioning (#1807)
Co-authored-by: Paulus Schoutsen <balloob@gmail.com>
2021-06-08 11:56:21 +12:00
Oxan van Leeuwen
33625e2dd3 CLI user experience improvements (#1805)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-08 11:14:12 +12:00
Stefan Agner
0277218319 Bump Docker base version to 3.1.0 (#1864)
Bump Docker base version to 3.1.0 which includes Arduino SDK 1.0.6
for ESP32.
2021-06-08 07:02:31 +12:00
Stefan Agner
18a8c727fa Fix SCD30 configuration on ESP32 (#1830) 2021-06-05 20:56:54 +12:00
Stefan Agner
80ad784a4e Avoid unnecessary waits to stabilize the VOC algorithm (#1834) 2021-06-05 20:52:16 +12:00
Lumpusz
ebadaa9660 Add preset, custom_preset and custom_fan_mode support to climate (#1471)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-04 22:04:54 +12:00
Samuel Sieb
7bc51582f0 make crc16 function accessible (#1857) 2021-06-03 16:13:42 +12:00
Franck Nijhof
11fb54c74e Add support for Sensor state class (#1835)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-03 13:49:56 +12:00
Stefan Rado
913ac8b7e8 Support raw datapoints for tuya components (#1669) 2021-06-03 13:10:29 +12:00
foxsam21
2b9350ce76 Added vol +/- control to dfplayer (#1856)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-03 10:12:23 +12:00
André Klitzing
3b18f1b87f Use size_t for length parameter (#1799) 2021-06-03 10:11:41 +12:00
Trevor North
c5c24c1989 Tuya improvements (#1491)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-02 21:31:56 +12:00
Ryan Mounce
c3938d04f3 Support Tuya light color temperature control (#1412)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-02 09:32:16 +12:00
David Kiliani
f968713be8 Add optional lambda to BLESensor for raw data parsing (#1851)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-01 21:46:54 +12:00
Jesse Hills
7b11284008 Fix ble client esp_gatt_if comparison (#1852) 2021-06-01 21:12:41 +12:00
zaluthar
f39c0d52ee Added support for Xiaomi CGDK2 (#1451)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-01 20:26:38 +12:00
buxtronix
a3756a9600 Copy missing BLE client characteristic read data (#1818)
Co-authored-by: Ben Buxton <bb@cactii.net>
2021-06-01 19:56:05 +12:00
0hax
afa436fe8f teleinfo: use text_sensor and sensor. (#1403)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-06-01 13:32:09 +12:00
Roberto Wagner
48b5ea9e59 Update fingerprint count after enroll (#1811) 2021-06-01 12:22:09 +12:00
Maurice Makaay
56974153f1 I2c raw cmds with multiplexer (#1817)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-06-01 10:36:25 +12:00
Jesse Hills
9a2cd71571 Don't check uart settings for modbus (#1850) 2021-06-01 09:57:03 +12:00
Stefan Agner
d1c6368283 Use built-in validation for altitude (#1831)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-01 07:40:57 +12:00
Adrián Panella
5c3268b8d4 Rf Bridge: add bucket sniffing and beep functionality (#1819)
Co-authored-by: Otto winter <otto@otto-winter.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-06-01 07:24:22 +12:00
Oxan van Leeuwen
25af5ab7c6 Drop 128x160 ESP-32 camera resolution (#1813) 2021-05-31 22:27:41 +12:00
Andrew Zaborowski
4d586b1446 Add CS5460A power-meter component (#1474)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-31 16:07:33 +12:00
polyfaces
bb759d52c8 Add support for SDMXXX energy meters (#1260)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-31 16:05:49 +12:00
testbughub
9a2cf05c5f Added bottom segment to digit 9 (#1847) 2021-05-30 20:54:26 -03:00
Guillermo Ruffino
c79d700d03 Add validate to components (#1631)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-31 10:06:45 +12:00
Thomas Dietrich
482a3aebc9 Fix typo in wizard (#1836) 2021-05-28 13:34:54 +12:00
Guillermo Ruffino
387f249363 fix dallas pin validation (#1692) 2021-05-28 13:15:52 +12:00
Guillermo Ruffino
3d917d0b7e lambda condition should return (#1833) 2021-05-26 08:03:59 +12:00
Oxan van Leeuwen
824f3187ac Update platformio.ini settings and fix test apps (#1815)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-05-25 07:47:45 +12:00
Otto Winter
e3c27a483c Update sensor device classes from HA (#1825) 2021-05-24 21:45:51 +02:00
Otto Winter
a33bb32874 Convert components to async-def syntax (#1823)
* Convert components to async-def syntax

* Remove stray @coroutine

* Manual part

* Convert complexer components code to async-def

* Manual cleanup

* More manual cleanup
2021-05-24 21:45:31 +02:00
dependabot[bot]
93d9d4b50a Bump protobuf from 3.15.8 to 3.17.0 (#1776)
Bumps [protobuf](https://github.com/protocolbuffers/protobuf) from 3.15.8 to 3.17.0.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/master/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.15.8...v3.17.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-24 11:23:29 +02:00
Otto Winter
2376a2c941 Convert components to async-def syntax (#1821) 2021-05-24 10:58:29 +02:00
Otto Winter
b92702a312 Document considerations when changing recommended framework version (#1822) 2021-05-23 23:24:00 +02:00
Jim Bauwens
b11d5f6799 Allow segments in a light partition to be reversed (#1484)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-24 08:57:48 +12:00
Stanislav Meduna
072dce340e Add the on_page_change display trigger (#1687)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-24 08:56:04 +12:00
Trevor North
cccb1a2c9e BME680 BSEC: Allow sample rate overrides for T/P/H sensors (#1710) 2021-05-24 08:27:19 +12:00
Stanislav Meduna
063d9c47a4 Refactor font creation to save stack (#1707) 2021-05-24 08:24:54 +12:00
wifwucite
8d8d421286 allow default option for typed_schema (#1700)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-05-24 08:24:24 +12:00
Franck Nijhof
0ce57e5a39 Light & Switch Inverted Restore mode (#1810) 2021-05-24 08:20:11 +12:00
Otto Winter
aebad04c0b Convert core components to async-def coroutine syntax (#1658)
Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-23 22:10:30 +02:00
Anthony Uk
514d11d46f tm1637 - support 6 character displays (#1803) 2021-05-21 20:04:25 -03:00
Anthony Uk
96e46db272 Added fan triggers on_turn_on and on_turn_off (#1726) 2021-05-19 16:12:43 +12:00
Stefan Agner
76f78877f6 Use latest version of the NeoPixelBus-esphome library (#1701) 2021-05-19 14:55:49 +12:00
Jesse Hills
4ffa68b773 Merge branch 'master' into dev 2021-05-19 14:02:04 +12:00
Jesse Hills
8eaffee160 Merge pull request #1801 from esphome/bump-1.18.0
1.18.0
2021-05-19 12:59:13 +12:00
Jesse Hills
557a622f71 Bump version to v1.18.0 2021-05-19 11:43:47 +12:00
Jesse Hills
e9c6556296 Merge branch 'beta' into bump-1.18.0 2021-05-19 11:43:47 +12:00
André Klitzing
dce9d59dfe Do not use Serial2 for ESP32C3, too (#1798)
src/esphome/components/logger/logger.cpp: In member function 'void esphome::logger::Logger::pre_setup()':
src/esphome/components/logger/logger.cpp:142:29: error: 'Serial2' was not declared in this scope
         this->hw_serial_ = &Serial2;
2021-05-18 19:16:51 +12:00
romerod
d3e291b442 Add on_tag_removed trigger to pn532 (#1436)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-18 11:54:09 +12:00
Otto Winter
d4686c0fb1 Introduce new async-def coroutine syntax (#1657) 2021-05-17 17:14:15 +12:00
Jesse Hills
ae9b247f47 Merge pull request #1792 from esphome/bump-1.18.0b4
1.18.0b4
2021-05-17 14:44:49 +12:00
Jesse Hills
a59761d292 Bump version to v1.18.0b4 2021-05-17 13:53:35 +12:00
Jesse Hills
030c87d142 Allow RC522 components to have multiple configurations (#1782) 2021-05-17 13:53:35 +12:00
Jesse Hills
95ed3e9d46 Revert "Added bottom segment to digit 9 (#1787)" (#1791)
This reverts commit 9ecead2645.
2021-05-17 13:22:49 +12:00
Stanislav Meduna
d0eaebe19f Add support for the XPT2046 touchscreen controller (#1542) 2021-05-17 13:03:58 +12:00
testbughub
9ecead2645 Added bottom segment to digit 9 (#1787) 2021-05-17 11:38:49 +12:00
Stefan Agner
98166dfa66 Bump Arduino SDK for ESP32 to 1.0.6 (#1789)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-17 11:38:26 +12:00
Franck Nijhof
5645be4e0f Add attribute support to Home Assistant sensors (#1770)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-17 11:16:22 +12:00
Jesse Hills
9a7a205510 Generate protobuf code closer to formatted files (#1790) 2021-05-17 10:54:17 +12:00
Jesse Hills
7e3b8fd346 Allow RC522 components to have multiple configurations (#1782) 2021-05-15 17:02:52 +12:00
Guillermo Ruffino
3d6dcc9eee Add more json schema generation features (#1690)
* some enums

* extract enums, light effects remote_receiver etc

* more pins schema

* update to core changes
2021-05-14 20:35:39 -03:00
Jesse Hills
4f6982fbc5 Add action to set total pulses on pulse_meter (#1757) 2021-05-14 20:06:31 +12:00
Stanislav Meduna
00c144daeb Autorepeat filter for the binary sensors (#1681)
* add the autorepeat filter

* add a test for the autorepeat filter

* make no timing equivalent to a single default one
2021-05-13 17:36:53 -03:00
Jesse Hills
fddb05c845 Merge pull request #1775 from esphome/bump-1.18.0b3
1.18.0b3
2021-05-13 07:48:44 +12:00
Jesse Hills
3b13e62d3f Bump version to v1.18.0b3 2021-05-13 07:17:14 +12:00
BoukeHaarsma23
9e7acd6f75 Add sm2135 component (#1736)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-13 07:17:13 +12:00
Yuval Aboulafia
7d9c043f1d Use core constants for sample duration on bh1750 (#1764)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-13 07:17:13 +12:00
Guillermo Ruffino
bafbeefb37 Switch to esphome/AsyncTCP-esphome v1.2.2. (#1762) 2021-05-13 07:17:13 +12:00
BoukeHaarsma23
54660300e9 Add sm2135 component (#1736)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-13 07:14:01 +12:00
onde2rock
5dc40049be Add function to set SDS011 sensor in sleeping state (#1416)
Co-authored-by: aurelien <aurelien.antunes@gmail.com>
2021-05-12 16:38:29 +12:00
RubyBailey
1e46b4073f Mitsubishi Heat Pump - Fixed default transmit_state to be generic instead of for a specific type of heat pump (#1414)
Co-authored-by: RubyBailey <ruby_bailey11@hotmail.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-12 16:07:28 +12:00
krunkel
29fc4af0fc Add delay to aht10.cpp (#1498) 2021-05-12 15:50:26 +12:00
dependabot[bot]
4030a2e253 Bump pytest from 6.2.3 to 6.2.4 (#1769)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.3 to 6.2.4.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.3...6.2.4)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-12 15:44:33 +12:00
dependabot[bot]
ea80cb751b Bump flake8 from 3.9.0 to 3.9.2 (#1763)
Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.9.0 to 3.9.2.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.9.0...3.9.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-12 15:33:20 +12:00
dependabot[bot]
6aa61dbce7 Bump black from 21.5b0 to 21.5b1 (#1768)
Bumps [black](https://github.com/psf/black) from 21.5b0 to 21.5b1.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/main/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-12 15:25:23 +12:00
Yuval Aboulafia
cdc9c99d40 Use core constants for sample duration on bh1750 (#1764)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-12 10:16:59 +12:00
Jesse Hills
07f2931841 Merge pull request #1771 from esphome/bump-1.18.0b2
1.18.0b2
2021-05-12 10:14:41 +12:00
Jesse Hills
616ad04131 Bump version to v1.18.0b2 2021-05-12 09:57:40 +12:00
André Klitzing
b966e58f9e Fix build issues for idf 4.2 (Support ESP32-S2) (#1433)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-05-12 09:57:39 +12:00
André Klitzing
a546677b08 Fix build issues for idf 4.2 (Support ESP32-S2) (#1433)
Co-authored-by: Otto winter <otto@otto-winter.com>
2021-05-12 08:31:40 +12:00
Jesse Hills
5c3af1d3f6 Allow duration for deep_sleep.enter to be templateable (#1765) 2021-05-11 12:36:14 -03:00
Ciprian Constantinescu
66b0b6feeb Update const.py (#1748)
* Update const.py

Added cubic meter for https://github.com/esphome/feature-requests/issues/1185

* Update const.py

ordered alphabetically
2021-05-11 12:16:51 -03:00
Maurice Makaay
7665a220a0 Fix error when using %% in printf format. (#1713)
For printf formatting, a check is done to see if the number of
arguments matches the number of printf formatting placeholders.

The escape code `%%` that is used for representing a literal `%`
is also counted as a placeholder, but no argument will be provided
for that one.

This makes it impossible to use something like `("%f%%", percentage)`
in the code. In such case, one gets the error:

  `Found 2 printf-patterns (%f, %%), but 1 args were given!`

This commit fixes this behavior by omitting the `%%` from the matches.

Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-05-11 12:15:29 -03:00
Guillermo Ruffino
4250af4dd9 Switch to esphome/AsyncTCP-esphome v1.2.2. (#1762) 2021-05-11 12:05:49 -03:00
dependabot[bot]
73252ccd25 Bump pylint from 2.7.2 to 2.8.2 (#1729)
* Bump pylint from 2.7.2 to 2.8.2

Bumps [pylint](https://github.com/PyCQA/pylint) from 2.7.2 to 2.8.2.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/master/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/pylint-2.7.2...v2.8.2)

Signed-off-by: dependabot[bot] <support@github.com>

* fix pylint

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2021-05-10 17:57:25 -03:00
dependabot[bot]
33bf78c369 Bump black from 20.8b1 to 21.5b0 (#1745)
Bumps [black](https://github.com/psf/black) from 20.8b1 to 21.5b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/master/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-10 17:25:37 -03:00
Jesse Hills
f33c2a48eb Merge pull request #1761 from esphome/bump-1.18.0b1
1.18.0b1
2021-05-10 08:54:58 +12:00
Jesse Hills
96ded4e402 Fix quotes 2021-05-10 08:05:08 +12:00
Jesse Hills
44d5be6e7b Bump version to v1.18.0b1 2021-05-10 07:54:06 +12:00
Jesse Hills
076124eb71 Bump version to v1.19.0-dev 2021-05-10 07:54:06 +12:00
Jesse Hills
44562dbef1 Merge branch 'dev' into bump-1.18.0b1 2021-05-10 07:54:06 +12:00
Mauricio Bonani
cafdcaec29 Update copyright year (#1760) 2021-05-10 07:40:06 +12:00
Jesse Hills
b660e5a7fa Merge pull request #1759 from esphome/bump-1.17.2
1.17.2
2021-05-09 22:58:57 +12:00
Jesse Hills
3b4ea0ed0a Bump version to v1.17.2 2021-05-09 22:37:31 +12:00
Vegetto
403b6e32e3 fixes #858 - esphome crashes with neolightbus and RMT (#1667)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-05-09 22:37:31 +12:00
Otto Winter
229bf719a2 Implement external custom components installing from YAML (#1630)
* Move components import loading to importlib MetaPathFinder and importlib.resources

* Add external_components component

* Fix

* Fix

* fix cv.url return

* fix validate shorthand git

* implement git refresh

* Use finders from sys.path_hooks instead of looking for __init__.py

* use github:// schema

* error handling

* add test

* fix handling git output

* revert file check handling

* fix test

* allow full component path be specified for local

* fix test

* fix path handling

* lint

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2021-05-07 15:02:17 -03:00
Farzad E
2225594ee8 Added an option to disable mDNS (#1716)
* Added an option to disable mDNS

* Fixed linter issues

* Moved the enable_mdns option to WiFi and Ethernet components

* extracted common method for add mdns library

* lint

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2021-05-06 12:31:42 -03:00
Jesse Hills
b91a1aa027 Merge pull request #1746 from esphome/bump-1.17.1
1.17.1
2021-05-05 22:46:19 +12:00
Jesse Hills
13dbdd9b16 Bump version to v1.17.1 2021-05-05 22:35:18 +12:00
Alex
37bc0b3b5a Do not call component update on failed components (#1392)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-05 22:35:17 +12:00
Guillermo Ruffino
be70a96651 RC522 fixes (#1479) 2021-05-05 22:35:17 +12:00
Richard Klingler
d83d214497 Added / to default glyphs (#1691)
Co-authored-by: Charlie Root <klingler@blender.klingler.net>
2021-05-05 22:35:17 +12:00
Otto Winter
6ec0f80b76 Sensor Average Filter Fix Floating Pointer Error Accumulating (#1624) 2021-05-05 22:35:17 +12:00
Otto Winter
06f566346d Fix sensor.sensor_schema interface changed (#1659) 2021-05-05 22:35:17 +12:00
Guillermo Ruffino
b680649113 Fix servo detach chopped PWM (#1650) 2021-05-05 22:35:16 +12:00
Otto Winter
5ab2ef4079 Fix colorlog removing colors and refactor color code (#1671) 2021-05-05 22:35:16 +12:00
Guillermo Ruffino
392ed64375 fix servo not reattaching with same target (#1649) 2021-05-05 22:35:16 +12:00
SenexCrenshaw
566c129435 Buffer allocation and TRUEFALSE templates (#1644) 2021-05-05 22:35:16 +12:00
Diego Elio Pettenò
c903eb2d01 Add optional bindkey support for CGG1. (#1407) 2021-05-05 22:35:16 +12:00
buxtronix
69c78651d5 Fix BLE UUID matching (#1637)
Co-authored-by: Ben Buxton <bb@cactii.net>
2021-05-05 22:35:15 +12:00
mbo18
f7232b199a Change wifi signal strength unit to dBm (#1734) 2021-05-05 20:13:14 +12:00
Ryan Mounce
ffc6fe9ca0 Add support for controlling Tuya fan direction (#1409) 2021-05-05 16:24:31 +12:00
Alex Konradi
06b8e4df27 Call Stepper::should_step_ every loop iteration (#1373) 2021-05-05 14:32:15 +12:00
Alex
b103be99e8 Do not call component update on failed components (#1392)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-05 14:31:38 +12:00
d-two
28ed42d879 Add Hyperion Support (#1339) 2021-05-05 14:09:38 +12:00
0x0a11c0de
98f0d75180 Fix #1940: Implement speed_count in TuyaFan (#1654)
Co-authored-by: Frank Riley <fhriley@gmail.com>
2021-05-04 14:11:24 +12:00
Jesse Hills
34487c9de4 Merge pull request #1742 from esphome/bump-1.17.0
1.17.0
2021-05-04 10:48:51 +12:00
Jesse Hills
822377be8b Bump version to v1.17.0 2021-05-04 09:21:14 +12:00
buxtronix
dd4fb85170 Ble client fixes (#1739)
Co-authored-by: Ben Buxton <bb@cactii.net>
2021-05-04 08:51:03 +12:00
Jesse Hills
07b3327102 Update email addresses (#1733) 2021-05-03 11:51:10 +12:00
buxtronix
02aa75f68c BLE client support on ESP32 (#1177)
Co-authored-by: Ben Buxton <bb@cactii.net>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-05-03 11:10:50 +12:00
Alex
07db9319ad Swap fan and swing fields for Fujitu ACs (#1635) 2021-04-30 11:53:44 +12:00
Wojtek Strzalka
4ae4a4ee88 Support for TOF10120 distance sensor (#1375) 2021-04-29 11:49:46 +12:00
Guillermo Ruffino
a7c648b60b RC522 fixes (#1479) 2021-04-29 10:50:24 +12:00
Barry Loong
4d7c1ae143 Add Grow Fingerprint Reader (#1356) 2021-04-29 10:08:27 +12:00
elyorkhakimov
cc6d1e85cc Addition of forward and reverse active energy counters to ATM90E32 sensor component (#1271)
Co-authored-by: Elyor Khakimov <elyorkhakimov@forwardnetworks.com>
2021-04-29 07:15:50 +12:00
Stephen Tierney
7fb116d87d Add support for SHT4X (#1512) 2021-04-28 20:22:46 +12:00
Christian Ferbar
cc43e01e34 Add monochromatic effects: Pulse, Random (#1616) 2021-04-28 15:05:04 +12:00
Guillermo Ruffino
6d3ccf4df5 Change mac add mac suffix from underscore to dash (#1702) 2021-04-27 13:41:16 +12:00
Guillermo Ruffino
bb3d0706d3 Revert "Bump AsyncTCP-esphome to 1.2.1. (#1693)" (#1709)
This reverts commit aed6f2b1ea.
2021-04-21 10:33:59 -03:00
Richard Klingler
820dedbcd2 Added / to default glyphs (#1691)
Co-authored-by: Charlie Root <klingler@blender.klingler.net>
2021-04-21 12:10:45 +02:00
Maurice Makaay
aed6f2b1ea Bump AsyncTCP-esphome to 1.2.1. (#1693)
Co-authored-by: Maurice Makaay <mmakaay1@xs4all.net>
2021-04-19 20:15:37 -03:00
John Coggeshall
bf1885af3f Implementing the remainder of GPS data for the GPS component. (#1676) 2021-04-11 19:15:23 +02:00
Otto Winter
d8e4f5d56b Sensor Average Filter Fix Floating Pointer Error Accumulating (#1624) 2021-04-09 10:27:18 +02:00
dependabot[bot]
af616473aa Bump protobuf from 3.15.7 to 3.15.8 (#1682)
Bumps [protobuf](https://github.com/protocolbuffers/protobuf) from 3.15.7 to 3.15.8.
- [Release notes](https://github.com/protocolbuffers/protobuf/releases)
- [Changelog](https://github.com/protocolbuffers/protobuf/blob/master/generate_changelog.py)
- [Commits](https://github.com/protocolbuffers/protobuf/compare/v3.15.7...v3.15.8)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-09 10:14:38 +02:00
SenexCrenshaw
2033ac34e5 Sgp40 (#1513)
* Start of SGP40 dev

* Clean up

* Initial Commit

* VOC is working

* Fixed up sensor config

* Lint Fixes
Added in save/restore baseline
Noted original repo in header

* Lint Fixes
Added to test

* Lint Fixes

* Added additional check on restoring

* Removed double check

* Changed defines to static const double

* Changed defines to const
Do not send voc index until sensor stabilizes

* Fixed sensor stabilization message

* Fixup according to PR

* samples_read increment fix

* Fixed missing device class

* Choose a SENSOR device class

* Moved some sensors for tests

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2021-04-08 22:40:19 -03:00
Otto Winter
5e239d3d88 Automate building and publishing of esphome-lint docker image (#1680) 2021-04-08 17:08:11 +02:00
Otto Winter
30893afd67 Add Arduino ESP32 version mapping (#1679)
See also https://github.com/platformio/platform-espressif32/releases/tag/v3.2.0
2021-04-08 17:07:19 +02:00
SenexCrenshaw
a39bb7b92f Support custom build_flags for bme680_bsec (#1678) 2021-04-08 17:06:54 +02:00
Dan Gentry
b53f9f2a81 Daylight Saving Time spelling fix (#1677) 2021-04-08 17:04:40 +02:00
Otto Winter
586e36906d Fix sensor.sensor_schema interface changed (#1659) 2021-04-08 14:37:55 +02:00
Gareth Cooper
e6f8e73705 Receive long MQTT payload (#1590) 2021-04-08 14:26:34 +02:00
Peter Kuehne
eaf9735eda Disallow _ in node name (#1632) 2021-04-08 14:26:01 +02:00
Guillermo Ruffino
2e50e1f506 Fix servo detach chopped PWM (#1650) 2021-04-08 14:22:30 +02:00
Anthony Uk
76a6c39f25 mqtt_client: Added MQTTClientComponent::unsubscribe() (#1672)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-04-08 14:21:42 +02:00
rbaron
bf01c22e1f Adds support for b-parasite soil moisture sensor (#1666) 2021-04-08 13:59:30 +02:00
Otto Winter
99f14e03d4 Fix colorlog removing colors and refactor color code (#1671) 2021-04-08 13:58:01 +02:00
Otto Winter
d92c8ccadf Raise minimum python version to 3.7 (#1673) 2021-04-08 13:57:29 +02:00
Otto Winter
7964b724ed Rewrite sun component calculations (#1661) 2021-04-07 12:16:36 +02:00
dependabot[bot]
e0c5b45694 Bump protobuf from 3.15.6 to 3.15.7 (#1662)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-04-06 14:43:10 +02:00
dependabot[bot]
26407e001b Bump pytest from 6.2.2 to 6.2.3 (#1663)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.2 to 6.2.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.2...6.2.3)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-04-06 14:42:50 +02:00
Vegetto
3ecae3f16f fixes #858 - esphome crashes with neolightbus and RMT (#1667)
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-04-06 14:31:38 +02:00
Anthony Uk
5c359856ff Fixed CustomComponentConstructor::get_component() (#1653)
Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2021-04-06 13:50:31 +02:00
Trevor North
2d618768d5 Add BME680 via BSEC integration (#1313) 2021-04-06 12:19:56 +02:00
Stanislav Meduna
808e3be324 Add the display.is_displaying_page condition (#1646)
* display: add the display.is_displaying_page condition

* use maybe_simple_value for page_id

* add test
2021-04-02 23:00:41 -03:00
Andreas Hergert
9e23987db8 Add I2CMultiplexer in generel and the TCA9548A in special (#1410)
* Added I2CMultiplexer in generel and the TCA9548A in special

* cleanup

* tidy

* tidy

* tidy

* tidy

* Update CODEOWNERS

* Update CODEOWNERS

* added CODEOWNERS

* Fix CODEOWNERS

* protected function

* fixed scan

* fixed style

* added to test1.yaml

* Update esphome/components/tca9548a/__init__.py

* Update esphome/components/i2c/__init__.py

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

* Update esphome/components/i2c/i2c.cpp

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

* Update esphome/components/i2c/__init__.py

* Update esphome/components/i2c/__init__.py

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>

* Update esphome/components/i2c/i2c.cpp

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>

* added define statements for I2C Multiplexer

* fix

* try to tidy

* bug fix

* tidy

* override fix

* only change channel if different

* tidy

* added test

* testfix

* added defines

* tidy

* fix dep

* like recommended

Co-authored-by: Andreas Hergert <andreas.hergert@otrs.com>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2021-03-29 16:50:30 -03:00
Guillermo Ruffino
ad76312f66 fix servo not reattaching with same target (#1649) 2021-03-28 22:35:39 -03:00
SenexCrenshaw
2028362fd5 Buffer allocation and TRUEFALSE templates (#1644) 2021-03-27 11:01:37 +13:00
Paulus Schoutsen
13e0d6b9a1 Update FUNDING.yml 2021-03-26 11:39:29 -07:00
Diego Elio Pettenò
a6255c31fe Add optional bindkey support for CGG1. (#1407) 2021-03-26 07:33:06 +13:00
buxtronix
46356cbc4a Fix BLE UUID matching (#1637)
Co-authored-by: Ben Buxton <bb@cactii.net>
2021-03-23 18:21:04 +13:00
Jesse Hills
0fe61d9ec7 Merge pull request #1636 from esphome/bump-1.17.0b1
1.17.0b1
2021-03-22 20:44:38 +13:00
Jesse Hills
6114d331c9 Bump version to v1.17.0b1 2021-03-22 20:12:48 +13:00
Jesse Hills
e2e074a3fd Fix bump script for double quotes 2021-03-22 20:12:11 +13:00
Jesse Hills
4d340dc029 Merge branch 'dev' into bump-1.17.0b1 2021-03-22 20:08:57 +13:00
Jesse Hills
fb6c5ebe9a Bump version to v1.18.0-dev 2021-03-22 17:42:38 +13:00
Jesse Hills
af3273d930 Add trigger for http actions to receive the status code (#1599) 2021-03-22 16:26:10 +13:00
Niccolò Maggioni
8f1eb77e05 Background calibration & ABC commands for SenseAir S8 (#1623) 2021-03-22 12:59:41 +13:00
Otto Winter
89d0d41c5a Switch docker images to debian (#1626) 2021-03-20 20:58:46 +01:00
dependabot[bot]
452ca8e4c6 Bump pyyaml from 5.3.1 to 5.4.1 (#1482)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-03-20 18:58:26 +01:00
dependabot[bot]
e51b0ca15e Bump protobuf from 3.13.0 to 3.15.6 (#1607)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-03-20 18:58:08 +01:00
Otto Winter
5eeb110d74 Bundle platformio lib_deps in docker images (#1625) 2021-03-20 18:43:31 +01:00
dependabot[bot]
60b2d57dc3 Bump flake8 from 3.8.4 to 3.9.0 (#1612)
Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.8.4 to 3.9.0.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.8.4...3.9.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Otto Winter <otto@otto-winter.com>
2021-03-20 15:21:47 +01:00
matikij
91898cb814 Add 2.13in-ttgo-b1 waveshare epaper module. (#1326) 2021-03-20 20:32:46 +13:00
Keith Burzinski
818a7f1c78 Declare Color objects in main.cpp (#1395) 2021-03-19 23:40:05 +13:00
Jesse Hills
dedf343bd5 Fix pulse-meter with device_class and black (#1621) 2021-03-19 21:40:11 +13:00
dependabot[bot]
251240cc90 Bump platformio from 5.1.0 to 5.1.1 (#1618)
Bumps [platformio](https://github.com/platformio/platformio) from 5.1.0 to 5.1.1.
- [Release notes](https://github.com/platformio/platformio/releases)
- [Changelog](https://github.com/platformio/platformio-core/blob/develop/HISTORY.rst)
- [Commits](https://github.com/platformio/platformio/compare/v5.1.0...v5.1.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-19 21:29:26 +13:00
DrZoid
e5b45b6b4b e131: fix issue 1579: limitation of maximum light count (#1619) 2021-03-19 21:19:34 +13:00
Steve Baxter
a77784a6da Implement pulse_meter as an improvement on pulse_counter and pulse_width for meters (#1434) 2021-03-19 21:16:27 +13:00
Mike Ryan
f63f9168ff Add addressable_light display platform (#1272) 2021-03-18 19:08:50 +13:00
SenexCrenshaw
b5b2036971 8266 hardware spi enable with just 3 pins (#1617) 2021-03-18 13:59:47 +13:00
SenexCrenshaw
a96b6e7002 SPI transfer fix. Use write when no miso pin is set (#1563) 2021-03-18 13:54:58 +13:00
Sergey V. DUDANOV
f34c9b33fc Midea climate support (#1328)
* Added support for Midea IoT climate devices via UART interface (USB-dongle)

* Fixed lint checks

* Fixed lint checks

* CODEOWNERS update

* Clang-format

* Clang-format

* Add network device notification message support (show WiFi sign on devices)

* Make wifi_signal_sensor optional component

* Some optimization

* Optimizations and code formatting

* Fixed lint checks

* Fixed lint checks

* Fixed sign error

* Code changes

* Network notify repeat every 10 min

* Added log messages

* Fixed lint checks

* Refactoring: MideaClimate => MideaAC

* Using enums instead literals in Midea states

* Enum changed to be more correct

* Shrink notify frame to 32 bytes

* Fixed lint checks

* Change notify frame appliance type to common broadcast

* Control optimization

* Fixed control error

* Control command now don't reset others uncontrollable properties of device

* Fixed lint checks

* Some optimization

* on_receive callback give const Frame

* Fix control

* Fixes

* Some minor changes

* Fixed lint error

* No dependency from wifi_signal sensor for stretched WiFi icon. New option: stretched_icon instead wifi_signal_id.

* Fix option name

* Added export of outdoor temperature as sensor value

* Fixed lint errors

* Fixed pylint error

* Minor fix

* Fix temperature overflow in some cases

* Added answer on QueryNetwork command from appliance. Now don't wait for ack on 0x0D command.

* Fix lint error

* Added humidity setpoint optional sensor

* Added boolean options 'swing_horizontal' and 'swing_both'

* Added debug frame output

* Added debug frame output

* Fix lints error

* Some debug output optimization

* Fix lint check

* Some code optimization: adding templates

* Fix lint error

* Added sensors device classes

* Python code reformatted with black formatter

* RX frame debug message

RX frame debug message now prints before checking

* Remove CRC check for receiving frames

* Added experimental power usage option

* Added power usage option

* Fixed lint errors

* Major changes. See esp-docs.

* Added tests in test4.yaml

* Added tests in test1.yaml

* Added wifi dependency

* Fix test1.yaml

* Some fix :)

* One more refactoring

* One more refactoring

* One more refactoring
2021-03-17 17:27:50 -03:00
Jesse Hills
faf577a9dd Add option to suffix name with mac address (#1615)
* Add option to suffix name with mac address

* Rename and add to test file
2021-03-17 17:22:48 -03:00
Jim Ekman
7708b81ef5 Support fan speed levels (#1541)
* Add fan speed percentage support to the API

* Add float fan speed percentage

* Add percentage support to automation and configuration

* Update Tuya fan

* Fix pylint warning

* Update API to use speed levels instead of percentage

* Use speed levels

* Fix type warnings

* MQTT component now converts between speed levels and enums

* Webserver now supports speed_level

* Update prometheus

* Remove low/medium/high settings from speed fan

* Remove unused enum

* Configurable speed levels for speed fan

* Remove unused import

* Rename speed_level->speed and speed_levels->speed_count

* Rename supported_speed_levels -> supported_speed_count in API and FanTraits

Field id stays the same in the protocol, so the change is not breaking for aioesphome.
2021-03-17 10:40:02 -03:00
WeekendWarrior1
08998caabc a4988 wait 1ms when coming out of sleep (#1597) 2021-03-13 21:29:31 -03:00
Jesse Hills
848a5f1680 Change COLOR_ON to be 255 values instead of 1 (#1594) 2021-03-13 21:27:16 -03:00
Alex
2e7c1d7345 Added receive for Fujitsu ACs (#1577) 2021-03-13 18:45:01 -03:00
Massimiliano Ravelli
28a72fa56b Fixed component_tests config (#1608) 2021-03-12 19:58:43 -03:00
Jesse Hills
cd1353ae54 Update PULL_REQUEST_TEMPLATE.md 2021-03-13 08:42:37 +13:00
Samuel Sieb
c9ee513fa8 PN532 - don't read extra page and fix size (#1565)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2021-03-11 18:26:55 +13:00
Samuel Sieb
2a12caa955 change lcd clear() to clear the buffer (#1600)
Co-authored-by: Samuel Sieb <samuel@sieb.net>
2021-03-11 18:17:50 +13:00
Guillermo Ruffino
5e5f8d5f9b schema-dump-pins (#1596)
* schema dump idea

accept boolean or anything default

accept null also for full dicts

added some common validators

more simple validators

support multi_conf

better handle automations

updates

updates

handle lists

removed not needed class

move to own folder

generalized for automations lists, etc

updates

updates

clean up

clean up

fix automations

made comment optional

basic docs support

added more docs

fixes docs handling

updates

updates

fix components parent

updates

updates

updates

Fix inkplate 6 registration

updates

Disable logging for vscode add on

better handle buses

keep extended order as in CONFIGs

updates

updates

updates

disable comments

moved to scripts/build_jsonschema

added configurable decorators

path handling

fix handle list_schema

fixes and cleanup

add jschema_extractor to maybe

updates

lint

no schema in git

add generated loggers list

* lint

* support pin schema
2021-03-08 22:53:20 -03:00
Derek Hageman
2c0fe49b86 Inkplate 6 Optimizations (#1592) 2021-03-08 19:25:49 +13:00
Guillermo Ruffino
1e227e8051 Schema dump (#1564)
* schema dump idea

accept boolean or anything default

accept null also for full dicts

added some common validators

more simple validators

support multi_conf

better handle automations

updates

updates

handle lists

removed not needed class

move to own folder

generalized for automations lists, etc

updates

updates

clean up

clean up

fix automations

made comment optional

basic docs support

added more docs

fixes docs handling

updates

updates

fix components parent

updates

updates

updates

Fix inkplate 6 registration

updates

Disable logging for vscode add on

better handle buses

keep extended order as in CONFIGs

updates

updates

updates

disable comments

moved to scripts/build_jsonschema

added configurable decorators

path handling

fix handle list_schema

fixes and cleanup

add jschema_extractor to maybe

updates

lint

no schema in git

add generated loggers list

* lint
2021-03-07 21:05:08 -03:00
Guillermo Ruffino
d5cf4b7eac Improve error checking: too many component id candidates (#1570)
* add error too many candidates

* Improve error checking of ids
2021-03-07 19:59:32 -03:00
Jesse Hills
570ec36fe3 MCP23XXX Refactor (#1560)
* Refactor MCP23XXX classes to consolidate shared code

* Update test mcp23xxx pin schemas
2021-03-07 16:23:54 -03:00
Guillermo Ruffino
69879920eb add-black (#1593)
* Add black

Update pre commit

Update pre commit

add empty line

* Format with black
2021-03-07 16:03:16 -03:00
Guillermo Ruffino
2b60b0f1fa fix servo warning (#1591) 2021-03-06 19:59:06 -03:00
dependabot[bot]
c17624adab Bump platformio from 5.0.4 to 5.1.0 (#1581)
Bumps [platformio](https://github.com/platformio/platformio) from 5.0.4 to 5.1.0.
- [Release notes](https://github.com/platformio/platformio/releases)
- [Changelog](https://github.com/platformio/platformio-core/blob/develop/HISTORY.rst)
- [Commits](https://github.com/platformio/platformio/compare/v5.0.4...v5.1.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-06 18:41:19 -03:00
needspeed
0f151a8f6b Extend 'uart:' with 'invert:' for esp32 (#1586) 2021-03-06 10:25:07 -03:00
dependabot[bot]
e62bf333a2 Bump pylint from 2.6.0 to 2.7.2 (#1582)
Bumps [pylint](https://github.com/PyCQA/pylint) from 2.6.0 to 2.7.2.
- [Release notes](https://github.com/PyCQA/pylint/releases)
- [Changelog](https://github.com/PyCQA/pylint/blob/master/ChangeLog)
- [Commits](https://github.com/PyCQA/pylint/compare/pylint-2.6.0...pylint-2.7.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-05 10:10:58 -03:00
Gabe Cook
88b46b7487 Add min/max filters (#1569) 2021-03-05 10:10:06 -03:00
nikito7
fa290fbce8 Fix for waveshare 2.13in-ttgo-b73 (#1543) 2021-03-04 13:50:27 +13:00
dependabot[bot]
1883ce1876 Bump pytz from 2020.5 to 2021.1 (#1575)
Bumps [pytz](https://github.com/stub42/pytz) from 2020.5 to 2021.1.
- [Release notes](https://github.com/stub42/pytz/releases)
- [Commits](https://github.com/stub42/pytz/compare/release_2020.5...release_2021.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 15:42:19 -03:00
dependabot[bot]
f3fe2bde38 Bump pytest from 6.2.1 to 6.2.2 (#1574)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.1 to 6.2.2.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.1...6.2.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-03 15:41:27 -03:00
Andrew Zaborowski
811c13d7d1 pins: Add three new boards (#1576)
Add the Lolin32 Lite and TTGO T7 board names so that esphome can be
built for those boards.  There's nothing special about them.  The
espressif/arduino-esp32 and platformio/platform-espressif32 projects
have both merged definitions for those boards recently.
2021-03-03 15:40:25 -03:00
dependabot[bot]
521dfe08f2 Bump colorlog from 4.6.2 to 4.7.2 (#1473)
Bumps [colorlog](https://github.com/borntyping/python-colorlog) from 4.6.2 to 4.7.2.
- [Release notes](https://github.com/borntyping/python-colorlog/releases)
- [Commits](https://github.com/borntyping/python-colorlog/compare/v4.6.2...v4.7.2)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-02 23:42:41 -03:00
dependabot[bot]
2c77d121da Bump pytest-cov from 2.10.1 to 2.11.1 (#1483)
Bumps [pytest-cov](https://github.com/pytest-dev/pytest-cov) from 2.10.1 to 2.11.1.
- [Release notes](https://github.com/pytest-dev/pytest-cov/releases)
- [Changelog](https://github.com/pytest-dev/pytest-cov/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-cov/compare/v2.10.1...v2.11.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-02 23:41:51 -03:00
Cody James
c5dc736c53 changed color temp from float to int (#1522)
* changed color temp from float to int

Changed cold_white_temperature and warm_white temperature from a float to an integer. This makes home assisting show it correctly in the color temperature slider. If it is set to float home assistant show something like 470.8390000283847829304845 in the slider which provides an ugly ui and color temperature to as a decimal is invalid anyway.

* Update esphome/components/rgbww/light.py

* Update esphome/components/rgbww/light.py

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2021-03-02 23:41:15 -03:00
Moritz Glöckl
8e93735861 Add support for the SM300D2 7-in-1 sensor module (#1524)
* Added support for SM300D2 sensor module

* Fixed lint errors due to added tvoc config

* add device class

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2021-03-02 21:54:52 -03:00
SenexCrenshaw
ac25b138f5 Migrate ESPColor to Color (#1551)
* Migrate ESPColor to Color

* color.h constructor fix

* Updated componets to use Color
Added a using for ESPColor

* Lint fixes

* Fixed value error

* Update display components to use colorutil

* Updated to latest PR comments

* Fixed COLOR_WHITE

* Moved esp_scale to color_utils

* Rename color_utils to display_color_utils
2021-03-02 11:08:57 -03:00
Guillermo Ruffino
b17e0c298e fix path on windows escape (#1573) 2021-03-01 22:16:36 -03:00
marecabo
422f0ad7a9 Add constants for device classes of binary_sensor (#1549) 2021-02-28 20:55:32 -03:00
Christian Ferbar
34d37961c3 ADC fix: GPIO0 not usable as output if ADC_VCC is used (#1557) 2021-02-28 14:02:02 -03:00
Seppel Hardt
bdf004867d Added samsung36 ir protocol (#1438)
* Added samsung36 ir protocol

* Make linter happy

* Added test and fixed python failure

* Sorry for the commits but linter was still not happy :)

* Okay have to run  script/clang-format -i

Co-authored-by: tuxBurner <tuxBurner@boggo.de>
2021-02-27 20:16:27 -03:00
Gabe Cook
08ecca86bc Add send_every to uart switch for recurring data (#1514) 2021-02-27 19:53:53 -03:00
marecabo
520c4331e3 Add default device classes to sensor components (#1533)
* Add device_class arg to homeassistant sensor_schema call

* Add device_class arg to mqtt_subscribe sensor_schema call

* Add device_class arg to dht sensor_schema call

* Add device_class arg to dht12 sensor_schema call

* Add device_class arg to am2320 sensor_schema call

* Add device_class arg to atc_mithermometer sensor_schema call

* Add device_class arg to atm90e32 sensor_schema call

* Add device_class arg to bh1750 sensor_schema call

* Add device_class arg to ble_rssi sensor_schema call

* Add device_class arg to bme280 sensor_schema call

* Add device_class arg to bme680 sensor_schema call

* Add device_class arg to bmp085 sensor_schema call

* Add device_class arg to bmp280 sensor_schema call

* Add device_class arg to binary_sensor_map sensor_schema call

* Add device_class arg to apds9960 sensor_schema call

* Add device_class arg to as3935 sensor_schema call

* Add device_class arg to ccs811 sensor_schema call

* Add device_class arg to cse7766 sensor_schema call

* Add device_class arg to ct_clamp sensor_schema call

* Add device_class arg to dallas sensor_schema call

* Add device_class arg to duty_cycle sensor_schema call

* Add device_class arg to esp32_hall sensor_schema call

* Add device_class arg to hdc1080 sensor_schema call

* Add device_class arg to hlw8012 sensor_schema call

* Add device_class arg to hm3301 sensor_schema call

* Add device_class arg to hmc5883l sensor_schema call

* Add device_class arg to htu21d sensor_schema call

* Add device_class arg to hx711 sensor_schema call

* Add device_class arg to ina219 sensor_schema call

* Add device_class arg to ina226 sensor_schema call

* Add device_class arg to ina3221 sensor_schema call

* Add device_class arg to ibsth1 sensor_schema call

* Add device_class arg to max31855 sensor_schema call

* Add device_class arg to max31856 sensor_schema call

* Add device_class arg to max31865 sensor_schema call

* Add device_class arg to mhz19 sensor_schema call

* Add device_class arg to max6675 sensor_schema call

* Add device_class arg to mpu6050 sensor_schema call

* Add device_class arg to ms5611 sensor_schema call

* Add device_class arg to mcp9808 sensor_schema call

* Add device_class arg to ntc sensor_schema call

* Add device_class arg to pid sensor_schema call

* Add device_class arg to pmsx003 sensor_schema call

* Add device_class arg to pulse_counter sensor_schema call

* Add device_class arg to pulse_width sensor_schema call

* Add device_class arg to pzem004t sensor_schema call

* Add device_class arg to pzemac sensor_schema call

* Add device_class arg to pzemdc sensor_schema call

* Add device_class arg to qmc5883l sensor_schema call

* Add device_class arg to resistance sensor_schema call

* Add device_class arg to rotary_encoder sensor_schema call

* Add device_class arg to ruuvitag sensor_schema call

* Add device_class arg to scd30 sensor_schema call

* Add device_class arg to sds011 sensor_schema call

* Add device_class arg to senseair sensor_schema call

* Add device_class arg to sgp30 sensor_schema call

* Add device_class arg to sht3xd sensor_schema call

* Add device_class arg to shtcx sensor_schema call

* Add device_class arg to sps30 sensor_schema call

* Add device_class arg to sts3x sensor_schema call

* Add device_class arg to sun sensor_schema call

* Add device_class arg to tcs34725 sensor_schema call

* Add device_class arg to teleinfo sensor_schema call

* Add device_class arg to template sensor_schema call

* Add device_class arg to tmp102 sensor_schema call

* Add device_class arg to tmp117 sensor_schema call

* Add device_class arg to tsl2561 sensor_schema call

* Add device_class arg to tx20 sensor_schema call

* Add device_class arg to ultrasonic sensor_schema call

* Add device_class arg to uptime sensor_schema call

* Add device_class arg to vl53l0x sensor_schema call

* Add device_class arg to wifi_signal sensor_schema call

* Add device_class arg to xiaomi_cgd1 sensor_schema call

* Add device_class arg to xiaomi_cgg1 sensor_schema call

* Add device_class arg to xiaomi_gcls002 sensor_schema call

* Add device_class arg to xiaomi_hhccjcy01 sensor_schema call

* Add device_class arg to xiaomi_hhccpot002 sensor_schema call

* Add device_class arg to xiaomi_jqjcy01ym sensor_schema call

* Add device_class arg to xiaomi_lywsd02 sensor_schema call

* Add device_class arg to xiaomi_lywsd03mmc sensor_schema call

* Add device_class arg to xiaomi_lywsdcgq sensor_schema call

* Add device_class arg to xiaomi_mhoc401 sensor_schema call

* Add device_class arg to xiaomi_mjyd02yla sensor_schema call

* Add device_class arg to xiaomi_wx08zm sensor_schema call

* Add device_class arg to zyaura sensor_schema call

* Add device_class arg to ads1115 sensor_schema call

* Add device_class arg to adc sensor_schema call

* Add device_class arg to ade7953 sensor_schema call

* Add device_class arg to aht10 sensor_schema call

* Make args of sensor_schema required

* lint

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2021-02-27 19:28:06 -03:00
Guillermo Ruffino
342d5166a0 More yaml validation (#1568)
* validate keys

* refactor line info
2021-02-27 19:21:07 -03:00
Otamay
69d39ef0cd Added heater to climate_ir_lg (#1555)
* Added heater to climate_ir_lg

* Code formatting

* Code formatting
2021-02-27 18:55:27 -03:00
Robert Resch
6588e9380e Replace substitutions in substitutions first (#1567) 2021-02-27 18:47:12 -03:00
Guillermo Ruffino
4d6277330b Update PULL_REQUEST_TEMPLATE.md 2021-02-26 10:32:23 -03:00
stubs12
87154e9b6f Tuya: Use queue for sending command messages (#1404) 2021-02-26 12:52:40 +13:00
Kurt Kellner
b91723344e Vl53l0x change address (#1126)
* Added vl53l0x change address and timeout

* Added vl53l0x change address and timeout

* vl53l0x code cleanup and update test

* remove executable bit

* lint code cleanup

* code review fixes including timeout default to 10ms

* Code review cleanup and change a WARN log level message to DEBUG

* Fix issue where warn should be temporary

* Added name of sensor to warning message

* Fix blacklist lint issue

* Remove unused import
2021-02-25 19:12:06 -03:00
Otamay
92b36720b6 Climate IR LG -keep previous temp and fan if swing (#1556)
Swing IR command does not carry CLIMATE_FAN or TEMP within itself, so previous states sould be kept. Tested with actual LG IR remote controller.
2021-02-25 18:26:19 -03:00
spilin
3d0310d0e0 Add dial support for sim800l component (#1558) 2021-02-25 18:11:15 -03:00
dckiller51
f81cddf22e Add Xiaomi Miscale v1 and v2 (#1368) 2021-02-22 22:23:12 +13:00
Jesse Hills
808ce6eecb Merge pull request #1548 from esphome/bump-1.16.2
1.16.2
2021-02-20 19:58:48 +13:00
Jesse Hills
665d0fd759 Bump version to v1.16.2 2021-02-20 19:29:52 +13:00
Jesse Hills
c519c02de8 Fix safe mode ota flashing under certain configurations (#1534)
* Fix safe mode ota flashing under certain configurations by allowing the arduino loop to run instead of while(true)

* rename to should_enter_safe_mode

* Fix line length
2021-02-20 19:29:52 +13:00
Samuel Sieb
eacac78099 Add reverse_enable for max7219 (#1489) 2021-02-20 19:29:52 +13:00
Kris
a925036ff8 Added Waveshare 2.90inch V2 e-ink display (#1538) 2021-02-20 19:29:52 +13:00
SenexCrenshaw
1468293f3e fix DHT auto_detect check (#1536) 2021-02-20 19:29:52 +13:00
Guillermo Ruffino
25924ca4e8 fix substitution losing track of document range (#1547) 2021-02-19 21:52:42 -03:00
Jesse Hills
6c8ace0ce8 Fix safe mode ota flashing under certain configurations (#1534)
* Fix safe mode ota flashing under certain configurations by allowing the arduino loop to run instead of while(true)

* rename to should_enter_safe_mode

* Fix line length
2021-02-17 20:26:59 -03:00
Samuel Sieb
acc1af0f51 Add reverse_enable for max7219 (#1489) 2021-02-18 08:26:22 +13:00
Kris
c92c439d17 Added Waveshare 2.90inch V2 e-ink display (#1538) 2021-02-18 07:12:02 +13:00
SenexCrenshaw
410fad3b41 fix DHT auto_detect check (#1536) 2021-02-16 20:42:14 +13:00
Chris Nussbaum
dce20680d7 Add duration option to action start deep sleep (#1526) 2021-02-15 14:32:22 -03:00
marecabo
f95be6a0df Device class attribute for sensor component (#1525)
* Add constants for sensor device_class

* Add device_class attribute to sensor component

* Add device_class attribute to sensor class

* Add device_class to mhz19 temperature sensor

* Add device_class to sensor in api component

* Add test for device_class of sensor

* Rename DEVICE_CLASS_NONE to DEVICE_CLASS_EMPTY for consistency

* Make optional attributes of sensor component truly optional
2021-02-15 12:49:02 -03:00
SenexCrenshaw
a342302114 st7735_conf_fixes (#1530) 2021-02-14 02:21:43 -03:00
Jesse Hills
925a992d1b Merge pull request #1531 from esphome/bump-1.16.1
1.16.1
2021-02-14 15:04:43 +13:00
Jesse Hills
61ecbe4273 Bump version to v1.16.1 2021-02-14 10:01:22 +13:00
Keith Burzinski
65c7e27a43 MCP230xx open drain interrupt pins (#1243) 2021-02-14 10:01:21 +13:00
Frank Bakker
57b56010da Added energy sensor to hlw8012 (#1198) 2021-02-14 10:01:21 +13:00
SenexCrenshaw
ef89249019 Fixed ST7735 transfer_byte to write_byte without miso (#1529) 2021-02-14 10:01:21 +13:00
Klarstein
bc64cf3e47 Update Dockerfile health check timings (#1517) 2021-02-14 10:01:21 +13:00
Jesse Hills
def70dde72 Fix PN532 SPI communication (#1511) 2021-02-14 10:01:21 +13:00
Keith Burzinski
b52f7cfe86 MCP230xx open drain interrupt pins (#1243) 2021-02-13 22:07:11 +13:00
Frank Bakker
81b512a7b3 Added energy sensor to hlw8012 (#1198) 2021-02-13 21:57:06 +13:00
Justin Gerhardt
57d6185374 Correct Native API Wire Format Documentation (#1528) 2021-02-13 21:36:39 +13:00
SenexCrenshaw
e288aa07fb Fixed ST7735 transfer_byte to write_byte without miso (#1529) 2021-02-13 21:34:59 +13:00
Klarstein
50006e4c42 Update Dockerfile health check timings (#1517) 2021-02-12 15:26:55 +13:00
rspaargaren
23cf120977 Added codeowners (#1487) 2021-02-10 09:20:31 -03:00
Jérémy JOURDIN
04d8593f38 Add MCP4725 DAC Component (#1418)
* Add MCP4725 DAC

* Fix lint

* Fix lint

* Fix lint

* Lint & cleanup

* Lint again

* One more lint

* add test

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2021-02-06 12:18:48 -03:00
Guillermo Ruffino
28e39f7f76 Add config validator location (#1490)
* show validation source location for id

* show validation source location for lambda

* refactor lambda #line position

* account content offset on made lambdas

* lint

* remove redundant check
2021-02-06 12:09:15 -03:00
fkirill
de3377132d Adding support for the Inkbird IBS-TH1 Mini sensor (#1099) 2021-02-06 17:04:47 +13:00
Jesse Hills
b351cd94d7 Fix PN532 SPI communication (#1511) 2021-02-06 11:02:20 +13:00
Guillermo Ruffino
bccaa78a90 RC522 increased retry loop count (#1506) 2021-02-03 12:30:20 +13:00
hcoohb
f402c89539 fix esp8266 remote_transmitter using incorrect timings (#1465)
* replace delay by delayMicroseconds in delay_microseconds_accurate

* Use delay(0) to let wifi and os function run

* Linting

* Remove unneeded delayMicroseconds, keep it for low usec

* Avoid micros() overflow issue
2021-02-01 11:59:27 -03:00
Jesse Hills
4eeb111fa3 Allow SCD30 sensors to be optional (#1502) 2021-01-30 16:50:09 +13:00
nikito7
1d378e416d Add support for MHO-C401 (#1486)
Committer: nikito7

Co-authored-by: vevsvevs <v-v@mail.ru>
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
Co-authored-by: nikito7 <root@vbox.lan>
2021-01-27 20:14:43 +13:00
Klarstein
d3b758d10a Add docker healthcheck (#1492) 2021-01-27 19:16:59 +13:00
mhentschke
7b9c2d2978 Added options to control pulse duration on Climate_IR_LG Component (#1470)
* Added options to control pulse duration on Climate_IR_LG Component. This is usefull as some equipment from LG (Tested in Brazil AC unit) use different pulse durations in their protocol.

* Fixed C++ linting issues

* Fixed Python linting issues

* fixed spaces on parameters linting issue

* fixed spacing clint

* Removed unused constants

* Removed wrong spacing

* Changed int to time period in all new fields

Changed cv._int to cv.positive_time_period_microseconds in the time definitions for the new options

* Fixed the time defaults

Time defaults fixed for Climate_IR_LG.
2021-01-26 15:49:14 -03:00
Paul Nicholls
9d38543cb0 Add support for string-type Tuya datapoints (#1488) 2021-01-26 17:44:10 +13:00
SenexCrenshaw
36a2ce2c23 SPI wasnt being disabled after display update (#1493) 2021-01-26 13:14:23 +13:00
Andrew Zaborowski
c7c71089ce codegen: Lambda improvements (#1476)
* Use #line directives in generated C++ code for lambdas

The #line directive in gcc is meant specifically for pieces of imported
code included in generated code, exactly what happens with lambdas in
the yaml files: https://gcc.gnu.org/onlinedocs/cpp/Line-Control.html

With this change, if I add the following at line 165 of kithen.yaml:
    - lambda: undefined_var == 5;

then "$ esphome kitchen.yaml compile" shows the following:

INFO Reading configuration kitchen.yaml...
INFO Generating C++ source...
INFO Compiling app...
INFO Running:  platformio run -d kitchen
<...>
Compiling .pioenvs/kitchen/src/main.cpp.o
kitchen.yaml: In lambda function:
kitchen.yaml:165:7: error: 'undefined_var' was not declared in this scope
*** [.pioenvs/kitchen/src/main.cpp.o] Error 1
== [FAILED] Took 2.37 seconds ==

* Silence gcc warning on multiline macros in lambdas

When the \ is used at the end of the C++ source in a lambda (line
continuation, often used in preprocessor macros), esphome will copy that
into main.cpp once as code and once as a // commment.  gcc will complain
about the multiline commment:

Compiling .pioenvs/kitchen/src/main.cpp.o
kitchen.yaml:640:3: warning: multi-line comment [-Wcomment]

Try to replace the \ with a "<cont>" for lack of a better idea.
2021-01-23 20:17:15 -03:00
Guillermo Ruffino
52c67d715b add http request tests (#1448)
* add http request tests

* add to test3 for esp8266

* move test action to another trigger
2021-01-23 19:44:20 -03:00
Philipp Tölke
f084ab339b Make fade_to*, lighten, and darken const (#1450) 2021-01-22 20:55:49 +13:00
Zixuan Wang
8352f52fef Improve ccs811 precision (#1428) 2021-01-22 20:51:40 +13:00
Florian Mösch
b28735d63b rename read/write to read/time/write_time (#1468) 2021-01-18 09:35:35 -03:00
Florian Mösch
4c105398f7 time sync notification (#1442)
* add on_time_sync trigger

* cleanup lint

* fix review remark (sntp didn't trigger callbacks)
2021-01-18 09:34:50 -03:00
David Zovko
d9a2651a5a Inkplate 6 support for ESPHome (#1283)
* Add Inkplate 6 support

Inkplate 6 is e-paper display based on ESP32. This commit adds support for integrating Inkplate 6 into the ESPHome. Find more info here: inkplate.io

* Greyscale working

* Update inkplate.h

* Fix formatting

* Formatting

* Update esphome/components/inkplate6/display.py

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

* Update esphome/components/inkplate6/display.py

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

* Fix some lint errors
Ignore some lint errors
Only allow on ESP32

* Update the codeowners file

Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-01-16 13:19:35 +13:00
Jesse Hills
5fcd1e391d Add NDEF reading and writing to PN532 (#1351) 2021-01-15 09:29:55 +13:00
SenexCrenshaw
36089a1400 Updated Mcp3008 to support reference_voltage and voltage_sampler::VoltageSampler (#1387)
Co-authored-by: Jesse Hills <3060199+jesserockz@users.noreply.github.com>
2021-01-14 07:33:19 +13:00
dependabot[bot]
e7b1d2efaa Bump voluptuous from 0.12.0 to 0.12.1 (#1411)
Bumps [voluptuous](https://github.com/alecthomas/voluptuous) from 0.12.0 to 0.12.1.
- [Release notes](https://github.com/alecthomas/voluptuous/releases)
- [Changelog](https://github.com/alecthomas/voluptuous/blob/master/CHANGELOG.md)
- [Commits](https://github.com/alecthomas/voluptuous/compare/0.12.0...0.12.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-12 23:53:35 -03:00
Florian Mösch
bf453ad8cd make time components polling components (#1443)
* make real time clock components polling components

* add test
2021-01-12 15:37:22 -03:00
Guillermo Ruffino
fbc1b3e316 Add rc522 i2c (#1432)
* split to spi and i2c

* fix binary_sensor

* i2c comms ready

* fix rc522_spi binary sensor compat

* lint

* lint

* add test and codeowners

* fix refactor
2021-01-12 10:13:53 -03:00
dependabot[bot]
400819175d Bump pytest-mock from 3.3.1 to 3.5.1 (#1458)
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.3.1 to 3.5.1.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.3.1...v3.5.1)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-01-12 10:12:25 -03:00
mmanza
3c34b539b0 Whirlpool ac (#1467)
* Checksum calc change

* first checksum change for MODEL_DG11J1_3A
2021-01-12 09:51:38 -03:00
Guillermo Ruffino
86385a1c19 Revert esptool to 2.8 (#1460)
Fixes https://github.com/esphome/issues/issues/1702
2021-01-11 11:33:43 -03:00
mknjc
96ab6b51b8 API: copy the data to send into the tcp internal buffer (#1455)
Without the flag lwip only holds a reference to the supplied buffers and the reference must be valid until the tcp ack is received. This can't be guaranteed for stack allocated buffers
2021-01-11 10:46:21 -03:00
mknjc
02dc49c272 Rotary Encoder: Don't call callbacks in the isr (#1456) 2021-01-11 08:05:53 +13:00
Dan Jackson
5df398ec31 Add encode_uint32 method (#1427) 2021-01-10 17:53:12 +13:00
Florian Mösch
699696e8d1 DS1307 real time clock component (#1441)
* initial support for DS1307 real time clock

* add simple test, make sync functions public

* cleanup lint

* add sync to/from rtc actions

* changes action names

* Update esphome/components/ds1307/ds1307.cpp

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>

* Update esphome/components/ds1307/time.py

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>

* fix suggested change

Co-authored-by: Guillermo Ruffino <glm.net@gmail.com>
2021-01-08 19:40:22 -03:00
Alex
93e35a53ed fix safe_mode (#1421)
* Deprioritize automations

Ensures safe mode is loaded before any automations are ran

* Fix lint
2021-01-08 16:11:42 -03:00
Jesse Hills
a269098a0e Bump version to v1.17.0-dev 2021-01-09 07:51:18 +13:00
2055 changed files with 146256 additions and 38915 deletions

View File

@@ -49,7 +49,7 @@ ConstructorInitializerAllOnOneLineOrOnePerLine: true
ConstructorInitializerIndentWidth: 4
ContinuationIndentWidth: 4
Cpp11BracedListStyle: true
DerivePointerAlignment: true
DerivePointerAlignment: false
DisableFormat: false
ExperimentalAutoDetectBinPacking: false
FixNamespaceComments: true

View File

@@ -2,17 +2,29 @@
Checks: >-
*,
-abseil-*,
-altera-*,
-android-*,
-boost-*,
-bugprone-macro-parentheses,
-bugprone-narrowing-conversions,
-bugprone-signed-char-misuse,
-cert-dcl50-cpp,
-cert-err58-cpp,
-clang-analyzer-core.CallAndMessage,
-cert-oop57-cpp,
-cert-str34-c,
-clang-analyzer-optin.cplusplus.UninitializedObject,
-clang-analyzer-osx.*,
-clang-analyzer-security.*,
-cppcoreguidelines-avoid-goto,
-cppcoreguidelines-c-copy-assignment-signature,
-cppcoreguidelines-owning-memory,
-clang-diagnostic-delete-abstract-non-virtual-dtor,
-clang-diagnostic-delete-non-abstract-non-virtual-dtor,
-clang-diagnostic-shadow-field,
-clang-diagnostic-unused-const-variable,
-clang-diagnostic-unused-parameter,
-concurrency-*,
-cppcoreguidelines-avoid-c-arrays,
-cppcoreguidelines-avoid-magic-numbers,
-cppcoreguidelines-init-variables,
-cppcoreguidelines-macro-usage,
-cppcoreguidelines-narrowing-conversions,
-cppcoreguidelines-non-private-member-variables-in-classes,
-cppcoreguidelines-pro-bounds-array-to-pointer-decay,
-cppcoreguidelines-pro-bounds-constant-array-index,
-cppcoreguidelines-pro-bounds-pointer-arithmetic,
@@ -24,42 +36,49 @@ Checks: >-
-cppcoreguidelines-pro-type-union-access,
-cppcoreguidelines-pro-type-vararg,
-cppcoreguidelines-special-member-functions,
-fuchsia-*,
-fuchsia-default-arguments,
-fuchsia-multiple-inheritance,
-fuchsia-overloaded-operator,
-fuchsia-statically-constructed-objects,
-fuchsia-default-arguments-declarations,
-fuchsia-default-arguments-calls,
-google-build-using-namespace,
-google-explicit-constructor,
-google-readability-braces-around-statements,
-google-readability-casting,
-google-readability-namespace-comments,
-google-readability-todo,
-google-runtime-int,
-google-runtime-references,
-hicpp-*,
-llvm-else-after-return,
-llvm-header-guard,
-llvm-include-order,
-misc-unconventional-assign-operator,
-llvm-qualified-auto,
-llvmlibc-*,
-misc-non-private-member-variables-in-classes,
-misc-no-recursion,
-misc-unused-parameters,
-modernize-deprecated-headers,
-modernize-pass-by-value,
-modernize-pass-by-value,
-modernize-avoid-c-arrays,
-modernize-avoid-bind,
-modernize-concat-nested-namespaces,
-modernize-return-braced-init-list,
-modernize-use-auto,
-modernize-use-default-member-init,
-modernize-use-equals-default,
-modernize-use-trailing-return-type,
-modernize-use-nodiscard,
-mpi-*,
-objc-*,
-performance-unnecessary-value-param,
-readability-braces-around-statements,
-readability-convert-member-functions-to-static,
-readability-else-after-return,
-readability-function-cognitive-complexity,
-readability-implicit-bool-conversion,
-readability-named-parameter,
-readability-redundant-member-init,
-warnings-as-errors,
-zircon-*
-readability-isolate-declaration,
-readability-magic-numbers,
-readability-make-member-function-const,
-readability-redundant-string-init,
-readability-uppercase-literal-suffix,
-readability-use-anyofallof,
WarningsAsErrors: '*'
HeaderFilterRegex: '^.*/src/esphome/.*'
AnalyzeTemporaryDtors: false
FormatStyle: google
CheckOptions:
@@ -67,9 +86,11 @@ CheckOptions:
value: '1'
- key: google-readability-function-size.StatementThreshold
value: '800'
- key: google-readability-namespace-comments.ShortNamespaceLines
- key: google-runtime-int.TypeSuffix
value: '_t'
- key: llvm-namespace-comment.ShortNamespaceLines
value: '10'
- key: google-readability-namespace-comments.SpacesBeforeComments
- key: llvm-namespace-comment.SpacesBeforeComments
value: '2'
- key: modernize-loop-convert.MaxCopySize
value: '16'
@@ -83,6 +104,12 @@ CheckOptions:
value: llvm
- key: modernize-use-nullptr.NullMacros
value: 'NULL'
- key: modernize-make-unique.MakeSmartPtrFunction
value: 'make_unique'
- key: modernize-make-unique.MakeSmartPtrFunctionHeader
value: 'esphome/core/helpers.h'
- key: readability-braces-around-statements.ShortStatementLines
value: 2
- key: readability-identifier-naming.LocalVariableCase
value: 'lower_case'
- key: readability-identifier-naming.ClassCase
@@ -96,15 +123,19 @@ CheckOptions:
- key: readability-identifier-naming.StaticConstantCase
value: 'UPPER_CASE'
- key: readability-identifier-naming.StaticVariableCase
value: 'UPPER_CASE'
value: 'lower_case'
- key: readability-identifier-naming.GlobalConstantCase
value: 'UPPER_CASE'
- key: readability-identifier-naming.ParameterCase
value: 'lower_case'
- key: readability-identifier-naming.PrivateMemberPrefix
value: 'NO_PRIVATE_MEMBERS_ALWAYS_USE_PROTECTED'
- key: readability-identifier-naming.PrivateMethodPrefix
value: 'NO_PRIVATE_METHODS_ALWAYS_USE_PROTECTED'
- key: readability-identifier-naming.PrivateMemberCase
value: 'lower_case'
- key: readability-identifier-naming.PrivateMemberSuffix
value: '_'
- key: readability-identifier-naming.PrivateMethodCase
value: 'lower_case'
- key: readability-identifier-naming.PrivateMethodSuffix
value: '_'
- key: readability-identifier-naming.ClassMemberCase
value: 'lower_case'
- key: readability-identifier-naming.ClassMemberCase
@@ -125,3 +156,5 @@ CheckOptions:
value: 'lower_case'
- key: readability-identifier-naming.VirtualMethodSuffix
value: ''
- key: readability-qualified-auto.AddConstToQualified
value: 0

View File

@@ -1,17 +1,29 @@
{
"name": "ESPHome Dev",
"context": "..",
"dockerFile": "../docker/Dockerfile.dev",
"postCreateCommand": "mkdir -p config && pip3 install -e .",
"runArgs": ["--privileged", "-e", "ESPHOME_DASHBOARD_USE_PING=1"],
"image": "esphome/esphome-lint:dev",
"postCreateCommand": [
"script/devcontainer-post-create"
],
"runArgs": [
"--privileged",
"-e",
"ESPHOME_DASHBOARD_USE_PING=1"
],
"appPort": 6052,
"extensions": [
// python
"ms-python.python",
"visualstudioexptteam.vscodeintellicode",
"redhat.vscode-yaml"
// yaml
"redhat.vscode-yaml",
// cpp
"ms-vscode.cpptools",
// editorconfig
"editorconfig.editorconfig",
],
"settings": {
"python.pythonPath": "/usr/local/bin/python",
"python.languageServer": "Pylance",
"python.pythonPath": "/usr/bin/python3",
"python.linting.pylintEnabled": true,
"python.linting.enabled": true,
"python.formatting.provider": "black",
@@ -19,7 +31,7 @@
"editor.formatOnSave": true,
"editor.formatOnType": true,
"files.trimTrailingWhitespace": true,
"terminal.integrated.shell.linux": "/bin/bash",
"terminal.integrated.defaultProfile.linux": "bash",
"yaml.customTags": [
"!secret scalar",
"!lambda scalar",
@@ -27,6 +39,18 @@
"!include_dir_list scalar",
"!include_dir_merge_list scalar",
"!include_dir_merge_named scalar"
]
],
"files.exclude": {
"**/.git": true,
"**/.DS_Store": true,
"**/*.pyc": {
"when": "$(basename).py"
},
"**/__pycache__": true
},
"files.associations": {
"**/.vscode/*.json": "jsonc"
},
"C_Cpp.clang_format_path": "/usr/bin/clang-format-11",
}
}

View File

@@ -103,6 +103,10 @@ venv.bak/
# mypy
.mypy_cache/
# PlatformIO
.pio/
# ESPHome
config/
examples/
Dockerfile

View File

@@ -7,7 +7,7 @@ insert_final_newline = true
charset = utf-8
# python
[*.{py}]
[*.py]
indent_style = space
indent_size = 4
@@ -25,4 +25,9 @@ indent_size = 2
[*.{yaml,yml}]
indent_style = space
indent_size = 2
quote_type = single
quote_type = double
# JSON
[*.json]
indent_style = space
indent_size = 2

2
.gitattributes vendored Normal file
View File

@@ -0,0 +1,2 @@
# Normalize line endings to LF in the repository
* text eol=lf

8
.github/FUNDING.yml vendored
View File

@@ -1,8 +1,4 @@
---
# These are supported funding model platforms
github:
patreon: ottowinter
open_collective:
ko_fi:
tidelift:
custom: https://esphome.io/guides/supporters.html
custom: https://www.nabucasa.com

View File

@@ -1,3 +1,4 @@
---
blank_issues_enabled: false
contact_links:
- name: Issue Tracker
@@ -5,8 +6,10 @@ contact_links:
about: Please create bug reports in the dedicated issue tracker.
- name: Feature Request Tracker
url: https://github.com/esphome/feature-requests
about: Please create feature requests in the dedicated feature request tracker.
about: |
Please create feature requests in the dedicated feature request tracker.
- name: Frequently Asked Question
url: https://esphome.io/guides/faq.html
about: Please view the FAQ for common questions and what to include in a bug report.
about: |
Please view the FAQ for common questions and what
to include in a bug report.

View File

@@ -1,10 +1,37 @@
## Description:
# What does this implement/fix?
Quick description and explanation of changes
**Related issue (if applicable):** fixes <link to issue>
## Types of changes
- [ ] 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)
- [ ] Other
**Related issue or feature (if applicable):** 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
- [ ] ESP32
- [ ] ESP32 IDF
- [ ] ESP8266
## 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
```
## Checklist:
- [ ] The code change is tested and works locally.
- [ ] Tests have been added to verify that the new code works (under `tests/` folder).

View File

@@ -1,9 +1,15 @@
---
version: 2
updates:
- package-ecosystem: "pip"
- package-ecosystem: pip
directory: "/"
schedule:
interval: "daily"
interval: daily
ignore:
# Hypotehsis is only used for testing and is updated quite often
- dependency-name: hypothesis
- package-ecosystem: github-actions
directory: "/"
schedule:
interval: daily
open-pull-requests-limit: 10

View File

@@ -1,7 +0,0 @@
comment: >-
https://github.com/esphome/esphome/issues/430
issueConfigs:
- content:
- "OTHERWISE THE ISSUE WILL BE CLOSED AUTOMATICALLY"
caseInsensitive: false

36
.github/lock.yml vendored
View File

@@ -1,36 +0,0 @@
# Configuration for Lock Threads - https://github.com/dessant/lock-threads
# Number of days of inactivity before a closed issue or pull request is locked
daysUntilLock: 7
# Skip issues and pull requests created before a given timestamp. Timestamp must
# follow ISO 8601 (`YYYY-MM-DD`). Set to `false` to disable
skipCreatedBefore: false
# Issues and pull requests with these labels will be ignored. Set to `[]` to disable
exemptLabels:
- keep-open
# Label to add before locking, such as `outdated`. Set to `false` to disable
lockLabel: false
# Comment to post before locking. Set to `false` to disable
lockComment: false
# Assign `resolved` as the reason for locking. Set to `false` to disable
setLockReason: false
# Limit to only `issues` or `pulls`
# only: issues
# Optionally, specify configuration settings just for `issues` or `pulls`
# issues:
# exemptLabels:
# - help-wanted
# lockLabel: outdated
# pulls:
# daysUntilLock: 30
# Repository to extend settings from
# _extends: repo

59
.github/stale.yml vendored
View File

@@ -1,59 +0,0 @@
# Configuration for probot-stale - https://github.com/probot/stale
# Number of days of inactivity before an Issue or Pull Request becomes stale
daysUntilStale: 60
# Number of days of inactivity before an Issue or Pull Request with the stale label is closed.
# Set to false to disable. If disabled, issues still need to be closed manually, but will remain marked as stale.
daysUntilClose: 7
# Only issues or pull requests with all of these labels are check if stale. Defaults to `[]` (disabled)
onlyLabels: []
# Issues or Pull Requests with these labels will never be considered stale. Set to `[]` to disable
exemptLabels:
- not-stale
# Set to true to ignore issues in a project (defaults to false)
exemptProjects: false
# Set to true to ignore issues in a milestone (defaults to false)
exemptMilestones: true
# Set to true to ignore issues with an assignee (defaults to false)
exemptAssignees: false
# Label to use when marking as stale
staleLabel: stale
# Comment to post when marking as stale. Set to `false` to disable
markComment: >
This issue has been automatically marked as stale because it has not had
recent activity. It will be closed if no further activity occurs. Thank you
for your contributions.
# Comment to post when removing the stale label.
# unmarkComment: >
# Your comment here.
# Comment to post when closing a stale Issue or Pull Request.
# closeComment: >
# Your comment here.
# Limit the number of actions per hour, from 1-30. Default is 30
limitPerRun: 10
# Limit to only `issues` or `pulls`
only: pulls
# Optionally, specify configuration settings that are specific to just 'issues' or 'pulls':
# pulls:
# daysUntilStale: 30
# markComment: >
# This pull request has been automatically marked as stale because it has not had
# recent activity. It will be closed if no further activity occurs. Thank you
# for your contributions.
# issues:
# exemptLabels:
# - confirmed

View File

@@ -1,17 +1,27 @@
---
name: CI for docker images
# Only run when docker paths change
# yamllint disable-line rule:truthy
on:
push:
branches: [dev, beta, master]
branches: [dev, beta, release]
paths:
- 'docker/**'
- '.github/workflows/**'
- "docker/**"
- ".github/workflows/**"
- "requirements*.txt"
- "platformio.ini"
pull_request:
paths:
- 'docker/**'
- '.github/workflows/**'
- "docker/**"
- ".github/workflows/**"
- "requirements*.txt"
- "platformio.ini"
permissions:
contents: read
packages: read
jobs:
check-docker:
@@ -21,35 +31,26 @@ jobs:
fail-fast: false
matrix:
arch: [amd64, armv7, aarch64]
build_type: ["hassio", "docker"]
build_type: ["ha-addon", "docker", "lint"]
steps:
- uses: actions/checkout@v2
- name: Set up env variables
run: |
base_version="2.6.0"
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if [[ "${{ matrix.build_type }}" == "hassio" ]]; then
build_from="esphome/esphome-hassio-base-${{ matrix.arch }}:${base_version}"
build_to="esphome/esphome-hassio-${{ matrix.arch }}"
dockerfile="docker/Dockerfile.hassio"
else
build_from="esphome/esphome-base-${{ matrix.arch }}:${base_version}"
build_to="esphome/esphome-${{ matrix.arch }}"
dockerfile="docker/Dockerfile"
fi
echo "BUILD_FROM=${build_from}" >> $GITHUB_ENV
echo "BUILD_TO=${build_to}" >> $GITHUB_ENV
echo "DOCKERFILE=${dockerfile}" >> $GITHUB_ENV
- name: Pull for cache
- name: Set TAG
run: |
docker pull "${BUILD_TO}:dev" || true
- name: Register QEMU binfmt
run: docker run --rm --privileged multiarch/qemu-user-static:5.0.0-2 --reset -p yes
- run: |
docker build \
--build-arg "BUILD_FROM=${BUILD_FROM}" \
--build-arg "BUILD_VERSION=ci" \
--cache-from "${BUILD_TO}:dev" \
--file "${DOCKERFILE}" \
.
echo "TAG=check" >> $GITHUB_ENV
- name: Run build
run: |
docker/build.py \
--tag "${TAG}" \
--arch "${{ matrix.arch }}" \
--build-type "${{ matrix.build_type }}" \
build

View File

@@ -1,178 +1,181 @@
# THESE JOBS ARE COPIED IN release.yml and release-dev.yml
# PLEASE ALSO UPDATE THOSE FILES WHEN CHANGING LINES HERE
---
name: CI
# yamllint disable-line rule:truthy
on:
push:
# On dev branch release-dev already performs CI checks
# On other branches the `pull_request` trigger will be used
branches: [beta, master]
branches: [dev, beta, release]
pull_request:
permissions:
contents: read
concurrency:
# yamllint disable-line rule:line-length
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
lint-clang-format:
ci:
name: ${{ matrix.name }}
runs-on: ubuntu-latest
# cpp lint job runs with esphome-lint docker image so that clang-format-*
# doesn't have to be installed
container: esphome/esphome-lint:latest
steps:
- uses: actions/checkout@v2
# Cache platformio intermediary files (like libraries etc)
# Note: platformio platform versions should be cached via the esphome-lint image
- name: Cache Platformio
uses: actions/cache@v1
with:
path: .pio
key: lint-cpp-pio-${{ hashFiles('platformio.ini') }}
restore-keys: |
lint-cpp-pio-
# Set up the pio project so that the cpp checks know how files are compiled
# (build flags, libraries etc)
- name: Set up platformio environment
run: pio init --ide atom
- name: Run clang-format
run: script/clang-format -i
- name: Suggest changes
run: script/ci-suggest-changes
lint-clang-tidy:
runs-on: ubuntu-latest
# cpp lint job runs with esphome-lint docker image so that clang-format-*
# doesn't have to be installed
container: esphome/esphome-lint:latest
# Split clang-tidy check into 4 jobs. Each one will check 1/4th of the .cpp files
strategy:
fail-fast: false
matrix:
split: [1, 2, 3, 4]
include:
- id: ci-custom
name: Run script/ci-custom
- id: lint-python
name: Run script/lint-python
- id: test
file: tests/test1.yaml
name: Test tests/test1.yaml
pio_cache_key: test1
- id: test
file: tests/test2.yaml
name: Test tests/test2.yaml
pio_cache_key: test2
- id: test
file: tests/test3.yaml
name: Test tests/test3.yaml
pio_cache_key: test3
- id: test
file: tests/test4.yaml
name: Test tests/test4.yaml
pio_cache_key: test4
- id: test
file: tests/test5.yaml
name: Test tests/test5.yaml
pio_cache_key: test5
- id: pytest
name: Run pytest
- id: clang-format
name: Run script/clang-format
- id: clang-tidy
name: Run script/clang-tidy for ESP8266
options: --environment esp8266-arduino-tidy --grep USE_ESP8266
pio_cache_key: tidyesp8266
- id: clang-tidy
name: Run script/clang-tidy for ESP32 Arduino 1/4
options: --environment esp32-arduino-tidy --split-num 4 --split-at 1
pio_cache_key: tidyesp32
- id: clang-tidy
name: Run script/clang-tidy for ESP32 Arduino 2/4
options: --environment esp32-arduino-tidy --split-num 4 --split-at 2
pio_cache_key: tidyesp32
- id: clang-tidy
name: Run script/clang-tidy for ESP32 Arduino 3/4
options: --environment esp32-arduino-tidy --split-num 4 --split-at 3
pio_cache_key: tidyesp32
- id: clang-tidy
name: Run script/clang-tidy for ESP32 Arduino 4/4
options: --environment esp32-arduino-tidy --split-num 4 --split-at 4
pio_cache_key: tidyesp32
- id: clang-tidy
name: Run script/clang-tidy for ESP32 IDF
options: --environment esp32-idf-tidy --grep USE_ESP_IDF
pio_cache_key: tidyesp32-idf
- id: yamllint
name: Run yamllint
steps:
- uses: actions/checkout@v2
# Cache platformio intermediary files (like libraries etc)
# Note: platformio platform versions should be cached via the esphome-lint image
- name: Cache Platformio
uses: actions/cache@v1
with:
path: .pio
key: lint-cpp-pio-${{ hashFiles('platformio.ini') }}
restore-keys: |
lint-cpp-pio-
# Set up the pio project so that the cpp checks know how files are compiled
# (build flags, libraries etc)
- name: Set up platformio environment
run: pio init --ide atom
- name: Register problem matchers
run: |
echo "::add-matcher::.github/workflows/matchers/clang-tidy.json"
echo "::add-matcher::.github/workflows/matchers/gcc.json"
- name: Run clang-tidy
run: script/clang-tidy --all-headers --fix --split-num 4 --split-at ${{ matrix.split }}
- name: Suggest changes
run: script/ci-suggest-changes
lint-python:
# Don't use the esphome-lint docker image because it may contain outdated requirements.
# This way, all dependencies are cached via the cache action.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
uses: actions/setup-python@v4
id: python
with:
python-version: '3.7'
- name: Cache pip modules
uses: actions/cache@v1
python-version: "3.9"
- name: Cache virtualenv
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: esphome-pip-3.7-${{ hashFiles('setup.py') }}
path: .venv
# yamllint disable-line rule:line-length
key: venv-${{ steps.python.outputs.python-version }}-${{ hashFiles('requirements*.txt') }}
restore-keys: |
esphome-pip-3.7-
- name: Set up python environment
run: script/setup
venv-${{ steps.python.outputs.python-version }}-
- name: Set up virtualenv
# yamllint disable rule:line-length
run: |
python -m venv .venv
source .venv/bin/activate
pip install -U pip
pip install -r requirements.txt -r requirements_optional.txt -r requirements_test.txt
pip install -e .
echo "$GITHUB_WORKSPACE/.venv/bin" >> $GITHUB_PATH
echo "VIRTUAL_ENV=$GITHUB_WORKSPACE/.venv" >> $GITHUB_ENV
# yamllint enable rule:line-length
# Use per check platformio cache because checks use different parts
- name: Cache platformio
uses: actions/cache@v3
with:
path: ~/.platformio
# yamllint disable-line rule:line-length
key: platformio-${{ matrix.pio_cache_key }}-${{ hashFiles('platformio.ini') }}
if: matrix.id == 'test' || matrix.id == 'clang-tidy'
- name: Install clang tools
run: |
sudo apt-get install \
clang-format-11 \
clang-tidy-11
if: matrix.id == 'clang-tidy' || matrix.id == 'clang-format'
- name: Register problem matchers
run: |
echo "::add-matcher::.github/workflows/matchers/ci-custom.json"
echo "::add-matcher::.github/workflows/matchers/lint-python.json"
echo "::add-matcher::.github/workflows/matchers/python.json"
- name: Lint Custom
run: script/ci-custom.py
- name: Lint Python
run: script/lint-python
- name: Lint CODEOWNERS
run: script/build_codeowners.py --check
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test:
- test1
- test2
- test3
- test4
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Cache pip modules
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: esphome-pip-3.7-${{ hashFiles('setup.py') }}
restore-keys: |
esphome-pip-3.7-
# Use per test platformio cache because tests have different platform versions
- name: Cache ~/.platformio
uses: actions/cache@v1
with:
path: ~/.platformio
key: test-home-platformio-${{ matrix.test }}-${{ hashFiles('esphome/core_config.py') }}
restore-keys: |
test-home-platformio-${{ matrix.test }}-
- name: Set up environment
run: script/setup
- name: Register problem matchers
run: |
echo "::add-matcher::.github/workflows/matchers/pytest.json"
echo "::add-matcher::.github/workflows/matchers/gcc.json"
echo "::add-matcher::.github/workflows/matchers/python.json"
- run: esphome tests/${{ matrix.test }}.yaml compile
echo "::add-matcher::.github/workflows/matchers/clang-tidy.json"
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Cache pip modules
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: esphome-pip-3.7-${{ hashFiles('setup.py') }}
restore-keys: |
esphome-pip-3.7-
- name: Set up environment
run: script/setup
- name: Install Github Actions annotator
run: pip install pytest-github-actions-annotate-failures
- name: Register problem matchers
- name: Lint Custom
run: |
echo "::add-matcher::.github/workflows/matchers/python.json"
script/ci-custom.py
script/build_codeowners.py --check
if: matrix.id == 'ci-custom'
- name: Lint Python
run: script/lint-python -a
if: matrix.id == 'lint-python'
- run: esphome compile ${{ matrix.file }}
if: matrix.id == 'test'
env:
# Also cache libdeps, store them in a ~/.platformio subfolder
PLATFORMIO_LIBDEPS_DIR: ~/.platformio/libdeps
- name: Run pytest
run: |
pytest \
-qq \
--durations=10 \
-o console_output_style=count \
tests
pytest -vv --tb=native tests
if: matrix.id == 'pytest'
# Also run git-diff-index so that the step is marked as failed on
# formatting errors, since clang-format doesn't do anything but
# change files if -i is passed.
- name: Run clang-format
run: |
script/clang-format -i
git diff-index --quiet HEAD --
if: matrix.id == 'clang-format'
- name: Run clang-tidy
run: |
script/clang-tidy --all-headers --fix ${{ matrix.options }}
if: matrix.id == 'clang-tidy'
env:
# Also cache libdeps, store them in a ~/.platformio subfolder
PLATFORMIO_LIBDEPS_DIR: ~/.platformio/libdeps
- name: Run yamllint
if: matrix.id == 'yamllint'
uses: frenck/action-yamllint@v1.3.0
- name: Suggested changes
run: script/ci-suggest-changes
# yamllint disable-line rule:line-length
if: always() && (matrix.id == 'clang-tidy' || matrix.id == 'clang-format' || matrix.id == 'lint-python')

29
.github/workflows/lock.yml vendored Normal file
View File

@@ -0,0 +1,29 @@
---
name: Lock
# yamllint disable-line rule:truthy
on:
schedule:
- cron: "30 0 * * *"
workflow_dispatch:
permissions:
issues: write
pull-requests: write
concurrency:
group: lock
jobs:
lock:
runs-on: ubuntu-latest
steps:
- uses: dessant/lock-threads@v3
with:
pr-inactive-days: "1"
pr-lock-reason: ""
exclude-any-pr-labels: keep-open
issue-inactive-days: "7"
issue-lock-reason: ""
exclude-any-issue-labels: keep-open

View File

@@ -4,7 +4,7 @@
"owner": "ci-custom",
"pattern": [
{
"regexp": "^ERROR (.*):(\\d+):(\\d+) - (.*)$",
"regexp": "^(.*):(\\d+):(\\d+):\\s+lint:\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,

View File

@@ -5,7 +5,7 @@
"severity": "error",
"pattern": [
{
"regexp": "^(.*):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
"regexp": "^src/(.*):(\\d+):(\\d+):\\s+(?:fatal\\s+)?(warning|error):\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,

View File

@@ -1,11 +1,22 @@
{
"problemMatcher": [
{
"owner": "black",
"severity": "error",
"pattern": [
{
"regexp": "^(.*): (Please format this file with the black formatter)",
"file": 1,
"message": 2
}
]
},
{
"owner": "flake8",
"severity": "error",
"pattern": [
{
"regexp": "^(.*):(\\d+) - ([EFCDNW]\\d{3}.*)$",
"regexp": "^(.*):(\\d+): ([EFCDNW]\\d{3}.*)$",
"file": 1,
"line": 2,
"message": 3
@@ -17,7 +28,7 @@
"severity": "error",
"pattern": [
{
"regexp": "^(.*):(\\d+) - (\\[[EFCRW]\\d{4}\\(.*\\),.*\\].*)$",
"regexp": "^(.*):(\\d+): (\\[[EFCRW]\\d{4}\\(.*\\),.*\\].*)$",
"file": 1,
"line": 2,
"message": 3

19
.github/workflows/matchers/pytest.json vendored Normal file
View File

@@ -0,0 +1,19 @@
{
"problemMatcher": [
{
"owner": "pytest",
"fileLocation": "absolute",
"pattern": [
{
"regexp": "^\\s+File \"(.*)\", line (\\d+), in (.*)$",
"file": 1,
"line": 2
},
{
"regexp": "^\\s+(.*)$",
"message": 1
}
]
}
]
}

View File

@@ -1,264 +0,0 @@
name: Publish dev releases to docker hub
on:
push:
branches:
- dev
jobs:
# THE LINT/TEST JOBS ARE COPIED FROM ci.yaml
lint-clang-format:
runs-on: ubuntu-latest
# cpp lint job runs with esphome-lint docker image so that clang-format-*
# doesn't have to be installed
container: esphome/esphome-lint:latest
steps:
- uses: actions/checkout@v2
# Cache platformio intermediary files (like libraries etc)
# Note: platformio platform versions should be cached via the esphome-lint image
- name: Cache Platformio
uses: actions/cache@v1
with:
path: .pio
key: lint-cpp-pio-${{ hashFiles('platformio.ini') }}
restore-keys: |
lint-cpp-pio-
# Set up the pio project so that the cpp checks know how files are compiled
# (build flags, libraries etc)
- name: Set up platformio environment
run: pio init --ide atom
- name: Run clang-format
run: script/clang-format -i
- name: Suggest changes
run: script/ci-suggest-changes
lint-clang-tidy:
runs-on: ubuntu-latest
# cpp lint job runs with esphome-lint docker image so that clang-format-*
# doesn't have to be installed
container: esphome/esphome-lint:latest
# Split clang-tidy check into 4 jobs. Each one will check 1/4th of the .cpp files
strategy:
fail-fast: false
matrix:
split: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v2
# Cache platformio intermediary files (like libraries etc)
# Note: platformio platform versions should be cached via the esphome-lint image
- name: Cache Platformio
uses: actions/cache@v1
with:
path: .pio
key: lint-cpp-pio-${{ hashFiles('platformio.ini') }}
restore-keys: |
lint-cpp-pio-
# Set up the pio project so that the cpp checks know how files are compiled
# (build flags, libraries etc)
- name: Set up platformio environment
run: pio init --ide atom
- name: Register problem matchers
run: |
echo "::add-matcher::.github/workflows/matchers/clang-tidy.json"
echo "::add-matcher::.github/workflows/matchers/gcc.json"
- name: Run clang-tidy
run: script/clang-tidy --all-headers --fix --split-num 4 --split-at ${{ matrix.split }}
- name: Suggest changes
run: script/ci-suggest-changes
lint-python:
# Don't use the esphome-lint docker image because it may contain outdated requirements.
# This way, all dependencies are cached via the cache action.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Cache pip modules
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: esphome-pip-3.7-${{ hashFiles('setup.py') }}
restore-keys: |
esphome-pip-3.7-
- name: Set up python environment
run: script/setup
- name: Register problem matchers
run: |
echo "::add-matcher::.github/workflows/matchers/ci-custom.json"
echo "::add-matcher::.github/workflows/matchers/lint-python.json"
echo "::add-matcher::.github/workflows/matchers/python.json"
- name: Lint Custom
run: script/ci-custom.py
- name: Lint Python
run: script/lint-python
- name: Lint CODEOWNERS
run: script/build_codeowners.py --check
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test:
- test1
- test2
- test3
- test4
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Cache pip modules
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: esphome-pip-3.7-${{ hashFiles('setup.py') }}
restore-keys: |
esphome-pip-3.7-
# Use per test platformio cache because tests have different platform versions
- name: Cache ~/.platformio
uses: actions/cache@v1
with:
path: ~/.platformio
key: test-home-platformio-${{ matrix.test }}-${{ hashFiles('esphome/core_config.py') }}
restore-keys: |
test-home-platformio-${{ matrix.test }}-
- name: Set up environment
run: script/setup
- name: Register problem matchers
run: |
echo "::add-matcher::.github/workflows/matchers/gcc.json"
echo "::add-matcher::.github/workflows/matchers/python.json"
- run: esphome tests/${{ matrix.test }}.yaml compile
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Cache pip modules
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: esphome-pip-3.7-${{ hashFiles('setup.py') }}
restore-keys: |
esphome-pip-3.7-
- name: Set up environment
run: script/setup
- name: Install Github Actions annotator
run: pip install pytest-github-actions-annotate-failures
- name: Register problem matchers
run: |
echo "::add-matcher::.github/workflows/matchers/python.json"
- name: Run pytest
run: |
pytest \
-qq \
--durations=10 \
-o console_output_style=count \
tests
deploy-docker:
name: Build and publish docker containers
if: github.repository == 'esphome/esphome'
runs-on: ubuntu-latest
needs: [lint-clang-format, lint-clang-tidy, lint-python, test, pytest]
strategy:
matrix:
arch: [amd64, armv7, aarch64]
# Hassio dev image doesn't use esphome/esphome-hassio-$arch and uses base directly
build_type: ["docker"]
steps:
- uses: actions/checkout@v2
- name: Set TAG
run: |
TAG="${GITHUB_SHA:0:7}"
echo "TAG=${TAG}" >> $GITHUB_ENV
- name: Set up env variables
run: |
base_version="2.6.0"
if [[ "${{ matrix.build_type }}" == "hassio" ]]; then
build_from="esphome/esphome-hassio-base-${{ matrix.arch }}:${base_version}"
build_to="esphome/esphome-hassio-${{ matrix.arch }}"
dockerfile="docker/Dockerfile.hassio"
else
build_from="esphome/esphome-base-${{ matrix.arch }}:${base_version}"
build_to="esphome/esphome-${{ matrix.arch }}"
dockerfile="docker/Dockerfile"
fi
echo "BUILD_FROM=${build_from}" >> $GITHUB_ENV
echo "BUILD_TO=${build_to}" >> $GITHUB_ENV
echo "DOCKERFILE=${dockerfile}" >> $GITHUB_ENV
- name: Pull for cache
run: |
docker pull "${BUILD_TO}:dev" || true
- name: Register QEMU binfmt
run: docker run --rm --privileged multiarch/qemu-user-static:5.0.0-2 --reset -p yes
- run: |
docker build \
--build-arg "BUILD_FROM=${BUILD_FROM}" \
--build-arg "BUILD_VERSION=${TAG}" \
--tag "${BUILD_TO}:${TAG}" \
--tag "${BUILD_TO}:dev" \
--cache-from "${BUILD_TO}:dev" \
--file "${DOCKERFILE}" \
.
- name: Log in to docker hub
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: docker login -u "${DOCKER_USER}" -p "${DOCKER_PASSWORD}"
- run: |
docker push "${BUILD_TO}:${TAG}"
docker push "${BUILD_TO}:dev"
deploy-docker-manifest:
if: github.repository == 'esphome/esphome'
runs-on: ubuntu-latest
needs: [deploy-docker]
steps:
- name: Enable experimental manifest support
run: |
mkdir -p ~/.docker
echo "{\"experimental\": \"enabled\"}" > ~/.docker/config.json
- name: Set TAG
run: |
TAG="${GITHUB_SHA:0:7}"
echo "TAG=${TAG}" >> $GITHUB_ENV
- name: Log in to docker hub
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: docker login -u "${DOCKER_USER}" -p "${DOCKER_PASSWORD}"
- name: "Create the manifest"
run: |
docker manifest create esphome/esphome:${TAG} \
esphome/esphome-aarch64:${TAG} \
esphome/esphome-amd64:${TAG} \
esphome/esphome-armv7:${TAG}
docker manifest push esphome/esphome:${TAG}
docker manifest create esphome/esphome:dev \
esphome/esphome-aarch64:${TAG} \
esphome/esphome-amd64:${TAG} \
esphome/esphome-armv7:${TAG}
docker manifest push esphome/esphome:dev

View File

@@ -1,188 +1,49 @@
---
name: Publish Release
# yamllint disable-line rule:truthy
on:
workflow_dispatch:
release:
types: [published]
schedule:
- cron: "0 2 * * *"
permissions:
contents: read
jobs:
# THE LINT/TEST JOBS ARE COPIED FROM ci.yaml
lint-clang-format:
init:
name: Initialize build
runs-on: ubuntu-latest
# cpp lint job runs with esphome-lint docker image so that clang-format-*
# doesn't have to be installed
container: esphome/esphome-lint:latest
outputs:
tag: ${{ steps.tag.outputs.tag }}
steps:
- uses: actions/checkout@v2
# Cache platformio intermediary files (like libraries etc)
# Note: platformio platform versions should be cached via the esphome-lint image
- name: Cache Platformio
uses: actions/cache@v1
with:
path: .pio
key: lint-cpp-pio-${{ hashFiles('platformio.ini') }}
restore-keys: |
lint-cpp-pio-
# Set up the pio project so that the cpp checks know how files are compiled
# (build flags, libraries etc)
- name: Set up platformio environment
run: pio init --ide atom
- name: Run clang-format
run: script/clang-format -i
- name: Suggest changes
run: script/ci-suggest-changes
lint-clang-tidy:
runs-on: ubuntu-latest
# cpp lint job runs with esphome-lint docker image so that clang-format-*
# doesn't have to be installed
container: esphome/esphome-lint:latest
# Split clang-tidy check into 4 jobs. Each one will check 1/4th of the .cpp files
strategy:
fail-fast: false
matrix:
split: [1, 2, 3, 4]
steps:
- uses: actions/checkout@v2
# Cache platformio intermediary files (like libraries etc)
# Note: platformio platform versions should be cached via the esphome-lint image
- name: Cache Platformio
uses: actions/cache@v1
with:
path: .pio
key: lint-cpp-pio-${{ hashFiles('platformio.ini') }}
restore-keys: |
lint-cpp-pio-
# Set up the pio project so that the cpp checks know how files are compiled
# (build flags, libraries etc)
- name: Set up platformio environment
run: pio init --ide atom
- name: Register problem matchers
- uses: actions/checkout@v3
- name: Get tag
id: tag
# yamllint disable rule:line-length
run: |
echo "::add-matcher::.github/workflows/matchers/clang-tidy.json"
echo "::add-matcher::.github/workflows/matchers/gcc.json"
- name: Run clang-tidy
run: script/clang-tidy --all-headers --fix --split-num 4 --split-at ${{ matrix.split }}
- name: Suggest changes
run: script/ci-suggest-changes
lint-python:
# Don't use the esphome-lint docker image because it may contain outdated requirements.
# This way, all dependencies are cached via the cache action.
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Cache pip modules
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: esphome-pip-3.7-${{ hashFiles('setup.py') }}
restore-keys: |
esphome-pip-3.7-
- name: Set up python environment
run: script/setup
- name: Register problem matchers
run: |
echo "::add-matcher::.github/workflows/matchers/ci-custom.json"
echo "::add-matcher::.github/workflows/matchers/lint-python.json"
echo "::add-matcher::.github/workflows/matchers/python.json"
- name: Lint Custom
run: script/ci-custom.py
- name: Lint Python
run: script/lint-python
- name: Lint CODEOWNERS
run: script/build_codeowners.py --check
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test:
- test1
- test2
- test3
- test4
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Cache pip modules
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: esphome-pip-3.7-${{ hashFiles('setup.py') }}
restore-keys: |
esphome-pip-3.7-
# Use per test platformio cache because tests have different platform versions
- name: Cache ~/.platformio
uses: actions/cache@v1
with:
path: ~/.platformio
key: test-home-platformio-${{ matrix.test }}-${{ hashFiles('esphome/core_config.py') }}
restore-keys: |
test-home-platformio-${{ matrix.test }}-
- name: Set up environment
run: script/setup
- name: Register problem matchers
run: |
echo "::add-matcher::.github/workflows/matchers/gcc.json"
echo "::add-matcher::.github/workflows/matchers/python.json"
- run: esphome tests/${{ matrix.test }}.yaml compile
pytest:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: '3.7'
- name: Cache pip modules
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: esphome-pip-3.7-${{ hashFiles('setup.py') }}
restore-keys: |
esphome-pip-3.7-
- name: Set up environment
run: script/setup
- name: Install Github Actions annotator
run: pip install pytest-github-actions-annotate-failures
- name: Register problem matchers
run: |
echo "::add-matcher::.github/workflows/matchers/python.json"
- name: Run pytest
run: |
pytest \
-qq \
--durations=10 \
-o console_output_style=count \
tests
if [[ "$GITHUB_EVENT_NAME" = "release" ]]; then
TAG="${GITHUB_REF#refs/tags/}"
else
TAG=$(cat esphome/const.py | sed -n -E "s/^__version__\s+=\s+\"(.+)\"$/\1/p")
today="$(date --utc '+%Y%m%d')"
TAG="${TAG}${today}"
fi
echo "::set-output name=tag::${TAG}"
# yamllint enable rule:line-length
deploy-pypi:
name: Build and publish to PyPi
if: github.repository == 'esphome/esphome'
needs: [lint-clang-format, lint-clang-tidy, lint-python, test, pytest]
if: github.repository == 'esphome/esphome' && github.event_name == 'release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v1
uses: actions/setup-python@v4
with:
python-version: '3.x'
python-version: "3.x"
- name: Set up python environment
run: |
script/setup
@@ -198,130 +59,102 @@ jobs:
deploy-docker:
name: Build and publish docker containers
if: github.repository == 'esphome/esphome'
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
needs: [lint-clang-format, lint-clang-tidy, lint-python, test, pytest]
needs: [init]
strategy:
matrix:
arch: [amd64, armv7, aarch64]
build_type: ["hassio", "docker"]
build_type: ["ha-addon", "docker", "lint"]
steps:
- uses: actions/checkout@v2
- name: Set TAG
run: |
TAG="${GITHUB_REF#refs/tags/v}"
echo "TAG=${TAG}" >> $GITHUB_ENV
- name: Set up env variables
run: |
base_version="2.6.0"
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
if [[ "${{ matrix.build_type }}" == "hassio" ]]; then
build_from="esphome/esphome-hassio-base-${{ matrix.arch }}:${base_version}"
build_to="esphome/esphome-hassio-${{ matrix.arch }}"
dockerfile="docker/Dockerfile.hassio"
else
build_from="esphome/esphome-base-${{ matrix.arch }}:${base_version}"
build_to="esphome/esphome-${{ matrix.arch }}"
dockerfile="docker/Dockerfile"
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
if [[ "${{ github.event.release.prerelease }}" == "true" ]]; then
cache_tag="beta"
else
cache_tag="latest"
fi
# Set env variables so these values don't need to be calculated again
echo "BUILD_FROM=${build_from}" >> $GITHUB_ENV
echo "BUILD_TO=${build_to}" >> $GITHUB_ENV
echo "DOCKERFILE=${dockerfile}" >> $GITHUB_ENV
echo "CACHE_TAG=${cache_tag}" >> $GITHUB_ENV
- name: Pull for cache
run: |
docker pull "${BUILD_TO}:${CACHE_TAG}" || true
- name: Register QEMU binfmt
run: docker run --rm --privileged multiarch/qemu-user-static:5.0.0-2 --reset -p yes
- run: |
docker build \
--build-arg "BUILD_FROM=${BUILD_FROM}" \
--build-arg "BUILD_VERSION=${TAG}" \
--tag "${BUILD_TO}:${TAG}" \
--cache-from "${BUILD_TO}:${CACHE_TAG}" \
--file "${DOCKERFILE}" \
.
- name: Log in to docker hub
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: docker login -u "${DOCKER_USER}" -p "${DOCKER_PASSWORD}"
- run: docker push "${BUILD_TO}:${TAG}"
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the GitHub container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
# Always publish to beta tag (also full releases)
- name: Publish docker beta tag
- name: Build and push
run: |
docker tag "${BUILD_TO}:${TAG}" "${BUILD_TO}:beta"
docker push "${BUILD_TO}:beta"
- if: ${{ !github.event.release.prerelease }}
name: Publish docker latest tag
run: |
docker tag "${BUILD_TO}:${TAG}" "${BUILD_TO}:latest"
docker push "${BUILD_TO}:latest"
docker/build.py \
--tag "${{ needs.init.outputs.tag }}" \
--arch "${{ matrix.arch }}" \
--build-type "${{ matrix.build_type }}" \
build \
--push
deploy-docker-manifest:
if: github.repository == 'esphome/esphome'
permissions:
contents: read
packages: write
runs-on: ubuntu-latest
needs: [deploy-docker]
needs: [init, deploy-docker]
strategy:
matrix:
build_type: ["ha-addon", "docker", "lint"]
steps:
- name: Enable experimental manifest support
run: |
mkdir -p ~/.docker
echo "{\"experimental\": \"enabled\"}" > ~/.docker/config.json
- name: Set TAG
run: |
TAG="${GITHUB_REF#refs/tags/v}"
echo "TAG=${TAG}" >> $GITHUB_ENV
- name: Log in to docker hub
env:
DOCKER_USER: ${{ secrets.DOCKER_USER }}
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }}
run: docker login -u "${DOCKER_USER}" -p "${DOCKER_PASSWORD}"
- name: "Create the manifest"
run: |
docker manifest create esphome/esphome:${TAG} \
esphome/esphome-aarch64:${TAG} \
esphome/esphome-amd64:${TAG} \
esphome/esphome-armv7:${TAG}
docker manifest push esphome/esphome:${TAG}
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.9"
- name: Enable experimental manifest support
run: |
mkdir -p ~/.docker
echo "{\"experimental\": \"enabled\"}" > ~/.docker/config.json
- name: Publish docker beta tag
run: |
docker manifest create esphome/esphome:beta \
esphome/esphome-aarch64:${TAG} \
esphome/esphome-amd64:${TAG} \
esphome/esphome-armv7:${TAG}
docker manifest push esphome/esphome:beta
- name: Log in to docker hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Log in to the GitHub container registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Publish docker latest tag
if: ${{ !github.event.release.prerelease }}
run: |
docker manifest create esphome/esphome:latest \
esphome/esphome-aarch64:${TAG} \
esphome/esphome-amd64:${TAG} \
esphome/esphome-armv7:${TAG}
docker manifest push esphome/esphome:latest
- name: Run manifest
run: |
docker/build.py \
--tag "${{ needs.init.outputs.tag }}" \
--build-type "${{ matrix.build_type }}" \
manifest
deploy-hassio-repo:
if: github.repository == 'esphome/esphome'
deploy-ha-addon-repo:
if: github.repository == 'esphome/esphome' && github.event_name == 'release'
runs-on: ubuntu-latest
needs: [deploy-docker]
steps:
- env:
TOKEN: ${{ secrets.DEPLOY_HASSIO_TOKEN }}
TOKEN: ${{ secrets.DEPLOY_HA_ADDON_REPO_TOKEN }}
# yamllint disable rule:line-length
run: |
TAG="${GITHUB_REF#refs/tags/v}"
TAG="${GITHUB_REF#refs/tags/}"
curl \
-u ":$TOKEN" \
-X POST \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/esphome/hassio/actions/workflows/bump-version.yml/dispatches \
-d "{\"ref\":\"master\",\"inputs\":{\"version\":\"$TAG\"}}"
https://api.github.com/repos/esphome/home-assistant-addon/actions/workflows/bump-version.yml/dispatches \
-d "{\"ref\":\"main\",\"inputs\":{\"version\":\"$TAG\"}}"
# yamllint enable rule:line-length

51
.github/workflows/stale.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
---
name: Stale
# yamllint disable-line rule:truthy
on:
schedule:
- cron: "30 0 * * *"
workflow_dispatch:
permissions:
issues: write
pull-requests: write
concurrency:
group: lock
jobs:
stale:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v5
with:
days-before-pr-stale: 90
days-before-pr-close: 7
days-before-issue-stale: -1
days-before-issue-close: -1
remove-stale-when-updated: true
stale-pr-label: "stale"
exempt-pr-labels: "no-stale"
stale-pr-message: >
There hasn't been any activity on this pull request recently. This
pull request has been automatically marked as stale because of that
and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.
# Use stale to automatically close issues with a
# reference to the issue tracker
close-issues:
runs-on: ubuntu-latest
steps:
- uses: actions/stale@v5
with:
days-before-pr-stale: -1
days-before-pr-close: -1
days-before-issue-stale: 1
days-before-issue-close: 1
remove-stale-when-updated: true
stale-issue-label: "stale"
exempt-issue-labels: "not-stale"
stale-issue-message: >
https://github.com/esphome/esphome/issues/430

11
.gitignore vendored
View File

@@ -13,6 +13,9 @@ __pycache__/
# Intellij Idea
.idea
# Vim
*.swp
# Hide some OS X stuff
.DS_Store
.AppleDouble
@@ -74,6 +77,7 @@ venv/
ENV/
env.bak/
venv.bak/
venv-*/
# mypy
.mypy_cache/
@@ -99,8 +103,7 @@ CMakeLists.txt
.idea/**/dynamic.xml
# CMake
cmake-build-debug/
cmake-build-release/
cmake-build-*/
CMakeCache.txt
CMakeFiles
@@ -120,4 +123,8 @@ config/
tests/build/
tests/.esphome/
/.temp-clang-tidy.cpp
/.temp/
.pio/
sdkconfig.*
!sdkconfig.defaults

View File

@@ -1,6 +1,8 @@
---
ports:
- port: 6052
onOpen: open-preview
- port: 6052
onOpen: open-preview
tasks:
- before: pyenv local $(pyenv version | grep '^3\.' | cut -d ' ' -f 1) && script/setup
command: python -m esphome config dashboard
# yamllint disable-line rule:line-length
- before: pyenv local $(pyenv version | grep '^3\.' | cut -d ' ' -f 1) && script/setup
command: python -m esphome dashboard config

View File

@@ -1,11 +1,33 @@
---
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v2.4.0
- repo: https://github.com/ambv/black
rev: 22.6.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml
- id: check-added-large-files
- id: flake8
- id: black
args:
- --safe
- --quiet
files: ^((esphome|script|tests)/.+)?[^/]+\.py$
- repo: https://gitlab.com/pycqa/flake8
rev: 4.0.1
hooks:
- id: flake8
additional_dependencies:
- flake8-docstrings==1.5.0
- pydocstyle==5.1.1
files: ^(esphome|tests)/.+\.py$
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.4.0
hooks:
- id: no-commit-to-branch
args:
- --branch=dev
- --branch=release
- --branch=beta
- repo: https://github.com/asottile/pyupgrade
rev: v3.0.0
hooks:
- id: pyupgrade
args: [--py39-plus]

35
.vscode/tasks.json vendored
View File

@@ -1,11 +1,32 @@
{
"version": "2.0.0",
"tasks": [
"version": "2.0.0",
"tasks": [
{
"label": "run",
"type": "shell",
"command": "python3 -m esphome dashboard config/",
"problemMatcher": []
},
{
"label": "clang-tidy",
"type": "shell",
"command": "./script/clang-tidy",
"problemMatcher": [
{
"label": "run",
"type": "shell",
"command": "python3 -m esphome config dashboard",
"problemMatcher": []
"owner": "clang-tidy",
"fileLocation": "absolute",
"pattern": [
{
"regexp": "^(.*):(\\d+):(\\d+):\\s+(error):\\s+(.*) \\[([a-z0-9,\\-]+)\\]\\s*$",
"file": 1,
"line": 2,
"column": 3,
"severity": 4,
"message": 5
}
]
}
]
]
}
]
}

3
.yamllint Normal file
View File

@@ -0,0 +1,3 @@
---
ignore: |
venv/

View File

@@ -13,61 +13,198 @@ esphome/core/* @esphome/core
# Integrations
esphome/components/ac_dimmer/* @glmnet
esphome/components/adc/* @esphome/core
esphome/components/addressable_light/* @justfalter
esphome/components/airthings_ble/* @jeromelaban
esphome/components/airthings_wave_mini/* @ncareau
esphome/components/airthings_wave_plus/* @jeromelaban
esphome/components/am43/* @buxtronix
esphome/components/am43/cover/* @buxtronix
esphome/components/analog_threshold/* @ianchi
esphome/components/animation/* @syndlex
esphome/components/anova/* @buxtronix
esphome/components/api/* @OttoWinter
esphome/components/async_tcp/* @OttoWinter
esphome/components/atc_mithermometer/* @ahpohl
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/bh1750/* @OttoWinter
esphome/components/binary_sensor/* @esphome/core
esphome/components/bl0939/* @ziceva
esphome/components/bl0940/* @tobias-
esphome/components/bl0942/* @dbuezas
esphome/components/ble_client/* @buxtronix
esphome/components/bluetooth_proxy/* @jesserockz
esphome/components/bme680_bsec/* @trvrnrth
esphome/components/bmp3xx/* @martgras
esphome/components/button/* @esphome/core
esphome/components/canbus/* @danielschramm @mvturnho
esphome/components/cap1188/* @MrEditor97
esphome/components/captive_portal/* @OttoWinter
esphome/components/ccs811/* @habbie
esphome/components/cd74hc4067/* @asoehlke
esphome/components/climate/* @esphome/core
esphome/components/climate_ir/* @glmnet
esphome/components/color_temperature/* @jesserockz
esphome/components/coolix/* @glmnet
esphome/components/copy/* @OttoWinter
esphome/components/cover/* @esphome/core
esphome/components/cs5460a/* @balrog-kun
esphome/components/cse7761/* @berfenger
esphome/components/ct_clamp/* @jesserockz
esphome/components/current_based/* @djwmarcx
esphome/components/dac7678/* @NickB1
esphome/components/daly_bms/* @s1lvi0
esphome/components/dashboard_import/* @esphome/core
esphome/components/debug/* @OttoWinter
esphome/components/delonghi/* @grob6000
esphome/components/dfplayer/* @glmnet
esphome/components/dht/* @OttoWinter
esphome/components/dps310/* @kbx81
esphome/components/ds1307/* @badbadc0ffee
esphome/components/dsmr/* @glmnet @zuidwijk
esphome/components/ektf2232/* @jesserockz
esphome/components/ens210/* @itn3rd77
esphome/components/esp32/* @esphome/core
esphome/components/esp32_ble/* @jesserockz
esphome/components/esp32_ble_client/* @jesserockz
esphome/components/esp32_ble_server/* @jesserockz
esphome/components/esp32_camera_web_server/* @ayufan
esphome/components/esp32_can/* @Sympatron
esphome/components/esp32_improv/* @jesserockz
esphome/components/esp8266/* @esphome/core
esphome/components/exposure_notifications/* @OttoWinter
esphome/components/ezo/* @ssieb
esphome/components/factory_reset/* @anatoly-savchenkov
esphome/components/fastled_base/* @OttoWinter
esphome/components/feedback/* @ianchi
esphome/components/fingerprint_grow/* @OnFreund @loongyh
esphome/components/globals/* @esphome/core
esphome/components/gpio/* @esphome/core
esphome/components/gps/* @coogle
esphome/components/graph/* @synco
esphome/components/growatt_solar/* @leeuwte
esphome/components/havells_solar/* @sourabhjaiswal
esphome/components/hbridge/fan/* @WeekendWarrior
esphome/components/hbridge/light/* @DotNetDann
esphome/components/heatpumpir/* @rob-deutsch
esphome/components/hitachi_ac424/* @sourabhjaiswal
esphome/components/homeassistant/* @OttoWinter
esphome/components/honeywellabp/* @RubyBailey
esphome/components/hrxl_maxsonar_wr/* @netmikey
esphome/components/hydreon_rgxx/* @functionpointer
esphome/components/i2c/* @esphome/core
esphome/components/i2s_audio/* @jesserockz
esphome/components/improv_serial/* @esphome/core
esphome/components/ina260/* @MrEditor97
esphome/components/inkbird_ibsth1_mini/* @fkirill
esphome/components/inkplate6/* @jesserockz
esphome/components/integration/* @OttoWinter
esphome/components/interval/* @esphome/core
esphome/components/json/* @OttoWinter
esphome/components/kalman_combinator/* @Cat-Ion
esphome/components/ledc/* @OttoWinter
esphome/components/light/* @esphome/core
esphome/components/lilygo_t5_47/touchscreen/* @jesserockz
esphome/components/lock/* @esphome/core
esphome/components/logger/* @esphome/core
esphome/components/mcp23s08/* @SenexCrenshaw
esphome/components/mcp23s17/* @SenexCrenshaw
esphome/components/ltr390/* @sjtrny
esphome/components/max31865/* @DAVe3283
esphome/components/max44009/* @berfenger
esphome/components/max7219digit/* @rspaargaren
esphome/components/max9611/* @mckaymatthew
esphome/components/mcp23008/* @jesserockz
esphome/components/mcp23017/* @jesserockz
esphome/components/mcp23s08/* @SenexCrenshaw @jesserockz
esphome/components/mcp23s17/* @SenexCrenshaw @jesserockz
esphome/components/mcp23x08_base/* @jesserockz
esphome/components/mcp23x17_base/* @jesserockz
esphome/components/mcp23xxx_base/* @jesserockz
esphome/components/mcp2515/* @danielschramm @mvturnho
esphome/components/mcp3204/* @rsumner
esphome/components/mcp4728/* @berfenger
esphome/components/mcp47a1/* @jesserockz
esphome/components/mcp9600/* @MrEditor97
esphome/components/mcp9808/* @k7hpn
esphome/components/md5/* @esphome/core
esphome/components/mdns/* @esphome/core
esphome/components/media_player/* @jesserockz
esphome/components/midea/* @dudanov
esphome/components/midea_ir/* @dudanov
esphome/components/mitsubishi/* @RubyBailey
esphome/components/mlx90393/* @functionpointer
esphome/components/modbus_controller/* @martgras
esphome/components/modbus_controller/binary_sensor/* @martgras
esphome/components/modbus_controller/number/* @martgras
esphome/components/modbus_controller/output/* @martgras
esphome/components/modbus_controller/select/* @martgras @stegm
esphome/components/modbus_controller/sensor/* @martgras
esphome/components/modbus_controller/switch/* @martgras
esphome/components/modbus_controller/text_sensor/* @martgras
esphome/components/mopeka_ble/* @spbrogan
esphome/components/mopeka_pro_check/* @spbrogan
esphome/components/mpl3115a2/* @kbickar
esphome/components/mpu6886/* @fabaff
esphome/components/network/* @esphome/core
esphome/components/nextion/* @senexcrenshaw
esphome/components/nextion/binary_sensor/* @senexcrenshaw
esphome/components/nextion/sensor/* @senexcrenshaw
esphome/components/nextion/switch/* @senexcrenshaw
esphome/components/nextion/text_sensor/* @senexcrenshaw
esphome/components/nfc/* @jesserockz
esphome/components/number/* @esphome/core
esphome/components/ota/* @esphome/core
esphome/components/output/* @esphome/core
esphome/components/pid/* @OttoWinter
esphome/components/pipsolar/* @andreashergert1984
esphome/components/pm1006/* @habbie
esphome/components/pmsa003i/* @sjtrny
esphome/components/pn532/* @OttoWinter @jesserockz
esphome/components/pn532_i2c/* @OttoWinter @jesserockz
esphome/components/pn532_spi/* @OttoWinter @jesserockz
esphome/components/power_supply/* @esphome/core
esphome/components/preferences/* @esphome/core
esphome/components/psram/* @esphome/core
esphome/components/pulse_meter/* @cstaahl @stevebaxter
esphome/components/pvvx_mithermometer/* @pasiz
esphome/components/qmp6988/* @andrewpc
esphome/components/qr_code/* @wjtje
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/restart/* @esphome/core
esphome/components/rf_bridge/* @jesserockz
esphome/components/rgbct/* @jesserockz
esphome/components/rtttl/* @glmnet
esphome/components/safe_mode/* @jsuanet @paulmonigatti
esphome/components/scd4x/* @martgras @sjtrny
esphome/components/script/* @esphome/core
esphome/components/sdm_meter/* @jesserockz @polyfaces
esphome/components/sdp3x/* @Azimath
esphome/components/selec_meter/* @sourabhjaiswal
esphome/components/select/* @esphome/core
esphome/components/sen5x/* @martgras
esphome/components/sensirion_common/* @martgras
esphome/components/sensor/* @esphome/core
esphome/components/shutdown/* @esphome/core
esphome/components/sgp40/* @SenexCrenshaw
esphome/components/sgp4x/* @SenexCrenshaw @martgras
esphome/components/shelly_dimmer/* @edge90 @rnauber
esphome/components/sht4x/* @sjtrny
esphome/components/shutdown/* @esphome/core @jsuanet
esphome/components/sim800l/* @glmnet
esphome/components/sm2135/* @BoukeHaarsma23
esphome/components/sml/* @alengwenus
esphome/components/smt100/* @piechade
esphome/components/socket/* @esphome/core
esphome/components/sonoff_d1/* @anatoly-savchenkov
esphome/components/spi/* @esphome/core
esphome/components/sprinkler/* @kbx81
esphome/components/sps30/* @martgras
esphome/components/ssd1322_base/* @kbx81
esphome/components/ssd1322_spi/* @kbx81
esphome/components/ssd1325_base/* @kbx81
@@ -81,23 +218,44 @@ esphome/components/ssd1351_base/* @kbx81
esphome/components/ssd1351_spi/* @kbx81
esphome/components/st7735/* @SenexCrenshaw
esphome/components/st7789v/* @kbx81
esphome/components/st7920/* @marsjan155
esphome/components/substitutions/* @esphome/core
esphome/components/sun/* @OttoWinter
esphome/components/switch/* @esphome/core
esphome/components/t6615/* @tylermenezes
esphome/components/tca9548a/* @andreashergert1984
esphome/components/tcl112/* @glmnet
esphome/components/teleinfo/* @0hax
esphome/components/thermostat/* @kbx81
esphome/components/time/* @OttoWinter
esphome/components/tlc5947/* @rnauber
esphome/components/tm1621/* @Philippe12
esphome/components/tm1637/* @glmnet
esphome/components/tm1638/* @skykingjwc
esphome/components/tmp102/* @timsavage
esphome/components/tmp117/* @Azimath
esphome/components/tof10120/* @wstrzalka
esphome/components/toshiba/* @kbx81
esphome/components/touchscreen/* @jesserockz
esphome/components/tsl2591/* @wjcarpenter
esphome/components/tuya/binary_sensor/* @jesserockz
esphome/components/tuya/climate/* @jesserockz
esphome/components/tuya/number/* @frankiboy1
esphome/components/tuya/select/* @bearpawmaxim
esphome/components/tuya/sensor/* @jesserockz
esphome/components/tuya/switch/* @jesserockz
esphome/components/tuya/text_sensor/* @dentra
esphome/components/uart/* @esphome/core
esphome/components/ufire_ec/* @pvizeli
esphome/components/ufire_ise/* @pvizeli
esphome/components/ultrasonic/* @OttoWinter
esphome/components/version/* @esphome/core
esphome/components/wake_on_lan/* @willwill2will54
esphome/components/web_server_base/* @OttoWinter
esphome/components/whirlpool/* @glmnet
esphome/components/whynter/* @aeonsablaze
esphome/components/xiaomi_lywsd03mmc/* @ahpohl
esphome/components/xiaomi_mhoc303/* @drug123
esphome/components/xiaomi_mhoc401/* @vevsvevs
esphome/components/xiaomi_rtcgq02lm/* @jesserockz
esphome/components/xpt2046/* @nielsnl68 @numo68

View File

@@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo
Examples of behavior that contributes to creating a positive environment include:
* Using welcoming and inclusive language
* Being respectful of differing viewpoints and experiences
* Gracefully accepting constructive criticism
* Focusing on what is best for the community
* Showing empathy towards other community members
- Using welcoming and inclusive language
- Being respectful of differing viewpoints and experiences
- Gracefully accepting constructive criticism
- Focusing on what is best for the community
- Showing empathy towards other community members
Examples of unacceptable behavior by participants include:
* The use of sexualized language or imagery and unwelcome sexual attention or advances
* Trolling, insulting/derogatory comments, and personal or political attacks
* Public or private harassment
* Publishing others' private information, such as a physical or electronic address, without explicit permission
* Other conduct which could reasonably be considered inappropriate in a professional setting
- The use of sexualized language or imagery and unwelcome sexual attention or advances
- Trolling, insulting/derogatory comments, and personal or political attacks
- Public or private harassment
- Publishing others' private information, such as a physical or electronic address, without explicit permission
- Other conduct which could reasonably be considered inappropriate in a professional setting
## Our Responsibilities
@@ -34,7 +34,7 @@ This Code of Conduct applies both within project spaces and in public spaces whe
## Enforcement
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at contact@otto-winter.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by contacting the project team at esphome@nabucasa.com. The project team will review and investigate all complaints, and will respond in a way that it deems appropriate to the circumstances. The project team is obligated to maintain confidentiality with regard to the reporter of an incident. Further details of specific enforcement policies may be posted separately.
Project maintainers who do not follow or enforce the Code of Conduct in good faith may face temporary or permanent repercussions as determined by other members of the project's leadership.

View File

@@ -1,15 +1,11 @@
# Contributing to ESPHome
This python project is responsible for reading in YAML configuration files,
converting them to C++ code. This code is then converted to a platformio project and compiled
with [esphome-core](https://github.com/esphome/esphome-core), the C++ framework behind the project.
For a detailed guide, please see https://esphome.io/guides/contributing.html#contributing-to-esphomeyaml
For a detailed guide, please see https://esphome.io/guides/contributing.html#contributing-to-esphome
Things to note when contributing:
- Please test your changes :)
- If a new feature is added or an existing user-facing feature is changed, you should also
- 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

View File

@@ -4,4 +4,5 @@ include requirements.txt
include esphome/dashboard/templates/*.html
recursive-include esphome/dashboard/static *.ico *.js *.css *.woff* LICENSE
recursive-include esphome *.cpp *.h *.tcc
recursive-include esphome *.py.script
recursive-include esphome LICENSE.txt

View File

@@ -1,4 +1,4 @@
# ESPHome [![Build Status](https://travis-ci.org/esphome/esphome.svg?branch=master)](https://travis-ci.org/esphome/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 [![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/)

View File

@@ -1,13 +1,71 @@
ARG BUILD_FROM=esphome/esphome-base-amd64:2.6.0
FROM ${BUILD_FROM}
# Build these with the build.py script
# Example:
# python3 docker/build.py --tag dev --arch amd64 --build-type docker build
# One of "docker", "hassio"
ARG BASEIMGTYPE=docker
# https://github.com/hassio-addons/addon-debian-base/releases
FROM ghcr.io/hassio-addons/debian-base/amd64:5.3.0 AS base-hassio-amd64
FROM ghcr.io/hassio-addons/debian-base/aarch64:5.3.0 AS base-hassio-arm64
FROM ghcr.io/hassio-addons/debian-base/armv7:5.3.0 AS base-hassio-armv7
# https://hub.docker.com/_/debian?tab=tags&page=1&name=bullseye
FROM debian:bullseye-20220328-slim AS base-docker-amd64
FROM debian:bullseye-20220328-slim AS base-docker-arm64
FROM debian:bullseye-20220328-slim AS base-docker-armv7
# Use TARGETARCH/TARGETVARIANT defined by docker
# https://docs.docker.com/engine/reference/builder/#automatic-platform-args-in-the-global-scope
FROM base-${BASEIMGTYPE}-${TARGETARCH}${TARGETVARIANT} AS base
RUN \
apt-get update \
# Use pinned versions so that we get updates with build caching
&& apt-get install -y --no-install-recommends \
python3=3.9.2-3 \
python3-pip=20.3.4-4+deb11u1 \
python3-setuptools=52.0.0-4 \
python3-pil=8.1.2+dfsg-0.3+deb11u1 \
python3-cryptography=3.3.2-1 \
iputils-ping=3:20210202-1 \
git=1:2.30.2-1 \
curl=7.74.0-1.3+deb11u1 \
openssh-client=1:8.4p1-5 \
&& rm -rf \
/tmp/* \
/var/{cache,log}/* \
/var/lib/apt/lists/*
ENV \
# Fix click python3 lang warning https://click.palletsprojects.com/en/7.x/python3/
LANG=C.UTF-8 LC_ALL=C.UTF-8 \
# Store globally installed pio libs in /piolibs
PLATFORMIO_GLOBALLIB_DIR=/piolibs
RUN \
# Ubuntu python3-pip is missing wheel
pip3 install --no-cache-dir \
wheel==0.37.1 \
platformio==6.0.2 \
# Change some platformio settings
&& platformio settings set enable_telemetry No \
&& platformio settings set check_platformio_interval 1000000 \
&& mkdir -p /piolibs
# First install requirements to leverage caching when requirements don't change
COPY requirements.txt /
RUN pip3 install --no-cache-dir -r /requirements.txt
COPY requirements.txt requirements_optional.txt docker/platformio_install_deps.py platformio.ini /
RUN \
pip3 install --no-cache-dir -r /requirements.txt -r /requirements_optional.txt \
&& /platformio_install_deps.py /platformio.ini
# Then copy esphome and install
COPY . .
RUN pip3 install --no-cache-dir -e .
# ======================= docker-type image =======================
FROM base AS docker
# Copy esphome and install
COPY . /esphome
RUN pip3 install --no-cache-dir --no-use-pep517 -e /esphome
# Settings for dashboard
ENV USERNAME="" PASSWORD=""
@@ -15,14 +73,77 @@ ENV USERNAME="" PASSWORD=""
# Expose the dashboard to Docker
EXPOSE 6052
# Run healthcheck (heartbeat)
HEALTHCHECK --interval=5m --timeout=3s \
CMD curl --fail http://localhost:6052 || exit 1
COPY docker/docker_entrypoint.sh /entrypoint.sh
# The directory the user should mount their configuration files to
VOLUME /config
WORKDIR /config
# Set entrypoint to esphome so that the user doesn't have to type 'esphome'
# Set entrypoint to esphome (via a script) so that the user doesn't have to type 'esphome'
# in every docker command twice
ENTRYPOINT ["esphome"]
ENTRYPOINT ["/entrypoint.sh"]
# When no arguments given, start the dashboard in the workdir
CMD ["/config", "dashboard"]
CMD ["dashboard", "/config"]
# ======================= hassio-type image =======================
FROM base AS hassio
RUN \
apt-get update \
# Use pinned versions so that we get updates with build caching
&& apt-get install -y --no-install-recommends \
nginx-light=1.18.0-6.1+deb11u2 \
&& rm -rf \
/tmp/* \
/var/{cache,log}/* \
/var/lib/apt/lists/*
ARG BUILD_VERSION=dev
# Copy root filesystem
COPY docker/ha-addon-rootfs/ /
# Copy esphome and install
COPY . /esphome
RUN pip3 install --no-cache-dir --no-use-pep517 -e /esphome
# Labels
LABEL \
io.hass.name="ESPHome" \
io.hass.description="Manage and program ESP8266/ESP32 microcontrollers through YAML configuration files" \
io.hass.type="addon" \
io.hass.version="${BUILD_VERSION}"
# io.hass.arch is inherited from addon-debian-base
# ======================= lint-type image =======================
FROM base AS lint
ENV \
PLATFORMIO_CORE_DIR=/esphome/.temp/platformio
RUN \
apt-get update \
# Use pinned versions so that we get updates with build caching
&& apt-get install -y --no-install-recommends \
clang-format-11=1:11.0.1-2 \
clang-tidy-11=1:11.0.1-2 \
patch=2.7.6-7 \
software-properties-common=0.96.20.2-2.1 \
nano=5.4-2+deb11u1 \
build-essential=12.9 \
python3-dev=3.9.2-3 \
&& rm -rf \
/tmp/* \
/var/{cache,log}/* \
/var/lib/apt/lists/*
COPY requirements_test.txt /
RUN pip3 install --no-cache-dir -r /requirements_test.txt
VOLUME ["/esphome"]
WORKDIR /esphome

View File

@@ -1,13 +0,0 @@
FROM esphome/esphome-base-amd64:2.6.0
COPY . .
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python3-wheel \
net-tools \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*
WORKDIR /workspaces
ENV SHELL /bin/bash

View File

@@ -1,23 +0,0 @@
ARG BUILD_FROM
FROM ${BUILD_FROM}
# First install requirements to leverage caching when requirements don't change
COPY requirements.txt /
RUN pip3 install --no-cache-dir -r /requirements.txt
# Copy root filesystem
COPY docker/rootfs/ /
# Then copy esphome and install
COPY . /opt/esphome/
RUN pip3 install --no-cache-dir -e /opt/esphome
# Build arguments
ARG BUILD_VERSION=dev
# Labels
LABEL \
io.hass.name="ESPHome" \
io.hass.description="Manage and program ESP8266/ESP32 microcontrollers through YAML configuration files" \
io.hass.type="addon" \
io.hass.version=${BUILD_VERSION}

View File

@@ -1,7 +0,0 @@
FROM esphome/esphome-lint-base:2.6.0
COPY requirements.txt requirements_test.txt /
RUN pip3 install --no-cache-dir -r /requirements.txt -r /requirements_test.txt
VOLUME ["/esphome"]
WORKDIR /esphome

169
docker/build.py Executable file
View File

@@ -0,0 +1,169 @@
#!/usr/bin/env python3
from dataclasses import dataclass
import subprocess
import argparse
from platform import machine
import shlex
import re
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]
TYPE_DOCKER = 'docker'
TYPE_HA_ADDON = 'ha-addon'
TYPE_LINT = 'lint'
TYPES = [TYPE_DOCKER, TYPE_HA_ADDON, TYPE_LINT]
parser = argparse.ArgumentParser()
parser.add_argument("--tag", type=str, required=True, help="The main docker tag to push to. If a version number also adds latest and/or beta tag")
parser.add_argument("--arch", choices=ARCHS, required=False, help="The architecture to build for")
parser.add_argument("--build-type", choices=TYPES, required=True, help="The type of build to run")
parser.add_argument("--dry-run", action="store_true", help="Don't run any commands, just print them")
subparsers = parser.add_subparsers(help="Action to perform", dest="command", required=True)
build_parser = subparsers.add_parser("build", help="Build the image")
build_parser.add_argument("--push", help="Also push the images", action="store_true")
build_parser.add_argument("--load", help="Load the docker image locally", action="store_true")
manifest_parser = subparsers.add_parser("manifest", help="Create a manifest from already pushed images")
@dataclass(frozen=True)
class DockerParams:
build_to: str
manifest_to: str
baseimgtype: str
platform: str
target: str
@classmethod
def for_type_arch(cls, build_type, arch):
prefix = {
TYPE_DOCKER: "esphome/esphome",
TYPE_HA_ADDON: "esphome/esphome-hassio",
TYPE_LINT: "esphome/esphome-lint"
}[build_type]
build_to = f"{prefix}-{arch}"
baseimgtype = {
TYPE_DOCKER: "docker",
TYPE_HA_ADDON: "hassio",
TYPE_LINT: "docker",
}[build_type]
platform = {
ARCH_AMD64: "linux/amd64",
ARCH_ARMV7: "linux/arm/v7",
ARCH_AARCH64: "linux/arm64",
}[arch]
target = {
TYPE_DOCKER: "docker",
TYPE_HA_ADDON: "hassio",
TYPE_LINT: "lint",
}[build_type]
return cls(
build_to=build_to,
manifest_to=prefix,
baseimgtype=baseimgtype,
platform=platform,
target=target,
)
def main():
args = parser.parse_args()
def run_command(*cmd, ignore_error: bool = False):
print(f"$ {shlex.join(list(cmd))}")
if not args.dry_run:
rc = subprocess.call(list(cmd))
if rc != 0 and not ignore_error:
print("Command failed")
sys.exit(1)
# detect channel from tag
match = re.match(r"^(\d+\.\d+)(?:\.\d+)?(b\d+)?$", args.tag)
major_minor_version = None
if match is None:
channel = CHANNEL_DEV
elif match.group(2) is None:
major_minor_version = match.group(1)
channel = CHANNEL_RELEASE
else:
channel = CHANNEL_BETA
tags_to_push = [args.tag]
if channel == CHANNEL_DEV:
tags_to_push.append("dev")
elif channel == CHANNEL_BETA:
tags_to_push.append("beta")
elif channel == CHANNEL_RELEASE:
# Additionally push to beta
tags_to_push.append("beta")
tags_to_push.append("latest")
# Compatibility with HA tags
if major_minor_version:
tags_to_push.append("stable")
tags_to_push.append(major_minor_version)
if args.command == "build":
# 1. pull cache image
params = DockerParams.for_type_arch(args.build_type, args.arch)
cache_tag = {
CHANNEL_DEV: "cache-dev",
CHANNEL_BETA: "cache-beta",
CHANNEL_RELEASE: "cache-latest",
}[channel]
cache_img = f"ghcr.io/{params.build_to}:{cache_tag}"
imgs = [f"{params.build_to}:{tag}" for tag in tags_to_push]
imgs += [f"ghcr.io/{params.build_to}:{tag}" for tag in tags_to_push]
# 3. build
cmd = [
"docker", "buildx", "build",
"--build-arg", f"BASEIMGTYPE={params.baseimgtype}",
"--build-arg", f"BUILD_VERSION={args.tag}",
"--cache-from", f"type=registry,ref={cache_img}",
"--file", "docker/Dockerfile",
"--platform", params.platform,
"--target", params.target,
]
for img in imgs:
cmd += ["--tag", img]
if args.push:
cmd += ["--push", "--cache-to", f"type=registry,ref={cache_img},mode=max"]
if args.load:
cmd += ["--load"]
run_command(*cmd, ".")
elif args.command == "manifest":
manifest = DockerParams.for_type_arch(args.build_type, ARCH_AMD64).manifest_to
targets = [f"{manifest}:{tag}" for tag in tags_to_push]
targets += [f"ghcr.io/{manifest}:{tag}" for tag in tags_to_push]
# 1. Create manifests
for target in targets:
cmd = ["docker", "manifest", "create", target]
for arch in ARCHS:
src = f"{DockerParams.for_type_arch(args.build_type, arch).build_to}:{args.tag}"
if target.startswith("ghcr.io"):
src = f"ghcr.io/{src}"
cmd.append(src)
run_command(*cmd)
# 2. Push manifests
for target in targets:
run_command(
"docker", "manifest", "push", target
)
if __name__ == "__main__":
main()

24
docker/docker_entrypoint.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/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)
if [[ -d /cache ]]; then
pio_cache_base=/cache/platformio
else
pio_cache_base=/config/.esphome/platformio
fi
if [[ ! -d "${pio_cache_base}" ]]; then
echo "Creating cache directory ${pio_cache_base}"
echo "You can change this behavior by mounting a directory to the container's /cache directory."
mkdir -p "${pio_cache_base}"
fi
# we can't set core_dir, because the settings file is stored in `core_dir/appstate.json`
# setting `core_dir` would therefore prevent pio from accessing
export PLATFORMIO_PLATFORMS_DIR="${pio_cache_base}/platforms"
export PLATFORMIO_PACKAGES_DIR="${pio_cache_base}/packages"
export PLATFORMIO_CACHE_DIR="${pio_cache_base}/cache"
exec esphome "$@"

View File

@@ -7,12 +7,12 @@
# Check SSL requirements, if enabled
if bashio::config.true 'ssl'; then
if ! bashio::config.has_value 'certfile'; then
bashio::fatal 'SSL is enabled, but no certfile was specified.'
bashio::log.fatal 'SSL is enabled, but no certfile was specified.'
bashio::exit.nok
fi
if ! bashio::config.has_value 'keyfile'; then
bashio::fatal 'SSL is enabled, but no keyfile was specified'
bashio::log.fatal 'SSL is enabled, but no keyfile was specified'
bashio::exit.nok
fi

View File

@@ -0,0 +1,9 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Community Hass.io Add-ons: ESPHome
# This files creates all directories used by esphome
# ==============================================================================
pio_cache_base=/data/cache/platformio
mkdir -p "${pio_cache_base}"

View File

@@ -10,7 +10,7 @@ server {
ssl_certificate_key /ssl/%%keyfile%%;
# Clear Hass.io Ingress header
proxy_set_header X-Hassio-Ingress "";
proxy_set_header X-HA-Ingress "";
# Redirect http requests to https on the same port.
# https://rageagainstshell.com/2016/11/redirect-http-to-https-on-the-same-port-in-nginx/

View File

@@ -4,7 +4,7 @@ server {
include /etc/nginx/includes/server_params.conf;
include /etc/nginx/includes/proxy_params.conf;
# Clear Hass.io Ingress header
proxy_set_header X-Hassio-Ingress "";
proxy_set_header X-HA-Ingress "";
location / {
proxy_pass http://esphome;

View File

@@ -3,8 +3,8 @@ server {
include /etc/nginx/includes/server_params.conf;
include /etc/nginx/includes/proxy_params.conf;
# Set Hass.io Ingress header
proxy_set_header X-Hassio-Ingress "YES";
# Set Home Assistant Ingress header
proxy_set_header X-HA-Ingress "YES";
location / {
# Only allow from Hass.io supervisor

View File

@@ -4,7 +4,7 @@
# Runs the ESPHome dashboard
# ==============================================================================
export ESPHOME_IS_HASSIO=true
export ESPHOME_IS_HA_ADDON=true
if bashio::config.true 'leave_front_door_open'; then
export DISABLE_HA_AUTHENTICATION=true
@@ -22,5 +22,14 @@ if bashio::config.has_value 'relative_url'; then
export ESPHOME_DASHBOARD_RELATIVE_URL=$(bashio::config 'relative_url')
fi
pio_cache_base=/data/cache/platformio
# we can't set core_dir, because the settings file is stored in `core_dir/appstate.json`
# setting `core_dir` would therefore prevent pio from accessing
export PLATFORMIO_PLATFORMS_DIR="${pio_cache_base}/platforms"
export PLATFORMIO_PACKAGES_DIR="${pio_cache_base}/packages"
export PLATFORMIO_CACHE_DIR="${pio_cache_base}/cache"
export PLATFORMIO_GLOBALLIB_DIR=/piolibs
bashio::log.info "Starting ESPHome dashboard..."
exec esphome /config/esphome dashboard --socket /var/run/esphome.sock --hassio
exec esphome dashboard /config/esphome --socket /var/run/esphome.sock --ha-addon

View File

@@ -0,0 +1,30 @@
#!/usr/bin/env python3
# This script is used in the docker containers to preinstall
# all platformio libraries in the global storage
import configparser
import subprocess
import sys
config = configparser.ConfigParser(inline_comment_prefixes=(';', ))
config.read(sys.argv[1])
libs = []
# Extract from every lib_deps key in all sections
for section in config.sections():
conf = config[section]
if "lib_deps" not in conf:
continue
for lib_dep in conf["lib_deps"].splitlines():
if not lib_dep:
# Empty line or comment
continue
if lib_dep.startswith("${"):
# Extending from another section
continue
if "@" not in lib_dep:
# No version pinned, this is an internal lib
continue
libs.append(lib_dep)
subprocess.check_call(['platformio', 'lib', '-g', 'install', *libs])

View File

@@ -1,23 +0,0 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Community Hass.io Add-ons: ESPHome
# This files installs the user ESPHome version if specified
# ==============================================================================
declare esphome_version
if bashio::config.has_value 'esphome_version'; then
esphome_version=$(bashio::config 'esphome_version')
if [[ $esphome_version == *":"* ]]; then
IFS=':' read -r -a array <<< "$esphome_version"
username=${array[0]}
ref=${array[1]}
else
username="esphome"
ref=$esphome_version
fi
full_url="https://github.com/${username}/esphome/archive/${ref}.zip"
bashio::log.info "Installing esphome version '${esphome_version}' (${full_url})..."
pip3 install -U --no-cache-dir "${full_url}" \
|| bashio::exit.nok "Failed installing esphome pinned version."
fi

View File

@@ -1,11 +0,0 @@
#!/usr/bin/with-contenv bashio
# ==============================================================================
# Community Hass.io Add-ons: ESPHome
# This files migrates the esphome config directory from the old path
# ==============================================================================
if [[ ! -d /config/esphome && -d /config/esphomeyaml ]]; then
echo "Moving config directory from /config/esphomeyaml to /config/esphome"
mv /config/esphomeyaml /config/esphome
mv /config/esphome/.esphomeyaml /config/esphome/.esphome
fi

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

View File

@@ -1,490 +0,0 @@
from datetime import datetime
import functools
import logging
import socket
import threading
import time
# pylint: disable=unused-import
from typing import Optional # noqa
from google.protobuf import message # noqa
from esphome import const
import esphome.api.api_pb2 as pb
from esphome.const import CONF_PASSWORD, CONF_PORT
from esphome.core import EsphomeError
from esphome.helpers import resolve_ip_address, indent, color
from esphome.util import safe_print
_LOGGER = logging.getLogger(__name__)
class APIConnectionError(EsphomeError):
pass
MESSAGE_TYPE_TO_PROTO = {
1: pb.HelloRequest,
2: pb.HelloResponse,
3: pb.ConnectRequest,
4: pb.ConnectResponse,
5: pb.DisconnectRequest,
6: pb.DisconnectResponse,
7: pb.PingRequest,
8: pb.PingResponse,
9: pb.DeviceInfoRequest,
10: pb.DeviceInfoResponse,
11: pb.ListEntitiesRequest,
12: pb.ListEntitiesBinarySensorResponse,
13: pb.ListEntitiesCoverResponse,
14: pb.ListEntitiesFanResponse,
15: pb.ListEntitiesLightResponse,
16: pb.ListEntitiesSensorResponse,
17: pb.ListEntitiesSwitchResponse,
18: pb.ListEntitiesTextSensorResponse,
19: pb.ListEntitiesDoneResponse,
20: pb.SubscribeStatesRequest,
21: pb.BinarySensorStateResponse,
22: pb.CoverStateResponse,
23: pb.FanStateResponse,
24: pb.LightStateResponse,
25: pb.SensorStateResponse,
26: pb.SwitchStateResponse,
27: pb.TextSensorStateResponse,
28: pb.SubscribeLogsRequest,
29: pb.SubscribeLogsResponse,
30: pb.CoverCommandRequest,
31: pb.FanCommandRequest,
32: pb.LightCommandRequest,
33: pb.SwitchCommandRequest,
34: pb.SubscribeServiceCallsRequest,
35: pb.ServiceCallResponse,
36: pb.GetTimeRequest,
37: pb.GetTimeResponse,
}
def _varuint_to_bytes(value):
if value <= 0x7F:
return bytes([value])
ret = bytes()
while value:
temp = value & 0x7F
value >>= 7
if value:
ret += bytes([temp | 0x80])
else:
ret += bytes([temp])
return ret
def _bytes_to_varuint(value):
result = 0
bitpos = 0
for val in value:
result |= (val & 0x7F) << bitpos
bitpos += 7
if (val & 0x80) == 0:
return result
return None
# pylint: disable=too-many-instance-attributes,not-callable
class APIClient(threading.Thread):
def __init__(self, address, port, password):
threading.Thread.__init__(self)
self._address = address # type: str
self._port = port # type: int
self._password = password # type: Optional[str]
self._socket = None # type: Optional[socket.socket]
self._socket_open_event = threading.Event()
self._socket_write_lock = threading.Lock()
self._connected = False
self._authenticated = False
self._message_handlers = []
self._keepalive = 5
self._ping_timer = None
self.on_disconnect = None
self.on_connect = None
self.on_login = None
self.auto_reconnect = False
self._running_event = threading.Event()
self._stop_event = threading.Event()
@property
def stopped(self):
return self._stop_event.is_set()
def _refresh_ping(self):
if self._ping_timer is not None:
self._ping_timer.cancel()
self._ping_timer = None
def func():
self._ping_timer = None
if self._connected:
try:
self.ping()
except APIConnectionError as err:
self._fatal_error(err)
else:
self._refresh_ping()
self._ping_timer = threading.Timer(self._keepalive, func)
self._ping_timer.start()
def _cancel_ping(self):
if self._ping_timer is not None:
self._ping_timer.cancel()
self._ping_timer = None
def _close_socket(self):
self._cancel_ping()
if self._socket is not None:
self._socket.close()
self._socket = None
self._socket_open_event.clear()
self._connected = False
self._authenticated = False
self._message_handlers = []
def stop(self, force=False):
if self.stopped:
raise ValueError
if self._connected and not force:
try:
self.disconnect()
except APIConnectionError:
pass
self._close_socket()
self._stop_event.set()
if not force:
self.join()
def connect(self):
if not self._running_event.wait(0.1):
raise APIConnectionError("You need to call start() first!")
if self._connected:
self.disconnect(on_disconnect=False)
try:
ip = resolve_ip_address(self._address)
except EsphomeError as err:
_LOGGER.warning("Error resolving IP address of %s. Is it connected to WiFi?",
self._address)
_LOGGER.warning("(If this error persists, please set a static IP address: "
"https://esphome.io/components/wifi.html#manual-ips)")
raise APIConnectionError(err) from err
_LOGGER.info("Connecting to %s:%s (%s)", self._address, self._port, ip)
self._socket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
self._socket.settimeout(10.0)
self._socket.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
try:
self._socket.connect((ip, self._port))
except OSError as err:
err = APIConnectionError(f"Error connecting to {ip}: {err}")
self._fatal_error(err)
raise err
self._socket.settimeout(0.1)
self._socket_open_event.set()
hello = pb.HelloRequest()
hello.client_info = f'ESPHome v{const.__version__}'
try:
resp = self._send_message_await_response(hello, pb.HelloResponse)
except APIConnectionError as err:
self._fatal_error(err)
raise err
_LOGGER.debug("Successfully connected to %s ('%s' API=%s.%s)", self._address,
resp.server_info, resp.api_version_major, resp.api_version_minor)
self._connected = True
self._refresh_ping()
if self.on_connect is not None:
self.on_connect()
def _check_connected(self):
if not self._connected:
err = APIConnectionError("Must be connected!")
self._fatal_error(err)
raise err
def login(self):
self._check_connected()
if self._authenticated:
raise APIConnectionError("Already logged in!")
connect = pb.ConnectRequest()
if self._password is not None:
connect.password = self._password
resp = self._send_message_await_response(connect, pb.ConnectResponse)
if resp.invalid_password:
raise APIConnectionError("Invalid password!")
self._authenticated = True
if self.on_login is not None:
self.on_login()
def _fatal_error(self, err):
was_connected = self._connected
self._close_socket()
if was_connected and self.on_disconnect is not None:
self.on_disconnect(err)
def _write(self, data): # type: (bytes) -> None
if self._socket is None:
raise APIConnectionError("Socket closed")
# _LOGGER.debug("Write: %s", format_bytes(data))
with self._socket_write_lock:
try:
self._socket.sendall(data)
except OSError as err:
err = APIConnectionError(f"Error while writing data: {err}")
self._fatal_error(err)
raise err
def _send_message(self, msg):
# type: (message.Message) -> None
for message_type, klass in MESSAGE_TYPE_TO_PROTO.items():
if isinstance(msg, klass):
break
else:
raise ValueError
encoded = msg.SerializeToString()
_LOGGER.debug("Sending %s:\n%s", type(msg), indent(str(msg)))
req = bytes([0])
req += _varuint_to_bytes(len(encoded))
req += _varuint_to_bytes(message_type)
req += encoded
self._write(req)
def _send_message_await_response_complex(self, send_msg, do_append, do_stop, timeout=5):
event = threading.Event()
responses = []
def on_message(resp):
if do_append(resp):
responses.append(resp)
if do_stop(resp):
event.set()
self._message_handlers.append(on_message)
self._send_message(send_msg)
ret = event.wait(timeout)
try:
self._message_handlers.remove(on_message)
except ValueError:
pass
if not ret:
raise APIConnectionError("Timeout while waiting for message response!")
return responses
def _send_message_await_response(self, send_msg, response_type, timeout=5):
def is_response(msg):
return isinstance(msg, response_type)
return self._send_message_await_response_complex(send_msg, is_response, is_response,
timeout)[0]
def device_info(self):
self._check_connected()
return self._send_message_await_response(pb.DeviceInfoRequest(), pb.DeviceInfoResponse)
def ping(self):
self._check_connected()
return self._send_message_await_response(pb.PingRequest(), pb.PingResponse)
def disconnect(self, on_disconnect=True):
self._check_connected()
try:
self._send_message_await_response(pb.DisconnectRequest(), pb.DisconnectResponse)
except APIConnectionError:
pass
self._close_socket()
if self.on_disconnect is not None and on_disconnect:
self.on_disconnect(None)
def _check_authenticated(self):
if not self._authenticated:
raise APIConnectionError("Must login first!")
def subscribe_logs(self, on_log, log_level=7, dump_config=False):
self._check_authenticated()
def on_msg(msg):
if isinstance(msg, pb.SubscribeLogsResponse):
on_log(msg)
self._message_handlers.append(on_msg)
req = pb.SubscribeLogsRequest(dump_config=dump_config)
req.level = log_level
self._send_message(req)
def _recv(self, amount):
ret = bytes()
if amount == 0:
return ret
while len(ret) < amount:
if self.stopped:
raise APIConnectionError("Stopped!")
if not self._socket_open_event.is_set():
raise APIConnectionError("No socket!")
try:
val = self._socket.recv(amount - len(ret))
except AttributeError as err:
raise APIConnectionError("Socket was closed") from err
except socket.timeout:
continue
except OSError as err:
raise APIConnectionError(f"Error while receiving data: {err}") from err
ret += val
return ret
def _recv_varint(self):
raw = bytes()
while not raw or raw[-1] & 0x80:
raw += self._recv(1)
return _bytes_to_varuint(raw)
def _run_once(self):
if not self._socket_open_event.wait(0.1):
return
# Preamble
if self._recv(1)[0] != 0x00:
raise APIConnectionError("Invalid preamble")
length = self._recv_varint()
msg_type = self._recv_varint()
raw_msg = self._recv(length)
if msg_type not in MESSAGE_TYPE_TO_PROTO:
_LOGGER.debug("Skipping message type %s", msg_type)
return
msg = MESSAGE_TYPE_TO_PROTO[msg_type]()
msg.ParseFromString(raw_msg)
_LOGGER.debug("Got message: %s:\n%s", type(msg), indent(str(msg)))
for msg_handler in self._message_handlers[:]:
msg_handler(msg)
self._handle_internal_messages(msg)
def run(self):
self._running_event.set()
while not self.stopped:
try:
self._run_once()
except APIConnectionError as err:
if self.stopped:
break
if self._connected:
_LOGGER.error("Error while reading incoming messages: %s", err)
self._fatal_error(err)
self._running_event.clear()
def _handle_internal_messages(self, msg):
if isinstance(msg, pb.DisconnectRequest):
self._send_message(pb.DisconnectResponse())
if self._socket is not None:
self._socket.close()
self._socket = None
self._connected = False
if self.on_disconnect is not None:
self.on_disconnect(None)
elif isinstance(msg, pb.PingRequest):
self._send_message(pb.PingResponse())
elif isinstance(msg, pb.GetTimeRequest):
resp = pb.GetTimeResponse()
resp.epoch_seconds = int(time.time())
self._send_message(resp)
def run_logs(config, address):
conf = config['api']
port = conf[CONF_PORT]
password = conf[CONF_PASSWORD]
_LOGGER.info("Starting log output from %s using esphome API", address)
cli = APIClient(address, port, password)
stopping = False
retry_timer = []
has_connects = []
def try_connect(err, tries=0):
if stopping:
return
if err:
_LOGGER.warning("Disconnected from API: %s", err)
while retry_timer:
retry_timer.pop(0).cancel()
error = None
try:
cli.connect()
cli.login()
except APIConnectionError as err2: # noqa
error = err2
if error is None:
_LOGGER.info("Successfully connected to %s", address)
return
wait_time = int(min(1.5**min(tries, 100), 30))
if not has_connects:
_LOGGER.warning("Initial connection failed. The ESP might not be connected "
"to WiFi yet (%s). Re-Trying in %s seconds",
error, wait_time)
else:
_LOGGER.warning("Couldn't connect to API (%s). Trying to reconnect in %s seconds",
error, wait_time)
timer = threading.Timer(wait_time, functools.partial(try_connect, None, tries + 1))
timer.start()
retry_timer.append(timer)
def on_log(msg):
time_ = datetime.now().time().strftime('[%H:%M:%S]')
text = msg.message
if msg.send_failed:
text = color('white', '(Message skipped because it was too big to fit in '
'TCP buffer - This is only cosmetic)')
safe_print(time_ + text)
def on_login():
try:
cli.subscribe_logs(on_log, dump_config=not has_connects)
has_connects.append(True)
except APIConnectionError:
cli.disconnect()
cli.on_disconnect = try_connect
cli.on_login = on_login
cli.start()
try:
try_connect(None)
while True:
time.sleep(1)
except KeyboardInterrupt:
stopping = True
cli.stop(True)
while retry_timer:
retry_timer.pop(0).cancel()
return 0

View File

@@ -1,8 +1,18 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.const import CONF_AUTOMATION_ID, CONF_CONDITION, CONF_ELSE, CONF_ID, CONF_THEN, \
CONF_TRIGGER_ID, CONF_TYPE_ID, CONF_TIME
from esphome.core import coroutine
from esphome.const import (
CONF_AUTOMATION_ID,
CONF_CONDITION,
CONF_COUNT,
CONF_ELSE,
CONF_ID,
CONF_THEN,
CONF_TIMEOUT,
CONF_TRIGGER_ID,
CONF_TYPE_ID,
CONF_TIME,
)
from esphome.schema_extractors import SCHEMA_EXTRACT, schema_extractor
from esphome.util import Registry
@@ -13,7 +23,11 @@ def maybe_simple_id(*validators):
def maybe_conf(conf, *validators):
validator = cv.All(*validators)
@schema_extractor("maybe")
def validate(value):
if value == SCHEMA_EXTRACT:
return (validator, conf)
if isinstance(value, dict):
return validator(value)
with cv.remove_prepend_path([conf]):
@@ -30,36 +44,35 @@ def register_condition(name, condition_type, schema):
return CONDITION_REGISTRY.register(name, condition_type, schema)
Action = cg.esphome_ns.class_('Action')
Trigger = cg.esphome_ns.class_('Trigger')
Action = cg.esphome_ns.class_("Action")
Trigger = cg.esphome_ns.class_("Trigger")
ACTION_REGISTRY = Registry()
Condition = cg.esphome_ns.class_('Condition')
Condition = cg.esphome_ns.class_("Condition")
CONDITION_REGISTRY = Registry()
validate_action = cv.validate_registry_entry('action', ACTION_REGISTRY)
validate_action_list = cv.validate_registry('action', ACTION_REGISTRY)
validate_condition = cv.validate_registry_entry('condition', CONDITION_REGISTRY)
validate_condition_list = cv.validate_registry('condition', CONDITION_REGISTRY)
validate_action = cv.validate_registry_entry("action", ACTION_REGISTRY)
validate_action_list = cv.validate_registry("action", ACTION_REGISTRY)
validate_condition = cv.validate_registry_entry("condition", CONDITION_REGISTRY)
validate_condition_list = cv.validate_registry("condition", CONDITION_REGISTRY)
def validate_potentially_and_condition(value):
if isinstance(value, list):
with cv.remove_prepend_path(['and']):
return validate_condition({
'and': value
})
with cv.remove_prepend_path(["and"]):
return validate_condition({"and": 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)
WhileAction = cg.esphome_ns.class_('WhileAction', Action)
WaitUntilAction = cg.esphome_ns.class_('WaitUntilAction', Action, cg.Component)
UpdateComponentAction = cg.esphome_ns.class_('UpdateComponentAction', Action)
Automation = cg.esphome_ns.class_('Automation')
DelayAction = cg.esphome_ns.class_("DelayAction", Action, cg.Component)
LambdaAction = cg.esphome_ns.class_("LambdaAction", Action)
IfAction = cg.esphome_ns.class_("IfAction", Action)
WhileAction = cg.esphome_ns.class_("WhileAction", Action)
RepeatAction = cg.esphome_ns.class_("RepeatAction", Action)
WaitUntilAction = cg.esphome_ns.class_("WaitUntilAction", Action, cg.Component)
UpdateComponentAction = cg.esphome_ns.class_("UpdateComponentAction", Action)
Automation = cg.esphome_ns.class_("Automation")
LambdaCondition = cg.esphome_ns.class_('LambdaCondition', Condition)
ForCondition = cg.esphome_ns.class_('ForCondition', Condition, cg.Component)
LambdaCondition = cg.esphome_ns.class_("LambdaCondition", Condition)
ForCondition = cg.esphome_ns.class_("ForCondition", Condition, cg.Component)
def validate_automation(extra_schema=None, extra_validators=None, single=False):
@@ -83,10 +96,10 @@ def validate_automation(extra_schema=None, extra_validators=None, single=False):
try:
return cv.Schema([schema])(value)
except cv.Invalid as err2:
if 'extra keys not allowed' in str(err2) and len(err2.path) == 2:
if "extra keys not allowed" in str(err2) and len(err2.path) == 2:
# pylint: disable=raise-missing-from
raise err
if 'Unable to find action' in str(err):
if "Unable to find action" in str(err):
raise err2
raise cv.MultipleInvalid([err, err2])
elif isinstance(value, dict):
@@ -97,7 +110,11 @@ def validate_automation(extra_schema=None, extra_validators=None, single=False):
# This should only happen with invalid configs, but let's have a nice error message.
return [schema(value)]
@schema_extractor("automation")
def validator(value):
if value == SCHEMA_EXTRACT:
return schema
value = validator_(value)
if extra_validators is not None:
value = cv.Schema([extra_validators])(value)
@@ -110,162 +127,218 @@ def validate_automation(extra_schema=None, extra_validators=None, single=False):
return validator
AUTOMATION_SCHEMA = cv.Schema({
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(Trigger),
cv.GenerateID(CONF_AUTOMATION_ID): cv.declare_id(Automation),
cv.Required(CONF_THEN): validate_action_list,
})
AUTOMATION_SCHEMA = cv.Schema(
{
cv.GenerateID(CONF_TRIGGER_ID): cv.declare_id(Trigger),
cv.GenerateID(CONF_AUTOMATION_ID): cv.declare_id(Automation),
cv.Required(CONF_THEN): validate_action_list,
}
)
AndCondition = cg.esphome_ns.class_('AndCondition', Condition)
OrCondition = cg.esphome_ns.class_('OrCondition', Condition)
NotCondition = cg.esphome_ns.class_('NotCondition', Condition)
AndCondition = cg.esphome_ns.class_("AndCondition", Condition)
OrCondition = cg.esphome_ns.class_("OrCondition", Condition)
NotCondition = cg.esphome_ns.class_("NotCondition", Condition)
@register_condition('and', AndCondition, validate_condition_list)
def and_condition_to_code(config, condition_id, template_arg, args):
conditions = yield build_condition_list(config, template_arg, args)
yield cg.new_Pvariable(condition_id, template_arg, conditions)
@register_condition("and", AndCondition, validate_condition_list)
async def and_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('or', OrCondition, validate_condition_list)
def or_condition_to_code(config, condition_id, template_arg, args):
conditions = yield build_condition_list(config, template_arg, args)
yield cg.new_Pvariable(condition_id, template_arg, conditions)
@register_condition("or", OrCondition, validate_condition_list)
async def or_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)
def not_condition_to_code(config, condition_id, template_arg, args):
condition = yield build_condition(config, template_arg, args)
yield cg.new_Pvariable(condition_id, template_arg, condition)
@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)
return cg.new_Pvariable(condition_id, template_arg, condition)
@register_condition('lambda', LambdaCondition, cv.lambda_)
def lambda_condition_to_code(config, condition_id, template_arg, args):
lambda_ = yield cg.process_lambda(config, args, return_type=bool)
yield cg.new_Pvariable(condition_id, template_arg, lambda_)
@register_condition("lambda", LambdaCondition, cv.returning_lambda)
async def lambda_condition_to_code(config, condition_id, template_arg, args):
lambda_ = await cg.process_lambda(config, args, return_type=bool)
return cg.new_Pvariable(condition_id, template_arg, lambda_)
@register_condition('for', ForCondition, cv.Schema({
cv.Required(CONF_TIME): cv.templatable(cv.positive_time_period_milliseconds),
cv.Required(CONF_CONDITION): validate_potentially_and_condition,
}).extend(cv.COMPONENT_SCHEMA))
def for_condition_to_code(config, condition_id, template_arg, args):
condition = yield build_condition(config[CONF_CONDITION], cg.TemplateArguments(), [])
@register_condition(
"for",
ForCondition,
cv.Schema(
{
cv.Required(CONF_TIME): cv.templatable(
cv.positive_time_period_milliseconds
),
cv.Required(CONF_CONDITION): validate_potentially_and_condition,
}
).extend(cv.COMPONENT_SCHEMA),
)
async def for_condition_to_code(config, condition_id, template_arg, args):
condition = await build_condition(
config[CONF_CONDITION], cg.TemplateArguments(), []
)
var = cg.new_Pvariable(condition_id, template_arg, condition)
yield cg.register_component(var, config)
templ = yield cg.templatable(config[CONF_TIME], args, cg.uint32)
await cg.register_component(var, config)
templ = await cg.templatable(config[CONF_TIME], args, cg.uint32)
cg.add(var.set_time(templ))
yield var
return var
@register_action('delay', DelayAction, cv.templatable(cv.positive_time_period_milliseconds))
def delay_action_to_code(config, action_id, template_arg, args):
@register_action(
"delay", DelayAction, cv.templatable(cv.positive_time_period_milliseconds)
)
async def delay_action_to_code(config, action_id, template_arg, args):
var = cg.new_Pvariable(action_id, template_arg)
yield cg.register_component(var, {})
template_ = yield cg.templatable(config, args, cg.uint32)
await cg.register_component(var, {})
template_ = await cg.templatable(config, args, cg.uint32)
cg.add(var.set_delay(template_))
yield var
return var
@register_action('if', IfAction, cv.All({
cv.Required(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)))
def if_action_to_code(config, action_id, template_arg, args):
conditions = yield build_condition(config[CONF_CONDITION], template_arg, args)
@register_action(
"if",
IfAction,
cv.All(
{
cv.Required(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),
),
)
async def if_action_to_code(config, action_id, template_arg, args):
conditions = await build_condition(config[CONF_CONDITION], template_arg, args)
var = cg.new_Pvariable(action_id, template_arg, conditions)
if CONF_THEN in config:
actions = yield build_action_list(config[CONF_THEN], template_arg, args)
actions = await build_action_list(config[CONF_THEN], template_arg, args)
cg.add(var.add_then(actions))
if CONF_ELSE in config:
actions = yield build_action_list(config[CONF_ELSE], template_arg, args)
actions = await build_action_list(config[CONF_ELSE], template_arg, args)
cg.add(var.add_else(actions))
yield var
return var
@register_action('while', WhileAction, cv.Schema({
cv.Required(CONF_CONDITION): validate_potentially_and_condition,
cv.Required(CONF_THEN): validate_action_list,
}))
def while_action_to_code(config, action_id, template_arg, args):
conditions = yield build_condition(config[CONF_CONDITION], template_arg, args)
@register_action(
"while",
WhileAction,
cv.Schema(
{
cv.Required(CONF_CONDITION): validate_potentially_and_condition,
cv.Required(CONF_THEN): validate_action_list,
}
),
)
async def while_action_to_code(config, action_id, template_arg, args):
conditions = await build_condition(config[CONF_CONDITION], template_arg, args)
var = cg.new_Pvariable(action_id, template_arg, conditions)
actions = yield build_action_list(config[CONF_THEN], template_arg, args)
actions = await build_action_list(config[CONF_THEN], template_arg, args)
cg.add(var.add_then(actions))
yield var
return var
def validate_wait_until(value):
schema = cv.Schema({
@register_action(
"repeat",
RepeatAction,
cv.Schema(
{
cv.Required(CONF_COUNT): cv.templatable(cv.positive_not_null_int),
cv.Required(CONF_THEN): validate_action_list,
}
),
)
async def repeat_action_to_code(config, action_id, template_arg, args):
var = cg.new_Pvariable(action_id, template_arg)
count_template = await cg.templatable(config[CONF_COUNT], args, cg.uint32)
cg.add(var.set_count(count_template))
actions = await build_action_list(config[CONF_THEN], template_arg, args)
cg.add(var.add_then(actions))
return var
_validate_wait_until = cv.maybe_simple_value(
{
cv.Required(CONF_CONDITION): validate_potentially_and_condition,
})
if isinstance(value, dict) and CONF_CONDITION in value:
return schema(value)
return validate_wait_until({CONF_CONDITION: value})
cv.Optional(CONF_TIMEOUT): cv.templatable(cv.positive_time_period_milliseconds),
},
key=CONF_CONDITION,
)
@register_action('wait_until', WaitUntilAction, validate_wait_until)
def wait_until_action_to_code(config, action_id, template_arg, args):
conditions = yield build_condition(config[CONF_CONDITION], template_arg, args)
@register_action("wait_until", WaitUntilAction, _validate_wait_until)
async def wait_until_action_to_code(config, action_id, template_arg, args):
conditions = await build_condition(config[CONF_CONDITION], template_arg, args)
var = cg.new_Pvariable(action_id, template_arg, conditions)
yield cg.register_component(var, {})
yield var
if CONF_TIMEOUT in config:
template_ = await cg.templatable(config[CONF_TIMEOUT], args, cg.uint32)
cg.add(var.set_timeout_value(template_))
await cg.register_component(var, {})
return var
@register_action('lambda', LambdaAction, cv.lambda_)
def lambda_action_to_code(config, action_id, template_arg, args):
lambda_ = yield cg.process_lambda(config, args, return_type=cg.void)
yield cg.new_Pvariable(action_id, template_arg, lambda_)
@register_action("lambda", LambdaAction, cv.lambda_)
async def lambda_action_to_code(config, action_id, template_arg, args):
lambda_ = await cg.process_lambda(config, args, return_type=cg.void)
return cg.new_Pvariable(action_id, template_arg, lambda_)
@register_action('component.update', UpdateComponentAction, maybe_simple_id({
cv.Required(CONF_ID): cv.use_id(cg.PollingComponent),
}))
def component_update_action_to_code(config, action_id, template_arg, args):
comp = yield cg.get_variable(config[CONF_ID])
yield cg.new_Pvariable(action_id, template_arg, comp)
@register_action(
"component.update",
UpdateComponentAction,
maybe_simple_id(
{
cv.Required(CONF_ID): cv.use_id(cg.PollingComponent),
}
),
)
async def component_update_action_to_code(config, action_id, template_arg, args):
comp = await cg.get_variable(config[CONF_ID])
return cg.new_Pvariable(action_id, template_arg, comp)
@coroutine
def build_action(full_config, template_arg, args):
registry_entry, config = cg.extract_registry_entry_config(ACTION_REGISTRY, full_config)
async def build_action(full_config, template_arg, args):
registry_entry, config = cg.extract_registry_entry_config(
ACTION_REGISTRY, full_config
)
action_id = full_config[CONF_TYPE_ID]
builder = registry_entry.coroutine_fun
yield builder(config, action_id, template_arg, args)
ret = await builder(config, action_id, template_arg, args)
return ret
@coroutine
def build_action_list(config, templ, arg_type):
async def build_action_list(config, templ, arg_type):
actions = []
for conf in config:
action = yield build_action(conf, templ, arg_type)
action = await build_action(conf, templ, arg_type)
actions.append(action)
yield actions
return actions
@coroutine
def build_condition(full_config, template_arg, args):
registry_entry, config = cg.extract_registry_entry_config(CONDITION_REGISTRY, full_config)
async def build_condition(full_config, template_arg, args):
registry_entry, config = cg.extract_registry_entry_config(
CONDITION_REGISTRY, full_config
)
action_id = full_config[CONF_TYPE_ID]
builder = registry_entry.coroutine_fun
yield builder(config, action_id, template_arg, args)
ret = await builder(config, action_id, template_arg, args)
return ret
@coroutine
def build_condition_list(config, templ, args):
async def build_condition_list(config, templ, args):
conditions = []
for conf in config:
condition = yield build_condition(conf, templ, args)
condition = await build_condition(conf, templ, args)
conditions.append(condition)
yield conditions
return conditions
@coroutine
def build_automation(trigger, args, config):
async def build_automation(trigger, args, config):
arg_types = [arg[0] for arg in args]
templ = cg.TemplateArguments(*arg_types)
obj = cg.new_Pvariable(config[CONF_AUTOMATION_ID], templ, trigger)
actions = yield build_action_list(config[CONF_THEN], templ, args)
actions = await build_action_list(config[CONF_THEN], templ, args)
cg.add(obj.add_actions(actions))
yield obj
return obj

View File

@@ -9,18 +9,80 @@
# pylint: disable=unused-import
from esphome.cpp_generator import ( # noqa
Expression, RawExpression, RawStatement, TemplateArguments,
StructInitializer, ArrayInitializer, safe_exp, Statement, LineComment,
progmem_array, statement, variable, Pvariable, new_Pvariable,
add, add_global, add_library, add_build_flag, add_define,
get_variable, get_variable_with_full_id, process_lambda, is_template, templatable, MockObj,
MockObjClass)
Expression,
RawExpression,
RawStatement,
TemplateArguments,
StructInitializer,
ArrayInitializer,
safe_exp,
Statement,
LineComment,
progmem_array,
static_const_array,
statement,
variable,
with_local_variable,
new_variable,
Pvariable,
new_Pvariable,
add,
add_global,
add_library,
add_build_flag,
add_define,
add_platformio_option,
get_variable,
get_variable_with_full_id,
process_lambda,
is_template,
templatable,
MockObj,
MockObjClass,
)
from esphome.cpp_helpers import ( # noqa
gpio_pin_expression, register_component, build_registry_entry,
build_registry_list, extract_registry_entry_config, register_parented)
gpio_pin_expression,
register_component,
build_registry_entry,
build_registry_list,
extract_registry_entry_config,
register_parented,
)
from esphome.cpp_types import ( # noqa
global_ns, void, nullptr, float_, double, bool_, int_, std_ns, std_string,
std_vector, uint8, uint16, uint32, int32, const_char_ptr, NAN,
esphome_ns, App, Nameable, Component, ComponentPtr,
PollingComponent, Application, optional, arduino_json_ns, JsonObject,
JsonObjectRef, JsonObjectConstRef, Controller, GPIOPin)
global_ns,
void,
nullptr,
float_,
double,
bool_,
int_,
std_ns,
std_string,
std_vector,
uint8,
uint16,
uint32,
uint64,
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,
)

View File

@@ -4,13 +4,14 @@
namespace esphome {
namespace a4988 {
static const char *TAG = "a4988.stepper";
static const char *const TAG = "a4988.stepper";
void A4988::setup() {
ESP_LOGCONFIG(TAG, "Setting up A4988...");
if (this->sleep_pin_ != nullptr) {
this->sleep_pin_->setup();
this->sleep_pin_->digital_write(false);
this->sleep_pin_state_ = false;
}
this->step_pin_->setup();
this->step_pin_->digital_write(false);
@@ -27,7 +28,12 @@ void A4988::dump_config() {
void A4988::loop() {
bool at_target = this->has_reached_target();
if (this->sleep_pin_ != nullptr) {
bool sleep_rising_edge = !sleep_pin_state_ & !at_target;
this->sleep_pin_->digital_write(!at_target);
this->sleep_pin_state_ = !at_target;
if (sleep_rising_edge) {
delayMicroseconds(1000);
}
}
if (at_target) {
this->high_freq_.stop();

View File

@@ -1,7 +1,7 @@
#pragma once
#include "esphome/core/component.h"
#include "esphome/core/esphal.h"
#include "esphome/core/hal.h"
#include "esphome/components/stepper/stepper.h"
namespace esphome {
@@ -21,6 +21,7 @@ class A4988 : public stepper::Stepper, public Component {
GPIOPin *step_pin_;
GPIOPin *dir_pin_;
GPIOPin *sleep_pin_{nullptr};
bool sleep_pin_state_;
HighFrequencyLoopRequester high_freq_;
};

View File

@@ -5,27 +5,29 @@ import esphome.codegen as cg
from esphome.const import CONF_DIR_PIN, CONF_ID, CONF_SLEEP_PIN, CONF_STEP_PIN
a4988_ns = cg.esphome_ns.namespace('a4988')
A4988 = a4988_ns.class_('A4988', stepper.Stepper, cg.Component)
a4988_ns = cg.esphome_ns.namespace("a4988")
A4988 = a4988_ns.class_("A4988", stepper.Stepper, cg.Component)
CONFIG_SCHEMA = stepper.STEPPER_SCHEMA.extend({
cv.Required(CONF_ID): cv.declare_id(A4988),
cv.Required(CONF_STEP_PIN): pins.gpio_output_pin_schema,
cv.Required(CONF_DIR_PIN): pins.gpio_output_pin_schema,
cv.Optional(CONF_SLEEP_PIN): pins.gpio_output_pin_schema,
}).extend(cv.COMPONENT_SCHEMA)
CONFIG_SCHEMA = stepper.STEPPER_SCHEMA.extend(
{
cv.Required(CONF_ID): cv.declare_id(A4988),
cv.Required(CONF_STEP_PIN): pins.gpio_output_pin_schema,
cv.Required(CONF_DIR_PIN): pins.gpio_output_pin_schema,
cv.Optional(CONF_SLEEP_PIN): pins.gpio_output_pin_schema,
}
).extend(cv.COMPONENT_SCHEMA)
def to_code(config):
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
yield cg.register_component(var, config)
yield stepper.register_stepper(var, config)
await cg.register_component(var, config)
await stepper.register_stepper(var, config)
step_pin = yield cg.gpio_pin_expression(config[CONF_STEP_PIN])
step_pin = await cg.gpio_pin_expression(config[CONF_STEP_PIN])
cg.add(var.set_step_pin(step_pin))
dir_pin = yield cg.gpio_pin_expression(config[CONF_DIR_PIN])
dir_pin = await cg.gpio_pin_expression(config[CONF_DIR_PIN])
cg.add(var.set_dir_pin(dir_pin))
if CONF_SLEEP_PIN in config:
sleep_pin = yield cg.gpio_pin_expression(config[CONF_SLEEP_PIN])
sleep_pin = await cg.gpio_pin_expression(config[CONF_SLEEP_PIN])
cg.add(var.set_sleep_pin(sleep_pin))

View File

@@ -1,28 +1,37 @@
#ifdef USE_ARDUINO
#include "ac_dimmer.h"
#include "esphome/core/helpers.h"
#include "esphome/core/log.h"
#include <cmath>
#ifdef ARDUINO_ARCH_ESP8266
#ifdef USE_ESP8266
#include <core_esp8266_waveform.h>
#endif
#ifdef USE_ESP32_FRAMEWORK_ARDUINO
#include <esp32-hal-timer.h>
#endif
namespace esphome {
namespace ac_dimmer {
static const char *TAG = "ac_dimmer";
static const char *const TAG = "ac_dimmer";
// Global array to store dimmer objects
static AcDimmerDataStore *all_dimmers[32];
static AcDimmerDataStore *all_dimmers[32]; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
/// Time in microseconds the gate should be held high
/// 10µs should be long enough for most triacs
/// For reference: BT136 datasheet says 2µs nominal (page 7)
static uint32_t GATE_ENABLE_TIME = 10;
/// However other factors like gate driver propagation time
/// are also considered and a really low value is not important
/// See also: https://github.com/esphome/issues/issues/1632
static const uint32_t GATE_ENABLE_TIME = 50;
/// Function called from timer interrupt
/// Input is current time in microseconds (micros())
/// Returns when next "event" is expected in µs, or 0 if no such event known.
uint32_t ICACHE_RAM_ATTR HOT AcDimmerDataStore::timer_intr(uint32_t now) {
uint32_t IRAM_ATTR HOT AcDimmerDataStore::timer_intr(uint32_t now) {
// If no ZC signal received yet.
if (this->crossed_zero_at == 0)
return 0;
@@ -34,19 +43,19 @@ uint32_t ICACHE_RAM_ATTR HOT AcDimmerDataStore::timer_intr(uint32_t now) {
if (this->enable_time_us != 0 && time_since_zc >= this->enable_time_us) {
this->enable_time_us = 0;
this->gate_pin->digital_write(true);
this->gate_pin.digital_write(true);
// Prevent too short pulses
this->disable_time_us = max(this->disable_time_us, time_since_zc + GATE_ENABLE_TIME);
this->disable_time_us = std::max(this->disable_time_us, time_since_zc + GATE_ENABLE_TIME);
}
if (this->disable_time_us != 0 && time_since_zc >= this->disable_time_us) {
this->disable_time_us = 0;
this->gate_pin->digital_write(false);
this->gate_pin.digital_write(false);
}
if (time_since_zc < this->enable_time_us)
if (time_since_zc < this->enable_time_us) {
// Next event is enable, return time until that event
return this->enable_time_us - time_since_zc;
else if (time_since_zc < disable_time_us) {
} else if (time_since_zc < disable_time_us) {
// Next event is disable, return time until that event
return this->disable_time_us - time_since_zc;
}
@@ -60,14 +69,15 @@ uint32_t ICACHE_RAM_ATTR HOT AcDimmerDataStore::timer_intr(uint32_t now) {
}
/// Run timer interrupt code and return in how many µs the next event is expected
uint32_t ICACHE_RAM_ATTR HOT timer_interrupt() {
uint32_t IRAM_ATTR HOT timer_interrupt() {
// run at least with 1kHz
uint32_t min_dt_us = 1000;
uint32_t now = micros();
for (auto *dimmer : all_dimmers) {
if (dimmer == nullptr)
if (dimmer == nullptr) {
// no more dimmers
break;
}
uint32_t res = dimmer->timer_intr(now);
if (res != 0 && res < min_dt_us)
min_dt_us = res;
@@ -77,7 +87,7 @@ uint32_t ICACHE_RAM_ATTR HOT timer_interrupt() {
}
/// GPIO interrupt routine, called when ZC pin triggers
void ICACHE_RAM_ATTR HOT AcDimmerDataStore::gpio_intr() {
void IRAM_ATTR HOT AcDimmerDataStore::gpio_intr() {
uint32_t prev_crossed = this->crossed_zero_at;
// 50Hz mains frequency should give a half cycle of 10ms a 60Hz will give 8.33ms
@@ -94,7 +104,7 @@ void ICACHE_RAM_ATTR HOT AcDimmerDataStore::gpio_intr() {
if (this->value == 65535) {
// fully on, enable output immediately
this->gate_pin->digital_write(true);
this->gate_pin.digital_write(true);
} else if (this->init_cycle) {
// send a full cycle
this->init_cycle = false;
@@ -102,30 +112,31 @@ void ICACHE_RAM_ATTR HOT AcDimmerDataStore::gpio_intr() {
this->disable_time_us = cycle_time_us;
} else if (this->value == 0) {
// fully off, disable output immediately
this->gate_pin->digital_write(false);
this->gate_pin.digital_write(false);
} else {
if (this->method == DIM_METHOD_TRAILING) {
this->enable_time_us = 1; // cannot be 0
this->disable_time_us = max((uint32_t) 10, this->value * this->cycle_time_us / 65535);
this->disable_time_us = std::max((uint32_t) 10, this->value * this->cycle_time_us / 65535);
} else {
// calculate time until enable in µs: (1.0-value)*cycle_time, but with integer arithmetic
// also take into account min_power
auto min_us = this->cycle_time_us * this->min_power / 1000;
this->enable_time_us = max((uint32_t) 1, ((65535 - this->value) * (this->cycle_time_us - min_us)) / 65535);
this->enable_time_us = std::max((uint32_t) 1, ((65535 - this->value) * (this->cycle_time_us - min_us)) / 65535);
if (this->method == DIM_METHOD_LEADING_PULSE) {
// Minimum pulse time should be enough for the triac to trigger when it is close to the ZC zone
// this is for brightness near 99%
this->disable_time_us = max(this->enable_time_us + GATE_ENABLE_TIME, (uint32_t) cycle_time_us / 10);
this->disable_time_us = std::max(this->enable_time_us + GATE_ENABLE_TIME, (uint32_t) cycle_time_us / 10);
} else {
this->gate_pin->digital_write(false);
this->gate_pin.digital_write(false);
this->disable_time_us = this->cycle_time_us;
}
}
}
}
void ICACHE_RAM_ATTR HOT AcDimmerDataStore::s_gpio_intr(AcDimmerDataStore *store) {
// Attaching pin interrupts on the same pin will override the previous interupt
void IRAM_ATTR HOT AcDimmerDataStore::s_gpio_intr(AcDimmerDataStore *store) {
// Attaching pin interrupts on the same pin will override the previous interrupt
// However, the user expects that multiple dimmers sharing the same ZC pin will work.
// We solve this in a bit of a hacky way: On each pin interrupt, we check all dimmers
// if any of them are using the same ZC pin, and also trigger the interrupt for *them*.
@@ -138,11 +149,11 @@ void ICACHE_RAM_ATTR HOT AcDimmerDataStore::s_gpio_intr(AcDimmerDataStore *store
}
}
#ifdef ARDUINO_ARCH_ESP32
#ifdef USE_ESP32
// ESP32 implementation, uses basically the same code but needs to wrap
// timer_interrupt() function to auto-reschedule
static hw_timer_t *dimmer_timer = nullptr;
void ICACHE_RAM_ATTR HOT AcDimmerDataStore::s_timer_intr() { timer_interrupt(); }
static hw_timer_t *dimmer_timer = nullptr; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
void IRAM_ATTR HOT AcDimmerDataStore::s_timer_intr() { timer_interrupt(); }
#endif
void AcDimmer::setup() {
@@ -171,15 +182,16 @@ void AcDimmer::setup() {
if (setup_zero_cross_pin) {
this->zero_cross_pin_->setup();
this->store_.zero_cross_pin = this->zero_cross_pin_->to_isr();
this->zero_cross_pin_->attach_interrupt(&AcDimmerDataStore::s_gpio_intr, &this->store_, FALLING);
this->zero_cross_pin_->attach_interrupt(&AcDimmerDataStore::s_gpio_intr, &this->store_,
gpio::INTERRUPT_FALLING_EDGE);
}
#ifdef ARDUINO_ARCH_ESP8266
#ifdef USE_ESP8266
// Uses ESP8266 waveform (soft PWM) class
// PWM and AcDimmer can even run at the same time this way
setTimer1Callback(&timer_interrupt);
#endif
#ifdef ARDUINO_ARCH_ESP32
#ifdef USE_ESP32
// 80 Divider -> 1 count=1µs
dimmer_timer = timerBegin(0, 80, true);
timerAttachInterrupt(dimmer_timer, &AcDimmerDataStore::s_timer_intr, true);
@@ -191,6 +203,7 @@ void AcDimmer::setup() {
#endif
}
void AcDimmer::write_state(float state) {
state = std::acos(1 - (2 * state)) / 3.14159; // RMS power compensation
auto new_value = static_cast<uint16_t>(roundf(state * 65535));
if (new_value != 0 && this->store_.value == 0)
this->store_.init_cycle = this->init_with_half_cycle_;
@@ -202,12 +215,13 @@ void AcDimmer::dump_config() {
LOG_PIN(" Zero-Cross Pin: ", this->zero_cross_pin_);
ESP_LOGCONFIG(TAG, " Min Power: %.1f%%", this->store_.min_power / 10.0f);
ESP_LOGCONFIG(TAG, " Init with half cycle: %s", YESNO(this->init_with_half_cycle_));
if (method_ == DIM_METHOD_LEADING_PULSE)
if (method_ == DIM_METHOD_LEADING_PULSE) {
ESP_LOGCONFIG(TAG, " Method: leading pulse");
else if (method_ == DIM_METHOD_LEADING)
} else if (method_ == DIM_METHOD_LEADING) {
ESP_LOGCONFIG(TAG, " Method: leading");
else
} else {
ESP_LOGCONFIG(TAG, " Method: trailing");
}
LOG_FLOAT_OUTPUT(this);
ESP_LOGV(TAG, " Estimated Frequency: %.3fHz", 1e6f / this->store_.cycle_time_us / 2);
@@ -215,3 +229,5 @@ void AcDimmer::dump_config() {
} // namespace ac_dimmer
} // namespace esphome
#endif // USE_ARDUINO

View File

@@ -1,7 +1,9 @@
#pragma once
#ifdef USE_ARDUINO
#include "esphome/core/component.h"
#include "esphome/core/esphal.h"
#include "esphome/core/hal.h"
#include "esphome/components/output/float_output.h"
namespace esphome {
@@ -11,11 +13,11 @@ enum DimMethod { DIM_METHOD_LEADING_PULSE = 0, DIM_METHOD_LEADING, DIM_METHOD_TR
struct AcDimmerDataStore {
/// Zero-cross pin
ISRInternalGPIOPin *zero_cross_pin;
ISRInternalGPIOPin zero_cross_pin;
/// Zero-cross pin number - used to share ZC pin across multiple dimmers
uint8_t zero_cross_pin_number;
/// Output pin to write to
ISRInternalGPIOPin *gate_pin;
ISRInternalGPIOPin gate_pin;
/// Value of the dimmer - 0 to 65535.
uint16_t value;
/// Minimum power for activation
@@ -37,7 +39,7 @@ struct AcDimmerDataStore {
void gpio_intr();
static void s_gpio_intr(AcDimmerDataStore *store);
#ifdef ARDUINO_ARCH_ESP32
#ifdef USE_ESP32
static void s_timer_intr();
#endif
};
@@ -47,16 +49,16 @@ class AcDimmer : public output::FloatOutput, public Component {
void setup() override;
void dump_config() override;
void set_gate_pin(GPIOPin *gate_pin) { gate_pin_ = gate_pin; }
void set_zero_cross_pin(GPIOPin *zero_cross_pin) { zero_cross_pin_ = zero_cross_pin; }
void set_gate_pin(InternalGPIOPin *gate_pin) { gate_pin_ = gate_pin; }
void set_zero_cross_pin(InternalGPIOPin *zero_cross_pin) { zero_cross_pin_ = zero_cross_pin; }
void set_init_with_half_cycle(bool init_with_half_cycle) { init_with_half_cycle_ = init_with_half_cycle; }
void set_method(DimMethod method) { method_ = method; }
protected:
void write_state(float state) override;
GPIOPin *gate_pin_;
GPIOPin *zero_cross_pin_;
InternalGPIOPin *gate_pin_;
InternalGPIOPin *zero_cross_pin_;
AcDimmerDataStore store_;
bool init_with_half_cycle_;
DimMethod method_;
@@ -64,3 +66,5 @@ class AcDimmer : public output::FloatOutput, public Component {
} // namespace ac_dimmer
} // namespace esphome
#endif // USE_ARDUINO

View File

@@ -4,42 +4,49 @@ from esphome import pins
from esphome.components import output
from esphome.const import CONF_ID, CONF_MIN_POWER, CONF_METHOD
CODEOWNERS = ['@glmnet']
CODEOWNERS = ["@glmnet"]
ac_dimmer_ns = cg.esphome_ns.namespace('ac_dimmer')
AcDimmer = ac_dimmer_ns.class_('AcDimmer', output.FloatOutput, cg.Component)
ac_dimmer_ns = cg.esphome_ns.namespace("ac_dimmer")
AcDimmer = ac_dimmer_ns.class_("AcDimmer", output.FloatOutput, cg.Component)
DimMethod = ac_dimmer_ns.enum('DimMethod')
DimMethod = ac_dimmer_ns.enum("DimMethod")
DIM_METHODS = {
'LEADING_PULSE': DimMethod.DIM_METHOD_LEADING_PULSE,
'LEADING': DimMethod.DIM_METHOD_LEADING,
'TRAILING': DimMethod.DIM_METHOD_TRAILING,
"LEADING_PULSE": DimMethod.DIM_METHOD_LEADING_PULSE,
"LEADING": DimMethod.DIM_METHOD_LEADING,
"TRAILING": DimMethod.DIM_METHOD_TRAILING,
}
CONF_GATE_PIN = 'gate_pin'
CONF_ZERO_CROSS_PIN = 'zero_cross_pin'
CONF_INIT_WITH_HALF_CYCLE = 'init_with_half_cycle'
CONFIG_SCHEMA = output.FLOAT_OUTPUT_SCHEMA.extend({
cv.Required(CONF_ID): cv.declare_id(AcDimmer),
cv.Required(CONF_GATE_PIN): pins.internal_gpio_output_pin_schema,
cv.Required(CONF_ZERO_CROSS_PIN): pins.internal_gpio_input_pin_schema,
cv.Optional(CONF_INIT_WITH_HALF_CYCLE, default=True): cv.boolean,
cv.Optional(CONF_METHOD, default='leading pulse'): cv.enum(DIM_METHODS, upper=True, space='_'),
}).extend(cv.COMPONENT_SCHEMA)
CONF_GATE_PIN = "gate_pin"
CONF_ZERO_CROSS_PIN = "zero_cross_pin"
CONF_INIT_WITH_HALF_CYCLE = "init_with_half_cycle"
CONFIG_SCHEMA = cv.All(
output.FLOAT_OUTPUT_SCHEMA.extend(
{
cv.Required(CONF_ID): cv.declare_id(AcDimmer),
cv.Required(CONF_GATE_PIN): pins.internal_gpio_output_pin_schema,
cv.Required(CONF_ZERO_CROSS_PIN): pins.internal_gpio_input_pin_schema,
cv.Optional(CONF_INIT_WITH_HALF_CYCLE, default=True): cv.boolean,
cv.Optional(CONF_METHOD, default="leading pulse"): cv.enum(
DIM_METHODS, upper=True, space="_"
),
}
).extend(cv.COMPONENT_SCHEMA),
cv.only_with_arduino,
)
def to_code(config):
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
yield cg.register_component(var, config)
await cg.register_component(var, config)
# override default min power to 10%
if CONF_MIN_POWER not in config:
config[CONF_MIN_POWER] = 0.1
yield output.register_output(var, config)
await output.register_output(var, config)
pin = yield cg.gpio_pin_expression(config[CONF_GATE_PIN])
pin = await cg.gpio_pin_expression(config[CONF_GATE_PIN])
cg.add(var.set_gate_pin(pin))
pin = yield cg.gpio_pin_expression(config[CONF_ZERO_CROSS_PIN])
pin = await cg.gpio_pin_expression(config[CONF_ZERO_CROSS_PIN])
cg.add(var.set_zero_cross_pin(pin))
cg.add(var.set_init_with_half_cycle(config[CONF_INIT_WITH_HALF_CYCLE]))
cg.add(var.set_method(config[CONF_METHOD]))

View File

@@ -5,20 +5,23 @@ from esphome.components.light.types import AddressableLightEffect
from esphome.components.light.effects import register_addressable_effect
from esphome.const import CONF_NAME, CONF_UART_ID
DEPENDENCIES = ['uart']
DEPENDENCIES = ["uart"]
adalight_ns = cg.esphome_ns.namespace('adalight')
adalight_ns = cg.esphome_ns.namespace("adalight")
AdalightLightEffect = adalight_ns.class_(
'AdalightLightEffect', uart.UARTDevice, AddressableLightEffect)
"AdalightLightEffect", uart.UARTDevice, AddressableLightEffect
)
CONFIG_SCHEMA = cv.Schema({})
@register_addressable_effect('adalight', AdalightLightEffect, "Adalight", {
cv.GenerateID(CONF_UART_ID): cv.use_id(uart.UARTComponent)
})
def adalight_light_effect_to_code(config, effect_id):
@register_addressable_effect(
"adalight",
AdalightLightEffect,
"Adalight",
{cv.GenerateID(CONF_UART_ID): cv.use_id(uart.UARTComponent)},
)
async def adalight_light_effect_to_code(config, effect_id):
effect = cg.new_Pvariable(effect_id, config[CONF_NAME])
yield uart.register_uart_device(effect, config)
yield effect
await uart.register_uart_device(effect, config)
return effect

View File

@@ -4,7 +4,7 @@
namespace esphome {
namespace adalight {
static const char *TAG = "adalight_light_effect";
static const char *const TAG = "adalight_light_effect";
static const uint32_t ADALIGHT_ACK_INTERVAL = 1000;
static const uint32_t ADALIGHT_RECEIVE_TIMEOUT = 1000;
@@ -25,7 +25,7 @@ void AdalightLightEffect::stop() {
AddressableLightEffect::stop();
}
int AdalightLightEffect::get_frame_size_(int led_count) const {
unsigned int AdalightLightEffect::get_frame_size_(int led_count) const {
// 3 bytes: Ada
// 2 bytes: LED count
// 1 byte: checksum
@@ -42,11 +42,12 @@ void AdalightLightEffect::reset_frame_(light::AddressableLight &it) {
void AdalightLightEffect::blank_all_leds_(light::AddressableLight &it) {
for (int led = it.size(); led-- > 0;) {
it[led].set(light::ESPColor::BLACK);
it[led].set(Color::BLACK);
}
it.schedule_show();
}
void AdalightLightEffect::apply(light::AddressableLight &it, const light::ESPColor &current_color) {
void AdalightLightEffect::apply(light::AddressableLight &it, const Color &current_color) {
const uint32_t now = millis();
if (now - this->last_ack_ >= ADALIGHT_ACK_INTERVAL) {
@@ -130,9 +131,10 @@ AdalightLightEffect::Frame AdalightLightEffect::parse_frame_(light::AddressableL
for (int led = 0; led < accepted_led_count; led++, led_data += 3) {
auto white = std::min(std::min(led_data[0], led_data[1]), led_data[2]);
it[led].set(light::ESPColor(led_data[0], led_data[1], led_data[2], white));
it[led].set(Color(led_data[0], led_data[1], led_data[2], white));
}
it.schedule_show();
return CONSUMED;
}

View File

@@ -13,10 +13,9 @@ class AdalightLightEffect : public light::AddressableLightEffect, public uart::U
public:
AdalightLightEffect(const std::string &name);
public:
void start() override;
void stop() override;
void apply(light::AddressableLight &it, const light::ESPColor &current_color) override;
void apply(light::AddressableLight &it, const Color &current_color) override;
protected:
enum Frame {
@@ -25,12 +24,11 @@ class AdalightLightEffect : public light::AddressableLightEffect, public uart::U
CONSUMED,
};
int get_frame_size_(int led_count) const;
unsigned int get_frame_size_(int led_count) const;
void reset_frame_(light::AddressableLight &it);
void blank_all_leds_(light::AddressableLight &it);
Frame parse_frame_(light::AddressableLight &it);
protected:
uint32_t last_ack_{0};
uint32_t last_byte_{0};
uint32_t last_reset_{0};

View File

@@ -1 +1 @@
CODEOWNERS = ['@esphome/core']
CODEOWNERS = ["@esphome/core"]

View File

@@ -1,90 +1,181 @@
#include "adc_sensor.h"
#include "esphome/core/log.h"
#include "esphome/core/helpers.h"
#ifdef USE_ESP8266
#ifdef USE_ADC_SENSOR_VCC
#include <Esp.h>
ADC_MODE(ADC_VCC)
#else
#include <Arduino.h>
#endif
#endif
namespace esphome {
namespace adc {
static const char *TAG = "adc";
static const char *const TAG = "adc";
#ifdef ARDUINO_ARCH_ESP32
void ADCSensor::set_attenuation(adc_attenuation_t attenuation) { this->attenuation_ = attenuation; }
// 13bit for S2, and 12bit 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 int SOC_ADC_RTC_MAX_BITWIDTH = 13;
#else
static const int 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
void ADCSensor::setup() {
ESP_LOGCONFIG(TAG, "Setting up ADC '%s'...", this->get_name().c_str());
GPIOPin(this->pin_, INPUT).setup();
#ifdef ARDUINO_ARCH_ESP32
analogSetPinAttenuation(this->pin_, this->attenuation_);
#ifndef USE_ADC_SENSOR_VCC
pin_->setup();
#endif
#ifdef USE_ESP32
adc1_config_width(ADC_WIDTH_MAX_SOC_BITS);
if (!autorange_) {
adc1_config_channel_atten(channel_, attenuation_);
}
// load characteristics for each attenuation
for (int i = 0; i < (int) ADC_ATTEN_MAX; i++) {
auto cal_value = esp_adc_cal_characterize(ADC_UNIT_1, (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
}
void ADCSensor::dump_config() {
LOG_SENSOR("", "ADC Sensor", this);
#ifdef ARDUINO_ARCH_ESP8266
#ifdef USE_ESP8266
#ifdef USE_ADC_SENSOR_VCC
ESP_LOGCONFIG(TAG, " Pin: VCC");
#else
ESP_LOGCONFIG(TAG, " Pin: %u", this->pin_);
LOG_PIN(" Pin: ", pin_);
#endif
#endif
#ifdef ARDUINO_ARCH_ESP32
ESP_LOGCONFIG(TAG, " Pin: %u", this->pin_);
switch (this->attenuation_) {
case ADC_0db:
ESP_LOGCONFIG(TAG, " Attenuation: 0db (max 1.1V)");
break;
case ADC_2_5db:
ESP_LOGCONFIG(TAG, " Attenuation: 2.5db (max 1.5V)");
break;
case ADC_6db:
ESP_LOGCONFIG(TAG, " Attenuation: 6db (max 2.2V)");
break;
case ADC_11db:
ESP_LOGCONFIG(TAG, " Attenuation: 11db (max 3.9V)");
break;
#endif // USE_ESP8266
#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
#endif // USE_ESP32
LOG_UPDATE_INTERVAL(this);
}
float ADCSensor::get_setup_priority() const { return setup_priority::DATA; }
void ADCSensor::update() {
float value_v = this->sample();
ESP_LOGD(TAG, "'%s': Got voltage=%.2fV", this->get_name().c_str(), value_v);
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 ARDUINO_ARCH_ESP32
float value_v = analogRead(this->pin_) / 4095.0f; // NOLINT
switch (this->attenuation_) {
case ADC_0db:
value_v *= 1.1;
break;
case ADC_2_5db:
value_v *= 1.5;
break;
case ADC_6db:
value_v *= 2.2;
break;
case ADC_11db:
value_v *= 3.9;
break;
#ifdef USE_ADC_SENSOR_VCC
int raw = ESP.getVcc(); // NOLINT(readability-static-accessed-through-instance)
#else
int raw = analogRead(this->pin_->get_pin()); // NOLINT
#endif
if (output_raw_) {
return raw;
}
return value_v;
return raw / 1024.0f;
}
#endif
#ifdef ARDUINO_ARCH_ESP8266
#ifdef USE_ADC_SENSOR_VCC
return ESP.getVcc() / 1024.0f;
#else
return analogRead(this->pin_) / 1024.0f; // NOLINT
#endif
#endif
#ifdef USE_ESP32
float ADCSensor::sample() {
if (!autorange_) {
int raw = adc1_get_raw(channel_);
if (raw == -1) {
return NAN;
}
if (output_raw_) {
return raw;
}
uint32_t mv = esp_adc_cal_raw_to_voltage(raw, &cal_characteristics_[(int) attenuation_]);
return mv / 1000.0f;
}
int raw11, raw6 = ADC_MAX, raw2 = ADC_MAX, raw0 = ADC_MAX;
adc1_config_channel_atten(channel_, ADC_ATTEN_DB_11);
raw11 = adc1_get_raw(channel_);
if (raw11 < ADC_MAX) {
adc1_config_channel_atten(channel_, ADC_ATTEN_DB_6);
raw6 = adc1_get_raw(channel_);
if (raw6 < ADC_MAX) {
adc1_config_channel_atten(channel_, ADC_ATTEN_DB_2_5);
raw2 = adc1_get_raw(channel_);
if (raw2 < ADC_MAX) {
adc1_config_channel_atten(channel_, ADC_ATTEN_DB_0);
raw0 = adc1_get_raw(channel_);
}
}
}
if (raw0 == -1 || raw2 == -1 || raw6 == -1 || raw11 == -1) {
return NAN;
}
uint32_t mv11 = esp_adc_cal_raw_to_voltage(raw11, &cal_characteristics_[(int) ADC_ATTEN_DB_11]);
uint32_t mv6 = esp_adc_cal_raw_to_voltage(raw6, &cal_characteristics_[(int) ADC_ATTEN_DB_6]);
uint32_t mv2 = esp_adc_cal_raw_to_voltage(raw2, &cal_characteristics_[(int) ADC_ATTEN_DB_2_5]);
uint32_t mv0 = esp_adc_cal_raw_to_voltage(raw0, &cal_characteristics_[(int) 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);
}
#ifdef ARDUINO_ARCH_ESP8266
#endif // USE_ESP32
#ifdef USE_ESP8266
std::string ADCSensor::unique_id() { return get_mac_address() + "-adc"; }
#endif

View File

@@ -1,19 +1,26 @@
#pragma once
#include "esphome/core/component.h"
#include "esphome/core/esphal.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"
#ifdef USE_ESP32
#include "driver/adc.h"
#include <esp_adc_cal.h>
#endif
namespace esphome {
namespace adc {
class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage_sampler::VoltageSampler {
public:
#ifdef ARDUINO_ARCH_ESP32
#ifdef USE_ESP32
/// Set the attenuation for this pin. Only available on the ESP32.
void set_attenuation(adc_attenuation_t attenuation);
void set_attenuation(adc_atten_t attenuation) { attenuation_ = attenuation; }
void set_channel(adc1_channel_t channel) { channel_ = channel; }
void set_autorange(bool autorange) { autorange_ = autorange; }
#endif
/// Update adc values.
@@ -23,18 +30,23 @@ class ADCSensor : public sensor::Sensor, public PollingComponent, public voltage
void dump_config() override;
/// `HARDWARE_LATE` setup priority.
float get_setup_priority() const override;
void set_pin(uint8_t pin) { this->pin_ = pin; }
void set_pin(InternalGPIOPin *pin) { this->pin_ = pin; }
void set_output_raw(bool output_raw) { output_raw_ = output_raw; }
float sample() override;
#ifdef ARDUINO_ARCH_ESP8266
#ifdef USE_ESP8266
std::string unique_id() override;
#endif
protected:
uint8_t pin_;
InternalGPIOPin *pin_;
bool output_raw_{false};
#ifdef ARDUINO_ARCH_ESP32
adc_attenuation_t attenuation_{ADC_0db};
#ifdef USE_ESP32
adc_atten_t attenuation_{ADC_ATTEN_DB_0};
adc1_channel_t channel_{};
bool autorange_{false};
esp_adc_cal_characteristics_t cal_characteristics_[(int) ADC_ATTEN_MAX] = {};
#endif
};

View File

@@ -2,47 +2,179 @@ import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import pins
from esphome.components import sensor, voltage_sampler
from esphome.const import CONF_ATTENUATION, CONF_ID, CONF_PIN, ICON_FLASH, UNIT_VOLT
from esphome.const import (
CONF_ATTENUATION,
CONF_RAW,
CONF_ID,
CONF_INPUT,
CONF_NUMBER,
CONF_PIN,
DEVICE_CLASS_VOLTAGE,
STATE_CLASS_MEASUREMENT,
UNIT_VOLT,
)
from esphome.core import CORE
from esphome.components.esp32 import get_esp32_variant
from esphome.components.esp32.const import (
VARIANT_ESP32,
VARIANT_ESP32C3,
VARIANT_ESP32H2,
VARIANT_ESP32S2,
VARIANT_ESP32S3,
)
AUTO_LOAD = ['voltage_sampler']
AUTO_LOAD = ["voltage_sampler"]
ATTENUATION_MODES = {
'0db': cg.global_ns.ADC_0db,
'2.5db': cg.global_ns.ADC_2_5db,
'6db': cg.global_ns.ADC_6db,
'11db': cg.global_ns.ADC_11db,
"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,
"auto": "auto",
}
adc1_channel_t = cg.global_ns.enum("adc1_channel_t")
# From https://github.com/espressif/esp-idf/blob/master/components/driver/include/driver/adc_common.h
# pin to adc1 channel mapping
ESP32_VARIANT_ADC1_PIN_TO_CHANNEL = {
VARIANT_ESP32: {
36: adc1_channel_t.ADC1_CHANNEL_0,
37: adc1_channel_t.ADC1_CHANNEL_1,
38: adc1_channel_t.ADC1_CHANNEL_2,
39: adc1_channel_t.ADC1_CHANNEL_3,
32: adc1_channel_t.ADC1_CHANNEL_4,
33: adc1_channel_t.ADC1_CHANNEL_5,
34: adc1_channel_t.ADC1_CHANNEL_6,
35: adc1_channel_t.ADC1_CHANNEL_7,
},
VARIANT_ESP32S2: {
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,
6: adc1_channel_t.ADC1_CHANNEL_5,
7: adc1_channel_t.ADC1_CHANNEL_6,
8: adc1_channel_t.ADC1_CHANNEL_7,
9: adc1_channel_t.ADC1_CHANNEL_8,
10: adc1_channel_t.ADC1_CHANNEL_9,
},
VARIANT_ESP32S3: {
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,
6: adc1_channel_t.ADC1_CHANNEL_5,
7: adc1_channel_t.ADC1_CHANNEL_6,
8: adc1_channel_t.ADC1_CHANNEL_7,
9: adc1_channel_t.ADC1_CHANNEL_8,
10: adc1_channel_t.ADC1_CHANNEL_9,
},
VARIANT_ESP32C3: {
0: adc1_channel_t.ADC1_CHANNEL_0,
1: adc1_channel_t.ADC1_CHANNEL_1,
2: adc1_channel_t.ADC1_CHANNEL_2,
3: adc1_channel_t.ADC1_CHANNEL_3,
4: adc1_channel_t.ADC1_CHANNEL_4,
},
VARIANT_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,
},
}
def validate_adc_pin(value):
vcc = str(value).upper()
if vcc == 'VCC':
return cv.only_on_esp8266(vcc)
return pins.analog_pin(value)
if str(value).upper() == "VCC":
return cv.only_on_esp8266("VCC")
if CORE.is_esp32:
value = pins.internal_gpio_input_pin_number(value)
variant = get_esp32_variant()
if variant not in ESP32_VARIANT_ADC1_PIN_TO_CHANNEL:
raise cv.Invalid(f"This ESP32 variant ({variant}) is not supported")
if value not in ESP32_VARIANT_ADC1_PIN_TO_CHANNEL[variant]:
raise cv.Invalid(f"{variant} doesn't support ADC on this pin")
return pins.internal_gpio_input_pin_schema(value)
if CORE.is_esp8266:
from esphome.components.esp8266.gpio import CONF_ANALOG
value = pins.internal_gpio_pin_number({CONF_ANALOG: True, CONF_INPUT: True})(
value
)
if value != 17: # A0
raise cv.Invalid("ESP8266: Only pin A0 (GPIO17) supports ADC.")
return pins.gpio_pin_schema(
{CONF_ANALOG: True, CONF_INPUT: True}, internal=True
)(value)
raise NotImplementedError
adc_ns = cg.esphome_ns.namespace('adc')
ADCSensor = adc_ns.class_('ADCSensor', sensor.Sensor, cg.PollingComponent,
voltage_sampler.VoltageSampler)
CONFIG_SCHEMA = sensor.sensor_schema(UNIT_VOLT, ICON_FLASH, 2).extend({
cv.GenerateID(): cv.declare_id(ADCSensor),
cv.Required(CONF_PIN): validate_adc_pin,
cv.SplitDefault(CONF_ATTENUATION, esp32='0db'):
cv.All(cv.only_on_esp32, cv.enum(ATTENUATION_MODES, lower=True)),
}).extend(cv.polling_component_schema('60s'))
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.")
return config
def to_code(config):
adc_ns = cg.esphome_ns.namespace("adc")
ADCSensor = adc_ns.class_(
"ADCSensor", sensor.Sensor, cg.PollingComponent, voltage_sampler.VoltageSampler
)
CONFIG_SCHEMA = cv.All(
sensor.sensor_schema(
ADCSensor,
unit_of_measurement=UNIT_VOLT,
accuracy_decimals=2,
device_class=DEVICE_CLASS_VOLTAGE,
state_class=STATE_CLASS_MEASUREMENT,
)
.extend(
{
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)
),
}
)
.extend(cv.polling_component_schema("60s")),
validate_config,
)
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
yield cg.register_component(var, config)
yield sensor.register_sensor(var, config)
await cg.register_component(var, config)
await sensor.register_sensor(var, config)
if config[CONF_PIN] == 'VCC':
cg.add_define('USE_ADC_SENSOR_VCC')
if config[CONF_PIN] == "VCC":
cg.add_define("USE_ADC_SENSOR_VCC")
else:
cg.add(var.set_pin(config[CONF_PIN]))
pin = await cg.gpio_pin_expression(config[CONF_PIN])
cg.add(var.set_pin(pin))
if CONF_RAW in config:
cg.add(var.set_output_raw(config[CONF_RAW]))
if CONF_ATTENUATION in config:
cg.add(var.set_attenuation(config[CONF_ATTENUATION]))
if config[CONF_ATTENUATION] == "auto":
cg.add(var.set_autorange(cg.global_ns.true))
else:
cg.add(var.set_attenuation(config[CONF_ATTENUATION]))
if CORE.is_esp32:
variant = get_esp32_variant()
pin_num = config[CONF_PIN][CONF_NUMBER]
chan = ESP32_VARIANT_ADC1_PIN_TO_CHANNEL[variant][pin_num]
cg.add(var.set_channel(chan))

View File

@@ -0,0 +1,67 @@
#include "addressable_light_display.h"
#include "esphome/core/log.h"
namespace esphome {
namespace addressable_light {
static const char *const TAG = "addressable_light.display";
int AddressableLightDisplay::get_width_internal() { return this->width_; }
int AddressableLightDisplay::get_height_internal() { return this->height_; }
void AddressableLightDisplay::setup() {
this->addressable_light_buffer_.resize(this->width_ * this->height_, {0, 0, 0, 0});
}
void AddressableLightDisplay::update() {
if (!this->enabled_)
return;
this->do_update_();
this->display();
}
void AddressableLightDisplay::display() {
bool dirty = false;
uint8_t old_r, old_g, old_b, old_w;
Color *c;
for (uint32_t offset = 0; offset < this->addressable_light_buffer_.size(); offset++) {
c = &(this->addressable_light_buffer_[offset]);
light::ESPColorView pixel = (*this->light_)[offset];
// Track the original values for the pixel view. If it has changed updating, then
// we trigger a redraw. Avoiding redraws == avoiding flicker!
old_r = pixel.get_red();
old_g = pixel.get_green();
old_b = pixel.get_blue();
old_w = pixel.get_white();
pixel.set_rgbw(c->r, c->g, c->b, c->w);
// If the actual value of the pixel changed, then schedule a redraw.
if (pixel.get_red() != old_r || pixel.get_green() != old_g || pixel.get_blue() != old_b ||
pixel.get_white() != old_w) {
dirty = true;
}
}
if (dirty) {
this->light_->schedule_show();
}
}
void HOT AddressableLightDisplay::draw_absolute_pixel_internal(int x, int y, Color color) {
if (x >= this->get_width_internal() || x < 0 || y >= this->get_height_internal() || y < 0)
return;
if (this->pixel_mapper_f_.has_value()) {
// Params are passed by reference, so they may be modified in call.
this->addressable_light_buffer_[(*this->pixel_mapper_f_)(x, y)] = color;
} else {
this->addressable_light_buffer_[y * this->get_width_internal() + x] = color;
}
}
} // namespace addressable_light
} // namespace esphome

View File

@@ -0,0 +1,61 @@
#pragma once
#include "esphome/core/component.h"
#include "esphome/core/color.h"
#include "esphome/components/display/display_buffer.h"
#include "esphome/components/light/addressable_light.h"
namespace esphome {
namespace addressable_light {
class AddressableLightDisplay : public display::DisplayBuffer, public PollingComponent {
public:
light::AddressableLight *get_light() const { return this->light_; }
void set_width(int32_t width) { width_ = width; }
void set_height(int32_t height) { height_ = height; }
void set_light(light::LightState *state) {
light_state_ = state;
light_ = static_cast<light::AddressableLight *>(state->get_output());
}
void set_enabled(bool enabled) {
if (light_state_) {
if (enabled_ && !enabled) { // enabled -> disabled
// - Tell the parent light to refresh, effectively wiping the display. Also
// restores the previous effect (if any).
light_state_->make_call().set_effect(this->last_effect_).perform();
} else if (!enabled_ && enabled) { // disabled -> enabled
// - Save the current effect.
this->last_effect_ = light_state_->get_effect_name();
// - Disable any current effect.
light_state_->make_call().set_effect(0).perform();
}
}
enabled_ = enabled;
}
bool get_enabled() { return enabled_; }
void set_pixel_mapper(std::function<int(int, int)> &&pixel_mapper_f) { this->pixel_mapper_f_ = pixel_mapper_f; }
void setup() override;
void display();
display::DisplayType get_display_type() override { return display::DisplayType::DISPLAY_TYPE_COLOR; }
protected:
int get_width_internal() override;
int get_height_internal() override;
void draw_absolute_pixel_internal(int x, int y, Color color) override;
void update() override;
light::LightState *light_state_;
light::AddressableLight *light_;
bool enabled_{true};
int32_t width_;
int32_t height_;
std::vector<Color> addressable_light_buffer_;
optional<std::string> last_effect_;
optional<std::function<int(int, int)>> pixel_mapper_f_;
};
} // namespace addressable_light
} // namespace esphome

View File

@@ -0,0 +1,63 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import display, light
from esphome.const import (
CONF_ID,
CONF_LAMBDA,
CONF_PAGES,
CONF_ADDRESSABLE_LIGHT_ID,
CONF_HEIGHT,
CONF_WIDTH,
CONF_UPDATE_INTERVAL,
CONF_PIXEL_MAPPER,
)
CODEOWNERS = ["@justfalter"]
addressable_light_ns = cg.esphome_ns.namespace("addressable_light")
AddressableLightDisplay = addressable_light_ns.class_(
"AddressableLightDisplay", display.DisplayBuffer, cg.PollingComponent
)
CONFIG_SCHEMA = cv.All(
display.FULL_DISPLAY_SCHEMA.extend(
{
cv.GenerateID(): cv.declare_id(AddressableLightDisplay),
cv.Required(CONF_ADDRESSABLE_LIGHT_ID): cv.use_id(
light.AddressableLightState
),
cv.Required(CONF_WIDTH): cv.positive_int,
cv.Required(CONF_HEIGHT): cv.positive_int,
cv.Optional(
CONF_UPDATE_INTERVAL, default="16ms"
): cv.positive_time_period_milliseconds,
cv.Optional(CONF_PIXEL_MAPPER): cv.returning_lambda,
}
),
cv.has_at_most_one_key(CONF_PAGES, CONF_LAMBDA),
)
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
wrapped_light = await cg.get_variable(config[CONF_ADDRESSABLE_LIGHT_ID])
cg.add(var.set_width(config[CONF_WIDTH]))
cg.add(var.set_height(config[CONF_HEIGHT]))
cg.add(var.set_light(wrapped_light))
await cg.register_component(var, config)
await display.register_display(var, config)
if CONF_PIXEL_MAPPER in config:
pixel_mapper_template_ = await cg.process_lambda(
config[CONF_PIXEL_MAPPER],
[(int, "x"), (int, "y")],
return_type=cg.int_,
)
cg.add(var.set_pixel_mapper(pixel_mapper_template_))
if CONF_LAMBDA in config:
lambda_ = await cg.process_lambda(
config[CONF_LAMBDA], [(display.DisplayBufferRef, "it")], return_type=cg.void
)
cg.add(var.set_writer(lambda_))

View File

@@ -4,13 +4,11 @@
namespace esphome {
namespace ade7953 {
static const char *TAG = "ade7953";
static const char *const TAG = "ade7953";
void ADE7953::dump_config() {
ESP_LOGCONFIG(TAG, "ADE7953:");
if (this->has_irq_) {
ESP_LOGCONFIG(TAG, " IRQ Pin: GPIO%u", this->irq_pin_number_);
}
LOG_PIN(" IRQ Pin: ", irq_pin_);
LOG_I2C_DEVICE(this);
LOG_UPDATE_INTERVAL(this);
LOG_SENSOR(" ", "Voltage Sensor", this->voltage_sensor_);
@@ -20,27 +18,28 @@ void ADE7953::dump_config() {
LOG_SENSOR(" ", "Active Power B Sensor", this->active_power_b_sensor_);
}
#define ADE_PUBLISH_(name, factor) \
if (name && this->name##_sensor_) { \
float value = *name / factor; \
#define ADE_PUBLISH_(name, val, factor) \
if (err == i2c::ERROR_OK && this->name##_sensor_) { \
float value = (val) / (factor); \
this->name##_sensor_->publish_state(value); \
}
#define ADE_PUBLISH(name, factor) ADE_PUBLISH_(name, factor)
#define ADE_PUBLISH(name, val, factor) ADE_PUBLISH_(name, val, factor)
void ADE7953::update() {
if (!this->is_setup_)
return;
auto active_power_a = this->ade_read_<int32_t>(0x0312);
ADE_PUBLISH(active_power_a, 154.0f);
auto active_power_b = this->ade_read_<int32_t>(0x0313);
ADE_PUBLISH(active_power_b, 154.0f);
auto current_a = this->ade_read_<uint32_t>(0x031A);
ADE_PUBLISH(current_a, 100000.0f);
auto current_b = this->ade_read_<uint32_t>(0x031B);
ADE_PUBLISH(current_b, 100000.0f);
auto voltage = this->ade_read_<uint32_t>(0x031C);
ADE_PUBLISH(voltage, 26000.0f);
uint32_t val;
i2c::ErrorCode err = ade_read_32_(0x0312, &val);
ADE_PUBLISH(active_power_a, (int32_t) val, 154.0f);
err = ade_read_32_(0x0313, &val);
ADE_PUBLISH(active_power_b, (int32_t) val, 154.0f);
err = ade_read_32_(0x031A, &val);
ADE_PUBLISH(current_a, (uint32_t) val, 100000.0f);
err = ade_read_32_(0x031B, &val);
ADE_PUBLISH(current_b, (uint32_t) val, 100000.0f);
err = ade_read_32_(0x031C, &val);
ADE_PUBLISH(voltage, (uint32_t) val, 26000.0f);
// auto apparent_power_a = this->ade_read_<int32_t>(0x0310);
// auto apparent_power_b = this->ade_read_<int32_t>(0x0311);

View File

@@ -1,6 +1,7 @@
#pragma once
#include "esphome/core/component.h"
#include "esphome/core/hal.h"
#include "esphome/components/i2c/i2c.h"
#include "esphome/components/sensor/sensor.h"
@@ -9,10 +10,7 @@ namespace ade7953 {
class ADE7953 : public i2c::I2CDevice, public PollingComponent {
public:
void set_irq_pin(uint8_t irq_pin) {
has_irq_ = true;
irq_pin_number_ = irq_pin;
}
void set_irq_pin(InternalGPIOPin *irq_pin) { irq_pin_ = irq_pin; }
void set_voltage_sensor(sensor::Sensor *voltage_sensor) { voltage_sensor_ = voltage_sensor; }
void set_current_a_sensor(sensor::Sensor *current_a_sensor) { current_a_sensor_ = current_a_sensor; }
void set_current_b_sensor(sensor::Sensor *current_b_sensor) { current_b_sensor_ = current_b_sensor; }
@@ -24,15 +22,13 @@ class ADE7953 : public i2c::I2CDevice, public PollingComponent {
}
void setup() override {
if (this->has_irq_) {
auto pin = GPIOPin(this->irq_pin_number_, INPUT);
this->irq_pin_ = &pin;
if (this->irq_pin_ != nullptr) {
this->irq_pin_->setup();
}
this->set_timeout(100, [this]() {
this->ade_write_<uint8_t>(0x0010, 0x04);
this->ade_write_<uint8_t>(0x00FE, 0xAD);
this->ade_write_<uint16_t>(0x0120, 0x0030);
this->ade_write_8_(0x0010, 0x04);
this->ade_write_8_(0x00FE, 0xAD);
this->ade_write_16_(0x0120, 0x0030);
this->is_setup_ = true;
});
}
@@ -42,31 +38,51 @@ class ADE7953 : public i2c::I2CDevice, public PollingComponent {
void update() override;
protected:
template<typename T> bool ade_write_(uint16_t reg, T value) {
i2c::ErrorCode ade_write_8_(uint16_t reg, uint8_t value) {
std::vector<uint8_t> data;
data.push_back(reg >> 8);
data.push_back(reg >> 0);
for (int i = sizeof(T) - 1; i >= 0; i--)
data.push_back(value >> (i * 8));
return this->write_bytes_raw(data);
data.push_back(value);
return write(data.data(), data.size());
}
template<typename T> optional<T> ade_read_(uint16_t reg) {
uint8_t hi = reg >> 8;
uint8_t lo = reg >> 0;
if (!this->write_bytes_raw({hi, lo}))
return {};
auto ret = this->read_bytes_raw<sizeof(T)>();
if (!ret.has_value())
return {};
T result = 0;
for (int i = 0, j = sizeof(T) - 1; i < sizeof(T); i++, j--)
result |= T((*ret)[i]) << (j * 8);
return result;
i2c::ErrorCode ade_write_16_(uint16_t reg, uint16_t value) {
std::vector<uint8_t> data;
data.push_back(reg >> 8);
data.push_back(reg >> 0);
data.push_back(value >> 8);
data.push_back(value >> 0);
return write(data.data(), data.size());
}
i2c::ErrorCode ade_write_32_(uint16_t reg, uint32_t value) {
std::vector<uint8_t> data;
data.push_back(reg >> 8);
data.push_back(reg >> 0);
data.push_back(value >> 24);
data.push_back(value >> 16);
data.push_back(value >> 8);
data.push_back(value >> 0);
return write(data.data(), data.size());
}
i2c::ErrorCode ade_read_32_(uint16_t reg, uint32_t *value) {
uint8_t reg_data[2];
reg_data[0] = reg >> 8;
reg_data[1] = reg >> 0;
i2c::ErrorCode err = write(reg_data, 2);
if (err != i2c::ERROR_OK)
return err;
uint8_t recv[4];
err = read(recv, 4);
if (err != i2c::ERROR_OK)
return err;
*value = 0;
*value |= ((uint32_t) recv[0]) << 24;
*value |= ((uint32_t) recv[1]) << 16;
*value |= ((uint32_t) recv[2]) << 8;
*value |= ((uint32_t) recv[3]);
return i2c::ERROR_OK;
}
bool has_irq_ = false;
uint8_t irq_pin_number_;
GPIOPin *irq_pin_{nullptr};
InternalGPIOPin *irq_pin_{nullptr};
bool is_setup_{false};
sensor::Sensor *voltage_sensor_{nullptr};
sensor::Sensor *current_a_sensor_{nullptr};

View File

@@ -2,43 +2,89 @@ import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import sensor, i2c
from esphome import pins
from esphome.const import CONF_ID, CONF_VOLTAGE, \
UNIT_VOLT, ICON_FLASH, UNIT_AMPERE, UNIT_WATT
from esphome.const import (
CONF_ID,
CONF_VOLTAGE,
DEVICE_CLASS_CURRENT,
DEVICE_CLASS_POWER,
DEVICE_CLASS_VOLTAGE,
STATE_CLASS_MEASUREMENT,
UNIT_VOLT,
UNIT_AMPERE,
UNIT_WATT,
)
DEPENDENCIES = ['i2c']
DEPENDENCIES = ["i2c"]
ade7953_ns = cg.esphome_ns.namespace('ade7953')
ADE7953 = ade7953_ns.class_('ADE7953', cg.PollingComponent, i2c.I2CDevice)
ade7953_ns = cg.esphome_ns.namespace("ade7953")
ADE7953 = ade7953_ns.class_("ADE7953", cg.PollingComponent, i2c.I2CDevice)
CONF_IRQ_PIN = 'irq_pin'
CONF_CURRENT_A = 'current_a'
CONF_CURRENT_B = 'current_b'
CONF_ACTIVE_POWER_A = 'active_power_a'
CONF_ACTIVE_POWER_B = 'active_power_b'
CONF_IRQ_PIN = "irq_pin"
CONF_CURRENT_A = "current_a"
CONF_CURRENT_B = "current_b"
CONF_ACTIVE_POWER_A = "active_power_a"
CONF_ACTIVE_POWER_B = "active_power_b"
CONFIG_SCHEMA = cv.Schema({
cv.GenerateID(): cv.declare_id(ADE7953),
cv.Optional(CONF_IRQ_PIN): pins.input_pin,
cv.Optional(CONF_VOLTAGE): sensor.sensor_schema(UNIT_VOLT, ICON_FLASH, 1),
cv.Optional(CONF_CURRENT_A): sensor.sensor_schema(UNIT_AMPERE, ICON_FLASH, 2),
cv.Optional(CONF_CURRENT_B): sensor.sensor_schema(UNIT_AMPERE, ICON_FLASH, 2),
cv.Optional(CONF_ACTIVE_POWER_A): sensor.sensor_schema(UNIT_WATT, ICON_FLASH, 1),
cv.Optional(CONF_ACTIVE_POWER_B): sensor.sensor_schema(UNIT_WATT, ICON_FLASH, 1),
}).extend(cv.polling_component_schema('60s')).extend(i2c.i2c_device_schema(0x38))
CONFIG_SCHEMA = (
cv.Schema(
{
cv.GenerateID(): cv.declare_id(ADE7953),
cv.Optional(CONF_IRQ_PIN): pins.internal_gpio_input_pin_schema,
cv.Optional(CONF_VOLTAGE): sensor.sensor_schema(
unit_of_measurement=UNIT_VOLT,
accuracy_decimals=1,
device_class=DEVICE_CLASS_VOLTAGE,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_CURRENT_A): sensor.sensor_schema(
unit_of_measurement=UNIT_AMPERE,
accuracy_decimals=2,
device_class=DEVICE_CLASS_CURRENT,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_CURRENT_B): sensor.sensor_schema(
unit_of_measurement=UNIT_AMPERE,
accuracy_decimals=2,
device_class=DEVICE_CLASS_CURRENT,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_ACTIVE_POWER_A): sensor.sensor_schema(
unit_of_measurement=UNIT_WATT,
accuracy_decimals=1,
device_class=DEVICE_CLASS_POWER,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_ACTIVE_POWER_B): sensor.sensor_schema(
unit_of_measurement=UNIT_WATT,
accuracy_decimals=1,
device_class=DEVICE_CLASS_POWER,
state_class=STATE_CLASS_MEASUREMENT,
),
}
)
.extend(cv.polling_component_schema("60s"))
.extend(i2c.i2c_device_schema(0x38))
)
def to_code(config):
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
yield cg.register_component(var, config)
yield i2c.register_i2c_device(var, config)
await cg.register_component(var, config)
await i2c.register_i2c_device(var, config)
if CONF_IRQ_PIN in config:
cg.add(var.set_irq_pin(config[CONF_IRQ_PIN]))
irq_pin = await cg.gpio_pin_expression(config[CONF_IRQ_PIN])
cg.add(var.set_irq_pin(irq_pin))
for key in [CONF_VOLTAGE, CONF_CURRENT_A, CONF_CURRENT_B, CONF_ACTIVE_POWER_A,
CONF_ACTIVE_POWER_B]:
for key in [
CONF_VOLTAGE,
CONF_CURRENT_A,
CONF_CURRENT_B,
CONF_ACTIVE_POWER_A,
CONF_ACTIVE_POWER_B,
]:
if key not in config:
continue
conf = config[key]
sens = yield sensor.new_sensor(conf)
cg.add(getattr(var, f'set_{key}_sensor')(sens))
sens = await sensor.new_sensor(conf)
cg.add(getattr(var, f"set_{key}_sensor")(sens))

View File

@@ -3,23 +3,29 @@ import esphome.config_validation as cv
from esphome.components import i2c
from esphome.const import CONF_ID
DEPENDENCIES = ['i2c']
AUTO_LOAD = ['sensor', 'voltage_sampler']
DEPENDENCIES = ["i2c"]
AUTO_LOAD = ["sensor", "voltage_sampler"]
MULTI_CONF = True
ads1115_ns = cg.esphome_ns.namespace('ads1115')
ADS1115Component = ads1115_ns.class_('ADS1115Component', cg.Component, i2c.I2CDevice)
ads1115_ns = cg.esphome_ns.namespace("ads1115")
ADS1115Component = ads1115_ns.class_("ADS1115Component", cg.Component, i2c.I2CDevice)
CONF_CONTINUOUS_MODE = 'continuous_mode'
CONFIG_SCHEMA = cv.Schema({
cv.GenerateID(): cv.declare_id(ADS1115Component),
cv.Optional(CONF_CONTINUOUS_MODE, default=False): cv.boolean,
}).extend(cv.COMPONENT_SCHEMA).extend(i2c.i2c_device_schema(None))
CONF_CONTINUOUS_MODE = "continuous_mode"
CONFIG_SCHEMA = (
cv.Schema(
{
cv.GenerateID(): cv.declare_id(ADS1115Component),
cv.Optional(CONF_CONTINUOUS_MODE, default=False): cv.boolean,
}
)
.extend(cv.COMPONENT_SCHEMA)
.extend(i2c.i2c_device_schema(None))
)
def to_code(config):
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
yield cg.register_component(var, config)
yield i2c.register_i2c_device(var, config)
await cg.register_component(var, config)
await i2c.register_i2c_device(var, config)
cg.add(var.set_continuous_mode(config[CONF_CONTINUOUS_MODE]))

View File

@@ -1,10 +1,11 @@
#include "ads1115.h"
#include "esphome/core/log.h"
#include "esphome/core/hal.h"
namespace esphome {
namespace ads1115 {
static const char *TAG = "ads1115";
static const char *const TAG = "ads1115";
static const uint8_t ADS1115_REGISTER_CONVERSION = 0x00;
static const uint8_t ADS1115_REGISTER_CONFIG = 0x01;
@@ -64,11 +65,6 @@ void ADS1115Component::setup() {
return;
}
this->prev_config_ = config;
for (auto *sensor : this->sensors_) {
this->set_interval(sensor->get_name(), sensor->update_interval(),
[this, sensor] { this->request_measurement(sensor); });
}
}
void ADS1115Component::dump_config() {
ESP_LOGCONFIG(TAG, "Setting up ADS1115...");
@@ -107,17 +103,22 @@ float ADS1115Component::request_measurement(ADS1115Sensor *sensor) {
}
this->prev_config_ = config;
// about 1.6 ms with 860 samples per second
// about 1.2 ms with 860 samples per second
delay(2);
uint32_t start = millis();
while (this->read_byte_16(ADS1115_REGISTER_CONFIG, &config) && (config >> 15) == 0) {
if (millis() - start > 100) {
ESP_LOGW(TAG, "Reading ADS1115 timed out");
this->status_set_warning();
return NAN;
// in continuous mode, conversion will always be running, rely on the delay
// to ensure conversion is taking place with the correct settings
// can we use the rdy pin to trigger when a conversion is done?
if (!this->continuous_mode_) {
uint32_t start = millis();
while (this->read_byte_16(ADS1115_REGISTER_CONFIG, &config) && (config >> 15) == 0) {
if (millis() - start > 100) {
ESP_LOGW(TAG, "Reading ADS1115 timed out");
this->status_set_warning();
return NAN;
}
yield();
}
yield();
}
}
@@ -159,7 +160,7 @@ float ADS1115Component::request_measurement(ADS1115Sensor *sensor) {
float ADS1115Sensor::sample() { return this->parent_->request_measurement(this); }
void ADS1115Sensor::update() {
float v = this->parent_->request_measurement(this);
if (!isnan(v)) {
if (!std::isnan(v)) {
ESP_LOGD(TAG, "'%s': Got Voltage=%fV", this->get_name().c_str(), v);
this->publish_state(v);
}

View File

@@ -1,60 +1,79 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import sensor, voltage_sampler
from esphome.const import CONF_GAIN, CONF_MULTIPLEXER, ICON_FLASH, UNIT_VOLT, CONF_ID
from esphome.const import (
CONF_GAIN,
CONF_MULTIPLEXER,
DEVICE_CLASS_VOLTAGE,
STATE_CLASS_MEASUREMENT,
UNIT_VOLT,
CONF_ID,
)
from . import ads1115_ns, ADS1115Component
DEPENDENCIES = ['ads1115']
DEPENDENCIES = ["ads1115"]
ADS1115Multiplexer = ads1115_ns.enum('ADS1115Multiplexer')
ADS1115Multiplexer = ads1115_ns.enum("ADS1115Multiplexer")
MUX = {
'A0_A1': ADS1115Multiplexer.ADS1115_MULTIPLEXER_P0_N1,
'A0_A3': ADS1115Multiplexer.ADS1115_MULTIPLEXER_P0_N3,
'A1_A3': ADS1115Multiplexer.ADS1115_MULTIPLEXER_P1_N3,
'A2_A3': ADS1115Multiplexer.ADS1115_MULTIPLEXER_P2_N3,
'A0_GND': ADS1115Multiplexer.ADS1115_MULTIPLEXER_P0_NG,
'A1_GND': ADS1115Multiplexer.ADS1115_MULTIPLEXER_P1_NG,
'A2_GND': ADS1115Multiplexer.ADS1115_MULTIPLEXER_P2_NG,
'A3_GND': ADS1115Multiplexer.ADS1115_MULTIPLEXER_P3_NG,
"A0_A1": ADS1115Multiplexer.ADS1115_MULTIPLEXER_P0_N1,
"A0_A3": ADS1115Multiplexer.ADS1115_MULTIPLEXER_P0_N3,
"A1_A3": ADS1115Multiplexer.ADS1115_MULTIPLEXER_P1_N3,
"A2_A3": ADS1115Multiplexer.ADS1115_MULTIPLEXER_P2_N3,
"A0_GND": ADS1115Multiplexer.ADS1115_MULTIPLEXER_P0_NG,
"A1_GND": ADS1115Multiplexer.ADS1115_MULTIPLEXER_P1_NG,
"A2_GND": ADS1115Multiplexer.ADS1115_MULTIPLEXER_P2_NG,
"A3_GND": ADS1115Multiplexer.ADS1115_MULTIPLEXER_P3_NG,
}
ADS1115Gain = ads1115_ns.enum('ADS1115Gain')
ADS1115Gain = ads1115_ns.enum("ADS1115Gain")
GAIN = {
'6.144': ADS1115Gain.ADS1115_GAIN_6P144,
'4.096': ADS1115Gain.ADS1115_GAIN_4P096,
'2.048': ADS1115Gain.ADS1115_GAIN_2P048,
'1.024': ADS1115Gain.ADS1115_GAIN_1P024,
'0.512': ADS1115Gain.ADS1115_GAIN_0P512,
'0.256': ADS1115Gain.ADS1115_GAIN_0P256,
"6.144": ADS1115Gain.ADS1115_GAIN_6P144,
"4.096": ADS1115Gain.ADS1115_GAIN_4P096,
"2.048": ADS1115Gain.ADS1115_GAIN_2P048,
"1.024": ADS1115Gain.ADS1115_GAIN_1P024,
"0.512": ADS1115Gain.ADS1115_GAIN_0P512,
"0.256": ADS1115Gain.ADS1115_GAIN_0P256,
}
def validate_gain(value):
if isinstance(value, float):
value = f'{value:0.03f}'
value = f"{value:0.03f}"
elif not isinstance(value, str):
raise cv.Invalid(f'invalid gain "{value}"')
return cv.enum(GAIN)(value)
ADS1115Sensor = ads1115_ns.class_('ADS1115Sensor', sensor.Sensor, cg.PollingComponent,
voltage_sampler.VoltageSampler)
ADS1115Sensor = ads1115_ns.class_(
"ADS1115Sensor", sensor.Sensor, cg.PollingComponent, voltage_sampler.VoltageSampler
)
CONF_ADS1115_ID = 'ads1115_id'
CONFIG_SCHEMA = sensor.sensor_schema(UNIT_VOLT, ICON_FLASH, 3).extend({
cv.GenerateID(): cv.declare_id(ADS1115Sensor),
cv.GenerateID(CONF_ADS1115_ID): cv.use_id(ADS1115Component),
cv.Required(CONF_MULTIPLEXER): cv.enum(MUX, upper=True, space='_'),
cv.Required(CONF_GAIN): validate_gain,
}).extend(cv.polling_component_schema('60s'))
CONF_ADS1115_ID = "ads1115_id"
CONFIG_SCHEMA = (
sensor.sensor_schema(
ADS1115Sensor,
unit_of_measurement=UNIT_VOLT,
accuracy_decimals=3,
device_class=DEVICE_CLASS_VOLTAGE,
state_class=STATE_CLASS_MEASUREMENT,
)
.extend(
{
cv.GenerateID(CONF_ADS1115_ID): cv.use_id(ADS1115Component),
cv.Required(CONF_MULTIPLEXER): cv.enum(MUX, upper=True, space="_"),
cv.Required(CONF_GAIN): validate_gain,
}
)
.extend(cv.polling_component_schema("60s"))
)
def to_code(config):
paren = yield cg.get_variable(config[CONF_ADS1115_ID])
async def to_code(config):
paren = await cg.get_variable(config[CONF_ADS1115_ID])
var = cg.new_Pvariable(config[CONF_ID], paren)
yield sensor.register_sensor(var, config)
yield cg.register_component(var, config)
await sensor.register_sensor(var, config)
await cg.register_component(var, config)
cg.add(var.set_multiplexer(config[CONF_MULTIPLEXER]))
cg.add(var.set_gain(config[CONF_GAIN]))

View File

@@ -10,20 +10,21 @@
//
// According to the datasheet, the component is supposed to respond in more than 75ms. In fact, it can answer almost
// immediately for temperature. But for humidity, it takes >90ms to get a valid data. From experience, we have best
// results making successive requests; the current implementation make 3 attemps with a delay of 30ms each time.
// results making successive requests; the current implementation makes 3 attempts with a delay of 30ms each time.
#include "aht10.h"
#include "esphome/core/log.h"
#include "esphome/core/hal.h"
namespace esphome {
namespace aht10 {
static const char *TAG = "aht10";
static const char *const TAG = "aht10";
static const uint8_t AHT10_CALIBRATE_CMD[] = {0xE1};
static const uint8_t AHT10_MEASURE_CMD[] = {0xAC, 0x33, 0x00};
static const uint8_t AHT10_DEFAULT_DELAY = 5; // ms, for calibration and temperature measurement
static const uint8_t AHT10_HUMIDITY_DELAY = 30; // ms
static const uint8_t AHT10_ATTEMPS = 3; // safety margin, normally 3 attemps are enough: 3*30=90ms
static const uint8_t AHT10_ATTEMPTS = 3; // safety margin, normally 3 attempts are enough: 3*30=90ms
void AHT10Component::setup() {
ESP_LOGCONFIG(TAG, "Setting up AHT10...");
@@ -33,8 +34,19 @@ void AHT10Component::setup() {
this->mark_failed();
return;
}
uint8_t data;
if (!this->read_byte(0, &data, AHT10_DEFAULT_DELAY)) {
uint8_t data = 0;
if (this->write(&data, 1) != i2c::ERROR_OK) {
ESP_LOGD(TAG, "Communication with AHT10 failed!");
this->mark_failed();
return;
}
delay(AHT10_DEFAULT_DELAY);
if (this->read(&data, 1) != i2c::ERROR_OK) {
ESP_LOGD(TAG, "Communication with AHT10 failed!");
this->mark_failed();
return;
}
if (this->read(&data, 1) != i2c::ERROR_OK) {
ESP_LOGD(TAG, "Communication with AHT10 failed!");
this->mark_failed();
return;
@@ -55,14 +67,19 @@ void AHT10Component::update() {
return;
}
uint8_t data[6];
uint8_t delay = AHT10_DEFAULT_DELAY;
uint8_t delay_ms = AHT10_DEFAULT_DELAY;
if (this->humidity_sensor_ != nullptr)
delay = AHT10_HUMIDITY_DELAY;
for (int i = 0; i < AHT10_ATTEMPS; ++i) {
ESP_LOGVV(TAG, "Attemps %u at %6ld", i, millis());
if (!this->read_bytes(0, data, 6, delay)) {
delay_ms = AHT10_HUMIDITY_DELAY;
bool success = false;
for (int i = 0; i < AHT10_ATTEMPTS; ++i) {
ESP_LOGVV(TAG, "Attempt %d at %6u", i, millis());
delay(delay_ms);
if (this->read(data, 6) != i2c::ERROR_OK) {
ESP_LOGD(TAG, "Communication with AHT10 failed, waiting...");
} else if ((data[0] & 0x80) == 0x80) { // Bit[7] = 0b1, device is busy
continue;
}
if ((data[0] & 0x80) == 0x80) { // Bit[7] = 0b1, device is busy
ESP_LOGD(TAG, "AHT10 is busy, waiting...");
} else if (data[1] == 0x0 && data[2] == 0x0 && (data[3] >> 4) == 0x0) {
// Unrealistic humidity (0x0)
@@ -79,11 +96,12 @@ void AHT10Component::update() {
}
} else {
// data is valid, we can break the loop
ESP_LOGVV(TAG, "Answer at %6ld", millis());
ESP_LOGVV(TAG, "Answer at %6u", millis());
success = true;
break;
}
}
if ((data[0] & 0x80) == 0x80) {
if (!success || (data[0] & 0x80) == 0x80) {
ESP_LOGE(TAG, "Measurements reading timed-out!");
this->status_set_warning();
return;
@@ -92,19 +110,19 @@ void AHT10Component::update() {
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;
float temperature = ((200.0 * (float) raw_temperature) / 1048576.0) - 50.0;
float temperature = ((200.0f * (float) raw_temperature) / 1048576.0f) - 50.0f;
float humidity;
if (raw_humidity == 0) { // unrealistic value
humidity = NAN;
} else {
humidity = (float) raw_humidity * 100.0 / 1048576.0;
humidity = (float) raw_humidity * 100.0f / 1048576.0f;
}
if (this->temperature_sensor_ != nullptr) {
this->temperature_sensor_->publish_state(temperature);
}
if (this->humidity_sensor_ != nullptr) {
if (isnan(humidity))
if (std::isnan(humidity))
ESP_LOGW(TAG, "Invalid humidity! Sensor reported 0%% Hum");
this->humidity_sensor_->publish_state(humidity);
}

View File

@@ -18,8 +18,8 @@ class AHT10Component : public PollingComponent, public i2c::I2CDevice {
void set_humidity_sensor(sensor::Sensor *humidity_sensor) { humidity_sensor_ = humidity_sensor; }
protected:
sensor::Sensor *temperature_sensor_;
sensor::Sensor *humidity_sensor_;
sensor::Sensor *temperature_sensor_{nullptr};
sensor::Sensor *humidity_sensor_{nullptr};
};
} // namespace aht10

View File

@@ -1,30 +1,54 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import i2c, sensor
from esphome.const import CONF_HUMIDITY, CONF_ID, CONF_TEMPERATURE, \
UNIT_CELSIUS, ICON_THERMOMETER, ICON_WATER_PERCENT, UNIT_PERCENT
from esphome.const import (
CONF_HUMIDITY,
CONF_ID,
CONF_TEMPERATURE,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
STATE_CLASS_MEASUREMENT,
UNIT_CELSIUS,
UNIT_PERCENT,
)
DEPENDENCIES = ['i2c']
DEPENDENCIES = ["i2c"]
aht10_ns = cg.esphome_ns.namespace('aht10')
AHT10Component = aht10_ns.class_('AHT10Component', cg.PollingComponent, i2c.I2CDevice)
aht10_ns = cg.esphome_ns.namespace("aht10")
AHT10Component = aht10_ns.class_("AHT10Component", cg.PollingComponent, i2c.I2CDevice)
CONFIG_SCHEMA = cv.Schema({
cv.GenerateID(): cv.declare_id(AHT10Component),
cv.Optional(CONF_TEMPERATURE): sensor.sensor_schema(UNIT_CELSIUS, ICON_THERMOMETER, 2),
cv.Optional(CONF_HUMIDITY): sensor.sensor_schema(UNIT_PERCENT, ICON_WATER_PERCENT, 2),
}).extend(cv.polling_component_schema('60s')).extend(i2c.i2c_device_schema(0x38))
CONFIG_SCHEMA = (
cv.Schema(
{
cv.GenerateID(): cv.declare_id(AHT10Component),
cv.Optional(CONF_TEMPERATURE): sensor.sensor_schema(
unit_of_measurement=UNIT_CELSIUS,
accuracy_decimals=2,
device_class=DEVICE_CLASS_TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_HUMIDITY): sensor.sensor_schema(
unit_of_measurement=UNIT_PERCENT,
accuracy_decimals=2,
device_class=DEVICE_CLASS_HUMIDITY,
state_class=STATE_CLASS_MEASUREMENT,
),
}
)
.extend(cv.polling_component_schema("60s"))
.extend(i2c.i2c_device_schema(0x38))
)
def to_code(config):
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
yield cg.register_component(var, config)
yield i2c.register_i2c_device(var, config)
await cg.register_component(var, config)
await i2c.register_i2c_device(var, config)
if CONF_TEMPERATURE in config:
sens = yield sensor.new_sensor(config[CONF_TEMPERATURE])
sens = await sensor.new_sensor(config[CONF_TEMPERATURE])
cg.add(var.set_temperature_sensor(sens))
if CONF_HUMIDITY in config:
sens = yield sensor.new_sensor(config[CONF_HUMIDITY])
sens = await sensor.new_sensor(config[CONF_HUMIDITY])
cg.add(var.set_humidity_sensor(sens))

View File

@@ -0,0 +1,23 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import esp32_ble_tracker
from esphome.const import CONF_ID
DEPENDENCIES = ["esp32_ble_tracker"]
CODEOWNERS = ["@jeromelaban"]
airthings_ble_ns = cg.esphome_ns.namespace("airthings_ble")
AirthingsListener = airthings_ble_ns.class_(
"AirthingsListener", esp32_ble_tracker.ESPBTDeviceListener
)
CONFIG_SCHEMA = cv.Schema(
{
cv.GenerateID(): cv.declare_id(AirthingsListener),
}
).extend(esp32_ble_tracker.ESP_BLE_DEVICE_SCHEMA)
def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
yield esp32_ble_tracker.register_ble_device(var, config)

View File

@@ -0,0 +1,33 @@
#include "airthings_listener.h"
#include "esphome/core/log.h"
#ifdef USE_ESP32
namespace esphome {
namespace airthings_ble {
static const char *const TAG = "airthings_ble";
bool AirthingsListener::parse_device(const esp32_ble_tracker::ESPBTDevice &device) {
for (auto &it : device.get_manufacturer_datas()) {
if (it.uuid == esp32_ble_tracker::ESPBTUUID::from_uint32(0x0334)) {
if (it.data.size() < 4)
continue;
uint32_t sn = it.data[0];
sn |= ((uint32_t) it.data[1] << 8);
sn |= ((uint32_t) it.data[2] << 16);
sn |= ((uint32_t) it.data[3] << 24);
ESP_LOGD(TAG, "Found AirThings device Serial:%u (MAC: %s)", sn, device.address_str().c_str());
return true;
}
}
return false;
}
} // namespace airthings_ble
} // namespace esphome
#endif

View File

@@ -0,0 +1,19 @@
#pragma once
#ifdef USE_ESP32
#include "esphome/core/component.h"
#include "esphome/components/esp32_ble_tracker/esp32_ble_tracker.h"
namespace esphome {
namespace airthings_ble {
class AirthingsListener : public esp32_ble_tracker::ESPBTDeviceListener {
public:
bool parse_device(const esp32_ble_tracker::ESPBTDevice &device) override;
};
} // namespace airthings_ble
} // namespace esphome
#endif

View File

@@ -0,0 +1 @@
CODEOWNERS = ["@ncareau"]

View File

@@ -0,0 +1,113 @@
#include "airthings_wave_mini.h"
#ifdef USE_ESP32
namespace esphome {
namespace airthings_wave_mini {
static const char *const TAG = "airthings_wave_mini";
void AirthingsWaveMini::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
esp_ble_gattc_cb_param_t *param) {
switch (event) {
case ESP_GATTC_OPEN_EVT: {
if (param->open.status == ESP_GATT_OK) {
ESP_LOGI(TAG, "Connected successfully!");
}
break;
}
case ESP_GATTC_DISCONNECT_EVT: {
ESP_LOGW(TAG, "Disconnected!");
break;
}
case ESP_GATTC_SEARCH_CMPL_EVT: {
this->handle_ = 0;
auto *chr = this->parent()->get_characteristic(service_uuid_, sensors_data_characteristic_uuid_);
if (chr == nullptr) {
ESP_LOGW(TAG, "No sensor characteristic found at service %s char %s", service_uuid_.to_string().c_str(),
sensors_data_characteristic_uuid_.to_string().c_str());
break;
}
this->handle_ = chr->handle;
this->node_state = esp32_ble_tracker::ClientState::ESTABLISHED;
request_read_values_();
break;
}
case ESP_GATTC_READ_CHAR_EVT: {
if (param->read.conn_id != this->parent()->get_conn_id())
break;
if (param->read.status != ESP_GATT_OK) {
ESP_LOGW(TAG, "Error reading char at handle %d, status=%d", param->read.handle, param->read.status);
break;
}
if (param->read.handle == this->handle_) {
read_sensors_(param->read.value, param->read.value_len);
}
break;
}
default:
break;
}
}
void AirthingsWaveMini::read_sensors_(uint8_t *raw_value, uint16_t value_len) {
auto *value = (WaveMiniReadings *) raw_value;
if (sizeof(WaveMiniReadings) <= value_len) {
this->humidity_sensor_->publish_state(value->humidity / 100.0f);
this->pressure_sensor_->publish_state(value->pressure / 50.0f);
this->temperature_sensor_->publish_state(value->temperature / 100.0f - 273.15f);
if (is_valid_voc_value_(value->voc)) {
this->tvoc_sensor_->publish_state(value->voc);
}
// This instance must not stay connected
// so other clients can connect to it (e.g. the
// mobile app).
parent()->set_enabled(false);
}
}
bool AirthingsWaveMini::is_valid_voc_value_(uint16_t voc) { return 0 <= voc && voc <= 16383; }
void AirthingsWaveMini::update() {
if (this->node_state != esp32_ble_tracker::ClientState::ESTABLISHED) {
if (!parent()->enabled) {
ESP_LOGW(TAG, "Reconnecting to device");
parent()->set_enabled(true);
parent()->connect();
} else {
ESP_LOGW(TAG, "Connection in progress");
}
}
}
void AirthingsWaveMini::request_read_values_() {
auto status = esp_ble_gattc_read_char(this->parent()->get_gattc_if(), this->parent()->get_conn_id(), this->handle_,
ESP_GATT_AUTH_REQ_NONE);
if (status) {
ESP_LOGW(TAG, "Error sending read request for sensor, status=%d", status);
}
}
void AirthingsWaveMini::dump_config() {
LOG_SENSOR(" ", "Humidity", this->humidity_sensor_);
LOG_SENSOR(" ", "Temperature", this->temperature_sensor_);
LOG_SENSOR(" ", "Pressure", this->pressure_sensor_);
LOG_SENSOR(" ", "TVOC", this->tvoc_sensor_);
}
AirthingsWaveMini::AirthingsWaveMini()
: PollingComponent(10000),
service_uuid_(esp32_ble_tracker::ESPBTUUID::from_raw(SERVICE_UUID)),
sensors_data_characteristic_uuid_(esp32_ble_tracker::ESPBTUUID::from_raw(CHARACTERISTIC_UUID)) {}
} // namespace airthings_wave_mini
} // namespace esphome
#endif // USE_ESP32

View File

@@ -0,0 +1,65 @@
#pragma once
#ifdef USE_ESP32
#include <esp_gattc_api.h>
#include <algorithm>
#include <iterator>
#include "esphome/components/ble_client/ble_client.h"
#include "esphome/components/esp32_ble_tracker/esp32_ble_tracker.h"
#include "esphome/components/sensor/sensor.h"
#include "esphome/core/component.h"
#include "esphome/core/log.h"
namespace esphome {
namespace airthings_wave_mini {
static const char *const SERVICE_UUID = "b42e3882-ade7-11e4-89d3-123b93f75cba";
static const char *const CHARACTERISTIC_UUID = "b42e3b98-ade7-11e4-89d3-123b93f75cba";
class AirthingsWaveMini : public PollingComponent, public ble_client::BLEClientNode {
public:
AirthingsWaveMini();
void dump_config() override;
void update() override;
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
esp_ble_gattc_cb_param_t *param) override;
void set_temperature(sensor::Sensor *temperature) { temperature_sensor_ = temperature; }
void set_humidity(sensor::Sensor *humidity) { humidity_sensor_ = humidity; }
void set_pressure(sensor::Sensor *pressure) { pressure_sensor_ = pressure; }
void set_tvoc(sensor::Sensor *tvoc) { tvoc_sensor_ = tvoc; }
protected:
bool is_valid_voc_value_(uint16_t voc);
void read_sensors_(uint8_t *value, uint16_t value_len);
void request_read_values_();
sensor::Sensor *temperature_sensor_{nullptr};
sensor::Sensor *humidity_sensor_{nullptr};
sensor::Sensor *pressure_sensor_{nullptr};
sensor::Sensor *tvoc_sensor_{nullptr};
uint16_t handle_;
esp32_ble_tracker::ESPBTUUID service_uuid_;
esp32_ble_tracker::ESPBTUUID sensors_data_characteristic_uuid_;
struct WaveMiniReadings {
uint16_t unused01;
uint16_t temperature;
uint16_t pressure;
uint16_t humidity;
uint16_t voc;
uint16_t unused02;
uint32_t unused03;
uint32_t unused04;
};
};
} // namespace airthings_wave_mini
} // namespace esphome
#endif // USE_ESP32

View File

@@ -0,0 +1,82 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import sensor, ble_client
from esphome.const import (
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_PRESSURE,
STATE_CLASS_MEASUREMENT,
UNIT_PERCENT,
UNIT_CELSIUS,
UNIT_HECTOPASCAL,
CONF_ID,
CONF_HUMIDITY,
CONF_TVOC,
CONF_PRESSURE,
CONF_TEMPERATURE,
UNIT_PARTS_PER_BILLION,
ICON_RADIATOR,
)
DEPENDENCIES = ["ble_client"]
airthings_wave_mini_ns = cg.esphome_ns.namespace("airthings_wave_mini")
AirthingsWaveMini = airthings_wave_mini_ns.class_(
"AirthingsWaveMini", cg.PollingComponent, ble_client.BLEClientNode
)
CONFIG_SCHEMA = cv.All(
cv.Schema(
{
cv.GenerateID(): cv.declare_id(AirthingsWaveMini),
cv.Optional(CONF_HUMIDITY): sensor.sensor_schema(
unit_of_measurement=UNIT_PERCENT,
device_class=DEVICE_CLASS_HUMIDITY,
state_class=STATE_CLASS_MEASUREMENT,
accuracy_decimals=2,
),
cv.Optional(CONF_TEMPERATURE): sensor.sensor_schema(
unit_of_measurement=UNIT_CELSIUS,
accuracy_decimals=2,
device_class=DEVICE_CLASS_TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_PRESSURE): sensor.sensor_schema(
unit_of_measurement=UNIT_HECTOPASCAL,
accuracy_decimals=2,
device_class=DEVICE_CLASS_PRESSURE,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_TVOC): sensor.sensor_schema(
unit_of_measurement=UNIT_PARTS_PER_BILLION,
icon=ICON_RADIATOR,
accuracy_decimals=0,
state_class=STATE_CLASS_MEASUREMENT,
),
}
)
.extend(cv.polling_component_schema("5min"))
.extend(ble_client.BLE_CLIENT_SCHEMA),
)
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config)
await ble_client.register_ble_node(var, config)
if CONF_HUMIDITY in config:
sens = await sensor.new_sensor(config[CONF_HUMIDITY])
cg.add(var.set_humidity(sens))
if CONF_TEMPERATURE in config:
sens = await sensor.new_sensor(config[CONF_TEMPERATURE])
cg.add(var.set_temperature(sens))
if CONF_PRESSURE in config:
sens = await sensor.new_sensor(config[CONF_PRESSURE])
cg.add(var.set_pressure(sens))
if CONF_TVOC in config:
sens = await sensor.new_sensor(config[CONF_TVOC])
cg.add(var.set_tvoc(sens))

View File

@@ -0,0 +1 @@
CODEOWNERS = ["@jeromelaban"]

View File

@@ -0,0 +1,137 @@
#include "airthings_wave_plus.h"
#ifdef USE_ESP32
namespace esphome {
namespace airthings_wave_plus {
static const char *const TAG = "airthings_wave_plus";
void AirthingsWavePlus::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
esp_ble_gattc_cb_param_t *param) {
switch (event) {
case ESP_GATTC_OPEN_EVT: {
if (param->open.status == ESP_GATT_OK) {
ESP_LOGI(TAG, "Connected successfully!");
}
break;
}
case ESP_GATTC_DISCONNECT_EVT: {
ESP_LOGW(TAG, "Disconnected!");
break;
}
case ESP_GATTC_SEARCH_CMPL_EVT: {
this->handle_ = 0;
auto *chr = this->parent()->get_characteristic(service_uuid_, sensors_data_characteristic_uuid_);
if (chr == nullptr) {
ESP_LOGW(TAG, "No sensor characteristic found at service %s char %s", service_uuid_.to_string().c_str(),
sensors_data_characteristic_uuid_.to_string().c_str());
break;
}
this->handle_ = chr->handle;
this->node_state = esp32_ble_tracker::ClientState::ESTABLISHED;
request_read_values_();
break;
}
case ESP_GATTC_READ_CHAR_EVT: {
if (param->read.conn_id != this->parent()->get_conn_id())
break;
if (param->read.status != ESP_GATT_OK) {
ESP_LOGW(TAG, "Error reading char at handle %d, status=%d", param->read.handle, param->read.status);
break;
}
if (param->read.handle == this->handle_) {
read_sensors_(param->read.value, param->read.value_len);
}
break;
}
default:
break;
}
}
void AirthingsWavePlus::read_sensors_(uint8_t *raw_value, uint16_t value_len) {
auto *value = (WavePlusReadings *) raw_value;
if (sizeof(WavePlusReadings) <= value_len) {
ESP_LOGD(TAG, "version = %d", value->version);
if (value->version == 1) {
ESP_LOGD(TAG, "ambient light = %d", value->ambientLight);
this->humidity_sensor_->publish_state(value->humidity / 2.0f);
if (is_valid_radon_value_(value->radon)) {
this->radon_sensor_->publish_state(value->radon);
}
if (is_valid_radon_value_(value->radon_lt)) {
this->radon_long_term_sensor_->publish_state(value->radon_lt);
}
this->temperature_sensor_->publish_state(value->temperature / 100.0f);
this->pressure_sensor_->publish_state(value->pressure / 50.0f);
if (is_valid_co2_value_(value->co2)) {
this->co2_sensor_->publish_state(value->co2);
}
if (is_valid_voc_value_(value->voc)) {
this->tvoc_sensor_->publish_state(value->voc);
}
// This instance must not stay connected
// so other clients can connect to it (e.g. the
// mobile app).
parent()->set_enabled(false);
} else {
ESP_LOGE(TAG, "Invalid payload version (%d != 1, newer version or not a Wave Plus?)", value->version);
}
}
}
bool AirthingsWavePlus::is_valid_radon_value_(uint16_t radon) { return 0 <= radon && radon <= 16383; }
bool AirthingsWavePlus::is_valid_voc_value_(uint16_t voc) { return 0 <= voc && voc <= 16383; }
bool AirthingsWavePlus::is_valid_co2_value_(uint16_t co2) { return 0 <= co2 && co2 <= 16383; }
void AirthingsWavePlus::update() {
if (this->node_state != esp32_ble_tracker::ClientState::ESTABLISHED) {
if (!parent()->enabled) {
ESP_LOGW(TAG, "Reconnecting to device");
parent()->set_enabled(true);
parent()->connect();
} else {
ESP_LOGW(TAG, "Connection in progress");
}
}
}
void AirthingsWavePlus::request_read_values_() {
auto status = esp_ble_gattc_read_char(this->parent()->get_gattc_if(), this->parent()->get_conn_id(), this->handle_,
ESP_GATT_AUTH_REQ_NONE);
if (status) {
ESP_LOGW(TAG, "Error sending read request for sensor, status=%d", status);
}
}
void AirthingsWavePlus::dump_config() {
LOG_SENSOR(" ", "Humidity", this->humidity_sensor_);
LOG_SENSOR(" ", "Radon", this->radon_sensor_);
LOG_SENSOR(" ", "Radon Long Term", this->radon_long_term_sensor_);
LOG_SENSOR(" ", "Temperature", this->temperature_sensor_);
LOG_SENSOR(" ", "Pressure", this->pressure_sensor_);
LOG_SENSOR(" ", "CO2", this->co2_sensor_);
LOG_SENSOR(" ", "TVOC", this->tvoc_sensor_);
}
AirthingsWavePlus::AirthingsWavePlus()
: PollingComponent(10000),
service_uuid_(esp32_ble_tracker::ESPBTUUID::from_raw(SERVICE_UUID)),
sensors_data_characteristic_uuid_(esp32_ble_tracker::ESPBTUUID::from_raw(CHARACTERISTIC_UUID)) {}
} // namespace airthings_wave_plus
} // namespace esphome
#endif // USE_ESP32

View File

@@ -0,0 +1,75 @@
#pragma once
#ifdef USE_ESP32
#include <esp_gattc_api.h>
#include <algorithm>
#include <iterator>
#include "esphome/components/ble_client/ble_client.h"
#include "esphome/components/esp32_ble_tracker/esp32_ble_tracker.h"
#include "esphome/components/sensor/sensor.h"
#include "esphome/core/component.h"
#include "esphome/core/log.h"
namespace esphome {
namespace airthings_wave_plus {
static const char *const SERVICE_UUID = "b42e1c08-ade7-11e4-89d3-123b93f75cba";
static const char *const CHARACTERISTIC_UUID = "b42e2a68-ade7-11e4-89d3-123b93f75cba";
class AirthingsWavePlus : public PollingComponent, public ble_client::BLEClientNode {
public:
AirthingsWavePlus();
void dump_config() override;
void update() override;
void gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if,
esp_ble_gattc_cb_param_t *param) override;
void set_temperature(sensor::Sensor *temperature) { temperature_sensor_ = temperature; }
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_humidity(sensor::Sensor *humidity) { humidity_sensor_ = humidity; }
void set_pressure(sensor::Sensor *pressure) { pressure_sensor_ = pressure; }
void set_co2(sensor::Sensor *co2) { co2_sensor_ = co2; }
void set_tvoc(sensor::Sensor *tvoc) { tvoc_sensor_ = tvoc; }
protected:
bool is_valid_radon_value_(uint16_t radon);
bool is_valid_voc_value_(uint16_t voc);
bool is_valid_co2_value_(uint16_t co2);
void read_sensors_(uint8_t *value, uint16_t value_len);
void request_read_values_();
sensor::Sensor *temperature_sensor_{nullptr};
sensor::Sensor *radon_sensor_{nullptr};
sensor::Sensor *radon_long_term_sensor_{nullptr};
sensor::Sensor *humidity_sensor_{nullptr};
sensor::Sensor *pressure_sensor_{nullptr};
sensor::Sensor *co2_sensor_{nullptr};
sensor::Sensor *tvoc_sensor_{nullptr};
uint16_t handle_;
esp32_ble_tracker::ESPBTUUID service_uuid_;
esp32_ble_tracker::ESPBTUUID sensors_data_characteristic_uuid_;
struct WavePlusReadings {
uint8_t version;
uint8_t humidity;
uint8_t ambientLight;
uint8_t unused01;
uint16_t radon;
uint16_t radon_lt;
uint16_t temperature;
uint16_t pressure;
uint16_t co2;
uint16_t voc;
};
};
} // namespace airthings_wave_plus
} // namespace esphome
#endif // USE_ESP32

View File

@@ -0,0 +1,116 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import sensor, ble_client
from esphome.const import (
DEVICE_CLASS_CARBON_DIOXIDE,
DEVICE_CLASS_HUMIDITY,
DEVICE_CLASS_TEMPERATURE,
DEVICE_CLASS_PRESSURE,
STATE_CLASS_MEASUREMENT,
UNIT_PERCENT,
UNIT_CELSIUS,
UNIT_HECTOPASCAL,
ICON_RADIOACTIVE,
CONF_ID,
CONF_RADON,
CONF_RADON_LONG_TERM,
CONF_HUMIDITY,
CONF_TVOC,
CONF_CO2,
CONF_PRESSURE,
CONF_TEMPERATURE,
UNIT_BECQUEREL_PER_CUBIC_METER,
UNIT_PARTS_PER_MILLION,
UNIT_PARTS_PER_BILLION,
ICON_RADIATOR,
)
DEPENDENCIES = ["ble_client"]
airthings_wave_plus_ns = cg.esphome_ns.namespace("airthings_wave_plus")
AirthingsWavePlus = airthings_wave_plus_ns.class_(
"AirthingsWavePlus", cg.PollingComponent, ble_client.BLEClientNode
)
CONFIG_SCHEMA = cv.All(
cv.Schema(
{
cv.GenerateID(): cv.declare_id(AirthingsWavePlus),
cv.Optional(CONF_HUMIDITY): sensor.sensor_schema(
unit_of_measurement=UNIT_PERCENT,
device_class=DEVICE_CLASS_HUMIDITY,
state_class=STATE_CLASS_MEASUREMENT,
accuracy_decimals=0,
),
cv.Optional(CONF_RADON): sensor.sensor_schema(
unit_of_measurement=UNIT_BECQUEREL_PER_CUBIC_METER,
icon=ICON_RADIOACTIVE,
accuracy_decimals=0,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_RADON_LONG_TERM): sensor.sensor_schema(
unit_of_measurement=UNIT_BECQUEREL_PER_CUBIC_METER,
icon=ICON_RADIOACTIVE,
accuracy_decimals=0,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_TEMPERATURE): sensor.sensor_schema(
unit_of_measurement=UNIT_CELSIUS,
accuracy_decimals=2,
device_class=DEVICE_CLASS_TEMPERATURE,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_PRESSURE): sensor.sensor_schema(
unit_of_measurement=UNIT_HECTOPASCAL,
accuracy_decimals=1,
device_class=DEVICE_CLASS_PRESSURE,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_CO2): sensor.sensor_schema(
unit_of_measurement=UNIT_PARTS_PER_MILLION,
accuracy_decimals=0,
device_class=DEVICE_CLASS_CARBON_DIOXIDE,
state_class=STATE_CLASS_MEASUREMENT,
),
cv.Optional(CONF_TVOC): sensor.sensor_schema(
unit_of_measurement=UNIT_PARTS_PER_BILLION,
icon=ICON_RADIATOR,
accuracy_decimals=0,
state_class=STATE_CLASS_MEASUREMENT,
),
}
)
.extend(cv.polling_component_schema("5min"))
.extend(ble_client.BLE_CLIENT_SCHEMA),
)
async def to_code(config):
var = cg.new_Pvariable(config[CONF_ID])
await cg.register_component(var, config)
await ble_client.register_ble_node(var, config)
if CONF_HUMIDITY in config:
sens = await sensor.new_sensor(config[CONF_HUMIDITY])
cg.add(var.set_humidity(sens))
if CONF_RADON in config:
sens = await sensor.new_sensor(config[CONF_RADON])
cg.add(var.set_radon(sens))
if CONF_RADON_LONG_TERM in config:
sens = await sensor.new_sensor(config[CONF_RADON_LONG_TERM])
cg.add(var.set_radon_long_term(sens))
if CONF_TEMPERATURE in config:
sens = await sensor.new_sensor(config[CONF_TEMPERATURE])
cg.add(var.set_temperature(sens))
if CONF_PRESSURE in config:
sens = await sensor.new_sensor(config[CONF_PRESSURE])
cg.add(var.set_pressure(sens))
if CONF_CO2 in config:
sens = await sensor.new_sensor(config[CONF_CO2])
cg.add(var.set_co2(sens))
if CONF_TVOC in config:
sens = await sensor.new_sensor(config[CONF_TVOC])
cg.add(var.set_tvoc(sens))

View File

@@ -4,29 +4,14 @@
// - Arduino - AM2320: https://github.com/EngDial/AM2320/blob/master/src/AM2320.cpp
#include "am2320.h"
#include "esphome/core/hal.h"
#include "esphome/core/helpers.h"
#include "esphome/core/log.h"
namespace esphome {
namespace am2320 {
static const char *TAG = "am2320";
// ---=== Calc CRC16 ===---
uint16_t crc_16(uint8_t *ptr, uint8_t length) {
uint16_t crc = 0xFFFF;
uint8_t i;
//------------------------------
while (length--) {
crc ^= *ptr++;
for (i = 0; i < 8; i++)
if ((crc & 0x01) != 0) {
crc >>= 1;
crc ^= 0xA001;
} else
crc >>= 1;
}
return crc;
}
static const char *const TAG = "am2320";
void AM2320Component::update() {
uint8_t data[8];
@@ -37,9 +22,9 @@ void AM2320Component::update() {
return;
}
float temperature = (((data[4] & 0x7F) << 8) + data[5]) / 10.0;
float temperature = (((data[4] & 0x7F) << 8) + data[5]) / 10.0f;
temperature = (data[4] & 0x80) ? -temperature : temperature;
float humidity = ((data[2] << 8) + data[3]) / 10.0;
float humidity = ((data[2] << 8) + data[3]) / 10.0f;
ESP_LOGD(TAG, "Got temperature=%.1f°C humidity=%.1f%%", temperature, humidity);
if (this->temperature_sensor_ != nullptr)
@@ -77,7 +62,7 @@ bool AM2320Component::read_bytes_(uint8_t a_register, uint8_t *data, uint8_t len
if (conversion > 0)
delay(conversion);
return this->parent_->raw_receive(this->address_, data, len);
return this->read(data, len) == i2c::ERROR_OK;
}
bool AM2320Component::read_data_(uint8_t *data) {
@@ -95,7 +80,7 @@ bool AM2320Component::read_data_(uint8_t *data) {
checksum = data[7] << 8;
checksum += data[6];
if (crc_16(data, 6) != checksum) {
if (crc16(data, 6) != checksum) {
ESP_LOGW(TAG, "AM2320 Checksum invalid!");
return false;
}

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