esphome 2025.8.4__py3-none-any.whl → 2025.9.0b2__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 +177 -105
- esphome/components/absolute_humidity/absolute_humidity.cpp +3 -5
- esphome/components/adc/__init__.py +1 -26
- esphome/components/adc/adc_sensor_esp32.cpp +29 -6
- esphome/components/adc/sensor.py +20 -0
- esphome/components/ags10/ags10.cpp +3 -18
- esphome/components/ags10/ags10.h +2 -12
- esphome/components/aht10/aht10.cpp +3 -3
- esphome/components/airthings_ble/__init__.py +2 -2
- esphome/components/alarm_control_panel/__init__.py +2 -2
- esphome/components/am2315c/am2315c.cpp +1 -17
- esphome/components/am2315c/am2315c.h +2 -3
- esphome/components/api/__init__.py +2 -2
- esphome/components/api/api_connection.cpp +38 -34
- esphome/components/api/api_connection.h +20 -40
- esphome/components/api/api_frame_helper.cpp +25 -25
- esphome/components/api/api_frame_helper.h +3 -3
- esphome/components/api/api_frame_helper_noise.cpp +75 -40
- esphome/components/api/api_frame_helper_noise.h +3 -7
- esphome/components/api/api_frame_helper_plaintext.cpp +17 -4
- esphome/components/api/api_frame_helper_plaintext.h +1 -4
- esphome/components/api/api_pb2.cpp +12 -2
- esphome/components/api/api_pb2.h +144 -143
- esphome/components/api/api_pb2_dump.cpp +6 -1
- esphome/components/api/api_pb2_service.cpp +0 -14
- esphome/components/api/api_pb2_service.h +1 -3
- esphome/components/api/client.py +5 -3
- esphome/components/api/proto.cpp +33 -37
- esphome/components/async_tcp/__init__.py +2 -2
- esphome/components/atm90e26/sensor.py +2 -0
- esphome/components/atm90e32/sensor.py +4 -2
- esphome/components/audio_adc/__init__.py +2 -2
- esphome/components/audio_dac/__init__.py +2 -2
- esphome/components/axs15231/touchscreen/axs15231_touchscreen.cpp +1 -1
- esphome/components/bedjet/bedjet_hub.cpp +1 -1
- esphome/components/binary_sensor/__init__.py +2 -2
- esphome/components/binary_sensor/binary_sensor.cpp +13 -0
- esphome/components/binary_sensor/binary_sensor.h +4 -7
- esphome/components/bl0940/__init__.py +6 -1
- esphome/components/bl0940/bl0940.cpp +178 -41
- esphome/components/bl0940/bl0940.h +121 -76
- esphome/components/bl0940/button/__init__.py +27 -0
- esphome/components/bl0940/button/calibration_reset_button.cpp +20 -0
- esphome/components/bl0940/button/calibration_reset_button.h +19 -0
- esphome/components/bl0940/number/__init__.py +94 -0
- esphome/components/bl0940/number/calibration_number.cpp +29 -0
- esphome/components/bl0940/number/calibration_number.h +26 -0
- esphome/components/bl0940/sensor.py +151 -2
- esphome/components/bl0942/bl0942.cpp +1 -1
- esphome/components/ble_client/output/__init__.py +4 -4
- esphome/components/bluetooth_proxy/__init__.py +1 -1
- esphome/components/bluetooth_proxy/bluetooth_connection.h +1 -1
- esphome/components/bluetooth_proxy/bluetooth_proxy.cpp +15 -7
- esphome/components/bluetooth_proxy/bluetooth_proxy.h +6 -3
- esphome/components/button/__init__.py +2 -2
- esphome/components/button/button.cpp +13 -0
- esphome/components/button/button.h +4 -7
- esphome/components/camera/buffer.h +18 -0
- esphome/components/camera/buffer_impl.cpp +20 -0
- esphome/components/camera/buffer_impl.h +26 -0
- esphome/components/camera/camera.h +43 -0
- esphome/components/camera/encoder.h +69 -0
- esphome/components/camera_encoder/__init__.py +62 -0
- esphome/components/camera_encoder/encoder_buffer_impl.cpp +23 -0
- esphome/components/camera_encoder/encoder_buffer_impl.h +25 -0
- esphome/components/camera_encoder/esp32_camera_jpeg_encoder.cpp +82 -0
- esphome/components/camera_encoder/esp32_camera_jpeg_encoder.h +39 -0
- esphome/components/captive_portal/__init__.py +2 -2
- esphome/components/captive_portal/captive_index.h +77 -97
- esphome/components/captive_portal/captive_portal.cpp +35 -12
- esphome/components/captive_portal/captive_portal.h +3 -3
- esphome/components/ccs811/ccs811.cpp +3 -3
- esphome/components/climate/__init__.py +2 -2
- esphome/components/climate/climate.cpp +1 -1
- esphome/components/cover/__init__.py +5 -5
- esphome/components/cover/cover.cpp +1 -1
- esphome/components/cover/cover.h +2 -2
- esphome/components/dallas_temp/dallas_temp.cpp +2 -2
- esphome/components/datetime/__init__.py +2 -2
- esphome/components/datetime/date_entity.h +2 -2
- esphome/components/datetime/datetime_entity.h +2 -2
- esphome/components/datetime/time_entity.h +2 -2
- esphome/components/debug/debug_esp32.cpp +1 -1
- esphome/components/display/__init__.py +4 -4
- esphome/components/duty_time/duty_time_sensor.cpp +1 -1
- esphome/components/esp32/__init__.py +0 -5
- esphome/components/esp32/gpio.cpp +27 -23
- esphome/components/esp32/gpio.h +26 -11
- esphome/components/esp32/preferences.cpp +8 -4
- esphome/components/esp32_ble/__init__.py +7 -2
- esphome/components/esp32_ble/ble_uuid.cpp +30 -9
- esphome/components/esp32_ble_beacon/esp32_ble_beacon.cpp +4 -3
- esphome/components/esp32_ble_client/ble_client_base.cpp +7 -3
- esphome/components/esp32_ble_client/ble_client_base.h +8 -5
- esphome/components/esp32_ble_tracker/__init__.py +2 -2
- esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +11 -47
- esphome/components/esp32_ble_tracker/esp32_ble_tracker.h +2 -14
- esphome/components/esp8266/__init__.py +2 -2
- esphome/components/esp8266/core.cpp +2 -2
- esphome/components/esp8266/gpio.py +4 -4
- esphome/components/esp8266/preferences.cpp +30 -28
- esphome/components/esphome/ota/__init__.py +2 -2
- esphome/components/esphome/ota/ota_esphome.cpp +21 -19
- esphome/components/esphome/ota/ota_esphome.h +6 -5
- esphome/components/ethernet/__init__.py +7 -2
- esphome/components/ethernet/ethernet_component.cpp +49 -3
- esphome/components/ethernet/ethernet_component.h +2 -0
- esphome/components/event/__init__.py +2 -2
- esphome/components/event/event.h +4 -4
- esphome/components/factory_reset/button/factory_reset_button.cpp +18 -1
- esphome/components/factory_reset/button/factory_reset_button.h +6 -1
- esphome/components/factory_reset/switch/factory_reset_switch.cpp +18 -1
- esphome/components/factory_reset/switch/factory_reset_switch.h +5 -1
- esphome/components/fan/__init__.py +2 -2
- esphome/components/fan/fan.cpp +2 -1
- esphome/components/gdk101/gdk101.cpp +4 -4
- esphome/components/globals/__init__.py +2 -2
- esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp +19 -18
- esphome/components/gpio_expander/cached_gpio.h +36 -16
- esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.cpp +5 -5
- esphome/components/gt911/touchscreen/gt911_touchscreen.cpp +1 -1
- esphome/components/haier/haier_base.cpp +1 -1
- esphome/components/haier/hon_climate.cpp +1 -1
- esphome/components/hlw8012/hlw8012.cpp +5 -5
- esphome/components/honeywellabp2_i2c/honeywellabp2.cpp +4 -4
- esphome/components/host/preferences.h +3 -2
- esphome/components/hte501/hte501.cpp +3 -21
- esphome/components/hte501/hte501.h +2 -3
- esphome/components/http_request/ota/__init__.py +2 -2
- esphome/components/i2c/__init__.py +2 -2
- esphome/components/i2c/i2c.cpp +13 -9
- esphome/components/i2c/i2c_bus.h +36 -6
- esphome/components/i2s_audio/__init__.py +8 -2
- esphome/components/i2s_audio/media_player/__init__.py +1 -1
- esphome/components/i2s_audio/microphone/__init__.py +1 -1
- esphome/components/i2s_audio/speaker/__init__.py +1 -1
- esphome/components/ina2xx_base/__init__.py +4 -2
- esphome/components/inkplate/__init__.py +1 -0
- esphome/components/inkplate/const.py +105 -0
- esphome/components/inkplate/display.py +238 -0
- esphome/components/{inkplate6 → inkplate}/inkplate.cpp +156 -74
- esphome/components/{inkplate6 → inkplate}/inkplate.h +28 -68
- esphome/components/inkplate6/__init__.py +0 -1
- esphome/components/inkplate6/display.py +2 -211
- esphome/components/integration/integration_sensor.cpp +1 -1
- esphome/components/json/__init__.py +2 -2
- esphome/components/lc709203f/lc709203f.cpp +4 -17
- esphome/components/lc709203f/lc709203f.h +2 -3
- esphome/components/ld2420/text_sensor/{text_sensor.cpp → ld2420_text_sensor.cpp} +1 -1
- esphome/components/ld2450/ld2450.cpp +1 -1
- esphome/components/libretiny/preferences.cpp +13 -5
- esphome/components/light/__init__.py +2 -2
- esphome/components/light/addressable_light_effect.h +7 -0
- esphome/components/light/base_light_effects.h +8 -0
- esphome/components/light/light_call.cpp +22 -20
- esphome/components/light/light_effect.cpp +36 -0
- esphome/components/light/light_effect.h +14 -0
- esphome/components/light/light_json_schema.cpp +9 -1
- esphome/components/light/light_state.cpp +2 -2
- esphome/components/light/light_state.h +38 -0
- esphome/components/lock/__init__.py +2 -2
- esphome/components/lock/lock.h +2 -2
- esphome/components/logger/__init__.py +2 -2
- esphome/components/logger/logger.cpp +25 -4
- esphome/components/logger/logger.h +1 -1
- esphome/components/logger/logger_esp32.cpp +16 -8
- esphome/components/logger/logger_esp8266.cpp +11 -3
- esphome/components/logger/logger_libretiny.cpp +13 -3
- esphome/components/logger/logger_rp2040.cpp +14 -3
- esphome/components/logger/logger_zephyr.cpp +15 -4
- esphome/components/lvgl/defines.py +1 -0
- esphome/components/lvgl/hello_world.py +96 -33
- esphome/components/lvgl/number/lvgl_number.h +1 -1
- esphome/components/lvgl/select/lvgl_select.h +1 -1
- esphome/components/lvgl/widgets/__init__.py +0 -1
- esphome/components/lvgl/widgets/spinbox.py +20 -11
- esphome/components/m5stack_8angle/binary_sensor/m5stack_8angle_binary_sensor.cpp +1 -1
- esphome/components/m5stack_8angle/sensor/m5stack_8angle_sensor.cpp +1 -1
- esphome/components/mapping/__init__.py +13 -5
- esphome/components/mapping/mapping.h +69 -0
- esphome/components/max17043/max17043.cpp +2 -2
- esphome/components/mcp23016/__init__.py +1 -0
- esphome/components/mcp23016/mcp23016.cpp +20 -5
- esphome/components/mcp23016/mcp23016.h +10 -4
- esphome/components/mcp23x08_base/mcp23x08_base.cpp +1 -1
- esphome/components/mcp23x17_base/mcp23x17_base.cpp +2 -2
- esphome/components/md5/md5.cpp +3 -2
- esphome/components/mdns/__init__.py +2 -2
- esphome/components/mdns/mdns_component.cpp +145 -54
- esphome/components/media_player/__init__.py +2 -2
- esphome/components/micro_wake_word/__init__.py +2 -2
- esphome/components/microphone/__init__.py +2 -2
- esphome/components/mipi/__init__.py +77 -33
- esphome/components/mipi_rgb/__init__.py +2 -0
- esphome/components/mipi_rgb/display.py +321 -0
- esphome/components/mipi_rgb/mipi_rgb.cpp +388 -0
- esphome/components/mipi_rgb/mipi_rgb.h +127 -0
- esphome/components/mipi_rgb/models/guition.py +24 -0
- esphome/components/mipi_rgb/models/lilygo.py +228 -0
- esphome/components/mipi_rgb/models/rpi.py +9 -0
- esphome/components/mipi_rgb/models/st7701s.py +214 -0
- esphome/components/mipi_rgb/models/waveshare.py +64 -0
- esphome/components/mipi_spi/models/jc.py +229 -0
- esphome/components/mlx90614/mlx90614.cpp +1 -16
- esphome/components/mlx90614/mlx90614.h +0 -1
- esphome/components/mqtt/__init__.py +2 -2
- esphome/components/mqtt/mqtt_sensor.cpp +7 -2
- esphome/components/ms5611/ms5611.cpp +7 -6
- esphome/components/network/__init__.py +2 -2
- esphome/components/nextion/nextion_upload.cpp +4 -1
- esphome/components/nrf52/__init__.py +49 -6
- esphome/components/nrf52/const.py +1 -0
- esphome/components/nrf52/dfu.cpp +51 -0
- esphome/components/nrf52/dfu.h +24 -0
- esphome/components/ntc/ntc.cpp +1 -1
- esphome/components/number/__init__.py +2 -2
- esphome/components/number/automation.cpp +1 -1
- esphome/components/number/number.cpp +21 -0
- esphome/components/number/number.h +4 -13
- esphome/components/opentherm/hub.h +6 -6
- esphome/components/opentherm/number/{number.cpp → opentherm_number.cpp} +2 -2
- esphome/components/opentherm/output/{output.cpp → opentherm_output.cpp} +1 -1
- esphome/components/opentherm/switch/{switch.cpp → opentherm_switch.cpp} +1 -1
- esphome/components/openthread/openthread.cpp +41 -7
- esphome/components/openthread/openthread.h +11 -0
- esphome/components/ota/__init__.py +2 -2
- esphome/components/pca6416a/__init__.py +1 -0
- esphome/components/pca6416a/pca6416a.cpp +20 -5
- esphome/components/pca6416a/pca6416a.h +12 -5
- esphome/components/pca9554/__init__.py +2 -1
- esphome/components/pca9554/pca9554.cpp +12 -18
- esphome/components/pca9554/pca9554.h +10 -9
- esphome/components/pcf8574/__init__.py +1 -0
- esphome/components/pcf8574/pcf8574.cpp +14 -5
- esphome/components/pcf8574/pcf8574.h +13 -6
- esphome/components/pi4ioe5v6408/pi4ioe5v6408.cpp +7 -7
- esphome/components/pipsolar/__init__.py +3 -3
- esphome/components/pipsolar/output/__init__.py +4 -4
- esphome/components/pulse_width/pulse_width.cpp +2 -2
- esphome/components/qmp6988/qmp6988.cpp +81 -126
- esphome/components/qmp6988/qmp6988.h +31 -37
- esphome/components/radon_eye_ble/__init__.py +2 -2
- esphome/components/remote_base/__init__.py +6 -8
- esphome/components/rotary_encoder/rotary_encoder.cpp +1 -1
- esphome/components/rp2040/__init__.py +2 -2
- esphome/components/runtime_stats/runtime_stats.cpp +10 -23
- esphome/components/runtime_stats/runtime_stats.h +4 -10
- esphome/components/safe_mode/__init__.py +2 -2
- esphome/components/safe_mode/safe_mode.cpp +33 -31
- esphome/components/script/script.cpp +6 -0
- esphome/components/script/script.h +19 -5
- esphome/components/sdm_meter/sensor.py +3 -1
- esphome/components/select/__init__.py +2 -2
- esphome/components/select/select.h +2 -2
- esphome/components/sen5x/sen5x.cpp +57 -55
- esphome/components/sen5x/sen5x.h +21 -15
- esphome/components/sen5x/sensor.py +67 -44
- esphome/components/sensirion_common/i2c_sensirion.cpp +18 -47
- esphome/components/sensirion_common/i2c_sensirion.h +39 -55
- esphome/components/sensor/__init__.py +2 -2
- esphome/components/sensor/automation.h +1 -1
- esphome/components/sensor/sensor.cpp +34 -6
- esphome/components/sensor/sensor.h +4 -21
- esphome/components/sgp30/sgp30.cpp +34 -35
- esphome/components/sgp30/sgp30.h +11 -10
- esphome/components/sgp4x/sgp4x.cpp +2 -2
- esphome/components/shelly_dimmer/light.py +7 -7
- esphome/components/sht4x/sht4x.cpp +1 -1
- esphome/components/sntp/sntp_component.cpp +36 -9
- esphome/components/sntp/sntp_component.h +7 -0
- esphome/components/sound_level/sound_level.cpp +1 -1
- esphome/components/speaker/__init__.py +2 -2
- esphome/components/speaker/media_player/__init__.py +2 -2
- esphome/components/speaker/media_player/speaker_media_player.cpp +1 -1
- esphome/components/spi/__init__.py +2 -2
- esphome/components/sprinkler/sprinkler.cpp +1 -1
- esphome/components/sps30/sps30.cpp +18 -23
- esphome/components/sps30/sps30.h +3 -3
- esphome/components/status_led/__init__.py +2 -2
- esphome/components/stepper/__init__.py +2 -2
- esphome/components/switch/__init__.py +2 -2
- esphome/components/switch/switch.cpp +5 -5
- esphome/components/sx1509/__init__.py +1 -1
- esphome/components/sx1509/sx1509.cpp +12 -7
- esphome/components/sx1509/sx1509.h +11 -4
- esphome/components/tca9555/tca9555.cpp +5 -5
- esphome/components/tee501/tee501.cpp +2 -21
- esphome/components/tee501/tee501.h +2 -4
- esphome/components/template/alarm_control_panel/template_alarm_control_panel.cpp +1 -1
- esphome/components/template/datetime/template_date.cpp +1 -1
- esphome/components/template/datetime/template_datetime.cpp +2 -2
- esphome/components/template/datetime/template_time.cpp +1 -1
- esphome/components/template/number/template_number.cpp +1 -1
- esphome/components/template/select/template_select.cpp +1 -1
- esphome/components/template/text/template_text.cpp +1 -1
- esphome/components/text/__init__.py +2 -2
- esphome/components/text/text.h +2 -2
- esphome/components/text_sensor/__init__.py +2 -2
- esphome/components/text_sensor/text_sensor.h +4 -4
- esphome/components/thermostat/climate.py +11 -7
- esphome/components/thermostat/thermostat_climate.cpp +237 -206
- esphome/components/thermostat/thermostat_climate.h +52 -41
- esphome/components/time/__init__.py +2 -2
- esphome/components/tmp1075/tmp1075.cpp +1 -1
- esphome/components/total_daily_energy/total_daily_energy.cpp +1 -1
- esphome/components/touchscreen/__init__.py +2 -2
- esphome/components/tuya/number/tuya_number.cpp +1 -1
- esphome/components/udp/udp_component.cpp +3 -3
- esphome/components/ufire_ec/ufire_ec.cpp +4 -4
- esphome/components/ufire_ise/ufire_ise.cpp +4 -4
- esphome/components/update/__init__.py +2 -2
- esphome/components/usb_uart/usb_uart.cpp +1 -1
- esphome/components/valve/__init__.py +5 -5
- esphome/components/valve/valve.cpp +1 -1
- esphome/components/valve/valve.h +2 -2
- esphome/components/wake_on_lan/wake_on_lan.cpp +2 -2
- esphome/components/waveshare_epaper/waveshare_213v3.cpp +1 -1
- esphome/components/web_server/__init__.py +2 -2
- esphome/components/web_server/ota/__init__.py +2 -2
- esphome/components/web_server/ota/ota_web_server.cpp +11 -0
- esphome/components/web_server/server_index_v2.h +149 -149
- esphome/components/web_server/web_server.cpp +58 -12
- esphome/components/web_server_base/__init__.py +2 -2
- esphome/components/wifi/__init__.py +5 -5
- esphome/components/wifi/wifi_component.cpp +4 -4
- esphome/components/wifi/wifi_component_esp_idf.cpp +2 -0
- esphome/components/wifi_info/wifi_info_text_sensor.h +3 -2
- esphome/config_validation.py +2 -2
- esphome/const.py +3 -1
- esphome/core/__init__.py +1 -0
- esphome/core/application.cpp +89 -51
- esphome/core/application.h +1 -0
- esphome/core/component.cpp +41 -19
- esphome/core/component.h +17 -13
- esphome/core/config.py +7 -7
- esphome/core/defines.h +4 -0
- esphome/core/entity_base.cpp +22 -8
- esphome/core/entity_base.h +43 -0
- esphome/core/helpers.cpp +34 -20
- esphome/core/helpers.h +33 -3
- esphome/core/ring_buffer.cpp +6 -2
- esphome/core/ring_buffer.h +2 -1
- esphome/core/scheduler.cpp +178 -97
- esphome/core/scheduler.h +67 -36
- esphome/core/time.cpp +6 -20
- esphome/coroutine.py +80 -3
- esphome/cpp_generator.py +13 -0
- esphome/cpp_helpers.py +2 -2
- esphome/dashboard/web_server.py +67 -10
- esphome/espota2.py +13 -6
- esphome/helpers.py +68 -83
- esphome/resolver.py +67 -0
- esphome/util.py +9 -6
- esphome/wizard.py +39 -26
- {esphome-2025.8.4.dist-info → esphome-2025.9.0b2.dist-info}/METADATA +9 -9
- {esphome-2025.8.4.dist-info → esphome-2025.9.0b2.dist-info}/RECORD +364 -333
- /esphome/components/ld2420/text_sensor/{text_sensor.h → ld2420_text_sensor.h} +0 -0
- /esphome/components/opentherm/number/{number.h → opentherm_number.h} +0 -0
- /esphome/components/opentherm/output/{output.h → opentherm_output.h} +0 -0
- /esphome/components/opentherm/switch/{switch.h → opentherm_switch.h} +0 -0
- {esphome-2025.8.4.dist-info → esphome-2025.9.0b2.dist-info}/WHEEL +0 -0
- {esphome-2025.8.4.dist-info → esphome-2025.9.0b2.dist-info}/entry_points.txt +0 -0
- {esphome-2025.8.4.dist-info → esphome-2025.9.0b2.dist-info}/licenses/LICENSE +0 -0
- {esphome-2025.8.4.dist-info → esphome-2025.9.0b2.dist-info}/top_level.txt +0 -0
@@ -3,7 +3,7 @@ import esphome.codegen as cg
|
|
3
3
|
from esphome.components.ota import BASE_OTA_SCHEMA, OTAComponent, ota_to_code
|
4
4
|
import esphome.config_validation as cv
|
5
5
|
from esphome.const import CONF_ID, CONF_PASSWORD, CONF_URL, CONF_USERNAME
|
6
|
-
from esphome.core import coroutine_with_priority
|
6
|
+
from esphome.core import CoroPriority, coroutine_with_priority
|
7
7
|
|
8
8
|
from .. import CONF_HTTP_REQUEST_ID, HttpRequestComponent, http_request_ns
|
9
9
|
|
@@ -40,7 +40,7 @@ CONFIG_SCHEMA = cv.All(
|
|
40
40
|
)
|
41
41
|
|
42
42
|
|
43
|
-
@coroutine_with_priority(
|
43
|
+
@coroutine_with_priority(CoroPriority.COMMUNICATION)
|
44
44
|
async def to_code(config):
|
45
45
|
var = cg.new_Pvariable(config[CONF_ID])
|
46
46
|
await ota_to_code(var, config)
|
@@ -18,7 +18,7 @@ from esphome.const import (
|
|
18
18
|
PLATFORM_RP2040,
|
19
19
|
PlatformFramework,
|
20
20
|
)
|
21
|
-
from esphome.core import CORE, coroutine_with_priority
|
21
|
+
from esphome.core import CORE, CoroPriority, coroutine_with_priority
|
22
22
|
import esphome.final_validate as fv
|
23
23
|
|
24
24
|
LOGGER = logging.getLogger(__name__)
|
@@ -74,7 +74,7 @@ CONFIG_SCHEMA = cv.All(
|
|
74
74
|
)
|
75
75
|
|
76
76
|
|
77
|
-
@coroutine_with_priority(
|
77
|
+
@coroutine_with_priority(CoroPriority.BUS)
|
78
78
|
async def to_code(config):
|
79
79
|
cg.add_global(i2c_ns.using)
|
80
80
|
cg.add_define("USE_I2C")
|
esphome/components/i2c/i2c.cpp
CHANGED
@@ -39,18 +39,22 @@ ErrorCode I2CDevice::read_register16(uint16_t a_register, uint8_t *data, size_t
|
|
39
39
|
}
|
40
40
|
|
41
41
|
ErrorCode I2CDevice::write_register(uint8_t a_register, const uint8_t *data, size_t len) const {
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
42
|
+
SmallBufferWithHeapFallback<17> buffer_alloc; // Most I2C writes are <= 16 bytes
|
43
|
+
uint8_t *buffer = buffer_alloc.get(len + 1);
|
44
|
+
|
45
|
+
buffer[0] = a_register;
|
46
|
+
std::copy(data, data + len, buffer + 1);
|
47
|
+
return this->bus_->write_readv(this->address_, buffer, len + 1, nullptr, 0);
|
46
48
|
}
|
47
49
|
|
48
50
|
ErrorCode I2CDevice::write_register16(uint16_t a_register, const uint8_t *data, size_t len) const {
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
51
|
+
SmallBufferWithHeapFallback<18> buffer_alloc; // Most I2C writes are <= 16 bytes + 2 for register
|
52
|
+
uint8_t *buffer = buffer_alloc.get(len + 2);
|
53
|
+
|
54
|
+
buffer[0] = a_register >> 8;
|
55
|
+
buffer[1] = a_register;
|
56
|
+
std::copy(data, data + len, buffer + 2);
|
57
|
+
return this->bus_->write_readv(this->address_, buffer, len + 2, nullptr, 0);
|
54
58
|
}
|
55
59
|
|
56
60
|
bool I2CDevice::read_bytes_16(uint8_t a_register, uint16_t *data, uint8_t len) {
|
esphome/components/i2c/i2c_bus.h
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
#include <cstddef>
|
3
3
|
#include <cstdint>
|
4
4
|
#include <cstring>
|
5
|
+
#include <memory>
|
5
6
|
#include <utility>
|
6
7
|
#include <vector>
|
7
8
|
|
@@ -10,6 +11,22 @@
|
|
10
11
|
namespace esphome {
|
11
12
|
namespace i2c {
|
12
13
|
|
14
|
+
/// @brief Helper class for efficient buffer allocation - uses stack for small sizes, heap for large
|
15
|
+
template<size_t STACK_SIZE> class SmallBufferWithHeapFallback {
|
16
|
+
public:
|
17
|
+
uint8_t *get(size_t size) {
|
18
|
+
if (size <= STACK_SIZE) {
|
19
|
+
return this->stack_buffer_;
|
20
|
+
}
|
21
|
+
this->heap_buffer_ = std::unique_ptr<uint8_t[]>(new uint8_t[size]);
|
22
|
+
return this->heap_buffer_.get();
|
23
|
+
}
|
24
|
+
|
25
|
+
private:
|
26
|
+
uint8_t stack_buffer_[STACK_SIZE];
|
27
|
+
std::unique_ptr<uint8_t[]> heap_buffer_;
|
28
|
+
};
|
29
|
+
|
13
30
|
/// @brief Error codes returned by I2CBus and I2CDevice methods
|
14
31
|
enum ErrorCode {
|
15
32
|
NO_ERROR = 0, ///< No error found during execution of method
|
@@ -74,14 +91,17 @@ class I2CBus {
|
|
74
91
|
for (size_t i = 0; i != count; i++) {
|
75
92
|
total_len += read_buffers[i].len;
|
76
93
|
}
|
77
|
-
|
78
|
-
|
94
|
+
|
95
|
+
SmallBufferWithHeapFallback<128> buffer_alloc; // Most I2C reads are small
|
96
|
+
uint8_t *buffer = buffer_alloc.get(total_len);
|
97
|
+
|
98
|
+
auto err = this->write_readv(address, nullptr, 0, buffer, total_len);
|
79
99
|
if (err != ERROR_OK)
|
80
100
|
return err;
|
81
101
|
size_t pos = 0;
|
82
102
|
for (size_t i = 0; i != count; i++) {
|
83
103
|
if (read_buffers[i].len != 0) {
|
84
|
-
std::memcpy(read_buffers[i].data, buffer
|
104
|
+
std::memcpy(read_buffers[i].data, buffer + pos, read_buffers[i].len);
|
85
105
|
pos += read_buffers[i].len;
|
86
106
|
}
|
87
107
|
}
|
@@ -91,11 +111,21 @@ class I2CBus {
|
|
91
111
|
ESPDEPRECATED("This method is deprecated and will be removed in ESPHome 2026.3.0. Use write_readv() instead.",
|
92
112
|
"2025.9.0")
|
93
113
|
ErrorCode writev(uint8_t address, const WriteBuffer *write_buffers, size_t count, bool stop = true) {
|
94
|
-
|
114
|
+
size_t total_len = 0;
|
95
115
|
for (size_t i = 0; i != count; i++) {
|
96
|
-
|
116
|
+
total_len += write_buffers[i].len;
|
97
117
|
}
|
98
|
-
|
118
|
+
|
119
|
+
SmallBufferWithHeapFallback<128> buffer_alloc; // Most I2C writes are small
|
120
|
+
uint8_t *buffer = buffer_alloc.get(total_len);
|
121
|
+
|
122
|
+
size_t pos = 0;
|
123
|
+
for (size_t i = 0; i != count; i++) {
|
124
|
+
std::memcpy(buffer + pos, write_buffers[i].data, write_buffers[i].len);
|
125
|
+
pos += write_buffers[i].len;
|
126
|
+
}
|
127
|
+
|
128
|
+
return this->write_readv(address, buffer, total_len, nullptr, 0);
|
99
129
|
}
|
100
130
|
|
101
131
|
protected:
|
@@ -4,6 +4,9 @@ from esphome.components.esp32 import add_idf_sdkconfig_option, get_esp32_variant
|
|
4
4
|
from esphome.components.esp32.const import (
|
5
5
|
VARIANT_ESP32,
|
6
6
|
VARIANT_ESP32C3,
|
7
|
+
VARIANT_ESP32C5,
|
8
|
+
VARIANT_ESP32C6,
|
9
|
+
VARIANT_ESP32H2,
|
7
10
|
VARIANT_ESP32P4,
|
8
11
|
VARIANT_ESP32S2,
|
9
12
|
VARIANT_ESP32S3,
|
@@ -62,12 +65,15 @@ I2S_ROLE_OPTIONS = {
|
|
62
65
|
CONF_SECONDARY: i2s_role_t.I2S_ROLE_SLAVE, # NOLINT
|
63
66
|
}
|
64
67
|
|
65
|
-
# https://github.com/espressif/esp-idf/blob/master/components/soc/{variant}/include/soc/soc_caps.h
|
68
|
+
# https://github.com/espressif/esp-idf/blob/master/components/soc/{variant}/include/soc/soc_caps.h (SOC_I2S_NUM)
|
66
69
|
I2S_PORTS = {
|
67
70
|
VARIANT_ESP32: 2,
|
68
71
|
VARIANT_ESP32S2: 1,
|
69
72
|
VARIANT_ESP32S3: 2,
|
70
73
|
VARIANT_ESP32C3: 1,
|
74
|
+
VARIANT_ESP32C5: 1,
|
75
|
+
VARIANT_ESP32C6: 1,
|
76
|
+
VARIANT_ESP32H2: 1,
|
71
77
|
VARIANT_ESP32P4: 3,
|
72
78
|
}
|
73
79
|
|
@@ -212,7 +218,7 @@ def validate_use_legacy(value):
|
|
212
218
|
f"All i2s_audio components must set {CONF_USE_LEGACY} to the same value."
|
213
219
|
)
|
214
220
|
if (not value[CONF_USE_LEGACY]) and (CORE.using_arduino):
|
215
|
-
raise cv.Invalid("Arduino supports only the legacy i2s driver
|
221
|
+
raise cv.Invalid("Arduino supports only the legacy i2s driver")
|
216
222
|
_use_legacy_driver = value[CONF_USE_LEGACY]
|
217
223
|
return value
|
218
224
|
|
@@ -92,7 +92,7 @@ CONFIG_SCHEMA = cv.All(
|
|
92
92
|
|
93
93
|
def _final_validate(_):
|
94
94
|
if not use_legacy():
|
95
|
-
raise cv.Invalid("I2S media player is only compatible with legacy i2s driver
|
95
|
+
raise cv.Invalid("I2S media player is only compatible with legacy i2s driver")
|
96
96
|
|
97
97
|
|
98
98
|
FINAL_VALIDATE_SCHEMA = _final_validate
|
@@ -122,7 +122,7 @@ CONFIG_SCHEMA = cv.All(
|
|
122
122
|
|
123
123
|
def _final_validate(config):
|
124
124
|
if not use_legacy() and config[CONF_ADC_TYPE] == "internal":
|
125
|
-
raise cv.Invalid("Internal ADC is only compatible with legacy i2s driver
|
125
|
+
raise cv.Invalid("Internal ADC is only compatible with legacy i2s driver")
|
126
126
|
|
127
127
|
|
128
128
|
FINAL_VALIDATE_SCHEMA = _final_validate
|
@@ -163,7 +163,7 @@ CONFIG_SCHEMA = cv.All(
|
|
163
163
|
def _final_validate(config):
|
164
164
|
if not use_legacy():
|
165
165
|
if config[CONF_DAC_TYPE] == "internal":
|
166
|
-
raise cv.Invalid("Internal DAC is only compatible with legacy i2s driver
|
166
|
+
raise cv.Invalid("Internal DAC is only compatible with legacy i2s driver")
|
167
167
|
if config[CONF_I2S_COMM_FMT] == "stand_max":
|
168
168
|
raise cv.Invalid(
|
169
169
|
"I2S standard max format only implemented with legacy i2s driver."
|
@@ -18,6 +18,7 @@ from esphome.const import (
|
|
18
18
|
DEVICE_CLASS_TEMPERATURE,
|
19
19
|
DEVICE_CLASS_VOLTAGE,
|
20
20
|
STATE_CLASS_MEASUREMENT,
|
21
|
+
STATE_CLASS_TOTAL_INCREASING,
|
21
22
|
UNIT_AMPERE,
|
22
23
|
UNIT_CELSIUS,
|
23
24
|
UNIT_VOLT,
|
@@ -162,7 +163,7 @@ INA2XX_SCHEMA = cv.Schema(
|
|
162
163
|
unit_of_measurement=UNIT_WATT_HOURS,
|
163
164
|
accuracy_decimals=8,
|
164
165
|
device_class=DEVICE_CLASS_ENERGY,
|
165
|
-
state_class=
|
166
|
+
state_class=STATE_CLASS_TOTAL_INCREASING,
|
166
167
|
),
|
167
168
|
key=CONF_NAME,
|
168
169
|
),
|
@@ -170,7 +171,8 @@ INA2XX_SCHEMA = cv.Schema(
|
|
170
171
|
sensor.sensor_schema(
|
171
172
|
unit_of_measurement=UNIT_JOULE,
|
172
173
|
accuracy_decimals=8,
|
173
|
-
|
174
|
+
device_class=DEVICE_CLASS_ENERGY,
|
175
|
+
state_class=STATE_CLASS_TOTAL_INCREASING,
|
174
176
|
),
|
175
177
|
key=CONF_NAME,
|
176
178
|
),
|
@@ -0,0 +1 @@
|
|
1
|
+
CODEOWNERS = ["@jesserockz", "@JosipKuci"]
|
@@ -0,0 +1,105 @@
|
|
1
|
+
WAVEFORMS = {
|
2
|
+
"inkplate_6": (
|
3
|
+
(0, 1, 1, 0, 0, 1, 1, 0, 0),
|
4
|
+
(0, 1, 2, 1, 1, 2, 1, 0, 0),
|
5
|
+
(1, 1, 1, 2, 2, 1, 0, 0, 0),
|
6
|
+
(0, 0, 0, 1, 1, 1, 2, 0, 0),
|
7
|
+
(2, 1, 1, 1, 2, 1, 2, 0, 0),
|
8
|
+
(2, 2, 1, 1, 2, 1, 2, 0, 0),
|
9
|
+
(1, 1, 1, 2, 1, 2, 2, 0, 0),
|
10
|
+
(0, 0, 0, 0, 0, 0, 2, 0, 0),
|
11
|
+
),
|
12
|
+
"inkplate_10": (
|
13
|
+
(0, 0, 0, 0, 0, 0, 0, 1, 0),
|
14
|
+
(0, 0, 0, 2, 2, 2, 1, 1, 0),
|
15
|
+
(0, 0, 2, 1, 1, 2, 2, 1, 0),
|
16
|
+
(0, 1, 2, 2, 1, 2, 2, 1, 0),
|
17
|
+
(0, 0, 2, 1, 2, 2, 2, 1, 0),
|
18
|
+
(0, 2, 2, 2, 2, 2, 2, 1, 0),
|
19
|
+
(0, 0, 0, 0, 0, 2, 1, 2, 0),
|
20
|
+
(0, 0, 0, 2, 2, 2, 2, 2, 0),
|
21
|
+
),
|
22
|
+
"inkplate_6_plus": (
|
23
|
+
(0, 0, 0, 0, 0, 2, 1, 1, 0),
|
24
|
+
(0, 0, 2, 1, 1, 1, 2, 1, 0),
|
25
|
+
(0, 2, 2, 2, 1, 1, 2, 1, 0),
|
26
|
+
(0, 0, 2, 2, 2, 1, 2, 1, 0),
|
27
|
+
(0, 0, 0, 0, 2, 2, 2, 1, 0),
|
28
|
+
(0, 0, 2, 1, 2, 1, 1, 2, 0),
|
29
|
+
(0, 0, 2, 2, 2, 1, 1, 2, 0),
|
30
|
+
(0, 0, 0, 0, 2, 2, 2, 2, 0),
|
31
|
+
),
|
32
|
+
"inkplate_6_v2": (
|
33
|
+
(1, 0, 1, 0, 1, 1, 1, 0, 0),
|
34
|
+
(0, 0, 0, 1, 1, 1, 1, 0, 0),
|
35
|
+
(1, 1, 1, 1, 0, 2, 1, 0, 0),
|
36
|
+
(1, 1, 1, 2, 2, 1, 1, 0, 0),
|
37
|
+
(1, 1, 1, 1, 2, 2, 1, 0, 0),
|
38
|
+
(0, 1, 1, 1, 2, 2, 1, 0, 0),
|
39
|
+
(0, 0, 0, 0, 1, 1, 2, 0, 0),
|
40
|
+
(0, 0, 0, 0, 0, 1, 2, 0, 0),
|
41
|
+
),
|
42
|
+
"inkplate_5": (
|
43
|
+
(0, 0, 1, 1, 0, 1, 1, 1, 0),
|
44
|
+
(0, 1, 1, 1, 1, 2, 0, 1, 0),
|
45
|
+
(1, 2, 2, 0, 2, 1, 1, 1, 0),
|
46
|
+
(1, 1, 1, 2, 0, 1, 1, 2, 0),
|
47
|
+
(0, 1, 1, 1, 2, 0, 1, 2, 0),
|
48
|
+
(0, 0, 0, 1, 1, 2, 1, 2, 0),
|
49
|
+
(1, 1, 1, 2, 0, 2, 1, 2, 0),
|
50
|
+
(0, 0, 0, 0, 0, 0, 0, 0, 0),
|
51
|
+
),
|
52
|
+
"inkplate_5_v2": (
|
53
|
+
(0, 0, 1, 1, 2, 1, 1, 1, 0),
|
54
|
+
(1, 1, 2, 2, 1, 2, 1, 1, 0),
|
55
|
+
(0, 1, 2, 2, 1, 1, 2, 1, 0),
|
56
|
+
(0, 0, 1, 1, 1, 1, 1, 2, 0),
|
57
|
+
(1, 2, 1, 2, 1, 1, 1, 2, 0),
|
58
|
+
(0, 1, 1, 1, 2, 0, 1, 2, 0),
|
59
|
+
(1, 1, 1, 2, 2, 2, 1, 2, 0),
|
60
|
+
(0, 0, 0, 0, 0, 0, 0, 0, 0),
|
61
|
+
),
|
62
|
+
}
|
63
|
+
|
64
|
+
INKPLATE_10_CUSTOM_WAVEFORMS = (
|
65
|
+
(
|
66
|
+
(0, 0, 0, 0, 0, 0, 0, 0, 0),
|
67
|
+
(0, 0, 0, 2, 1, 2, 1, 1, 0),
|
68
|
+
(0, 0, 0, 2, 2, 1, 2, 1, 0),
|
69
|
+
(0, 0, 2, 2, 1, 2, 2, 1, 0),
|
70
|
+
(0, 0, 0, 2, 1, 1, 1, 2, 0),
|
71
|
+
(0, 0, 2, 2, 2, 1, 1, 2, 0),
|
72
|
+
(0, 0, 0, 0, 0, 1, 2, 2, 0),
|
73
|
+
(0, 0, 0, 0, 2, 2, 2, 2, 0),
|
74
|
+
),
|
75
|
+
(
|
76
|
+
(0, 3, 3, 3, 3, 3, 3, 3, 0),
|
77
|
+
(0, 1, 2, 1, 1, 2, 2, 1, 0),
|
78
|
+
(0, 2, 2, 2, 1, 2, 2, 1, 0),
|
79
|
+
(0, 0, 2, 2, 2, 2, 2, 1, 0),
|
80
|
+
(0, 3, 3, 2, 1, 1, 1, 2, 0),
|
81
|
+
(0, 3, 3, 2, 2, 1, 1, 2, 0),
|
82
|
+
(0, 2, 1, 2, 1, 2, 1, 2, 0),
|
83
|
+
(0, 3, 3, 3, 2, 2, 2, 2, 0),
|
84
|
+
),
|
85
|
+
(
|
86
|
+
(0, 0, 0, 0, 0, 0, 0, 1, 0),
|
87
|
+
(0, 0, 0, 2, 2, 2, 1, 1, 0),
|
88
|
+
(0, 0, 2, 1, 1, 2, 2, 1, 0),
|
89
|
+
(1, 1, 2, 2, 1, 2, 2, 1, 0),
|
90
|
+
(0, 0, 2, 1, 2, 2, 2, 1, 0),
|
91
|
+
(0, 1, 2, 2, 2, 2, 2, 1, 0),
|
92
|
+
(0, 0, 0, 2, 2, 2, 1, 2, 0),
|
93
|
+
(0, 0, 0, 2, 2, 2, 2, 2, 0),
|
94
|
+
),
|
95
|
+
(
|
96
|
+
(0, 0, 0, 0, 0, 0, 0, 1, 0),
|
97
|
+
(0, 0, 0, 2, 2, 2, 1, 1, 0),
|
98
|
+
(2, 2, 2, 1, 0, 2, 1, 0, 0),
|
99
|
+
(2, 1, 1, 2, 1, 1, 1, 2, 0),
|
100
|
+
(2, 2, 2, 1, 1, 1, 0, 2, 0),
|
101
|
+
(2, 2, 2, 1, 1, 2, 1, 2, 0),
|
102
|
+
(0, 0, 0, 0, 2, 1, 2, 2, 0),
|
103
|
+
(0, 0, 0, 0, 2, 2, 2, 2, 0),
|
104
|
+
),
|
105
|
+
)
|
@@ -0,0 +1,238 @@
|
|
1
|
+
from esphome import pins
|
2
|
+
import esphome.codegen as cg
|
3
|
+
from esphome.components import display, i2c
|
4
|
+
from esphome.components.esp32 import CONF_CPU_FREQUENCY
|
5
|
+
import esphome.config_validation as cv
|
6
|
+
from esphome.const import (
|
7
|
+
CONF_FULL_UPDATE_EVERY,
|
8
|
+
CONF_ID,
|
9
|
+
CONF_LAMBDA,
|
10
|
+
CONF_MIRROR_X,
|
11
|
+
CONF_MIRROR_Y,
|
12
|
+
CONF_MODEL,
|
13
|
+
CONF_OE_PIN,
|
14
|
+
CONF_PAGES,
|
15
|
+
CONF_TRANSFORM,
|
16
|
+
CONF_WAKEUP_PIN,
|
17
|
+
PLATFORM_ESP32,
|
18
|
+
)
|
19
|
+
import esphome.final_validate as fv
|
20
|
+
|
21
|
+
from .const import INKPLATE_10_CUSTOM_WAVEFORMS, WAVEFORMS
|
22
|
+
|
23
|
+
DEPENDENCIES = ["i2c", "esp32"]
|
24
|
+
AUTO_LOAD = ["psram"]
|
25
|
+
|
26
|
+
CONF_DISPLAY_DATA_0_PIN = "display_data_0_pin"
|
27
|
+
CONF_DISPLAY_DATA_1_PIN = "display_data_1_pin"
|
28
|
+
CONF_DISPLAY_DATA_2_PIN = "display_data_2_pin"
|
29
|
+
CONF_DISPLAY_DATA_3_PIN = "display_data_3_pin"
|
30
|
+
CONF_DISPLAY_DATA_4_PIN = "display_data_4_pin"
|
31
|
+
CONF_DISPLAY_DATA_5_PIN = "display_data_5_pin"
|
32
|
+
CONF_DISPLAY_DATA_6_PIN = "display_data_6_pin"
|
33
|
+
CONF_DISPLAY_DATA_7_PIN = "display_data_7_pin"
|
34
|
+
|
35
|
+
CONF_CL_PIN = "cl_pin"
|
36
|
+
CONF_CKV_PIN = "ckv_pin"
|
37
|
+
CONF_GREYSCALE = "greyscale"
|
38
|
+
CONF_GMOD_PIN = "gmod_pin"
|
39
|
+
CONF_GPIO0_ENABLE_PIN = "gpio0_enable_pin"
|
40
|
+
CONF_LE_PIN = "le_pin"
|
41
|
+
CONF_PARTIAL_UPDATING = "partial_updating"
|
42
|
+
CONF_POWERUP_PIN = "powerup_pin"
|
43
|
+
CONF_SPH_PIN = "sph_pin"
|
44
|
+
CONF_SPV_PIN = "spv_pin"
|
45
|
+
CONF_VCOM_PIN = "vcom_pin"
|
46
|
+
|
47
|
+
inkplate_ns = cg.esphome_ns.namespace("inkplate")
|
48
|
+
Inkplate = inkplate_ns.class_(
|
49
|
+
"Inkplate",
|
50
|
+
cg.PollingComponent,
|
51
|
+
i2c.I2CDevice,
|
52
|
+
display.Display,
|
53
|
+
display.DisplayBuffer,
|
54
|
+
)
|
55
|
+
|
56
|
+
InkplateModel = inkplate_ns.enum("InkplateModel")
|
57
|
+
|
58
|
+
MODELS = {
|
59
|
+
"inkplate_6": InkplateModel.INKPLATE_6,
|
60
|
+
"inkplate_10": InkplateModel.INKPLATE_10,
|
61
|
+
"inkplate_6_plus": InkplateModel.INKPLATE_6_PLUS,
|
62
|
+
"inkplate_6_v2": InkplateModel.INKPLATE_6_V2,
|
63
|
+
"inkplate_5": InkplateModel.INKPLATE_5,
|
64
|
+
"inkplate_5_v2": InkplateModel.INKPLATE_5_V2,
|
65
|
+
}
|
66
|
+
|
67
|
+
CONF_CUSTOM_WAVEFORM = "custom_waveform"
|
68
|
+
|
69
|
+
|
70
|
+
def _validate_custom_waveform(config):
|
71
|
+
if CONF_CUSTOM_WAVEFORM in config and config[CONF_MODEL] != "inkplate_10":
|
72
|
+
raise cv.Invalid("Custom waveforms are only supported on the Inkplate 10")
|
73
|
+
return config
|
74
|
+
|
75
|
+
|
76
|
+
CONFIG_SCHEMA = cv.All(
|
77
|
+
display.FULL_DISPLAY_SCHEMA.extend(
|
78
|
+
{
|
79
|
+
cv.GenerateID(): cv.declare_id(Inkplate),
|
80
|
+
cv.Optional(CONF_GREYSCALE, default=False): cv.boolean,
|
81
|
+
cv.Optional(CONF_CUSTOM_WAVEFORM): cv.All(
|
82
|
+
cv.uint8_t, cv.Range(min=1, max=len(INKPLATE_10_CUSTOM_WAVEFORMS))
|
83
|
+
),
|
84
|
+
cv.Optional(CONF_TRANSFORM): cv.Schema(
|
85
|
+
{
|
86
|
+
cv.Optional(CONF_MIRROR_X, default=False): cv.boolean,
|
87
|
+
cv.Optional(CONF_MIRROR_Y, default=False): cv.boolean,
|
88
|
+
}
|
89
|
+
),
|
90
|
+
cv.Optional(CONF_PARTIAL_UPDATING, default=True): cv.boolean,
|
91
|
+
cv.Optional(CONF_FULL_UPDATE_EVERY, default=10): cv.uint32_t,
|
92
|
+
cv.Optional(CONF_MODEL, default="inkplate_6"): cv.enum(
|
93
|
+
MODELS, lower=True, space="_"
|
94
|
+
),
|
95
|
+
# Control pins
|
96
|
+
cv.Required(CONF_CKV_PIN): pins.gpio_output_pin_schema,
|
97
|
+
cv.Required(CONF_GMOD_PIN): pins.gpio_output_pin_schema,
|
98
|
+
cv.Required(CONF_GPIO0_ENABLE_PIN): pins.gpio_output_pin_schema,
|
99
|
+
cv.Required(CONF_OE_PIN): pins.gpio_output_pin_schema,
|
100
|
+
cv.Required(CONF_POWERUP_PIN): pins.gpio_output_pin_schema,
|
101
|
+
cv.Required(CONF_SPH_PIN): pins.gpio_output_pin_schema,
|
102
|
+
cv.Required(CONF_SPV_PIN): pins.gpio_output_pin_schema,
|
103
|
+
cv.Required(CONF_VCOM_PIN): pins.gpio_output_pin_schema,
|
104
|
+
cv.Required(CONF_WAKEUP_PIN): pins.gpio_output_pin_schema,
|
105
|
+
cv.Optional(CONF_CL_PIN, default=0): pins.internal_gpio_output_pin_schema,
|
106
|
+
cv.Optional(CONF_LE_PIN, default=2): pins.internal_gpio_output_pin_schema,
|
107
|
+
# Data pins
|
108
|
+
cv.Optional(
|
109
|
+
CONF_DISPLAY_DATA_0_PIN, default=4
|
110
|
+
): pins.internal_gpio_output_pin_schema,
|
111
|
+
cv.Optional(
|
112
|
+
CONF_DISPLAY_DATA_1_PIN, default=5
|
113
|
+
): pins.internal_gpio_output_pin_schema,
|
114
|
+
cv.Optional(
|
115
|
+
CONF_DISPLAY_DATA_2_PIN, default=18
|
116
|
+
): pins.internal_gpio_output_pin_schema,
|
117
|
+
cv.Optional(
|
118
|
+
CONF_DISPLAY_DATA_3_PIN, default=19
|
119
|
+
): pins.internal_gpio_output_pin_schema,
|
120
|
+
cv.Optional(
|
121
|
+
CONF_DISPLAY_DATA_4_PIN, default=23
|
122
|
+
): pins.internal_gpio_output_pin_schema,
|
123
|
+
cv.Optional(
|
124
|
+
CONF_DISPLAY_DATA_5_PIN, default=25
|
125
|
+
): pins.internal_gpio_output_pin_schema,
|
126
|
+
cv.Optional(
|
127
|
+
CONF_DISPLAY_DATA_6_PIN, default=26
|
128
|
+
): pins.internal_gpio_output_pin_schema,
|
129
|
+
cv.Optional(
|
130
|
+
CONF_DISPLAY_DATA_7_PIN, default=27
|
131
|
+
): pins.internal_gpio_output_pin_schema,
|
132
|
+
}
|
133
|
+
)
|
134
|
+
.extend(cv.polling_component_schema("5s"))
|
135
|
+
.extend(i2c.i2c_device_schema(0x48)),
|
136
|
+
cv.has_at_most_one_key(CONF_PAGES, CONF_LAMBDA),
|
137
|
+
_validate_custom_waveform,
|
138
|
+
)
|
139
|
+
|
140
|
+
|
141
|
+
def _validate_cpu_frequency(config):
|
142
|
+
esp32_config = fv.full_config.get()[PLATFORM_ESP32]
|
143
|
+
if esp32_config[CONF_CPU_FREQUENCY] != "240MHZ":
|
144
|
+
raise cv.Invalid(
|
145
|
+
"Inkplate requires 240MHz CPU frequency (set in esp32 component)"
|
146
|
+
)
|
147
|
+
return config
|
148
|
+
|
149
|
+
|
150
|
+
FINAL_VALIDATE_SCHEMA = _validate_cpu_frequency
|
151
|
+
|
152
|
+
|
153
|
+
async def to_code(config):
|
154
|
+
var = cg.new_Pvariable(config[CONF_ID])
|
155
|
+
|
156
|
+
await display.register_display(var, config)
|
157
|
+
await i2c.register_i2c_device(var, config)
|
158
|
+
|
159
|
+
if CONF_LAMBDA in config:
|
160
|
+
lambda_ = await cg.process_lambda(
|
161
|
+
config[CONF_LAMBDA], [(display.DisplayRef, "it")], return_type=cg.void
|
162
|
+
)
|
163
|
+
cg.add(var.set_writer(lambda_))
|
164
|
+
|
165
|
+
cg.add(var.set_greyscale(config[CONF_GREYSCALE]))
|
166
|
+
if transform := config.get(CONF_TRANSFORM):
|
167
|
+
cg.add(var.set_mirror_x(transform[CONF_MIRROR_X]))
|
168
|
+
cg.add(var.set_mirror_y(transform[CONF_MIRROR_Y]))
|
169
|
+
cg.add(var.set_partial_updating(config[CONF_PARTIAL_UPDATING]))
|
170
|
+
cg.add(var.set_full_update_every(config[CONF_FULL_UPDATE_EVERY]))
|
171
|
+
|
172
|
+
cg.add(var.set_model(config[CONF_MODEL]))
|
173
|
+
|
174
|
+
if custom_waveform := config.get(CONF_CUSTOM_WAVEFORM):
|
175
|
+
waveform = INKPLATE_10_CUSTOM_WAVEFORMS[custom_waveform - 1]
|
176
|
+
waveform = [element for tupl in waveform for element in tupl]
|
177
|
+
cg.add(var.set_waveform(waveform, True))
|
178
|
+
else:
|
179
|
+
waveform = WAVEFORMS[config[CONF_MODEL]]
|
180
|
+
waveform = [element for tupl in waveform for element in tupl]
|
181
|
+
cg.add(var.set_waveform(waveform, False))
|
182
|
+
|
183
|
+
ckv = await cg.gpio_pin_expression(config[CONF_CKV_PIN])
|
184
|
+
cg.add(var.set_ckv_pin(ckv))
|
185
|
+
|
186
|
+
gmod = await cg.gpio_pin_expression(config[CONF_GMOD_PIN])
|
187
|
+
cg.add(var.set_gmod_pin(gmod))
|
188
|
+
|
189
|
+
gpio0_enable = await cg.gpio_pin_expression(config[CONF_GPIO0_ENABLE_PIN])
|
190
|
+
cg.add(var.set_gpio0_enable_pin(gpio0_enable))
|
191
|
+
|
192
|
+
oe = await cg.gpio_pin_expression(config[CONF_OE_PIN])
|
193
|
+
cg.add(var.set_oe_pin(oe))
|
194
|
+
|
195
|
+
powerup = await cg.gpio_pin_expression(config[CONF_POWERUP_PIN])
|
196
|
+
cg.add(var.set_powerup_pin(powerup))
|
197
|
+
|
198
|
+
sph = await cg.gpio_pin_expression(config[CONF_SPH_PIN])
|
199
|
+
cg.add(var.set_sph_pin(sph))
|
200
|
+
|
201
|
+
spv = await cg.gpio_pin_expression(config[CONF_SPV_PIN])
|
202
|
+
cg.add(var.set_spv_pin(spv))
|
203
|
+
|
204
|
+
vcom = await cg.gpio_pin_expression(config[CONF_VCOM_PIN])
|
205
|
+
cg.add(var.set_vcom_pin(vcom))
|
206
|
+
|
207
|
+
wakeup = await cg.gpio_pin_expression(config[CONF_WAKEUP_PIN])
|
208
|
+
cg.add(var.set_wakeup_pin(wakeup))
|
209
|
+
|
210
|
+
cl = await cg.gpio_pin_expression(config[CONF_CL_PIN])
|
211
|
+
cg.add(var.set_cl_pin(cl))
|
212
|
+
|
213
|
+
le = await cg.gpio_pin_expression(config[CONF_LE_PIN])
|
214
|
+
cg.add(var.set_le_pin(le))
|
215
|
+
|
216
|
+
display_data_0 = await cg.gpio_pin_expression(config[CONF_DISPLAY_DATA_0_PIN])
|
217
|
+
cg.add(var.set_display_data_0_pin(display_data_0))
|
218
|
+
|
219
|
+
display_data_1 = await cg.gpio_pin_expression(config[CONF_DISPLAY_DATA_1_PIN])
|
220
|
+
cg.add(var.set_display_data_1_pin(display_data_1))
|
221
|
+
|
222
|
+
display_data_2 = await cg.gpio_pin_expression(config[CONF_DISPLAY_DATA_2_PIN])
|
223
|
+
cg.add(var.set_display_data_2_pin(display_data_2))
|
224
|
+
|
225
|
+
display_data_3 = await cg.gpio_pin_expression(config[CONF_DISPLAY_DATA_3_PIN])
|
226
|
+
cg.add(var.set_display_data_3_pin(display_data_3))
|
227
|
+
|
228
|
+
display_data_4 = await cg.gpio_pin_expression(config[CONF_DISPLAY_DATA_4_PIN])
|
229
|
+
cg.add(var.set_display_data_4_pin(display_data_4))
|
230
|
+
|
231
|
+
display_data_5 = await cg.gpio_pin_expression(config[CONF_DISPLAY_DATA_5_PIN])
|
232
|
+
cg.add(var.set_display_data_5_pin(display_data_5))
|
233
|
+
|
234
|
+
display_data_6 = await cg.gpio_pin_expression(config[CONF_DISPLAY_DATA_6_PIN])
|
235
|
+
cg.add(var.set_display_data_6_pin(display_data_6))
|
236
|
+
|
237
|
+
display_data_7 = await cg.gpio_pin_expression(config[CONF_DISPLAY_DATA_7_PIN])
|
238
|
+
cg.add(var.set_display_data_7_pin(display_data_7))
|