esphome 2025.8.3__py3-none-any.whl → 2025.9.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 +36 -42
- esphome/components/absolute_humidity/absolute_humidity.cpp +3 -5
- esphome/components/adc/adc_sensor_esp32.cpp +29 -6
- 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 +34 -23
- esphome/components/api/api_connection.h +20 -39
- 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 +20 -2
- esphome/components/api/api_pb2.h +146 -141
- esphome/components/api/api_pb2_dump.cpp +12 -1
- 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 +3 -2
- 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_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_client/ble_client_base.cpp +7 -3
- esphome/components/esp32_ble_tracker/__init__.py +2 -2
- esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +9 -44
- 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 +1 -1
- esphome/components/event/__init__.py +2 -2
- esphome/components/event/event.h +4 -4
- 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/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/kmeteriso/kmeteriso.cpp +1 -1
- 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 +39 -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/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/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 +58 -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/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 +3 -3
- esphome/components/wifi/wifi_component_esp_idf.cpp +2 -0
- esphome/config_validation.py +2 -2
- esphome/const.py +2 -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 +26 -13
- esphome/core/helpers.h +4 -3
- esphome/core/ring_buffer.cpp +6 -2
- esphome/core/ring_buffer.h +2 -1
- esphome/core/scheduler.cpp +175 -94
- esphome/core/scheduler.h +66 -35
- 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.3.dist-info → esphome-2025.9.0b1.dist-info}/METADATA +9 -9
- {esphome-2025.8.3.dist-info → esphome-2025.9.0b1.dist-info}/RECORD +345 -314
- /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.3.dist-info → esphome-2025.9.0b1.dist-info}/WHEEL +0 -0
- {esphome-2025.8.3.dist-info → esphome-2025.9.0b1.dist-info}/entry_points.txt +0 -0
- {esphome-2025.8.3.dist-info → esphome-2025.9.0b1.dist-info}/licenses/LICENSE +0 -0
- {esphome-2025.8.3.dist-info → esphome-2025.9.0b1.dist-info}/top_level.txt +0 -0
@@ -255,4 +255,233 @@ DriverChip(
|
|
255
255
|
),
|
256
256
|
)
|
257
257
|
|
258
|
+
DriverChip(
|
259
|
+
"JC3636W518V2",
|
260
|
+
height=360,
|
261
|
+
width=360,
|
262
|
+
offset_height=1,
|
263
|
+
draw_rounding=1,
|
264
|
+
cs_pin=10,
|
265
|
+
reset_pin=47,
|
266
|
+
invert_colors=True,
|
267
|
+
color_order=MODE_RGB,
|
268
|
+
bus_mode=TYPE_QUAD,
|
269
|
+
data_rate="40MHz",
|
270
|
+
initsequence=(
|
271
|
+
(0xF0, 0x28),
|
272
|
+
(0xF2, 0x28),
|
273
|
+
(0x73, 0xF0),
|
274
|
+
(0x7C, 0xD1),
|
275
|
+
(0x83, 0xE0),
|
276
|
+
(0x84, 0x61),
|
277
|
+
(0xF2, 0x82),
|
278
|
+
(0xF0, 0x00),
|
279
|
+
(0xF0, 0x01),
|
280
|
+
(0xF1, 0x01),
|
281
|
+
(0xB0, 0x56),
|
282
|
+
(0xB1, 0x4D),
|
283
|
+
(0xB2, 0x24),
|
284
|
+
(0xB4, 0x87),
|
285
|
+
(0xB5, 0x44),
|
286
|
+
(0xB6, 0x8B),
|
287
|
+
(0xB7, 0x40),
|
288
|
+
(0xB8, 0x86),
|
289
|
+
(0xBA, 0x00),
|
290
|
+
(0xBB, 0x08),
|
291
|
+
(0xBC, 0x08),
|
292
|
+
(0xBD, 0x00),
|
293
|
+
(0xC0, 0x80),
|
294
|
+
(0xC1, 0x10),
|
295
|
+
(0xC2, 0x37),
|
296
|
+
(0xC3, 0x80),
|
297
|
+
(0xC4, 0x10),
|
298
|
+
(0xC5, 0x37),
|
299
|
+
(0xC6, 0xA9),
|
300
|
+
(0xC7, 0x41),
|
301
|
+
(0xC8, 0x01),
|
302
|
+
(0xC9, 0xA9),
|
303
|
+
(0xCA, 0x41),
|
304
|
+
(0xCB, 0x01),
|
305
|
+
(0xD0, 0x91),
|
306
|
+
(0xD1, 0x68),
|
307
|
+
(0xD2, 0x68),
|
308
|
+
(0xF5, 0x00, 0xA5),
|
309
|
+
(0xDD, 0x4F),
|
310
|
+
(0xDE, 0x4F),
|
311
|
+
(0xF1, 0x10),
|
312
|
+
(0xF0, 0x00),
|
313
|
+
(0xF0, 0x02),
|
314
|
+
(
|
315
|
+
0xE0,
|
316
|
+
0xF0,
|
317
|
+
0x0A,
|
318
|
+
0x10,
|
319
|
+
0x09,
|
320
|
+
0x09,
|
321
|
+
0x36,
|
322
|
+
0x35,
|
323
|
+
0x33,
|
324
|
+
0x4A,
|
325
|
+
0x29,
|
326
|
+
0x15,
|
327
|
+
0x15,
|
328
|
+
0x2E,
|
329
|
+
0x34,
|
330
|
+
),
|
331
|
+
(
|
332
|
+
0xE1,
|
333
|
+
0xF0,
|
334
|
+
0x0A,
|
335
|
+
0x0F,
|
336
|
+
0x08,
|
337
|
+
0x08,
|
338
|
+
0x05,
|
339
|
+
0x34,
|
340
|
+
0x33,
|
341
|
+
0x4A,
|
342
|
+
0x39,
|
343
|
+
0x15,
|
344
|
+
0x15,
|
345
|
+
0x2D,
|
346
|
+
0x33,
|
347
|
+
),
|
348
|
+
(0xF0, 0x10),
|
349
|
+
(0xF3, 0x10),
|
350
|
+
(0xE0, 0x07),
|
351
|
+
(0xE1, 0x00),
|
352
|
+
(0xE2, 0x00),
|
353
|
+
(0xE3, 0x00),
|
354
|
+
(0xE4, 0xE0),
|
355
|
+
(0xE5, 0x06),
|
356
|
+
(0xE6, 0x21),
|
357
|
+
(0xE7, 0x01),
|
358
|
+
(0xE8, 0x05),
|
359
|
+
(0xE9, 0x02),
|
360
|
+
(0xEA, 0xDA),
|
361
|
+
(0xEB, 0x00),
|
362
|
+
(0xEC, 0x00),
|
363
|
+
(0xED, 0x0F),
|
364
|
+
(0xEE, 0x00),
|
365
|
+
(0xEF, 0x00),
|
366
|
+
(0xF8, 0x00),
|
367
|
+
(0xF9, 0x00),
|
368
|
+
(0xFA, 0x00),
|
369
|
+
(0xFB, 0x00),
|
370
|
+
(0xFC, 0x00),
|
371
|
+
(0xFD, 0x00),
|
372
|
+
(0xFE, 0x00),
|
373
|
+
(0xFF, 0x00),
|
374
|
+
(0x60, 0x40),
|
375
|
+
(0x61, 0x04),
|
376
|
+
(0x62, 0x00),
|
377
|
+
(0x63, 0x42),
|
378
|
+
(0x64, 0xD9),
|
379
|
+
(0x65, 0x00),
|
380
|
+
(0x66, 0x00),
|
381
|
+
(0x67, 0x00),
|
382
|
+
(0x68, 0x00),
|
383
|
+
(0x69, 0x00),
|
384
|
+
(0x6A, 0x00),
|
385
|
+
(0x6B, 0x00),
|
386
|
+
(0x70, 0x40),
|
387
|
+
(0x71, 0x03),
|
388
|
+
(0x72, 0x00),
|
389
|
+
(0x73, 0x42),
|
390
|
+
(0x74, 0xD8),
|
391
|
+
(0x75, 0x00),
|
392
|
+
(0x76, 0x00),
|
393
|
+
(0x77, 0x00),
|
394
|
+
(0x78, 0x00),
|
395
|
+
(0x79, 0x00),
|
396
|
+
(0x7A, 0x00),
|
397
|
+
(0x7B, 0x00),
|
398
|
+
(0x80, 0x48),
|
399
|
+
(0x81, 0x00),
|
400
|
+
(0x82, 0x06),
|
401
|
+
(0x83, 0x02),
|
402
|
+
(0x84, 0xD6),
|
403
|
+
(0x85, 0x04),
|
404
|
+
(0x86, 0x00),
|
405
|
+
(0x87, 0x00),
|
406
|
+
(0x88, 0x48),
|
407
|
+
(0x89, 0x00),
|
408
|
+
(0x8A, 0x08),
|
409
|
+
(0x8B, 0x02),
|
410
|
+
(0x8C, 0xD8),
|
411
|
+
(0x8D, 0x04),
|
412
|
+
(0x8E, 0x00),
|
413
|
+
(0x8F, 0x00),
|
414
|
+
(0x90, 0x48),
|
415
|
+
(0x91, 0x00),
|
416
|
+
(0x92, 0x0A),
|
417
|
+
(0x93, 0x02),
|
418
|
+
(0x94, 0xDA),
|
419
|
+
(0x95, 0x04),
|
420
|
+
(0x96, 0x00),
|
421
|
+
(0x97, 0x00),
|
422
|
+
(0x98, 0x48),
|
423
|
+
(0x99, 0x00),
|
424
|
+
(0x9A, 0x0C),
|
425
|
+
(0x9B, 0x02),
|
426
|
+
(0x9C, 0xDC),
|
427
|
+
(0x9D, 0x04),
|
428
|
+
(0x9E, 0x00),
|
429
|
+
(0x9F, 0x00),
|
430
|
+
(0xA0, 0x48),
|
431
|
+
(0xA1, 0x00),
|
432
|
+
(0xA2, 0x05),
|
433
|
+
(0xA3, 0x02),
|
434
|
+
(0xA4, 0xD5),
|
435
|
+
(0xA5, 0x04),
|
436
|
+
(0xA6, 0x00),
|
437
|
+
(0xA7, 0x00),
|
438
|
+
(0xA8, 0x48),
|
439
|
+
(0xA9, 0x00),
|
440
|
+
(0xAA, 0x07),
|
441
|
+
(0xAB, 0x02),
|
442
|
+
(0xAC, 0xD7),
|
443
|
+
(0xAD, 0x04),
|
444
|
+
(0xAE, 0x00),
|
445
|
+
(0xAF, 0x00),
|
446
|
+
(0xB0, 0x48),
|
447
|
+
(0xB1, 0x00),
|
448
|
+
(0xB2, 0x09),
|
449
|
+
(0xB3, 0x02),
|
450
|
+
(0xB4, 0xD9),
|
451
|
+
(0xB5, 0x04),
|
452
|
+
(0xB6, 0x00),
|
453
|
+
(0xB7, 0x00),
|
454
|
+
(0xB8, 0x48),
|
455
|
+
(0xB9, 0x00),
|
456
|
+
(0xBA, 0x0B),
|
457
|
+
(0xBB, 0x02),
|
458
|
+
(0xBC, 0xDB),
|
459
|
+
(0xBD, 0x04),
|
460
|
+
(0xBE, 0x00),
|
461
|
+
(0xBF, 0x00),
|
462
|
+
(0xC0, 0x10),
|
463
|
+
(0xC1, 0x47),
|
464
|
+
(0xC2, 0x56),
|
465
|
+
(0xC3, 0x65),
|
466
|
+
(0xC4, 0x74),
|
467
|
+
(0xC5, 0x88),
|
468
|
+
(0xC6, 0x99),
|
469
|
+
(0xC7, 0x01),
|
470
|
+
(0xC8, 0xBB),
|
471
|
+
(0xC9, 0xAA),
|
472
|
+
(0xD0, 0x10),
|
473
|
+
(0xD1, 0x47),
|
474
|
+
(0xD2, 0x56),
|
475
|
+
(0xD3, 0x65),
|
476
|
+
(0xD4, 0x74),
|
477
|
+
(0xD5, 0x88),
|
478
|
+
(0xD6, 0x99),
|
479
|
+
(0xD7, 0x01),
|
480
|
+
(0xD8, 0xBB),
|
481
|
+
(0xD9, 0xAA),
|
482
|
+
(0xF3, 0x01),
|
483
|
+
(0xF0, 0x00),
|
484
|
+
),
|
485
|
+
)
|
486
|
+
|
258
487
|
models = {}
|
@@ -50,28 +50,13 @@ bool MLX90614Component::write_emissivity_() {
|
|
50
50
|
return true;
|
51
51
|
}
|
52
52
|
|
53
|
-
uint8_t MLX90614Component::crc8_pec_(const uint8_t *data, uint8_t len) {
|
54
|
-
uint8_t crc = 0;
|
55
|
-
for (uint8_t i = 0; i < len; i++) {
|
56
|
-
uint8_t in = data[i];
|
57
|
-
for (uint8_t j = 0; j < 8; j++) {
|
58
|
-
bool carry = (crc ^ in) & 0x80;
|
59
|
-
crc <<= 1;
|
60
|
-
if (carry)
|
61
|
-
crc ^= 0x07;
|
62
|
-
in <<= 1;
|
63
|
-
}
|
64
|
-
}
|
65
|
-
return crc;
|
66
|
-
}
|
67
|
-
|
68
53
|
bool MLX90614Component::write_bytes_(uint8_t reg, uint16_t data) {
|
69
54
|
uint8_t buf[5];
|
70
55
|
buf[0] = this->address_ << 1;
|
71
56
|
buf[1] = reg;
|
72
57
|
buf[2] = data & 0xFF;
|
73
58
|
buf[3] = data >> 8;
|
74
|
-
buf[4] =
|
59
|
+
buf[4] = crc8(buf, 4, 0x00, 0x07, true);
|
75
60
|
return this->write_bytes(reg, buf + 2, 3);
|
76
61
|
}
|
77
62
|
|
@@ -22,7 +22,6 @@ class MLX90614Component : public PollingComponent, public i2c::I2CDevice {
|
|
22
22
|
protected:
|
23
23
|
bool write_emissivity_();
|
24
24
|
|
25
|
-
uint8_t crc8_pec_(const uint8_t *data, uint8_t len);
|
26
25
|
bool write_bytes_(uint8_t reg, uint16_t data);
|
27
26
|
|
28
27
|
sensor::Sensor *ambient_sensor_{nullptr};
|
@@ -57,7 +57,7 @@ from esphome.const import (
|
|
57
57
|
PLATFORM_ESP8266,
|
58
58
|
PlatformFramework,
|
59
59
|
)
|
60
|
-
from esphome.core import CORE, coroutine_with_priority
|
60
|
+
from esphome.core import CORE, CoroPriority, coroutine_with_priority
|
61
61
|
|
62
62
|
DEPENDENCIES = ["network"]
|
63
63
|
|
@@ -321,7 +321,7 @@ def exp_mqtt_message(config):
|
|
321
321
|
)
|
322
322
|
|
323
323
|
|
324
|
-
@coroutine_with_priority(
|
324
|
+
@coroutine_with_priority(CoroPriority.WEB)
|
325
325
|
async def to_code(config):
|
326
326
|
var = cg.new_Pvariable(config[CONF_ID])
|
327
327
|
await cg.register_component(var, config)
|
@@ -58,8 +58,13 @@ void MQTTSensorComponent::send_discovery(JsonObject root, mqtt::SendDiscoveryCon
|
|
58
58
|
if (this->sensor_->get_force_update())
|
59
59
|
root[MQTT_FORCE_UPDATE] = true;
|
60
60
|
|
61
|
-
if (this->sensor_->get_state_class() != STATE_CLASS_NONE)
|
62
|
-
|
61
|
+
if (this->sensor_->get_state_class() != STATE_CLASS_NONE) {
|
62
|
+
#ifdef USE_STORE_LOG_STR_IN_FLASH
|
63
|
+
root[MQTT_STATE_CLASS] = (const __FlashStringHelper *) state_class_to_string(this->sensor_->get_state_class());
|
64
|
+
#else
|
65
|
+
root[MQTT_STATE_CLASS] = LOG_STR_ARG(state_class_to_string(this->sensor_->get_state_class()));
|
66
|
+
#endif
|
67
|
+
}
|
63
68
|
|
64
69
|
config.command_topic = false;
|
65
70
|
}
|
@@ -19,13 +19,14 @@ void MS5611Component::setup() {
|
|
19
19
|
this->mark_failed();
|
20
20
|
return;
|
21
21
|
}
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
22
|
+
this->set_timeout(100, [this]() {
|
23
|
+
for (uint8_t offset = 0; offset < 6; offset++) {
|
24
|
+
if (!this->read_byte_16(MS5611_CMD_READ_PROM + (offset * 2), &this->prom_[offset])) {
|
25
|
+
this->mark_failed();
|
26
|
+
return;
|
27
|
+
}
|
27
28
|
}
|
28
|
-
}
|
29
|
+
});
|
29
30
|
}
|
30
31
|
void MS5611Component::dump_config() {
|
31
32
|
ESP_LOGCONFIG(TAG, "MS5611:");
|
@@ -2,7 +2,7 @@ import esphome.codegen as cg
|
|
2
2
|
from esphome.components.esp32 import add_idf_sdkconfig_option
|
3
3
|
import esphome.config_validation as cv
|
4
4
|
from esphome.const import CONF_ENABLE_IPV6, CONF_MIN_IPV6_ADDR_COUNT
|
5
|
-
from esphome.core import CORE, coroutine_with_priority
|
5
|
+
from esphome.core import CORE, CoroPriority, coroutine_with_priority
|
6
6
|
|
7
7
|
CODEOWNERS = ["@esphome/core"]
|
8
8
|
AUTO_LOAD = ["mdns"]
|
@@ -36,7 +36,7 @@ CONFIG_SCHEMA = cv.Schema(
|
|
36
36
|
)
|
37
37
|
|
38
38
|
|
39
|
-
@coroutine_with_priority(
|
39
|
+
@coroutine_with_priority(CoroPriority.NETWORK)
|
40
40
|
async def to_code(config):
|
41
41
|
cg.add_define("USE_NETWORK")
|
42
42
|
if CORE.using_arduino and CORE.is_esp32:
|
@@ -11,7 +11,10 @@ static const char *const TAG = "nextion.upload";
|
|
11
11
|
bool Nextion::upload_end_(bool successful) {
|
12
12
|
if (successful) {
|
13
13
|
ESP_LOGD(TAG, "Upload successful");
|
14
|
-
|
14
|
+
for (uint8_t i = 0; i <= 5; i++) {
|
15
|
+
delay(1000); // NOLINT
|
16
|
+
App.feed_wdt(); // Feed the watchdog timer.
|
17
|
+
}
|
15
18
|
App.safe_reboot();
|
16
19
|
} else {
|
17
20
|
ESP_LOGE(TAG, "Upload failed");
|
@@ -2,10 +2,13 @@ from __future__ import annotations
|
|
2
2
|
|
3
3
|
from pathlib import Path
|
4
4
|
|
5
|
+
from esphome import pins
|
5
6
|
import esphome.codegen as cg
|
6
7
|
from esphome.components.zephyr import (
|
7
8
|
copy_files as zephyr_copy_files,
|
8
9
|
zephyr_add_pm_static,
|
10
|
+
zephyr_add_prj_conf,
|
11
|
+
zephyr_data,
|
9
12
|
zephyr_set_core_data,
|
10
13
|
zephyr_to_code,
|
11
14
|
)
|
@@ -18,6 +21,8 @@ import esphome.config_validation as cv
|
|
18
21
|
from esphome.const import (
|
19
22
|
CONF_BOARD,
|
20
23
|
CONF_FRAMEWORK,
|
24
|
+
CONF_ID,
|
25
|
+
CONF_RESET_PIN,
|
21
26
|
KEY_CORE,
|
22
27
|
KEY_FRAMEWORK_VERSION,
|
23
28
|
KEY_TARGET_FRAMEWORK,
|
@@ -25,7 +30,7 @@ from esphome.const import (
|
|
25
30
|
PLATFORM_NRF52,
|
26
31
|
ThreadModel,
|
27
32
|
)
|
28
|
-
from esphome.core import CORE, EsphomeError, coroutine_with_priority
|
33
|
+
from esphome.core import CORE, CoroPriority, EsphomeError, coroutine_with_priority
|
29
34
|
from esphome.storage_json import StorageJSON
|
30
35
|
from esphome.types import ConfigType
|
31
36
|
|
@@ -90,19 +95,44 @@ def _detect_bootloader(config: ConfigType) -> ConfigType:
|
|
90
95
|
return config
|
91
96
|
|
92
97
|
|
98
|
+
nrf52_ns = cg.esphome_ns.namespace("nrf52")
|
99
|
+
DeviceFirmwareUpdate = nrf52_ns.class_("DeviceFirmwareUpdate", cg.Component)
|
100
|
+
|
101
|
+
CONF_DFU = "dfu"
|
102
|
+
|
93
103
|
CONFIG_SCHEMA = cv.All(
|
104
|
+
_detect_bootloader,
|
105
|
+
set_core_data,
|
94
106
|
cv.Schema(
|
95
107
|
{
|
96
108
|
cv.Required(CONF_BOARD): cv.string_strict,
|
97
109
|
cv.Optional(KEY_BOOTLOADER): cv.one_of(*BOOTLOADERS, lower=True),
|
110
|
+
cv.Optional(CONF_DFU): cv.Schema(
|
111
|
+
{
|
112
|
+
cv.GenerateID(): cv.declare_id(DeviceFirmwareUpdate),
|
113
|
+
cv.Required(CONF_RESET_PIN): pins.gpio_output_pin_schema,
|
114
|
+
}
|
115
|
+
),
|
98
116
|
}
|
99
117
|
),
|
100
|
-
_detect_bootloader,
|
101
|
-
set_core_data,
|
102
118
|
)
|
103
119
|
|
104
120
|
|
105
|
-
|
121
|
+
def _validate_mcumgr(config):
|
122
|
+
bootloader = zephyr_data()[KEY_BOOTLOADER]
|
123
|
+
if bootloader == BOOTLOADER_MCUBOOT:
|
124
|
+
raise cv.Invalid(f"'{bootloader}' bootloader does not support DFU")
|
125
|
+
|
126
|
+
|
127
|
+
def _final_validate(config):
|
128
|
+
if CONF_DFU in config:
|
129
|
+
_validate_mcumgr(config)
|
130
|
+
|
131
|
+
|
132
|
+
FINAL_VALIDATE_SCHEMA = _final_validate
|
133
|
+
|
134
|
+
|
135
|
+
@coroutine_with_priority(CoroPriority.PLATFORM)
|
106
136
|
async def to_code(config: ConfigType) -> None:
|
107
137
|
"""Convert the configuration to code."""
|
108
138
|
cg.add_platformio_option("board", config[CONF_BOARD])
|
@@ -119,8 +149,8 @@ async def to_code(config: ConfigType) -> None:
|
|
119
149
|
cg.add_platformio_option(
|
120
150
|
"platform_packages",
|
121
151
|
[
|
122
|
-
"platformio/framework-zephyr@https://github.com/tomaszduda23/framework-sdk-nrf/archive/refs/tags/v2.6.1-
|
123
|
-
"platformio/toolchain-gccarmnoneeabi@https://github.com/tomaszduda23/toolchain-sdk-ng/archive/refs/tags/v0.
|
152
|
+
"platformio/framework-zephyr@https://github.com/tomaszduda23/framework-sdk-nrf/archive/refs/tags/v2.6.1-7.zip",
|
153
|
+
"platformio/toolchain-gccarmnoneeabi@https://github.com/tomaszduda23/toolchain-sdk-ng/archive/refs/tags/v0.17.4-0.zip",
|
124
154
|
],
|
125
155
|
)
|
126
156
|
|
@@ -136,6 +166,19 @@ async def to_code(config: ConfigType) -> None:
|
|
136
166
|
|
137
167
|
zephyr_to_code(config)
|
138
168
|
|
169
|
+
if dfu_config := config.get(CONF_DFU):
|
170
|
+
CORE.add_job(_dfu_to_code, dfu_config)
|
171
|
+
|
172
|
+
|
173
|
+
@coroutine_with_priority(CoroPriority.DIAGNOSTICS)
|
174
|
+
async def _dfu_to_code(dfu_config):
|
175
|
+
cg.add_define("USE_NRF52_DFU")
|
176
|
+
var = cg.new_Pvariable(dfu_config[CONF_ID])
|
177
|
+
pin = await cg.gpio_pin_expression(dfu_config[CONF_RESET_PIN])
|
178
|
+
cg.add(var.set_reset_pin(pin))
|
179
|
+
zephyr_add_prj_conf("CDC_ACM_DTE_RATE_CALLBACK_SUPPORT", True)
|
180
|
+
await cg.register_component(var, dfu_config)
|
181
|
+
|
139
182
|
|
140
183
|
def copy_files() -> None:
|
141
184
|
"""Copy files to the build directory."""
|
@@ -0,0 +1,51 @@
|
|
1
|
+
#include "dfu.h"
|
2
|
+
|
3
|
+
#ifdef USE_NRF52_DFU
|
4
|
+
|
5
|
+
#include <zephyr/device.h>
|
6
|
+
#include <zephyr/drivers/uart.h>
|
7
|
+
#include <zephyr/drivers/uart/cdc_acm.h>
|
8
|
+
#include "esphome/core/log.h"
|
9
|
+
|
10
|
+
namespace esphome {
|
11
|
+
namespace nrf52 {
|
12
|
+
|
13
|
+
static const char *const TAG = "dfu";
|
14
|
+
|
15
|
+
volatile bool goto_dfu = false; // NOLINT(cppcoreguidelines-avoid-non-const-global-variables)
|
16
|
+
|
17
|
+
static const uint32_t DFU_DBL_RESET_MAGIC = 0x5A1AD5; // SALADS
|
18
|
+
|
19
|
+
#define DEVICE_AND_COMMA(node_id) DEVICE_DT_GET(node_id),
|
20
|
+
|
21
|
+
static void cdc_dte_rate_callback(const struct device * /*unused*/, uint32_t rate) {
|
22
|
+
if (rate == 1200) {
|
23
|
+
goto_dfu = true;
|
24
|
+
}
|
25
|
+
}
|
26
|
+
void DeviceFirmwareUpdate::setup() {
|
27
|
+
this->reset_pin_->setup();
|
28
|
+
const struct device *cdc_dev[] = {DT_FOREACH_STATUS_OKAY(zephyr_cdc_acm_uart, DEVICE_AND_COMMA)};
|
29
|
+
for (auto &idx : cdc_dev) {
|
30
|
+
cdc_acm_dte_rate_callback_set(idx, cdc_dte_rate_callback);
|
31
|
+
}
|
32
|
+
}
|
33
|
+
|
34
|
+
void DeviceFirmwareUpdate::loop() {
|
35
|
+
if (goto_dfu) {
|
36
|
+
goto_dfu = false;
|
37
|
+
volatile uint32_t *dbl_reset_mem = (volatile uint32_t *) 0x20007F7C;
|
38
|
+
(*dbl_reset_mem) = DFU_DBL_RESET_MAGIC;
|
39
|
+
this->reset_pin_->digital_write(true);
|
40
|
+
}
|
41
|
+
}
|
42
|
+
|
43
|
+
void DeviceFirmwareUpdate::dump_config() {
|
44
|
+
ESP_LOGCONFIG(TAG, "DFU:");
|
45
|
+
LOG_PIN(" RESET Pin: ", this->reset_pin_);
|
46
|
+
}
|
47
|
+
|
48
|
+
} // namespace nrf52
|
49
|
+
} // namespace esphome
|
50
|
+
|
51
|
+
#endif
|
@@ -0,0 +1,24 @@
|
|
1
|
+
#pragma once
|
2
|
+
|
3
|
+
#include "esphome/core/defines.h"
|
4
|
+
#ifdef USE_NRF52_DFU
|
5
|
+
#include "esphome/core/component.h"
|
6
|
+
#include "esphome/core/gpio.h"
|
7
|
+
|
8
|
+
namespace esphome {
|
9
|
+
namespace nrf52 {
|
10
|
+
class DeviceFirmwareUpdate : public Component {
|
11
|
+
public:
|
12
|
+
void setup() override;
|
13
|
+
void loop() override;
|
14
|
+
void set_reset_pin(GPIOPin *reset) { this->reset_pin_ = reset; }
|
15
|
+
void dump_config() override;
|
16
|
+
|
17
|
+
protected:
|
18
|
+
GPIOPin *reset_pin_;
|
19
|
+
};
|
20
|
+
|
21
|
+
} // namespace nrf52
|
22
|
+
} // namespace esphome
|
23
|
+
|
24
|
+
#endif
|
esphome/components/ntc/ntc.cpp
CHANGED
@@ -11,7 +11,7 @@ void NTC::setup() {
|
|
11
11
|
if (this->sensor_->has_state())
|
12
12
|
this->process_(this->sensor_->state);
|
13
13
|
}
|
14
|
-
void NTC::dump_config() { LOG_SENSOR("", "NTC Sensor", this) }
|
14
|
+
void NTC::dump_config() { LOG_SENSOR("", "NTC Sensor", this); }
|
15
15
|
float NTC::get_setup_priority() const { return setup_priority::DATA; }
|
16
16
|
void NTC::process_(float value) {
|
17
17
|
if (std::isnan(value)) {
|
@@ -76,7 +76,7 @@ from esphome.const import (
|
|
76
76
|
DEVICE_CLASS_WIND_DIRECTION,
|
77
77
|
DEVICE_CLASS_WIND_SPEED,
|
78
78
|
)
|
79
|
-
from esphome.core import CORE, coroutine_with_priority
|
79
|
+
from esphome.core import CORE, CoroPriority, coroutine_with_priority
|
80
80
|
from esphome.core.entity_helpers import entity_duplicate_validator, setup_entity
|
81
81
|
from esphome.cpp_generator import MockObjClass
|
82
82
|
|
@@ -321,7 +321,7 @@ async def number_in_range_to_code(config, condition_id, template_arg, args):
|
|
321
321
|
return var
|
322
322
|
|
323
323
|
|
324
|
-
@coroutine_with_priority(
|
324
|
+
@coroutine_with_priority(CoroPriority.CORE)
|
325
325
|
async def to_code(config):
|
326
326
|
cg.add_global(number_ns.using)
|
327
327
|
|
@@ -15,7 +15,7 @@ void ValueRangeTrigger::setup() {
|
|
15
15
|
float local_min = this->min_.value(0.0);
|
16
16
|
float local_max = this->max_.value(0.0);
|
17
17
|
convert hash = {.from = (local_max - local_min)};
|
18
|
-
uint32_t myhash = hash.to ^ this->parent_->
|
18
|
+
uint32_t myhash = hash.to ^ this->parent_->get_preference_hash();
|
19
19
|
this->rtc_ = global_preferences->make_preference<bool>(myhash);
|
20
20
|
bool initial_state;
|
21
21
|
if (this->rtc_.load(&initial_state)) {
|
@@ -6,6 +6,27 @@ namespace number {
|
|
6
6
|
|
7
7
|
static const char *const TAG = "number";
|
8
8
|
|
9
|
+
// Function implementation of LOG_NUMBER macro to reduce code size
|
10
|
+
void log_number(const char *tag, const char *prefix, const char *type, Number *obj) {
|
11
|
+
if (obj == nullptr) {
|
12
|
+
return;
|
13
|
+
}
|
14
|
+
|
15
|
+
ESP_LOGCONFIG(tag, "%s%s '%s'", prefix, type, obj->get_name().c_str());
|
16
|
+
|
17
|
+
if (!obj->get_icon_ref().empty()) {
|
18
|
+
ESP_LOGCONFIG(tag, "%s Icon: '%s'", prefix, obj->get_icon_ref().c_str());
|
19
|
+
}
|
20
|
+
|
21
|
+
if (!obj->traits.get_unit_of_measurement_ref().empty()) {
|
22
|
+
ESP_LOGCONFIG(tag, "%s Unit of Measurement: '%s'", prefix, obj->traits.get_unit_of_measurement_ref().c_str());
|
23
|
+
}
|
24
|
+
|
25
|
+
if (!obj->traits.get_device_class_ref().empty()) {
|
26
|
+
ESP_LOGCONFIG(tag, "%s Device Class: '%s'", prefix, obj->traits.get_device_class_ref().c_str());
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
9
30
|
void Number::publish_state(float state) {
|
10
31
|
this->set_has_state(true);
|
11
32
|
this->state = state;
|
@@ -9,19 +9,10 @@
|
|
9
9
|
namespace esphome {
|
10
10
|
namespace number {
|
11
11
|
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
ESP_LOGCONFIG(TAG, "%s Icon: '%s'", prefix, (obj)->get_icon().c_str()); \
|
17
|
-
} \
|
18
|
-
if (!(obj)->traits.get_unit_of_measurement().empty()) { \
|
19
|
-
ESP_LOGCONFIG(TAG, "%s Unit of Measurement: '%s'", prefix, (obj)->traits.get_unit_of_measurement().c_str()); \
|
20
|
-
} \
|
21
|
-
if (!(obj)->traits.get_device_class().empty()) { \
|
22
|
-
ESP_LOGCONFIG(TAG, "%s Device Class: '%s'", prefix, (obj)->traits.get_device_class().c_str()); \
|
23
|
-
} \
|
24
|
-
}
|
12
|
+
class Number;
|
13
|
+
void log_number(const char *tag, const char *prefix, const char *type, Number *obj);
|
14
|
+
|
15
|
+
#define LOG_NUMBER(prefix, type, obj) log_number(TAG, prefix, LOG_STR_LITERAL(type), obj)
|
25
16
|
|
26
17
|
#define SUB_NUMBER(name) \
|
27
18
|
protected: \
|
@@ -1,10 +1,10 @@
|
|
1
1
|
#pragma once
|
2
2
|
|
3
|
+
#include <vector>
|
4
|
+
#include "esphome/core/component.h"
|
3
5
|
#include "esphome/core/defines.h"
|
4
6
|
#include "esphome/core/hal.h"
|
5
|
-
#include "esphome/core/component.h"
|
6
7
|
#include "esphome/core/log.h"
|
7
|
-
#include <vector>
|
8
8
|
|
9
9
|
#include "opentherm.h"
|
10
10
|
|
@@ -17,21 +17,21 @@
|
|
17
17
|
#endif
|
18
18
|
|
19
19
|
#ifdef OPENTHERM_USE_SWITCH
|
20
|
-
#include "esphome/components/opentherm/switch/
|
20
|
+
#include "esphome/components/opentherm/switch/opentherm_switch.h"
|
21
21
|
#endif
|
22
22
|
|
23
23
|
#ifdef OPENTHERM_USE_OUTPUT
|
24
|
-
#include "esphome/components/opentherm/output/
|
24
|
+
#include "esphome/components/opentherm/output/opentherm_output.h"
|
25
25
|
#endif
|
26
26
|
|
27
27
|
#ifdef OPENTHERM_USE_NUMBER
|
28
|
-
#include "esphome/components/opentherm/number/
|
28
|
+
#include "esphome/components/opentherm/number/opentherm_number.h"
|
29
29
|
#endif
|
30
30
|
|
31
|
+
#include <functional>
|
31
32
|
#include <memory>
|
32
33
|
#include <unordered_map>
|
33
34
|
#include <unordered_set>
|
34
|
-
#include <functional>
|
35
35
|
|
36
36
|
#include "opentherm_macros.h"
|
37
37
|
|