From 12f00a9d3d4e5354bd3c21b414b60cc14e04ee73 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Sat, 29 Jun 2024 14:12:59 +1200 Subject: [PATCH 1/4] [mpr121] await register parented (#7014) fixes https://github.com/esphome/issues/issues/5913 --- esphome/components/mpr121/binary_sensor/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/components/mpr121/binary_sensor/__init__.py b/esphome/components/mpr121/binary_sensor/__init__.py index 292c631c37..dfae92a9af 100644 --- a/esphome/components/mpr121/binary_sensor/__init__.py +++ b/esphome/components/mpr121/binary_sensor/__init__.py @@ -27,7 +27,7 @@ async def to_code(config): var = await binary_sensor.new_binary_sensor(config) hub = await cg.get_variable(config[CONF_MPR121_ID]) cg.add(var.set_channel(config[CONF_CHANNEL])) - cg.register_parented(var, hub) + await cg.register_parented(var, hub) if CONF_TOUCH_THRESHOLD in config: cg.add(var.set_touch_threshold(config[CONF_TOUCH_THRESHOLD])) From 0914dc719889d25e71bf12a4025c821ed6542504 Mon Sep 17 00:00:00 2001 From: Keith Burzinski Date: Mon, 1 Jul 2024 01:20:59 -0500 Subject: [PATCH 2/4] Move some consts for #4585 (#7023) --- esphome/components/bme680_bsec/__init__.py | 3 +-- esphome/components/bme680_bsec/sensor.py | 12 ++++++------ esphome/components/bme680_bsec/text_sensor.py | 2 +- esphome/components/i2s_audio/microphone/__init__.py | 3 +-- esphome/const.py | 2 ++ 5 files changed, 11 insertions(+), 11 deletions(-) diff --git a/esphome/components/bme680_bsec/__init__.py b/esphome/components/bme680_bsec/__init__.py index 62ab50b8f7..743ef6e85d 100644 --- a/esphome/components/bme680_bsec/__init__.py +++ b/esphome/components/bme680_bsec/__init__.py @@ -1,7 +1,7 @@ import esphome.codegen as cg import esphome.config_validation as cv from esphome.components import i2c, esp32 -from esphome.const import CONF_ID, CONF_TEMPERATURE_OFFSET +from esphome.const import CONF_ID, CONF_SAMPLE_RATE, CONF_TEMPERATURE_OFFSET CODEOWNERS = ["@trvrnrth"] DEPENDENCIES = ["i2c"] @@ -11,7 +11,6 @@ MULTI_CONF = True CONF_BME680_BSEC_ID = "bme680_bsec_id" CONF_IAQ_MODE = "iaq_mode" CONF_SUPPLY_VOLTAGE = "supply_voltage" -CONF_SAMPLE_RATE = "sample_rate" CONF_STATE_SAVE_INTERVAL = "state_save_interval" bme680_bsec_ns = cg.esphome_ns.namespace("bme680_bsec") diff --git a/esphome/components/bme680_bsec/sensor.py b/esphome/components/bme680_bsec/sensor.py index 43b068b926..aa96998232 100644 --- a/esphome/components/bme680_bsec/sensor.py +++ b/esphome/components/bme680_bsec/sensor.py @@ -4,33 +4,33 @@ from esphome.components import sensor from esphome.const import ( CONF_GAS_RESISTANCE, CONF_HUMIDITY, + CONF_IAQ_ACCURACY, CONF_PRESSURE, + CONF_SAMPLE_RATE, CONF_TEMPERATURE, + DEVICE_CLASS_ATMOSPHERIC_PRESSURE, DEVICE_CLASS_CARBON_DIOXIDE, DEVICE_CLASS_HUMIDITY, - DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS, - DEVICE_CLASS_ATMOSPHERIC_PRESSURE, DEVICE_CLASS_TEMPERATURE, + DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS_PARTS, + ICON_GAS_CYLINDER, + ICON_GAUGE, STATE_CLASS_MEASUREMENT, UNIT_CELSIUS, UNIT_HECTOPASCAL, UNIT_OHM, UNIT_PARTS_PER_MILLION, UNIT_PERCENT, - ICON_GAS_CYLINDER, - ICON_GAUGE, ) from . import ( BME680BSECComponent, CONF_BME680_BSEC_ID, - CONF_SAMPLE_RATE, SAMPLE_RATE_OPTIONS, ) DEPENDENCIES = ["bme680_bsec"] CONF_IAQ = "iaq" -CONF_IAQ_ACCURACY = "iaq_accuracy" CONF_CO2_EQUIVALENT = "co2_equivalent" CONF_BREATH_VOC_EQUIVALENT = "breath_voc_equivalent" UNIT_IAQ = "IAQ" diff --git a/esphome/components/bme680_bsec/text_sensor.py b/esphome/components/bme680_bsec/text_sensor.py index 3494ba0cac..6b46e501da 100644 --- a/esphome/components/bme680_bsec/text_sensor.py +++ b/esphome/components/bme680_bsec/text_sensor.py @@ -1,11 +1,11 @@ import esphome.codegen as cg import esphome.config_validation as cv from esphome.components import text_sensor +from esphome.const import CONF_IAQ_ACCURACY from . import BME680BSECComponent, CONF_BME680_BSEC_ID DEPENDENCIES = ["bme680_bsec"] -CONF_IAQ_ACCURACY = "iaq_accuracy" ICON_ACCURACY = "mdi:checkbox-marked-circle-outline" TYPES = [CONF_IAQ_ACCURACY] diff --git a/esphome/components/i2s_audio/microphone/__init__.py b/esphome/components/i2s_audio/microphone/__init__.py index 5ee359dc26..d9c31e8e7b 100644 --- a/esphome/components/i2s_audio/microphone/__init__.py +++ b/esphome/components/i2s_audio/microphone/__init__.py @@ -2,7 +2,7 @@ import esphome.config_validation as cv import esphome.codegen as cg from esphome import pins -from esphome.const import CONF_CHANNEL, CONF_ID, CONF_NUMBER +from esphome.const import CONF_CHANNEL, CONF_ID, CONF_NUMBER, CONF_SAMPLE_RATE from esphome.components import microphone, esp32 from esphome.components.adc import ESP32_VARIANT_ADC1_PIN_TO_CHANNEL, validate_adc_pin @@ -20,7 +20,6 @@ DEPENDENCIES = ["i2s_audio"] CONF_ADC_PIN = "adc_pin" CONF_ADC_TYPE = "adc_type" CONF_PDM = "pdm" -CONF_SAMPLE_RATE = "sample_rate" CONF_BITS_PER_SAMPLE = "bits_per_sample" CONF_USE_APLL = "use_apll" diff --git a/esphome/const.py b/esphome/const.py index b26d8d2851..fee9c1796a 100644 --- a/esphome/const.py +++ b/esphome/const.py @@ -355,6 +355,7 @@ CONF_HUMIDITY_SENSOR = "humidity_sensor" CONF_HYSTERESIS = "hysteresis" CONF_I2C = "i2c" CONF_I2C_ID = "i2c_id" +CONF_IAQ_ACCURACY = "iaq_accuracy" CONF_IBEACON_MAJOR = "ibeacon_major" CONF_IBEACON_MINOR = "ibeacon_minor" CONF_IBEACON_UUID = "ibeacon_uuid" @@ -719,6 +720,7 @@ CONF_RX_BUFFER_SIZE = "rx_buffer_size" CONF_RX_ONLY = "rx_only" CONF_RX_PIN = "rx_pin" CONF_SAFE_MODE = "safe_mode" +CONF_SAMPLE_RATE = "sample_rate" CONF_SAMSUNG = "samsung" CONF_SATELLITES = "satellites" CONF_SCAN = "scan" From 5cb80619ddd362c055e9e418f9da1c4c175687b5 Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Wed, 3 Jul 2024 14:21:41 +1200 Subject: [PATCH 3/4] [wifi] Only set default ttls phase 2 on esp-idf (#7033) * [wifi] Only set default ttls phase 2 on esp-idf * Add eap arduino test --- esphome/components/wifi/__init__.py | 4 ++-- tests/components/wifi/test-eap.esp32-ard.yaml | 7 +++++++ 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 tests/components/wifi/test-eap.esp32-ard.yaml diff --git a/esphome/components/wifi/__init__.py b/esphome/components/wifi/__init__.py index 3b9e00956f..624bcdabdc 100644 --- a/esphome/components/wifi/__init__.py +++ b/esphome/components/wifi/__init__.py @@ -114,7 +114,7 @@ EAP_AUTH_SCHEMA = cv.All( cv.Optional(CONF_USERNAME): cv.string_strict, cv.Optional(CONF_PASSWORD): cv.string_strict, cv.Optional(CONF_CERTIFICATE_AUTHORITY): wpa2_eap.validate_certificate, - cv.Optional(CONF_TTLS_PHASE_2): cv.All( + cv.SplitDefault(CONF_TTLS_PHASE_2, esp32_idf="mschapv2"): cv.All( cv.enum(TTLS_PHASE_2), cv.only_with_esp_idf ), cv.Inclusive( @@ -350,7 +350,7 @@ def eap_auth(config): ("ca_cert", ca_cert), ("client_cert", client_cert), ("client_key", key), - ("ttls_phase_2", config.get(CONF_TTLS_PHASE_2, TTLS_PHASE_2["mschapv2"])), + ("ttls_phase_2", config.get(CONF_TTLS_PHASE_2)), ) diff --git a/tests/components/wifi/test-eap.esp32-ard.yaml b/tests/components/wifi/test-eap.esp32-ard.yaml new file mode 100644 index 0000000000..779cd6b49a --- /dev/null +++ b/tests/components/wifi/test-eap.esp32-ard.yaml @@ -0,0 +1,7 @@ +wifi: + networks: + - ssid: MySSID + eap: + username: username + password: password + identity: identity From 995db1d0e11554fed3fa62672df3faa535b7f1ba Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Wed, 3 Jul 2024 15:45:30 +1200 Subject: [PATCH 4/4] Bump version to 2024.6.5 --- esphome/const.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/esphome/const.py b/esphome/const.py index fee9c1796a..5b441faa6c 100644 --- a/esphome/const.py +++ b/esphome/const.py @@ -1,6 +1,6 @@ """Constants used by esphome.""" -__version__ = "2024.6.4" +__version__ = "2024.6.5" ALLOWED_NAME_CHARS = "abcdefghijklmnopqrstuvwxyz0123456789-_" VALID_SUBSTITUTIONS_CHARACTERS = (