esphome 2025.3.3__py3-none-any.whl → 2025.4.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 +34 -10
- esphome/components/a01nyub/sensor.py +2 -2
- esphome/components/a02yyuw/sensor.py +2 -2
- esphome/components/a4988/stepper.py +1 -2
- esphome/components/absolute_humidity/sensor.py +3 -3
- esphome/components/ac_dimmer/output.py +3 -3
- esphome/components/adalight/__init__.py +2 -2
- esphome/components/adc128s102/__init__.py +1 -1
- esphome/components/adc128s102/sensor/__init__.py +3 -3
- esphome/components/addressable_light/display.py +5 -5
- esphome/components/ade7880/sensor.py +2 -2
- esphome/components/ade7953_base/__init__.py +10 -10
- esphome/components/ade7953_i2c/sensor.py +1 -2
- esphome/components/ade7953_spi/sensor.py +1 -2
- esphome/components/ads1115/__init__.py +1 -1
- esphome/components/ads1115/sensor/__init__.py +4 -3
- esphome/components/ads1118/__init__.py +1 -1
- esphome/components/ads1118/sensor/__init__.py +5 -4
- esphome/components/ags10/sensor.py +9 -9
- esphome/components/aht10/sensor.py +2 -2
- esphome/components/airthings_ble/__init__.py +1 -1
- esphome/components/airthings_wave_base/__init__.py +2 -3
- esphome/components/airthings_wave_mini/sensor.py +2 -5
- esphome/components/airthings_wave_plus/sensor.py +8 -9
- esphome/components/alpha3/sensor.py +5 -5
- esphome/components/am2315c/am2315c.cpp +4 -4
- esphome/components/am2315c/sensor.py +1 -1
- esphome/components/am2320/sensor.py +1 -1
- esphome/components/am43/cover/__init__.py +1 -1
- esphome/components/am43/sensor/__init__.py +3 -3
- esphome/components/analog_threshold/binary_sensor.py +2 -5
- esphome/components/anova/climate.py +1 -1
- esphome/components/apds9306/sensor.py +1 -1
- esphome/components/apds9960/__init__.py +1 -1
- esphome/components/apds9960/binary_sensor.py +2 -1
- esphome/components/apds9960/sensor.py +3 -2
- esphome/components/api/api_frame_helper.cpp +25 -1
- esphome/components/as3935/__init__.py +3 -3
- esphome/components/as3935/binary_sensor.py +2 -1
- esphome/components/as3935/sensor.py +4 -3
- esphome/components/as3935_i2c/__init__.py +1 -1
- esphome/components/as3935_spi/__init__.py +1 -1
- esphome/components/as5600/__init__.py +2 -2
- esphome/components/as5600/sensor/__init__.py +10 -9
- esphome/components/as7341/sensor.py +1 -2
- esphome/components/at581x/__init__.py +4 -8
- esphome/components/at581x/switch/__init__.py +2 -4
- esphome/components/atc_mithermometer/sensor.py +3 -3
- esphome/components/axs15231/touchscreen/axs15231_touchscreen.cpp +7 -3
- esphome/components/b_parasite/sensor.py +2 -2
- esphome/components/ballu/climate.py +1 -1
- esphome/components/bang_bang/climate.py +2 -2
- esphome/components/bedjet/__init__.py +2 -6
- esphome/components/bedjet/climate/__init__.py +3 -6
- esphome/components/bedjet/fan/__init__.py +4 -9
- esphome/components/bedjet/sensor/__init__.py +3 -6
- esphome/components/beken_spi_led_strip/light.py +2 -2
- esphome/components/bh1750/sensor.py +2 -6
- esphome/components/binary/fan/__init__.py +2 -1
- esphome/components/binary/light/__init__.py +3 -2
- esphome/components/binary_sensor_map/sensor.py +5 -6
- esphome/components/bl0939/sensor.py +1 -1
- esphome/components/bl0940/sensor.py +3 -3
- esphome/components/ble_client/__init__.py +3 -2
- esphome/components/ble_client/sensor/__init__.py +1 -1
- esphome/components/ble_client/text_sensor/__init__.py +1 -1
- esphome/components/bluetooth_proxy/__init__.py +35 -23
- esphome/components/bme280_base/__init__.py +1 -1
- esphome/components/bme280_i2c/sensor.py +3 -2
- esphome/components/bme280_spi/sensor.py +3 -2
- esphome/components/bme680/sensor.py +4 -4
- esphome/components/bme680_bsec/__init__.py +1 -1
- esphome/components/bme680_bsec/sensor.py +3 -6
- esphome/components/bme680_bsec/text_sensor.py +3 -2
- esphome/components/bmi160/sensor.py +6 -6
- esphome/components/bmp085/sensor.py +1 -1
- esphome/components/bmp280_base/__init__.py +1 -1
- esphome/components/bmp280_i2c/sensor.py +3 -2
- esphome/components/bmp280_spi/sensor.py +3 -2
- esphome/components/bmp3xx_base/__init__.py +1 -1
- esphome/components/bmp3xx_i2c/sensor.py +2 -1
- esphome/components/bmp3xx_spi/sensor.py +2 -1
- esphome/components/bmp581/sensor.py +2 -1
- esphome/components/bp1658cj/__init__.py +2 -6
- esphome/components/bp1658cj/output.py +2 -1
- esphome/components/bp5758d/__init__.py +2 -6
- esphome/components/bp5758d/output.py +3 -2
- esphome/components/canbus/__init__.py +13 -2
- esphome/components/canbus/canbus.cpp +7 -1
- esphome/components/cap1188/__init__.py +2 -2
- esphome/components/cap1188/binary_sensor.py +3 -2
- esphome/components/captive_portal/__init__.py +3 -3
- esphome/components/ccs811/sensor.py +10 -10
- esphome/components/cd74hc4067/__init__.py +2 -5
- esphome/components/cd74hc4067/sensor.py +6 -5
- esphome/components/climate_ir/__init__.py +2 -2
- esphome/components/climate_ir_lg/climate.py +1 -1
- esphome/components/color/__init__.py +1 -2
- esphome/components/color_temperature/light.py +2 -2
- esphome/components/combination/sensor.py +1 -1
- esphome/components/coolix/climate.py +1 -1
- esphome/components/copy/binary_sensor/__init__.py +1 -1
- esphome/components/copy/button/__init__.py +1 -1
- esphome/components/copy/cover/__init__.py +1 -1
- esphome/components/copy/fan/__init__.py +2 -7
- esphome/components/copy/lock/__init__.py +2 -7
- esphome/components/copy/number/__init__.py +1 -1
- esphome/components/copy/select/__init__.py +2 -7
- esphome/components/copy/sensor/__init__.py +2 -2
- esphome/components/copy/switch/__init__.py +1 -1
- esphome/components/copy/text/__init__.py +2 -7
- esphome/components/copy/text_sensor/__init__.py +2 -6
- esphome/components/cs5460a/sensor.py +7 -7
- esphome/components/cse7761/sensor.py +2 -2
- esphome/components/cse7766/sensor.py +1 -1
- esphome/components/cst226/touchscreen/__init__.py +3 -4
- esphome/components/ct_clamp/sensor.py +1 -1
- esphome/components/current_based/cover.py +3 -4
- esphome/components/cwww/light.py +3 -3
- esphome/components/dac7678/__init__.py +1 -1
- esphome/components/dac7678/output.py +2 -1
- esphome/components/daikin/climate.py +1 -1
- esphome/components/daikin_arc/climate.py +1 -1
- esphome/components/daikin_brc/climate.py +1 -1
- esphome/components/dallas_temp/sensor.py +1 -1
- esphome/components/daly_bms/__init__.py +2 -2
- esphome/components/daly_bms/binary_sensor.py +3 -2
- esphome/components/daly_bms/sensor.py +14 -13
- esphome/components/daly_bms/text_sensor.py +3 -2
- esphome/components/dashboard_import/__init__.py +5 -5
- esphome/components/debug/sensor.py +7 -6
- esphome/components/debug/text_sensor.py +1 -1
- esphome/components/deep_sleep/__init__.py +12 -13
- esphome/components/delonghi/climate.py +1 -1
- esphome/components/demo/__init__.py +1 -1
- esphome/components/dfplayer/__init__.py +3 -3
- esphome/components/dfrobot_sen0395/__init__.py +3 -3
- esphome/components/dfrobot_sen0395/binary_sensor.py +2 -1
- esphome/components/dfrobot_sen0395/switch/__init__.py +2 -3
- esphome/components/dht/sensor.py +4 -5
- esphome/components/dht12/sensor.py +3 -3
- esphome/components/dps310/sensor.py +3 -3
- esphome/components/ds1307/time.py +2 -3
- esphome/components/dsmr/__init__.py +3 -7
- esphome/components/dsmr/sensor.py +5 -4
- esphome/components/dsmr/text_sensor.py +3 -2
- esphome/components/duty_cycle/sensor.py +3 -8
- esphome/components/duty_time/sensor.py +7 -7
- esphome/components/e131/__init__.py +3 -3
- esphome/components/ee895/sensor.py +5 -5
- esphome/components/ektf2232/touchscreen/__init__.py +2 -3
- esphome/components/emc2101/__init__.py +1 -1
- esphome/components/emc2101/output/__init__.py +3 -2
- esphome/components/emc2101/sensor/__init__.py +4 -3
- esphome/components/emmeti/climate.py +1 -1
- esphome/components/endstop/cover.py +3 -3
- esphome/components/ens160_base/__init__.py +1 -1
- esphome/components/ens160_i2c/sensor.py +2 -1
- esphome/components/ens160_spi/sensor.py +2 -1
- esphome/components/ens210/sensor.py +1 -1
- esphome/components/esp32/__init__.py +10 -0
- esphome/components/esp32_ble_tracker/__init__.py +135 -51
- esphome/components/esp32_camera/__init__.py +7 -8
- esphome/components/esp32_camera_web_server/__init__.py +2 -2
- esphome/components/esp32_can/canbus.py +21 -0
- esphome/components/esp32_can/esp32_can.cpp +1 -1
- esphome/components/esp32_can/esp32_can.h +4 -0
- esphome/components/esp32_dac/output.py +2 -2
- esphome/components/esp32_hall/sensor.py +2 -6
- esphome/components/esp32_touch/__init__.py +7 -7
- esphome/components/esp32_touch/binary_sensor.py +4 -7
- esphome/components/esp8266_pwm/output.py +3 -8
- esphome/components/ethernet/__init__.py +1 -0
- esphome/components/ethernet/ethernet_component.cpp +1 -1
- esphome/components/ethernet_info/ethernet_info_text_sensor.h +1 -0
- esphome/components/exposure_notifications/__init__.py +2 -2
- esphome/components/external_components/__init__.py +1 -1
- esphome/components/ezo/sensor.py +2 -2
- esphome/components/ezo_pmp/__init__.py +4 -4
- esphome/components/ezo_pmp/binary_sensor.py +4 -4
- esphome/components/ezo_pmp/sensor.py +4 -5
- esphome/components/ezo_pmp/text_sensor.py +2 -6
- esphome/components/factory_reset/button/__init__.py +2 -1
- esphome/components/factory_reset/switch/__init__.py +3 -2
- esphome/components/fastled_base/__init__.py +3 -3
- esphome/components/fastled_clockless/light.py +2 -2
- esphome/components/fastled_spi/light.py +2 -2
- esphome/components/feedback/cover.py +3 -3
- esphome/components/fingerprint_grow/__init__.py +5 -6
- esphome/components/fingerprint_grow/binary_sensor.py +2 -1
- esphome/components/fingerprint_grow/sensor.py +2 -1
- esphome/components/fs3000/sensor.py +2 -6
- esphome/components/ft5x06/touchscreen/__init__.py +2 -2
- esphome/components/ft63x6/touchscreen.py +2 -3
- esphome/components/fujitsu_general/climate.py +1 -1
- esphome/components/gcja5/sensor.py +4 -4
- esphome/components/gdk101/__init__.py +1 -1
- esphome/components/gdk101/binary_sensor.py +2 -1
- esphome/components/gdk101/sensor.py +5 -4
- esphome/components/globals/__init__.py +1 -2
- esphome/components/gp2y1010au0f/sensor.py +3 -3
- esphome/components/gp8403/__init__.py +1 -2
- esphome/components/gp8403/output/__init__.py +3 -4
- esphome/components/gpio/binary_sensor/__init__.py +3 -2
- esphome/components/gpio/one_wire/__init__.py +3 -2
- esphome/components/gpio/output/__init__.py +3 -2
- esphome/components/gpio/switch/__init__.py +3 -2
- esphome/components/gps/__init__.py +4 -5
- esphome/components/gps/time/__init__.py +3 -2
- esphome/components/graph/__init__.py +12 -12
- esphome/components/grove_tb6612fng/__init__.py +5 -6
- esphome/components/growatt_solar/sensor.py +1 -1
- esphome/components/gt911/binary_sensor/__init__.py +2 -2
- esphome/components/haier/binary_sensor/__init__.py +4 -10
- esphome/components/haier/button/__init__.py +3 -6
- esphome/components/haier/sensor/__init__.py +4 -6
- esphome/components/haier/switch/__init__.py +4 -7
- esphome/components/haier/text_sensor/__init__.py +4 -9
- esphome/components/havells_solar/sensor.py +1 -1
- esphome/components/hbridge/fan/__init__.py +6 -6
- esphome/components/hbridge/light/__init__.py +2 -1
- esphome/components/hdc1080/sensor.py +1 -1
- esphome/components/he60r/cover.py +2 -6
- esphome/components/heatpumpir/climate.py +1 -1
- esphome/components/hitachi_ac344/climate.py +1 -1
- esphome/components/hitachi_ac424/climate.py +1 -1
- esphome/components/hlw8012/sensor.py +6 -6
- esphome/components/hm3301/sensor.py +3 -3
- esphome/components/hmc5883l/sensor.py +4 -4
- esphome/components/homeassistant/time/__init__.py +2 -1
- esphome/components/honeywell_hih_i2c/sensor.py +3 -3
- esphome/components/honeywellabp/sensor.py +1 -2
- esphome/components/honeywellabp2_i2c/sensor.py +1 -2
- esphome/components/host/time/__init__.py +2 -2
- esphome/components/hrxl_maxsonar_wr/sensor.py +1 -1
- esphome/components/hte501/sensor.py +3 -3
- esphome/components/http_request/ota/__init__.py +5 -9
- esphome/components/http_request/update/__init__.py +3 -7
- esphome/components/htu21d/sensor.py +6 -6
- esphome/components/htu31d/sensor.py +1 -1
- esphome/components/hx711/sensor.py +3 -8
- esphome/components/hydreon_rgxx/binary_sensor.py +3 -7
- esphome/components/hydreon_rgxx/sensor.py +4 -4
- esphome/components/hyt271/sensor.py +1 -1
- esphome/components/i2c_device/__init__.py +1 -1
- esphome/components/i2s_audio/media_player/__init__.py +6 -8
- esphome/components/iaqcore/sensor.py +2 -2
- esphome/components/ina219/sensor.py +2 -2
- esphome/components/ina226/sensor.py +4 -4
- esphome/components/ina260/sensor.py +4 -4
- esphome/components/ina2xx_base/__init__.py +2 -2
- esphome/components/ina2xx_i2c/sensor.py +1 -1
- esphome/components/ina2xx_spi/sensor.py +1 -1
- esphome/components/ina3221/sensor.py +3 -3
- esphome/components/inkbird_ibsth1_mini/sensor.py +2 -2
- esphome/components/inkplate6/display.py +2 -2
- esphome/components/integration/sensor.py +4 -4
- esphome/components/internal_temperature/sensor.py +5 -7
- esphome/components/interval/__init__.py +1 -1
- esphome/components/jsn_sr04t/sensor.py +3 -3
- esphome/components/kamstrup_kmp/sensor.py +1 -1
- esphome/components/key_collector/__init__.py +2 -2
- esphome/components/kmeteriso/sensor.py +2 -2
- esphome/components/kuntze/sensor.py +5 -5
- esphome/components/lcd_base/__init__.py +2 -2
- esphome/components/lcd_gpio/display.py +4 -4
- esphome/components/lcd_menu/__init__.py +3 -7
- esphome/components/lcd_pcf8574/display.py +1 -1
- esphome/components/ld2410/__init__.py +4 -4
- esphome/components/ld2410/binary_sensor.py +5 -4
- esphome/components/ld2410/button/__init__.py +3 -2
- esphome/components/ld2410/number/__init__.py +5 -4
- esphome/components/ld2410/select/__init__.py +4 -3
- esphome/components/ld2410/sensor.py +6 -5
- esphome/components/ld2410/switch/__init__.py +2 -1
- esphome/components/ld2410/text_sensor.py +3 -2
- esphome/components/ld2420/__init__.py +1 -1
- esphome/components/ld2420/binary_sensor/__init__.py +4 -3
- esphome/components/ld2420/button/__init__.py +3 -2
- esphome/components/ld2420/number/__init__.py +3 -2
- esphome/components/ld2420/select/__init__.py +1 -0
- esphome/components/ld2420/sensor/__init__.py +3 -2
- esphome/components/ld2420/text_sensor/__init__.py +2 -6
- esphome/components/ld2450/__init__.py +2 -5
- esphome/components/ledc/output.py +3 -3
- esphome/components/libretiny/text_sensor.py +1 -1
- esphome/components/libretiny_pwm/output.py +3 -7
- esphome/components/lightwaverf/__init__.py +6 -8
- esphome/components/lilygo_t5_47/touchscreen/__init__.py +2 -3
- esphome/components/ltr390/sensor.py +1 -1
- esphome/components/ltr501/sensor.py +2 -2
- esphome/components/ltr_als_ps/sensor.py +2 -2
- esphome/components/lvgl/__init__.py +9 -12
- esphome/components/lvgl/automation.py +15 -3
- esphome/components/lvgl/defines.py +5 -2
- esphome/components/lvgl/encoders.py +3 -2
- esphome/components/lvgl/lv_validation.py +17 -9
- esphome/components/lvgl/lvcode.py +11 -9
- esphome/components/lvgl/lvgl_esphome.h +21 -0
- esphome/components/lvgl/number/__init__.py +23 -20
- esphome/components/lvgl/number/lvgl_number.h +27 -14
- esphome/components/lvgl/schemas.py +70 -19
- esphome/components/lvgl/select/__init__.py +11 -13
- esphome/components/lvgl/select/lvgl_select.h +25 -18
- esphome/components/lvgl/styles.py +42 -11
- esphome/components/lvgl/trigger.py +10 -1
- esphome/components/lvgl/widgets/__init__.py +1 -2
- esphome/components/lvgl/widgets/buttonmatrix.py +2 -2
- esphome/components/lvgl/widgets/canvas.py +407 -0
- esphome/components/lvgl/widgets/line.py +22 -32
- esphome/components/lvgl/widgets/meter.py +3 -1
- esphome/components/m5stack_8angle/__init__.py +1 -2
- esphome/components/m5stack_8angle/binary_sensor/__init__.py +2 -3
- esphome/components/m5stack_8angle/light/__init__.py +2 -4
- esphome/components/m5stack_8angle/sensor/__init__.py +2 -4
- esphome/components/matrix_keypad/binary_sensor/__init__.py +4 -3
- esphome/components/max31855/sensor.py +1 -1
- esphome/components/max31865/sensor.py +1 -1
- esphome/components/max44009/sensor.py +1 -1
- esphome/components/max6675/sensor.py +1 -1
- esphome/components/max6956/__init__.py +5 -5
- esphome/components/max6956/output/__init__.py +4 -3
- esphome/components/max7219/display.py +1 -1
- esphome/components/max7219digit/display.py +1 -1
- esphome/components/max9611/sensor.py +10 -10
- esphome/components/mcp23008/__init__.py +1 -1
- esphome/components/mcp23016/__init__.py +4 -4
- esphome/components/mcp23017/__init__.py +1 -1
- esphome/components/mcp23s08/__init__.py +1 -1
- esphome/components/mcp23s17/__init__.py +1 -1
- esphome/components/mcp23xxx_base/__init__.py +4 -4
- esphome/components/mcp2515/canbus.py +2 -2
- esphome/components/mcp3008/__init__.py +1 -1
- esphome/components/mcp3008/sensor/__init__.py +4 -4
- esphome/components/mcp3204/__init__.py +1 -1
- esphome/components/mcp3204/sensor/__init__.py +3 -2
- esphome/components/mcp4461/__init__.py +42 -0
- esphome/components/mcp4461/mcp4461.cpp +618 -0
- esphome/components/mcp4461/mcp4461.h +171 -0
- esphome/components/mcp4461/output/__init__.py +60 -0
- esphome/components/mcp4461/output/mcp4461_output.cpp +73 -0
- esphome/components/mcp4461/output/mcp4461_output.h +49 -0
- esphome/components/mcp4725/output.py +2 -2
- esphome/components/mcp4728/__init__.py +1 -1
- esphome/components/mcp4728/output/__init__.py +4 -3
- esphome/components/mcp47a1/output.py +2 -2
- esphome/components/mcp9808/sensor.py +1 -1
- esphome/components/mhz19/sensor.py +4 -4
- esphome/components/micronova/__init__.py +3 -5
- esphome/components/micronova/button/__init__.py +5 -5
- esphome/components/micronova/number/__init__.py +6 -10
- esphome/components/micronova/sensor/__init__.py +6 -6
- esphome/components/micronova/switch/__init__.py +6 -8
- esphome/components/micronova/text_sensor/__init__.py +5 -5
- esphome/components/microphone/__init__.py +2 -4
- esphome/components/midea/climate.py +6 -10
- esphome/components/midea_ir/climate.py +1 -1
- esphome/components/mitsubishi/climate.py +1 -1
- esphome/components/mlx90614/sensor.py +1 -1
- esphome/components/mmc5603/sensor.py +4 -4
- esphome/components/mmc5983/sensor.py +1 -1
- esphome/components/modbus/__init__.py +5 -9
- esphome/components/modbus_controller/__init__.py +1 -1
- esphome/components/monochromatic/light.py +2 -2
- esphome/components/mopeka_ble/__init__.py +1 -1
- esphome/components/mopeka_pro_check/sensor.py +12 -12
- esphome/components/mopeka_std_check/sensor.py +8 -8
- esphome/components/mpl3115a2/sensor.py +1 -1
- esphome/components/mpr121/__init__.py +3 -3
- esphome/components/mpr121/binary_sensor/__init__.py +5 -4
- esphome/components/mpu6050/sensor.py +4 -4
- esphome/components/mpu6886/sensor.py +4 -4
- esphome/components/mqtt_subscribe/sensor/__init__.py +3 -5
- esphome/components/mqtt_subscribe/text_sensor/__init__.py +1 -1
- esphome/components/ms5611/sensor.py +2 -2
- esphome/components/ms8607/sensor.py +1 -1
- esphome/components/my9231/__init__.py +1 -1
- esphome/components/my9231/output.py +2 -1
- esphome/components/nau7802/nau7802.cpp +0 -4
- esphome/components/nau7802/nau7802.h +0 -2
- esphome/components/neopixelbus/_methods.py +11 -9
- esphome/components/neopixelbus/light.py +11 -18
- esphome/components/nextion/binary_sensor/__init__.py +6 -14
- esphome/components/nextion/sensor/__init__.py +7 -10
- esphome/components/nextion/switch/__init__.py +3 -5
- esphome/components/nextion/text_sensor/__init__.py +3 -7
- esphome/components/noblex/climate.py +1 -1
- esphome/components/ntc/sensor.py +1 -1
- esphome/components/opentherm/__init__.py +6 -6
- esphome/components/opentherm/input.py +2 -1
- esphome/components/opentherm/number/__init__.py +5 -4
- esphome/components/opentherm/output/__init__.py +3 -2
- esphome/components/opentherm/schema.py +7 -7
- esphome/components/opentherm/switch/__init__.py +3 -2
- esphome/components/opentherm/validate.py +1 -1
- esphome/components/output/__init__.py +2 -3
- esphome/components/output/button/__init__.py +3 -2
- esphome/components/output/lock/__init__.py +2 -1
- esphome/components/output/switch/__init__.py +2 -1
- esphome/components/partition/light.py +4 -4
- esphome/components/pca6416a/__init__.py +4 -4
- esphome/components/pca9554/__init__.py +4 -4
- esphome/components/pca9685/__init__.py +2 -2
- esphome/components/pca9685/output.py +2 -1
- esphome/components/pcf85063/time.py +2 -3
- esphome/components/pcf8563/time.py +2 -2
- esphome/components/pcf8574/__init__.py +4 -4
- esphome/components/pid/climate.py +2 -2
- esphome/components/pid/sensor/__init__.py +4 -8
- esphome/components/pipsolar/__init__.py +1 -1
- esphome/components/pipsolar/binary_sensor/__init__.py +2 -2
- esphome/components/pipsolar/output/__init__.py +4 -3
- esphome/components/pipsolar/sensor/__init__.py +5 -4
- esphome/components/pipsolar/switch/__init__.py +2 -1
- esphome/components/pipsolar/text_sensor/__init__.py +2 -1
- esphome/components/pm1006/sensor.py +2 -2
- esphome/components/pmsa003i/sensor.py +4 -4
- esphome/components/pmsx003/sensor.py +10 -11
- esphome/components/pmwcs3/sensor.py +5 -5
- esphome/components/pn532/__init__.py +3 -3
- esphome/components/pn532_i2c/__init__.py +1 -1
- esphome/components/pn532_spi/__init__.py +1 -1
- esphome/components/pn7150/__init__.py +2 -2
- esphome/components/pn7150_i2c/__init__.py +1 -1
- esphome/components/pn7160/__init__.py +2 -2
- esphome/components/pn7160_i2c/__init__.py +1 -1
- esphome/components/pn7160_spi/__init__.py +1 -1
- esphome/components/power_supply/__init__.py +1 -1
- esphome/components/prometheus/__init__.py +3 -8
- esphome/components/psram/__init__.py +75 -11
- esphome/components/psram/psram.cpp +18 -7
- esphome/components/pulse_counter/sensor.py +4 -4
- esphome/components/pulse_meter/sensor.py +3 -3
- esphome/components/pulse_width/sensor.py +3 -8
- esphome/components/pvvx_mithermometer/display/__init__.py +1 -1
- esphome/components/pvvx_mithermometer/sensor.py +3 -3
- esphome/components/pylontech/__init__.py +1 -0
- esphome/components/pylontech/sensor/__init__.py +8 -13
- esphome/components/pylontech/text_sensor/__init__.py +2 -7
- esphome/components/pzem004t/sensor.py +3 -3
- esphome/components/pzemac/sensor.py +9 -9
- esphome/components/pzemdc/sensor.py +6 -6
- esphome/components/qmc5883l/sensor.py +5 -5
- esphome/components/qmp6988/sensor.py +3 -3
- esphome/components/qr_code/__init__.py +1 -1
- esphome/components/qspi_dbi/display.py +1 -1
- esphome/components/qspi_dbi/qspi_dbi.cpp +1 -1
- esphome/components/qspi_dbi/qspi_dbi.h +1 -1
- esphome/components/qwiic_pir/binary_sensor.py +2 -5
- esphome/components/radon_eye_ble/__init__.py +1 -1
- esphome/components/radon_eye_rd200/sensor.py +3 -4
- esphome/components/rc522/__init__.py +3 -3
- esphome/components/rc522_i2c/__init__.py +1 -1
- esphome/components/rc522_spi/__init__.py +1 -1
- esphome/components/rdm6300/__init__.py +2 -2
- esphome/components/rdm6300/binary_sensor.py +2 -1
- esphome/components/resistance/sensor.py +2 -2
- esphome/components/restart/button/__init__.py +1 -1
- esphome/components/restart/switch/__init__.py +2 -5
- esphome/components/rf_bridge/__init__.py +3 -3
- esphome/components/rgb/light.py +2 -2
- esphome/components/rgbct/light.py +3 -3
- esphome/components/rgbw/light.py +2 -2
- esphome/components/rgbww/light.py +4 -4
- esphome/components/rotary_encoder/sensor.py +8 -8
- esphome/components/rp2040_pio/__init__.py +0 -1
- esphome/components/rp2040_pio_led_strip/light.py +2 -4
- esphome/components/rp2040_pwm/output.py +3 -7
- esphome/components/rtttl/__init__.py +6 -6
- esphome/components/ruuvi_ble/__init__.py +1 -1
- esphome/components/ruuvitag/sensor.py +15 -15
- esphome/components/safe_mode/__init__.py +2 -3
- esphome/components/safe_mode/button/__init__.py +3 -2
- esphome/components/safe_mode/switch/__init__.py +4 -7
- esphome/components/scd30/sensor.py +5 -6
- esphome/components/scd4x/sensor.py +6 -8
- esphome/components/script/__init__.py +2 -2
- esphome/components/sdl/display.py +3 -3
- esphome/components/sdl/touchscreen/__init__.py +2 -2
- esphome/components/sdm_meter/sensor.py +3 -3
- esphome/components/sdp3x/sensor.py +1 -2
- esphome/components/sds011/sensor.py +4 -4
- esphome/components/seeed_mr24hpc1/__init__.py +1 -1
- esphome/components/seeed_mr24hpc1/binary_sensor.py +2 -5
- esphome/components/seeed_mr24hpc1/button/__init__.py +1 -0
- esphome/components/seeed_mr24hpc1/number/__init__.py +2 -4
- esphome/components/seeed_mr24hpc1/select/__init__.py +2 -3
- esphome/components/seeed_mr24hpc1/sensor.py +1 -0
- esphome/components/seeed_mr24hpc1/switch/__init__.py +2 -4
- esphome/components/seeed_mr24hpc1/text_sensor.py +1 -0
- esphome/components/seeed_mr60bha2/binary_sensor.py +2 -4
- esphome/components/seeed_mr60bha2/sensor.py +1 -1
- esphome/components/seeed_mr60fda2/button/__init__.py +1 -1
- esphome/components/seeed_mr60fda2/select/__init__.py +0 -1
- esphome/components/selec_meter/sensor.py +1 -1
- esphome/components/sen0321/sensor.py +2 -2
- esphome/components/sen21231/sensor.py +1 -1
- esphome/components/senseair/sensor.py +3 -3
- esphome/components/sensirion_common/__init__.py +0 -2
- esphome/components/servo/__init__.py +3 -3
- esphome/components/sfa30/sensor.py +4 -5
- esphome/components/sgp4x/sensor.py +2 -2
- esphome/components/shelly_dimmer/light.py +16 -16
- esphome/components/sht3xd/sensor.py +1 -1
- esphome/components/sht4x/sensor.py +6 -6
- esphome/components/shtcx/sensor.py +1 -1
- esphome/components/shutdown/button/__init__.py +2 -6
- esphome/components/shutdown/switch/__init__.py +2 -5
- esphome/components/sigma_delta_output/output.py +2 -7
- esphome/components/sim800l/__init__.py +3 -7
- esphome/components/sim800l/binary_sensor.py +3 -5
- esphome/components/sim800l/sensor.py +2 -1
- esphome/components/slow_pwm/output.py +4 -5
- esphome/components/sm10bit_base/__init__.py +2 -6
- esphome/components/sm16716/__init__.py +1 -1
- esphome/components/sm16716/output.py +2 -1
- esphome/components/sm2135/__init__.py +2 -6
- esphome/components/sm2135/output.py +2 -1
- esphome/components/sm2235/__init__.py +1 -1
- esphome/components/sm2235/output.py +2 -1
- esphome/components/sm2335/__init__.py +1 -1
- esphome/components/sm2335/output.py +2 -1
- esphome/components/sm300d2/sensor.py +13 -13
- esphome/components/sml/__init__.py +1 -1
- esphome/components/sml/sensor/__init__.py +1 -1
- esphome/components/sml/sml.cpp +8 -6
- esphome/components/sml/sml.h +1 -1
- esphome/components/sml/sml_parser.cpp +16 -18
- esphome/components/sml/sml_parser.h +42 -12
- esphome/components/sml/text_sensor/__init__.py +1 -1
- esphome/components/smt100/sensor.py +5 -6
- esphome/components/sn74hc165/__init__.py +5 -5
- esphome/components/sn74hc595/__init__.py +5 -5
- esphome/components/socket/__init__.py +1 -1
- esphome/components/sonoff_d1/light.py +2 -6
- esphome/components/speaker/media_player/audio_pipeline.cpp +3 -2
- esphome/components/speed/fan/__init__.py +2 -2
- esphome/components/spi/__init__.py +45 -36
- esphome/components/spi/spi.h +1 -0
- esphome/components/spi/spi_esp_idf.cpp +13 -5
- esphome/components/sprinkler/__init__.py +4 -5
- esphome/components/sps30/sensor.py +8 -8
- esphome/components/ssd1306_i2c/display.py +2 -2
- esphome/components/ssd1322_base/__init__.py +2 -2
- esphome/components/ssd1325_base/__init__.py +2 -2
- esphome/components/ssd1327_base/__init__.py +2 -2
- esphome/components/ssd1327_i2c/display.py +1 -1
- esphome/components/ssd1331_base/__init__.py +2 -2
- esphome/components/ssd1351_base/__init__.py +2 -2
- esphome/components/st7567_base/__init__.py +4 -4
- esphome/components/st7567_i2c/display.py +1 -1
- esphome/components/st7920/display.py +2 -2
- esphome/components/statsd/__init__.py +3 -3
- esphome/components/status/binary_sensor.py +2 -5
- esphome/components/status_led/__init__.py +1 -1
- esphome/components/status_led/light/__init__.py +2 -1
- esphome/components/stepper/__init__.py +2 -2
- esphome/components/sts3x/sensor.py +1 -1
- esphome/components/substitutions/__init__.py +2 -2
- esphome/components/sun/__init__.py +4 -4
- esphome/components/sun/sensor/__init__.py +4 -7
- esphome/components/sun/text_sensor/__init__.py +5 -4
- esphome/components/sun_gtil2/__init__.py +1 -1
- esphome/components/sun_gtil2/sensor.py +7 -6
- esphome/components/sun_gtil2/text_sensor.py +3 -2
- esphome/components/sx1509/__init__.py +5 -5
- esphome/components/sx1509/binary_sensor/__init__.py +3 -3
- esphome/components/sx1509/output/__init__.py +4 -3
- esphome/components/t6615/sensor.py +1 -1
- esphome/components/tca9548a/__init__.py +1 -1
- esphome/components/tcl112/climate.py +1 -1
- esphome/components/tcs34725/sensor.py +4 -4
- esphome/components/tee501/sensor.py +1 -1
- esphome/components/teleinfo/__init__.py +1 -1
- esphome/components/teleinfo/sensor/__init__.py +1 -7
- esphome/components/teleinfo/text_sensor/__init__.py +1 -1
- esphome/components/tem3200/sensor.py +1 -2
- esphome/components/template/alarm_control_panel/__init__.py +3 -10
- esphome/components/template/cover/__init__.py +4 -3
- esphome/components/template/datetime/__init__.py +8 -9
- esphome/components/template/event/__init__.py +2 -5
- esphome/components/template/fan/__init__.py +2 -6
- esphome/components/template/lock/__init__.py +3 -2
- esphome/components/template/number/__init__.py +3 -2
- esphome/components/template/output/__init__.py +4 -3
- esphome/components/template/select/__init__.py +3 -2
- esphome/components/template/sensor/__init__.py +4 -7
- esphome/components/template/switch/__init__.py +3 -2
- esphome/components/template/text/__init__.py +4 -3
- esphome/components/template/text_sensor/__init__.py +3 -2
- esphome/components/template/valve/__init__.py +3 -2
- esphome/components/time/real_time_clock.cpp +0 -4
- esphome/components/time/real_time_clock.h +4 -3
- esphome/components/time_based/cover.py +3 -3
- esphome/components/tlc59208f/__init__.py +1 -1
- esphome/components/tlc59208f/output.py +2 -1
- esphome/components/tlc5947/__init__.py +1 -1
- esphome/components/tlc5947/output/__init__.py +2 -1
- esphome/components/tlc5971/__init__.py +2 -8
- esphome/components/tlc5971/output/__init__.py +2 -1
- esphome/components/tm1621/display.py +3 -3
- esphome/components/tm1637/binary_sensor.py +1 -1
- esphome/components/tm1637/display.py +3 -3
- esphome/components/tm1651/__init__.py +4 -4
- esphome/components/tmp102/sensor.py +1 -1
- esphome/components/tmp1075/sensor.py +2 -2
- esphome/components/tmp117/sensor.py +1 -1
- esphome/components/tof10120/sensor.py +2 -2
- esphome/components/tormatic/cover.py +2 -6
- esphome/components/toshiba/climate.py +1 -1
- esphome/components/total_daily_energy/sensor.py +4 -4
- esphome/components/tsl2561/sensor.py +1 -1
- esphome/components/tsl2591/sensor.py +9 -9
- esphome/components/tt21100/binary_sensor/__init__.py +2 -2
- esphome/components/tt21100/touchscreen/__init__.py +2 -3
- esphome/components/ttp229_bsf/__init__.py +2 -2
- esphome/components/ttp229_bsf/binary_sensor.py +3 -2
- esphome/components/ttp229_lsf/__init__.py +1 -1
- esphome/components/ttp229_lsf/binary_sensor.py +3 -2
- esphome/components/tuya/__init__.py +3 -5
- esphome/components/tuya/binary_sensor/__init__.py +2 -2
- esphome/components/tuya/climate/__init__.py +6 -5
- esphome/components/tuya/cover/__init__.py +5 -4
- esphome/components/tuya/fan/__init__.py +3 -2
- esphome/components/tuya/light/__init__.py +9 -8
- esphome/components/tuya/number/__init__.py +6 -5
- esphome/components/tuya/select/__init__.py +4 -3
- esphome/components/tuya/sensor/__init__.py +3 -2
- esphome/components/tuya/switch/__init__.py +3 -2
- esphome/components/tuya/text_sensor/__init__.py +3 -2
- esphome/components/tx20/sensor.py +6 -6
- esphome/components/uart/__init__.py +20 -19
- esphome/components/uart/button/__init__.py +2 -1
- esphome/components/uart/switch/__init__.py +2 -1
- esphome/components/ufire_ise/sensor.py +2 -2
- esphome/components/uln2003/stepper.py +2 -2
- esphome/components/ultrasonic/sensor.py +4 -4
- esphome/components/uponor_smatrix/__init__.py +2 -6
- esphome/components/uponor_smatrix/climate/__init__.py +3 -3
- esphome/components/vbus/__init__.py +1 -1
- esphome/components/vbus/binary_sensor/__init__.py +7 -6
- esphome/components/vbus/sensor/__init__.py +7 -6
- esphome/components/veml3235/sensor.py +1 -1
- esphome/components/veml7700/sensor.py +1 -1
- esphome/components/version/text_sensor.py +2 -6
- esphome/components/vl53l0x/sensor.py +6 -6
- esphome/components/web_server_base/__init__.py +2 -2
- esphome/components/web_server_idf/__init__.py +1 -1
- esphome/components/weikai/__init__.py +1 -1
- esphome/components/whirlpool/climate.py +1 -1
- esphome/components/whynter/climate.py +1 -1
- esphome/components/wireguard/binary_sensor.py +1 -1
- esphome/components/wireguard/sensor.py +2 -5
- esphome/components/wireguard/text_sensor.py +2 -5
- esphome/components/wk2132_i2c/__init__.py +1 -1
- esphome/components/wk2132_spi/__init__.py +1 -2
- esphome/components/wk2168_i2c/__init__.py +3 -8
- esphome/components/wk2168_spi/__init__.py +3 -8
- esphome/components/wk2204_i2c/__init__.py +1 -1
- esphome/components/wk2204_spi/__init__.py +1 -1
- esphome/components/wk2212_i2c/__init__.py +3 -8
- esphome/components/wk2212_spi/__init__.py +3 -8
- esphome/components/wl_134/text_sensor.py +2 -4
- esphome/components/wled/__init__.py +2 -2
- esphome/components/x9c/output.py +4 -4
- esphome/components/xgzp68xx/sensor.py +5 -5
- esphome/components/xiaomi_ble/__init__.py +1 -1
- esphome/components/xiaomi_cgd1/sensor.py +3 -3
- esphome/components/xiaomi_cgdk2/sensor.py +3 -3
- esphome/components/xiaomi_cgg1/sensor.py +2 -2
- esphome/components/xiaomi_cgpr1/binary_sensor.py +6 -6
- esphome/components/xiaomi_gcls002/sensor.py +7 -7
- esphome/components/xiaomi_hhccjcy01/sensor.py +9 -9
- esphome/components/xiaomi_hhccjcy10/sensor.py +9 -9
- esphome/components/xiaomi_hhccpot002/sensor.py +7 -7
- esphome/components/xiaomi_jqjcy01ym/sensor.py +6 -6
- esphome/components/xiaomi_lywsd02/sensor.py +4 -4
- esphome/components/xiaomi_lywsd02mmc/sensor.py +5 -5
- esphome/components/xiaomi_lywsd03mmc/sensor.py +6 -6
- esphome/components/xiaomi_lywsdcgq/sensor.py +5 -5
- esphome/components/xiaomi_mhoc303/sensor.py +4 -4
- esphome/components/xiaomi_mhoc401/sensor.py +6 -6
- esphome/components/xiaomi_miscale/sensor.py +6 -6
- esphome/components/xiaomi_mjyd02yla/binary_sensor.py +8 -8
- esphome/components/xiaomi_mue4094rt/binary_sensor.py +2 -7
- esphome/components/xiaomi_rtcgq02lm/__init__.py +2 -3
- esphome/components/xiaomi_rtcgq02lm/binary_sensor.py +3 -3
- esphome/components/xiaomi_rtcgq02lm/sensor.py +3 -3
- esphome/components/xiaomi_wx08zm/binary_sensor.py +2 -3
- esphome/components/xl9535/__init__.py +2 -2
- esphome/components/yashima/climate.py +1 -1
- esphome/components/zhlt01/climate.py +1 -1
- esphome/components/zio_ultrasonic/sensor.py +2 -5
- esphome/components/zyaura/sensor.py +7 -7
- esphome/config_validation.py +0 -42
- esphome/const.py +3 -1
- esphome/core/__init__.py +0 -1
- esphome/core/component.cpp +3 -1
- esphome/core/component.h +15 -2
- esphome/core/config.py +4 -0
- esphome/core/defines.h +21 -0
- esphome/core/helpers.cpp +6 -7
- esphome/core/scheduler.cpp +34 -67
- esphome/core/scheduler.h +7 -17
- esphome/dashboard/status/mqtt.py +0 -2
- esphome/vscode.py +27 -8
- esphome/yaml_util.py +75 -39
- {esphome-2025.3.3.dist-info → esphome-2025.4.0.dist-info}/METADATA +45 -44
- {esphome-2025.3.3.dist-info → esphome-2025.4.0.dist-info}/RECORD +713 -706
- {esphome-2025.3.3.dist-info → esphome-2025.4.0.dist-info}/WHEEL +1 -1
- {esphome-2025.3.3.dist-info → esphome-2025.4.0.dist-info}/entry_points.txt +0 -0
- {esphome-2025.3.3.dist-info → esphome-2025.4.0.dist-info/licenses}/LICENSE +0 -0
- {esphome-2025.3.3.dist-info → esphome-2025.4.0.dist-info}/top_level.txt +0 -0
@@ -1,17 +1,17 @@
|
|
1
1
|
import esphome.codegen as cg
|
2
|
+
from esphome.components import i2c, sensirion_common, sensor
|
2
3
|
import esphome.config_validation as cv
|
3
|
-
from esphome.components import i2c, sensor, sensirion_common
|
4
4
|
from esphome.const import (
|
5
|
+
CONF_HUMIDITY,
|
5
6
|
CONF_ID,
|
6
7
|
CONF_TEMPERATURE,
|
7
|
-
|
8
|
+
DEVICE_CLASS_HUMIDITY,
|
9
|
+
DEVICE_CLASS_TEMPERATURE,
|
10
|
+
ICON_THERMOMETER,
|
11
|
+
ICON_WATER_PERCENT,
|
8
12
|
STATE_CLASS_MEASUREMENT,
|
9
13
|
UNIT_CELSIUS,
|
10
14
|
UNIT_PERCENT,
|
11
|
-
ICON_THERMOMETER,
|
12
|
-
ICON_WATER_PERCENT,
|
13
|
-
DEVICE_CLASS_TEMPERATURE,
|
14
|
-
DEVICE_CLASS_HUMIDITY,
|
15
15
|
)
|
16
16
|
|
17
17
|
CODEOWNERS = ["@sjtrny"]
|
@@ -1,11 +1,7 @@
|
|
1
1
|
import esphome.codegen as cg
|
2
|
-
import esphome.config_validation as cv
|
3
2
|
from esphome.components import button
|
4
|
-
|
5
|
-
|
6
|
-
ENTITY_CATEGORY_CONFIG,
|
7
|
-
ICON_POWER,
|
8
|
-
)
|
3
|
+
import esphome.config_validation as cv
|
4
|
+
from esphome.const import CONF_ID, ENTITY_CATEGORY_CONFIG, ICON_POWER
|
9
5
|
|
10
6
|
shutdown_ns = cg.esphome_ns.namespace("shutdown")
|
11
7
|
ShutdownButton = shutdown_ns.class_("ShutdownButton", button.Button, cg.Component)
|
@@ -1,10 +1,7 @@
|
|
1
1
|
import esphome.codegen as cg
|
2
|
-
import esphome.config_validation as cv
|
3
2
|
from esphome.components import switch
|
4
|
-
|
5
|
-
|
6
|
-
ICON_POWER,
|
7
|
-
)
|
3
|
+
import esphome.config_validation as cv
|
4
|
+
from esphome.const import ENTITY_CATEGORY_CONFIG, ICON_POWER
|
8
5
|
|
9
6
|
shutdown_ns = cg.esphome_ns.namespace("shutdown")
|
10
7
|
ShutdownSwitch = shutdown_ns.class_("ShutdownSwitch", switch.Switch, cg.Component)
|
@@ -1,13 +1,8 @@
|
|
1
1
|
from esphome import automation, pins
|
2
|
+
import esphome.codegen as cg
|
2
3
|
from esphome.components import output
|
3
4
|
import esphome.config_validation as cv
|
4
|
-
|
5
|
-
from esphome.const import (
|
6
|
-
CONF_ID,
|
7
|
-
CONF_PIN,
|
8
|
-
CONF_TURN_ON_ACTION,
|
9
|
-
CONF_TURN_OFF_ACTION,
|
10
|
-
)
|
5
|
+
from esphome.const import CONF_ID, CONF_PIN, CONF_TURN_OFF_ACTION, CONF_TURN_ON_ACTION
|
11
6
|
|
12
7
|
DEPENDENCIES = []
|
13
8
|
|
@@ -1,12 +1,8 @@
|
|
1
|
-
import esphome.codegen as cg
|
2
|
-
import esphome.config_validation as cv
|
3
1
|
from esphome import automation
|
4
|
-
|
5
|
-
CONF_ID,
|
6
|
-
CONF_MESSAGE,
|
7
|
-
CONF_TRIGGER_ID,
|
8
|
-
)
|
2
|
+
import esphome.codegen as cg
|
9
3
|
from esphome.components import uart
|
4
|
+
import esphome.config_validation as cv
|
5
|
+
from esphome.const import CONF_ID, CONF_MESSAGE, CONF_TRIGGER_ID
|
10
6
|
|
11
7
|
DEPENDENCIES = ["uart"]
|
12
8
|
CODEOWNERS = ["@glmnet"]
|
@@ -1,10 +1,8 @@
|
|
1
1
|
import esphome.codegen as cg
|
2
|
-
import esphome.config_validation as cv
|
3
2
|
from esphome.components import binary_sensor
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
)
|
3
|
+
import esphome.config_validation as cv
|
4
|
+
from esphome.const import DEVICE_CLASS_CONNECTIVITY, ENTITY_CATEGORY_DIAGNOSTIC
|
5
|
+
|
8
6
|
from . import CONF_SIM800L_ID, Sim800LComponent
|
9
7
|
|
10
8
|
DEPENDENCIES = ["sim800l"]
|
@@ -1,12 +1,13 @@
|
|
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
|
DEVICE_CLASS_SIGNAL_STRENGTH,
|
6
6
|
ENTITY_CATEGORY_DIAGNOSTIC,
|
7
7
|
STATE_CLASS_MEASUREMENT,
|
8
8
|
UNIT_DECIBEL_MILLIWATT,
|
9
9
|
)
|
10
|
+
|
10
11
|
from . import CONF_SIM800L_ID, Sim800LComponent
|
11
12
|
|
12
13
|
DEPENDENCIES = ["sim800l"]
|
@@ -1,14 +1,13 @@
|
|
1
|
-
from esphome import
|
1
|
+
from esphome import automation, core, pins
|
2
|
+
import esphome.codegen as cg
|
2
3
|
from esphome.components import output
|
3
4
|
import esphome.config_validation as cv
|
4
|
-
import esphome.codegen as cg
|
5
|
-
from esphome import automation
|
6
5
|
from esphome.const import (
|
7
6
|
CONF_ID,
|
8
|
-
CONF_PIN,
|
9
7
|
CONF_PERIOD,
|
10
|
-
|
8
|
+
CONF_PIN,
|
11
9
|
CONF_TURN_OFF_ACTION,
|
10
|
+
CONF_TURN_ON_ACTION,
|
12
11
|
)
|
13
12
|
|
14
13
|
slow_pwm_ns = cg.esphome_ns.namespace("slow_pwm")
|
@@ -1,11 +1,7 @@
|
|
1
|
+
from esphome import pins
|
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_CLOCK_PIN,
|
6
|
-
CONF_DATA_PIN,
|
7
|
-
CONF_ID,
|
8
|
-
)
|
4
|
+
from esphome.const import CONF_CLOCK_PIN, CONF_DATA_PIN, CONF_ID
|
9
5
|
|
10
6
|
CODEOWNERS = ["@Cossid"]
|
11
7
|
MULTI_CONF = True
|
@@ -1,11 +1,7 @@
|
|
1
|
+
from esphome import pins
|
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_CLOCK_PIN,
|
6
|
-
CONF_DATA_PIN,
|
7
|
-
CONF_ID,
|
8
|
-
)
|
4
|
+
from esphome.const import CONF_CLOCK_PIN, CONF_DATA_PIN, CONF_ID
|
9
5
|
|
10
6
|
AUTO_LOAD = ["output"]
|
11
7
|
CODEOWNERS = ["@BoukeHaarsma23", "@matika77", "@dd32"]
|
@@ -1,30 +1,30 @@
|
|
1
1
|
import esphome.codegen as cg
|
2
|
-
import esphome.config_validation as cv
|
3
2
|
from esphome.components import sensor, uart
|
3
|
+
import esphome.config_validation as cv
|
4
4
|
from esphome.const import (
|
5
|
-
CONF_ID,
|
6
5
|
CONF_CO2,
|
7
6
|
CONF_FORMALDEHYDE,
|
8
|
-
|
7
|
+
CONF_HUMIDITY,
|
8
|
+
CONF_ID,
|
9
9
|
CONF_PM_2_5,
|
10
10
|
CONF_PM_10_0,
|
11
11
|
CONF_TEMPERATURE,
|
12
|
-
|
12
|
+
CONF_TVOC,
|
13
13
|
DEVICE_CLASS_CARBON_DIOXIDE,
|
14
|
-
|
15
|
-
DEVICE_CLASS_PM25,
|
14
|
+
DEVICE_CLASS_HUMIDITY,
|
16
15
|
DEVICE_CLASS_PM10,
|
16
|
+
DEVICE_CLASS_PM25,
|
17
17
|
DEVICE_CLASS_TEMPERATURE,
|
18
|
-
|
18
|
+
DEVICE_CLASS_VOLATILE_ORGANIC_COMPOUNDS,
|
19
|
+
ICON_CHEMICAL_WEAPON,
|
20
|
+
ICON_FLASK,
|
21
|
+
ICON_GRAIN,
|
22
|
+
ICON_MOLECULE_CO2,
|
19
23
|
STATE_CLASS_MEASUREMENT,
|
20
|
-
UNIT_PARTS_PER_MILLION,
|
21
|
-
UNIT_MICROGRAMS_PER_CUBIC_METER,
|
22
24
|
UNIT_CELSIUS,
|
25
|
+
UNIT_MICROGRAMS_PER_CUBIC_METER,
|
26
|
+
UNIT_PARTS_PER_MILLION,
|
23
27
|
UNIT_PERCENT,
|
24
|
-
ICON_MOLECULE_CO2,
|
25
|
-
ICON_FLASK,
|
26
|
-
ICON_CHEMICAL_WEAPON,
|
27
|
-
ICON_GRAIN,
|
28
28
|
)
|
29
29
|
|
30
30
|
DEPENDENCIES = ["uart"]
|
@@ -2,8 +2,8 @@ import re
|
|
2
2
|
|
3
3
|
from esphome import automation
|
4
4
|
import esphome.codegen as cg
|
5
|
-
import esphome.config_validation as cv
|
6
5
|
from esphome.components import uart
|
6
|
+
import esphome.config_validation as cv
|
7
7
|
from esphome.const import CONF_ID, CONF_TRIGGER_ID
|
8
8
|
|
9
9
|
CODEOWNERS = ["@alengwenus"]
|
@@ -1,6 +1,6 @@
|
|
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 CONF_ID
|
5
5
|
|
6
6
|
from .. import CONF_OBIS_CODE, CONF_SERVER_ID, CONF_SML_ID, Sml, obis_code, sml_ns
|
esphome/components/sml/sml.cpp
CHANGED
@@ -52,9 +52,8 @@ void Sml::loop() {
|
|
52
52
|
break;
|
53
53
|
|
54
54
|
// remove start/end sequence
|
55
|
-
this->
|
56
|
-
|
57
|
-
this->process_sml_file_(this->sml_data_);
|
55
|
+
this->process_sml_file_(
|
56
|
+
BytesView(this->sml_data_).subview(START_SEQ.size(), this->sml_data_.size() - START_SEQ.size() - 8));
|
58
57
|
}
|
59
58
|
break;
|
60
59
|
};
|
@@ -66,8 +65,8 @@ void Sml::add_on_data_callback(std::function<void(std::vector<uint8_t>, bool)> &
|
|
66
65
|
this->data_callbacks_.add(std::move(callback));
|
67
66
|
}
|
68
67
|
|
69
|
-
void Sml::process_sml_file_(const
|
70
|
-
SmlFile sml_file
|
68
|
+
void Sml::process_sml_file_(const BytesView &sml_data) {
|
69
|
+
SmlFile sml_file(sml_data);
|
71
70
|
std::vector<ObisInfo> obis_info = sml_file.get_obis_info();
|
72
71
|
this->publish_obis_info_(obis_info);
|
73
72
|
|
@@ -75,6 +74,7 @@ void Sml::process_sml_file_(const bytes &sml_data) {
|
|
75
74
|
}
|
76
75
|
|
77
76
|
void Sml::log_obis_info_(const std::vector<ObisInfo> &obis_info_vec) {
|
77
|
+
#ifdef ESPHOME_LOG_HAS_DEBUG
|
78
78
|
ESP_LOGD(TAG, "OBIS info:");
|
79
79
|
for (auto const &obis_info : obis_info_vec) {
|
80
80
|
std::string info;
|
@@ -83,6 +83,7 @@ void Sml::log_obis_info_(const std::vector<ObisInfo> &obis_info_vec) {
|
|
83
83
|
info += " [0x" + bytes_repr(obis_info.value) + "]";
|
84
84
|
ESP_LOGD(TAG, "%s", info.c_str());
|
85
85
|
}
|
86
|
+
#endif
|
86
87
|
}
|
87
88
|
|
88
89
|
void Sml::publish_obis_info_(const std::vector<ObisInfo> &obis_info_vec) {
|
@@ -92,10 +93,11 @@ void Sml::publish_obis_info_(const std::vector<ObisInfo> &obis_info_vec) {
|
|
92
93
|
}
|
93
94
|
|
94
95
|
void Sml::publish_value_(const ObisInfo &obis_info) {
|
96
|
+
const auto obis_code = obis_info.code_repr();
|
95
97
|
for (auto const &sml_listener : sml_listeners_) {
|
96
98
|
if ((!sml_listener->server_id.empty()) && (bytes_repr(obis_info.server_id) != sml_listener->server_id))
|
97
99
|
continue;
|
98
|
-
if (
|
100
|
+
if (obis_code != sml_listener->obis_code)
|
99
101
|
continue;
|
100
102
|
sml_listener->publish_val(obis_info);
|
101
103
|
}
|
esphome/components/sml/sml.h
CHANGED
@@ -27,7 +27,7 @@ class Sml : public Component, public uart::UARTDevice {
|
|
27
27
|
void add_on_data_callback(std::function<void(std::vector<uint8_t>, bool)> &&callback);
|
28
28
|
|
29
29
|
protected:
|
30
|
-
void process_sml_file_(const
|
30
|
+
void process_sml_file_(const BytesView &sml_data);
|
31
31
|
void log_obis_info_(const std::vector<ObisInfo> &obis_info_vec);
|
32
32
|
void publish_obis_info_(const std::vector<ObisInfo> &obis_info_vec);
|
33
33
|
char check_start_end_bytes_(uint8_t byte);
|
@@ -5,17 +5,17 @@
|
|
5
5
|
namespace esphome {
|
6
6
|
namespace sml {
|
7
7
|
|
8
|
-
SmlFile::SmlFile(
|
8
|
+
SmlFile::SmlFile(const BytesView &buffer) : buffer_(buffer) {
|
9
9
|
// extract messages
|
10
10
|
this->pos_ = 0;
|
11
11
|
while (this->pos_ < this->buffer_.size()) {
|
12
12
|
if (this->buffer_[this->pos_] == 0x00)
|
13
13
|
break; // EndOfSmlMsg
|
14
14
|
|
15
|
-
SmlNode message
|
15
|
+
SmlNode message;
|
16
16
|
if (!this->setup_node(&message))
|
17
17
|
break;
|
18
|
-
this->messages.emplace_back(message);
|
18
|
+
this->messages.emplace_back(std::move(message));
|
19
19
|
}
|
20
20
|
}
|
21
21
|
|
@@ -62,22 +62,20 @@ bool SmlFile::setup_node(SmlNode *node) {
|
|
62
62
|
return false;
|
63
63
|
|
64
64
|
node->type = type;
|
65
|
-
node->nodes.clear();
|
66
|
-
node->value_bytes.clear();
|
67
65
|
|
68
66
|
if (type == SML_LIST) {
|
69
67
|
node->nodes.reserve(length);
|
70
68
|
for (size_t i = 0; i != length; i++) {
|
71
|
-
SmlNode child_node
|
69
|
+
SmlNode child_node;
|
72
70
|
if (!this->setup_node(&child_node))
|
73
71
|
return false;
|
74
|
-
node->nodes.emplace_back(child_node);
|
72
|
+
node->nodes.emplace_back(std::move(child_node));
|
75
73
|
}
|
76
74
|
} else {
|
77
75
|
// Value starts at the current position
|
78
76
|
// Value ends "length" bytes later,
|
79
77
|
// (since the TL field is counted but already subtracted from length)
|
80
|
-
node->value_bytes =
|
78
|
+
node->value_bytes = buffer_.subview(this->pos_, length);
|
81
79
|
// Increment the pointer past all consumed bytes
|
82
80
|
this->pos_ += length;
|
83
81
|
}
|
@@ -87,14 +85,14 @@ bool SmlFile::setup_node(SmlNode *node) {
|
|
87
85
|
std::vector<ObisInfo> SmlFile::get_obis_info() {
|
88
86
|
std::vector<ObisInfo> obis_info;
|
89
87
|
for (auto const &message : messages) {
|
90
|
-
|
88
|
+
const auto &message_body = message.nodes[3];
|
91
89
|
uint16_t message_type = bytes_to_uint(message_body.nodes[0].value_bytes);
|
92
90
|
if (message_type != SML_GET_LIST_RES)
|
93
91
|
continue;
|
94
92
|
|
95
|
-
|
96
|
-
|
97
|
-
|
93
|
+
const auto &get_list_response = message_body.nodes[1];
|
94
|
+
const auto &server_id = get_list_response.nodes[1].value_bytes;
|
95
|
+
const auto &val_list = get_list_response.nodes[4];
|
98
96
|
|
99
97
|
for (auto const &val_list_entry : val_list.nodes) {
|
100
98
|
obis_info.emplace_back(server_id, val_list_entry);
|
@@ -103,7 +101,7 @@ std::vector<ObisInfo> SmlFile::get_obis_info() {
|
|
103
101
|
return obis_info;
|
104
102
|
}
|
105
103
|
|
106
|
-
std::string bytes_repr(const
|
104
|
+
std::string bytes_repr(const BytesView &buffer) {
|
107
105
|
std::string repr;
|
108
106
|
for (auto const value : buffer) {
|
109
107
|
repr += str_sprintf("%02x", value & 0xff);
|
@@ -111,7 +109,7 @@ std::string bytes_repr(const bytes &buffer) {
|
|
111
109
|
return repr;
|
112
110
|
}
|
113
111
|
|
114
|
-
uint64_t bytes_to_uint(const
|
112
|
+
uint64_t bytes_to_uint(const BytesView &buffer) {
|
115
113
|
uint64_t val = 0;
|
116
114
|
for (auto const value : buffer) {
|
117
115
|
val = (val << 8) + value;
|
@@ -119,7 +117,7 @@ uint64_t bytes_to_uint(const bytes &buffer) {
|
|
119
117
|
return val;
|
120
118
|
}
|
121
119
|
|
122
|
-
int64_t bytes_to_int(const
|
120
|
+
int64_t bytes_to_int(const BytesView &buffer) {
|
123
121
|
uint64_t tmp = bytes_to_uint(buffer);
|
124
122
|
int64_t val;
|
125
123
|
|
@@ -135,14 +133,14 @@ int64_t bytes_to_int(const bytes &buffer) {
|
|
135
133
|
return val;
|
136
134
|
}
|
137
135
|
|
138
|
-
std::string bytes_to_string(const
|
136
|
+
std::string bytes_to_string(const BytesView &buffer) { return std::string(buffer.begin(), buffer.end()); }
|
139
137
|
|
140
|
-
ObisInfo::ObisInfo(
|
138
|
+
ObisInfo::ObisInfo(const BytesView &server_id, const SmlNode &val_list_entry) : server_id(server_id) {
|
141
139
|
this->code = val_list_entry.nodes[0].value_bytes;
|
142
140
|
this->status = val_list_entry.nodes[1].value_bytes;
|
143
141
|
this->unit = bytes_to_uint(val_list_entry.nodes[3].value_bytes);
|
144
142
|
this->scaler = bytes_to_int(val_list_entry.nodes[4].value_bytes);
|
145
|
-
|
143
|
+
const auto &value_node = val_list_entry.nodes[5];
|
146
144
|
this->value = value_node.value_bytes;
|
147
145
|
this->value_type = value_node.type;
|
148
146
|
}
|
@@ -1,5 +1,6 @@
|
|
1
1
|
#pragma once
|
2
2
|
|
3
|
+
#include <cassert>
|
3
4
|
#include <cstdint>
|
4
5
|
#include <cstdio>
|
5
6
|
#include <string>
|
@@ -11,44 +12,73 @@ namespace sml {
|
|
11
12
|
|
12
13
|
using bytes = std::vector<uint8_t>;
|
13
14
|
|
15
|
+
class BytesView {
|
16
|
+
public:
|
17
|
+
BytesView() noexcept = default;
|
18
|
+
|
19
|
+
explicit BytesView(const uint8_t *first, size_t count) noexcept : data_{first}, count_{count} {}
|
20
|
+
|
21
|
+
explicit BytesView(const bytes &bytes) noexcept : data_{bytes.data()}, count_{bytes.size()} {}
|
22
|
+
|
23
|
+
size_t size() const noexcept { return count_; }
|
24
|
+
|
25
|
+
uint8_t operator[](size_t index) const noexcept {
|
26
|
+
assert(index < count_);
|
27
|
+
return data_[index];
|
28
|
+
}
|
29
|
+
|
30
|
+
BytesView subview(size_t offset, size_t count) const noexcept {
|
31
|
+
assert(offset + count <= count_);
|
32
|
+
return BytesView{data_ + offset, count};
|
33
|
+
}
|
34
|
+
|
35
|
+
const uint8_t *begin() const noexcept { return data_; }
|
36
|
+
|
37
|
+
const uint8_t *end() const noexcept { return data_ + count_; }
|
38
|
+
|
39
|
+
private:
|
40
|
+
const uint8_t *data_ = nullptr;
|
41
|
+
size_t count_ = 0;
|
42
|
+
};
|
43
|
+
|
14
44
|
class SmlNode {
|
15
45
|
public:
|
16
46
|
uint8_t type;
|
17
|
-
|
47
|
+
BytesView value_bytes;
|
18
48
|
std::vector<SmlNode> nodes;
|
19
49
|
};
|
20
50
|
|
21
51
|
class ObisInfo {
|
22
52
|
public:
|
23
|
-
ObisInfo(
|
24
|
-
|
25
|
-
|
26
|
-
|
53
|
+
ObisInfo(const BytesView &server_id, const SmlNode &val_list_entry);
|
54
|
+
BytesView server_id;
|
55
|
+
BytesView code;
|
56
|
+
BytesView status;
|
27
57
|
char unit;
|
28
58
|
char scaler;
|
29
|
-
|
59
|
+
BytesView value;
|
30
60
|
uint16_t value_type;
|
31
61
|
std::string code_repr() const;
|
32
62
|
};
|
33
63
|
|
34
64
|
class SmlFile {
|
35
65
|
public:
|
36
|
-
SmlFile(
|
66
|
+
SmlFile(const BytesView &buffer);
|
37
67
|
bool setup_node(SmlNode *node);
|
38
68
|
std::vector<SmlNode> messages;
|
39
69
|
std::vector<ObisInfo> get_obis_info();
|
40
70
|
|
41
71
|
protected:
|
42
|
-
const
|
72
|
+
const BytesView buffer_;
|
43
73
|
size_t pos_;
|
44
74
|
};
|
45
75
|
|
46
|
-
std::string bytes_repr(const
|
76
|
+
std::string bytes_repr(const BytesView &buffer);
|
47
77
|
|
48
|
-
uint64_t bytes_to_uint(const
|
78
|
+
uint64_t bytes_to_uint(const BytesView &buffer);
|
49
79
|
|
50
|
-
int64_t bytes_to_int(const
|
80
|
+
int64_t bytes_to_int(const BytesView &buffer);
|
51
81
|
|
52
|
-
std::string bytes_to_string(const
|
82
|
+
std::string bytes_to_string(const BytesView &buffer);
|
53
83
|
} // namespace sml
|
54
84
|
} // namespace esphome
|
@@ -1,6 +1,6 @@
|
|
1
1
|
import esphome.codegen as cg
|
2
|
-
import esphome.config_validation as cv
|
3
2
|
from esphome.components import text_sensor
|
3
|
+
import esphome.config_validation as cv
|
4
4
|
from esphome.const import CONF_FORMAT, CONF_ID
|
5
5
|
|
6
6
|
from .. import CONF_OBIS_CODE, CONF_SERVER_ID, CONF_SML_ID, Sml, obis_code, sml_ns
|
@@ -1,20 +1,19 @@
|
|
1
1
|
import esphome.codegen as cg
|
2
|
-
import esphome.config_validation as cv
|
3
2
|
from esphome.components import sensor, uart
|
4
|
-
|
3
|
+
import esphome.config_validation as cv
|
5
4
|
from esphome.const import (
|
6
|
-
CONF_ID,
|
7
5
|
CONF_COUNTS,
|
8
6
|
CONF_DIELECTRIC_CONSTANT,
|
9
|
-
|
7
|
+
CONF_ID,
|
10
8
|
CONF_MOISTURE,
|
9
|
+
CONF_TEMPERATURE,
|
11
10
|
CONF_VOLTAGE,
|
12
|
-
ICON_WATER_PERCENT,
|
13
11
|
DEVICE_CLASS_TEMPERATURE,
|
14
12
|
DEVICE_CLASS_VOLTAGE,
|
13
|
+
ICON_WATER_PERCENT,
|
15
14
|
STATE_CLASS_MEASUREMENT,
|
16
|
-
UNIT_EMPTY,
|
17
15
|
UNIT_CELSIUS,
|
16
|
+
UNIT_EMPTY,
|
18
17
|
UNIT_PERCENT,
|
19
18
|
UNIT_VOLT,
|
20
19
|
)
|
@@ -1,14 +1,14 @@
|
|
1
|
+
from esphome import pins
|
1
2
|
import esphome.codegen as cg
|
2
3
|
import esphome.config_validation as cv
|
3
|
-
from esphome import pins
|
4
4
|
from esphome.const import (
|
5
|
+
CONF_CLOCK_PIN,
|
6
|
+
CONF_DATA_PIN,
|
5
7
|
CONF_ID,
|
8
|
+
CONF_INPUT,
|
9
|
+
CONF_INVERTED,
|
6
10
|
CONF_MODE,
|
7
11
|
CONF_NUMBER,
|
8
|
-
CONF_INVERTED,
|
9
|
-
CONF_DATA_PIN,
|
10
|
-
CONF_CLOCK_PIN,
|
11
|
-
CONF_INPUT,
|
12
12
|
)
|
13
13
|
|
14
14
|
CODEOWNERS = ["@jesserockz"]
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import esphome.codegen as cg
|
2
|
-
import esphome.config_validation as cv
|
3
1
|
from esphome import pins
|
2
|
+
import esphome.codegen as cg
|
4
3
|
from esphome.components import spi
|
4
|
+
import esphome.config_validation as cv
|
5
5
|
from esphome.const import (
|
6
|
+
CONF_CLOCK_PIN,
|
7
|
+
CONF_DATA_PIN,
|
6
8
|
CONF_ID,
|
7
|
-
CONF_NUMBER,
|
8
9
|
CONF_INVERTED,
|
9
|
-
|
10
|
-
CONF_CLOCK_PIN,
|
10
|
+
CONF_NUMBER,
|
11
11
|
CONF_OE_PIN,
|
12
12
|
CONF_OUTPUT,
|
13
13
|
CONF_TYPE,
|