esphome 2024.12.3__py3-none-any.whl → 2025.2.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 +16 -3
- esphome/components/adc/__init__.py +17 -11
- esphome/components/adc/adc_sensor.h +17 -0
- esphome/components/adc/adc_sensor_common.cpp +55 -0
- esphome/components/adc/adc_sensor_esp32.cpp +8 -5
- esphome/components/adc/adc_sensor_esp8266.cpp +10 -6
- esphome/components/adc/adc_sensor_libretiny.cpp +11 -6
- esphome/components/adc/adc_sensor_rp2040.cpp +13 -10
- esphome/components/adc/sensor.py +9 -3
- esphome/components/ads1115/ads1115.cpp +56 -7
- esphome/components/ads1115/ads1115.h +13 -1
- esphome/components/ads1115/sensor/__init__.py +16 -0
- esphome/components/ads1115/sensor/ads1115_sensor.cpp +2 -1
- esphome/components/ads1115/sensor/ads1115_sensor.h +2 -0
- esphome/components/animation/__init__.py +23 -261
- esphome/components/animation/animation.cpp +2 -2
- esphome/components/animation/animation.h +2 -1
- esphome/components/api/api_pb2.cpp +14 -0
- esphome/components/api/api_pb2.h +1 -0
- esphome/components/audio/__init__.py +112 -0
- esphome/components/audio/audio.cpp +67 -0
- esphome/components/audio/audio.h +125 -7
- esphome/components/audio/audio_decoder.cpp +361 -0
- esphome/components/audio/audio_decoder.h +135 -0
- esphome/components/audio/audio_reader.cpp +308 -0
- esphome/components/audio/audio_reader.h +85 -0
- esphome/components/audio/audio_resampler.cpp +159 -0
- esphome/components/audio/audio_resampler.h +101 -0
- esphome/components/audio/audio_transfer_buffer.cpp +165 -0
- esphome/components/audio/audio_transfer_buffer.h +139 -0
- esphome/components/audio_adc/__init__.py +41 -0
- esphome/components/audio_adc/audio_adc.h +17 -0
- esphome/components/audio_adc/automation.h +23 -0
- esphome/components/bk72xx/__init__.py +1 -0
- esphome/components/ble_client/ble_client.cpp +1 -2
- esphome/components/ble_client/sensor/__init__.py +1 -1
- esphome/components/ble_client/text_sensor/__init__.py +1 -1
- esphome/components/bluetooth_proxy/bluetooth_connection.cpp +5 -0
- esphome/components/bluetooth_proxy/bluetooth_connection.h +1 -0
- esphome/components/bluetooth_proxy/bluetooth_proxy.cpp +5 -0
- esphome/components/ch422g/ch422g.h +2 -0
- esphome/components/climate/__init__.py +1 -1
- esphome/components/climate_ir/climate_ir.cpp +2 -1
- esphome/components/coolix/coolix.cpp +2 -1
- esphome/components/custom/__init__.py +0 -3
- esphome/components/custom/binary_sensor/__init__.py +2 -28
- esphome/components/custom/climate/__init__.py +2 -27
- esphome/components/custom/cover/__init__.py +2 -27
- esphome/components/custom/light/__init__.py +2 -27
- esphome/components/custom/output/__init__.py +2 -58
- esphome/components/custom/sensor/__init__.py +2 -24
- esphome/components/custom/switch/__init__.py +2 -24
- esphome/components/custom/text_sensor/__init__.py +2 -29
- esphome/components/custom_component/__init__.py +3 -27
- esphome/components/daly_bms/daly_bms.cpp +6 -0
- esphome/components/daly_bms/daly_bms.h +2 -0
- esphome/components/daly_bms/sensor.py +6 -0
- esphome/components/debug/debug_component.cpp +4 -0
- esphome/components/debug/debug_component.h +14 -0
- esphome/components/debug/debug_esp32.cpp +154 -74
- esphome/components/dfplayer/dfplayer.cpp +15 -2
- esphome/components/dfrobot_sen0395/dfrobot_sen0395.cpp +2 -1
- esphome/components/dht/dht.cpp +2 -1
- esphome/components/display/__init__.py +18 -5
- esphome/components/display/display.cpp +2 -1
- esphome/components/display/rect.cpp +2 -1
- esphome/components/es7210/__init__.py +0 -0
- esphome/components/es7210/audio_adc.py +51 -0
- esphome/components/es7210/es7210.cpp +228 -0
- esphome/components/es7210/es7210.h +62 -0
- esphome/components/es7210/es7210_const.h +129 -0
- esphome/components/es7243e/__init__.py +0 -0
- esphome/components/es7243e/audio_adc.py +34 -0
- esphome/components/es7243e/es7243e.cpp +125 -0
- esphome/components/es7243e/es7243e.h +37 -0
- esphome/components/es7243e/es7243e_const.h +54 -0
- esphome/components/es8156/__init__.py +0 -0
- esphome/components/es8156/audio_dac.py +27 -0
- esphome/components/es8156/es8156.cpp +87 -0
- esphome/components/es8156/es8156.h +51 -0
- esphome/components/es8156/es8156_const.h +68 -0
- esphome/components/es8311/audio_dac.py +1 -2
- esphome/components/esp32/__init__.py +1 -0
- esphome/components/esp32/core.cpp +5 -1
- esphome/components/esp32/gpio.h +2 -0
- esphome/components/esp32_ble/__init__.py +39 -0
- esphome/components/esp32_ble/queue.h +4 -4
- esphome/components/esp32_ble_client/ble_client_base.cpp +46 -0
- esphome/components/esp32_ble_client/ble_client_base.h +2 -0
- esphome/components/esp32_ble_server/__init__.py +582 -12
- esphome/components/esp32_ble_server/ble_characteristic.cpp +48 -60
- esphome/components/esp32_ble_server/ble_characteristic.h +24 -17
- esphome/components/esp32_ble_server/ble_descriptor.cpp +21 -9
- esphome/components/esp32_ble_server/ble_descriptor.h +17 -6
- esphome/components/esp32_ble_server/ble_server.cpp +62 -67
- esphome/components/esp32_ble_server/ble_server.h +28 -32
- esphome/components/esp32_ble_server/ble_server_automations.cpp +77 -0
- esphome/components/esp32_ble_server/ble_server_automations.h +115 -0
- esphome/components/esp32_ble_server/ble_service.cpp +17 -15
- esphome/components/esp32_ble_server/ble_service.h +10 -14
- esphome/components/esp32_ble_tracker/__init__.py +6 -39
- esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +33 -10
- esphome/components/esp32_ble_tracker/esp32_ble_tracker.h +8 -4
- esphome/components/esp32_improv/__init__.py +2 -8
- esphome/components/esp32_improv/esp32_improv_component.cpp +21 -20
- esphome/components/esp32_improv/esp32_improv_component.h +3 -4
- esphome/components/esp32_rmt/__init__.py +28 -3
- esphome/components/esp32_rmt_led_strip/led_strip.cpp +73 -6
- esphome/components/esp32_rmt_led_strip/led_strip.h +21 -3
- esphome/components/esp32_rmt_led_strip/light.py +72 -7
- esphome/components/esp32_touch/esp32_touch.cpp +5 -0
- esphome/components/esp8266/__init__.py +1 -0
- esphome/components/esp8266/gpio.h +1 -0
- esphome/components/ethernet/__init__.py +10 -10
- esphome/components/event/event.cpp +4 -2
- esphome/components/event/event.h +2 -0
- esphome/components/event_emitter/__init__.py +5 -0
- esphome/components/event_emitter/event_emitter.cpp +14 -0
- esphome/components/event_emitter/event_emitter.h +63 -0
- esphome/components/gcja5/gcja5.cpp +2 -1
- esphome/components/haier/haier_base.cpp +2 -1
- esphome/components/haier/hon_climate.cpp +2 -1
- esphome/components/heatpumpir/heatpumpir.cpp +2 -1
- esphome/components/host/__init__.py +1 -0
- esphome/components/host/gpio.h +1 -0
- esphome/components/http_request/http_request.h +2 -2
- esphome/components/http_request/http_request_arduino.cpp +1 -1
- esphome/components/http_request/http_request_idf.cpp +1 -1
- esphome/components/i2c/i2c_bus_esp_idf.cpp +4 -0
- esphome/components/i2s_audio/microphone/i2s_audio_microphone.cpp +7 -5
- esphome/components/i2s_audio/speaker/__init__.py +53 -6
- esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp +92 -46
- esphome/components/i2s_audio/speaker/i2s_audio_speaker.h +8 -0
- esphome/components/ili9xxx/display.py +29 -11
- esphome/components/ili9xxx/ili9xxx_display.cpp +2 -5
- esphome/components/ili9xxx/ili9xxx_display.h +2 -1
- esphome/components/image/__init__.py +443 -255
- esphome/components/image/image.cpp +115 -61
- esphome/components/image/image.h +15 -24
- esphome/components/json/json_util.cpp +8 -34
- esphome/components/libretiny/__init__.py +1 -0
- esphome/components/libretiny/gpio_arduino.h +1 -0
- esphome/components/light/light_color_values.h +1 -1
- esphome/components/logger/__init__.py +43 -7
- esphome/components/logger/logger.cpp +16 -11
- esphome/components/logger/logger.h +11 -7
- esphome/components/logger/select/__init__.py +29 -0
- esphome/components/logger/select/logger_level_select.cpp +27 -0
- esphome/components/logger/select/logger_level_select.h +15 -0
- esphome/components/lvgl/__init__.py +96 -73
- esphome/components/lvgl/automation.py +39 -7
- esphome/components/lvgl/defines.py +8 -2
- esphome/components/lvgl/lvgl_esphome.cpp +8 -15
- esphome/components/lvgl/lvgl_esphome.h +20 -5
- esphome/components/lvgl/schemas.py +25 -14
- esphome/components/lvgl/trigger.py +27 -3
- esphome/components/lvgl/widgets/dropdown.py +1 -1
- esphome/components/lvgl/widgets/keyboard.py +8 -1
- esphome/components/lvgl/widgets/meter.py +2 -1
- esphome/components/lvgl/widgets/msgbox.py +1 -1
- esphome/components/lvgl/widgets/obj.py +1 -12
- esphome/components/lvgl/widgets/page.py +37 -2
- esphome/components/lvgl/widgets/tabview.py +1 -1
- esphome/components/max6956/max6956.h +2 -0
- esphome/components/mcp23016/mcp23016.h +2 -0
- esphome/components/mcp23xxx_base/mcp23xxx_base.h +2 -0
- esphome/components/mdns/__init__.py +1 -1
- esphome/components/media_player/__init__.py +37 -8
- esphome/components/media_player/automation.h +11 -2
- esphome/components/media_player/media_player.cpp +8 -0
- esphome/components/media_player/media_player.h +8 -4
- esphome/components/micronova/switch/micronova_switch.cpp +4 -2
- esphome/components/midea/ac_automations.h +3 -1
- esphome/components/midea/air_conditioner.cpp +7 -5
- esphome/components/midea/air_conditioner.h +1 -1
- esphome/components/midea/climate.py +4 -2
- esphome/components/midea/ir_transmitter.h +36 -5
- esphome/components/mixer/__init__.py +0 -0
- esphome/components/mixer/speaker/__init__.py +172 -0
- esphome/components/mixer/speaker/automation.h +19 -0
- esphome/components/mixer/speaker/mixer_speaker.cpp +624 -0
- esphome/components/mixer/speaker/mixer_speaker.h +207 -0
- esphome/components/mpr121/mpr121.h +2 -0
- esphome/components/mqtt/__init__.py +1 -1
- esphome/components/mqtt/mqtt_client.cpp +7 -1
- esphome/components/mqtt/mqtt_client.h +1 -1
- esphome/components/mqtt/mqtt_climate.cpp +2 -2
- esphome/components/network/ip_address.h +2 -0
- esphome/components/nextion/automation.h +17 -0
- esphome/components/nextion/display.py +42 -17
- esphome/components/nextion/nextion.cpp +4 -10
- esphome/components/nextion/nextion.h +89 -82
- esphome/components/nextion/nextion_commands.cpp +10 -10
- esphome/components/ntc/sensor.py +2 -4
- esphome/components/online_image/__init__.py +98 -46
- esphome/components/online_image/bmp_image.cpp +101 -0
- esphome/components/online_image/bmp_image.h +40 -0
- esphome/components/online_image/image_decoder.cpp +28 -2
- esphome/components/online_image/image_decoder.h +24 -15
- esphome/components/online_image/jpeg_image.cpp +90 -0
- esphome/components/online_image/jpeg_image.h +34 -0
- esphome/components/online_image/online_image.cpp +112 -53
- esphome/components/online_image/online_image.h +24 -7
- esphome/components/online_image/png_image.cpp +7 -3
- esphome/components/online_image/png_image.h +2 -1
- esphome/components/opentherm/__init__.py +73 -7
- esphome/components/opentherm/automation.h +25 -0
- esphome/components/opentherm/const.py +1 -0
- esphome/components/opentherm/generate.py +39 -6
- esphome/components/opentherm/hub.cpp +117 -79
- esphome/components/opentherm/hub.h +31 -15
- esphome/components/opentherm/opentherm.cpp +47 -23
- esphome/components/opentherm/opentherm.h +27 -6
- esphome/components/opentherm/opentherm_macros.h +11 -0
- esphome/components/opentherm/schema.py +78 -1
- esphome/components/opentherm/validate.py +7 -2
- esphome/components/pca6416a/pca6416a.h +2 -0
- esphome/components/pca9554/pca9554.h +2 -0
- esphome/components/pcf8574/pcf8574.h +2 -0
- esphome/components/preferences/__init__.py +2 -4
- esphome/components/preferences/syncer.h +10 -3
- esphome/components/prometheus/prometheus_handler.cpp +313 -0
- esphome/components/prometheus/prometheus_handler.h +48 -7
- esphome/components/psram/psram.cpp +8 -1
- esphome/components/pulse_counter/pulse_counter_sensor.cpp +14 -9
- esphome/components/pulse_counter/pulse_counter_sensor.h +4 -4
- esphome/components/pulse_meter/pulse_meter_sensor.cpp +2 -0
- esphome/components/qspi_dbi/__init__.py +3 -0
- esphome/components/qspi_dbi/display.py +74 -47
- esphome/components/qspi_dbi/models.py +245 -2
- esphome/components/qspi_dbi/qspi_dbi.cpp +9 -16
- esphome/components/qspi_dbi/qspi_dbi.h +2 -2
- esphome/components/remote_base/__init__.py +77 -25
- esphome/components/remote_base/remote_base.cpp +1 -1
- esphome/components/remote_base/remote_base.h +20 -2
- esphome/components/remote_base/toto_protocol.cpp +100 -0
- esphome/components/remote_base/toto_protocol.h +45 -0
- esphome/components/remote_receiver/__init__.py +55 -10
- esphome/components/remote_receiver/remote_receiver.h +36 -3
- esphome/components/remote_receiver/remote_receiver_esp32.cpp +145 -6
- esphome/components/remote_transmitter/__init__.py +62 -4
- esphome/components/remote_transmitter/remote_transmitter.h +21 -2
- esphome/components/remote_transmitter/remote_transmitter_esp32.cpp +140 -4
- esphome/components/remote_transmitter/remote_transmitter_esp8266.cpp +3 -3
- esphome/components/remote_transmitter/remote_transmitter_libretiny.cpp +3 -3
- esphome/components/resampler/__init__.py +0 -0
- esphome/components/resampler/speaker/__init__.py +103 -0
- esphome/components/resampler/speaker/resampler_speaker.cpp +318 -0
- esphome/components/resampler/speaker/resampler_speaker.h +107 -0
- esphome/components/resistance/resistance_sensor.h +2 -3
- esphome/components/resistance/sensor.py +2 -9
- esphome/components/rotary_encoder/rotary_encoder.cpp +8 -4
- esphome/components/rp2040/__init__.py +1 -0
- esphome/components/rp2040/gpio.h +1 -0
- esphome/components/rtl87xx/__init__.py +2 -0
- esphome/components/sdl/binary_sensor.py +270 -0
- esphome/components/sdl/sdl_esphome.cpp +16 -0
- esphome/components/sdl/sdl_esphome.h +9 -0
- esphome/components/seeed_mr60bha2/binary_sensor.py +25 -0
- esphome/components/seeed_mr60bha2/seeed_mr60bha2.cpp +26 -2
- esphome/components/seeed_mr60bha2/seeed_mr60bha2.h +9 -20
- esphome/components/seeed_mr60bha2/sensor.py +9 -1
- esphome/components/sn74hc165/sn74hc165.h +3 -0
- esphome/components/sn74hc595/sn74hc595.h +3 -0
- esphome/components/speaker/__init__.py +5 -4
- esphome/components/speaker/media_player/__init__.py +458 -0
- esphome/components/speaker/media_player/audio_pipeline.cpp +568 -0
- esphome/components/speaker/media_player/audio_pipeline.h +159 -0
- esphome/components/speaker/media_player/automation.h +26 -0
- esphome/components/speaker/media_player/speaker_media_player.cpp +577 -0
- esphome/components/speaker/media_player/speaker_media_player.h +160 -0
- esphome/components/speaker/speaker.h +20 -0
- esphome/components/spi/__init__.py +1 -5
- esphome/components/spi/spi.cpp +7 -1
- esphome/components/spi/spi.h +21 -2
- esphome/components/spi_led_strip/light.py +3 -5
- esphome/components/spi_led_strip/spi_led_strip.cpp +67 -0
- esphome/components/spi_led_strip/spi_led_strip.h +8 -60
- esphome/components/sprinkler/sprinkler.cpp +3 -1
- esphome/components/sx1509/sx1509_gpio_pin.h +2 -0
- esphome/components/tca9555/tca9555.h +2 -0
- esphome/components/toshiba/toshiba.cpp +2 -1
- esphome/components/tuya/light/tuya_light.cpp +4 -2
- esphome/components/uart/uart_component_esp32_arduino.cpp +2 -2
- esphome/components/uart/uart_component_esp_idf.cpp +2 -2
- esphome/components/udp/__init__.py +8 -2
- esphome/components/udp/udp_component.cpp +25 -56
- esphome/components/udp/udp_component.h +3 -0
- esphome/components/uponor_smatrix/sensor/__init__.py +14 -4
- esphome/components/uponor_smatrix/sensor/uponor_smatrix_sensor.cpp +5 -0
- esphome/components/uponor_smatrix/sensor/uponor_smatrix_sensor.h +1 -0
- esphome/components/uptime/text_sensor/__init__.py +19 -0
- esphome/components/uptime/text_sensor/uptime_text_sensor.cpp +63 -0
- esphome/components/uptime/text_sensor/uptime_text_sensor.h +25 -0
- esphome/components/voice_assistant/voice_assistant.cpp +24 -14
- esphome/components/voice_assistant/voice_assistant.h +8 -0
- esphome/components/waveshare_epaper/display.py +22 -1
- esphome/components/waveshare_epaper/waveshare_213v3.cpp +9 -3
- esphome/components/waveshare_epaper/waveshare_epaper.cpp +1155 -44
- esphome/components/waveshare_epaper/waveshare_epaper.h +208 -7
- esphome/components/web_server/web_server.cpp +28 -6
- esphome/components/weikai/weikai.h +2 -0
- esphome/components/wifi/__init__.py +6 -6
- esphome/components/wifi/wifi_component.cpp +1 -1
- esphome/components/wifi/wifi_component_esp32_arduino.cpp +30 -1
- esphome/components/wireguard/__init__.py +2 -2
- esphome/components/xl9535/xl9535.h +2 -0
- esphome/components/xxtea/__init__.py +3 -0
- esphome/components/xxtea/xxtea.cpp +46 -0
- esphome/components/xxtea/xxtea.h +26 -0
- esphome/components/yashima/yashima.cpp +2 -1
- esphome/config.py +9 -5
- esphome/config_validation.py +55 -17
- esphome/const.py +7 -10
- esphome/core/__init__.py +6 -13
- esphome/core/base_automation.h +1 -0
- esphome/core/config.py +57 -72
- esphome/core/defines.h +9 -1
- esphome/core/gpio.h +7 -0
- esphome/core/helpers.cpp +19 -15
- esphome/core/helpers.h +57 -8
- esphome/core/log.h +9 -7
- esphome/cpp_generator.py +2 -2
- esphome/espota2.py +3 -2
- esphome/loader.py +12 -4
- esphome/log.py +5 -7
- esphome/yaml_util.py +2 -2
- {esphome-2024.12.3.dist-info → esphome-2025.2.0b1.dist-info}/METADATA +12 -7
- {esphome-2024.12.3.dist-info → esphome-2025.2.0b1.dist-info}/RECORD +338 -289
- esphome/components/custom/binary_sensor/custom_binary_sensor.cpp +0 -16
- esphome/components/custom/binary_sensor/custom_binary_sensor.h +0 -26
- esphome/components/custom/climate/custom_climate.h +0 -22
- esphome/components/custom/cover/custom_cover.h +0 -21
- esphome/components/custom/light/custom_light_output.h +0 -24
- esphome/components/custom/output/custom_output.h +0 -37
- esphome/components/custom/sensor/custom_sensor.cpp +0 -16
- esphome/components/custom/sensor/custom_sensor.h +0 -24
- esphome/components/custom/switch/custom_switch.cpp +0 -16
- esphome/components/custom/switch/custom_switch.h +0 -24
- esphome/components/custom/text_sensor/custom_text_sensor.cpp +0 -16
- esphome/components/custom/text_sensor/custom_text_sensor.h +0 -26
- esphome/components/custom_component/custom_component.h +0 -28
- esphome/components/esp32_ble_server/ble_2901.cpp +0 -18
- esphome/components/esp32_ble_server/ble_2901.h +0 -19
- esphome/components/resistance_sampler/__init__.py +0 -6
- esphome/components/resistance_sampler/resistance_sampler.h +0 -10
- esphome/components/uptime/{sensor.py → sensor/__init__.py} +3 -3
- /esphome/components/uptime/{uptime_seconds_sensor.cpp → sensor/uptime_seconds_sensor.cpp} +0 -0
- /esphome/components/uptime/{uptime_seconds_sensor.h → sensor/uptime_seconds_sensor.h} +0 -0
- /esphome/components/uptime/{uptime_timestamp_sensor.cpp → sensor/uptime_timestamp_sensor.cpp} +0 -0
- /esphome/components/uptime/{uptime_timestamp_sensor.h → sensor/uptime_timestamp_sensor.h} +0 -0
- {esphome-2024.12.3.dist-info → esphome-2025.2.0b1.dist-info}/LICENSE +0 -0
- {esphome-2024.12.3.dist-info → esphome-2025.2.0b1.dist-info}/WHEEL +0 -0
- {esphome-2024.12.3.dist-info → esphome-2025.2.0b1.dist-info}/entry_points.txt +0 -0
- {esphome-2024.12.3.dist-info → esphome-2025.2.0b1.dist-info}/top_level.txt +0 -0
@@ -3,6 +3,8 @@
|
|
3
3
|
#include "esphome/components/network/util.h"
|
4
4
|
#include "udp_component.h"
|
5
5
|
|
6
|
+
#include "esphome/components/xxtea/xxtea.h"
|
7
|
+
|
6
8
|
namespace esphome {
|
7
9
|
namespace udp {
|
8
10
|
|
@@ -47,54 +49,7 @@ namespace udp {
|
|
47
49
|
*/
|
48
50
|
static const char *const TAG = "udp";
|
49
51
|
|
50
|
-
|
51
|
-
* XXTEA implementation, using 256 bit key.
|
52
|
-
*/
|
53
|
-
|
54
|
-
static const uint32_t DELTA = 0x9e3779b9;
|
55
|
-
#define MX ((((z >> 5) ^ (y << 2)) + ((y >> 3) ^ (z << 4))) ^ ((sum ^ y) + (k[(p ^ e) & 7] ^ z)))
|
56
|
-
|
57
|
-
/**
|
58
|
-
* Encrypt a block of data in-place
|
59
|
-
*/
|
60
|
-
|
61
|
-
static void xxtea_encrypt(uint32_t *v, size_t n, const uint32_t *k) {
|
62
|
-
uint32_t z, y, sum, e;
|
63
|
-
size_t p;
|
64
|
-
size_t q = 6 + 52 / n;
|
65
|
-
sum = 0;
|
66
|
-
z = v[n - 1];
|
67
|
-
while (q-- != 0) {
|
68
|
-
sum += DELTA;
|
69
|
-
e = (sum >> 2);
|
70
|
-
for (p = 0; p != n - 1; p++) {
|
71
|
-
y = v[p + 1];
|
72
|
-
z = v[p] += MX;
|
73
|
-
}
|
74
|
-
y = v[0];
|
75
|
-
z = v[n - 1] += MX;
|
76
|
-
}
|
77
|
-
}
|
78
|
-
|
79
|
-
static void xxtea_decrypt(uint32_t *v, size_t n, const uint32_t *k) {
|
80
|
-
uint32_t z, y, sum, e;
|
81
|
-
size_t p;
|
82
|
-
size_t q = 6 + 52 / n;
|
83
|
-
sum = q * DELTA;
|
84
|
-
y = v[0];
|
85
|
-
while (q-- != 0) {
|
86
|
-
e = (sum >> 2);
|
87
|
-
for (p = n - 1; p != 0; p--) {
|
88
|
-
z = v[p - 1];
|
89
|
-
y = v[p] -= MX;
|
90
|
-
}
|
91
|
-
z = v[n - 1];
|
92
|
-
y = v[0] -= MX;
|
93
|
-
sum -= DELTA;
|
94
|
-
}
|
95
|
-
}
|
96
|
-
|
97
|
-
inline static size_t round4(size_t value) { return (value + 3) & ~3; }
|
52
|
+
static size_t round4(size_t value) { return (value + 3) & ~3; }
|
98
53
|
|
99
54
|
union FuData {
|
100
55
|
uint32_t u32;
|
@@ -245,12 +200,23 @@ void UDPComponent::setup() {
|
|
245
200
|
}
|
246
201
|
struct sockaddr_in server {};
|
247
202
|
|
248
|
-
|
249
|
-
|
250
|
-
|
251
|
-
|
252
|
-
|
253
|
-
|
203
|
+
server.sin_family = AF_INET;
|
204
|
+
server.sin_addr.s_addr = ESPHOME_INADDR_ANY;
|
205
|
+
server.sin_port = htons(this->port_);
|
206
|
+
|
207
|
+
if (this->listen_address_.has_value()) {
|
208
|
+
struct ip_mreq imreq = {};
|
209
|
+
imreq.imr_interface.s_addr = ESPHOME_INADDR_ANY;
|
210
|
+
inet_aton(this->listen_address_.value().str().c_str(), &imreq.imr_multiaddr);
|
211
|
+
server.sin_addr.s_addr = imreq.imr_multiaddr.s_addr;
|
212
|
+
ESP_LOGV(TAG, "Join multicast %s", this->listen_address_.value().str().c_str());
|
213
|
+
err = this->listen_socket_->setsockopt(IPPROTO_IP, IP_ADD_MEMBERSHIP, &imreq, sizeof(imreq));
|
214
|
+
if (err < 0) {
|
215
|
+
ESP_LOGE(TAG, "Failed to set IP_ADD_MEMBERSHIP. Error %d", errno);
|
216
|
+
this->mark_failed();
|
217
|
+
this->status_set_error("Failed to set IP_ADD_MEMBERSHIP");
|
218
|
+
return;
|
219
|
+
}
|
254
220
|
}
|
255
221
|
|
256
222
|
err = this->listen_socket_->bind((struct sockaddr *) &server, sizeof(server));
|
@@ -301,7 +267,7 @@ void UDPComponent::flush_() {
|
|
301
267
|
memcpy(buffer, this->header_.data(), this->header_.size());
|
302
268
|
memcpy(buffer + header_len, this->data_.data(), this->data_.size());
|
303
269
|
if (this->is_encrypted_()) {
|
304
|
-
|
270
|
+
xxtea::encrypt(buffer + header_len, len, (uint32_t *) this->encryption_key_.data());
|
305
271
|
}
|
306
272
|
auto total_len = (header_len + len) * 4;
|
307
273
|
this->send_packet_(buffer, total_len);
|
@@ -492,7 +458,7 @@ void UDPComponent::process_(uint8_t *buf, const size_t len) {
|
|
492
458
|
#endif
|
493
459
|
|
494
460
|
if (!provider.encryption_key.empty()) {
|
495
|
-
|
461
|
+
xxtea::decrypt((uint32_t *) buf, (end - buf) / 4, (uint32_t *) provider.encryption_key.data());
|
496
462
|
}
|
497
463
|
byte = *buf++;
|
498
464
|
if (byte == ROLLING_CODE_KEY) {
|
@@ -569,6 +535,9 @@ void UDPComponent::dump_config() {
|
|
569
535
|
ESP_LOGCONFIG(TAG, " Ping-pong: %s", YESNO(this->ping_pong_enable_));
|
570
536
|
for (const auto &address : this->addresses_)
|
571
537
|
ESP_LOGCONFIG(TAG, " Address: %s", address.c_str());
|
538
|
+
if (this->listen_address_.has_value()) {
|
539
|
+
ESP_LOGCONFIG(TAG, " Listen address: %s", this->listen_address_.value().str().c_str());
|
540
|
+
}
|
572
541
|
#ifdef USE_SENSOR
|
573
542
|
for (auto sensor : this->sensors_)
|
574
543
|
ESP_LOGCONFIG(TAG, " Sensor: %s", sensor.id);
|
@@ -1,6 +1,7 @@
|
|
1
1
|
#pragma once
|
2
2
|
|
3
3
|
#include "esphome/core/component.h"
|
4
|
+
#include "esphome/components/network/ip_address.h"
|
4
5
|
#ifdef USE_SENSOR
|
5
6
|
#include "esphome/components/sensor/sensor.h"
|
6
7
|
#endif
|
@@ -69,6 +70,7 @@ class UDPComponent : public PollingComponent {
|
|
69
70
|
}
|
70
71
|
#endif
|
71
72
|
void add_address(const char *addr) { this->addresses_.emplace_back(addr); }
|
73
|
+
void set_listen_address(const char *listen_addr) { this->listen_address_ = network::IPAddress(listen_addr); }
|
72
74
|
void set_port(uint16_t port) { this->port_ = port; }
|
73
75
|
float get_setup_priority() const override { return setup_priority::AFTER_WIFI; }
|
74
76
|
|
@@ -143,6 +145,7 @@ class UDPComponent : public PollingComponent {
|
|
143
145
|
std::map<std::string, std::map<std::string, binary_sensor::BinarySensor *>> remote_binary_sensors_{};
|
144
146
|
#endif
|
145
147
|
|
148
|
+
optional<network::IPAddress> listen_address_{};
|
146
149
|
std::map<std::string, Provider> providers_{};
|
147
150
|
std::vector<uint8_t> ping_header_{};
|
148
151
|
std::vector<uint8_t> header_{};
|
@@ -1,11 +1,12 @@
|
|
1
1
|
import esphome.codegen as cg
|
2
|
-
import esphome.config_validation as cv
|
3
2
|
from esphome.components import sensor
|
3
|
+
import esphome.config_validation as cv
|
4
4
|
from esphome.const import (
|
5
5
|
CONF_EXTERNAL_TEMPERATURE,
|
6
6
|
CONF_HUMIDITY,
|
7
|
-
CONF_TEMPERATURE,
|
8
7
|
CONF_ID,
|
8
|
+
CONF_TARGET_TEMPERATURE,
|
9
|
+
CONF_TEMPERATURE,
|
9
10
|
DEVICE_CLASS_HUMIDITY,
|
10
11
|
DEVICE_CLASS_TEMPERATURE,
|
11
12
|
STATE_CLASS_MEASUREMENT,
|
@@ -14,10 +15,10 @@ from esphome.const import (
|
|
14
15
|
)
|
15
16
|
|
16
17
|
from .. import (
|
17
|
-
uponor_smatrix_ns,
|
18
|
-
UponorSmatrixDevice,
|
19
18
|
UPONOR_SMATRIX_DEVICE_SCHEMA,
|
19
|
+
UponorSmatrixDevice,
|
20
20
|
register_uponor_smatrix_device,
|
21
|
+
uponor_smatrix_ns,
|
21
22
|
)
|
22
23
|
|
23
24
|
DEPENDENCIES = ["uponor_smatrix"]
|
@@ -50,6 +51,12 @@ CONFIG_SCHEMA = cv.COMPONENT_SCHEMA.extend(
|
|
50
51
|
device_class=DEVICE_CLASS_HUMIDITY,
|
51
52
|
state_class=STATE_CLASS_MEASUREMENT,
|
52
53
|
),
|
54
|
+
cv.Optional(CONF_TARGET_TEMPERATURE): sensor.sensor_schema(
|
55
|
+
unit_of_measurement=UNIT_CELSIUS,
|
56
|
+
accuracy_decimals=1,
|
57
|
+
device_class=DEVICE_CLASS_TEMPERATURE,
|
58
|
+
state_class=STATE_CLASS_MEASUREMENT,
|
59
|
+
),
|
53
60
|
}
|
54
61
|
).extend(UPONOR_SMATRIX_DEVICE_SCHEMA)
|
55
62
|
|
@@ -68,3 +75,6 @@ async def to_code(config):
|
|
68
75
|
if humidity_config := config.get(CONF_HUMIDITY):
|
69
76
|
sens = await sensor.new_sensor(humidity_config)
|
70
77
|
cg.add(var.set_humidity_sensor(sens))
|
78
|
+
if target_temperature_config := config.get(CONF_TARGET_TEMPERATURE):
|
79
|
+
sens = await sensor.new_sensor(target_temperature_config)
|
80
|
+
cg.add(var.set_target_temperature_sensor(sens))
|
@@ -12,6 +12,7 @@ void UponorSmatrixSensor::dump_config() {
|
|
12
12
|
LOG_SENSOR(" ", "Temperature", this->temperature_sensor_);
|
13
13
|
LOG_SENSOR(" ", "External Temperature", this->external_temperature_sensor_);
|
14
14
|
LOG_SENSOR(" ", "Humidity", this->humidity_sensor_);
|
15
|
+
LOG_SENSOR(" ", "Target Temperature", this->target_temperature_sensor_);
|
15
16
|
}
|
16
17
|
|
17
18
|
void UponorSmatrixSensor::on_device_data(const UponorSmatrixData *data, size_t data_len) {
|
@@ -29,6 +30,10 @@ void UponorSmatrixSensor::on_device_data(const UponorSmatrixData *data, size_t d
|
|
29
30
|
if (this->humidity_sensor_ != nullptr)
|
30
31
|
this->humidity_sensor_->publish_state(data[i].value & 0x00FF);
|
31
32
|
break;
|
33
|
+
case UPONOR_ID_TARGET_TEMP:
|
34
|
+
if (this->target_temperature_sensor_ != nullptr)
|
35
|
+
this->target_temperature_sensor_->publish_state(raw_to_celsius(data[i].value));
|
36
|
+
break;
|
32
37
|
}
|
33
38
|
}
|
34
39
|
}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import esphome.codegen as cg
|
2
|
+
from esphome.components import text_sensor
|
3
|
+
import esphome.config_validation as cv
|
4
|
+
from esphome.const import ENTITY_CATEGORY_DIAGNOSTIC, ICON_TIMER
|
5
|
+
|
6
|
+
uptime_ns = cg.esphome_ns.namespace("uptime")
|
7
|
+
UptimeTextSensor = uptime_ns.class_(
|
8
|
+
"UptimeTextSensor", text_sensor.TextSensor, cg.PollingComponent
|
9
|
+
)
|
10
|
+
CONFIG_SCHEMA = text_sensor.text_sensor_schema(
|
11
|
+
UptimeTextSensor,
|
12
|
+
icon=ICON_TIMER,
|
13
|
+
entity_category=ENTITY_CATEGORY_DIAGNOSTIC,
|
14
|
+
).extend(cv.polling_component_schema("30s"))
|
15
|
+
|
16
|
+
|
17
|
+
async def to_code(config):
|
18
|
+
var = await text_sensor.new_text_sensor(config)
|
19
|
+
await cg.register_component(var, config)
|
@@ -0,0 +1,63 @@
|
|
1
|
+
#include "uptime_text_sensor.h"
|
2
|
+
|
3
|
+
#include "esphome/core/hal.h"
|
4
|
+
#include "esphome/core/helpers.h"
|
5
|
+
#include "esphome/core/log.h"
|
6
|
+
|
7
|
+
namespace esphome {
|
8
|
+
namespace uptime {
|
9
|
+
|
10
|
+
static const char *const TAG = "uptime.sensor";
|
11
|
+
|
12
|
+
void UptimeTextSensor::setup() {
|
13
|
+
this->last_ms_ = millis();
|
14
|
+
if (this->last_ms_ < 60 * 1000)
|
15
|
+
this->last_ms_ = 0;
|
16
|
+
this->update();
|
17
|
+
}
|
18
|
+
|
19
|
+
void UptimeTextSensor::update() {
|
20
|
+
auto now = millis();
|
21
|
+
// get whole seconds since last update. Note that even if the millis count has overflowed between updates,
|
22
|
+
// the difference will still be correct due to the way twos-complement arithmetic works.
|
23
|
+
uint32_t delta = now - this->last_ms_;
|
24
|
+
this->last_ms_ = now - delta % 1000; // save remainder for next update
|
25
|
+
delta /= 1000;
|
26
|
+
this->uptime_ += delta;
|
27
|
+
auto uptime = this->uptime_;
|
28
|
+
unsigned interval = this->get_update_interval() / 1000;
|
29
|
+
std::string buffer{};
|
30
|
+
// display from the largest unit that corresponds to the update interval, drop larger units that are zero.
|
31
|
+
while (true) { // enable use of break for early exit
|
32
|
+
unsigned remainder = uptime % 60;
|
33
|
+
uptime /= 60;
|
34
|
+
if (interval < 30) {
|
35
|
+
buffer.insert(0, str_sprintf("%us", remainder));
|
36
|
+
if (uptime == 0)
|
37
|
+
break;
|
38
|
+
}
|
39
|
+
remainder = uptime % 60;
|
40
|
+
uptime /= 60;
|
41
|
+
if (interval < 1800) {
|
42
|
+
buffer.insert(0, str_sprintf("%um", remainder));
|
43
|
+
if (uptime == 0)
|
44
|
+
break;
|
45
|
+
}
|
46
|
+
remainder = uptime % 24;
|
47
|
+
uptime /= 24;
|
48
|
+
if (interval < 12 * 3600) {
|
49
|
+
buffer.insert(0, str_sprintf("%uh", remainder));
|
50
|
+
if (uptime == 0)
|
51
|
+
break;
|
52
|
+
}
|
53
|
+
buffer.insert(0, str_sprintf("%ud", (unsigned) uptime));
|
54
|
+
break;
|
55
|
+
}
|
56
|
+
this->publish_state(buffer);
|
57
|
+
}
|
58
|
+
|
59
|
+
float UptimeTextSensor::get_setup_priority() const { return setup_priority::HARDWARE; }
|
60
|
+
void UptimeTextSensor::dump_config() { LOG_TEXT_SENSOR("", "Uptime Text Sensor", this); }
|
61
|
+
|
62
|
+
} // namespace uptime
|
63
|
+
} // namespace esphome
|
@@ -0,0 +1,25 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
#include "esphome/core/defines.h"
|
4
|
+
|
5
|
+
#include "esphome/components/text_sensor/text_sensor.h"
|
6
|
+
#include "esphome/core/component.h"
|
7
|
+
|
8
|
+
namespace esphome {
|
9
|
+
namespace uptime {
|
10
|
+
|
11
|
+
class UptimeTextSensor : public text_sensor::TextSensor, public PollingComponent {
|
12
|
+
public:
|
13
|
+
void update() override;
|
14
|
+
void dump_config() override;
|
15
|
+
void setup() override;
|
16
|
+
|
17
|
+
float get_setup_priority() const override;
|
18
|
+
|
19
|
+
protected:
|
20
|
+
uint32_t uptime_{0}; // uptime in seconds, will overflow after 136 years
|
21
|
+
uint32_t last_ms_{0};
|
22
|
+
};
|
23
|
+
|
24
|
+
} // namespace uptime
|
25
|
+
} // namespace esphome
|
@@ -1,4 +1,5 @@
|
|
1
1
|
#include "voice_assistant.h"
|
2
|
+
#include "esphome/core/defines.h"
|
2
3
|
|
3
4
|
#ifdef USE_VOICE_ASSISTANT
|
4
5
|
|
@@ -127,7 +128,7 @@ void VoiceAssistant::clear_buffers_() {
|
|
127
128
|
}
|
128
129
|
|
129
130
|
#ifdef USE_SPEAKER
|
130
|
-
if (this->speaker_buffer_ != nullptr) {
|
131
|
+
if ((this->speaker_ != nullptr) && (this->speaker_buffer_ != nullptr)) {
|
131
132
|
memset(this->speaker_buffer_, 0, SPEAKER_BUFFER_SIZE);
|
132
133
|
|
133
134
|
this->speaker_buffer_size_ = 0;
|
@@ -159,7 +160,7 @@ void VoiceAssistant::deallocate_buffers_() {
|
|
159
160
|
this->input_buffer_ = nullptr;
|
160
161
|
|
161
162
|
#ifdef USE_SPEAKER
|
162
|
-
if (this->speaker_buffer_ != nullptr) {
|
163
|
+
if ((this->speaker_ != nullptr) && (this->speaker_buffer_ != nullptr)) {
|
163
164
|
ExternalRAMAllocator<uint8_t> speaker_deallocator(ExternalRAMAllocator<uint8_t>::ALLOW_FAILURE);
|
164
165
|
speaker_deallocator.deallocate(this->speaker_buffer_, SPEAKER_BUFFER_SIZE);
|
165
166
|
this->speaker_buffer_ = nullptr;
|
@@ -389,14 +390,7 @@ void VoiceAssistant::loop() {
|
|
389
390
|
}
|
390
391
|
#endif
|
391
392
|
if (playing) {
|
392
|
-
this->
|
393
|
-
this->cancel_timeout("speaker-timeout");
|
394
|
-
this->set_state_(State::IDLE, State::IDLE);
|
395
|
-
|
396
|
-
api::VoiceAssistantAnnounceFinished msg;
|
397
|
-
msg.success = true;
|
398
|
-
this->api_client_->send_voice_assistant_announce_finished(msg);
|
399
|
-
});
|
393
|
+
this->start_playback_timeout_();
|
400
394
|
}
|
401
395
|
break;
|
402
396
|
}
|
@@ -614,6 +608,8 @@ void VoiceAssistant::request_stop() {
|
|
614
608
|
this->desired_state_ = State::IDLE;
|
615
609
|
break;
|
616
610
|
case State::AWAITING_RESPONSE:
|
611
|
+
this->signal_stop_();
|
612
|
+
break;
|
617
613
|
case State::STREAMING_RESPONSE:
|
618
614
|
case State::RESPONSE_FINISHED:
|
619
615
|
break; // Let the incoming audio stream finish then it will go to idle.
|
@@ -631,6 +627,17 @@ void VoiceAssistant::signal_stop_() {
|
|
631
627
|
this->api_client_->send_voice_assistant_request(msg);
|
632
628
|
}
|
633
629
|
|
630
|
+
void VoiceAssistant::start_playback_timeout_() {
|
631
|
+
this->set_timeout("playing", 100, [this]() {
|
632
|
+
this->cancel_timeout("speaker-timeout");
|
633
|
+
this->set_state_(State::IDLE, State::IDLE);
|
634
|
+
|
635
|
+
api::VoiceAssistantAnnounceFinished msg;
|
636
|
+
msg.success = true;
|
637
|
+
this->api_client_->send_voice_assistant_announce_finished(msg);
|
638
|
+
});
|
639
|
+
}
|
640
|
+
|
634
641
|
void VoiceAssistant::on_event(const api::VoiceAssistantEventResponse &msg) {
|
635
642
|
ESP_LOGD(TAG, "Event Type: %" PRId32, msg.event_type);
|
636
643
|
switch (msg.event_type) {
|
@@ -715,6 +722,8 @@ void VoiceAssistant::on_event(const api::VoiceAssistantEventResponse &msg) {
|
|
715
722
|
#ifdef USE_MEDIA_PLAYER
|
716
723
|
if (this->media_player_ != nullptr) {
|
717
724
|
this->media_player_->make_call().set_media_url(url).set_announcement(true).perform();
|
725
|
+
// Start the playback timeout, as the media player state isn't immediately updated
|
726
|
+
this->start_playback_timeout_();
|
718
727
|
}
|
719
728
|
#endif
|
720
729
|
this->tts_end_trigger_->trigger(url);
|
@@ -725,7 +734,11 @@ void VoiceAssistant::on_event(const api::VoiceAssistantEventResponse &msg) {
|
|
725
734
|
}
|
726
735
|
case api::enums::VOICE_ASSISTANT_RUN_END: {
|
727
736
|
ESP_LOGD(TAG, "Assist Pipeline ended");
|
728
|
-
if (this->state_ == State::
|
737
|
+
if ((this->state_ == State::STARTING_PIPELINE) || (this->state_ == State::AWAITING_RESPONSE)) {
|
738
|
+
// Pipeline ended before starting microphone
|
739
|
+
// Or there wasn't a TTS start event ("nevermind")
|
740
|
+
this->set_state_(State::IDLE, State::IDLE);
|
741
|
+
} else if (this->state_ == State::STREAMING_MICROPHONE) {
|
729
742
|
this->ring_buffer_->reset();
|
730
743
|
#ifdef USE_ESP_ADF
|
731
744
|
if (this->use_wake_word_) {
|
@@ -736,9 +749,6 @@ void VoiceAssistant::on_event(const api::VoiceAssistantEventResponse &msg) {
|
|
736
749
|
{
|
737
750
|
this->set_state_(State::IDLE, State::IDLE);
|
738
751
|
}
|
739
|
-
} else if (this->state_ == State::AWAITING_RESPONSE) {
|
740
|
-
// No TTS start event ("nevermind")
|
741
|
-
this->set_state_(State::IDLE, State::IDLE);
|
742
752
|
}
|
743
753
|
this->defer([this]() { this->end_trigger_->trigger(); });
|
744
754
|
break;
|
@@ -40,6 +40,7 @@ enum VoiceAssistantFeature : uint32_t {
|
|
40
40
|
FEATURE_SPEAKER = 1 << 1,
|
41
41
|
FEATURE_API_AUDIO = 1 << 2,
|
42
42
|
FEATURE_TIMERS = 1 << 3,
|
43
|
+
FEATURE_ANNOUNCE = 1 << 4,
|
43
44
|
};
|
44
45
|
|
45
46
|
enum class State {
|
@@ -136,6 +137,12 @@ class VoiceAssistant : public Component {
|
|
136
137
|
flags |= VoiceAssistantFeature::FEATURE_TIMERS;
|
137
138
|
}
|
138
139
|
|
140
|
+
#ifdef USE_MEDIA_PLAYER
|
141
|
+
if (this->media_player_ != nullptr) {
|
142
|
+
flags |= VoiceAssistantFeature::FEATURE_ANNOUNCE;
|
143
|
+
}
|
144
|
+
#endif
|
145
|
+
|
139
146
|
return flags;
|
140
147
|
}
|
141
148
|
|
@@ -209,6 +216,7 @@ class VoiceAssistant : public Component {
|
|
209
216
|
void set_state_(State state);
|
210
217
|
void set_state_(State state, State desired_state);
|
211
218
|
void signal_stop_();
|
219
|
+
void start_playback_timeout_();
|
212
220
|
|
213
221
|
std::unique_ptr<socket::Socket> socket_ = nullptr;
|
214
222
|
struct sockaddr_storage dest_addr_;
|
@@ -24,6 +24,7 @@ WaveshareEPaper = waveshare_epaper_ns.class_("WaveshareEPaper", WaveshareEPaperB
|
|
24
24
|
WaveshareEPaperBWR = waveshare_epaper_ns.class_(
|
25
25
|
"WaveshareEPaperBWR", WaveshareEPaperBase
|
26
26
|
)
|
27
|
+
WaveshareEPaper7C = waveshare_epaper_ns.class_("WaveshareEPaper7C", WaveshareEPaperBase)
|
27
28
|
WaveshareEPaperTypeA = waveshare_epaper_ns.class_(
|
28
29
|
"WaveshareEPaperTypeA", WaveshareEPaper
|
29
30
|
)
|
@@ -52,21 +53,32 @@ WaveshareEPaper2P9InV2R2 = waveshare_epaper_ns.class_(
|
|
52
53
|
"WaveshareEPaper2P9InV2R2", WaveshareEPaper
|
53
54
|
)
|
54
55
|
GDEW029T5 = waveshare_epaper_ns.class_("GDEW029T5", WaveshareEPaper)
|
56
|
+
GDEY029T94 = waveshare_epaper_ns.class_("GDEY029T94", WaveshareEPaper)
|
55
57
|
WaveshareEPaper2P9InDKE = waveshare_epaper_ns.class_(
|
56
58
|
"WaveshareEPaper2P9InDKE", WaveshareEPaper
|
57
59
|
)
|
60
|
+
GDEY042T81 = waveshare_epaper_ns.class_("GDEY042T81", WaveshareEPaper)
|
61
|
+
WaveshareEPaper2P9InD = waveshare_epaper_ns.class_(
|
62
|
+
"WaveshareEPaper2P9InD", WaveshareEPaper
|
63
|
+
)
|
58
64
|
WaveshareEPaper4P2In = waveshare_epaper_ns.class_(
|
59
65
|
"WaveshareEPaper4P2In", WaveshareEPaper
|
60
66
|
)
|
61
67
|
WaveshareEPaper4P2InBV2 = waveshare_epaper_ns.class_(
|
62
68
|
"WaveshareEPaper4P2InBV2", WaveshareEPaper
|
63
69
|
)
|
70
|
+
WaveshareEPaper4P2InBV2BWR = waveshare_epaper_ns.class_(
|
71
|
+
"WaveshareEPaper4P2InBV2BWR", WaveshareEPaperBWR
|
72
|
+
)
|
64
73
|
WaveshareEPaper5P8In = waveshare_epaper_ns.class_(
|
65
74
|
"WaveshareEPaper5P8In", WaveshareEPaper
|
66
75
|
)
|
67
76
|
WaveshareEPaper5P8InV2 = waveshare_epaper_ns.class_(
|
68
77
|
"WaveshareEPaper5P8InV2", WaveshareEPaper
|
69
78
|
)
|
79
|
+
WaveshareEPaper7P3InF = waveshare_epaper_ns.class_(
|
80
|
+
"WaveshareEPaper7P3InF", WaveshareEPaper7C
|
81
|
+
)
|
70
82
|
WaveshareEPaper7P5In = waveshare_epaper_ns.class_(
|
71
83
|
"WaveshareEPaper7P5In", WaveshareEPaper
|
72
84
|
)
|
@@ -88,6 +100,9 @@ WaveshareEPaper7P5InV2 = waveshare_epaper_ns.class_(
|
|
88
100
|
WaveshareEPaper7P5InV2alt = waveshare_epaper_ns.class_(
|
89
101
|
"WaveshareEPaper7P5InV2alt", WaveshareEPaper
|
90
102
|
)
|
103
|
+
WaveshareEPaper7P5InV2P = waveshare_epaper_ns.class_(
|
104
|
+
"WaveshareEPaper7P5InV2P", WaveshareEPaper
|
105
|
+
)
|
91
106
|
WaveshareEPaper7P5InHDB = waveshare_epaper_ns.class_(
|
92
107
|
"WaveshareEPaper7P5InHDB", WaveshareEPaper
|
93
108
|
)
|
@@ -127,12 +142,17 @@ MODELS = {
|
|
127
142
|
"2.70inv2": ("b", WaveshareEPaper2P7InV2),
|
128
143
|
"2.90in-b": ("b", WaveshareEPaper2P9InB),
|
129
144
|
"2.90in-bv3": ("b", WaveshareEPaper2P9InBV3),
|
145
|
+
"gdey029t94": ("c", GDEY029T94),
|
130
146
|
"2.90inv2-r2": ("c", WaveshareEPaper2P9InV2R2),
|
147
|
+
"2.90in-d": ("b", WaveshareEPaper2P9InD),
|
131
148
|
"2.90in-dke": ("c", WaveshareEPaper2P9InDKE),
|
149
|
+
"gdey042t81": ("c", GDEY042T81),
|
132
150
|
"4.20in": ("b", WaveshareEPaper4P2In),
|
133
151
|
"4.20in-bv2": ("b", WaveshareEPaper4P2InBV2),
|
152
|
+
"4.20in-bv2-bwr": ("b", WaveshareEPaper4P2InBV2BWR),
|
134
153
|
"5.83in": ("b", WaveshareEPaper5P8In),
|
135
154
|
"5.83inv2": ("b", WaveshareEPaper5P8InV2),
|
155
|
+
"7.30in-f": ("b", WaveshareEPaper7P3InF),
|
136
156
|
"7.50in": ("b", WaveshareEPaper7P5In),
|
137
157
|
"7.50in-bv2": ("b", WaveshareEPaper7P5InBV2),
|
138
158
|
"7.50in-bv3": ("b", WaveshareEPaper7P5InBV3),
|
@@ -140,10 +160,11 @@ MODELS = {
|
|
140
160
|
"7.50in-bc": ("b", WaveshareEPaper7P5InBC),
|
141
161
|
"7.50inv2": ("b", WaveshareEPaper7P5InV2),
|
142
162
|
"7.50inv2alt": ("b", WaveshareEPaper7P5InV2alt),
|
163
|
+
"7.50inv2p": ("c", WaveshareEPaper7P5InV2P),
|
143
164
|
"7.50in-hd-b": ("b", WaveshareEPaper7P5InHDB),
|
144
165
|
"2.13in-ttgo-dke": ("c", WaveshareEPaper2P13InDKE),
|
145
166
|
"2.13inv3": ("c", WaveshareEPaper2P13InV3),
|
146
|
-
"1.54in-m5coreink-m09": ("
|
167
|
+
"1.54in-m5coreink-m09": ("b", GDEW0154M09),
|
147
168
|
"13.3in-k": ("b", WaveshareEPaper13P3InK),
|
148
169
|
}
|
149
170
|
|
@@ -72,7 +72,8 @@ void WaveshareEPaper2P13InV3::write_buffer_(uint8_t cmd, int top, int bottom) {
|
|
72
72
|
this->set_window_(top, bottom);
|
73
73
|
this->command(cmd);
|
74
74
|
this->start_data_();
|
75
|
-
|
75
|
+
|
76
|
+
auto width_bytes = this->get_width_controller() / 8;
|
76
77
|
this->write_array(this->buffer_ + top * width_bytes, (bottom - top) * width_bytes);
|
77
78
|
this->end_data_();
|
78
79
|
}
|
@@ -86,7 +87,11 @@ void WaveshareEPaper2P13InV3::send_reset_() {
|
|
86
87
|
}
|
87
88
|
|
88
89
|
void WaveshareEPaper2P13InV3::setup() {
|
89
|
-
|
90
|
+
this->init_internal_(this->get_buffer_length_());
|
91
|
+
this->setup_pins_();
|
92
|
+
this->spi_setup();
|
93
|
+
this->reset_();
|
94
|
+
|
90
95
|
delay(20);
|
91
96
|
this->send_reset_();
|
92
97
|
// as a one-off delay this is not worth working around.
|
@@ -162,7 +167,8 @@ void WaveshareEPaper2P13InV3::display() {
|
|
162
167
|
}
|
163
168
|
}
|
164
169
|
|
165
|
-
int WaveshareEPaper2P13InV3::
|
170
|
+
int WaveshareEPaper2P13InV3::get_width_controller() { return 128; }
|
171
|
+
int WaveshareEPaper2P13InV3::get_width_internal() { return 122; }
|
166
172
|
|
167
173
|
int WaveshareEPaper2P13InV3::get_height_internal() { return 250; }
|
168
174
|
|