esphome 2024.7.3__py3-none-any.whl → 2024.8.0__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 +15 -81
- esphome/automation.py +1 -1
- esphome/codegen.py +53 -53
- esphome/components/ade7953/sensor.py +1 -1
- esphome/components/ade7953_spi/ade7953_spi.cpp +1 -1
- esphome/components/airthings_wave_plus/airthings_wave_plus.cpp +5 -2
- esphome/components/airthings_wave_plus/airthings_wave_plus.h +2 -0
- esphome/components/airthings_wave_plus/sensor.py +12 -0
- esphome/components/alarm_control_panel/__init__.py +75 -66
- esphome/components/apds9306/__init__.py +4 -0
- esphome/components/apds9306/apds9306.cpp +151 -0
- esphome/components/apds9306/apds9306.h +66 -0
- esphome/components/apds9306/sensor.py +95 -0
- esphome/components/api/__init__.py +80 -52
- esphome/components/api/api_connection.cpp +14 -1
- esphome/components/api/api_pb2.cpp +33 -4
- esphome/components/api/api_pb2.h +8 -1
- esphome/components/api/api_server.cpp +10 -0
- esphome/components/api/api_server.h +3 -0
- esphome/components/atm90e32/__init__.py +7 -0
- esphome/components/atm90e32/atm90e32.cpp +68 -16
- esphome/components/atm90e32/atm90e32.h +20 -7
- esphome/components/atm90e32/atm90e32_reg.h +2 -0
- esphome/components/atm90e32/button/__init__.py +43 -0
- esphome/components/atm90e32/button/atm90e32_button.cpp +20 -0
- esphome/components/atm90e32/button/atm90e32_button.h +27 -0
- esphome/components/atm90e32/sensor.py +15 -11
- esphome/components/bedjet/bedjet_codec.h +1 -1
- esphome/components/binary/light/binary_light_output.h +3 -2
- esphome/components/binary_sensor/__init__.py +5 -5
- esphome/components/ble_client/__init__.py +3 -3
- esphome/components/ble_client/output/__init__.py +1 -1
- esphome/components/ble_client/sensor/__init__.py +4 -3
- esphome/components/ble_client/switch/__init__.py +2 -1
- esphome/components/ble_client/text_sensor/__init__.py +4 -3
- esphome/components/ble_presence/binary_sensor.py +3 -3
- esphome/components/ble_rssi/sensor.py +2 -2
- esphome/components/ble_scanner/text_sensor.py +1 -1
- esphome/components/bluetooth_proxy/__init__.py +3 -3
- esphome/components/bme68x_bsec2/__init__.py +196 -0
- esphome/components/bme68x_bsec2/bme68x_bsec2.cpp +523 -0
- esphome/components/bme68x_bsec2/bme68x_bsec2.h +163 -0
- esphome/components/bme68x_bsec2/sensor.py +130 -0
- esphome/components/bme68x_bsec2/text_sensor.py +33 -0
- esphome/components/bme68x_bsec2_i2c/__init__.py +28 -0
- esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.cpp +53 -0
- esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.h +28 -0
- esphome/components/bmp3xx/sensor.py +1 -1
- esphome/components/button/__init__.py +4 -4
- esphome/components/climate/__init__.py +5 -5
- esphome/components/climate/climate.h +1 -1
- esphome/components/cover/__init__.py +8 -8
- esphome/components/cst226/touchscreen/cst226_touchscreen.cpp +11 -7
- esphome/components/cst226/touchscreen/cst226_touchscreen.h +1 -1
- esphome/components/datetime/__init__.py +11 -13
- esphome/components/demo/demo_sensor.h +3 -2
- esphome/components/display/display.cpp +31 -0
- esphome/components/display/display.h +3 -0
- esphome/components/display_menu_base/__init__.py +14 -13
- esphome/components/ens160/sensor.py +1 -1
- esphome/components/esp32/__init__.py +22 -10
- esphome/components/esp32/boards.py +1 -1
- esphome/components/esp32/gpio.py +12 -13
- esphome/components/esp32/gpio_esp32.py +1 -2
- esphome/components/esp32/gpio_esp32_c2.py +1 -2
- esphome/components/esp32/gpio_esp32_c3.py +1 -5
- esphome/components/esp32/gpio_esp32_c6.py +1 -2
- esphome/components/esp32/gpio_esp32_h2.py +1 -2
- esphome/components/esp32/gpio_esp32_s2.py +1 -2
- esphome/components/esp32/gpio_esp32_s3.py +1 -6
- esphome/components/esp32_ble/__init__.py +20 -3
- esphome/components/esp32_ble/ble.cpp +9 -1
- esphome/components/esp32_ble/ble.h +9 -0
- esphome/components/esp32_ble/ble_advertising.cpp +42 -9
- esphome/components/esp32_ble/ble_advertising.h +21 -1
- esphome/components/esp32_ble_beacon/__init__.py +17 -7
- esphome/components/esp32_ble_beacon/esp32_ble_beacon.cpp +45 -113
- esphome/components/esp32_ble_beacon/esp32_ble_beacon.h +17 -19
- esphome/components/esp32_ble_client/__init__.py +0 -1
- esphome/components/esp32_ble_server/__init__.py +2 -3
- esphome/components/esp32_ble_tracker/__init__.py +2 -2
- esphome/components/esp32_improv/__init__.py +2 -4
- esphome/components/ethernet/__init__.py +17 -17
- esphome/components/ethernet_info/text_sensor.py +2 -2
- esphome/components/event/__init__.py +5 -5
- esphome/components/fan/__init__.py +14 -14
- esphome/components/fan/fan.cpp +2 -2
- esphome/components/fingerprint_grow/fingerprint_grow.cpp +1 -1
- esphome/components/fingerprint_grow/fingerprint_grow.h +1 -1
- esphome/components/graphical_display_menu/__init__.py +11 -8
- esphome/components/haier/haier_base.h +2 -2
- esphome/components/homeassistant/__init__.py +8 -1
- esphome/components/homeassistant/number/__init__.py +33 -0
- esphome/components/homeassistant/number/homeassistant_number.cpp +100 -0
- esphome/components/homeassistant/number/homeassistant_number.h +31 -0
- esphome/components/homeassistant/switch/__init__.py +30 -0
- esphome/components/homeassistant/switch/homeassistant_switch.cpp +59 -0
- esphome/components/homeassistant/switch/homeassistant_switch.h +22 -0
- esphome/components/host/__init__.py +3 -7
- esphome/components/http_request/__init__.py +12 -1
- esphome/components/http_request/http_request_arduino.cpp +2 -2
- esphome/components/http_request/http_request_idf.cpp +11 -2
- esphome/components/http_request/http_request_idf.h +10 -0
- esphome/components/http_request/ota/ota_http_request.cpp +1 -1
- esphome/components/http_request/update/http_request_update.cpp +2 -2
- esphome/components/http_request/update/http_request_update.h +2 -1
- esphome/components/hx711/hx711.cpp +10 -1
- esphome/components/hydreon_rgxx/hydreon_rgxx.cpp +1 -1
- esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp +11 -2
- esphome/components/i2s_audio/speaker/i2s_audio_speaker.h +2 -0
- esphome/components/ili9xxx/ili9xxx_defines.h +3 -1
- esphome/components/ili9xxx/ili9xxx_display.cpp +9 -22
- esphome/components/ili9xxx/ili9xxx_display.h +5 -7
- esphome/components/ili9xxx/ili9xxx_init.h +4 -4
- esphome/components/improv_base/__init__.py +2 -3
- esphome/components/improv_serial/__init__.py +4 -10
- esphome/components/improv_serial/improv_serial_component.cpp +4 -0
- esphome/components/jsn_sr04t/jsn_sr04t.cpp +18 -1
- esphome/components/jsn_sr04t/jsn_sr04t.h +7 -1
- esphome/components/jsn_sr04t/sensor.py +13 -0
- esphome/components/kalman_combinator/sensor.py +1 -1
- esphome/components/light/__init__.py +16 -15
- esphome/components/light/addressable_light_effect.h +12 -8
- esphome/components/light/automation.h +16 -1
- esphome/components/light/automation.py +21 -0
- esphome/components/light/base_light_effects.h +5 -5
- esphome/components/light/esp_color_correction.h +8 -8
- esphome/components/light/types.py +7 -0
- esphome/components/lock/__init__.py +3 -3
- esphome/components/logger/__init__.py +15 -18
- esphome/components/lvgl/__init__.py +346 -0
- esphome/components/lvgl/automation.py +226 -0
- esphome/components/lvgl/binary_sensor/__init__.py +43 -0
- esphome/components/lvgl/defines.py +508 -0
- esphome/components/lvgl/encoders.py +77 -0
- esphome/components/lvgl/font.cpp +76 -0
- esphome/components/lvgl/helpers.py +49 -0
- esphome/components/lvgl/light/__init__.py +32 -0
- esphome/components/lvgl/light/lvgl_light.h +48 -0
- esphome/components/lvgl/lv_validation.py +303 -0
- esphome/components/lvgl/lvcode.py +349 -0
- esphome/components/lvgl/lvgl_esphome.cpp +407 -0
- esphome/components/lvgl/lvgl_esphome.h +274 -0
- esphome/components/lvgl/lvgl_hal.h +21 -0
- esphome/components/lvgl/number/__init__.py +66 -0
- esphome/components/lvgl/number/lvgl_number.h +34 -0
- esphome/components/lvgl/schemas.py +436 -0
- esphome/components/lvgl/select/__init__.py +55 -0
- esphome/components/lvgl/select/lvgl_select.h +62 -0
- esphome/components/lvgl/sensor/__init__.py +47 -0
- esphome/components/lvgl/styles.py +58 -0
- esphome/components/lvgl/switch/__init__.py +56 -0
- esphome/components/lvgl/switch/lvgl_switch.h +34 -0
- esphome/components/lvgl/text/__init__.py +50 -0
- esphome/components/lvgl/text/lvgl_text.h +34 -0
- esphome/components/lvgl/text_sensor/__init__.py +42 -0
- esphome/components/lvgl/touchscreens.py +45 -0
- esphome/components/lvgl/trigger.py +74 -0
- esphome/components/lvgl/types.py +191 -0
- esphome/components/lvgl/widgets/__init__.py +419 -0
- esphome/components/lvgl/widgets/animimg.py +117 -0
- esphome/components/lvgl/widgets/arc.py +78 -0
- esphome/components/lvgl/widgets/button.py +20 -0
- esphome/components/lvgl/widgets/buttonmatrix.py +275 -0
- esphome/components/lvgl/widgets/checkbox.py +27 -0
- esphome/components/lvgl/widgets/dropdown.py +76 -0
- esphome/components/lvgl/widgets/img.py +85 -0
- esphome/components/lvgl/widgets/keyboard.py +49 -0
- esphome/components/lvgl/widgets/label.py +42 -0
- esphome/components/lvgl/widgets/led.py +29 -0
- esphome/components/lvgl/widgets/line.py +50 -0
- esphome/components/lvgl/widgets/lv_bar.py +55 -0
- esphome/components/lvgl/widgets/meter.py +302 -0
- esphome/components/lvgl/widgets/msgbox.py +134 -0
- esphome/components/lvgl/widgets/obj.py +28 -0
- esphome/components/lvgl/widgets/page.py +113 -0
- esphome/components/lvgl/widgets/roller.py +77 -0
- esphome/components/lvgl/widgets/slider.py +63 -0
- esphome/components/lvgl/widgets/spinbox.py +178 -0
- esphome/components/lvgl/widgets/spinner.py +43 -0
- esphome/components/lvgl/widgets/switch.py +20 -0
- esphome/components/lvgl/widgets/tabview.py +114 -0
- esphome/components/lvgl/widgets/textarea.py +66 -0
- esphome/components/lvgl/widgets/tileview.py +128 -0
- esphome/components/m5stack_8angle/__init__.py +33 -0
- esphome/components/m5stack_8angle/binary_sensor/__init__.py +30 -0
- esphome/components/m5stack_8angle/binary_sensor/m5stack_8angle_binary_sensor.cpp +17 -0
- esphome/components/m5stack_8angle/binary_sensor/m5stack_8angle_binary_sensor.h +19 -0
- esphome/components/m5stack_8angle/light/__init__.py +31 -0
- esphome/components/m5stack_8angle/light/m5stack_8angle_light.cpp +45 -0
- esphome/components/m5stack_8angle/light/m5stack_8angle_light.h +37 -0
- esphome/components/m5stack_8angle/m5stack_8angle.cpp +74 -0
- esphome/components/m5stack_8angle/m5stack_8angle.h +34 -0
- esphome/components/m5stack_8angle/sensor/__init__.py +66 -0
- esphome/components/m5stack_8angle/sensor/m5stack_8angle_sensor.cpp +24 -0
- esphome/components/m5stack_8angle/sensor/m5stack_8angle_sensor.h +27 -0
- esphome/components/matrix_keypad/matrix_keypad.cpp +2 -0
- esphome/components/max31856/sensor.py +5 -5
- esphome/components/media_player/__init__.py +3 -5
- esphome/components/media_player/automation.h +31 -27
- esphome/components/micro_wake_word/__init__.py +20 -25
- esphome/components/microphone/microphone.h +4 -1
- esphome/components/modbus_controller/__init__.py +26 -2
- esphome/components/modbus_controller/automation.h +19 -0
- esphome/components/modbus_controller/const.py +1 -0
- esphome/components/modbus_controller/modbus_controller.cpp +8 -0
- esphome/components/modbus_controller/modbus_controller.h +3 -0
- esphome/components/mqtt/__init__.py +20 -9
- esphome/components/mqtt/mqtt_alarm_control_panel.cpp +128 -0
- esphome/components/mqtt/mqtt_alarm_control_panel.h +39 -0
- esphome/components/mqtt/mqtt_backend.h +3 -1
- esphome/components/mqtt/mqtt_backend_esp32.cpp +4 -1
- esphome/components/mqtt/mqtt_backend_esp32.h +3 -1
- esphome/components/mqtt/mqtt_backend_esp8266.h +3 -1
- esphome/components/mqtt/mqtt_backend_libretiny.h +3 -1
- esphome/components/mqtt/mqtt_client.cpp +16 -3
- esphome/components/mqtt/mqtt_client.h +5 -1
- esphome/components/mqtt/mqtt_component.cpp +32 -4
- esphome/components/mqtt/mqtt_const.h +2 -0
- esphome/components/network/__init__.py +15 -12
- esphome/components/network/ip_address.h +3 -0
- esphome/components/network/util.cpp +2 -1
- esphome/components/network/util.h +3 -1
- esphome/components/nextion/base_component.py +5 -8
- esphome/components/number/__init__.py +7 -8
- esphome/components/online_image/__init__.py +167 -0
- esphome/components/online_image/image_decoder.cpp +44 -0
- esphome/components/online_image/image_decoder.h +112 -0
- esphome/components/online_image/online_image.cpp +283 -0
- esphome/components/online_image/online_image.h +195 -0
- esphome/components/online_image/png_image.cpp +68 -0
- esphome/components/online_image/png_image.h +33 -0
- esphome/components/ota/__init__.py +8 -4
- esphome/components/pid/pid_climate.h +2 -0
- esphome/components/remote_base/pronto_protocol.cpp +0 -3
- esphome/components/remote_transmitter/remote_transmitter.h +1 -1
- esphome/components/rgbct/rgbct_light_output.h +3 -2
- esphome/components/rgbw/rgbw_light_output.h +3 -2
- esphome/components/rgbww/rgbww_light_output.h +3 -2
- esphome/components/rp2040_pio_led_strip/led_strip.cpp +31 -5
- esphome/components/rp2040_pio_led_strip/led_strip.h +5 -0
- esphome/components/rtttl/rtttl.cpp +108 -21
- esphome/components/rtttl/rtttl.h +15 -6
- esphome/components/select/__init__.py +7 -7
- esphome/components/sensor/__init__.py +29 -10
- esphome/components/sensor/filter.cpp +8 -0
- esphome/components/sensor/filter.h +9 -0
- esphome/components/sml/sml_parser.cpp +48 -22
- esphome/components/socket/socket.cpp +11 -14
- esphome/components/speaker/__init__.py +14 -5
- esphome/components/speaker/automation.h +10 -0
- esphome/components/speaker/speaker.h +9 -0
- esphome/components/spi/spi.cpp +0 -6
- esphome/components/spi/spi.h +2 -19
- esphome/components/spi_led_strip/spi_led_strip.h +5 -4
- esphome/components/sprinkler/sprinkler.cpp +2 -2
- esphome/components/sprinkler/sprinkler.h +1 -1
- esphome/components/switch/__init__.py +3 -3
- esphome/components/text/__init__.py +5 -5
- esphome/components/text_sensor/__init__.py +7 -7
- esphome/components/time/__init__.py +8 -8
- esphome/components/touchscreen/binary_sensor/__init__.py +24 -10
- esphome/components/touchscreen/binary_sensor/touchscreen_binary_sensor.cpp +3 -2
- esphome/components/touchscreen/binary_sensor/touchscreen_binary_sensor.h +4 -2
- esphome/components/uart/uart_component_host.cpp +6 -2
- esphome/components/update/__init__.py +33 -15
- esphome/components/update/automation.h +23 -0
- esphome/components/update/update_entity.h +3 -1
- esphome/components/valve/__init__.py +3 -3
- esphome/components/voice_assistant/__init__.py +7 -8
- esphome/components/wake_on_lan/wake_on_lan.cpp +2 -0
- esphome/components/wake_on_lan/wake_on_lan.h +3 -1
- esphome/components/watchdog/__init__.py +1 -0
- esphome/components/{http_request → watchdog}/watchdog.cpp +0 -2
- esphome/components/{http_request → watchdog}/watchdog.h +0 -2
- esphome/components/waveshare_epaper/waveshare_epaper.cpp +5 -5
- esphome/components/web_server/server_index_v3.h +3615 -3603
- esphome/components/web_server/web_server.cpp +0 -209
- esphome/components/web_server/web_server.h +1 -1
- esphome/components/web_server/web_server_v1.cpp +217 -0
- esphome/components/web_server_base/web_server_base.h +1 -0
- esphome/components/wifi/__init__.py +15 -14
- esphome/components/wifi/wifi_component.cpp +2 -0
- esphome/components/wifi/wifi_component.h +7 -1
- esphome/components/wifi/wifi_component_esp32_arduino.cpp +5 -2
- esphome/components/wifi/wifi_component_esp8266.cpp +2 -0
- esphome/components/wifi/wifi_component_esp_idf.cpp +43 -7
- esphome/components/wifi/wifi_component_libretiny.cpp +2 -0
- esphome/components/wifi/wifi_component_pico_w.cpp +2 -0
- esphome/components/wifi/wpa2_eap.py +6 -7
- esphome/components/wifi_info/text_sensor.py +3 -3
- esphome/components/wifi_info/wifi_info_text_sensor.cpp +2 -0
- esphome/components/wifi_info/wifi_info_text_sensor.h +2 -0
- esphome/components/wifi_signal/sensor.py +1 -1
- esphome/components/wifi_signal/wifi_signal_sensor.cpp +2 -0
- esphome/components/wifi_signal/wifi_signal_sensor.h +2 -1
- esphome/components/xiaomi_ble/xiaomi_ble.cpp +20 -3
- esphome/components/xiaomi_ble/xiaomi_ble.h +1 -0
- esphome/components/xiaomi_lywsd02mmc/__init__.py +0 -0
- esphome/components/xiaomi_lywsd02mmc/sensor.py +77 -0
- esphome/components/xiaomi_lywsd02mmc/xiaomi_lywsd02mmc.cpp +73 -0
- esphome/components/xiaomi_lywsd02mmc/xiaomi_lywsd02mmc.h +37 -0
- esphome/config.py +17 -19
- esphome/config_validation.py +55 -23
- esphome/const.py +25 -9
- esphome/core/__init__.py +17 -14
- esphome/core/application.h +42 -21
- esphome/core/automation.h +5 -3
- esphome/core/base_automation.h +3 -2
- esphome/core/bytebuffer.cpp +134 -0
- esphome/core/bytebuffer.h +96 -0
- esphome/core/color.h +24 -16
- esphome/core/config.py +3 -3
- esphome/core/defines.h +14 -1
- esphome/core/entity_base.h +2 -2
- esphome/core/entity_helpers.py +1 -2
- esphome/core/gpio.h +0 -18
- esphome/core/helpers.h +1 -1
- esphome/core/optional.h +15 -16
- esphome/coroutine.py +1 -1
- esphome/cpp_generator.py +1 -1
- esphome/cpp_helpers.py +3 -5
- esphome/dashboard/core.py +3 -3
- esphome/dashboard/dashboard.py +3 -3
- esphome/dashboard/entries.py +1 -1
- esphome/dashboard/util/file.py +1 -1
- esphome/dashboard/web_server.py +3 -3
- esphome/external_files.py +5 -3
- esphome/final_validate.py +2 -2
- esphome/git.py +4 -4
- esphome/helpers.py +5 -5
- esphome/loader.py +15 -10
- esphome/mqtt.py +4 -8
- esphome/pins.py +6 -6
- esphome/platformio_api.py +5 -5
- esphome/storage_json.py +2 -1
- esphome/types.py +1 -1
- esphome/util.py +2 -3
- esphome/voluptuous_schema.py +1 -0
- esphome/vscode.py +5 -4
- esphome/wizard.py +1 -1
- esphome/writer.py +7 -7
- esphome/yaml_util.py +3 -3
- esphome/zeroconf.py +1 -1
- {esphome-2024.7.3.dist-info → esphome-2024.8.0.dist-info}/METADATA +3 -3
- {esphome-2024.7.3.dist-info → esphome-2024.8.0.dist-info}/RECORD +350 -244
- {esphome-2024.7.3.dist-info → esphome-2024.8.0.dist-info}/LICENSE +0 -0
- {esphome-2024.7.3.dist-info → esphome-2024.8.0.dist-info}/WHEEL +0 -0
- {esphome-2024.7.3.dist-info → esphome-2024.8.0.dist-info}/entry_points.txt +0 -0
- {esphome-2024.7.3.dist-info → esphome-2024.8.0.dist-info}/top_level.txt +0 -0
@@ -0,0 +1,195 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
#include "esphome/core/component.h"
|
4
|
+
#include "esphome/core/defines.h"
|
5
|
+
#include "esphome/core/helpers.h"
|
6
|
+
#include "esphome/components/http_request/http_request.h"
|
7
|
+
#include "esphome/components/image/image.h"
|
8
|
+
|
9
|
+
#include "image_decoder.h"
|
10
|
+
|
11
|
+
namespace esphome {
|
12
|
+
namespace online_image {
|
13
|
+
|
14
|
+
using t_http_codes = enum {
|
15
|
+
HTTP_CODE_OK = 200,
|
16
|
+
HTTP_CODE_NOT_MODIFIED = 304,
|
17
|
+
HTTP_CODE_NOT_FOUND = 404,
|
18
|
+
};
|
19
|
+
|
20
|
+
/**
|
21
|
+
* @brief Format that the image is encoded with.
|
22
|
+
*/
|
23
|
+
enum ImageFormat {
|
24
|
+
/** Automatically detect from MIME type. Not supported yet. */
|
25
|
+
AUTO,
|
26
|
+
/** JPEG format. Not supported yet. */
|
27
|
+
JPEG,
|
28
|
+
/** PNG format. */
|
29
|
+
PNG,
|
30
|
+
};
|
31
|
+
|
32
|
+
/**
|
33
|
+
* @brief Download an image from a given URL, and decode it using the specified decoder.
|
34
|
+
* The image will then be stored in a buffer, so that it can be re-displayed without the
|
35
|
+
* need to re-download or re-decode.
|
36
|
+
*/
|
37
|
+
class OnlineImage : public PollingComponent,
|
38
|
+
public image::Image,
|
39
|
+
public Parented<esphome::http_request::HttpRequestComponent> {
|
40
|
+
public:
|
41
|
+
/**
|
42
|
+
* @brief Construct a new OnlineImage object.
|
43
|
+
*
|
44
|
+
* @param url URL to download the image from.
|
45
|
+
* @param width Desired width of the target image area.
|
46
|
+
* @param height Desired height of the target image area.
|
47
|
+
* @param format Format that the image is encoded in (@see ImageFormat).
|
48
|
+
* @param buffer_size Size of the buffer used to download the image.
|
49
|
+
*/
|
50
|
+
OnlineImage(const std::string &url, int width, int height, ImageFormat format, image::ImageType type,
|
51
|
+
uint32_t buffer_size);
|
52
|
+
|
53
|
+
void draw(int x, int y, display::Display *display, Color color_on, Color color_off) override;
|
54
|
+
|
55
|
+
void update() override;
|
56
|
+
void loop() override;
|
57
|
+
|
58
|
+
/** Set the URL to download the image from. */
|
59
|
+
void set_url(const std::string &url) {
|
60
|
+
if (this->validate_url_(url)) {
|
61
|
+
this->url_ = url;
|
62
|
+
}
|
63
|
+
}
|
64
|
+
|
65
|
+
/**
|
66
|
+
* @brief Set the image that needs to be shown as long as the downloaded image
|
67
|
+
* is not available.
|
68
|
+
*
|
69
|
+
* @param placeholder Pointer to the (@link Image) to show as placeholder.
|
70
|
+
*/
|
71
|
+
void set_placeholder(image::Image *placeholder) { this->placeholder_ = placeholder; }
|
72
|
+
|
73
|
+
/**
|
74
|
+
* Release the buffer storing the image. The image will need to be downloaded again
|
75
|
+
* to be able to be displayed.
|
76
|
+
*/
|
77
|
+
void release();
|
78
|
+
|
79
|
+
void add_on_finished_callback(std::function<void()> &&callback);
|
80
|
+
void add_on_error_callback(std::function<void()> &&callback);
|
81
|
+
|
82
|
+
protected:
|
83
|
+
bool validate_url_(const std::string &url);
|
84
|
+
|
85
|
+
using Allocator = ExternalRAMAllocator<uint8_t>;
|
86
|
+
Allocator allocator_{Allocator::Flags::ALLOW_FAILURE};
|
87
|
+
|
88
|
+
uint32_t get_buffer_size_() const { return get_buffer_size_(this->buffer_width_, this->buffer_height_); }
|
89
|
+
int get_buffer_size_(int width, int height) const {
|
90
|
+
return std::ceil(image::image_type_to_bpp(this->type_) * width * height / 8.0);
|
91
|
+
}
|
92
|
+
|
93
|
+
int get_position_(int x, int y) const {
|
94
|
+
return ((x + y * this->buffer_width_) * image::image_type_to_bpp(this->type_)) / 8;
|
95
|
+
}
|
96
|
+
|
97
|
+
ESPHOME_ALWAYS_INLINE bool auto_resize_() const { return this->fixed_width_ == 0 || this->fixed_height_ == 0; }
|
98
|
+
|
99
|
+
bool resize_(int width, int height);
|
100
|
+
|
101
|
+
/**
|
102
|
+
* @brief Draw a pixel into the buffer.
|
103
|
+
*
|
104
|
+
* This is used by the decoder to fill the buffer that will later be displayed
|
105
|
+
* by the `draw` method. This will internally convert the supplied 32 bit RGBA
|
106
|
+
* color into the requested image storage format.
|
107
|
+
*
|
108
|
+
* @param x Horizontal pixel position.
|
109
|
+
* @param y Vertical pixel position.
|
110
|
+
* @param color 32 bit color to put into the pixel.
|
111
|
+
*/
|
112
|
+
void draw_pixel_(int x, int y, Color color);
|
113
|
+
|
114
|
+
void end_connection_();
|
115
|
+
|
116
|
+
CallbackManager<void()> download_finished_callback_{};
|
117
|
+
CallbackManager<void()> download_error_callback_{};
|
118
|
+
|
119
|
+
std::shared_ptr<http_request::HttpContainer> downloader_{nullptr};
|
120
|
+
std::unique_ptr<ImageDecoder> decoder_{nullptr};
|
121
|
+
|
122
|
+
uint8_t *buffer_;
|
123
|
+
DownloadBuffer download_buffer_;
|
124
|
+
|
125
|
+
const ImageFormat format_;
|
126
|
+
image::Image *placeholder_{nullptr};
|
127
|
+
|
128
|
+
std::string url_{""};
|
129
|
+
|
130
|
+
/** width requested on configuration, or 0 if non specified. */
|
131
|
+
const int fixed_width_;
|
132
|
+
/** height requested on configuration, or 0 if non specified. */
|
133
|
+
const int fixed_height_;
|
134
|
+
/**
|
135
|
+
* Actual width of the current image. If fixed_width_ is specified,
|
136
|
+
* this will be equal to it; otherwise it will be set once the decoding
|
137
|
+
* starts and the original size is known.
|
138
|
+
* This needs to be separate from "BaseImage::get_width()" because the latter
|
139
|
+
* must return 0 until the image has been decoded (to avoid showing partially
|
140
|
+
* decoded images).
|
141
|
+
*/
|
142
|
+
int buffer_width_;
|
143
|
+
/**
|
144
|
+
* Actual height of the current image. If fixed_height_ is specified,
|
145
|
+
* this will be equal to it; otherwise it will be set once the decoding
|
146
|
+
* starts and the original size is known.
|
147
|
+
* This needs to be separate from "BaseImage::get_height()" because the latter
|
148
|
+
* must return 0 until the image has been decoded (to avoid showing partially
|
149
|
+
* decoded images).
|
150
|
+
*/
|
151
|
+
int buffer_height_;
|
152
|
+
|
153
|
+
friend void ImageDecoder::set_size(int width, int height);
|
154
|
+
friend void ImageDecoder::draw(int x, int y, int w, int h, const Color &color);
|
155
|
+
};
|
156
|
+
|
157
|
+
template<typename... Ts> class OnlineImageSetUrlAction : public Action<Ts...> {
|
158
|
+
public:
|
159
|
+
OnlineImageSetUrlAction(OnlineImage *parent) : parent_(parent) {}
|
160
|
+
TEMPLATABLE_VALUE(const char *, url)
|
161
|
+
void play(Ts... x) override {
|
162
|
+
this->parent_->set_url(this->url_.value(x...));
|
163
|
+
this->parent_->update();
|
164
|
+
}
|
165
|
+
|
166
|
+
protected:
|
167
|
+
OnlineImage *parent_;
|
168
|
+
};
|
169
|
+
|
170
|
+
template<typename... Ts> class OnlineImageReleaseAction : public Action<Ts...> {
|
171
|
+
public:
|
172
|
+
OnlineImageReleaseAction(OnlineImage *parent) : parent_(parent) {}
|
173
|
+
TEMPLATABLE_VALUE(const char *, url)
|
174
|
+
void play(Ts... x) override { this->parent_->release(); }
|
175
|
+
|
176
|
+
protected:
|
177
|
+
OnlineImage *parent_;
|
178
|
+
};
|
179
|
+
|
180
|
+
class DownloadFinishedTrigger : public Trigger<> {
|
181
|
+
public:
|
182
|
+
explicit DownloadFinishedTrigger(OnlineImage *parent) {
|
183
|
+
parent->add_on_finished_callback([this]() { this->trigger(); });
|
184
|
+
}
|
185
|
+
};
|
186
|
+
|
187
|
+
class DownloadErrorTrigger : public Trigger<> {
|
188
|
+
public:
|
189
|
+
explicit DownloadErrorTrigger(OnlineImage *parent) {
|
190
|
+
parent->add_on_error_callback([this]() { this->trigger(); });
|
191
|
+
}
|
192
|
+
};
|
193
|
+
|
194
|
+
} // namespace online_image
|
195
|
+
} // namespace esphome
|
@@ -0,0 +1,68 @@
|
|
1
|
+
#include "png_image.h"
|
2
|
+
#ifdef USE_ONLINE_IMAGE_PNG_SUPPORT
|
3
|
+
|
4
|
+
#include "esphome/components/display/display_buffer.h"
|
5
|
+
#include "esphome/core/application.h"
|
6
|
+
#include "esphome/core/helpers.h"
|
7
|
+
#include "esphome/core/log.h"
|
8
|
+
|
9
|
+
static const char *const TAG = "online_image.png";
|
10
|
+
|
11
|
+
namespace esphome {
|
12
|
+
namespace online_image {
|
13
|
+
|
14
|
+
/**
|
15
|
+
* @brief Callback method that will be called by the PNGLE engine when the basic
|
16
|
+
* data of the image is received (i.e. width and height);
|
17
|
+
*
|
18
|
+
* @param pngle The PNGLE object, including the context data.
|
19
|
+
* @param w The width of the image.
|
20
|
+
* @param h The height of the image.
|
21
|
+
*/
|
22
|
+
static void init_callback(pngle_t *pngle, uint32_t w, uint32_t h) {
|
23
|
+
PngDecoder *decoder = (PngDecoder *) pngle_get_user_data(pngle);
|
24
|
+
decoder->set_size(w, h);
|
25
|
+
}
|
26
|
+
|
27
|
+
/**
|
28
|
+
* @brief Callback method that will be called by the PNGLE engine when a chunk
|
29
|
+
* of the image is decoded.
|
30
|
+
*
|
31
|
+
* @param pngle The PNGLE object, including the context data.
|
32
|
+
* @param x The X coordinate to draw the rectangle on.
|
33
|
+
* @param y The Y coordinate to draw the rectangle on.
|
34
|
+
* @param w The width of the rectangle to draw.
|
35
|
+
* @param h The height of the rectangle to draw.
|
36
|
+
* @param rgba The color to paint the rectangle in.
|
37
|
+
*/
|
38
|
+
static void draw_callback(pngle_t *pngle, uint32_t x, uint32_t y, uint32_t w, uint32_t h, uint8_t rgba[4]) {
|
39
|
+
PngDecoder *decoder = (PngDecoder *) pngle_get_user_data(pngle);
|
40
|
+
Color color(rgba[0], rgba[1], rgba[2], rgba[3]);
|
41
|
+
decoder->draw(x, y, w, h, color);
|
42
|
+
}
|
43
|
+
|
44
|
+
void PngDecoder::prepare(uint32_t download_size) {
|
45
|
+
ImageDecoder::prepare(download_size);
|
46
|
+
pngle_set_user_data(this->pngle_, this);
|
47
|
+
pngle_set_init_callback(this->pngle_, init_callback);
|
48
|
+
pngle_set_draw_callback(this->pngle_, draw_callback);
|
49
|
+
}
|
50
|
+
|
51
|
+
int HOT PngDecoder::decode(uint8_t *buffer, size_t size) {
|
52
|
+
if (size < 256 && size < this->download_size_ - this->decoded_bytes_) {
|
53
|
+
ESP_LOGD(TAG, "Waiting for data");
|
54
|
+
return 0;
|
55
|
+
}
|
56
|
+
auto fed = pngle_feed(this->pngle_, buffer, size);
|
57
|
+
if (fed < 0) {
|
58
|
+
ESP_LOGE(TAG, "Error decoding image: %s", pngle_error(this->pngle_));
|
59
|
+
} else {
|
60
|
+
this->decoded_bytes_ += fed;
|
61
|
+
}
|
62
|
+
return fed;
|
63
|
+
}
|
64
|
+
|
65
|
+
} // namespace online_image
|
66
|
+
} // namespace esphome
|
67
|
+
|
68
|
+
#endif // USE_ONLINE_IMAGE_PNG_SUPPORT
|
@@ -0,0 +1,33 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
#include "image_decoder.h"
|
4
|
+
#ifdef USE_ONLINE_IMAGE_PNG_SUPPORT
|
5
|
+
#include <pngle.h>
|
6
|
+
|
7
|
+
namespace esphome {
|
8
|
+
namespace online_image {
|
9
|
+
|
10
|
+
/**
|
11
|
+
* @brief Image decoder specialization for PNG images.
|
12
|
+
*/
|
13
|
+
class PngDecoder : public ImageDecoder {
|
14
|
+
public:
|
15
|
+
/**
|
16
|
+
* @brief Construct a new PNG Decoder object.
|
17
|
+
*
|
18
|
+
* @param display The image to decode the stream into.
|
19
|
+
*/
|
20
|
+
PngDecoder(OnlineImage *image) : ImageDecoder(image), pngle_(pngle_new()) {}
|
21
|
+
~PngDecoder() override { pngle_destroy(this->pngle_); }
|
22
|
+
|
23
|
+
void prepare(uint32_t download_size) override;
|
24
|
+
int HOT decode(uint8_t *buffer, size_t size) override;
|
25
|
+
|
26
|
+
protected:
|
27
|
+
pngle_t *pngle_;
|
28
|
+
};
|
29
|
+
|
30
|
+
} // namespace online_image
|
31
|
+
} // namespace esphome
|
32
|
+
|
33
|
+
#endif // USE_ONLINE_IMAGE_PNG_SUPPORT
|
@@ -1,10 +1,15 @@
|
|
1
|
+
from esphome import automation
|
1
2
|
import esphome.codegen as cg
|
2
3
|
import esphome.config_validation as cv
|
3
|
-
from esphome import
|
4
|
+
from esphome.const import (
|
5
|
+
CONF_ESPHOME,
|
6
|
+
CONF_ON_ERROR,
|
7
|
+
CONF_OTA,
|
8
|
+
CONF_PLATFORM,
|
9
|
+
CONF_TRIGGER_ID,
|
10
|
+
)
|
4
11
|
from esphome.core import CORE, coroutine_with_priority
|
5
12
|
|
6
|
-
from esphome.const import CONF_ESPHOME, CONF_OTA, CONF_PLATFORM, CONF_TRIGGER_ID
|
7
|
-
|
8
13
|
CODEOWNERS = ["@esphome/core"]
|
9
14
|
AUTO_LOAD = ["md5", "safe_mode"]
|
10
15
|
|
@@ -13,7 +18,6 @@ IS_PLATFORM_COMPONENT = True
|
|
13
18
|
CONF_ON_ABORT = "on_abort"
|
14
19
|
CONF_ON_BEGIN = "on_begin"
|
15
20
|
CONF_ON_END = "on_end"
|
16
|
-
CONF_ON_ERROR = "on_error"
|
17
21
|
CONF_ON_PROGRESS = "on_progress"
|
18
22
|
CONF_ON_STATE_CHANGE = "on_state_change"
|
19
23
|
|
@@ -44,6 +44,8 @@ class PIDClimate : public climate::Climate, public Component {
|
|
44
44
|
float get_kp() { return controller_.kp_; }
|
45
45
|
float get_ki() { return controller_.ki_; }
|
46
46
|
float get_kd() { return controller_.kd_; }
|
47
|
+
float get_min_integral() { return controller_.min_integral_; }
|
48
|
+
float get_max_integral() { return controller_.max_integral_; }
|
47
49
|
float get_proportional_term() const { return controller_.proportional_term_; }
|
48
50
|
float get_integral_term() const { return controller_.integral_term_; }
|
49
51
|
float get_derivative_term() const { return controller_.derivative_term_; }
|
@@ -201,9 +201,6 @@ std::string ProntoProtocol::compensate_and_dump_sequence_(const RawTimings &data
|
|
201
201
|
out += dump_duration_(t_duration, timebase);
|
202
202
|
}
|
203
203
|
|
204
|
-
// append minimum gap
|
205
|
-
out += dump_duration_(PRONTO_DEFAULT_GAP, timebase, true);
|
206
|
-
|
207
204
|
return out;
|
208
205
|
}
|
209
206
|
|
@@ -49,7 +49,7 @@ class RemoteTransmitterComponent : public remote_base::RemoteTransmitterBase,
|
|
49
49
|
#ifdef USE_ESP32
|
50
50
|
void configure_rmt_();
|
51
51
|
|
52
|
-
uint32_t current_carrier_frequency_{
|
52
|
+
uint32_t current_carrier_frequency_{38000};
|
53
53
|
bool initialized_{false};
|
54
54
|
std::vector<rmt_item32_t> rmt_temp_;
|
55
55
|
esp_err_t error_code_{ESP_OK};
|
@@ -23,10 +23,11 @@ class RGBCTLightOutput : public light::LightOutput {
|
|
23
23
|
|
24
24
|
light::LightTraits get_traits() override {
|
25
25
|
auto traits = light::LightTraits();
|
26
|
-
if (this->color_interlock_)
|
26
|
+
if (this->color_interlock_) {
|
27
27
|
traits.set_supported_color_modes({light::ColorMode::RGB, light::ColorMode::COLOR_TEMPERATURE});
|
28
|
-
else
|
28
|
+
} else {
|
29
29
|
traits.set_supported_color_modes({light::ColorMode::RGB_COLOR_TEMPERATURE, light::ColorMode::COLOR_TEMPERATURE});
|
30
|
+
}
|
30
31
|
traits.set_min_mireds(this->cold_white_temperature_);
|
31
32
|
traits.set_max_mireds(this->warm_white_temperature_);
|
32
33
|
return traits;
|
@@ -16,10 +16,11 @@ class RGBWLightOutput : public light::LightOutput {
|
|
16
16
|
void set_color_interlock(bool color_interlock) { color_interlock_ = color_interlock; }
|
17
17
|
light::LightTraits get_traits() override {
|
18
18
|
auto traits = light::LightTraits();
|
19
|
-
if (this->color_interlock_)
|
19
|
+
if (this->color_interlock_) {
|
20
20
|
traits.set_supported_color_modes({light::ColorMode::RGB, light::ColorMode::WHITE});
|
21
|
-
else
|
21
|
+
} else {
|
22
22
|
traits.set_supported_color_modes({light::ColorMode::RGB_WHITE});
|
23
|
+
}
|
23
24
|
return traits;
|
24
25
|
}
|
25
26
|
void write_state(light::LightState *state) override {
|
@@ -20,10 +20,11 @@ class RGBWWLightOutput : public light::LightOutput {
|
|
20
20
|
void set_color_interlock(bool color_interlock) { color_interlock_ = color_interlock; }
|
21
21
|
light::LightTraits get_traits() override {
|
22
22
|
auto traits = light::LightTraits();
|
23
|
-
if (this->color_interlock_)
|
23
|
+
if (this->color_interlock_) {
|
24
24
|
traits.set_supported_color_modes({light::ColorMode::RGB, light::ColorMode::COLD_WARM_WHITE});
|
25
|
-
else
|
25
|
+
} else {
|
26
26
|
traits.set_supported_color_modes({light::ColorMode::RGB_COLD_WARM_WHITE});
|
27
|
+
}
|
27
28
|
traits.set_min_mireds(this->cold_white_temperature_);
|
28
29
|
traits.set_max_mireds(this->warm_white_temperature_);
|
29
30
|
return traits;
|
@@ -7,8 +7,10 @@
|
|
7
7
|
|
8
8
|
#include <hardware/clocks.h>
|
9
9
|
#include <hardware/dma.h>
|
10
|
+
#include <hardware/irq.h>
|
10
11
|
#include <hardware/pio.h>
|
11
12
|
#include <pico/stdlib.h>
|
13
|
+
#include <pico/sem.h>
|
12
14
|
|
13
15
|
namespace esphome {
|
14
16
|
namespace rp2040_pio_led_strip {
|
@@ -23,6 +25,19 @@ static std::map<Chipset, bool> conf_count_ = {
|
|
23
25
|
{CHIPSET_WS2812, false}, {CHIPSET_WS2812B, false}, {CHIPSET_SK6812, false},
|
24
26
|
{CHIPSET_SM16703, false}, {CHIPSET_CUSTOM, false},
|
25
27
|
};
|
28
|
+
static bool dma_chan_active_[12];
|
29
|
+
static struct semaphore dma_write_complete_sem_[12];
|
30
|
+
|
31
|
+
// DMA interrupt service routine
|
32
|
+
void RP2040PIOLEDStripLightOutput::dma_write_complete_handler_() {
|
33
|
+
uint32_t channel = dma_hw->ints0;
|
34
|
+
for (uint dma_chan = 0; dma_chan < 12; ++dma_chan) {
|
35
|
+
if (RP2040PIOLEDStripLightOutput::dma_chan_active_[dma_chan] && (channel & (1u << dma_chan))) {
|
36
|
+
dma_hw->ints0 = (1u << dma_chan); // Clear the interrupt
|
37
|
+
sem_release(&RP2040PIOLEDStripLightOutput::dma_write_complete_sem_[dma_chan]); // Handle the interrupt
|
38
|
+
}
|
39
|
+
}
|
40
|
+
}
|
26
41
|
|
27
42
|
void RP2040PIOLEDStripLightOutput::setup() {
|
28
43
|
ESP_LOGCONFIG(TAG, "Setting up RP2040 LED Strip...");
|
@@ -57,22 +72,22 @@ void RP2040PIOLEDStripLightOutput::setup() {
|
|
57
72
|
// but there are only 4 state machines on each PIO so we can only have 4 strips per PIO
|
58
73
|
uint offset = 0;
|
59
74
|
|
60
|
-
if (num_instance_[this->pio_ == pio0 ? 0 : 1] > 4) {
|
75
|
+
if (RP2040PIOLEDStripLightOutput::num_instance_[this->pio_ == pio0 ? 0 : 1] > 4) {
|
61
76
|
ESP_LOGE(TAG, "Too many instances of PIO program");
|
62
77
|
this->mark_failed();
|
63
78
|
return;
|
64
79
|
}
|
65
80
|
// keep track of how many instances of the PIO program are running on each PIO
|
66
|
-
num_instance_[this->pio_ == pio0 ? 0 : 1]++;
|
81
|
+
RP2040PIOLEDStripLightOutput::num_instance_[this->pio_ == pio0 ? 0 : 1]++;
|
67
82
|
|
68
83
|
// if there are multiple strips of the same chipset, we can reuse the same PIO program and save space
|
69
84
|
if (this->conf_count_[this->chipset_]) {
|
70
|
-
offset = chipset_offsets_[this->chipset_];
|
85
|
+
offset = RP2040PIOLEDStripLightOutput::chipset_offsets_[this->chipset_];
|
71
86
|
} else {
|
72
87
|
// Load the assembled program into the PIO and get its location in the PIO's instruction memory and save it
|
73
88
|
offset = pio_add_program(this->pio_, this->program_);
|
74
|
-
chipset_offsets_[this->chipset_] = offset;
|
75
|
-
conf_count_[this->chipset_] = true;
|
89
|
+
RP2040PIOLEDStripLightOutput::chipset_offsets_[this->chipset_] = offset;
|
90
|
+
RP2040PIOLEDStripLightOutput::conf_count_[this->chipset_] = true;
|
76
91
|
}
|
77
92
|
|
78
93
|
// Configure the state machine's PIO, and start it
|
@@ -93,6 +108,9 @@ void RP2040PIOLEDStripLightOutput::setup() {
|
|
93
108
|
return;
|
94
109
|
}
|
95
110
|
|
111
|
+
// Mark the DMA channel as active
|
112
|
+
RP2040PIOLEDStripLightOutput::dma_chan_active_[this->dma_chan_] = true;
|
113
|
+
|
96
114
|
this->dma_config_ = dma_channel_get_default_config(this->dma_chan_);
|
97
115
|
channel_config_set_transfer_data_size(
|
98
116
|
&this->dma_config_,
|
@@ -109,6 +127,13 @@ void RP2040PIOLEDStripLightOutput::setup() {
|
|
109
127
|
false // don't start yet
|
110
128
|
);
|
111
129
|
|
130
|
+
// Initialize the semaphore for this DMA channel
|
131
|
+
sem_init(&RP2040PIOLEDStripLightOutput::dma_write_complete_sem_[this->dma_chan_], 1, 1);
|
132
|
+
|
133
|
+
irq_set_exclusive_handler(DMA_IRQ_0, dma_write_complete_handler_); // after DMA all data, raise an interrupt
|
134
|
+
dma_channel_set_irq0_enabled(this->dma_chan_, true); // map DMA channel to interrupt
|
135
|
+
irq_set_enabled(DMA_IRQ_0, true); // enable interrupt
|
136
|
+
|
112
137
|
this->init_(this->pio_, this->sm_, offset, this->pin_, this->max_refresh_rate_);
|
113
138
|
}
|
114
139
|
|
@@ -126,6 +151,7 @@ void RP2040PIOLEDStripLightOutput::write_state(light::LightState *state) {
|
|
126
151
|
}
|
127
152
|
|
128
153
|
// the bits are already in the correct order for the pio program so we can just copy the buffer using DMA
|
154
|
+
sem_acquire_blocking(&RP2040PIOLEDStripLightOutput::dma_write_complete_sem_[this->dma_chan_]);
|
129
155
|
dma_channel_transfer_from_buffer_now(this->dma_chan_, this->buf_, this->get_buffer_size_());
|
130
156
|
}
|
131
157
|
|
@@ -13,6 +13,7 @@
|
|
13
13
|
#include <hardware/pio.h>
|
14
14
|
#include <hardware/structs/pio.h>
|
15
15
|
#include <pico/stdio.h>
|
16
|
+
#include <pico/sem.h>
|
16
17
|
#include <map>
|
17
18
|
|
18
19
|
namespace esphome {
|
@@ -95,6 +96,8 @@ class RP2040PIOLEDStripLightOutput : public light::AddressableLight {
|
|
95
96
|
|
96
97
|
size_t get_buffer_size_() const { return this->num_leds_ * (3 + this->is_rgbw_); }
|
97
98
|
|
99
|
+
static void dma_write_complete_handler_();
|
100
|
+
|
98
101
|
uint8_t *buf_{nullptr};
|
99
102
|
uint8_t *effect_data_{nullptr};
|
100
103
|
|
@@ -120,6 +123,8 @@ class RP2040PIOLEDStripLightOutput : public light::AddressableLight {
|
|
120
123
|
inline static int num_instance_[2];
|
121
124
|
inline static std::map<Chipset, bool> conf_count_;
|
122
125
|
inline static std::map<Chipset, int> chipset_offsets_;
|
126
|
+
inline static bool dma_chan_active_[12];
|
127
|
+
inline static struct semaphore dma_write_complete_sem_[12];
|
123
128
|
};
|
124
129
|
|
125
130
|
} // namespace rp2040_pio_led_strip
|