esphome 2025.9.3__py3-none-any.whl → 2025.10.0b1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- esphome/__main__.py +87 -31
- esphome/address_cache.py +142 -0
- esphome/automation.py +130 -32
- esphome/build_gen/platformio.py +1 -3
- esphome/codegen.py +1 -0
- esphome/components/animation/animation.cpp +2 -2
- esphome/components/api/__init__.py +166 -3
- esphome/components/api/api_connection.cpp +84 -41
- esphome/components/api/api_connection.h +22 -16
- esphome/components/api/api_frame_helper.cpp +33 -19
- esphome/components/api/api_frame_helper.h +19 -4
- esphome/components/api/api_frame_helper_noise.cpp +41 -53
- esphome/components/api/api_frame_helper_noise.h +1 -1
- esphome/components/api/api_frame_helper_plaintext.cpp +22 -31
- esphome/components/api/api_frame_helper_plaintext.h +1 -1
- esphome/components/api/api_pb2.cpp +189 -15
- esphome/components/api/api_pb2.h +132 -20
- esphome/components/api/api_pb2_dump.cpp +97 -9
- esphome/components/api/api_pb2_service.cpp +118 -160
- esphome/components/api/api_pb2_service.h +31 -3
- esphome/components/api/api_server.cpp +68 -10
- esphome/components/api/api_server.h +32 -4
- esphome/components/api/custom_api_device.h +8 -8
- esphome/components/api/homeassistant_service.h +123 -6
- esphome/components/api/proto.h +6 -2
- esphome/components/api/user_services.h +2 -2
- esphome/components/as7341/sensor.py +1 -1
- esphome/components/audio/__init__.py +1 -1
- esphome/components/audio/audio.cpp +1 -1
- esphome/components/audio/audio_decoder.cpp +9 -9
- esphome/components/bl0906/bl0906.cpp +2 -2
- esphome/components/bl0942/bl0942.cpp +2 -2
- esphome/components/ble_client/__init__.py +1 -1
- esphome/components/bluetooth_proxy/__init__.py +4 -30
- esphome/components/bluetooth_proxy/bluetooth_connection.cpp +11 -4
- esphome/components/bluetooth_proxy/bluetooth_connection.h +2 -2
- esphome/components/bluetooth_proxy/bluetooth_proxy.cpp +2 -2
- esphome/components/camera_encoder/__init__.py +2 -4
- esphome/components/camera_encoder/esp32_camera_jpeg_encoder.cpp +4 -2
- esphome/components/camera_encoder/esp32_camera_jpeg_encoder.h +3 -1
- esphome/components/canbus/canbus.cpp +7 -5
- esphome/components/canbus/canbus.h +4 -4
- esphome/components/captive_portal/__init__.py +18 -1
- esphome/components/captive_portal/captive_portal.cpp +40 -46
- esphome/components/captive_portal/captive_portal.h +20 -22
- esphome/components/captive_portal/dns_server_esp32_idf.cpp +205 -0
- esphome/components/captive_portal/dns_server_esp32_idf.h +27 -0
- esphome/components/ccs811/ccs811.cpp +1 -1
- esphome/components/climate/climate.cpp +10 -7
- esphome/components/cm1106/cm1106.cpp +1 -1
- esphome/components/copy/lock/copy_lock.cpp +1 -1
- esphome/components/cover/cover.cpp +1 -0
- esphome/components/daikin_arc/daikin_arc.cpp +19 -12
- esphome/components/deep_sleep/__init__.py +9 -2
- esphome/components/deep_sleep/deep_sleep_component.h +11 -9
- esphome/components/deep_sleep/deep_sleep_esp32.cpp +51 -27
- esphome/components/ektf2232/touchscreen/__init__.py +8 -5
- esphome/components/ektf2232/touchscreen/ektf2232.cpp +4 -4
- esphome/components/ektf2232/touchscreen/ektf2232.h +2 -2
- esphome/components/epaper_spi/__init__.py +1 -0
- esphome/components/epaper_spi/display.py +80 -0
- esphome/components/epaper_spi/epaper_spi.cpp +227 -0
- esphome/components/epaper_spi/epaper_spi.h +93 -0
- esphome/components/epaper_spi/epaper_spi_model_7p3in_spectra_e6.cpp +42 -0
- esphome/components/epaper_spi/epaper_spi_model_7p3in_spectra_e6.h +45 -0
- esphome/components/epaper_spi/epaper_spi_spectra_e6.cpp +135 -0
- esphome/components/epaper_spi/epaper_spi_spectra_e6.h +23 -0
- esphome/components/es7210/es7210.cpp +3 -3
- esphome/components/esp32/__init__.py +254 -339
- esphome/components/esp32/boards.py +81 -0
- esphome/components/esp32/preferences.cpp +23 -17
- esphome/components/esp32_ble/__init__.py +159 -44
- esphome/components/esp32_ble/ble.cpp +47 -3
- esphome/components/esp32_ble/ble.h +18 -0
- esphome/components/esp32_ble/ble_advertising.cpp +7 -3
- esphome/components/esp32_ble/ble_advertising.h +4 -0
- esphome/components/esp32_ble/ble_uuid.cpp +16 -42
- esphome/components/esp32_ble_beacon/__init__.py +3 -4
- esphome/components/esp32_ble_client/ble_client_base.cpp +14 -12
- esphome/components/esp32_ble_server/__init__.py +28 -14
- esphome/components/esp32_ble_server/ble_characteristic.cpp +67 -57
- esphome/components/esp32_ble_server/ble_characteristic.h +27 -16
- esphome/components/esp32_ble_server/ble_descriptor.cpp +4 -3
- esphome/components/esp32_ble_server/ble_descriptor.h +13 -9
- esphome/components/esp32_ble_server/ble_server.cpp +59 -24
- esphome/components/esp32_ble_server/ble_server.h +38 -20
- esphome/components/esp32_ble_server/ble_server_automations.cpp +49 -33
- esphome/components/esp32_ble_server/ble_server_automations.h +39 -24
- esphome/components/esp32_ble_tracker/__init__.py +25 -80
- esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +2 -4
- esphome/components/esp32_ble_tracker/esp32_ble_tracker.h +0 -3
- esphome/components/esp32_camera/__init__.py +1 -3
- esphome/components/esp32_can/esp32_can.cpp +22 -4
- esphome/components/esp32_can/esp32_can.h +3 -0
- esphome/components/esp32_hosted/__init__.py +2 -1
- esphome/components/esp32_improv/esp32_improv_component.cpp +102 -44
- esphome/components/esp32_improv/esp32_improv_component.h +6 -1
- esphome/components/esp32_rmt_led_strip/led_strip.cpp +1 -1
- esphome/components/esp8266/__init__.py +3 -3
- esphome/components/esphome/ota/__init__.py +21 -2
- esphome/components/esphome/ota/ota_esphome.cpp +455 -145
- esphome/components/esphome/ota/ota_esphome.h +49 -2
- esphome/components/ethernet/__init__.py +39 -22
- esphome/components/ethernet/ethernet_component.cpp +28 -5
- esphome/components/ethernet/ethernet_component.h +5 -1
- esphome/components/external_components/__init__.py +8 -6
- esphome/components/fingerprint_grow/fingerprint_grow.cpp +1 -1
- esphome/components/fingerprint_grow/fingerprint_grow.h +2 -1
- esphome/components/font/__init__.py +5 -5
- esphome/components/graph/graph.cpp +1 -1
- esphome/components/graphical_display_menu/graphical_display_menu.cpp +3 -2
- esphome/components/haier/hon_climate.cpp +2 -2
- esphome/components/haier/hon_climate.h +1 -1
- esphome/components/hdc1080/hdc1080.cpp +42 -34
- esphome/components/hdc1080/hdc1080.h +1 -3
- esphome/components/homeassistant/number/homeassistant_number.cpp +2 -2
- esphome/components/homeassistant/switch/homeassistant_switch.cpp +2 -2
- esphome/components/http_request/__init__.py +3 -3
- esphome/components/htu21d/htu21d.cpp +13 -18
- esphome/components/htu21d/htu21d.h +1 -1
- esphome/components/i2s_audio/__init__.py +1 -2
- esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp +1 -1
- esphome/components/ili9xxx/ili9xxx_display.cpp +2 -2
- esphome/components/improv_serial/improv_serial_component.cpp +12 -15
- esphome/components/improv_serial/improv_serial_component.h +6 -8
- esphome/components/json/json_util.cpp +35 -43
- esphome/components/json/json_util.h +57 -0
- esphome/components/kamstrup_kmp/kamstrup_kmp.cpp +2 -2
- esphome/components/key_collector/key_collector.h +4 -4
- esphome/components/libretiny/__init__.py +6 -6
- esphome/components/libretiny/preferences.cpp +23 -16
- esphome/components/light/light_call.cpp +98 -120
- esphome/components/light/light_call.h +17 -7
- esphome/components/lm75b/__init__.py +0 -0
- esphome/components/lm75b/lm75b.cpp +39 -0
- esphome/components/lm75b/lm75b.h +19 -0
- esphome/components/lm75b/sensor.py +34 -0
- esphome/components/lock/lock.h +12 -6
- esphome/components/logger/__init__.py +15 -27
- esphome/components/logger/logger.cpp +10 -20
- esphome/components/logger/logger.h +105 -62
- esphome/components/logger/logger_esp32.cpp +0 -48
- esphome/components/logger/logger_zephyr.cpp +2 -3
- esphome/components/logger/select/logger_level_select.cpp +6 -7
- esphome/components/logger/select/logger_level_select.h +7 -0
- esphome/components/ltr501/ltr501.cpp +7 -6
- esphome/components/ltr_als_ps/ltr_als_ps.cpp +7 -6
- esphome/components/matrix_keypad/matrix_keypad.h +4 -4
- esphome/components/max7219digit/max7219digit.cpp +1 -1
- esphome/components/mcp2515/mcp2515.cpp +31 -3
- esphome/components/mcp2515/mcp2515_defs.h +3 -1
- esphome/components/md5/md5.cpp +0 -26
- esphome/components/md5/md5.h +10 -20
- esphome/components/mdns/__init__.py +19 -6
- esphome/components/mdns/mdns_component.cpp +27 -59
- esphome/components/mdns/mdns_component.h +23 -10
- esphome/components/mdns/mdns_esp32.cpp +7 -7
- esphome/components/mdns/mdns_esp8266.cpp +6 -6
- esphome/components/mdns/mdns_libretiny.cpp +3 -3
- esphome/components/mdns/mdns_rp2040.cpp +3 -3
- esphome/components/mipi/__init__.py +1 -5
- esphome/components/mipi_spi/display.py +24 -8
- esphome/components/mipi_spi/mipi_spi.h +3 -3
- esphome/components/mixer/speaker/mixer_speaker.cpp +3 -3
- esphome/components/mmc5603/mmc5603.cpp +3 -3
- esphome/components/modbus/modbus.cpp +27 -13
- esphome/components/modbus/modbus.h +5 -3
- esphome/components/modbus/modbus_definitions.h +86 -0
- esphome/components/modbus_controller/__init__.py +29 -1
- esphome/components/modbus_controller/const.py +4 -0
- esphome/components/modbus_controller/modbus_controller.cpp +38 -13
- esphome/components/modbus_controller/modbus_controller.h +18 -29
- esphome/components/mpr121/mpr121.cpp +41 -42
- esphome/components/mpr121/mpr121.h +0 -1
- esphome/components/nau7802/nau7802.cpp +2 -2
- esphome/components/network/__init__.py +7 -3
- esphome/components/nextion/display.py +4 -4
- esphome/components/nextion/nextion.cpp +8 -8
- esphome/components/number/__init__.py +2 -0
- esphome/components/number/number_call.cpp +23 -12
- esphome/components/number/number_call.h +5 -0
- esphome/components/online_image/bmp_image.cpp +2 -1
- esphome/components/online_image/jpeg_image.cpp +4 -2
- esphome/components/openthread/openthread.cpp +6 -7
- esphome/components/openthread/openthread.h +0 -1
- esphome/components/ota/ota_backend.h +1 -0
- esphome/components/packages/__init__.py +10 -8
- esphome/components/packet_transport/packet_transport.cpp +2 -0
- esphome/components/pid/pid_controller.cpp +1 -1
- esphome/components/prometheus/prometheus_handler.cpp +239 -239
- esphome/components/psram/__init__.py +30 -28
- esphome/components/qmc5883l/qmc5883l.cpp +15 -0
- esphome/components/qmc5883l/qmc5883l.h +3 -0
- esphome/components/qmc5883l/sensor.py +31 -12
- esphome/components/remote_base/gobox_protocol.cpp +3 -3
- esphome/components/remote_receiver/__init__.py +14 -2
- esphome/components/remote_receiver/{remote_receiver_esp8266.cpp → remote_receiver.cpp} +2 -2
- esphome/components/remote_receiver/remote_receiver.h +4 -0
- esphome/components/remote_receiver/remote_receiver_esp32.cpp +18 -1
- esphome/components/remote_transmitter/__init__.py +2 -2
- esphome/components/remote_transmitter/remote_transmitter.cpp +103 -0
- esphome/components/rp2040/__init__.py +11 -11
- esphome/components/rtttl/rtttl.cpp +2 -2
- esphome/components/scd30/sensor.py +1 -1
- esphome/components/script/__init__.py +1 -1
- esphome/components/script/script.h +7 -7
- esphome/components/select/select.cpp +5 -4
- esphome/components/select/select_call.cpp +1 -1
- esphome/components/sensirion_common/i2c_sensirion.cpp +2 -1
- esphome/components/sensor/__init__.py +2 -0
- esphome/components/sha256/__init__.py +22 -0
- esphome/components/sha256/sha256.cpp +116 -0
- esphome/components/sha256/sha256.h +60 -0
- esphome/components/socket/lwip_raw_tcp_impl.cpp +34 -6
- esphome/components/sonoff_d1/sonoff_d1.cpp +1 -1
- esphome/components/spi/__init__.py +0 -3
- esphome/components/split_buffer/__init__.py +5 -0
- esphome/components/split_buffer/split_buffer.cpp +133 -0
- esphome/components/split_buffer/split_buffer.h +40 -0
- esphome/components/sps30/sps30.cpp +14 -10
- esphome/components/sps30/sps30.h +2 -0
- esphome/components/st7567_i2c/st7567_i2c.cpp +3 -1
- esphome/components/st7789v/st7789v.cpp +3 -2
- esphome/components/statsd/statsd.cpp +1 -1
- esphome/components/substitutions/__init__.py +3 -1
- esphome/components/substitutions/jinja.py +13 -3
- esphome/components/sx126x/__init__.py +16 -0
- esphome/components/sx126x/sx126x.cpp +15 -1
- esphome/components/sx126x/sx126x.h +9 -1
- esphome/components/sx126x/sx126x_reg.h +2 -0
- esphome/components/text_sensor/text_sensor.cpp +16 -0
- esphome/components/text_sensor/text_sensor.h +3 -10
- esphome/components/tormatic/tormatic_cover.cpp +1 -1
- esphome/components/tuya/select/tuya_select.cpp +1 -1
- esphome/components/tuya/tuya.cpp +29 -4
- esphome/components/uart/__init__.py +36 -26
- esphome/components/uart/uart.h +6 -0
- esphome/components/uart/uart_component.cpp +8 -0
- esphome/components/uart/uart_component.h +28 -0
- esphome/components/uart/uart_component_esp_idf.cpp +64 -10
- esphome/components/uart/uart_component_esp_idf.h +5 -2
- esphome/components/uponor_smatrix/climate/uponor_smatrix_climate.cpp +1 -1
- esphome/components/uponor_smatrix/sensor/uponor_smatrix_sensor.cpp +1 -1
- esphome/components/uponor_smatrix/uponor_smatrix.cpp +3 -3
- esphome/components/usb_host/__init__.py +2 -1
- esphome/components/usb_host/usb_host.h +82 -13
- esphome/components/usb_host/usb_host_client.cpp +180 -24
- esphome/components/usb_host/usb_host_component.cpp +1 -1
- esphome/components/usb_uart/__init__.py +0 -1
- esphome/components/usb_uart/ch34x.cpp +4 -4
- esphome/components/usb_uart/cp210x.cpp +3 -3
- esphome/components/usb_uart/usb_uart.cpp +88 -32
- esphome/components/usb_uart/usb_uart.h +30 -6
- esphome/components/valve/valve.cpp +1 -0
- esphome/components/veml7700/veml7700.cpp +7 -6
- esphome/components/version/version_text_sensor.cpp +2 -1
- esphome/components/voice_assistant/voice_assistant.cpp +3 -2
- esphome/components/waveshare_epaper/waveshare_epaper.cpp +4 -4
- esphome/components/web_server/list_entities.cpp +3 -4
- esphome/components/web_server/list_entities.h +8 -10
- esphome/components/web_server/ota/__init__.py +1 -1
- esphome/components/web_server/ota/ota_web_server.cpp +9 -3
- esphome/components/web_server/web_server.cpp +509 -404
- esphome/components/web_server/web_server.h +5 -6
- esphome/components/web_server/web_server_v1.cpp +21 -19
- esphome/components/web_server_base/__init__.py +5 -2
- esphome/components/web_server_base/web_server_base.h +27 -7
- esphome/components/web_server_idf/__init__.py +1 -1
- esphome/components/web_server_idf/multipart.cpp +2 -2
- esphome/components/web_server_idf/multipart.h +2 -2
- esphome/components/web_server_idf/utils.cpp +2 -2
- esphome/components/web_server_idf/utils.h +2 -2
- esphome/components/web_server_idf/web_server_idf.cpp +118 -26
- esphome/components/web_server_idf/web_server_idf.h +12 -10
- esphome/components/wifi/__init__.py +13 -11
- esphome/components/wifi/wifi_component.cpp +73 -56
- esphome/components/wifi/wifi_component.h +4 -4
- esphome/components/wifi/wifi_component_esp8266.cpp +1 -1
- esphome/components/wifi/wifi_component_esp_idf.cpp +24 -4
- esphome/components/wireguard/__init__.py +1 -1
- esphome/components/wts01/__init__.py +0 -0
- esphome/components/wts01/sensor.py +41 -0
- esphome/components/wts01/wts01.cpp +91 -0
- esphome/components/wts01/wts01.h +27 -0
- esphome/components/zephyr/__init__.py +5 -5
- esphome/components/zwave_proxy/__init__.py +43 -0
- esphome/components/zwave_proxy/zwave_proxy.cpp +346 -0
- esphome/components/zwave_proxy/zwave_proxy.h +93 -0
- esphome/config.py +79 -24
- esphome/config_validation.py +13 -15
- esphome/const.py +9 -2
- esphome/core/__init__.py +31 -22
- esphome/core/component.cpp +28 -18
- esphome/core/component_iterator.h +2 -1
- esphome/core/config.py +15 -15
- esphome/core/defines.h +19 -0
- esphome/core/hash_base.h +56 -0
- esphome/core/helpers.cpp +19 -3
- esphome/core/helpers.h +26 -0
- esphome/core/scheduler.cpp +5 -21
- esphome/core/scheduler.h +19 -8
- esphome/core/string_ref.h +1 -1
- esphome/core/time.cpp +5 -5
- esphome/cpp_generator.py +4 -29
- esphome/dashboard/const.py +21 -4
- esphome/dashboard/core.py +10 -8
- esphome/dashboard/dns.py +15 -0
- esphome/dashboard/entries.py +15 -21
- esphome/dashboard/models.py +76 -0
- esphome/dashboard/settings.py +7 -7
- esphome/dashboard/status/mdns.py +46 -2
- esphome/dashboard/web_server.py +367 -93
- esphome/espota2.py +111 -31
- esphome/external_files.py +6 -7
- esphome/git.py +8 -0
- esphome/helpers.py +124 -77
- esphome/loader.py +8 -9
- esphome/platformio_api.py +25 -18
- esphome/storage_json.py +26 -21
- esphome/types.py +30 -2
- esphome/util.py +32 -16
- esphome/vscode.py +8 -8
- esphome/wizard.py +10 -10
- esphome/writer.py +50 -15
- esphome/yaml_util.py +37 -31
- esphome/zeroconf.py +12 -3
- {esphome-2025.9.3.dist-info → esphome-2025.10.0b1.dist-info}/METADATA +11 -11
- {esphome-2025.9.3.dist-info → esphome-2025.10.0b1.dist-info}/RECORD +332 -312
- esphome/components/event_emitter/__init__.py +0 -5
- esphome/components/event_emitter/event_emitter.cpp +0 -14
- esphome/components/event_emitter/event_emitter.h +0 -63
- esphome/components/remote_receiver/remote_receiver_libretiny.cpp +0 -125
- esphome/components/remote_transmitter/remote_transmitter_esp8266.cpp +0 -107
- esphome/components/remote_transmitter/remote_transmitter_libretiny.cpp +0 -110
- esphome/components/uart/uart_component_esp32_arduino.cpp +0 -214
- esphome/components/uart/uart_component_esp32_arduino.h +0 -60
- esphome/components/wifi/wifi_component_esp32_arduino.cpp +0 -860
- esphome/core/string_ref.cpp +0 -12
- esphome/dashboard/util/file.py +0 -63
- {esphome-2025.9.3.dist-info → esphome-2025.10.0b1.dist-info}/WHEEL +0 -0
- {esphome-2025.9.3.dist-info → esphome-2025.10.0b1.dist-info}/entry_points.txt +0 -0
- {esphome-2025.9.3.dist-info → esphome-2025.10.0b1.dist-info}/licenses/LICENSE +0 -0
- {esphome-2025.9.3.dist-info → esphome-2025.10.0b1.dist-info}/top_level.txt +0 -0
@@ -218,7 +218,7 @@ void NAU7802Sensor::dump_config() {
|
|
218
218
|
|
219
219
|
void NAU7802Sensor::write_value_(uint8_t start_reg, size_t size, int32_t value) {
|
220
220
|
uint8_t data[4];
|
221
|
-
for (
|
221
|
+
for (size_t i = 0; i < size; i++) {
|
222
222
|
data[i] = 0xFF & (value >> (size - 1 - i) * 8);
|
223
223
|
}
|
224
224
|
this->write_register(start_reg, data, size);
|
@@ -228,7 +228,7 @@ int32_t NAU7802Sensor::read_value_(uint8_t start_reg, size_t size) {
|
|
228
228
|
uint8_t data[4];
|
229
229
|
this->read_register(start_reg, data, size);
|
230
230
|
int32_t result = 0;
|
231
|
-
for (
|
231
|
+
for (size_t i = 0; i < size; i++) {
|
232
232
|
result |= data[i] << (size - 1 - i) * 8;
|
233
233
|
}
|
234
234
|
// extend sign bit
|
@@ -47,9 +47,13 @@ async def to_code(config):
|
|
47
47
|
cg.add_define(
|
48
48
|
"USE_NETWORK_MIN_IPV6_ADDR_COUNT", config[CONF_MIN_IPV6_ADDR_COUNT]
|
49
49
|
)
|
50
|
-
if CORE.
|
51
|
-
|
52
|
-
|
50
|
+
if CORE.is_esp32:
|
51
|
+
if CORE.using_esp_idf:
|
52
|
+
add_idf_sdkconfig_option("CONFIG_LWIP_IPV6", enable_ipv6)
|
53
|
+
add_idf_sdkconfig_option("CONFIG_LWIP_IPV6_AUTOCONFIG", enable_ipv6)
|
54
|
+
else:
|
55
|
+
add_idf_sdkconfig_option("CONFIG_LWIP_IPV6", True)
|
56
|
+
add_idf_sdkconfig_option("CONFIG_LWIP_IPV6_AUTOCONFIG", True)
|
53
57
|
elif enable_ipv6:
|
54
58
|
cg.add_build_flag("-DCONFIG_LWIP_IPV6")
|
55
59
|
cg.add_build_flag("-DCONFIG_LWIP_IPV6_AUTOCONFIG")
|
@@ -153,10 +153,10 @@ async def to_code(config):
|
|
153
153
|
if CONF_TFT_URL in config:
|
154
154
|
cg.add_define("USE_NEXTION_TFT_UPLOAD")
|
155
155
|
cg.add(var.set_tft_url(config[CONF_TFT_URL]))
|
156
|
-
if CORE.is_esp32
|
157
|
-
|
158
|
-
|
159
|
-
|
156
|
+
if CORE.is_esp32:
|
157
|
+
if CORE.using_arduino:
|
158
|
+
cg.add_library("NetworkClientSecure", None)
|
159
|
+
cg.add_library("HTTPClient", None)
|
160
160
|
esp32.add_idf_sdkconfig_option("CONFIG_ESP_TLS_INSECURE", True)
|
161
161
|
esp32.add_idf_sdkconfig_option(
|
162
162
|
"CONFIG_ESP_TLS_SKIP_SERVER_CERT_VERIFY", True
|
@@ -77,7 +77,7 @@ bool Nextion::check_connect_() {
|
|
77
77
|
this->recv_ret_string_(response, 0, false);
|
78
78
|
if (!response.empty() && response[0] == 0x1A) {
|
79
79
|
// Swallow invalid variable name responses that may be caused by the above commands
|
80
|
-
|
80
|
+
ESP_LOGV(TAG, "0x1A error ignored (setup)");
|
81
81
|
return false;
|
82
82
|
}
|
83
83
|
if (response.empty() || response.find("comok") == std::string::npos) {
|
@@ -334,7 +334,7 @@ void Nextion::loop() {
|
|
334
334
|
this->started_ms_ = App.get_loop_component_start_time();
|
335
335
|
|
336
336
|
if (this->started_ms_ + this->startup_override_ms_ < App.get_loop_component_start_time()) {
|
337
|
-
|
337
|
+
ESP_LOGV(TAG, "Manual ready set");
|
338
338
|
this->connection_state_.nextion_reports_is_setup_ = true;
|
339
339
|
}
|
340
340
|
}
|
@@ -544,7 +544,7 @@ void Nextion::process_nextion_commands_() {
|
|
544
544
|
uint8_t page_id = to_process[0];
|
545
545
|
uint8_t component_id = to_process[1];
|
546
546
|
uint8_t touch_event = to_process[2]; // 0 -> release, 1 -> press
|
547
|
-
|
547
|
+
ESP_LOGV(TAG, "Touch %s: page %u comp %u", touch_event ? "PRESS" : "RELEASE", page_id, component_id);
|
548
548
|
for (auto *touch : this->touch_) {
|
549
549
|
touch->process_touch(page_id, component_id, touch_event != 0);
|
550
550
|
}
|
@@ -559,7 +559,7 @@ void Nextion::process_nextion_commands_() {
|
|
559
559
|
}
|
560
560
|
|
561
561
|
uint8_t page_id = to_process[0];
|
562
|
-
|
562
|
+
ESP_LOGV(TAG, "New page: %u", page_id);
|
563
563
|
this->page_callback_.call(page_id);
|
564
564
|
break;
|
565
565
|
}
|
@@ -577,7 +577,7 @@ void Nextion::process_nextion_commands_() {
|
|
577
577
|
const uint16_t x = (uint16_t(to_process[0]) << 8) | to_process[1];
|
578
578
|
const uint16_t y = (uint16_t(to_process[2]) << 8) | to_process[3];
|
579
579
|
const uint8_t touch_event = to_process[4]; // 0 -> release, 1 -> press
|
580
|
-
|
580
|
+
ESP_LOGV(TAG, "Touch %s at %u,%u", touch_event ? "PRESS" : "RELEASE", x, y);
|
581
581
|
break;
|
582
582
|
}
|
583
583
|
|
@@ -676,7 +676,7 @@ void Nextion::process_nextion_commands_() {
|
|
676
676
|
}
|
677
677
|
case 0x88: // system successful start up
|
678
678
|
{
|
679
|
-
|
679
|
+
ESP_LOGV(TAG, "System start: %zu", to_process_length);
|
680
680
|
this->connection_state_.nextion_reports_is_setup_ = true;
|
681
681
|
break;
|
682
682
|
}
|
@@ -922,7 +922,7 @@ void Nextion::set_nextion_sensor_state(NextionQueueType queue_type, const std::s
|
|
922
922
|
}
|
923
923
|
|
924
924
|
void Nextion::set_nextion_text_state(const std::string &name, const std::string &state) {
|
925
|
-
|
925
|
+
ESP_LOGV(TAG, "State: %s='%s'", name.c_str(), state.c_str());
|
926
926
|
|
927
927
|
for (auto *sensor : this->textsensortype_) {
|
928
928
|
if (name == sensor->get_variable_name()) {
|
@@ -933,7 +933,7 @@ void Nextion::set_nextion_text_state(const std::string &name, const std::string
|
|
933
933
|
}
|
934
934
|
|
935
935
|
void Nextion::all_components_send_state_(bool force_update) {
|
936
|
-
|
936
|
+
ESP_LOGV(TAG, "Send states");
|
937
937
|
for (auto *binarysensortype : this->binarysensortype_) {
|
938
938
|
if (force_update || binarysensortype->get_needs_to_send_update())
|
939
939
|
binarysensortype->send_state_to_nextion();
|
@@ -51,6 +51,7 @@ from esphome.const import (
|
|
51
51
|
DEVICE_CLASS_OZONE,
|
52
52
|
DEVICE_CLASS_PH,
|
53
53
|
DEVICE_CLASS_PM1,
|
54
|
+
DEVICE_CLASS_PM4,
|
54
55
|
DEVICE_CLASS_PM10,
|
55
56
|
DEVICE_CLASS_PM25,
|
56
57
|
DEVICE_CLASS_POWER,
|
@@ -116,6 +117,7 @@ DEVICE_CLASSES = [
|
|
116
117
|
DEVICE_CLASS_PM1,
|
117
118
|
DEVICE_CLASS_PM10,
|
118
119
|
DEVICE_CLASS_PM25,
|
120
|
+
DEVICE_CLASS_PM4,
|
119
121
|
DEVICE_CLASS_POWER,
|
120
122
|
DEVICE_CLASS_POWER_FACTOR,
|
121
123
|
DEVICE_CLASS_PRECIPITATION,
|
@@ -7,6 +7,17 @@ namespace number {
|
|
7
7
|
|
8
8
|
static const char *const TAG = "number";
|
9
9
|
|
10
|
+
// Helper functions to reduce code size for logging
|
11
|
+
void NumberCall::log_perform_warning_(const LogString *message) {
|
12
|
+
ESP_LOGW(TAG, "'%s': %s", this->parent_->get_name().c_str(), LOG_STR_ARG(message));
|
13
|
+
}
|
14
|
+
|
15
|
+
void NumberCall::log_perform_warning_value_range_(const LogString *comparison, const LogString *limit_type, float val,
|
16
|
+
float limit) {
|
17
|
+
ESP_LOGW(TAG, "'%s': %f %s %s %f", this->parent_->get_name().c_str(), val, LOG_STR_ARG(comparison),
|
18
|
+
LOG_STR_ARG(limit_type), limit);
|
19
|
+
}
|
20
|
+
|
10
21
|
NumberCall &NumberCall::set_value(float value) { return this->with_operation(NUMBER_OP_SET).with_value(value); }
|
11
22
|
|
12
23
|
NumberCall &NumberCall::number_increment(bool cycle) {
|
@@ -42,7 +53,7 @@ void NumberCall::perform() {
|
|
42
53
|
const auto &traits = parent->traits;
|
43
54
|
|
44
55
|
if (this->operation_ == NUMBER_OP_NONE) {
|
45
|
-
|
56
|
+
this->log_perform_warning_(LOG_STR("No operation"));
|
46
57
|
return;
|
47
58
|
}
|
48
59
|
|
@@ -51,28 +62,28 @@ void NumberCall::perform() {
|
|
51
62
|
float max_value = traits.get_max_value();
|
52
63
|
|
53
64
|
if (this->operation_ == NUMBER_OP_SET) {
|
54
|
-
ESP_LOGD(TAG, "'%s'
|
65
|
+
ESP_LOGD(TAG, "'%s': Setting value", name);
|
55
66
|
if (!this->value_.has_value() || std::isnan(*this->value_)) {
|
56
|
-
|
67
|
+
this->log_perform_warning_(LOG_STR("No value"));
|
57
68
|
return;
|
58
69
|
}
|
59
70
|
target_value = this->value_.value();
|
60
71
|
} else if (this->operation_ == NUMBER_OP_TO_MIN) {
|
61
72
|
if (std::isnan(min_value)) {
|
62
|
-
|
73
|
+
this->log_perform_warning_(LOG_STR("min undefined"));
|
63
74
|
} else {
|
64
75
|
target_value = min_value;
|
65
76
|
}
|
66
77
|
} else if (this->operation_ == NUMBER_OP_TO_MAX) {
|
67
78
|
if (std::isnan(max_value)) {
|
68
|
-
|
79
|
+
this->log_perform_warning_(LOG_STR("max undefined"));
|
69
80
|
} else {
|
70
81
|
target_value = max_value;
|
71
82
|
}
|
72
83
|
} else if (this->operation_ == NUMBER_OP_INCREMENT) {
|
73
|
-
ESP_LOGD(TAG, "'%s'
|
84
|
+
ESP_LOGD(TAG, "'%s': Increment with%s cycling", name, this->cycle_ ? "" : "out");
|
74
85
|
if (!parent->has_state()) {
|
75
|
-
|
86
|
+
this->log_perform_warning_(LOG_STR("Can't increment, no state"));
|
76
87
|
return;
|
77
88
|
}
|
78
89
|
auto step = traits.get_step();
|
@@ -85,9 +96,9 @@ void NumberCall::perform() {
|
|
85
96
|
}
|
86
97
|
}
|
87
98
|
} else if (this->operation_ == NUMBER_OP_DECREMENT) {
|
88
|
-
ESP_LOGD(TAG, "'%s'
|
99
|
+
ESP_LOGD(TAG, "'%s': Decrement with%s cycling", name, this->cycle_ ? "" : "out");
|
89
100
|
if (!parent->has_state()) {
|
90
|
-
|
101
|
+
this->log_perform_warning_(LOG_STR("Can't decrement, no state"));
|
91
102
|
return;
|
92
103
|
}
|
93
104
|
auto step = traits.get_step();
|
@@ -102,15 +113,15 @@ void NumberCall::perform() {
|
|
102
113
|
}
|
103
114
|
|
104
115
|
if (target_value < min_value) {
|
105
|
-
|
116
|
+
this->log_perform_warning_value_range_(LOG_STR("<"), LOG_STR("min"), target_value, min_value);
|
106
117
|
return;
|
107
118
|
}
|
108
119
|
if (target_value > max_value) {
|
109
|
-
|
120
|
+
this->log_perform_warning_value_range_(LOG_STR(">"), LOG_STR("max"), target_value, max_value);
|
110
121
|
return;
|
111
122
|
}
|
112
123
|
|
113
|
-
ESP_LOGD(TAG, " New
|
124
|
+
ESP_LOGD(TAG, " New value: %f", target_value);
|
114
125
|
this->parent_->control(target_value);
|
115
126
|
}
|
116
127
|
|
@@ -1,6 +1,7 @@
|
|
1
1
|
#pragma once
|
2
2
|
|
3
3
|
#include "esphome/core/helpers.h"
|
4
|
+
#include "esphome/core/log.h"
|
4
5
|
#include "number_traits.h"
|
5
6
|
|
6
7
|
namespace esphome {
|
@@ -33,6 +34,10 @@ class NumberCall {
|
|
33
34
|
NumberCall &with_cycle(bool cycle);
|
34
35
|
|
35
36
|
protected:
|
37
|
+
void log_perform_warning_(const LogString *message);
|
38
|
+
void log_perform_warning_value_range_(const LogString *comparison, const LogString *limit_type, float val,
|
39
|
+
float limit);
|
40
|
+
|
36
41
|
Number *const parent_;
|
37
42
|
NumberOperation operation_{NUMBER_OP_NONE};
|
38
43
|
optional<float> value_;
|
@@ -117,7 +117,8 @@ int HOT BmpDecoder::decode(uint8_t *buffer, size_t size) {
|
|
117
117
|
this->paint_index_++;
|
118
118
|
this->current_index_ += 3;
|
119
119
|
index += 3;
|
120
|
-
|
120
|
+
size_t last_col = static_cast<size_t>(this->width_) - 1;
|
121
|
+
if (x == last_col && this->padding_bytes_ > 0) {
|
121
122
|
index += this->padding_bytes_;
|
122
123
|
this->current_index_ += this->padding_bytes_;
|
123
124
|
}
|
@@ -25,8 +25,10 @@ static int draw_callback(JPEGDRAW *jpeg) {
|
|
25
25
|
// to avoid crashing.
|
26
26
|
App.feed_wdt();
|
27
27
|
size_t position = 0;
|
28
|
-
|
29
|
-
|
28
|
+
size_t height = static_cast<size_t>(jpeg->iHeight);
|
29
|
+
size_t width = static_cast<size_t>(jpeg->iWidth);
|
30
|
+
for (size_t y = 0; y < height; y++) {
|
31
|
+
for (size_t x = 0; x < width; x++) {
|
30
32
|
auto rg = decode_value(jpeg->pPixels[position++]);
|
31
33
|
auto ba = decode_value(jpeg->pPixels[position++]);
|
32
34
|
Color color(rg[1], rg[0], ba[1], ba[0]);
|
@@ -143,11 +143,10 @@ void OpenThreadSrpComponent::setup() {
|
|
143
143
|
return;
|
144
144
|
}
|
145
145
|
|
146
|
-
//
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
for (const auto &service : this->mdns_services_) {
|
146
|
+
// Get mdns services and copy their data (strings are copied with strdup below)
|
147
|
+
const auto &mdns_services = this->mdns_->get_services();
|
148
|
+
ESP_LOGD(TAG, "Setting up SRP services. count = %d\n", mdns_services.size());
|
149
|
+
for (const auto &service : mdns_services) {
|
151
150
|
otSrpClientBuffersServiceEntry *entry = otSrpClientBuffersAllocateService(instance);
|
152
151
|
if (!entry) {
|
153
152
|
ESP_LOGW(TAG, "Failed to allocate service entry");
|
@@ -156,7 +155,7 @@ void OpenThreadSrpComponent::setup() {
|
|
156
155
|
|
157
156
|
// Set service name
|
158
157
|
char *string = otSrpClientBuffersGetServiceEntryServiceNameString(entry, &size);
|
159
|
-
std::string full_service = service.service_type + "." + service.proto;
|
158
|
+
std::string full_service = std::string(MDNS_STR_ARG(service.service_type)) + "." + MDNS_STR_ARG(service.proto);
|
160
159
|
if (full_service.size() > size) {
|
161
160
|
ESP_LOGW(TAG, "Service name too long: %s", full_service.c_str());
|
162
161
|
continue;
|
@@ -182,7 +181,7 @@ void OpenThreadSrpComponent::setup() {
|
|
182
181
|
for (size_t i = 0; i < service.txt_records.size(); i++) {
|
183
182
|
const auto &txt = service.txt_records[i];
|
184
183
|
auto value = const_cast<TemplatableValue<std::string> &>(txt.value).value();
|
185
|
-
txt_entries[i].mKey =
|
184
|
+
txt_entries[i].mKey = MDNS_STR_ARG(txt.key);
|
186
185
|
txt_entries[i].mValue = reinterpret_cast<const uint8_t *>(strdup(value.c_str()));
|
187
186
|
txt_entries[i].mValueLength = value.size();
|
188
187
|
}
|
@@ -57,7 +57,6 @@ class OpenThreadSrpComponent : public Component {
|
|
57
57
|
|
58
58
|
protected:
|
59
59
|
esphome::mdns::MDNSComponent *mdns_{nullptr};
|
60
|
-
std::vector<esphome::mdns::MDNSService> mdns_services_;
|
61
60
|
std::vector<std::unique_ptr<uint8_t[]>> memory_pool_;
|
62
61
|
void *pool_alloc_(size_t size);
|
63
62
|
};
|
@@ -106,11 +106,13 @@ CONFIG_SCHEMA = cv.Any(
|
|
106
106
|
)
|
107
107
|
|
108
108
|
|
109
|
-
def _process_base_package(config: dict) -> dict:
|
109
|
+
def _process_base_package(config: dict, skip_update: bool = False) -> dict:
|
110
|
+
# When skip_update is True, use NEVER_REFRESH to prevent updates
|
111
|
+
actual_refresh = git.NEVER_REFRESH if skip_update else config[CONF_REFRESH]
|
110
112
|
repo_dir, revert = git.clone_or_update(
|
111
113
|
url=config[CONF_URL],
|
112
114
|
ref=config.get(CONF_REF),
|
113
|
-
refresh=
|
115
|
+
refresh=actual_refresh,
|
114
116
|
domain=DOMAIN,
|
115
117
|
username=config.get(CONF_USERNAME),
|
116
118
|
password=config.get(CONF_PASSWORD),
|
@@ -180,16 +182,16 @@ def _process_base_package(config: dict) -> dict:
|
|
180
182
|
return {"packages": packages}
|
181
183
|
|
182
184
|
|
183
|
-
def _process_package(package_config, config):
|
185
|
+
def _process_package(package_config, config, skip_update: bool = False):
|
184
186
|
recursive_package = package_config
|
185
187
|
if CONF_URL in package_config:
|
186
|
-
package_config = _process_base_package(package_config)
|
188
|
+
package_config = _process_base_package(package_config, skip_update)
|
187
189
|
if isinstance(package_config, dict):
|
188
|
-
recursive_package = do_packages_pass(package_config)
|
190
|
+
recursive_package = do_packages_pass(package_config, skip_update)
|
189
191
|
return merge_config(recursive_package, config)
|
190
192
|
|
191
193
|
|
192
|
-
def do_packages_pass(config: dict):
|
194
|
+
def do_packages_pass(config: dict, skip_update: bool = False):
|
193
195
|
if CONF_PACKAGES not in config:
|
194
196
|
return config
|
195
197
|
packages = config[CONF_PACKAGES]
|
@@ -198,10 +200,10 @@ def do_packages_pass(config: dict):
|
|
198
200
|
if isinstance(packages, dict):
|
199
201
|
for package_name, package_config in reversed(packages.items()):
|
200
202
|
with cv.prepend_path(package_name):
|
201
|
-
config = _process_package(package_config, config)
|
203
|
+
config = _process_package(package_config, config, skip_update)
|
202
204
|
elif isinstance(packages, list):
|
203
205
|
for package_config in reversed(packages):
|
204
|
-
config = _process_package(package_config, config)
|
206
|
+
config = _process_package(package_config, config, skip_update)
|
205
207
|
else:
|
206
208
|
raise cv.Invalid(
|
207
209
|
f"Packages must be a key to value mapping or list, got {type(packages)} instead"
|
@@ -270,6 +270,7 @@ void PacketTransport::add_binary_data_(uint8_t key, const char *id, bool data) {
|
|
270
270
|
auto len = 1 + 1 + 1 + strlen(id);
|
271
271
|
if (len + this->header_.size() + this->data_.size() > this->get_max_packet_size()) {
|
272
272
|
this->flush_();
|
273
|
+
this->init_data_();
|
273
274
|
}
|
274
275
|
add(this->data_, key);
|
275
276
|
add(this->data_, (uint8_t) data);
|
@@ -284,6 +285,7 @@ void PacketTransport::add_data_(uint8_t key, const char *id, uint32_t data) {
|
|
284
285
|
auto len = 4 + 1 + 1 + strlen(id);
|
285
286
|
if (len + this->header_.size() + this->data_.size() > this->get_max_packet_size()) {
|
286
287
|
this->flush_();
|
288
|
+
this->init_data_();
|
287
289
|
}
|
288
290
|
add(this->data_, key);
|
289
291
|
add(this->data_, data);
|
@@ -104,7 +104,7 @@ float PIDController::weighted_average_(std::deque<float> &list, float new_value,
|
|
104
104
|
list.push_front(new_value);
|
105
105
|
|
106
106
|
// keep only 'samples' readings, by popping off the back of the list
|
107
|
-
while (list.size() > samples)
|
107
|
+
while (samples > 0 && list.size() > static_cast<size_t>(samples))
|
108
108
|
list.pop_back();
|
109
109
|
|
110
110
|
// calculate and return the average of all values in the list
|