esphome 2024.12.3__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/__init__.py +0 -0
- esphome/__main__.py +1045 -0
- esphome/automation.py +430 -0
- esphome/codegen.py +93 -0
- esphome/components/__init__.py +0 -0
- esphome/components/a01nyub/__init__.py +1 -0
- esphome/components/a01nyub/a01nyub.cpp +44 -0
- esphome/components/a01nyub/a01nyub.h +27 -0
- esphome/components/a01nyub/sensor.py +41 -0
- esphome/components/a02yyuw/__init__.py +1 -0
- esphome/components/a02yyuw/a02yyuw.cpp +43 -0
- esphome/components/a02yyuw/a02yyuw.h +27 -0
- esphome/components/a02yyuw/sensor.py +41 -0
- esphome/components/a4988/__init__.py +0 -0
- esphome/components/a4988/a4988.cpp +56 -0
- esphome/components/a4988/a4988.h +29 -0
- esphome/components/a4988/stepper.py +33 -0
- esphome/components/absolute_humidity/__init__.py +1 -0
- esphome/components/absolute_humidity/absolute_humidity.cpp +182 -0
- esphome/components/absolute_humidity/absolute_humidity.h +76 -0
- esphome/components/absolute_humidity/sensor.py +56 -0
- esphome/components/ac_dimmer/__init__.py +0 -0
- esphome/components/ac_dimmer/ac_dimmer.cpp +233 -0
- esphome/components/ac_dimmer/ac_dimmer.h +70 -0
- esphome/components/ac_dimmer/output.py +52 -0
- esphome/components/adalight/__init__.py +27 -0
- esphome/components/adalight/adalight_light_effect.cpp +142 -0
- esphome/components/adalight/adalight_light_effect.h +39 -0
- esphome/components/adc/__init__.py +208 -0
- esphome/components/adc/adc_sensor.h +90 -0
- esphome/components/adc/adc_sensor_common.cpp +24 -0
- esphome/components/adc/adc_sensor_esp32.cpp +163 -0
- esphome/components/adc/adc_sensor_esp8266.cpp +58 -0
- esphome/components/adc/adc_sensor_libretiny.cpp +48 -0
- esphome/components/adc/adc_sensor_rp2040.cpp +93 -0
- esphome/components/adc/sensor.py +136 -0
- esphome/components/adc128s102/__init__.py +23 -0
- esphome/components/adc128s102/adc128s102.cpp +35 -0
- esphome/components/adc128s102/adc128s102.h +23 -0
- esphome/components/adc128s102/sensor/__init__.py +38 -0
- esphome/components/adc128s102/sensor/adc128s102_sensor.cpp +24 -0
- esphome/components/adc128s102/sensor/adc128s102_sensor.h +29 -0
- esphome/components/addressable_light/__init__.py +0 -0
- esphome/components/addressable_light/addressable_light_display.cpp +67 -0
- esphome/components/addressable_light/addressable_light_display.h +63 -0
- esphome/components/addressable_light/display.py +62 -0
- esphome/components/ade7880/__init__.py +1 -0
- esphome/components/ade7880/ade7880.cpp +304 -0
- esphome/components/ade7880/ade7880.h +131 -0
- esphome/components/ade7880/ade7880_i2c.cpp +101 -0
- esphome/components/ade7880/ade7880_registers.h +243 -0
- esphome/components/ade7880/sensor.py +290 -0
- esphome/components/ade7953/__init__.py +1 -0
- esphome/components/ade7953/sensor.py +5 -0
- esphome/components/ade7953_base/__init__.py +201 -0
- esphome/components/ade7953_base/ade7953_base.cpp +150 -0
- esphome/components/ade7953_base/ade7953_base.h +125 -0
- esphome/components/ade7953_i2c/__init__.py +1 -0
- esphome/components/ade7953_i2c/ade7953_i2c.cpp +80 -0
- esphome/components/ade7953_i2c/ade7953_i2c.h +28 -0
- esphome/components/ade7953_i2c/sensor.py +27 -0
- esphome/components/ade7953_spi/__init__.py +1 -0
- esphome/components/ade7953_spi/ade7953_spi.cpp +81 -0
- esphome/components/ade7953_spi/ade7953_spi.h +32 -0
- esphome/components/ade7953_spi/sensor.py +27 -0
- esphome/components/ads1115/__init__.py +32 -0
- esphome/components/ads1115/ads1115.cpp +177 -0
- esphome/components/ads1115/ads1115.h +53 -0
- esphome/components/ads1115/sensor/__init__.py +81 -0
- esphome/components/ads1115/sensor/ads1115_sensor.cpp +30 -0
- esphome/components/ads1115/sensor/ads1115_sensor.h +35 -0
- esphome/components/ads1118/__init__.py +25 -0
- esphome/components/ads1118/ads1118.cpp +126 -0
- esphome/components/ads1118/ads1118.h +46 -0
- esphome/components/ads1118/sensor/__init__.py +97 -0
- esphome/components/ads1118/sensor/ads1118_sensor.cpp +29 -0
- esphome/components/ads1118/sensor/ads1118_sensor.h +36 -0
- esphome/components/ags10/__init__.py +1 -0
- esphome/components/ags10/ags10.cpp +214 -0
- esphome/components/ags10/ags10.h +152 -0
- esphome/components/ags10/sensor.py +132 -0
- esphome/components/aht10/__init__.py +0 -0
- esphome/components/aht10/aht10.cpp +172 -0
- esphome/components/aht10/aht10.h +36 -0
- esphome/components/aht10/sensor.py +65 -0
- esphome/components/aic3204/__init__.py +0 -0
- esphome/components/aic3204/aic3204.cpp +173 -0
- esphome/components/aic3204/aic3204.h +88 -0
- esphome/components/aic3204/audio_dac.py +52 -0
- esphome/components/aic3204/automation.h +23 -0
- esphome/components/airthings_ble/__init__.py +23 -0
- esphome/components/airthings_ble/airthings_listener.cpp +34 -0
- esphome/components/airthings_ble/airthings_listener.h +19 -0
- esphome/components/airthings_wave_base/__init__.py +103 -0
- esphome/components/airthings_wave_base/airthings_wave_base.cpp +211 -0
- esphome/components/airthings_wave_base/airthings_wave_base.h +90 -0
- esphome/components/airthings_wave_mini/__init__.py +1 -0
- esphome/components/airthings_wave_mini/airthings_wave_mini.cpp +55 -0
- esphome/components/airthings_wave_mini/airthings_wave_mini.h +40 -0
- esphome/components/airthings_wave_mini/sensor.py +28 -0
- esphome/components/airthings_wave_plus/__init__.py +1 -0
- esphome/components/airthings_wave_plus/airthings_wave_plus.cpp +86 -0
- esphome/components/airthings_wave_plus/airthings_wave_plus.h +55 -0
- esphome/components/airthings_wave_plus/sensor.py +76 -0
- esphome/components/alarm_control_panel/__init__.py +316 -0
- esphome/components/alarm_control_panel/alarm_control_panel.cpp +156 -0
- esphome/components/alarm_control_panel/alarm_control_panel.h +200 -0
- esphome/components/alarm_control_panel/alarm_control_panel_call.cpp +103 -0
- esphome/components/alarm_control_panel/alarm_control_panel_call.h +40 -0
- esphome/components/alarm_control_panel/alarm_control_panel_state.cpp +34 -0
- esphome/components/alarm_control_panel/alarm_control_panel_state.h +29 -0
- esphome/components/alarm_control_panel/automation.h +191 -0
- esphome/components/alpha3/__init__.py +1 -0
- esphome/components/alpha3/alpha3.cpp +191 -0
- esphome/components/alpha3/alpha3.h +73 -0
- esphome/components/alpha3/sensor.py +85 -0
- esphome/components/am2315c/__init__.py +1 -0
- esphome/components/am2315c/am2315c.cpp +200 -0
- esphome/components/am2315c/am2315c.h +51 -0
- esphome/components/am2315c/sensor.py +54 -0
- esphome/components/am2320/__init__.py +0 -0
- esphome/components/am2320/am2320.cpp +92 -0
- esphome/components/am2320/am2320.h +29 -0
- esphome/components/am2320/sensor.py +56 -0
- esphome/components/am43/__init__.py +1 -0
- esphome/components/am43/am43_base.cpp +144 -0
- esphome/components/am43/am43_base.h +78 -0
- esphome/components/am43/cover/__init__.py +36 -0
- esphome/components/am43/cover/am43_cover.cpp +157 -0
- esphome/components/am43/cover/am43_cover.h +45 -0
- esphome/components/am43/sensor/__init__.py +53 -0
- esphome/components/am43/sensor/am43_sensor.cpp +120 -0
- esphome/components/am43/sensor/am43_sensor.h +45 -0
- esphome/components/analog_threshold/__init__.py +1 -0
- esphome/components/analog_threshold/analog_threshold_binary_sensor.cpp +40 -0
- esphome/components/analog_threshold/analog_threshold_binary_sensor.h +29 -0
- esphome/components/analog_threshold/binary_sensor.py +50 -0
- esphome/components/animation/__init__.py +343 -0
- esphome/components/animation/animation.cpp +70 -0
- esphome/components/animation/animation.h +67 -0
- esphome/components/anova/__init__.py +0 -0
- esphome/components/anova/anova.cpp +158 -0
- esphome/components/anova/anova.h +52 -0
- esphome/components/anova/anova_base.cpp +134 -0
- esphome/components/anova/anova_base.h +79 -0
- esphome/components/anova/climate.py +36 -0
- esphome/components/apds9306/__init__.py +4 -0
- esphome/components/apds9306/apds9306.cpp +152 -0
- esphome/components/apds9306/apds9306.h +66 -0
- esphome/components/apds9306/sensor.py +95 -0
- esphome/components/apds9960/__init__.py +69 -0
- esphome/components/apds9960/apds9960.cpp +408 -0
- esphome/components/apds9960/apds9960.h +76 -0
- esphome/components/apds9960/binary_sensor.py +25 -0
- esphome/components/apds9960/sensor.py +33 -0
- esphome/components/api/__init__.py +286 -0
- esphome/components/api/api_connection.cpp +1572 -0
- esphome/components/api/api_connection.h +272 -0
- esphome/components/api/api_frame_helper.cpp +1031 -0
- esphome/components/api/api_frame_helper.h +193 -0
- esphome/components/api/api_noise_context.h +23 -0
- esphome/components/api/api_pb2.cpp +8946 -0
- esphome/components/api/api_pb2.h +2288 -0
- esphome/components/api/api_pb2_service.cpp +1728 -0
- esphome/components/api/api_pb2_service.h +557 -0
- esphome/components/api/api_server.cpp +407 -0
- esphome/components/api/api_server.h +157 -0
- esphome/components/api/client.py +60 -0
- esphome/components/api/custom_api_device.h +219 -0
- esphome/components/api/homeassistant_service.h +84 -0
- esphome/components/api/list_entities.cpp +108 -0
- esphome/components/api/list_entities.h +90 -0
- esphome/components/api/proto.cpp +92 -0
- esphome/components/api/proto.h +313 -0
- esphome/components/api/subscribe_state.cpp +88 -0
- esphome/components/api/subscribe_state.h +85 -0
- esphome/components/api/user_services.cpp +44 -0
- esphome/components/api/user_services.h +75 -0
- esphome/components/as3935/__init__.py +59 -0
- esphome/components/as3935/as3935.cpp +326 -0
- esphome/components/as3935/as3935.h +132 -0
- esphome/components/as3935/binary_sensor.py +18 -0
- esphome/components/as3935/sensor.py +40 -0
- esphome/components/as3935_i2c/__init__.py +26 -0
- esphome/components/as3935_i2c/as3935_i2c.cpp +44 -0
- esphome/components/as3935_i2c/as3935_i2c.h +22 -0
- esphome/components/as3935_spi/__init__.py +26 -0
- esphome/components/as3935_spi/as3935_spi.cpp +48 -0
- esphome/components/as3935_spi/as3935_spi.h +27 -0
- esphome/components/as5600/__init__.py +227 -0
- esphome/components/as5600/as5600.cpp +138 -0
- esphome/components/as5600/as5600.h +105 -0
- esphome/components/as5600/sensor/__init__.py +119 -0
- esphome/components/as5600/sensor/as5600_sensor.cpp +98 -0
- esphome/components/as5600/sensor/as5600_sensor.h +43 -0
- esphome/components/as7341/__init__.py +0 -0
- esphome/components/as7341/as7341.cpp +271 -0
- esphome/components/as7341/as7341.h +144 -0
- esphome/components/as7341/sensor.py +112 -0
- esphome/components/async_tcp/__init__.py +28 -0
- esphome/components/at581x/__init__.py +223 -0
- esphome/components/at581x/at581x.cpp +195 -0
- esphome/components/at581x/at581x.h +62 -0
- esphome/components/at581x/automation.h +71 -0
- esphome/components/at581x/switch/__init__.py +31 -0
- esphome/components/at581x/switch/rf_switch.cpp +12 -0
- esphome/components/at581x/switch/rf_switch.h +15 -0
- esphome/components/atc_mithermometer/__init__.py +0 -0
- esphome/components/atc_mithermometer/atc_mithermometer.cpp +133 -0
- esphome/components/atc_mithermometer/atc_mithermometer.h +51 -0
- esphome/components/atc_mithermometer/sensor.py +100 -0
- esphome/components/atm90e26/__init__.py +1 -0
- esphome/components/atm90e26/atm90e26.cpp +235 -0
- esphome/components/atm90e26/atm90e26.h +72 -0
- esphome/components/atm90e26/atm90e26_reg.h +70 -0
- esphome/components/atm90e26/sensor.py +157 -0
- esphome/components/atm90e32/__init__.py +7 -0
- esphome/components/atm90e32/atm90e32.cpp +496 -0
- esphome/components/atm90e32/atm90e32.h +140 -0
- esphome/components/atm90e32/atm90e32_reg.h +270 -0
- esphome/components/atm90e32/button/__init__.py +43 -0
- esphome/components/atm90e32/button/atm90e32_button.cpp +20 -0
- esphome/components/atm90e32/button/atm90e32_button.h +27 -0
- esphome/components/atm90e32/sensor.py +233 -0
- esphome/components/audio/__init__.py +9 -0
- esphome/components/audio/audio.h +21 -0
- esphome/components/audio_dac/__init__.py +57 -0
- esphome/components/audio_dac/audio_dac.h +23 -0
- esphome/components/audio_dac/automation.h +43 -0
- esphome/components/axs15231/__init__.py +6 -0
- esphome/components/axs15231/touchscreen/__init__.py +36 -0
- esphome/components/axs15231/touchscreen/axs15231_touchscreen.cpp +64 -0
- esphome/components/axs15231/touchscreen/axs15231_touchscreen.h +27 -0
- esphome/components/b_parasite/__init__.py +0 -0
- esphome/components/b_parasite/b_parasite.cpp +108 -0
- esphome/components/b_parasite/b_parasite.h +42 -0
- esphome/components/b_parasite/sensor.py +92 -0
- esphome/components/ballu/__init__.py +0 -0
- esphome/components/ballu/ballu.cpp +239 -0
- esphome/components/ballu/ballu.h +31 -0
- esphome/components/ballu/climate.py +21 -0
- esphome/components/bang_bang/__init__.py +1 -0
- esphome/components/bang_bang/bang_bang_climate.cpp +210 -0
- esphome/components/bang_bang/bang_bang_climate.h +89 -0
- esphome/components/bang_bang/climate.py +82 -0
- esphome/components/bedjet/__init__.py +52 -0
- esphome/components/bedjet/bedjet_child.h +23 -0
- esphome/components/bedjet/bedjet_codec.cpp +169 -0
- esphome/components/bedjet/bedjet_codec.h +194 -0
- esphome/components/bedjet/bedjet_const.h +107 -0
- esphome/components/bedjet/bedjet_hub.cpp +546 -0
- esphome/components/bedjet/bedjet_hub.h +178 -0
- esphome/components/bedjet/climate/__init__.py +75 -0
- esphome/components/bedjet/climate/bedjet_climate.cpp +353 -0
- esphome/components/bedjet/climate/bedjet_climate.h +94 -0
- esphome/components/bedjet/fan/__init__.py +36 -0
- esphome/components/bedjet/fan/bedjet_fan.cpp +113 -0
- esphome/components/bedjet/fan/bedjet_fan.h +40 -0
- esphome/components/bedjet/sensor/__init__.py +55 -0
- esphome/components/bedjet/sensor/bedjet_sensor.cpp +34 -0
- esphome/components/bedjet/sensor/bedjet_sensor.h +32 -0
- esphome/components/beken_spi_led_strip/__init__.py +0 -0
- esphome/components/beken_spi_led_strip/led_strip.cpp +384 -0
- esphome/components/beken_spi_led_strip/led_strip.h +85 -0
- esphome/components/beken_spi_led_strip/light.py +134 -0
- esphome/components/bh1750/__init__.py +0 -0
- esphome/components/bh1750/bh1750.cpp +169 -0
- esphome/components/bh1750/bh1750.h +33 -0
- esphome/components/bh1750/sensor.py +45 -0
- esphome/components/binary/__init__.py +3 -0
- esphome/components/binary/fan/__init__.py +38 -0
- esphome/components/binary/fan/binary_fan.cpp +40 -0
- esphome/components/binary/fan/binary_fan.h +31 -0
- esphome/components/binary/light/__init__.py +22 -0
- esphome/components/binary/light/binary_light_output.h +33 -0
- esphome/components/binary_sensor/__init__.py +589 -0
- esphome/components/binary_sensor/automation.cpp +123 -0
- esphome/components/binary_sensor/automation.h +158 -0
- esphome/components/binary_sensor/binary_sensor.cpp +68 -0
- esphome/components/binary_sensor/binary_sensor.h +91 -0
- esphome/components/binary_sensor/filter.cpp +133 -0
- esphome/components/binary_sensor/filter.h +126 -0
- esphome/components/binary_sensor_map/__init__.py +0 -0
- esphome/components/binary_sensor_map/binary_sensor_map.cpp +142 -0
- esphome/components/binary_sensor_map/binary_sensor_map.h +100 -0
- esphome/components/binary_sensor_map/sensor.py +106 -0
- esphome/components/bk72xx/__init__.py +51 -0
- esphome/components/bk72xx/boards.py +1264 -0
- esphome/components/bl0906/__init__.py +1 -0
- esphome/components/bl0906/bl0906.cpp +238 -0
- esphome/components/bl0906/bl0906.h +96 -0
- esphome/components/bl0906/const.py +4 -0
- esphome/components/bl0906/constants.h +122 -0
- esphome/components/bl0906/sensor.py +185 -0
- esphome/components/bl0939/__init__.py +1 -0
- esphome/components/bl0939/bl0939.cpp +146 -0
- esphome/components/bl0939/bl0939.h +107 -0
- esphome/components/bl0939/sensor.py +119 -0
- esphome/components/bl0940/__init__.py +1 -0
- esphome/components/bl0940/bl0940.cpp +138 -0
- esphome/components/bl0940/bl0940.h +109 -0
- esphome/components/bl0940/sensor.py +101 -0
- esphome/components/bl0942/__init__.py +1 -0
- esphome/components/bl0942/bl0942.cpp +215 -0
- esphome/components/bl0942/bl0942.h +152 -0
- esphome/components/bl0942/sensor.py +128 -0
- esphome/components/ble_client/__init__.py +308 -0
- esphome/components/ble_client/automation.cpp +13 -0
- esphome/components/ble_client/automation.h +378 -0
- esphome/components/ble_client/ble_client.cpp +89 -0
- esphome/components/ble_client/ble_client.h +81 -0
- esphome/components/ble_client/output/__init__.py +68 -0
- esphome/components/ble_client/output/ble_binary_output.cpp +77 -0
- esphome/components/ble_client/output/ble_binary_output.h +43 -0
- esphome/components/ble_client/sensor/__init__.py +161 -0
- esphome/components/ble_client/sensor/automation.h +41 -0
- esphome/components/ble_client/sensor/ble_rssi_sensor.cpp +79 -0
- esphome/components/ble_client/sensor/ble_rssi_sensor.h +35 -0
- esphome/components/ble_client/sensor/ble_sensor.cpp +142 -0
- esphome/components/ble_client/sensor/ble_sensor.h +52 -0
- esphome/components/ble_client/switch/__init__.py +22 -0
- esphome/components/ble_client/switch/ble_switch.cpp +36 -0
- esphome/components/ble_client/switch/ble_switch.h +30 -0
- esphome/components/ble_client/text_sensor/__init__.py +108 -0
- esphome/components/ble_client/text_sensor/automation.h +39 -0
- esphome/components/ble_client/text_sensor/ble_text_sensor.cpp +133 -0
- esphome/components/ble_client/text_sensor/ble_text_sensor.h +46 -0
- esphome/components/ble_presence/__init__.py +0 -0
- esphome/components/ble_presence/binary_sensor.py +93 -0
- esphome/components/ble_presence/ble_presence_device.cpp +16 -0
- esphome/components/ble_presence/ble_presence_device.h +143 -0
- esphome/components/ble_rssi/__init__.py +0 -0
- esphome/components/ble_rssi/ble_rssi_sensor.cpp +16 -0
- esphome/components/ble_rssi/ble_rssi_sensor.h +126 -0
- esphome/components/ble_rssi/sensor.py +89 -0
- esphome/components/ble_scanner/__init__.py +0 -0
- esphome/components/ble_scanner/ble_scanner.cpp +16 -0
- esphome/components/ble_scanner/ble_scanner.h +38 -0
- esphome/components/ble_scanner/text_sensor.py +25 -0
- esphome/components/bluetooth_proxy/__init__.py +83 -0
- esphome/components/bluetooth_proxy/bluetooth_connection.cpp +268 -0
- esphome/components/bluetooth_proxy/bluetooth_connection.h +37 -0
- esphome/components/bluetooth_proxy/bluetooth_proxy.cpp +522 -0
- esphome/components/bluetooth_proxy/bluetooth_proxy.h +134 -0
- esphome/components/bme280_base/__init__.py +108 -0
- esphome/components/bme280_base/bme280_base.cpp +359 -0
- esphome/components/bme280_base/bme280_base.h +114 -0
- esphome/components/bme280_i2c/__init__.py +0 -0
- esphome/components/bme280_i2c/bme280_i2c.cpp +30 -0
- esphome/components/bme280_i2c/bme280_i2c.h +20 -0
- esphome/components/bme280_i2c/sensor.py +21 -0
- esphome/components/bme280_spi/__init__.py +0 -0
- esphome/components/bme280_spi/bme280_spi.cpp +65 -0
- esphome/components/bme280_spi/bme280_spi.h +20 -0
- esphome/components/bme280_spi/sensor.py +23 -0
- esphome/components/bme680/__init__.py +0 -0
- esphome/components/bme680/bme680.cpp +515 -0
- esphome/components/bme680/bme680.h +139 -0
- esphome/components/bme680/sensor.py +159 -0
- esphome/components/bme680_bsec/__init__.py +88 -0
- esphome/components/bme680_bsec/bme680_bsec.cpp +563 -0
- esphome/components/bme680_bsec/bme680_bsec.h +137 -0
- esphome/components/bme680_bsec/sensor.py +123 -0
- esphome/components/bme680_bsec/text_sensor.py +32 -0
- esphome/components/bme68x_bsec2/__init__.py +196 -0
- esphome/components/bme68x_bsec2/bme68x_bsec2.cpp +526 -0
- esphome/components/bme68x_bsec2/bme68x_bsec2.h +161 -0
- esphome/components/bme68x_bsec2/sensor.py +130 -0
- esphome/components/bme68x_bsec2/text_sensor.py +33 -0
- esphome/components/bme68x_bsec2_i2c/__init__.py +28 -0
- esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.cpp +53 -0
- esphome/components/bme68x_bsec2_i2c/bme68x_bsec2_i2c.h +28 -0
- esphome/components/bmi160/__init__.py +1 -0
- esphome/components/bmi160/bmi160.cpp +270 -0
- esphome/components/bmi160/bmi160.h +44 -0
- esphome/components/bmi160/sensor.py +102 -0
- esphome/components/bmp085/__init__.py +0 -0
- esphome/components/bmp085/bmp085.cpp +138 -0
- esphome/components/bmp085/bmp085.h +45 -0
- esphome/components/bmp085/sensor.py +56 -0
- esphome/components/bmp280/__init__.py +0 -0
- esphome/components/bmp280/sensor.py +5 -0
- esphome/components/bmp280_base/__init__.py +88 -0
- esphome/components/bmp280_base/bmp280_base.cpp +273 -0
- esphome/components/bmp280_base/bmp280_base.h +98 -0
- esphome/components/bmp280_i2c/__init__.py +0 -0
- esphome/components/bmp280_i2c/bmp280_i2c.cpp +27 -0
- esphome/components/bmp280_i2c/bmp280_i2c.h +22 -0
- esphome/components/bmp280_i2c/sensor.py +22 -0
- esphome/components/bmp280_spi/__init__.py +0 -0
- esphome/components/bmp280_spi/bmp280_spi.cpp +65 -0
- esphome/components/bmp280_spi/bmp280_spi.h +20 -0
- esphome/components/bmp280_spi/sensor.py +22 -0
- esphome/components/bmp3xx/__init__.py +0 -0
- esphome/components/bmp3xx/sensor.py +7 -0
- esphome/components/bmp3xx_base/__init__.py +95 -0
- esphome/components/bmp3xx_base/bmp3xx_base.cpp +389 -0
- esphome/components/bmp3xx_base/bmp3xx_base.h +242 -0
- esphome/components/bmp3xx_i2c/__init__.py +0 -0
- esphome/components/bmp3xx_i2c/bmp3xx_i2c.cpp +29 -0
- esphome/components/bmp3xx_i2c/bmp3xx_i2c.h +17 -0
- esphome/components/bmp3xx_i2c/sensor.py +22 -0
- esphome/components/bmp3xx_spi/__init__.py +0 -0
- esphome/components/bmp3xx_spi/bmp3xx_spi.cpp +57 -0
- esphome/components/bmp3xx_spi/bmp3xx_spi.h +19 -0
- esphome/components/bmp3xx_spi/sensor.py +22 -0
- esphome/components/bmp581/__init__.py +0 -0
- esphome/components/bmp581/bmp581.cpp +596 -0
- esphome/components/bmp581/bmp581.h +222 -0
- esphome/components/bmp581/sensor.py +163 -0
- esphome/components/bp1658cj/__init__.py +44 -0
- esphome/components/bp1658cj/bp1658cj.cpp +131 -0
- esphome/components/bp1658cj/bp1658cj.h +64 -0
- esphome/components/bp1658cj/output.py +27 -0
- esphome/components/bp5758d/__init__.py +33 -0
- esphome/components/bp5758d/bp5758d.cpp +169 -0
- esphome/components/bp5758d/bp5758d.h +64 -0
- esphome/components/bp5758d/output.py +29 -0
- esphome/components/button/__init__.py +133 -0
- esphome/components/button/automation.h +28 -0
- esphome/components/button/button.cpp +17 -0
- esphome/components/button/button.h +52 -0
- esphome/components/bytebuffer/__init__.py +5 -0
- esphome/components/bytebuffer/bytebuffer.h +421 -0
- esphome/components/canbus/__init__.py +169 -0
- esphome/components/canbus/canbus.cpp +96 -0
- esphome/components/canbus/canbus.h +160 -0
- esphome/components/cap1188/__init__.py +45 -0
- esphome/components/cap1188/binary_sensor.py +23 -0
- esphome/components/cap1188/cap1188.cpp +88 -0
- esphome/components/cap1188/cap1188.h +70 -0
- esphome/components/captive_portal/__init__.py +49 -0
- esphome/components/captive_portal/captive_index.h +109 -0
- esphome/components/captive_portal/captive_portal.cpp +95 -0
- esphome/components/captive_portal/captive_portal.h +75 -0
- esphome/components/ccs811/__init__.py +0 -0
- esphome/components/ccs811/ccs811.cpp +189 -0
- esphome/components/ccs811/ccs811.h +57 -0
- esphome/components/ccs811/sensor.py +84 -0
- esphome/components/cd74hc4067/__init__.py +54 -0
- esphome/components/cd74hc4067/cd74hc4067.cpp +87 -0
- esphome/components/cd74hc4067/cd74hc4067.h +65 -0
- esphome/components/cd74hc4067/sensor.py +55 -0
- esphome/components/ch422g/__init__.py +76 -0
- esphome/components/ch422g/ch422g.cpp +139 -0
- esphome/components/ch422g/ch422g.h +68 -0
- esphome/components/climate/__init__.py +487 -0
- esphome/components/climate/automation.h +62 -0
- esphome/components/climate/climate.cpp +632 -0
- esphome/components/climate/climate.h +307 -0
- esphome/components/climate/climate_mode.cpp +111 -0
- esphome/components/climate/climate_mode.h +117 -0
- esphome/components/climate/climate_traits.cpp +15 -0
- esphome/components/climate/climate_traits.h +213 -0
- esphome/components/climate_ir/__init__.py +50 -0
- esphome/components/climate_ir/climate_ir.cpp +84 -0
- esphome/components/climate_ir/climate_ir.h +71 -0
- esphome/components/climate_ir_lg/__init__.py +0 -0
- esphome/components/climate_ir_lg/climate.py +47 -0
- esphome/components/climate_ir_lg/climate_ir_lg.cpp +222 -0
- esphome/components/climate_ir_lg/climate_ir_lg.h +57 -0
- esphome/components/color/__init__.py +108 -0
- esphome/components/color_temperature/__init__.py +0 -0
- esphome/components/color_temperature/ct_light_output.h +38 -0
- esphome/components/color_temperature/light.py +42 -0
- esphome/components/combination/__init__.py +0 -0
- esphome/components/combination/combination.cpp +262 -0
- esphome/components/combination/combination.h +141 -0
- esphome/components/combination/sensor.py +176 -0
- esphome/components/coolix/__init__.py +0 -0
- esphome/components/coolix/climate.py +21 -0
- esphome/components/coolix/coolix.cpp +162 -0
- esphome/components/coolix/coolix.h +45 -0
- esphome/components/copy/__init__.py +5 -0
- esphome/components/copy/binary_sensor/__init__.py +41 -0
- esphome/components/copy/binary_sensor/copy_binary_sensor.cpp +18 -0
- esphome/components/copy/binary_sensor/copy_binary_sensor.h +21 -0
- esphome/components/copy/button/__init__.py +41 -0
- esphome/components/copy/button/copy_button.cpp +14 -0
- esphome/components/copy/button/copy_button.h +22 -0
- esphome/components/copy/cover/__init__.py +38 -0
- esphome/components/copy/cover/copy_cover.cpp +51 -0
- esphome/components/copy/cover/copy_cover.h +25 -0
- esphome/components/copy/fan/__init__.py +36 -0
- esphome/components/copy/fan/copy_fan.cpp +58 -0
- esphome/components/copy/fan/copy_fan.h +26 -0
- esphome/components/copy/lock/__init__.py +36 -0
- esphome/components/copy/lock/copy_lock.cpp +29 -0
- esphome/components/copy/lock/copy_lock.h +23 -0
- esphome/components/copy/number/__init__.py +41 -0
- esphome/components/copy/number/copy_number.cpp +29 -0
- esphome/components/copy/number/copy_number.h +23 -0
- esphome/components/copy/select/__init__.py +39 -0
- esphome/components/copy/select/copy_select.cpp +27 -0
- esphome/components/copy/select/copy_select.h +23 -0
- esphome/components/copy/sensor/__init__.py +45 -0
- esphome/components/copy/sensor/copy_sensor.cpp +18 -0
- esphome/components/copy/sensor/copy_sensor.h +21 -0
- esphome/components/copy/switch/__init__.py +39 -0
- esphome/components/copy/switch/copy_switch.cpp +26 -0
- esphome/components/copy/switch/copy_switch.h +23 -0
- esphome/components/copy/text/__init__.py +36 -0
- esphome/components/copy/text/copy_text.cpp +25 -0
- esphome/components/copy/text/copy_text.h +23 -0
- esphome/components/copy/text_sensor/__init__.py +37 -0
- esphome/components/copy/text_sensor/copy_text_sensor.cpp +18 -0
- esphome/components/copy/text_sensor/copy_text_sensor.h +21 -0
- esphome/components/cover/__init__.py +230 -0
- esphome/components/cover/automation.h +135 -0
- esphome/components/cover/cover.cpp +226 -0
- esphome/components/cover/cover.h +179 -0
- esphome/components/cover/cover_traits.h +30 -0
- esphome/components/cs5460a/__init__.py +0 -0
- esphome/components/cs5460a/cs5460a.cpp +340 -0
- esphome/components/cs5460a/cs5460a.h +125 -0
- esphome/components/cs5460a/sensor.py +138 -0
- esphome/components/cse7761/__init__.py +0 -0
- esphome/components/cse7761/cse7761.cpp +244 -0
- esphome/components/cse7761/cse7761.h +52 -0
- esphome/components/cse7761/sensor.py +90 -0
- esphome/components/cse7766/__init__.py +0 -0
- esphome/components/cse7766/cse7766.cpp +251 -0
- esphome/components/cse7766/cse7766.h +48 -0
- esphome/components/cse7766/sensor.py +111 -0
- esphome/components/cst226/__init__.py +6 -0
- esphome/components/cst226/touchscreen/__init__.py +38 -0
- esphome/components/cst226/touchscreen/cst226_touchscreen.cpp +92 -0
- esphome/components/cst226/touchscreen/cst226_touchscreen.h +44 -0
- esphome/components/cst816/__init__.py +6 -0
- esphome/components/cst816/binary_sensor/__init__.py +28 -0
- esphome/components/cst816/binary_sensor/cst816_button.h +27 -0
- esphome/components/cst816/touchscreen/__init__.py +37 -0
- esphome/components/cst816/touchscreen/cst816_touchscreen.cpp +118 -0
- esphome/components/cst816/touchscreen/cst816_touchscreen.h +63 -0
- esphome/components/ct_clamp/__init__.py +0 -0
- esphome/components/ct_clamp/ct_clamp_sensor.cpp +74 -0
- esphome/components/ct_clamp/ct_clamp_sensor.h +54 -0
- esphome/components/ct_clamp/sensor.py +45 -0
- esphome/components/current_based/__init__.py +1 -0
- esphome/components/current_based/cover.py +128 -0
- esphome/components/current_based/current_based_cover.cpp +270 -0
- esphome/components/current_based/current_based_cover.h +97 -0
- esphome/components/custom/__init__.py +3 -0
- esphome/components/custom/binary_sensor/__init__.py +31 -0
- esphome/components/custom/binary_sensor/custom_binary_sensor.cpp +16 -0
- esphome/components/custom/binary_sensor/custom_binary_sensor.h +26 -0
- esphome/components/custom/climate/__init__.py +30 -0
- esphome/components/custom/climate/custom_climate.h +22 -0
- esphome/components/custom/cover/__init__.py +30 -0
- esphome/components/custom/cover/custom_cover.h +21 -0
- esphome/components/custom/light/__init__.py +30 -0
- esphome/components/custom/light/custom_light_output.h +24 -0
- esphome/components/custom/output/__init__.py +61 -0
- esphome/components/custom/output/custom_output.h +37 -0
- esphome/components/custom/sensor/__init__.py +27 -0
- esphome/components/custom/sensor/custom_sensor.cpp +16 -0
- esphome/components/custom/sensor/custom_sensor.h +24 -0
- esphome/components/custom/switch/__init__.py +27 -0
- esphome/components/custom/switch/custom_switch.cpp +16 -0
- esphome/components/custom/switch/custom_switch.h +24 -0
- esphome/components/custom/text_sensor/__init__.py +32 -0
- esphome/components/custom/text_sensor/custom_text_sensor.cpp +16 -0
- esphome/components/custom/text_sensor/custom_text_sensor.h +26 -0
- esphome/components/custom_component/__init__.py +31 -0
- esphome/components/custom_component/custom_component.h +28 -0
- esphome/components/cwww/__init__.py +0 -0
- esphome/components/cwww/cwww_light_output.h +40 -0
- esphome/components/cwww/light.py +48 -0
- esphome/components/dac7678/__init__.py +32 -0
- esphome/components/dac7678/dac7678_output.cpp +86 -0
- esphome/components/dac7678/dac7678_output.h +55 -0
- esphome/components/dac7678/output.py +27 -0
- esphome/components/daikin/__init__.py +0 -0
- esphome/components/daikin/climate.py +20 -0
- esphome/components/daikin/daikin.cpp +249 -0
- esphome/components/daikin/daikin.h +64 -0
- esphome/components/daikin_arc/__init__.py +1 -0
- esphome/components/daikin_arc/climate.py +18 -0
- esphome/components/daikin_arc/daikin_arc.cpp +487 -0
- esphome/components/daikin_arc/daikin_arc.h +76 -0
- esphome/components/daikin_brc/__init__.py +1 -0
- esphome/components/daikin_brc/climate.py +23 -0
- esphome/components/daikin_brc/daikin_brc.cpp +273 -0
- esphome/components/daikin_brc/daikin_brc.h +82 -0
- esphome/components/dallas/__init__.py +7 -0
- esphome/components/dallas/sensor.py +5 -0
- esphome/components/dallas_temp/__init__.py +1 -0
- esphome/components/dallas_temp/dallas_temp.cpp +169 -0
- esphome/components/dallas_temp/dallas_temp.h +32 -0
- esphome/components/dallas_temp/sensor.py +43 -0
- esphome/components/daly_bms/__init__.py +33 -0
- esphome/components/daly_bms/binary_sensor.py +38 -0
- esphome/components/daly_bms/daly_bms.cpp +319 -0
- esphome/components/daly_bms/daly_bms.h +91 -0
- esphome/components/daly_bms/sensor.py +229 -0
- esphome/components/daly_bms/text_sensor.py +34 -0
- esphome/components/dashboard_import/__init__.py +168 -0
- esphome/components/dashboard_import/dashboard_import.cpp +12 -0
- esphome/components/dashboard_import/dashboard_import.h +12 -0
- esphome/components/datetime/__init__.py +271 -0
- esphome/components/datetime/date_entity.cpp +131 -0
- esphome/components/datetime/date_entity.h +117 -0
- esphome/components/datetime/datetime_base.h +48 -0
- esphome/components/datetime/datetime_entity.cpp +252 -0
- esphome/components/datetime/datetime_entity.h +152 -0
- esphome/components/datetime/time_entity.cpp +154 -0
- esphome/components/datetime/time_entity.h +131 -0
- esphome/components/debug/__init__.py +46 -0
- esphome/components/debug/debug_component.cpp +93 -0
- esphome/components/debug/debug_component.h +70 -0
- esphome/components/debug/debug_esp32.cpp +297 -0
- esphome/components/debug/debug_esp8266.cpp +94 -0
- esphome/components/debug/debug_host.cpp +18 -0
- esphome/components/debug/debug_libretiny.cpp +44 -0
- esphome/components/debug/debug_rp2040.cpp +23 -0
- esphome/components/debug/sensor.py +86 -0
- esphome/components/debug/text_sensor.py +40 -0
- esphome/components/deep_sleep/__init__.py +316 -0
- esphome/components/deep_sleep/deep_sleep_component.cpp +76 -0
- esphome/components/deep_sleep/deep_sleep_component.h +217 -0
- esphome/components/deep_sleep/deep_sleep_esp32.cpp +104 -0
- esphome/components/deep_sleep/deep_sleep_esp8266.cpp +23 -0
- esphome/components/delonghi/__init__.py +1 -0
- esphome/components/delonghi/climate.py +20 -0
- esphome/components/delonghi/delonghi.cpp +186 -0
- esphome/components/delonghi/delonghi.h +64 -0
- esphome/components/demo/__init__.py +425 -0
- esphome/components/demo/demo_binary_sensor.h +22 -0
- esphome/components/demo/demo_climate.h +158 -0
- esphome/components/demo/demo_cover.h +87 -0
- esphome/components/demo/demo_fan.h +66 -0
- esphome/components/demo/demo_light.h +68 -0
- esphome/components/demo/demo_number.h +39 -0
- esphome/components/demo/demo_sensor.h +29 -0
- esphome/components/demo/demo_switch.h +22 -0
- esphome/components/demo/demo_text_sensor.h +25 -0
- esphome/components/dfplayer/__init__.py +373 -0
- esphome/components/dfplayer/dfplayer.cpp +263 -0
- esphome/components/dfplayer/dfplayer.h +182 -0
- esphome/components/dfrobot_sen0395/__init__.py +205 -0
- esphome/components/dfrobot_sen0395/automation.h +89 -0
- esphome/components/dfrobot_sen0395/binary_sensor.py +22 -0
- esphome/components/dfrobot_sen0395/commands.cpp +321 -0
- esphome/components/dfrobot_sen0395/commands.h +156 -0
- esphome/components/dfrobot_sen0395/dfrobot_sen0395.cpp +142 -0
- esphome/components/dfrobot_sen0395/dfrobot_sen0395.h +125 -0
- esphome/components/dfrobot_sen0395/switch/__init__.py +65 -0
- esphome/components/dfrobot_sen0395/switch/dfrobot_sen0395_switch.cpp +48 -0
- esphome/components/dfrobot_sen0395/switch/dfrobot_sen0395_switch.h +34 -0
- esphome/components/dht/__init__.py +1 -0
- esphome/components/dht/dht.cpp +257 -0
- esphome/components/dht/dht.h +65 -0
- esphome/components/dht/sensor.py +71 -0
- esphome/components/dht12/__init__.py +0 -0
- esphome/components/dht12/dht12.cpp +70 -0
- esphome/components/dht12/dht12.h +28 -0
- esphome/components/dht12/sensor.py +54 -0
- esphome/components/display/__init__.py +198 -0
- esphome/components/display/display.cpp +856 -0
- esphome/components/display/display.h +765 -0
- esphome/components/display/display_buffer.cpp +72 -0
- esphome/components/display/display_buffer.h +34 -0
- esphome/components/display/display_color_utils.h +159 -0
- esphome/components/display/rect.cpp +98 -0
- esphome/components/display/rect.h +36 -0
- esphome/components/display_menu_base/__init__.py +428 -0
- esphome/components/display_menu_base/automation.h +133 -0
- esphome/components/display_menu_base/display_menu_base.cpp +329 -0
- esphome/components/display_menu_base/display_menu_base.h +82 -0
- esphome/components/display_menu_base/menu_item.cpp +202 -0
- esphome/components/display_menu_base/menu_item.h +191 -0
- esphome/components/dps310/__init__.py +0 -0
- esphome/components/dps310/dps310.cpp +189 -0
- esphome/components/dps310/dps310.h +65 -0
- esphome/components/dps310/sensor.py +62 -0
- esphome/components/ds1307/__init__.py +0 -0
- esphome/components/ds1307/ds1307.cpp +109 -0
- esphome/components/ds1307/ds1307.h +70 -0
- esphome/components/ds1307/time.py +58 -0
- esphome/components/dsmr/__init__.py +93 -0
- esphome/components/dsmr/dsmr.cpp +333 -0
- esphome/components/dsmr/dsmr.h +146 -0
- esphome/components/dsmr/sensor.py +290 -0
- esphome/components/dsmr/text_sensor.py +51 -0
- esphome/components/duty_cycle/__init__.py +0 -0
- esphome/components/duty_cycle/duty_cycle_sensor.cpp +63 -0
- esphome/components/duty_cycle/duty_cycle_sensor.h +37 -0
- esphome/components/duty_cycle/sensor.py +35 -0
- esphome/components/duty_time/__init__.py +1 -0
- esphome/components/duty_time/duty_time_sensor.cpp +105 -0
- esphome/components/duty_time/duty_time_sensor.h +76 -0
- esphome/components/duty_time/sensor.py +127 -0
- esphome/components/e131/__init__.py +58 -0
- esphome/components/e131/e131.cpp +122 -0
- esphome/components/e131/e131.h +57 -0
- esphome/components/e131/e131_addressable_light_effect.cpp +94 -0
- esphome/components/e131/e131_addressable_light_effect.h +45 -0
- esphome/components/e131/e131_packet.cpp +141 -0
- esphome/components/ee895/__init__.py +0 -0
- esphome/components/ee895/ee895.cpp +115 -0
- esphome/components/ee895/ee895.h +34 -0
- esphome/components/ee895/sensor.py +69 -0
- esphome/components/ektf2232/__init__.py +0 -0
- esphome/components/ektf2232/touchscreen/__init__.py +42 -0
- esphome/components/ektf2232/touchscreen/ektf2232.cpp +132 -0
- esphome/components/ektf2232/touchscreen/ektf2232.h +35 -0
- esphome/components/emc2101/__init__.py +83 -0
- esphome/components/emc2101/emc2101.cpp +169 -0
- esphome/components/emc2101/emc2101.h +115 -0
- esphome/components/emc2101/output/__init__.py +21 -0
- esphome/components/emc2101/output/emc2101_output.cpp +9 -0
- esphome/components/emc2101/output/emc2101_output.h +22 -0
- esphome/components/emc2101/sensor/__init__.py +74 -0
- esphome/components/emc2101/sensor/emc2101_sensor.cpp +43 -0
- esphome/components/emc2101/sensor/emc2101_sensor.h +39 -0
- esphome/components/emmeti/__init__.py +0 -0
- esphome/components/emmeti/climate.py +21 -0
- esphome/components/emmeti/emmeti.cpp +316 -0
- esphome/components/emmeti/emmeti.h +109 -0
- esphome/components/endstop/__init__.py +0 -0
- esphome/components/endstop/cover.py +59 -0
- esphome/components/endstop/endstop_cover.cpp +192 -0
- esphome/components/endstop/endstop_cover.h +58 -0
- esphome/components/ens160/__init__.py +0 -0
- esphome/components/ens160/sensor.py +7 -0
- esphome/components/ens160_base/__init__.py +78 -0
- esphome/components/ens160_base/ens160_base.cpp +320 -0
- esphome/components/ens160_base/ens160_base.h +64 -0
- esphome/components/ens160_i2c/__init__.py +0 -0
- esphome/components/ens160_i2c/ens160_i2c.cpp +32 -0
- esphome/components/ens160_i2c/ens160_i2c.h +19 -0
- esphome/components/ens160_i2c/sensor.py +22 -0
- esphome/components/ens160_spi/__init__.py +0 -0
- esphome/components/ens160_spi/ens160_spi.cpp +59 -0
- esphome/components/ens160_spi/ens160_spi.h +22 -0
- esphome/components/ens160_spi/sensor.py +22 -0
- esphome/components/ens210/__init__.py +0 -0
- esphome/components/ens210/ens210.cpp +230 -0
- esphome/components/ens210/ens210.h +39 -0
- esphome/components/ens210/sensor.py +58 -0
- esphome/components/es8311/__init__.py +0 -0
- esphome/components/es8311/audio_dac.py +70 -0
- esphome/components/es8311/es8311.cpp +227 -0
- esphome/components/es8311/es8311.h +135 -0
- esphome/components/es8311/es8311_const.h +195 -0
- esphome/components/esp32/__init__.py +853 -0
- esphome/components/esp32/boards.py +2303 -0
- esphome/components/esp32/const.py +42 -0
- esphome/components/esp32/core.cpp +85 -0
- esphome/components/esp32/gpio.cpp +144 -0
- esphome/components/esp32/gpio.h +40 -0
- esphome/components/esp32/gpio.py +219 -0
- esphome/components/esp32/gpio_esp32.py +71 -0
- esphome/components/esp32/gpio_esp32_c2.py +32 -0
- esphome/components/esp32/gpio_esp32_c3.py +45 -0
- esphome/components/esp32/gpio_esp32_c6.py +45 -0
- esphome/components/esp32/gpio_esp32_h2.py +52 -0
- esphome/components/esp32/gpio_esp32_s2.py +74 -0
- esphome/components/esp32/gpio_esp32_s3.py +64 -0
- esphome/components/esp32/post_build.py.script +77 -0
- esphome/components/esp32/preferences.cpp +199 -0
- esphome/components/esp32/preferences.h +12 -0
- esphome/components/esp32_ble/__init__.py +119 -0
- esphome/components/esp32_ble/ble.cpp +443 -0
- esphome/components/esp32_ble/ble.h +159 -0
- esphome/components/esp32_ble/ble_advertising.cpp +165 -0
- esphome/components/esp32_ble/ble_advertising.h +60 -0
- esphome/components/esp32_ble/ble_event.h +94 -0
- esphome/components/esp32_ble/ble_uuid.cpp +195 -0
- esphome/components/esp32_ble/ble_uuid.h +47 -0
- esphome/components/esp32_ble/const_esp32c6.h +74 -0
- esphome/components/esp32_ble/queue.h +56 -0
- esphome/components/esp32_ble_beacon/__init__.py +85 -0
- esphome/components/esp32_ble_beacon/esp32_ble_beacon.cpp +128 -0
- esphome/components/esp32_ble_beacon/esp32_ble_beacon.h +69 -0
- esphome/components/esp32_ble_client/__init__.py +11 -0
- esphome/components/esp32_ble_client/ble_characteristic.cpp +99 -0
- esphome/components/esp32_ble_client/ble_characteristic.h +39 -0
- esphome/components/esp32_ble_client/ble_client_base.cpp +487 -0
- esphome/components/esp32_ble_client/ble_client_base.h +113 -0
- esphome/components/esp32_ble_client/ble_descriptor.h +25 -0
- esphome/components/esp32_ble_client/ble_service.cpp +77 -0
- esphome/components/esp32_ble_client/ble_service.h +36 -0
- esphome/components/esp32_ble_server/__init__.py +54 -0
- esphome/components/esp32_ble_server/ble_2901.cpp +18 -0
- esphome/components/esp32_ble_server/ble_2901.h +19 -0
- esphome/components/esp32_ble_server/ble_2902.cpp +20 -0
- esphome/components/esp32_ble_server/ble_2902.h +18 -0
- esphome/components/esp32_ble_server/ble_characteristic.cpp +324 -0
- esphome/components/esp32_ble_server/ble_characteristic.h +101 -0
- esphome/components/esp32_ble_server/ble_descriptor.cpp +78 -0
- esphome/components/esp32_ble_server/ble_descriptor.h +51 -0
- esphome/components/esp32_ble_server/ble_server.cpp +207 -0
- esphome/components/esp32_ble_server/ble_server.h +103 -0
- esphome/components/esp32_ble_server/ble_service.cpp +177 -0
- esphome/components/esp32_ble_server/ble_service.h +90 -0
- esphome/components/esp32_ble_tracker/__init__.py +332 -0
- esphome/components/esp32_ble_tracker/automation.h +112 -0
- esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +743 -0
- esphome/components/esp32_ble_tracker/esp32_ble_tracker.h +271 -0
- esphome/components/esp32_camera/__init__.py +315 -0
- esphome/components/esp32_camera/esp32_camera.cpp +431 -0
- esphome/components/esp32_camera/esp32_camera.h +250 -0
- esphome/components/esp32_camera_web_server/__init__.py +28 -0
- esphome/components/esp32_camera_web_server/camera_web_server.cpp +244 -0
- esphome/components/esp32_camera_web_server/camera_web_server.h +51 -0
- esphome/components/esp32_can/__init__.py +0 -0
- esphome/components/esp32_can/canbus.py +100 -0
- esphome/components/esp32_can/esp32_can.cpp +158 -0
- esphome/components/esp32_can/esp32_can.h +33 -0
- esphome/components/esp32_dac/__init__.py +0 -0
- esphome/components/esp32_dac/esp32_dac.cpp +54 -0
- esphome/components/esp32_dac/esp32_dac.h +32 -0
- esphome/components/esp32_dac/output.py +35 -0
- esphome/components/esp32_hall/__init__.py +0 -0
- esphome/components/esp32_hall/esp32_hall.cpp +25 -0
- esphome/components/esp32_hall/esp32_hall.h +23 -0
- esphome/components/esp32_hall/sensor.py +28 -0
- esphome/components/esp32_improv/__init__.py +146 -0
- esphome/components/esp32_improv/automation.h +72 -0
- esphome/components/esp32_improv/esp32_improv_component.cpp +349 -0
- esphome/components/esp32_improv/esp32_improv_component.h +120 -0
- esphome/components/esp32_rmt/__init__.py +55 -0
- esphome/components/esp32_rmt_led_strip/__init__.py +0 -0
- esphome/components/esp32_rmt_led_strip/led_strip.cpp +224 -0
- esphome/components/esp32_rmt_led_strip/led_strip.h +92 -0
- esphome/components/esp32_rmt_led_strip/light.py +155 -0
- esphome/components/esp32_touch/__init__.py +325 -0
- esphome/components/esp32_touch/binary_sensor.py +39 -0
- esphome/components/esp32_touch/esp32_touch.cpp +346 -0
- esphome/components/esp32_touch/esp32_touch.h +122 -0
- esphome/components/esp8266/__init__.py +262 -0
- esphome/components/esp8266/boards.py +362 -0
- esphome/components/esp8266/const.py +11 -0
- esphome/components/esp8266/core.cpp +73 -0
- esphome/components/esp8266/core.h +14 -0
- esphome/components/esp8266/gpio.cpp +109 -0
- esphome/components/esp8266/gpio.h +38 -0
- esphome/components/esp8266/gpio.py +210 -0
- esphome/components/esp8266/post_build.py.script +23 -0
- esphome/components/esp8266/preferences.cpp +291 -0
- esphome/components/esp8266/preferences.h +14 -0
- esphome/components/esp8266_pwm/__init__.py +0 -0
- esphome/components/esp8266_pwm/esp8266_pwm.cpp +58 -0
- esphome/components/esp8266_pwm/esp8266_pwm.h +54 -0
- esphome/components/esp8266_pwm/output.py +68 -0
- esphome/components/esphome/ota/__init__.py +134 -0
- esphome/components/esphome/ota/ota_esphome.cpp +413 -0
- esphome/components/esphome/ota/ota_esphome.h +45 -0
- esphome/components/ethernet/__init__.py +326 -0
- esphome/components/ethernet/esp_eth_phy_jl1101.c +355 -0
- esphome/components/ethernet/ethernet_component.cpp +676 -0
- esphome/components/ethernet/ethernet_component.h +153 -0
- esphome/components/ethernet_info/__init__.py +1 -0
- esphome/components/ethernet_info/ethernet_info_text_sensor.cpp +18 -0
- esphome/components/ethernet_info/ethernet_info_text_sensor.h +72 -0
- esphome/components/ethernet_info/text_sensor.py +64 -0
- esphome/components/event/__init__.py +142 -0
- esphome/components/event/automation.h +25 -0
- esphome/components/event/event.cpp +24 -0
- esphome/components/event/event.h +37 -0
- esphome/components/exposure_notifications/__init__.py +39 -0
- esphome/components/exposure_notifications/exposure_notifications.cpp +49 -0
- esphome/components/exposure_notifications/exposure_notifications.h +29 -0
- esphome/components/external_components/__init__.py +116 -0
- esphome/components/ezo/__init__.py +0 -0
- esphome/components/ezo/automation.h +53 -0
- esphome/components/ezo/ezo.cpp +235 -0
- esphome/components/ezo/ezo.h +111 -0
- esphome/components/ezo/sensor.py +114 -0
- esphome/components/ezo_pmp/__init__.py +296 -0
- esphome/components/ezo_pmp/binary_sensor.py +42 -0
- esphome/components/ezo_pmp/ezo_pmp.cpp +543 -0
- esphome/components/ezo_pmp/ezo_pmp.h +252 -0
- esphome/components/ezo_pmp/sensor.py +104 -0
- esphome/components/ezo_pmp/text_sensor.py +39 -0
- esphome/components/factory_reset/__init__.py +5 -0
- esphome/components/factory_reset/button/__init__.py +27 -0
- esphome/components/factory_reset/button/factory_reset_button.cpp +21 -0
- esphome/components/factory_reset/button/factory_reset_button.h +18 -0
- esphome/components/factory_reset/switch/__init__.py +35 -0
- esphome/components/factory_reset/switch/factory_reset_switch.cpp +26 -0
- esphome/components/factory_reset/switch/factory_reset_switch.h +18 -0
- esphome/components/fan/__init__.py +353 -0
- esphome/components/fan/automation.h +230 -0
- esphome/components/fan/fan.cpp +209 -0
- esphome/components/fan/fan.h +151 -0
- esphome/components/fan/fan_state.cpp +16 -0
- esphome/components/fan/fan_state.h +34 -0
- esphome/components/fan/fan_traits.h +47 -0
- esphome/components/fastled_base/__init__.py +48 -0
- esphome/components/fastled_base/fastled_light.cpp +43 -0
- esphome/components/fastled_base/fastled_light.h +243 -0
- esphome/components/fastled_clockless/__init__.py +0 -0
- esphome/components/fastled_clockless/light.py +70 -0
- esphome/components/fastled_spi/__init__.py +0 -0
- esphome/components/fastled_spi/light.py +67 -0
- esphome/components/feedback/__init__.py +1 -0
- esphome/components/feedback/cover.py +157 -0
- esphome/components/feedback/feedback_cover.cpp +446 -0
- esphome/components/feedback/feedback_cover.h +90 -0
- esphome/components/fingerprint_grow/__init__.py +373 -0
- esphome/components/fingerprint_grow/binary_sensor.py +20 -0
- esphome/components/fingerprint_grow/fingerprint_grow.cpp +576 -0
- esphome/components/fingerprint_grow/fingerprint_grow.h +335 -0
- esphome/components/fingerprint_grow/sensor.py +73 -0
- esphome/components/font/__init__.py +617 -0
- esphome/components/font/font.cpp +172 -0
- esphome/components/font/font.h +79 -0
- esphome/components/fs3000/__init__.py +0 -0
- esphome/components/fs3000/fs3000.cpp +107 -0
- esphome/components/fs3000/fs3000.h +35 -0
- esphome/components/fs3000/sensor.py +50 -0
- esphome/components/ft5x06/__init__.py +6 -0
- esphome/components/ft5x06/touchscreen/__init__.py +32 -0
- esphome/components/ft5x06/touchscreen/ft5x06_touchscreen.cpp +102 -0
- esphome/components/ft5x06/touchscreen/ft5x06_touchscreen.h +56 -0
- esphome/components/ft63x6/__init__.py +1 -0
- esphome/components/ft63x6/ft63x6.cpp +134 -0
- esphome/components/ft63x6/ft63x6.h +51 -0
- esphome/components/ft63x6/touchscreen.py +45 -0
- esphome/components/fujitsu_general/__init__.py +0 -0
- esphome/components/fujitsu_general/climate.py +22 -0
- esphome/components/fujitsu_general/fujitsu_general.cpp +404 -0
- esphome/components/fujitsu_general/fujitsu_general.h +82 -0
- esphome/components/gcja5/__init__.py +1 -0
- esphome/components/gcja5/gcja5.cpp +119 -0
- esphome/components/gcja5/gcja5.h +52 -0
- esphome/components/gcja5/sensor.py +118 -0
- esphome/components/gdk101/__init__.py +32 -0
- esphome/components/gdk101/binary_sensor.py +29 -0
- esphome/components/gdk101/gdk101.cpp +189 -0
- esphome/components/gdk101/gdk101.h +52 -0
- esphome/components/gdk101/sensor.py +83 -0
- esphome/components/globals/__init__.py +89 -0
- esphome/components/globals/globals_component.h +145 -0
- esphome/components/gp2y1010au0f/__init__.py +0 -0
- esphome/components/gp2y1010au0f/gp2y1010au0f.cpp +67 -0
- esphome/components/gp2y1010au0f/gp2y1010au0f.h +52 -0
- esphome/components/gp2y1010au0f/sensor.py +61 -0
- esphome/components/gp8403/__init__.py +40 -0
- esphome/components/gp8403/gp8403.cpp +21 -0
- esphome/components/gp8403/gp8403.h +27 -0
- esphome/components/gp8403/output/__init__.py +31 -0
- esphome/components/gp8403/output/gp8403_output.cpp +26 -0
- esphome/components/gp8403/output/gp8403_output.h +25 -0
- esphome/components/gpio/__init__.py +4 -0
- esphome/components/gpio/binary_sensor/__init__.py +28 -0
- esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp +24 -0
- esphome/components/gpio/binary_sensor/gpio_binary_sensor.h +28 -0
- esphome/components/gpio/one_wire/__init__.py +25 -0
- esphome/components/gpio/one_wire/gpio_one_wire.cpp +205 -0
- esphome/components/gpio/one_wire/gpio_one_wire.h +41 -0
- esphome/components/gpio/output/__init__.py +24 -0
- esphome/components/gpio/output/gpio_binary_output.cpp +16 -0
- esphome/components/gpio/output/gpio_binary_output.h +29 -0
- esphome/components/gpio/switch/__init__.py +39 -0
- esphome/components/gpio/switch/gpio_switch.cpp +75 -0
- esphome/components/gpio/switch/gpio_switch.h +34 -0
- esphome/components/gpio_expander/__init__.py +0 -0
- esphome/components/gpio_expander/cached_gpio.h +38 -0
- esphome/components/gps/__init__.py +97 -0
- esphome/components/gps/gps.cpp +75 -0
- esphome/components/gps/gps.h +71 -0
- esphome/components/gps/time/__init__.py +27 -0
- esphome/components/gps/time/gps_time.cpp +38 -0
- esphome/components/gps/time/gps_time.h +28 -0
- esphome/components/graph/__init__.py +220 -0
- esphome/components/graph/graph.cpp +398 -0
- esphome/components/graph/graph.h +183 -0
- esphome/components/graphical_display_menu/__init__.py +100 -0
- esphome/components/graphical_display_menu/graphical_display_menu.cpp +245 -0
- esphome/components/graphical_display_menu/graphical_display_menu.h +84 -0
- esphome/components/gree/__init__.py +0 -0
- esphome/components/gree/climate.py +35 -0
- esphome/components/gree/gree.cpp +216 -0
- esphome/components/gree/gree.h +109 -0
- esphome/components/grove_gas_mc_v2/__init__.py +0 -0
- esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.cpp +88 -0
- esphome/components/grove_gas_mc_v2/grove_gas_mc_v2.h +39 -0
- esphome/components/grove_gas_mc_v2/sensor.py +77 -0
- esphome/components/grove_tb6612fng/__init__.py +177 -0
- esphome/components/grove_tb6612fng/grove_tb6612fng.cpp +171 -0
- esphome/components/grove_tb6612fng/grove_tb6612fng.h +215 -0
- esphome/components/growatt_solar/__init__.py +0 -0
- esphome/components/growatt_solar/growatt_solar.cpp +141 -0
- esphome/components/growatt_solar/growatt_solar.h +87 -0
- esphome/components/growatt_solar/sensor.py +212 -0
- esphome/components/gt911/__init__.py +6 -0
- esphome/components/gt911/binary_sensor/__init__.py +31 -0
- esphome/components/gt911/binary_sensor/gt911_button.cpp +27 -0
- esphome/components/gt911/binary_sensor/gt911_button.h +28 -0
- esphome/components/gt911/touchscreen/__init__.py +33 -0
- esphome/components/gt911/touchscreen/gt911_touchscreen.cpp +133 -0
- esphome/components/gt911/touchscreen/gt911_touchscreen.h +35 -0
- esphome/components/haier/__init__.py +0 -0
- esphome/components/haier/automation.h +130 -0
- esphome/components/haier/binary_sensor/__init__.py +71 -0
- esphome/components/haier/button/__init__.py +41 -0
- esphome/components/haier/button/self_cleaning.cpp +9 -0
- esphome/components/haier/button/self_cleaning.h +18 -0
- esphome/components/haier/button/steri_cleaning.cpp +9 -0
- esphome/components/haier/button/steri_cleaning.h +18 -0
- esphome/components/haier/climate.py +522 -0
- esphome/components/haier/haier_base.cpp +427 -0
- esphome/components/haier/haier_base.h +187 -0
- esphome/components/haier/hon_climate.cpp +1376 -0
- esphome/components/haier/hon_climate.h +214 -0
- esphome/components/haier/hon_packet.h +260 -0
- esphome/components/haier/logger_handler.cpp +33 -0
- esphome/components/haier/logger_handler.h +14 -0
- esphome/components/haier/sensor/__init__.py +152 -0
- esphome/components/haier/smartair2_climate.cpp +553 -0
- esphome/components/haier/smartair2_climate.h +40 -0
- esphome/components/haier/smartair2_packet.h +88 -0
- esphome/components/haier/switch/__init__.py +91 -0
- esphome/components/haier/switch/beeper.cpp +14 -0
- esphome/components/haier/switch/beeper.h +18 -0
- esphome/components/haier/switch/display.cpp +14 -0
- esphome/components/haier/switch/display.h +18 -0
- esphome/components/haier/switch/health_mode.cpp +14 -0
- esphome/components/haier/switch/health_mode.h +18 -0
- esphome/components/haier/switch/quiet_mode.cpp +14 -0
- esphome/components/haier/switch/quiet_mode.h +18 -0
- esphome/components/haier/text_sensor/__init__.py +54 -0
- esphome/components/havells_solar/__init__.py +0 -0
- esphome/components/havells_solar/havells_solar.cpp +165 -0
- esphome/components/havells_solar/havells_solar.h +117 -0
- esphome/components/havells_solar/havells_solar_registers.h +49 -0
- esphome/components/havells_solar/sensor.py +291 -0
- esphome/components/hbridge/__init__.py +3 -0
- esphome/components/hbridge/fan/__init__.py +76 -0
- esphome/components/hbridge/fan/hbridge_fan.cpp +94 -0
- esphome/components/hbridge/fan/hbridge_fan.h +60 -0
- esphome/components/hbridge/light/__init__.py +30 -0
- esphome/components/hbridge/light/hbridge_light_output.h +58 -0
- esphome/components/hbridge/switch/__init__.py +44 -0
- esphome/components/hbridge/switch/hbridge_switch.cpp +95 -0
- esphome/components/hbridge/switch/hbridge_switch.h +50 -0
- esphome/components/hdc1080/__init__.py +0 -0
- esphome/components/hdc1080/hdc1080.cpp +75 -0
- esphome/components/hdc1080/hdc1080.h +29 -0
- esphome/components/hdc1080/sensor.py +56 -0
- esphome/components/he60r/__init__.py +1 -0
- esphome/components/he60r/cover.py +47 -0
- esphome/components/he60r/he60r.cpp +263 -0
- esphome/components/he60r/he60r.h +46 -0
- esphome/components/heatpumpir/__init__.py +0 -0
- esphome/components/heatpumpir/climate.py +132 -0
- esphome/components/heatpumpir/heatpumpir.cpp +210 -0
- esphome/components/heatpumpir/heatpumpir.h +131 -0
- esphome/components/heatpumpir/ir_sender_esphome.cpp +32 -0
- esphome/components/heatpumpir/ir_sender_esphome.h +25 -0
- esphome/components/hitachi_ac344/__init__.py +0 -0
- esphome/components/hitachi_ac344/climate.py +20 -0
- esphome/components/hitachi_ac344/hitachi_ac344.cpp +370 -0
- esphome/components/hitachi_ac344/hitachi_ac344.h +121 -0
- esphome/components/hitachi_ac424/__init__.py +1 -0
- esphome/components/hitachi_ac424/climate.py +20 -0
- esphome/components/hitachi_ac424/hitachi_ac424.cpp +371 -0
- esphome/components/hitachi_ac424/hitachi_ac424.h +123 -0
- esphome/components/hlw8012/__init__.py +0 -0
- esphome/components/hlw8012/hlw8012.cpp +108 -0
- esphome/components/hlw8012/hlw8012.h +77 -0
- esphome/components/hlw8012/sensor.py +124 -0
- esphome/components/hm3301/__init__.py +0 -0
- esphome/components/hm3301/abstract_aqi_calculator.h +14 -0
- esphome/components/hm3301/aqi_calculator.h +51 -0
- esphome/components/hm3301/aqi_calculator_factory.h +29 -0
- esphome/components/hm3301/caqi_calculator.h +52 -0
- esphome/components/hm3301/hm3301.cpp +101 -0
- esphome/components/hm3301/hm3301.h +52 -0
- esphome/components/hm3301/sensor.py +111 -0
- esphome/components/hmac_md5/__init__.py +2 -0
- esphome/components/hmac_md5/hmac_md5.cpp +58 -0
- esphome/components/hmac_md5/hmac_md5.h +49 -0
- esphome/components/hmc5883l/__init__.py +0 -0
- esphome/components/hmc5883l/hmc5883l.cpp +146 -0
- esphome/components/hmc5883l/hmc5883l.h +70 -0
- esphome/components/hmc5883l/sensor.py +142 -0
- esphome/components/homeassistant/__init__.py +40 -0
- esphome/components/homeassistant/binary_sensor/__init__.py +24 -0
- esphome/components/homeassistant/binary_sensor/homeassistant_binary_sensor.cpp +48 -0
- esphome/components/homeassistant/binary_sensor/homeassistant_binary_sensor.h +24 -0
- esphome/components/homeassistant/number/__init__.py +33 -0
- esphome/components/homeassistant/number/homeassistant_number.cpp +103 -0
- esphome/components/homeassistant/number/homeassistant_number.h +31 -0
- esphome/components/homeassistant/sensor/__init__.py +24 -0
- esphome/components/homeassistant/sensor/homeassistant_sensor.cpp +39 -0
- esphome/components/homeassistant/sensor/homeassistant_sensor.h +23 -0
- esphome/components/homeassistant/switch/__init__.py +43 -0
- esphome/components/homeassistant/switch/homeassistant_switch.cpp +59 -0
- esphome/components/homeassistant/switch/homeassistant_switch.h +22 -0
- esphome/components/homeassistant/text_sensor/__init__.py +24 -0
- esphome/components/homeassistant/text_sensor/homeassistant_text_sensor.cpp +31 -0
- esphome/components/homeassistant/text_sensor/homeassistant_text_sensor.h +23 -0
- esphome/components/homeassistant/time/__init__.py +22 -0
- esphome/components/homeassistant/time/homeassistant_time.cpp +22 -0
- esphome/components/homeassistant/time/homeassistant_time.h +22 -0
- esphome/components/honeywell_hih_i2c/__init__.py +3 -0
- esphome/components/honeywell_hih_i2c/honeywell_hih.cpp +97 -0
- esphome/components/honeywell_hih_i2c/honeywell_hih.h +34 -0
- esphome/components/honeywell_hih_i2c/sensor.py +56 -0
- esphome/components/honeywellabp/__init__.py +1 -0
- esphome/components/honeywellabp/honeywellabp.cpp +102 -0
- esphome/components/honeywellabp/honeywellabp.h +45 -0
- esphome/components/honeywellabp/sensor.py +69 -0
- esphome/components/honeywellabp2_i2c/__init__.py +3 -0
- esphome/components/honeywellabp2_i2c/honeywellabp2.cpp +109 -0
- esphome/components/honeywellabp2_i2c/honeywellabp2.h +60 -0
- esphome/components/honeywellabp2_i2c/sensor.py +75 -0
- esphome/components/host/__init__.py +45 -0
- esphome/components/host/const.py +5 -0
- esphome/components/host/core.cpp +77 -0
- esphome/components/host/gpio.cpp +59 -0
- esphome/components/host/gpio.h +37 -0
- esphome/components/host/gpio.py +62 -0
- esphome/components/host/preferences.cpp +87 -0
- esphome/components/host/preferences.h +66 -0
- esphome/components/host/time/__init__.py +20 -0
- esphome/components/host/time/host_time.h +15 -0
- esphome/components/hrxl_maxsonar_wr/__init__.py +0 -0
- esphome/components/hrxl_maxsonar_wr/hrxl_maxsonar_wr.cpp +77 -0
- esphome/components/hrxl_maxsonar_wr/hrxl_maxsonar_wr.h +25 -0
- esphome/components/hrxl_maxsonar_wr/sensor.py +29 -0
- esphome/components/hte501/__init__.py +0 -0
- esphome/components/hte501/hte501.cpp +90 -0
- esphome/components/hte501/hte501.h +30 -0
- esphome/components/hte501/sensor.py +58 -0
- esphome/components/http_request/__init__.py +288 -0
- esphome/components/http_request/http_request.cpp +24 -0
- esphome/components/http_request/http_request.h +251 -0
- esphome/components/http_request/http_request_arduino.cpp +167 -0
- esphome/components/http_request/http_request_arduino.h +40 -0
- esphome/components/http_request/http_request_idf.cpp +217 -0
- esphome/components/http_request/http_request_idf.h +47 -0
- esphome/components/http_request/ota/__init__.py +100 -0
- esphome/components/http_request/ota/automation.h +42 -0
- esphome/components/http_request/ota/ota_http_request.cpp +269 -0
- esphome/components/http_request/ota/ota_http_request.h +61 -0
- esphome/components/http_request/update/__init__.py +44 -0
- esphome/components/http_request/update/http_request_update.cpp +181 -0
- esphome/components/http_request/update/http_request_update.h +44 -0
- esphome/components/htu21d/__init__.py +0 -0
- esphome/components/htu21d/htu21d.cpp +156 -0
- esphome/components/htu21d/htu21d.h +63 -0
- esphome/components/htu21d/sensor.py +121 -0
- esphome/components/htu31d/__init__.py +1 -0
- esphome/components/htu31d/htu31d.cpp +271 -0
- esphome/components/htu31d/htu31d.h +33 -0
- esphome/components/htu31d/sensor.py +56 -0
- esphome/components/hx711/__init__.py +0 -0
- esphome/components/hx711/hx711.cpp +83 -0
- esphome/components/hx711/hx711.h +38 -0
- esphome/components/hx711/sensor.py +50 -0
- esphome/components/hydreon_rgxx/__init__.py +12 -0
- esphome/components/hydreon_rgxx/binary_sensor.py +53 -0
- esphome/components/hydreon_rgxx/hydreon_rgxx.cpp +295 -0
- esphome/components/hydreon_rgxx/hydreon_rgxx.h +98 -0
- esphome/components/hydreon_rgxx/sensor.py +157 -0
- esphome/components/hyt271/__init__.py +1 -0
- esphome/components/hyt271/hyt271.cpp +52 -0
- esphome/components/hyt271/hyt271.h +27 -0
- esphome/components/hyt271/sensor.py +56 -0
- esphome/components/i2c/__init__.py +179 -0
- esphome/components/i2c/i2c.cpp +103 -0
- esphome/components/i2c/i2c.h +274 -0
- esphome/components/i2c/i2c_bus.h +112 -0
- esphome/components/i2c/i2c_bus_arduino.cpp +326 -0
- esphome/components/i2c/i2c_bus_arduino.h +49 -0
- esphome/components/i2c/i2c_bus_esp_idf.cpp +364 -0
- esphome/components/i2c/i2c_bus_esp_idf.h +52 -0
- esphome/components/i2c_device/__init__.py +26 -0
- esphome/components/i2c_device/i2c_device.cpp +17 -0
- esphome/components/i2c_device/i2c_device.h +18 -0
- esphome/components/i2s_audio/__init__.py +162 -0
- esphome/components/i2s_audio/i2s_audio.cpp +34 -0
- esphome/components/i2s_audio/i2s_audio.h +75 -0
- esphome/components/i2s_audio/media_player/__init__.py +112 -0
- esphome/components/i2s_audio/media_player/i2s_audio_media_player.cpp +258 -0
- esphome/components/i2s_audio/media_player/i2s_audio_media_player.h +87 -0
- esphome/components/i2s_audio/microphone/__init__.py +90 -0
- esphome/components/i2s_audio/microphone/i2s_audio_microphone.cpp +220 -0
- esphome/components/i2s_audio/microphone/i2s_audio_microphone.h +51 -0
- esphome/components/i2s_audio/speaker/__init__.py +126 -0
- esphome/components/i2s_audio/speaker/i2s_audio_speaker.cpp +524 -0
- esphome/components/i2s_audio/speaker/i2s_audio_speaker.h +136 -0
- esphome/components/iaqcore/__init__.py +0 -0
- esphome/components/iaqcore/iaqcore.cpp +99 -0
- esphome/components/iaqcore/iaqcore.h +29 -0
- esphome/components/iaqcore/sensor.py +57 -0
- esphome/components/ili9341/__init__.py +0 -0
- esphome/components/ili9341/display.py +5 -0
- esphome/components/ili9xxx/__init__.py +0 -0
- esphome/components/ili9xxx/display.py +293 -0
- esphome/components/ili9xxx/ili9xxx_defines.h +100 -0
- esphome/components/ili9xxx/ili9xxx_display.cpp +463 -0
- esphome/components/ili9xxx/ili9xxx_display.h +281 -0
- esphome/components/ili9xxx/ili9xxx_init.h +423 -0
- esphome/components/image/__init__.py +407 -0
- esphome/components/image/image.cpp +178 -0
- esphome/components/image/image.h +74 -0
- esphome/components/improv_base/__init__.py +41 -0
- esphome/components/improv_base/improv_base.cpp +37 -0
- esphome/components/improv_base/improv_base.h +18 -0
- esphome/components/improv_serial/__init__.py +47 -0
- esphome/components/improv_serial/improv_serial_component.cpp +316 -0
- esphome/components/improv_serial/improv_serial_component.h +81 -0
- esphome/components/ina219/__init__.py +0 -0
- esphome/components/ina219/ina219.cpp +196 -0
- esphome/components/ina219/ina219.h +39 -0
- esphome/components/ina219/sensor.py +96 -0
- esphome/components/ina226/__init__.py +1 -0
- esphome/components/ina226/ina226.cpp +166 -0
- esphome/components/ina226/ina226.h +78 -0
- esphome/components/ina226/sensor.py +147 -0
- esphome/components/ina260/__init__.py +0 -0
- esphome/components/ina260/ina260.cpp +128 -0
- esphome/components/ina260/ina260.h +39 -0
- esphome/components/ina260/sensor.py +71 -0
- esphome/components/ina2xx_base/__init__.py +255 -0
- esphome/components/ina2xx_base/ina2xx_base.cpp +604 -0
- esphome/components/ina2xx_base/ina2xx_base.h +253 -0
- esphome/components/ina2xx_i2c/__init__.py +0 -0
- esphome/components/ina2xx_i2c/ina2xx_i2c.cpp +39 -0
- esphome/components/ina2xx_i2c/ina2xx_i2c.h +21 -0
- esphome/components/ina2xx_i2c/sensor.py +34 -0
- esphome/components/ina2xx_spi/__init__.py +0 -0
- esphome/components/ina2xx_spi/ina2xx_spi.cpp +38 -0
- esphome/components/ina2xx_spi/ina2xx_spi.h +22 -0
- esphome/components/ina2xx_spi/sensor.py +33 -0
- esphome/components/ina3221/__init__.py +0 -0
- esphome/components/ina3221/ina3221.cpp +134 -0
- esphome/components/ina3221/ina3221.h +40 -0
- esphome/components/ina3221/sensor.py +99 -0
- esphome/components/inkbird_ibsth1_mini/__init__.py +0 -0
- esphome/components/inkbird_ibsth1_mini/inkbird_ibsth1_mini.cpp +110 -0
- esphome/components/inkbird_ibsth1_mini/inkbird_ibsth1_mini.h +36 -0
- esphome/components/inkbird_ibsth1_mini/sensor.py +83 -0
- esphome/components/inkplate6/__init__.py +1 -0
- esphome/components/inkplate6/display.py +189 -0
- esphome/components/inkplate6/inkplate.cpp +719 -0
- esphome/components/inkplate6/inkplate.h +253 -0
- esphome/components/integration/__init__.py +1 -0
- esphome/components/integration/integration_sensor.cpp +51 -0
- esphome/components/integration/integration_sensor.h +86 -0
- esphome/components/integration/sensor.py +115 -0
- esphome/components/internal_temperature/__init__.py +1 -0
- esphome/components/internal_temperature/internal_temperature.cpp +128 -0
- esphome/components/internal_temperature/internal_temperature.h +18 -0
- esphome/components/internal_temperature/sensor.py +62 -0
- esphome/components/interval/__init__.py +32 -0
- esphome/components/interval/interval.h +34 -0
- esphome/components/jsn_sr04t/__init__.py +1 -0
- esphome/components/jsn_sr04t/jsn_sr04t.cpp +73 -0
- esphome/components/jsn_sr04t/jsn_sr04t.h +34 -0
- esphome/components/jsn_sr04t/sensor.py +57 -0
- esphome/components/json/__init__.py +17 -0
- esphome/components/json/json_util.cpp +111 -0
- esphome/components/json/json_util.h +29 -0
- esphome/components/kalman_combinator/__init__.py +0 -0
- esphome/components/kalman_combinator/sensor.py +6 -0
- esphome/components/kamstrup_kmp/__init__.py +0 -0
- esphome/components/kamstrup_kmp/kamstrup_kmp.cpp +301 -0
- esphome/components/kamstrup_kmp/kamstrup_kmp.h +131 -0
- esphome/components/kamstrup_kmp/sensor.py +132 -0
- esphome/components/key_collector/__init__.py +96 -0
- esphome/components/key_collector/key_collector.cpp +97 -0
- esphome/components/key_collector/key_collector.h +53 -0
- esphome/components/key_provider/__init__.py +6 -0
- esphome/components/key_provider/key_provider.cpp +13 -0
- esphome/components/key_provider/key_provider.h +21 -0
- esphome/components/kmeteriso/__init__.py +0 -0
- esphome/components/kmeteriso/kmeteriso.cpp +82 -0
- esphome/components/kmeteriso/kmeteriso.h +34 -0
- esphome/components/kmeteriso/sensor.py +55 -0
- esphome/components/kuntze/__init__.py +0 -0
- esphome/components/kuntze/kuntze.cpp +91 -0
- esphome/components/kuntze/kuntze.h +42 -0
- esphome/components/kuntze/sensor.py +123 -0
- esphome/components/lcd_base/__init__.py +59 -0
- esphome/components/lcd_base/lcd_display.cpp +177 -0
- esphome/components/lcd_base/lcd_display.h +66 -0
- esphome/components/lcd_gpio/__init__.py +0 -0
- esphome/components/lcd_gpio/display.py +64 -0
- esphome/components/lcd_gpio/gpio_lcd_display.cpp +66 -0
- esphome/components/lcd_gpio/gpio_lcd_display.h +50 -0
- esphome/components/lcd_menu/__init__.py +73 -0
- esphome/components/lcd_menu/lcd_menu.cpp +74 -0
- esphome/components/lcd_menu/lcd_menu.h +45 -0
- esphome/components/lcd_pcf8574/__init__.py +0 -0
- esphome/components/lcd_pcf8574/display.py +32 -0
- esphome/components/lcd_pcf8574/pcf8574_display.cpp +59 -0
- esphome/components/lcd_pcf8574/pcf8574_display.h +31 -0
- esphome/components/ld2410/__init__.py +109 -0
- esphome/components/ld2410/automation.h +22 -0
- esphome/components/ld2410/binary_sensor.py +55 -0
- esphome/components/ld2410/button/__init__.py +57 -0
- esphome/components/ld2410/button/query_button.cpp +9 -0
- esphome/components/ld2410/button/query_button.h +18 -0
- esphome/components/ld2410/button/reset_button.cpp +9 -0
- esphome/components/ld2410/button/reset_button.h +18 -0
- esphome/components/ld2410/button/restart_button.cpp +9 -0
- esphome/components/ld2410/button/restart_button.h +18 -0
- esphome/components/ld2410/ld2410.cpp +680 -0
- esphome/components/ld2410/ld2410.h +237 -0
- esphome/components/ld2410/number/__init__.py +128 -0
- esphome/components/ld2410/number/gate_threshold_number.cpp +14 -0
- esphome/components/ld2410/number/gate_threshold_number.h +19 -0
- esphome/components/ld2410/number/light_threshold_number.cpp +12 -0
- esphome/components/ld2410/number/light_threshold_number.h +18 -0
- esphome/components/ld2410/number/max_distance_timeout_number.cpp +12 -0
- esphome/components/ld2410/number/max_distance_timeout_number.h +18 -0
- esphome/components/ld2410/select/__init__.py +81 -0
- esphome/components/ld2410/select/baud_rate_select.cpp +12 -0
- esphome/components/ld2410/select/baud_rate_select.h +18 -0
- esphome/components/ld2410/select/distance_resolution_select.cpp +12 -0
- esphome/components/ld2410/select/distance_resolution_select.h +18 -0
- esphome/components/ld2410/select/light_out_control_select.cpp +12 -0
- esphome/components/ld2410/select/light_out_control_select.h +18 -0
- esphome/components/ld2410/sensor.py +108 -0
- esphome/components/ld2410/switch/__init__.py +44 -0
- esphome/components/ld2410/switch/bluetooth_switch.cpp +12 -0
- esphome/components/ld2410/switch/bluetooth_switch.h +18 -0
- esphome/components/ld2410/switch/engineering_mode_switch.cpp +12 -0
- esphome/components/ld2410/switch/engineering_mode_switch.h +18 -0
- esphome/components/ld2410/text_sensor.py +33 -0
- esphome/components/ld2420/__init__.py +39 -0
- esphome/components/ld2420/binary_sensor/__init__.py +32 -0
- esphome/components/ld2420/binary_sensor/ld2420_binary_sensor.cpp +16 -0
- esphome/components/ld2420/binary_sensor/ld2420_binary_sensor.h +25 -0
- esphome/components/ld2420/button/__init__.py +69 -0
- esphome/components/ld2420/button/reconfig_buttons.cpp +16 -0
- esphome/components/ld2420/button/reconfig_buttons.h +42 -0
- esphome/components/ld2420/ld2420.cpp +778 -0
- esphome/components/ld2420/ld2420.h +271 -0
- esphome/components/ld2420/number/__init__.py +183 -0
- esphome/components/ld2420/number/gate_config_number.cpp +73 -0
- esphome/components/ld2420/number/gate_config_number.h +78 -0
- esphome/components/ld2420/select/__init__.py +33 -0
- esphome/components/ld2420/select/operating_mode_select.cpp +16 -0
- esphome/components/ld2420/select/operating_mode_select.h +18 -0
- esphome/components/ld2420/sensor/__init__.py +35 -0
- esphome/components/ld2420/sensor/ld2420_sensor.cpp +16 -0
- esphome/components/ld2420/sensor/ld2420_sensor.h +34 -0
- esphome/components/ld2420/text_sensor/__init__.py +38 -0
- esphome/components/ld2420/text_sensor/text_sensor.cpp +16 -0
- esphome/components/ld2420/text_sensor/text_sensor.h +24 -0
- esphome/components/ledc/__init__.py +1 -0
- esphome/components/ledc/ledc_output.cpp +268 -0
- esphome/components/ledc/ledc_output.h +62 -0
- esphome/components/ledc/output.py +84 -0
- esphome/components/libretiny/__init__.py +340 -0
- esphome/components/libretiny/const.py +90 -0
- esphome/components/libretiny/core.cpp +40 -0
- esphome/components/libretiny/core.h +11 -0
- esphome/components/libretiny/generate_components.py +329 -0
- esphome/components/libretiny/gpio.py +204 -0
- esphome/components/libretiny/gpio_arduino.cpp +105 -0
- esphome/components/libretiny/gpio_arduino.h +36 -0
- esphome/components/libretiny/lt_component.cpp +29 -0
- esphome/components/libretiny/lt_component.h +36 -0
- esphome/components/libretiny/preferences.cpp +182 -0
- esphome/components/libretiny/preferences.h +13 -0
- esphome/components/libretiny/text_sensor.py +31 -0
- esphome/components/libretiny_pwm/__init__.py +1 -0
- esphome/components/libretiny_pwm/libretiny_pwm.cpp +53 -0
- esphome/components/libretiny_pwm/libretiny_pwm.h +55 -0
- esphome/components/libretiny_pwm/output.py +49 -0
- esphome/components/light/__init__.py +229 -0
- esphome/components/light/addressable_light.cpp +113 -0
- esphome/components/light/addressable_light.h +123 -0
- esphome/components/light/addressable_light_effect.h +369 -0
- esphome/components/light/addressable_light_wrapper.h +127 -0
- esphome/components/light/automation.cpp +15 -0
- esphome/components/light/automation.h +220 -0
- esphome/components/light/automation.py +281 -0
- esphome/components/light/base_light_effects.h +231 -0
- esphome/components/light/color_mode.h +108 -0
- esphome/components/light/effects.py +552 -0
- esphome/components/light/esp_color_correction.cpp +27 -0
- esphome/components/light/esp_color_correction.h +77 -0
- esphome/components/light/esp_color_view.h +110 -0
- esphome/components/light/esp_hsv_color.cpp +74 -0
- esphome/components/light/esp_hsv_color.h +36 -0
- esphome/components/light/esp_range_view.cpp +96 -0
- esphome/components/light/esp_range_view.h +80 -0
- esphome/components/light/light_call.cpp +690 -0
- esphome/components/light/light_call.h +197 -0
- esphome/components/light/light_color_values.h +309 -0
- esphome/components/light/light_effect.h +43 -0
- esphome/components/light/light_json_schema.cpp +165 -0
- esphome/components/light/light_json_schema.h +28 -0
- esphome/components/light/light_output.cpp +12 -0
- esphome/components/light/light_output.h +33 -0
- esphome/components/light/light_state.cpp +296 -0
- esphome/components/light/light_state.h +257 -0
- esphome/components/light/light_traits.h +61 -0
- esphome/components/light/light_transformer.h +59 -0
- esphome/components/light/transformers.h +126 -0
- esphome/components/light/types.py +87 -0
- esphome/components/lightwaverf/LwRx.cpp +427 -0
- esphome/components/lightwaverf/LwRx.h +142 -0
- esphome/components/lightwaverf/LwTx.cpp +208 -0
- esphome/components/lightwaverf/LwTx.h +94 -0
- esphome/components/lightwaverf/__init__.py +83 -0
- esphome/components/lightwaverf/lightwaverf.cpp +67 -0
- esphome/components/lightwaverf/lightwaverf.h +70 -0
- esphome/components/lilygo_t5_47/__init__.py +3 -0
- esphome/components/lilygo_t5_47/touchscreen/__init__.py +39 -0
- esphome/components/lilygo_t5_47/touchscreen/lilygo_t5_47_touchscreen.cpp +105 -0
- esphome/components/lilygo_t5_47/touchscreen/lilygo_t5_47_touchscreen.h +31 -0
- esphome/components/lock/__init__.py +110 -0
- esphome/components/lock/automation.h +87 -0
- esphome/components/lock/lock.cpp +107 -0
- esphome/components/lock/lock.h +175 -0
- esphome/components/logger/__init__.py +367 -0
- esphome/components/logger/logger.cpp +201 -0
- esphome/components/logger/logger.h +192 -0
- esphome/components/logger/logger_esp32.cpp +214 -0
- esphome/components/logger/logger_esp8266.cpp +45 -0
- esphome/components/logger/logger_host.cpp +24 -0
- esphome/components/logger/logger_libretiny.cpp +62 -0
- esphome/components/logger/logger_rp2040.cpp +39 -0
- esphome/components/ltr390/__init__.py +0 -0
- esphome/components/ltr390/ltr390.cpp +204 -0
- esphome/components/ltr390/ltr390.h +91 -0
- esphome/components/ltr390/sensor.py +141 -0
- esphome/components/ltr501/__init__.py +1 -0
- esphome/components/ltr501/ltr501.cpp +542 -0
- esphome/components/ltr501/ltr501.h +184 -0
- esphome/components/ltr501/ltr_definitions_501.h +260 -0
- esphome/components/ltr501/sensor.py +274 -0
- esphome/components/ltr_als_ps/__init__.py +1 -0
- esphome/components/ltr_als_ps/ltr_als_ps.cpp +519 -0
- esphome/components/ltr_als_ps/ltr_als_ps.h +184 -0
- esphome/components/ltr_als_ps/ltr_definitions.h +275 -0
- esphome/components/ltr_als_ps/sensor.py +271 -0
- esphome/components/lvgl/__init__.py +470 -0
- esphome/components/lvgl/automation.py +319 -0
- esphome/components/lvgl/binary_sensor/__init__.py +37 -0
- esphome/components/lvgl/defines.py +549 -0
- esphome/components/lvgl/encoders.py +80 -0
- esphome/components/lvgl/font.cpp +76 -0
- esphome/components/lvgl/gradient.py +61 -0
- esphome/components/lvgl/hello_world.py +64 -0
- esphome/components/lvgl/helpers.py +49 -0
- esphome/components/lvgl/keypads.py +77 -0
- esphome/components/lvgl/light/__init__.py +31 -0
- esphome/components/lvgl/light/lvgl_light.h +48 -0
- esphome/components/lvgl/lv_validation.py +485 -0
- esphome/components/lvgl/lvcode.py +351 -0
- esphome/components/lvgl/lvgl_esphome.cpp +546 -0
- esphome/components/lvgl/lvgl_esphome.h +379 -0
- esphome/components/lvgl/lvgl_hal.h +21 -0
- esphome/components/lvgl/lvgl_proxy.h +17 -0
- esphome/components/lvgl/number/__init__.py +63 -0
- esphome/components/lvgl/number/lvgl_number.h +36 -0
- esphome/components/lvgl/schemas.py +444 -0
- esphome/components/lvgl/select/__init__.py +32 -0
- esphome/components/lvgl/select/lvgl_select.h +58 -0
- esphome/components/lvgl/sensor/__init__.py +42 -0
- esphome/components/lvgl/styles.py +58 -0
- esphome/components/lvgl/switch/__init__.py +53 -0
- esphome/components/lvgl/switch/lvgl_switch.h +36 -0
- esphome/components/lvgl/text/__init__.py +51 -0
- esphome/components/lvgl/text/lvgl_text.h +36 -0
- esphome/components/lvgl/text_sensor/__init__.py +43 -0
- esphome/components/lvgl/touchscreens.py +44 -0
- esphome/components/lvgl/trigger.py +73 -0
- esphome/components/lvgl/types.py +198 -0
- esphome/components/lvgl/widgets/__init__.py +460 -0
- esphome/components/lvgl/widgets/animimg.py +112 -0
- esphome/components/lvgl/widgets/arc.py +82 -0
- esphome/components/lvgl/widgets/button.py +20 -0
- esphome/components/lvgl/widgets/buttonmatrix.py +279 -0
- esphome/components/lvgl/widgets/checkbox.py +32 -0
- esphome/components/lvgl/widgets/dropdown.py +92 -0
- esphome/components/lvgl/widgets/img.py +85 -0
- esphome/components/lvgl/widgets/keyboard.py +49 -0
- esphome/components/lvgl/widgets/label.py +42 -0
- esphome/components/lvgl/widgets/led.py +29 -0
- esphome/components/lvgl/widgets/line.py +61 -0
- esphome/components/lvgl/widgets/lv_bar.py +55 -0
- esphome/components/lvgl/widgets/meter.py +314 -0
- esphome/components/lvgl/widgets/msgbox.py +148 -0
- esphome/components/lvgl/widgets/obj.py +30 -0
- esphome/components/lvgl/widgets/page.py +158 -0
- esphome/components/lvgl/widgets/qrcode.py +54 -0
- esphome/components/lvgl/widgets/roller.py +84 -0
- esphome/components/lvgl/widgets/slider.py +63 -0
- esphome/components/lvgl/widgets/spinbox.py +178 -0
- esphome/components/lvgl/widgets/spinner.py +43 -0
- esphome/components/lvgl/widgets/switch.py +20 -0
- esphome/components/lvgl/widgets/tabview.py +114 -0
- esphome/components/lvgl/widgets/textarea.py +66 -0
- esphome/components/lvgl/widgets/tileview.py +123 -0
- esphome/components/m5stack_8angle/__init__.py +33 -0
- esphome/components/m5stack_8angle/binary_sensor/__init__.py +30 -0
- esphome/components/m5stack_8angle/binary_sensor/m5stack_8angle_binary_sensor.cpp +17 -0
- esphome/components/m5stack_8angle/binary_sensor/m5stack_8angle_binary_sensor.h +19 -0
- esphome/components/m5stack_8angle/light/__init__.py +31 -0
- esphome/components/m5stack_8angle/light/m5stack_8angle_light.cpp +45 -0
- esphome/components/m5stack_8angle/light/m5stack_8angle_light.h +37 -0
- esphome/components/m5stack_8angle/m5stack_8angle.cpp +74 -0
- esphome/components/m5stack_8angle/m5stack_8angle.h +34 -0
- esphome/components/m5stack_8angle/sensor/__init__.py +66 -0
- esphome/components/m5stack_8angle/sensor/m5stack_8angle_sensor.cpp +24 -0
- esphome/components/m5stack_8angle/sensor/m5stack_8angle_sensor.h +27 -0
- esphome/components/matrix_keypad/__init__.py +87 -0
- esphome/components/matrix_keypad/binary_sensor/__init__.py +49 -0
- esphome/components/matrix_keypad/binary_sensor/matrix_keypad_binary_sensor.h +51 -0
- esphome/components/matrix_keypad/matrix_keypad.cpp +115 -0
- esphome/components/matrix_keypad/matrix_keypad.h +53 -0
- esphome/components/max17043/__init__.py +1 -0
- esphome/components/max17043/automation.h +20 -0
- esphome/components/max17043/max17043.cpp +98 -0
- esphome/components/max17043/max17043.h +29 -0
- esphome/components/max17043/sensor.py +77 -0
- esphome/components/max31855/__init__.py +0 -0
- esphome/components/max31855/max31855.cpp +108 -0
- esphome/components/max31855/max31855.h +31 -0
- esphome/components/max31855/sensor.py +44 -0
- esphome/components/max31856/__init__.py +0 -0
- esphome/components/max31856/max31856.cpp +209 -0
- esphome/components/max31856/max31856.h +103 -0
- esphome/components/max31856/sensor.py +66 -0
- esphome/components/max31865/__init__.py +0 -0
- esphome/components/max31865/max31865.cpp +232 -0
- esphome/components/max31865/max31865.h +58 -0
- esphome/components/max31865/sensor.py +62 -0
- esphome/components/max44009/__init__.py +0 -0
- esphome/components/max44009/max44009.cpp +144 -0
- esphome/components/max44009/max44009.h +37 -0
- esphome/components/max44009/sensor.py +53 -0
- esphome/components/max6675/__init__.py +0 -0
- esphome/components/max6675/max6675.cpp +52 -0
- esphome/components/max6675/max6675.h +26 -0
- esphome/components/max6675/sensor.py +31 -0
- esphome/components/max6956/__init__.py +142 -0
- esphome/components/max6956/automation.h +40 -0
- esphome/components/max6956/max6956.cpp +170 -0
- esphome/components/max6956/max6956.h +94 -0
- esphome/components/max6956/output/__init__.py +28 -0
- esphome/components/max6956/output/max6956_led_output.cpp +26 -0
- esphome/components/max6956/output/max6956_led_output.h +28 -0
- esphome/components/max7219/__init__.py +0 -0
- esphome/components/max7219/display.py +43 -0
- esphome/components/max7219/max7219.cpp +243 -0
- esphome/components/max7219/max7219.h +64 -0
- esphome/components/max7219digit/__init__.py +0 -0
- esphome/components/max7219digit/display.py +101 -0
- esphome/components/max7219digit/max7219digit.cpp +342 -0
- esphome/components/max7219digit/max7219digit.h +124 -0
- esphome/components/max7219digit/max7219font.h +270 -0
- esphome/components/max9611/__init__.py +1 -0
- esphome/components/max9611/max9611.cpp +93 -0
- esphome/components/max9611/max9611.h +62 -0
- esphome/components/max9611/sensor.py +92 -0
- esphome/components/mcp23008/__init__.py +28 -0
- esphome/components/mcp23008/mcp23008.cpp +43 -0
- esphome/components/mcp23008/mcp23008.h +24 -0
- esphome/components/mcp23016/__init__.py +72 -0
- esphome/components/mcp23016/mcp23016.cpp +95 -0
- esphome/components/mcp23016/mcp23016.h +72 -0
- esphome/components/mcp23017/__init__.py +28 -0
- esphome/components/mcp23017/mcp23017.cpp +44 -0
- esphome/components/mcp23017/mcp23017.h +24 -0
- esphome/components/mcp23s08/__init__.py +32 -0
- esphome/components/mcp23s08/mcp23s08.cpp +59 -0
- esphome/components/mcp23s08/mcp23s08.h +30 -0
- esphome/components/mcp23s17/__init__.py +32 -0
- esphome/components/mcp23s17/mcp23s17.cpp +69 -0
- esphome/components/mcp23s17/mcp23s17.h +29 -0
- esphome/components/mcp23x08_base/__init__.py +8 -0
- esphome/components/mcp23x08_base/mcp23x08_base.cpp +84 -0
- esphome/components/mcp23x08_base/mcp23x08_base.h +39 -0
- esphome/components/mcp23x17_base/__init__.py +8 -0
- esphome/components/mcp23x17_base/mcp23x17_base.cpp +89 -0
- esphome/components/mcp23x17_base/mcp23x17_base.h +52 -0
- esphome/components/mcp23xxx_base/__init__.py +86 -0
- esphome/components/mcp23xxx_base/mcp23xxx_base.cpp +20 -0
- esphome/components/mcp23xxx_base/mcp23xxx_base.h +55 -0
- esphome/components/mcp2515/__init__.py +0 -0
- esphome/components/mcp2515/canbus.py +50 -0
- esphome/components/mcp2515/mcp2515.cpp +681 -0
- esphome/components/mcp2515/mcp2515.h +112 -0
- esphome/components/mcp2515/mcp2515_defs.h +373 -0
- esphome/components/mcp3008/__init__.py +25 -0
- esphome/components/mcp3008/mcp3008.cpp +43 -0
- esphome/components/mcp3008/mcp3008.h +22 -0
- esphome/components/mcp3008/sensor/__init__.py +53 -0
- esphome/components/mcp3008/sensor/mcp3008_sensor.cpp +27 -0
- esphome/components/mcp3008/sensor/mcp3008_sensor.h +31 -0
- esphome/components/mcp3204/__init__.py +26 -0
- esphome/components/mcp3204/mcp3204.cpp +35 -0
- esphome/components/mcp3204/mcp3204.h +28 -0
- esphome/components/mcp3204/sensor/__init__.py +35 -0
- esphome/components/mcp3204/sensor/mcp3204_sensor.cpp +23 -0
- esphome/components/mcp3204/sensor/mcp3204_sensor.h +30 -0
- esphome/components/mcp4725/__init__.py +0 -0
- esphome/components/mcp4725/mcp4725.cpp +35 -0
- esphome/components/mcp4725/mcp4725.h +23 -0
- esphome/components/mcp4725/output.py +26 -0
- esphome/components/mcp4728/__init__.py +30 -0
- esphome/components/mcp4728/mcp4728.cpp +114 -0
- esphome/components/mcp4728/mcp4728.h +67 -0
- esphome/components/mcp4728/output/__init__.py +62 -0
- esphome/components/mcp4728/output/mcp4728_output.cpp +17 -0
- esphome/components/mcp4728/output/mcp4728_output.h +32 -0
- esphome/components/mcp47a1/__init__.py +0 -0
- esphome/components/mcp47a1/mcp47a1.cpp +21 -0
- esphome/components/mcp47a1/mcp47a1.h +17 -0
- esphome/components/mcp47a1/output.py +27 -0
- esphome/components/mcp9600/__init__.py +0 -0
- esphome/components/mcp9600/mcp9600.cpp +115 -0
- esphome/components/mcp9600/mcp9600.h +51 -0
- esphome/components/mcp9600/sensor.py +81 -0
- esphome/components/mcp9808/__init__.py +0 -0
- esphome/components/mcp9808/mcp9808.cpp +81 -0
- esphome/components/mcp9808/mcp9808.h +20 -0
- esphome/components/mcp9808/sensor.py +34 -0
- esphome/components/md5/__init__.py +7 -0
- esphome/components/md5/md5.cpp +69 -0
- esphome/components/md5/md5.h +70 -0
- esphome/components/mdns/__init__.py +113 -0
- esphome/components/mdns/mdns_component.cpp +129 -0
- esphome/components/mdns/mdns_component.h +50 -0
- esphome/components/mdns/mdns_esp32.cpp +60 -0
- esphome/components/mdns/mdns_esp8266.cpp +49 -0
- esphome/components/mdns/mdns_host.cpp +19 -0
- esphome/components/mdns/mdns_libretiny.cpp +44 -0
- esphome/components/mdns/mdns_rp2040.cpp +49 -0
- esphome/components/media_player/__init__.py +204 -0
- esphome/components/media_player/automation.h +82 -0
- esphome/components/media_player/media_player.cpp +132 -0
- esphome/components/media_player/media_player.h +113 -0
- esphome/components/mhz19/__init__.py +0 -0
- esphome/components/mhz19/mhz19.cpp +119 -0
- esphome/components/mhz19/mhz19.h +70 -0
- esphome/components/mhz19/sensor.py +96 -0
- esphome/components/micro_wake_word/__init__.py +498 -0
- esphome/components/micro_wake_word/micro_wake_word.cpp +458 -0
- esphome/components/micro_wake_word/micro_wake_word.h +176 -0
- esphome/components/micro_wake_word/preprocessor_settings.h +20 -0
- esphome/components/micro_wake_word/streaming_model.cpp +191 -0
- esphome/components/micro_wake_word/streaming_model.h +84 -0
- esphome/components/micronova/__init__.py +69 -0
- esphome/components/micronova/button/__init__.py +44 -0
- esphome/components/micronova/button/micronova_button.cpp +18 -0
- esphome/components/micronova/button/micronova_button.h +23 -0
- esphome/components/micronova/micronova.cpp +148 -0
- esphome/components/micronova/micronova.h +164 -0
- esphome/components/micronova/number/__init__.py +110 -0
- esphome/components/micronova/number/micronova_number.cpp +45 -0
- esphome/components/micronova/number/micronova_number.h +28 -0
- esphome/components/micronova/sensor/__init__.py +172 -0
- esphome/components/micronova/sensor/micronova_sensor.cpp +35 -0
- esphome/components/micronova/sensor/micronova_sensor.h +27 -0
- esphome/components/micronova/switch/__init__.py +56 -0
- esphome/components/micronova/switch/micronova_switch.cpp +33 -0
- esphome/components/micronova/switch/micronova_switch.h +29 -0
- esphome/components/micronova/text_sensor/__init__.py +43 -0
- esphome/components/micronova/text_sensor/micronova_text_sensor.cpp +31 -0
- esphome/components/micronova/text_sensor/micronova_text_sensor.h +20 -0
- esphome/components/microphone/__init__.py +91 -0
- esphome/components/microphone/automation.h +32 -0
- esphome/components/microphone/microphone.h +38 -0
- esphome/components/mics_4514/__init__.py +0 -0
- esphome/components/mics_4514/mics_4514.cpp +135 -0
- esphome/components/mics_4514/mics_4514.h +34 -0
- esphome/components/mics_4514/sensor.py +56 -0
- esphome/components/midea/__init__.py +0 -0
- esphome/components/midea/ac_adapter.cpp +179 -0
- esphome/components/midea/ac_adapter.h +51 -0
- esphome/components/midea/ac_automations.h +68 -0
- esphome/components/midea/air_conditioner.cpp +173 -0
- esphome/components/midea/air_conditioner.h +66 -0
- esphome/components/midea/appliance_base.h +102 -0
- esphome/components/midea/climate.py +296 -0
- esphome/components/midea/ir_transmitter.h +60 -0
- esphome/components/midea_ac/__init__.py +0 -0
- esphome/components/midea_ac/climate.py +3 -0
- esphome/components/midea_ir/__init__.py +0 -0
- esphome/components/midea_ir/climate.py +24 -0
- esphome/components/midea_ir/midea_data.h +92 -0
- esphome/components/midea_ir/midea_ir.cpp +202 -0
- esphome/components/midea_ir/midea_ir.h +47 -0
- esphome/components/mitsubishi/__init__.py +0 -0
- esphome/components/mitsubishi/climate.py +71 -0
- esphome/components/mitsubishi/mitsubishi.cpp +397 -0
- esphome/components/mitsubishi/mitsubishi.h +83 -0
- esphome/components/mlx90393/__init__.py +1 -0
- esphome/components/mlx90393/sensor.py +135 -0
- esphome/components/mlx90393/sensor_mlx90393.cpp +91 -0
- esphome/components/mlx90393/sensor_mlx90393.h +59 -0
- esphome/components/mlx90614/__init__.py +0 -0
- esphome/components/mlx90614/mlx90614.cpp +122 -0
- esphome/components/mlx90614/mlx90614.h +34 -0
- esphome/components/mlx90614/sensor.py +63 -0
- esphome/components/mmc5603/__init__.py +1 -0
- esphome/components/mmc5603/mmc5603.cpp +162 -0
- esphome/components/mmc5603/mmc5603.h +43 -0
- esphome/components/mmc5603/sensor.py +90 -0
- esphome/components/mmc5983/__init__.py +1 -0
- esphome/components/mmc5983/mmc5983.cpp +141 -0
- esphome/components/mmc5983/mmc5983.h +28 -0
- esphome/components/mmc5983/sensor.py +55 -0
- esphome/components/modbus/__init__.py +104 -0
- esphome/components/modbus/modbus.cpp +249 -0
- esphome/components/modbus/modbus.h +78 -0
- esphome/components/modbus_controller/__init__.py +338 -0
- esphome/components/modbus_controller/automation.h +35 -0
- esphome/components/modbus_controller/binary_sensor/__init__.py +60 -0
- esphome/components/modbus_controller/binary_sensor/modbus_binarysensor.cpp +38 -0
- esphome/components/modbus_controller/binary_sensor/modbus_binarysensor.h +44 -0
- esphome/components/modbus_controller/const.py +21 -0
- esphome/components/modbus_controller/modbus_controller.cpp +722 -0
- esphome/components/modbus_controller/modbus_controller.h +556 -0
- esphome/components/modbus_controller/number/__init__.py +125 -0
- esphome/components/modbus_controller/number/modbus_number.cpp +86 -0
- esphome/components/modbus_controller/number/modbus_number.h +50 -0
- esphome/components/modbus_controller/output/__init__.py +105 -0
- esphome/components/modbus_controller/output/modbus_output.cpp +111 -0
- esphome/components/modbus_controller/output/modbus_output.h +76 -0
- esphome/components/modbus_controller/select/__init__.py +143 -0
- esphome/components/modbus_controller/select/modbus_select.cpp +90 -0
- esphome/components/modbus_controller/select/modbus_select.h +54 -0
- esphome/components/modbus_controller/sensor/__init__.py +68 -0
- esphome/components/modbus_controller/sensor/modbus_sensor.cpp +31 -0
- esphome/components/modbus_controller/sensor/modbus_sensor.h +37 -0
- esphome/components/modbus_controller/switch/__init__.py +77 -0
- esphome/components/modbus_controller/switch/modbus_switch.cpp +104 -0
- esphome/components/modbus_controller/switch/modbus_switch.h +50 -0
- esphome/components/modbus_controller/text_sensor/__init__.py +84 -0
- esphome/components/modbus_controller/text_sensor/modbus_textsensor.cpp +58 -0
- esphome/components/modbus_controller/text_sensor/modbus_textsensor.h +44 -0
- esphome/components/monochromatic/__init__.py +0 -0
- esphome/components/monochromatic/light.py +24 -0
- esphome/components/monochromatic/monochromatic_light_output.h +29 -0
- esphome/components/mopeka_ble/__init__.py +30 -0
- esphome/components/mopeka_ble/mopeka_ble.cpp +91 -0
- esphome/components/mopeka_ble/mopeka_ble.h +27 -0
- esphome/components/mopeka_pro_check/__init__.py +1 -0
- esphome/components/mopeka_pro_check/mopeka_pro_check.cpp +159 -0
- esphome/components/mopeka_pro_check/mopeka_pro_check.h +72 -0
- esphome/components/mopeka_pro_check/sensor.py +174 -0
- esphome/components/mopeka_std_check/__init__.py +1 -0
- esphome/components/mopeka_std_check/mopeka_std_check.cpp +227 -0
- esphome/components/mopeka_std_check/mopeka_std_check.h +80 -0
- esphome/components/mopeka_std_check/sensor.py +138 -0
- esphome/components/mpl3115a2/__init__.py +0 -0
- esphome/components/mpl3115a2/mpl3115a2.cpp +99 -0
- esphome/components/mpl3115a2/mpl3115a2.h +108 -0
- esphome/components/mpl3115a2/sensor.py +75 -0
- esphome/components/mpr121/__init__.py +127 -0
- esphome/components/mpr121/binary_sensor/__init__.py +37 -0
- esphome/components/mpr121/binary_sensor/mpr121_binary_sensor.cpp +20 -0
- esphome/components/mpr121/binary_sensor/mpr121_binary_sensor.h +26 -0
- esphome/components/mpr121/mpr121.cpp +165 -0
- esphome/components/mpr121/mpr121.h +128 -0
- esphome/components/mpu6050/__init__.py +0 -0
- esphome/components/mpu6050/mpu6050.cpp +147 -0
- esphome/components/mpu6050/mpu6050.h +39 -0
- esphome/components/mpu6050/sensor.py +84 -0
- esphome/components/mpu6886/__init__.py +1 -0
- esphome/components/mpu6886/mpu6886.cpp +153 -0
- esphome/components/mpu6886/mpu6886.h +39 -0
- esphome/components/mpu6886/sensor.py +85 -0
- esphome/components/mqtt/__init__.py +594 -0
- esphome/components/mqtt/custom_mqtt_device.cpp +35 -0
- esphome/components/mqtt/custom_mqtt_device.h +220 -0
- esphome/components/mqtt/mqtt_alarm_control_panel.cpp +125 -0
- esphome/components/mqtt/mqtt_alarm_control_panel.h +39 -0
- esphome/components/mqtt/mqtt_backend.h +71 -0
- esphome/components/mqtt/mqtt_backend_esp32.cpp +194 -0
- esphome/components/mqtt/mqtt_backend_esp32.h +178 -0
- esphome/components/mqtt/mqtt_backend_esp8266.h +74 -0
- esphome/components/mqtt/mqtt_backend_libretiny.h +74 -0
- esphome/components/mqtt/mqtt_binary_sensor.cpp +60 -0
- esphome/components/mqtt/mqtt_binary_sensor.h +43 -0
- esphome/components/mqtt/mqtt_button.cpp +46 -0
- esphome/components/mqtt/mqtt_button.h +40 -0
- esphome/components/mqtt/mqtt_client.cpp +723 -0
- esphome/components/mqtt/mqtt_client.h +451 -0
- esphome/components/mqtt/mqtt_climate.cpp +459 -0
- esphome/components/mqtt/mqtt_climate.h +56 -0
- esphome/components/mqtt/mqtt_component.cpp +320 -0
- esphome/components/mqtt/mqtt_component.h +218 -0
- esphome/components/mqtt/mqtt_const.h +543 -0
- esphome/components/mqtt/mqtt_cover.cpp +118 -0
- esphome/components/mqtt/mqtt_cover.h +43 -0
- esphome/components/mqtt/mqtt_date.cpp +68 -0
- esphome/components/mqtt/mqtt_date.h +45 -0
- esphome/components/mqtt/mqtt_datetime.cpp +84 -0
- esphome/components/mqtt/mqtt_datetime.h +45 -0
- esphome/components/mqtt/mqtt_event.cpp +54 -0
- esphome/components/mqtt/mqtt_event.h +39 -0
- esphome/components/mqtt/mqtt_fan.cpp +143 -0
- esphome/components/mqtt/mqtt_fan.h +52 -0
- esphome/components/mqtt/mqtt_light.cpp +87 -0
- esphome/components/mqtt/mqtt_light.h +41 -0
- esphome/components/mqtt/mqtt_lock.cpp +57 -0
- esphome/components/mqtt/mqtt_lock.h +41 -0
- esphome/components/mqtt/mqtt_number.cpp +80 -0
- esphome/components/mqtt/mqtt_number.h +46 -0
- esphome/components/mqtt/mqtt_select.cpp +59 -0
- esphome/components/mqtt/mqtt_select.h +46 -0
- esphome/components/mqtt/mqtt_sensor.cpp +83 -0
- esphome/components/mqtt/mqtt_sensor.h +59 -0
- esphome/components/mqtt/mqtt_switch.cpp +62 -0
- esphome/components/mqtt/mqtt_switch.h +41 -0
- esphome/components/mqtt/mqtt_text.cpp +63 -0
- esphome/components/mqtt/mqtt_text.h +46 -0
- esphome/components/mqtt/mqtt_text_sensor.cpp +47 -0
- esphome/components/mqtt/mqtt_text_sensor.h +40 -0
- esphome/components/mqtt/mqtt_time.cpp +68 -0
- esphome/components/mqtt/mqtt_time.h +45 -0
- esphome/components/mqtt/mqtt_update.cpp +62 -0
- esphome/components/mqtt/mqtt_update.h +41 -0
- esphome/components/mqtt/mqtt_valve.cpp +90 -0
- esphome/components/mqtt/mqtt_valve.h +41 -0
- esphome/components/mqtt_subscribe/__init__.py +3 -0
- esphome/components/mqtt_subscribe/sensor/__init__.py +40 -0
- esphome/components/mqtt_subscribe/sensor/mqtt_subscribe_sensor.cpp +38 -0
- esphome/components/mqtt_subscribe/sensor/mqtt_subscribe_sensor.h +33 -0
- esphome/components/mqtt_subscribe/text_sensor/__init__.py +36 -0
- esphome/components/mqtt_subscribe/text_sensor/mqtt_subscribe_text_sensor.cpp +28 -0
- esphome/components/mqtt_subscribe/text_sensor/mqtt_subscribe_text_sensor.h +32 -0
- esphome/components/ms5611/__init__.py +0 -0
- esphome/components/ms5611/ms5611.cpp +130 -0
- esphome/components/ms5611/ms5611.h +31 -0
- esphome/components/ms5611/sensor.py +58 -0
- esphome/components/ms8607/__init__.py +1 -0
- esphome/components/ms8607/ms8607.cpp +444 -0
- esphome/components/ms8607/ms8607.h +109 -0
- esphome/components/ms8607/sensor.py +83 -0
- esphome/components/my9231/__init__.py +41 -0
- esphome/components/my9231/my9231.cpp +127 -0
- esphome/components/my9231/my9231.h +64 -0
- esphome/components/my9231/output.py +27 -0
- esphome/components/nau7802/__init__.py +0 -0
- esphome/components/nau7802/nau7802.cpp +323 -0
- esphome/components/nau7802/nau7802.h +121 -0
- esphome/components/nau7802/sensor.py +134 -0
- esphome/components/neopixelbus/__init__.py +0 -0
- esphome/components/neopixelbus/_methods.py +421 -0
- esphome/components/neopixelbus/const.py +42 -0
- esphome/components/neopixelbus/light.py +225 -0
- esphome/components/neopixelbus/neopixelbus_light.h +146 -0
- esphome/components/network/__init__.py +58 -0
- esphome/components/network/ip_address.h +145 -0
- esphome/components/network/util.cpp +66 -0
- esphome/components/network/util.h +20 -0
- esphome/components/nextion/__init__.py +10 -0
- esphome/components/nextion/automation.h +122 -0
- esphome/components/nextion/base_component.py +126 -0
- esphome/components/nextion/binary_sensor/__init__.py +95 -0
- esphome/components/nextion/binary_sensor/nextion_binarysensor.cpp +69 -0
- esphome/components/nextion/binary_sensor/nextion_binarysensor.h +42 -0
- esphome/components/nextion/display.py +168 -0
- esphome/components/nextion/nextion.cpp +1172 -0
- esphome/components/nextion/nextion.h +1357 -0
- esphome/components/nextion/nextion_base.h +64 -0
- esphome/components/nextion/nextion_commands.cpp +356 -0
- esphome/components/nextion/nextion_component.cpp +116 -0
- esphome/components/nextion/nextion_component.h +49 -0
- esphome/components/nextion/nextion_component_base.h +103 -0
- esphome/components/nextion/nextion_upload_arduino.cpp +387 -0
- esphome/components/nextion/nextion_upload_idf.cpp +367 -0
- esphome/components/nextion/sensor/__init__.py +130 -0
- esphome/components/nextion/sensor/nextion_sensor.cpp +116 -0
- esphome/components/nextion/sensor/nextion_sensor.h +49 -0
- esphome/components/nextion/switch/__init__.py +71 -0
- esphome/components/nextion/switch/nextion_switch.cpp +52 -0
- esphome/components/nextion/switch/nextion_switch.h +34 -0
- esphome/components/nextion/text_sensor/__init__.py +69 -0
- esphome/components/nextion/text_sensor/nextion_textsensor.cpp +49 -0
- esphome/components/nextion/text_sensor/nextion_textsensor.h +32 -0
- esphome/components/nfc/__init__.py +13 -0
- esphome/components/nfc/automation.cpp +9 -0
- esphome/components/nfc/automation.h +17 -0
- esphome/components/nfc/binary_sensor/__init__.py +72 -0
- esphome/components/nfc/binary_sensor/binary_sensor.cpp +114 -0
- esphome/components/nfc/binary_sensor/binary_sensor.h +38 -0
- esphome/components/nfc/nci_core.h +144 -0
- esphome/components/nfc/nci_message.cpp +166 -0
- esphome/components/nfc/nci_message.h +50 -0
- esphome/components/nfc/ndef_message.cpp +110 -0
- esphome/components/nfc/ndef_message.h +42 -0
- esphome/components/nfc/ndef_record.cpp +65 -0
- esphome/components/nfc/ndef_record.h +57 -0
- esphome/components/nfc/ndef_record_text.cpp +40 -0
- esphome/components/nfc/ndef_record_text.h +43 -0
- esphome/components/nfc/ndef_record_uri.cpp +48 -0
- esphome/components/nfc/ndef_record_uri.h +78 -0
- esphome/components/nfc/nfc.cpp +108 -0
- esphome/components/nfc/nfc.h +84 -0
- esphome/components/nfc/nfc_helpers.cpp +47 -0
- esphome/components/nfc/nfc_helpers.h +17 -0
- esphome/components/nfc/nfc_tag.cpp +9 -0
- esphome/components/nfc/nfc_tag.h +57 -0
- esphome/components/noblex/__init__.py +1 -0
- esphome/components/noblex/climate.py +20 -0
- esphome/components/noblex/noblex.cpp +309 -0
- esphome/components/noblex/noblex.h +47 -0
- esphome/components/npi19/__init__.py +0 -0
- esphome/components/npi19/npi19.cpp +111 -0
- esphome/components/npi19/npi19.h +30 -0
- esphome/components/npi19/sensor.py +52 -0
- esphome/components/ntc/__init__.py +0 -0
- esphome/components/ntc/ntc.cpp +31 -0
- esphome/components/ntc/ntc.h +29 -0
- esphome/components/ntc/sensor.py +146 -0
- esphome/components/number/__init__.py +414 -0
- esphome/components/number/automation.cpp +56 -0
- esphome/components/number/automation.h +95 -0
- esphome/components/number/number.cpp +21 -0
- esphome/components/number/number.h +70 -0
- esphome/components/number/number_call.cpp +118 -0
- esphome/components/number/number_call.h +43 -0
- esphome/components/number/number_traits.cpp +10 -0
- esphome/components/number/number_traits.h +39 -0
- esphome/components/one_wire/__init__.py +40 -0
- esphome/components/one_wire/one_wire.cpp +40 -0
- esphome/components/one_wire/one_wire.h +44 -0
- esphome/components/one_wire/one_wire_bus.cpp +88 -0
- esphome/components/one_wire/one_wire_bus.h +61 -0
- esphome/components/online_image/__init__.py +168 -0
- esphome/components/online_image/image_decoder.cpp +44 -0
- esphome/components/online_image/image_decoder.h +112 -0
- esphome/components/online_image/online_image.cpp +277 -0
- esphome/components/online_image/online_image.h +190 -0
- esphome/components/online_image/png_image.cpp +72 -0
- esphome/components/online_image/png_image.h +33 -0
- esphome/components/opentherm/__init__.py +83 -0
- esphome/components/opentherm/binary_sensor/__init__.py +33 -0
- esphome/components/opentherm/const.py +11 -0
- esphome/components/opentherm/generate.py +142 -0
- esphome/components/opentherm/hub.cpp +382 -0
- esphome/components/opentherm/hub.h +163 -0
- esphome/components/opentherm/input.h +18 -0
- esphome/components/opentherm/input.py +51 -0
- esphome/components/opentherm/number/__init__.py +74 -0
- esphome/components/opentherm/number/number.cpp +40 -0
- esphome/components/opentherm/number/number.h +31 -0
- esphome/components/opentherm/opentherm.cpp +582 -0
- esphome/components/opentherm/opentherm.h +378 -0
- esphome/components/opentherm/opentherm_macros.h +151 -0
- esphome/components/opentherm/output/__init__.py +47 -0
- esphome/components/opentherm/output/output.cpp +18 -0
- esphome/components/opentherm/output/output.h +33 -0
- esphome/components/opentherm/schema.py +814 -0
- esphome/components/opentherm/sensor/__init__.py +51 -0
- esphome/components/opentherm/switch/__init__.py +43 -0
- esphome/components/opentherm/switch/switch.cpp +28 -0
- esphome/components/opentherm/switch/switch.h +20 -0
- esphome/components/opentherm/validate.py +31 -0
- esphome/components/ota/__init__.py +122 -0
- esphome/components/ota/automation.h +78 -0
- esphome/components/ota/ota_backend.cpp +20 -0
- esphome/components/ota/ota_backend.h +96 -0
- esphome/components/ota/ota_backend_arduino_esp32.cpp +62 -0
- esphome/components/ota/ota_backend_arduino_esp32.h +24 -0
- esphome/components/ota/ota_backend_arduino_esp8266.cpp +75 -0
- esphome/components/ota/ota_backend_arduino_esp8266.h +30 -0
- esphome/components/ota/ota_backend_arduino_libretiny.cpp +62 -0
- esphome/components/ota/ota_backend_arduino_libretiny.h +23 -0
- esphome/components/ota/ota_backend_arduino_rp2040.cpp +75 -0
- esphome/components/ota/ota_backend_arduino_rp2040.h +26 -0
- esphome/components/ota/ota_backend_esp_idf.cpp +116 -0
- esphome/components/ota/ota_backend_esp_idf.h +31 -0
- esphome/components/output/__init__.py +110 -0
- esphome/components/output/automation.cpp +10 -0
- esphome/components/output/automation.h +44 -0
- esphome/components/output/binary_output.h +73 -0
- esphome/components/output/button/__init__.py +29 -0
- esphome/components/output/button/output_button.cpp +21 -0
- esphome/components/output/button/output_button.h +25 -0
- esphome/components/output/float_output.cpp +46 -0
- esphome/components/output/float_output.h +89 -0
- esphome/components/output/lock/__init__.py +23 -0
- esphome/components/output/lock/output_lock.cpp +22 -0
- esphome/components/output/lock/output_lock.h +24 -0
- esphome/components/output/switch/__init__.py +28 -0
- esphome/components/output/switch/output_switch.cpp +31 -0
- esphome/components/output/switch/output_switch.h +25 -0
- esphome/components/packages/__init__.py +183 -0
- esphome/components/partition/__init__.py +0 -0
- esphome/components/partition/light.py +121 -0
- esphome/components/partition/light_partition.cpp +10 -0
- esphome/components/partition/light_partition.h +97 -0
- esphome/components/pca6416a/__init__.py +78 -0
- esphome/components/pca6416a/pca6416a.cpp +176 -0
- esphome/components/pca6416a/pca6416a.h +63 -0
- esphome/components/pca9554/__init__.py +86 -0
- esphome/components/pca9554/pca9554.cpp +144 -0
- esphome/components/pca9554/pca9554.h +76 -0
- esphome/components/pca9685/__init__.py +47 -0
- esphome/components/pca9685/output.py +26 -0
- esphome/components/pca9685/pca9685_output.cpp +154 -0
- esphome/components/pca9685/pca9685_output.h +73 -0
- esphome/components/pcd8544/__init__.py +0 -0
- esphome/components/pcd8544/display.py +60 -0
- esphome/components/pcd8544/pcd_8544.cpp +126 -0
- esphome/components/pcd8544/pcd_8544.h +78 -0
- esphome/components/pcf85063/__init__.py +0 -0
- esphome/components/pcf85063/pcf85063.cpp +109 -0
- esphome/components/pcf85063/pcf85063.h +96 -0
- esphome/components/pcf85063/time.py +60 -0
- esphome/components/pcf8563/__init__.py +0 -0
- esphome/components/pcf8563/pcf8563.cpp +109 -0
- esphome/components/pcf8563/pcf8563.h +124 -0
- esphome/components/pcf8563/time.py +62 -0
- esphome/components/pcf8574/__init__.py +75 -0
- esphome/components/pcf8574/pcf8574.cpp +106 -0
- esphome/components/pcf8574/pcf8574.h +65 -0
- esphome/components/pid/__init__.py +1 -0
- esphome/components/pid/climate.py +194 -0
- esphome/components/pid/pid_autotuner.cpp +361 -0
- esphome/components/pid/pid_autotuner.h +115 -0
- esphome/components/pid/pid_climate.cpp +187 -0
- esphome/components/pid/pid_climate.h +160 -0
- esphome/components/pid/pid_controller.cpp +129 -0
- esphome/components/pid/pid_controller.h +71 -0
- esphome/components/pid/pid_simulator.h +77 -0
- esphome/components/pid/sensor/__init__.py +53 -0
- esphome/components/pid/sensor/pid_climate_sensor.cpp +59 -0
- esphome/components/pid/sensor/pid_climate_sensor.h +37 -0
- esphome/components/pipsolar/__init__.py +32 -0
- esphome/components/pipsolar/binary_sensor/__init__.py +141 -0
- esphome/components/pipsolar/output/__init__.py +106 -0
- esphome/components/pipsolar/output/pipsolar_output.cpp +22 -0
- esphome/components/pipsolar/output/pipsolar_output.h +42 -0
- esphome/components/pipsolar/pipsolar.cpp +912 -0
- esphome/components/pipsolar/pipsolar.h +223 -0
- esphome/components/pipsolar/sensor/__init__.py +279 -0
- esphome/components/pipsolar/switch/__init__.py +50 -0
- esphome/components/pipsolar/switch/pipsolar_switch.cpp +24 -0
- esphome/components/pipsolar/switch/pipsolar_switch.h +25 -0
- esphome/components/pipsolar/text_sensor/__init__.py +40 -0
- esphome/components/pm1006/__init__.py +0 -0
- esphome/components/pm1006/pm1006.cpp +103 -0
- esphome/components/pm1006/pm1006.h +36 -0
- esphome/components/pm1006/sensor.py +67 -0
- esphome/components/pmsa003i/__init__.py +0 -0
- esphome/components/pmsa003i/pmsa003i.cpp +110 -0
- esphome/components/pmsa003i/pmsa003i.h +68 -0
- esphome/components/pmsa003i/sensor.py +127 -0
- esphome/components/pmsx003/__init__.py +0 -0
- esphome/components/pmsx003/pmsx003.cpp +357 -0
- esphome/components/pmsx003/pmsx003.h +101 -0
- esphome/components/pmsx003/sensor.py +272 -0
- esphome/components/pmwcs3/__init__.py +1 -0
- esphome/components/pmwcs3/pmwcs3.cpp +116 -0
- esphome/components/pmwcs3/pmwcs3.h +70 -0
- esphome/components/pmwcs3/sensor.py +140 -0
- esphome/components/pn532/__init__.py +96 -0
- esphome/components/pn532/binary_sensor.py +48 -0
- esphome/components/pn532/pn532.cpp +465 -0
- esphome/components/pn532/pn532.h +150 -0
- esphome/components/pn532/pn532_mifare_classic.cpp +262 -0
- esphome/components/pn532/pn532_mifare_ultralight.cpp +192 -0
- esphome/components/pn532_i2c/__init__.py +26 -0
- esphome/components/pn532_i2c/pn532_i2c.cpp +129 -0
- esphome/components/pn532_i2c/pn532_i2c.h +25 -0
- esphome/components/pn532_spi/__init__.py +26 -0
- esphome/components/pn532_spi/pn532_spi.cpp +138 -0
- esphome/components/pn532_spi/pn532_spi.h +28 -0
- esphome/components/pn7150/__init__.py +215 -0
- esphome/components/pn7150/automation.h +82 -0
- esphome/components/pn7150/pn7150.cpp +1143 -0
- esphome/components/pn7150/pn7150.h +296 -0
- esphome/components/pn7150/pn7150_mifare_classic.cpp +322 -0
- esphome/components/pn7150/pn7150_mifare_ultralight.cpp +186 -0
- esphome/components/pn7150_i2c/__init__.py +25 -0
- esphome/components/pn7150_i2c/pn7150_i2c.cpp +49 -0
- esphome/components/pn7150_i2c/pn7150_i2c.h +22 -0
- esphome/components/pn7160/__init__.py +227 -0
- esphome/components/pn7160/automation.h +82 -0
- esphome/components/pn7160/pn7160.cpp +1167 -0
- esphome/components/pn7160/pn7160.h +315 -0
- esphome/components/pn7160/pn7160_mifare_classic.cpp +322 -0
- esphome/components/pn7160/pn7160_mifare_ultralight.cpp +186 -0
- esphome/components/pn7160_i2c/__init__.py +25 -0
- esphome/components/pn7160_i2c/pn7160_i2c.cpp +49 -0
- esphome/components/pn7160_i2c/pn7160_i2c.h +22 -0
- esphome/components/pn7160_spi/__init__.py +26 -0
- esphome/components/pn7160_spi/pn7160_spi.cpp +54 -0
- esphome/components/pn7160_spi/pn7160_spi.h +30 -0
- esphome/components/power_supply/__init__.py +42 -0
- esphome/components/power_supply/power_supply.cpp +59 -0
- esphome/components/power_supply/power_supply.h +67 -0
- esphome/components/preferences/__init__.py +24 -0
- esphome/components/preferences/syncer.h +23 -0
- esphome/components/prometheus/__init__.py +58 -0
- esphome/components/prometheus/prometheus_handler.cpp +516 -0
- esphome/components/prometheus/prometheus_handler.h +139 -0
- esphome/components/psram/__init__.py +60 -0
- esphome/components/psram/psram.cpp +32 -0
- esphome/components/psram/psram.h +17 -0
- esphome/components/pulse_counter/__init__.py +0 -0
- esphome/components/pulse_counter/automation.h +24 -0
- esphome/components/pulse_counter/pulse_counter_sensor.cpp +194 -0
- esphome/components/pulse_counter/pulse_counter_sensor.h +91 -0
- esphome/components/pulse_counter/sensor.py +156 -0
- esphome/components/pulse_meter/__init__.py +0 -0
- esphome/components/pulse_meter/automation.h +24 -0
- esphome/components/pulse_meter/pulse_meter_sensor.cpp +163 -0
- esphome/components/pulse_meter/pulse_meter_sensor.h +83 -0
- esphome/components/pulse_meter/sensor.py +114 -0
- esphome/components/pulse_width/__init__.py +0 -0
- esphome/components/pulse_width/pulse_width.cpp +31 -0
- esphome/components/pulse_width/pulse_width.h +44 -0
- esphome/components/pulse_width/sensor.py +40 -0
- esphome/components/pvvx_mithermometer/__init__.py +0 -0
- esphome/components/pvvx_mithermometer/display/__init__.py +55 -0
- esphome/components/pvvx_mithermometer/display/pvvx_display.cpp +163 -0
- esphome/components/pvvx_mithermometer/display/pvvx_display.h +135 -0
- esphome/components/pvvx_mithermometer/pvvx_mithermometer.cpp +141 -0
- esphome/components/pvvx_mithermometer/pvvx_mithermometer.h +51 -0
- esphome/components/pvvx_mithermometer/sensor.py +100 -0
- esphome/components/pylontech/__init__.py +46 -0
- esphome/components/pylontech/pylontech.cpp +104 -0
- esphome/components/pylontech/pylontech.h +53 -0
- esphome/components/pylontech/sensor/__init__.py +97 -0
- esphome/components/pylontech/sensor/pylontech_sensor.cpp +60 -0
- esphome/components/pylontech/sensor/pylontech_sensor.h +32 -0
- esphome/components/pylontech/text_sensor/__init__.py +41 -0
- esphome/components/pylontech/text_sensor/pylontech_text_sensor.cpp +40 -0
- esphome/components/pylontech/text_sensor/pylontech_text_sensor.h +26 -0
- esphome/components/pzem004t/__init__.py +0 -0
- esphome/components/pzem004t/pzem004t.cpp +126 -0
- esphome/components/pzem004t/pzem004t.h +46 -0
- esphome/components/pzem004t/sensor.py +82 -0
- esphome/components/pzemac/__init__.py +0 -0
- esphome/components/pzemac/pzemac.cpp +85 -0
- esphome/components/pzemac/pzemac.h +53 -0
- esphome/components/pzemac/sensor.py +125 -0
- esphome/components/pzemdc/__init__.py +0 -0
- esphome/components/pzemdc/pzemdc.cpp +73 -0
- esphome/components/pzemdc/pzemdc.h +46 -0
- esphome/components/pzemdc/sensor.py +101 -0
- esphome/components/qmc5883l/__init__.py +0 -0
- esphome/components/qmc5883l/qmc5883l.cpp +175 -0
- esphome/components/qmc5883l/qmc5883l.h +63 -0
- esphome/components/qmc5883l/sensor.py +145 -0
- esphome/components/qmp6988/__init__.py +1 -0
- esphome/components/qmp6988/qmp6988.cpp +397 -0
- esphome/components/qmp6988/qmp6988.h +116 -0
- esphome/components/qmp6988/sensor.py +101 -0
- esphome/components/qr_code/__init__.py +41 -0
- esphome/components/qr_code/qr_code.cpp +67 -0
- esphome/components/qr_code/qr_code.h +36 -0
- esphome/components/qspi_amoled/display.py +3 -0
- esphome/components/qspi_dbi/__init__.py +1 -0
- esphome/components/qspi_dbi/display.py +185 -0
- esphome/components/qspi_dbi/models.py +67 -0
- esphome/components/qspi_dbi/qspi_dbi.cpp +230 -0
- esphome/components/qspi_dbi/qspi_dbi.h +173 -0
- esphome/components/qwiic_pir/__init__.py +0 -0
- esphome/components/qwiic_pir/binary_sensor.py +67 -0
- esphome/components/qwiic_pir/qwiic_pir.cpp +137 -0
- esphome/components/qwiic_pir/qwiic_pir.h +70 -0
- esphome/components/radon_eye_ble/__init__.py +23 -0
- esphome/components/radon_eye_ble/radon_eye_listener.cpp +32 -0
- esphome/components/radon_eye_ble/radon_eye_listener.h +19 -0
- esphome/components/radon_eye_rd200/__init__.py +1 -0
- esphome/components/radon_eye_rd200/radon_eye_rd200.cpp +179 -0
- esphome/components/radon_eye_rd200/radon_eye_rd200.h +59 -0
- esphome/components/radon_eye_rd200/sensor.py +55 -0
- esphome/components/rc522/__init__.py +56 -0
- esphome/components/rc522/binary_sensor.py +48 -0
- esphome/components/rc522/rc522.cpp +505 -0
- esphome/components/rc522/rc522.h +280 -0
- esphome/components/rc522_i2c/__init__.py +26 -0
- esphome/components/rc522_i2c/rc522_i2c.cpp +70 -0
- esphome/components/rc522_i2c/rc522_i2c.h +42 -0
- esphome/components/rc522_spi/__init__.py +30 -0
- esphome/components/rc522_spi/binary_sensor.py +9 -0
- esphome/components/rc522_spi/rc522_spi.cpp +140 -0
- esphome/components/rc522_spi/rc522_spi.h +54 -0
- esphome/components/rdm6300/__init__.py +41 -0
- esphome/components/rdm6300/binary_sensor.py +27 -0
- esphome/components/rdm6300/rdm6300.cpp +68 -0
- esphome/components/rdm6300/rdm6300.h +58 -0
- esphome/components/remote_base/__init__.py +1965 -0
- esphome/components/remote_base/abbwelcome_protocol.cpp +123 -0
- esphome/components/remote_base/abbwelcome_protocol.h +253 -0
- esphome/components/remote_base/aeha_protocol.cpp +102 -0
- esphome/components/remote_base/aeha_protocol.h +46 -0
- esphome/components/remote_base/byronsx_protocol.cpp +139 -0
- esphome/components/remote_base/byronsx_protocol.h +46 -0
- esphome/components/remote_base/canalsat_protocol.cpp +108 -0
- esphome/components/remote_base/canalsat_protocol.h +78 -0
- esphome/components/remote_base/coolix_protocol.cpp +113 -0
- esphome/components/remote_base/coolix_protocol.h +41 -0
- esphome/components/remote_base/dish_protocol.cpp +94 -0
- esphome/components/remote_base/dish_protocol.h +38 -0
- esphome/components/remote_base/dooya_protocol.cpp +120 -0
- esphome/components/remote_base/dooya_protocol.h +49 -0
- esphome/components/remote_base/drayton_protocol.cpp +240 -0
- esphome/components/remote_base/drayton_protocol.h +46 -0
- esphome/components/remote_base/haier_protocol.cpp +84 -0
- esphome/components/remote_base/haier_protocol.h +39 -0
- esphome/components/remote_base/jvc_protocol.cpp +52 -0
- esphome/components/remote_base/jvc_protocol.h +37 -0
- esphome/components/remote_base/keeloq_protocol.cpp +194 -0
- esphome/components/remote_base/keeloq_protocol.h +53 -0
- esphome/components/remote_base/lg_protocol.cpp +58 -0
- esphome/components/remote_base/lg_protocol.h +41 -0
- esphome/components/remote_base/magiquest_protocol.cpp +83 -0
- esphome/components/remote_base/magiquest_protocol.h +52 -0
- esphome/components/remote_base/midea_protocol.cpp +76 -0
- esphome/components/remote_base/midea_protocol.h +83 -0
- esphome/components/remote_base/mirage_protocol.cpp +84 -0
- esphome/components/remote_base/mirage_protocol.h +39 -0
- esphome/components/remote_base/nec_protocol.cpp +102 -0
- esphome/components/remote_base/nec_protocol.h +41 -0
- esphome/components/remote_base/nexa_protocol.cpp +240 -0
- esphome/components/remote_base/nexa_protocol.h +54 -0
- esphome/components/remote_base/panasonic_protocol.cpp +74 -0
- esphome/components/remote_base/panasonic_protocol.h +41 -0
- esphome/components/remote_base/pioneer_protocol.cpp +156 -0
- esphome/components/remote_base/pioneer_protocol.h +38 -0
- esphome/components/remote_base/pronto_protocol.cpp +243 -0
- esphome/components/remote_base/pronto_protocol.h +55 -0
- esphome/components/remote_base/raw_protocol.cpp +47 -0
- esphome/components/remote_base/raw_protocol.h +81 -0
- esphome/components/remote_base/rc5_protocol.cpp +90 -0
- esphome/components/remote_base/rc5_protocol.h +39 -0
- esphome/components/remote_base/rc6_protocol.cpp +181 -0
- esphome/components/remote_base/rc6_protocol.h +46 -0
- esphome/components/remote_base/rc_switch_protocol.cpp +271 -0
- esphome/components/remote_base/rc_switch_protocol.h +221 -0
- esphome/components/remote_base/remote_base.cpp +168 -0
- esphome/components/remote_base/remote_base.h +313 -0
- esphome/components/remote_base/roomba_protocol.cpp +56 -0
- esphome/components/remote_base/roomba_protocol.h +35 -0
- esphome/components/remote_base/samsung36_protocol.cpp +103 -0
- esphome/components/remote_base/samsung36_protocol.h +41 -0
- esphome/components/remote_base/samsung_protocol.cpp +65 -0
- esphome/components/remote_base/samsung_protocol.h +39 -0
- esphome/components/remote_base/sony_protocol.cpp +69 -0
- esphome/components/remote_base/sony_protocol.h +41 -0
- esphome/components/remote_base/toshiba_ac_protocol.cpp +115 -0
- esphome/components/remote_base/toshiba_ac_protocol.h +39 -0
- esphome/components/remote_receiver/__init__.py +143 -0
- esphome/components/remote_receiver/binary_sensor.py +10 -0
- esphome/components/remote_receiver/remote_receiver.h +75 -0
- esphome/components/remote_receiver/remote_receiver_esp32.cpp +170 -0
- esphome/components/remote_receiver/remote_receiver_esp8266.cpp +123 -0
- esphome/components/remote_receiver/remote_receiver_libretiny.cpp +123 -0
- esphome/components/remote_transmitter/__init__.py +50 -0
- esphome/components/remote_transmitter/remote_transmitter.cpp +11 -0
- esphome/components/remote_transmitter/remote_transmitter.h +69 -0
- esphome/components/remote_transmitter/remote_transmitter_esp32.cpp +145 -0
- esphome/components/remote_transmitter/remote_transmitter_esp8266.cpp +103 -0
- esphome/components/remote_transmitter/remote_transmitter_libretiny.cpp +106 -0
- esphome/components/resistance/__init__.py +0 -0
- esphome/components/resistance/resistance_sensor.cpp +44 -0
- esphome/components/resistance/resistance_sensor.h +39 -0
- esphome/components/resistance/sensor.py +59 -0
- esphome/components/resistance_sampler/__init__.py +6 -0
- esphome/components/resistance_sampler/resistance_sampler.h +10 -0
- esphome/components/restart/__init__.py +1 -0
- esphome/components/restart/button/__init__.py +25 -0
- esphome/components/restart/button/restart_button.cpp +20 -0
- esphome/components/restart/button/restart_button.h +18 -0
- esphome/components/restart/switch/__init__.py +22 -0
- esphome/components/restart/switch/restart_switch.cpp +25 -0
- esphome/components/restart/switch/restart_switch.h +18 -0
- esphome/components/rf_bridge/__init__.py +242 -0
- esphome/components/rf_bridge/rf_bridge.cpp +235 -0
- esphome/components/rf_bridge/rf_bridge.h +196 -0
- esphome/components/rgb/__init__.py +0 -0
- esphome/components/rgb/light.py +28 -0
- esphome/components/rgb/rgb_light_output.h +36 -0
- esphome/components/rgbct/__init__.py +0 -0
- esphome/components/rgbct/light.py +59 -0
- esphome/components/rgbct/rgbct_light_output.h +59 -0
- esphome/components/rgbw/__init__.py +0 -0
- esphome/components/rgbw/light.py +40 -0
- esphome/components/rgbw/rgbw_light_output.h +44 -0
- esphome/components/rgbww/__init__.py +0 -0
- esphome/components/rgbww/light.py +69 -0
- esphome/components/rgbww/rgbww_light_output.h +55 -0
- esphome/components/rotary_encoder/__init__.py +0 -0
- esphome/components/rotary_encoder/rotary_encoder.cpp +245 -0
- esphome/components/rotary_encoder/rotary_encoder.h +138 -0
- esphome/components/rotary_encoder/sensor.py +148 -0
- esphome/components/rp2040/__init__.py +243 -0
- esphome/components/rp2040/boards.py +28 -0
- esphome/components/rp2040/build_pio.py.script +47 -0
- esphome/components/rp2040/const.py +7 -0
- esphome/components/rp2040/core.cpp +33 -0
- esphome/components/rp2040/core.h +14 -0
- esphome/components/rp2040/gpio.cpp +103 -0
- esphome/components/rp2040/gpio.h +38 -0
- esphome/components/rp2040/gpio.py +99 -0
- esphome/components/rp2040/post_build.py.script +23 -0
- esphome/components/rp2040/preferences.cpp +160 -0
- esphome/components/rp2040/preferences.h +14 -0
- esphome/components/rp2040_pio/__init__.py +40 -0
- esphome/components/rp2040_pio_led_strip/__init__.py +1 -0
- esphome/components/rp2040_pio_led_strip/led_strip.cpp +215 -0
- esphome/components/rp2040_pio_led_strip/led_strip.h +133 -0
- esphome/components/rp2040_pio_led_strip/light.py +283 -0
- esphome/components/rp2040_pwm/__init__.py +0 -0
- esphome/components/rp2040_pwm/output.py +55 -0
- esphome/components/rp2040_pwm/rp2040_pwm.cpp +68 -0
- esphome/components/rp2040_pwm/rp2040_pwm.h +59 -0
- esphome/components/rpi_dpi_rgb/__init__.py +1 -0
- esphome/components/rpi_dpi_rgb/display.py +200 -0
- esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.cpp +166 -0
- esphome/components/rpi_dpi_rgb/rpi_dpi_rgb.h +97 -0
- esphome/components/rtl87xx/__init__.py +51 -0
- esphome/components/rtl87xx/boards.py +1404 -0
- esphome/components/rtttl/__init__.py +156 -0
- esphome/components/rtttl/rtttl.cpp +395 -0
- esphome/components/rtttl/rtttl.h +124 -0
- esphome/components/ruuvi_ble/__init__.py +22 -0
- esphome/components/ruuvi_ble/ruuvi_ble.cpp +144 -0
- esphome/components/ruuvi_ble/ruuvi_ble.h +37 -0
- esphome/components/ruuvitag/__init__.py +0 -0
- esphome/components/ruuvitag/ruuvitag.cpp +29 -0
- esphome/components/ruuvitag/ruuvitag.h +84 -0
- esphome/components/ruuvitag/sensor.py +163 -0
- esphome/components/safe_mode/__init__.py +75 -0
- esphome/components/safe_mode/automation.h +17 -0
- esphome/components/safe_mode/button/__init__.py +33 -0
- esphome/components/safe_mode/button/safe_mode_button.cpp +27 -0
- esphome/components/safe_mode/button/safe_mode_button.h +21 -0
- esphome/components/safe_mode/safe_mode.cpp +131 -0
- esphome/components/safe_mode/safe_mode.h +50 -0
- esphome/components/safe_mode/switch/__init__.py +32 -0
- esphome/components/safe_mode/switch/safe_mode_switch.cpp +32 -0
- esphome/components/safe_mode/switch/safe_mode_switch.h +21 -0
- esphome/components/scd30/__init__.py +0 -0
- esphome/components/scd30/automation.h +23 -0
- esphome/components/scd30/scd30.cpp +233 -0
- esphome/components/scd30/scd30.h +53 -0
- esphome/components/scd30/sensor.py +142 -0
- esphome/components/scd4x/__init__.py +0 -0
- esphome/components/scd4x/automation.h +28 -0
- esphome/components/scd4x/scd4x.cpp +317 -0
- esphome/components/scd4x/scd4x.h +61 -0
- esphome/components/scd4x/sensor.py +171 -0
- esphome/components/script/__init__.py +226 -0
- esphome/components/script/script.cpp +14 -0
- esphome/components/script/script.h +253 -0
- esphome/components/sdl/__init__.py +1 -0
- esphome/components/sdl/display.py +72 -0
- esphome/components/sdl/sdl_esphome.cpp +113 -0
- esphome/components/sdl/sdl_esphome.h +55 -0
- esphome/components/sdl/touchscreen/__init__.py +22 -0
- esphome/components/sdl/touchscreen/sdl_touchscreen.h +26 -0
- esphome/components/sdm_meter/__init__.py +0 -0
- esphome/components/sdm_meter/sdm_meter.cpp +111 -0
- esphome/components/sdm_meter/sdm_meter.h +83 -0
- esphome/components/sdm_meter/sdm_meter_registers.h +114 -0
- esphome/components/sdm_meter/sensor.py +174 -0
- esphome/components/sdp3x/__init__.py +0 -0
- esphome/components/sdp3x/sdp3x.cpp +122 -0
- esphome/components/sdp3x/sdp3x.h +30 -0
- esphome/components/sdp3x/sensor.py +52 -0
- esphome/components/sds011/__init__.py +0 -0
- esphome/components/sds011/sds011.cpp +190 -0
- esphome/components/sds011/sds011.h +49 -0
- esphome/components/sds011/sensor.py +81 -0
- esphome/components/seeed_mr24hpc1/__init__.py +51 -0
- esphome/components/seeed_mr24hpc1/binary_sensor.py +23 -0
- esphome/components/seeed_mr24hpc1/button/__init__.py +42 -0
- esphome/components/seeed_mr24hpc1/button/custom_mode_end_button.cpp +9 -0
- esphome/components/seeed_mr24hpc1/button/custom_mode_end_button.h +18 -0
- esphome/components/seeed_mr24hpc1/button/restart_button.cpp +9 -0
- esphome/components/seeed_mr24hpc1/button/restart_button.h +18 -0
- esphome/components/seeed_mr24hpc1/number/__init__.py +132 -0
- esphome/components/seeed_mr24hpc1/number/custom_mode_number.cpp +12 -0
- esphome/components/seeed_mr24hpc1/number/custom_mode_number.h +18 -0
- esphome/components/seeed_mr24hpc1/number/custom_unman_time_number.cpp +9 -0
- esphome/components/seeed_mr24hpc1/number/custom_unman_time_number.h +18 -0
- esphome/components/seeed_mr24hpc1/number/existence_threshold_number.cpp +9 -0
- esphome/components/seeed_mr24hpc1/number/existence_threshold_number.h +18 -0
- esphome/components/seeed_mr24hpc1/number/motion_threshold_number.cpp +9 -0
- esphome/components/seeed_mr24hpc1/number/motion_threshold_number.h +18 -0
- esphome/components/seeed_mr24hpc1/number/motion_trigger_time_number.cpp +9 -0
- esphome/components/seeed_mr24hpc1/number/motion_trigger_time_number.h +18 -0
- esphome/components/seeed_mr24hpc1/number/motiontorest_time_number.cpp +9 -0
- esphome/components/seeed_mr24hpc1/number/motiontorest_time_number.h +18 -0
- esphome/components/seeed_mr24hpc1/number/sensitivity_number.cpp +9 -0
- esphome/components/seeed_mr24hpc1/number/sensitivity_number.h +18 -0
- esphome/components/seeed_mr24hpc1/seeed_mr24hpc1.cpp +890 -0
- esphome/components/seeed_mr24hpc1/seeed_mr24hpc1.h +217 -0
- esphome/components/seeed_mr24hpc1/seeed_mr24hpc1_constants.h +173 -0
- esphome/components/seeed_mr24hpc1/select/__init__.py +103 -0
- esphome/components/seeed_mr24hpc1/select/existence_boundary_select.cpp +15 -0
- esphome/components/seeed_mr24hpc1/select/existence_boundary_select.h +18 -0
- esphome/components/seeed_mr24hpc1/select/motion_boundary_select.cpp +15 -0
- esphome/components/seeed_mr24hpc1/select/motion_boundary_select.h +18 -0
- esphome/components/seeed_mr24hpc1/select/scene_mode_select.cpp +15 -0
- esphome/components/seeed_mr24hpc1/select/scene_mode_select.h +18 -0
- esphome/components/seeed_mr24hpc1/select/unman_time_select.cpp +15 -0
- esphome/components/seeed_mr24hpc1/select/unman_time_select.h +18 -0
- esphome/components/seeed_mr24hpc1/sensor.py +82 -0
- esphome/components/seeed_mr24hpc1/switch/__init__.py +32 -0
- esphome/components/seeed_mr24hpc1/switch/underlyFuc_switch.cpp +12 -0
- esphome/components/seeed_mr24hpc1/switch/underlyFuc_switch.h +18 -0
- esphome/components/seeed_mr24hpc1/text_sensor.py +74 -0
- esphome/components/seeed_mr60bha2/__init__.py +41 -0
- esphome/components/seeed_mr60bha2/seeed_mr60bha2.cpp +173 -0
- esphome/components/seeed_mr60bha2/seeed_mr60bha2.h +61 -0
- esphome/components/seeed_mr60bha2/sensor.py +57 -0
- esphome/components/seeed_mr60fda2/__init__.py +41 -0
- esphome/components/seeed_mr60fda2/binary_sensor.py +33 -0
- esphome/components/seeed_mr60fda2/button/__init__.py +45 -0
- esphome/components/seeed_mr60fda2/button/get_radar_parameters_button.cpp +9 -0
- esphome/components/seeed_mr60fda2/button/get_radar_parameters_button.h +18 -0
- esphome/components/seeed_mr60fda2/button/reset_radar_button.cpp +9 -0
- esphome/components/seeed_mr60fda2/button/reset_radar_button.h +18 -0
- esphome/components/seeed_mr60fda2/seeed_mr60fda2.cpp +368 -0
- esphome/components/seeed_mr60fda2/seeed_mr60fda2.h +101 -0
- esphome/components/seeed_mr60fda2/select/__init__.py +59 -0
- esphome/components/seeed_mr60fda2/select/height_threshold_select.cpp +15 -0
- esphome/components/seeed_mr60fda2/select/height_threshold_select.h +18 -0
- esphome/components/seeed_mr60fda2/select/install_height_select.cpp +15 -0
- esphome/components/seeed_mr60fda2/select/install_height_select.h +18 -0
- esphome/components/seeed_mr60fda2/select/sensitivity_select.cpp +15 -0
- esphome/components/seeed_mr60fda2/select/sensitivity_select.h +18 -0
- esphome/components/selec_meter/__init__.py +0 -0
- esphome/components/selec_meter/selec_meter.cpp +108 -0
- esphome/components/selec_meter/selec_meter.h +47 -0
- esphome/components/selec_meter/selec_meter_registers.h +32 -0
- esphome/components/selec_meter/sensor.py +165 -0
- esphome/components/select/__init__.py +244 -0
- esphome/components/select/automation.h +67 -0
- esphome/components/select/select.cpp +62 -0
- esphome/components/select/select.h +80 -0
- esphome/components/select/select_call.cpp +120 -0
- esphome/components/select/select_call.h +47 -0
- esphome/components/select/select_traits.cpp +11 -0
- esphome/components/select/select_traits.h +19 -0
- esphome/components/sen0321/__init__.py +1 -0
- esphome/components/sen0321/sen0321.cpp +36 -0
- esphome/components/sen0321/sen0321.h +35 -0
- esphome/components/sen0321/sensor.py +34 -0
- esphome/components/sen21231/__init__.py +0 -0
- esphome/components/sen21231/sen21231.cpp +32 -0
- esphome/components/sen21231/sen21231.h +77 -0
- esphome/components/sen21231/sensor.py +24 -0
- esphome/components/sen5x/__init__.py +0 -0
- esphome/components/sen5x/automation.h +21 -0
- esphome/components/sen5x/sen5x.cpp +424 -0
- esphome/components/sen5x/sen5x.h +134 -0
- esphome/components/sen5x/sensor.py +250 -0
- esphome/components/senseair/__init__.py +0 -0
- esphome/components/senseair/senseair.cpp +150 -0
- esphome/components/senseair/senseair.h +82 -0
- esphome/components/senseair/sensor.py +93 -0
- esphome/components/sensirion_common/__init__.py +10 -0
- esphome/components/sensirion_common/i2c_sensirion.cpp +128 -0
- esphome/components/sensirion_common/i2c_sensirion.h +157 -0
- esphome/components/sensor/__init__.py +959 -0
- esphome/components/sensor/automation.cpp +10 -0
- esphome/components/sensor/automation.h +111 -0
- esphome/components/sensor/filter.cpp +485 -0
- esphome/components/sensor/filter.h +443 -0
- esphome/components/sensor/sensor.cpp +100 -0
- esphome/components/sensor/sensor.h +163 -0
- esphome/components/servo/__init__.py +85 -0
- esphome/components/servo/servo.cpp +107 -0
- esphome/components/servo/servo.h +78 -0
- esphome/components/sfa30/__init__.py +1 -0
- esphome/components/sfa30/sensor.py +78 -0
- esphome/components/sfa30/sfa30.cpp +99 -0
- esphome/components/sfa30/sfa30.h +34 -0
- esphome/components/sgp30/__init__.py +0 -0
- esphome/components/sgp30/sensor.py +118 -0
- esphome/components/sgp30/sgp30.cpp +305 -0
- esphome/components/sgp30/sgp30.h +71 -0
- esphome/components/sgp40/__init__.py +0 -0
- esphome/components/sgp40/sensor.py +8 -0
- esphome/components/sgp4x/__init__.py +0 -0
- esphome/components/sgp4x/sensor.py +145 -0
- esphome/components/sgp4x/sgp4x.cpp +310 -0
- esphome/components/sgp4x/sgp4x.h +145 -0
- esphome/components/shelly_dimmer/__init__.py +1 -0
- esphome/components/shelly_dimmer/dev_table.h +159 -0
- esphome/components/shelly_dimmer/light.py +221 -0
- esphome/components/shelly_dimmer/shelly_dimmer.cpp +527 -0
- esphome/components/shelly_dimmer/shelly_dimmer.h +123 -0
- esphome/components/shelly_dimmer/stm32flash.cpp +1066 -0
- esphome/components/shelly_dimmer/stm32flash.h +131 -0
- esphome/components/sht3xd/__init__.py +0 -0
- esphome/components/sht3xd/sensor.py +64 -0
- esphome/components/sht3xd/sht3xd.cpp +107 -0
- esphome/components/sht3xd/sht3xd.h +39 -0
- esphome/components/sht4x/__init__.py +0 -0
- esphome/components/sht4x/sensor.py +103 -0
- esphome/components/sht4x/sht4x.cpp +86 -0
- esphome/components/sht4x/sht4x.h +47 -0
- esphome/components/shtcx/__init__.py +0 -0
- esphome/components/shtcx/sensor.py +59 -0
- esphome/components/shtcx/shtcx.cpp +125 -0
- esphome/components/shtcx/shtcx.h +34 -0
- esphome/components/shutdown/__init__.py +1 -0
- esphome/components/shutdown/button/__init__.py +21 -0
- esphome/components/shutdown/button/shutdown_button.cpp +33 -0
- esphome/components/shutdown/button/shutdown_button.h +18 -0
- esphome/components/shutdown/switch/__init__.py +22 -0
- esphome/components/shutdown/switch/shutdown_switch.cpp +38 -0
- esphome/components/shutdown/switch/shutdown_switch.h +18 -0
- esphome/components/sigma_delta_output/__init__.py +1 -0
- esphome/components/sigma_delta_output/output.py +66 -0
- esphome/components/sigma_delta_output/sigma_delta_output.cpp +57 -0
- esphome/components/sigma_delta_output/sigma_delta_output.h +47 -0
- esphome/components/sim800l/__init__.py +209 -0
- esphome/components/sim800l/binary_sensor.py +28 -0
- esphome/components/sim800l/sensor.py +33 -0
- esphome/components/sim800l/sim800l.cpp +489 -0
- esphome/components/sim800l/sim800l.h +223 -0
- esphome/components/slow_pwm/__init__.py +0 -0
- esphome/components/slow_pwm/output.py +72 -0
- esphome/components/slow_pwm/slow_pwm_output.cpp +77 -0
- esphome/components/slow_pwm/slow_pwm_output.h +61 -0
- esphome/components/sm10bit_base/__init__.py +44 -0
- esphome/components/sm10bit_base/sm10bit_base.cpp +131 -0
- esphome/components/sm10bit_base/sm10bit_base.h +63 -0
- esphome/components/sm16716/__init__.py +38 -0
- esphome/components/sm16716/output.py +27 -0
- esphome/components/sm16716/sm16716.cpp +52 -0
- esphome/components/sm16716/sm16716.h +72 -0
- esphome/components/sm2135/__init__.py +71 -0
- esphome/components/sm2135/output.py +28 -0
- esphome/components/sm2135/sm2135.cpp +152 -0
- esphome/components/sm2135/sm2135.h +90 -0
- esphome/components/sm2235/__init__.py +22 -0
- esphome/components/sm2235/output.py +28 -0
- esphome/components/sm2235/sm2235.cpp +27 -0
- esphome/components/sm2235/sm2235.h +19 -0
- esphome/components/sm2335/__init__.py +22 -0
- esphome/components/sm2335/output.py +28 -0
- esphome/components/sm2335/sm2335.cpp +27 -0
- esphome/components/sm2335/sm2335.h +19 -0
- esphome/components/sm300d2/__init__.py +0 -0
- esphome/components/sm300d2/sensor.py +117 -0
- esphome/components/sm300d2/sm300d2.cpp +108 -0
- esphome/components/sm300d2/sm300d2.h +38 -0
- esphome/components/sml/__init__.py +68 -0
- esphome/components/sml/automation.h +19 -0
- esphome/components/sml/constants.h +27 -0
- esphome/components/sml/sensor/__init__.py +30 -0
- esphome/components/sml/sensor/sml_sensor.cpp +41 -0
- esphome/components/sml/sensor/sml_sensor.h +16 -0
- esphome/components/sml/sml.cpp +146 -0
- esphome/components/sml/sml.h +48 -0
- esphome/components/sml/sml_parser.cpp +155 -0
- esphome/components/sml/sml_parser.h +54 -0
- esphome/components/sml/text_sensor/__init__.py +43 -0
- esphome/components/sml/text_sensor/sml_text_sensor.cpp +54 -0
- esphome/components/sml/text_sensor/sml_text_sensor.h +21 -0
- esphome/components/smt100/__init__.py +1 -0
- esphome/components/smt100/sensor.py +94 -0
- esphome/components/smt100/smt100.cpp +84 -0
- esphome/components/smt100/smt100.h +43 -0
- esphome/components/sn74hc165/__init__.py +95 -0
- esphome/components/sn74hc165/sn74hc165.cpp +72 -0
- esphome/components/sn74hc165/sn74hc165.h +61 -0
- esphome/components/sn74hc595/__init__.py +121 -0
- esphome/components/sn74hc595/sn74hc595.cpp +100 -0
- esphome/components/sn74hc595/sn74hc595.h +94 -0
- esphome/components/sntp/__init__.py +0 -0
- esphome/components/sntp/sntp_component.cpp +73 -0
- esphome/components/sntp/sntp_component.h +35 -0
- esphome/components/sntp/time.py +51 -0
- esphome/components/socket/__init__.py +39 -0
- esphome/components/socket/bsd_sockets_impl.cpp +143 -0
- esphome/components/socket/headers.h +185 -0
- esphome/components/socket/lwip_raw_tcp_impl.cpp +612 -0
- esphome/components/socket/lwip_sockets_impl.cpp +115 -0
- esphome/components/socket/socket.cpp +78 -0
- esphome/components/socket/socket.h +61 -0
- esphome/components/sonoff_d1/__init__.py +1 -0
- esphome/components/sonoff_d1/light.py +43 -0
- esphome/components/sonoff_d1/sonoff_d1.cpp +309 -0
- esphome/components/sonoff_d1/sonoff_d1.h +85 -0
- esphome/components/speaker/__init__.py +143 -0
- esphome/components/speaker/automation.h +83 -0
- esphome/components/speaker/speaker.h +110 -0
- esphome/components/speed/__init__.py +3 -0
- esphome/components/speed/fan/__init__.py +51 -0
- esphome/components/speed/fan/speed_fan.cpp +48 -0
- esphome/components/speed/fan/speed_fan.h +37 -0
- esphome/components/spi/__init__.py +408 -0
- esphome/components/spi/spi.cpp +118 -0
- esphome/components/spi/spi.h +477 -0
- esphome/components/spi/spi_arduino.cpp +95 -0
- esphome/components/spi/spi_esp_idf.cpp +244 -0
- esphome/components/spi_device/__init__.py +36 -0
- esphome/components/spi_device/spi_device.cpp +31 -0
- esphome/components/spi_device/spi_device.h +22 -0
- esphome/components/spi_led_strip/__init__.py +2 -0
- esphome/components/spi_led_strip/light.py +25 -0
- esphome/components/spi_led_strip/spi_led_strip.h +92 -0
- esphome/components/sprinkler/__init__.py +837 -0
- esphome/components/sprinkler/automation.h +185 -0
- esphome/components/sprinkler/sprinkler.cpp +1735 -0
- esphome/components/sprinkler/sprinkler.h +611 -0
- esphome/components/sps30/__init__.py +0 -0
- esphome/components/sps30/automation.h +21 -0
- esphome/components/sps30/sensor.py +180 -0
- esphome/components/sps30/sps30.cpp +238 -0
- esphome/components/sps30/sps30.h +63 -0
- esphome/components/ssd1306_base/__init__.py +103 -0
- esphome/components/ssd1306_base/ssd1306_base.cpp +382 -0
- esphome/components/ssd1306_base/ssd1306_base.h +88 -0
- esphome/components/ssd1306_i2c/__init__.py +0 -0
- esphome/components/ssd1306_i2c/display.py +29 -0
- esphome/components/ssd1306_i2c/ssd1306_i2c.cpp +78 -0
- esphome/components/ssd1306_i2c/ssd1306_i2c.h +23 -0
- esphome/components/ssd1306_spi/__init__.py +0 -0
- esphome/components/ssd1306_spi/display.py +38 -0
- esphome/components/ssd1306_spi/ssd1306_spi.cpp +65 -0
- esphome/components/ssd1306_spi/ssd1306_spi.h +29 -0
- esphome/components/ssd1322_base/__init__.py +50 -0
- esphome/components/ssd1322_base/ssd1322_base.cpp +204 -0
- esphome/components/ssd1322_base/ssd1322_base.h +55 -0
- esphome/components/ssd1322_spi/__init__.py +0 -0
- esphome/components/ssd1322_spi/display.py +38 -0
- esphome/components/ssd1322_spi/ssd1322_spi.cpp +71 -0
- esphome/components/ssd1322_spi/ssd1322_spi.h +30 -0
- esphome/components/ssd1325_base/__init__.py +54 -0
- esphome/components/ssd1325_base/ssd1325_base.cpp +245 -0
- esphome/components/ssd1325_base/ssd1325_base.h +60 -0
- esphome/components/ssd1325_spi/__init__.py +0 -0
- esphome/components/ssd1325_spi/display.py +38 -0
- esphome/components/ssd1325_spi/ssd1325_spi.cpp +59 -0
- esphome/components/ssd1325_spi/ssd1325_spi.h +29 -0
- esphome/components/ssd1327_base/__init__.py +41 -0
- esphome/components/ssd1327_base/ssd1327_base.cpp +180 -0
- esphome/components/ssd1327_base/ssd1327_base.h +54 -0
- esphome/components/ssd1327_i2c/__init__.py +0 -0
- esphome/components/ssd1327_i2c/display.py +29 -0
- esphome/components/ssd1327_i2c/ssd1327_i2c.cpp +44 -0
- esphome/components/ssd1327_i2c/ssd1327_i2c.h +23 -0
- esphome/components/ssd1327_spi/__init__.py +0 -0
- esphome/components/ssd1327_spi/display.py +38 -0
- esphome/components/ssd1327_spi/ssd1327_spi.cpp +58 -0
- esphome/components/ssd1327_spi/ssd1327_spi.h +29 -0
- esphome/components/ssd1331_base/__init__.py +32 -0
- esphome/components/ssd1331_base/ssd1331_base.cpp +154 -0
- esphome/components/ssd1331_base/ssd1331_base.h +47 -0
- esphome/components/ssd1331_spi/__init__.py +0 -0
- esphome/components/ssd1331_spi/display.py +38 -0
- esphome/components/ssd1331_spi/ssd1331_spi.cpp +57 -0
- esphome/components/ssd1331_spi/ssd1331_spi.h +29 -0
- esphome/components/ssd1351_base/__init__.py +42 -0
- esphome/components/ssd1351_base/ssd1351_base.cpp +196 -0
- esphome/components/ssd1351_base/ssd1351_base.h +56 -0
- esphome/components/ssd1351_spi/__init__.py +0 -0
- esphome/components/ssd1351_spi/display.py +38 -0
- esphome/components/ssd1351_spi/ssd1351_spi.cpp +71 -0
- esphome/components/ssd1351_spi/ssd1351_spi.h +30 -0
- esphome/components/st7567_base/__init__.py +55 -0
- esphome/components/st7567_base/st7567_base.cpp +152 -0
- esphome/components/st7567_base/st7567_base.h +100 -0
- esphome/components/st7567_i2c/__init__.py +1 -0
- esphome/components/st7567_i2c/display.py +29 -0
- esphome/components/st7567_i2c/st7567_i2c.cpp +60 -0
- esphome/components/st7567_i2c/st7567_i2c.h +23 -0
- esphome/components/st7567_spi/__init__.py +1 -0
- esphome/components/st7567_spi/display.py +38 -0
- esphome/components/st7567_spi/st7567_spi.cpp +66 -0
- esphome/components/st7567_spi/st7567_spi.h +29 -0
- esphome/components/st7701s/__init__.py +1 -0
- esphome/components/st7701s/display.py +255 -0
- esphome/components/st7701s/init_sequences.py +363 -0
- esphome/components/st7701s/st7701s.cpp +198 -0
- esphome/components/st7701s/st7701s.h +118 -0
- esphome/components/st7735/__init__.py +3 -0
- esphome/components/st7735/display.py +105 -0
- esphome/components/st7735/st7735.cpp +490 -0
- esphome/components/st7735/st7735.h +90 -0
- esphome/components/st7789v/__init__.py +3 -0
- esphome/components/st7789v/display.py +209 -0
- esphome/components/st7789v/st7789v.cpp +309 -0
- esphome/components/st7789v/st7789v.h +172 -0
- esphome/components/st7920/__init__.py +0 -0
- esphome/components/st7920/display.py +41 -0
- esphome/components/st7920/st7920.cpp +145 -0
- esphome/components/st7920/st7920.h +51 -0
- esphome/components/statsd/__init__.py +65 -0
- esphome/components/statsd/statsd.cpp +158 -0
- esphome/components/statsd/statsd.h +88 -0
- esphome/components/status/__init__.py +0 -0
- esphome/components/status/binary_sensor.py +25 -0
- esphome/components/status/status_binary_sensor.cpp +37 -0
- esphome/components/status/status_binary_sensor.h +22 -0
- esphome/components/status_led/__init__.py +25 -0
- esphome/components/status_led/light/__init__.py +35 -0
- esphome/components/status_led/light/status_led_light.cpp +77 -0
- esphome/components/status_led/light/status_led_light.h +44 -0
- esphome/components/status_led/status_led.cpp +35 -0
- esphome/components/status_led/status_led.h +26 -0
- esphome/components/stepper/__init__.py +185 -0
- esphome/components/stepper/stepper.cpp +51 -0
- esphome/components/stepper/stepper.h +110 -0
- esphome/components/sts3x/__init__.py +0 -0
- esphome/components/sts3x/sensor.py +35 -0
- esphome/components/sts3x/sts3x.cpp +71 -0
- esphome/components/sts3x/sts3x.h +22 -0
- esphome/components/substitutions/__init__.py +144 -0
- esphome/components/sun/__init__.py +181 -0
- esphome/components/sun/sensor/__init__.py +43 -0
- esphome/components/sun/sensor/sun_sensor.cpp +12 -0
- esphome/components/sun/sensor/sun_sensor.h +41 -0
- esphome/components/sun/sun.cpp +322 -0
- esphome/components/sun/sun.h +133 -0
- esphome/components/sun/text_sensor/__init__.py +58 -0
- esphome/components/sun/text_sensor/sun_text_sensor.cpp +12 -0
- esphome/components/sun/text_sensor/sun_text_sensor.h +44 -0
- esphome/components/sun_gtil2/__init__.py +26 -0
- esphome/components/sun_gtil2/sensor.py +87 -0
- esphome/components/sun_gtil2/sun_gtil2.cpp +135 -0
- esphome/components/sun_gtil2/sun_gtil2.h +58 -0
- esphome/components/sun_gtil2/text_sensor.py +31 -0
- esphome/components/switch/__init__.py +211 -0
- esphome/components/switch/automation.cpp +10 -0
- esphome/components/switch/automation.h +84 -0
- esphome/components/switch/binary_sensor/__init__.py +31 -0
- esphome/components/switch/binary_sensor/switch_binary_sensor.cpp +17 -0
- esphome/components/switch/binary_sensor/switch_binary_sensor.h +22 -0
- esphome/components/switch/switch.cpp +96 -0
- esphome/components/switch/switch.h +136 -0
- esphome/components/sx1509/__init__.py +119 -0
- esphome/components/sx1509/binary_sensor/__init__.py +26 -0
- esphome/components/sx1509/binary_sensor/sx1509_binary_keypad_sensor.h +19 -0
- esphome/components/sx1509/output/__init__.py +28 -0
- esphome/components/sx1509/output/sx1509_float_output.cpp +31 -0
- esphome/components/sx1509/output/sx1509_float_output.h +27 -0
- esphome/components/sx1509/sx1509.cpp +290 -0
- esphome/components/sx1509/sx1509.h +86 -0
- esphome/components/sx1509/sx1509_gpio_pin.cpp +22 -0
- esphome/components/sx1509/sx1509_gpio_pin.h +31 -0
- esphome/components/sx1509/sx1509_registers.h +110 -0
- esphome/components/t6615/__init__.py +0 -0
- esphome/components/t6615/sensor.py +46 -0
- esphome/components/t6615/t6615.cpp +95 -0
- esphome/components/t6615/t6615.h +44 -0
- esphome/components/tc74/__init__.py +1 -0
- esphome/components/tc74/sensor.py +32 -0
- esphome/components/tc74/tc74.cpp +68 -0
- esphome/components/tc74/tc74.h +28 -0
- esphome/components/tca9548a/__init__.py +43 -0
- esphome/components/tca9548a/tca9548a.cpp +57 -0
- esphome/components/tca9548a/tca9548a.h +39 -0
- esphome/components/tca9555/__init__.py +72 -0
- esphome/components/tca9555/tca9555.cpp +140 -0
- esphome/components/tca9555/tca9555.h +64 -0
- esphome/components/tcl112/__init__.py +0 -0
- esphome/components/tcl112/climate.py +21 -0
- esphome/components/tcl112/tcl112.cpp +244 -0
- esphome/components/tcl112/tcl112.h +28 -0
- esphome/components/tcs34725/__init__.py +0 -0
- esphome/components/tcs34725/sensor.py +132 -0
- esphome/components/tcs34725/tcs34725.cpp +354 -0
- esphome/components/tcs34725/tcs34725.h +90 -0
- esphome/components/tee501/__init__.py +0 -0
- esphome/components/tee501/sensor.py +36 -0
- esphome/components/tee501/tee501.cpp +85 -0
- esphome/components/tee501/tee501.h +25 -0
- esphome/components/teleinfo/__init__.py +40 -0
- esphome/components/teleinfo/sensor/__init__.py +28 -0
- esphome/components/teleinfo/sensor/teleinfo_sensor.cpp +14 -0
- esphome/components/teleinfo/sensor/teleinfo_sensor.h +16 -0
- esphome/components/teleinfo/teleinfo.cpp +209 -0
- esphome/components/teleinfo/teleinfo.h +54 -0
- esphome/components/teleinfo/text_sensor/__init__.py +21 -0
- esphome/components/teleinfo/text_sensor/teleinfo_text_sensor.cpp +11 -0
- esphome/components/teleinfo/text_sensor/teleinfo_text_sensor.h +13 -0
- esphome/components/tem3200/__init__.py +0 -0
- esphome/components/tem3200/sensor.py +55 -0
- esphome/components/tem3200/tem3200.cpp +151 -0
- esphome/components/tem3200/tem3200.h +30 -0
- esphome/components/template/__init__.py +3 -0
- esphome/components/template/alarm_control_panel/__init__.py +159 -0
- esphome/components/template/alarm_control_panel/template_alarm_control_panel.cpp +266 -0
- esphome/components/template/alarm_control_panel/template_alarm_control_panel.h +155 -0
- esphome/components/template/binary_sensor/__init__.py +62 -0
- esphome/components/template/binary_sensor/template_binary_sensor.cpp +31 -0
- esphome/components/template/binary_sensor/template_binary_sensor.h +24 -0
- esphome/components/template/button/__init__.py +11 -0
- esphome/components/template/button/template_button.h +15 -0
- esphome/components/template/cover/__init__.py +139 -0
- esphome/components/template/cover/template_cover.cpp +141 -0
- esphome/components/template/cover/template_cover.h +66 -0
- esphome/components/template/datetime/__init__.py +151 -0
- esphome/components/template/datetime/template_date.cpp +111 -0
- esphome/components/template/datetime/template_date.h +46 -0
- esphome/components/template/datetime/template_datetime.cpp +150 -0
- esphome/components/template/datetime/template_datetime.h +46 -0
- esphome/components/template/datetime/template_time.cpp +111 -0
- esphome/components/template/datetime/template_time.h +46 -0
- esphome/components/template/event/__init__.py +24 -0
- esphome/components/template/event/template_event.h +12 -0
- esphome/components/template/fan/__init__.py +43 -0
- esphome/components/template/fan/template_fan.cpp +38 -0
- esphome/components/template/fan/template_fan.h +33 -0
- esphome/components/template/lock/__init__.py +103 -0
- esphome/components/template/lock/template_lock.cpp +59 -0
- esphome/components/template/lock/template_lock.h +38 -0
- esphome/components/template/number/__init__.py +93 -0
- esphome/components/template/number/template_number.cpp +56 -0
- esphome/components/template/number/template_number.h +37 -0
- esphome/components/template/output/__init__.py +47 -0
- esphome/components/template/output/template_output.h +31 -0
- esphome/components/template/select/__init__.py +84 -0
- esphome/components/template/select/template_select.cpp +75 -0
- esphome/components/template/select/template_select.h +37 -0
- esphome/components/template/sensor/__init__.py +56 -0
- esphome/components/template/sensor/template_sensor.cpp +27 -0
- esphome/components/template/sensor/template_sensor.h +24 -0
- esphome/components/template/switch/__init__.py +92 -0
- esphome/components/template/switch/template_switch.cpp +62 -0
- esphome/components/template/switch/template_switch.h +40 -0
- esphome/components/template/text/__init__.py +92 -0
- esphome/components/template/text/template_text.cpp +64 -0
- esphome/components/template/text/template_text.h +87 -0
- esphome/components/template/text_sensor/__init__.py +51 -0
- esphome/components/template/text_sensor/template_text_sensor.cpp +23 -0
- esphome/components/template/text_sensor/template_text_sensor.h +25 -0
- esphome/components/template/valve/__init__.py +118 -0
- esphome/components/template/valve/template_valve.cpp +131 -0
- esphome/components/template/valve/template_valve.h +60 -0
- esphome/components/text/__init__.py +146 -0
- esphome/components/text/automation.h +33 -0
- esphome/components/text/text.cpp +26 -0
- esphome/components/text/text.h +55 -0
- esphome/components/text/text_call.cpp +56 -0
- esphome/components/text/text_call.h +25 -0
- esphome/components/text/text_traits.h +39 -0
- esphome/components/text_sensor/__init__.py +253 -0
- esphome/components/text_sensor/automation.h +50 -0
- esphome/components/text_sensor/filter.cpp +81 -0
- esphome/components/text_sensor/filter.h +124 -0
- esphome/components/text_sensor/text_sensor.cpp +72 -0
- esphome/components/text_sensor/text_sensor.h +84 -0
- esphome/components/thermostat/__init__.py +0 -0
- esphome/components/thermostat/climate.py +951 -0
- esphome/components/thermostat/thermostat_climate.cpp +1404 -0
- esphome/components/thermostat/thermostat_climate.h +475 -0
- esphome/components/time/__init__.py +346 -0
- esphome/components/time/automation.cpp +96 -0
- esphome/components/time/automation.h +52 -0
- esphome/components/time/real_time_clock.cpp +62 -0
- esphome/components/time/real_time_clock.h +64 -0
- esphome/components/time_based/__init__.py +0 -0
- esphome/components/time_based/cover.py +57 -0
- esphome/components/time_based/time_based_cover.cpp +183 -0
- esphome/components/time_based/time_based_cover.h +55 -0
- esphome/components/tlc59208f/__init__.py +26 -0
- esphome/components/tlc59208f/output.py +26 -0
- esphome/components/tlc59208f/tlc59208f_output.cpp +156 -0
- esphome/components/tlc59208f/tlc59208f_output.h +69 -0
- esphome/components/tlc5947/__init__.py +49 -0
- esphome/components/tlc5947/output/__init__.py +27 -0
- esphome/components/tlc5947/output/tlc5947_output.cpp +12 -0
- esphome/components/tlc5947/output/tlc5947_output.h +22 -0
- esphome/components/tlc5947/tlc5947.cpp +73 -0
- esphome/components/tlc5947/tlc5947.h +46 -0
- esphome/components/tlc5971/__init__.py +40 -0
- esphome/components/tlc5971/output/__init__.py +27 -0
- esphome/components/tlc5971/output/tlc5971_output.cpp +12 -0
- esphome/components/tlc5971/output/tlc5971_output.h +22 -0
- esphome/components/tlc5971/tlc5971.cpp +101 -0
- esphome/components/tlc5971/tlc5971.h +43 -0
- esphome/components/tm1621/__init__.py +1 -0
- esphome/components/tm1621/display.py +46 -0
- esphome/components/tm1621/tm1621.cpp +283 -0
- esphome/components/tm1621/tm1621.h +74 -0
- esphome/components/tm1637/__init__.py +0 -0
- esphome/components/tm1637/binary_sensor.py +25 -0
- esphome/components/tm1637/display.py +52 -0
- esphome/components/tm1637/tm1637.cpp +382 -0
- esphome/components/tm1637/tm1637.h +102 -0
- esphome/components/tm1638/__init__.py +0 -0
- esphome/components/tm1638/binary_sensor/__init__.py +22 -0
- esphome/components/tm1638/binary_sensor/tm1638_key.cpp +13 -0
- esphome/components/tm1638/binary_sensor/tm1638_key.h +19 -0
- esphome/components/tm1638/display.py +54 -0
- esphome/components/tm1638/output/__init__.py +26 -0
- esphome/components/tm1638/output/tm1638_output_led.cpp +17 -0
- esphome/components/tm1638/output/tm1638_output_led.h +25 -0
- esphome/components/tm1638/sevenseg.h +107 -0
- esphome/components/tm1638/switch/__init__.py +25 -0
- esphome/components/tm1638/switch/tm1638_switch_led.cpp +20 -0
- esphome/components/tm1638/switch/tm1638_switch_led.h +23 -0
- esphome/components/tm1638/tm1638.cpp +286 -0
- esphome/components/tm1638/tm1638.h +78 -0
- esphome/components/tm1651/__init__.py +139 -0
- esphome/components/tm1651/tm1651.cpp +94 -0
- esphome/components/tm1651/tm1651.h +96 -0
- esphome/components/tmp102/__init__.py +9 -0
- esphome/components/tmp102/sensor.py +44 -0
- esphome/components/tmp102/tmp102.cpp +54 -0
- esphome/components/tmp102/tmp102.h +22 -0
- esphome/components/tmp1075/__init__.py +1 -0
- esphome/components/tmp1075/sensor.py +92 -0
- esphome/components/tmp1075/tmp1075.cpp +129 -0
- esphome/components/tmp1075/tmp1075.h +92 -0
- esphome/components/tmp117/__init__.py +0 -0
- esphome/components/tmp117/sensor.py +80 -0
- esphome/components/tmp117/tmp117.cpp +76 -0
- esphome/components/tmp117/tmp117.h +27 -0
- esphome/components/tof10120/__init__.py +0 -0
- esphome/components/tof10120/sensor.py +34 -0
- esphome/components/tof10120/tof10120_sensor.cpp +60 -0
- esphome/components/tof10120/tof10120_sensor.h +19 -0
- esphome/components/toshiba/__init__.py +0 -0
- esphome/components/toshiba/climate.py +30 -0
- esphome/components/toshiba/toshiba.cpp +768 -0
- esphome/components/toshiba/toshiba.h +64 -0
- esphome/components/total_daily_energy/__init__.py +0 -0
- esphome/components/total_daily_energy/sensor.py +92 -0
- esphome/components/total_daily_energy/total_daily_energy.cpp +75 -0
- esphome/components/total_daily_energy/total_daily_energy.h +46 -0
- esphome/components/touchscreen/__init__.py +158 -0
- esphome/components/touchscreen/binary_sensor/__init__.py +83 -0
- esphome/components/touchscreen/binary_sensor/touchscreen_binary_sensor.cpp +28 -0
- esphome/components/touchscreen/binary_sensor/touchscreen_binary_sensor.h +46 -0
- esphome/components/touchscreen/touchscreen.cpp +165 -0
- esphome/components/touchscreen/touchscreen.h +119 -0
- esphome/components/tsl2561/__init__.py +0 -0
- esphome/components/tsl2561/sensor.py +69 -0
- esphome/components/tsl2561/tsl2561.cpp +164 -0
- esphome/components/tsl2561/tsl2561.h +87 -0
- esphome/components/tsl2591/__init__.py +1 -0
- esphome/components/tsl2591/sensor.py +172 -0
- esphome/components/tsl2591/tsl2591.cpp +482 -0
- esphome/components/tsl2591/tsl2591.h +276 -0
- esphome/components/tt21100/__init__.py +5 -0
- esphome/components/tt21100/binary_sensor/__init__.py +31 -0
- esphome/components/tt21100/binary_sensor/tt21100_button.cpp +27 -0
- esphome/components/tt21100/binary_sensor/tt21100_button.h +28 -0
- esphome/components/tt21100/touchscreen/__init__.py +41 -0
- esphome/components/tt21100/touchscreen/tt21100.cpp +145 -0
- esphome/components/tt21100/touchscreen/tt21100.h +43 -0
- esphome/components/ttp229_bsf/__init__.py +30 -0
- esphome/components/ttp229_bsf/binary_sensor.py +23 -0
- esphome/components/ttp229_bsf/ttp229_bsf.cpp +23 -0
- esphome/components/ttp229_bsf/ttp229_bsf.h +56 -0
- esphome/components/ttp229_lsf/__init__.py +31 -0
- esphome/components/ttp229_lsf/binary_sensor.py +23 -0
- esphome/components/ttp229_lsf/ttp229_lsf.cpp +45 -0
- esphome/components/ttp229_lsf/ttp229_lsf.h +38 -0
- esphome/components/tuya/__init__.py +133 -0
- esphome/components/tuya/automation.cpp +67 -0
- esphome/components/tuya/automation.h +55 -0
- esphome/components/tuya/binary_sensor/__init__.py +34 -0
- esphome/components/tuya/binary_sensor/tuya_binary_sensor.cpp +22 -0
- esphome/components/tuya/binary_sensor/tuya_binary_sensor.h +24 -0
- esphome/components/tuya/climate/__init__.py +274 -0
- esphome/components/tuya/climate/tuya_climate.cpp +492 -0
- esphome/components/tuya/climate/tuya_climate.h +128 -0
- esphome/components/tuya/cover/__init__.py +79 -0
- esphome/components/tuya/cover/tuya_cover.cpp +140 -0
- esphome/components/tuya/cover/tuya_cover.h +50 -0
- esphome/components/tuya/fan/__init__.py +45 -0
- esphome/components/tuya/fan/tuya_fan.cpp +107 -0
- esphome/components/tuya/fan/tuya_fan.h +36 -0
- esphome/components/tuya/light/__init__.py +122 -0
- esphome/components/tuya/light/tuya_light.cpp +224 -0
- esphome/components/tuya/light/tuya_light.h +71 -0
- esphome/components/tuya/number/__init__.py +95 -0
- esphome/components/tuya/number/tuya_number.cpp +95 -0
- esphome/components/tuya/number/tuya_number.h +38 -0
- esphome/components/tuya/select/__init__.py +50 -0
- esphome/components/tuya/select/tuya_select.cpp +52 -0
- esphome/components/tuya/select/tuya_select.h +32 -0
- esphome/components/tuya/sensor/__init__.py +32 -0
- esphome/components/tuya/sensor/tuya_sensor.cpp +34 -0
- esphome/components/tuya/sensor/tuya_sensor.h +24 -0
- esphome/components/tuya/switch/__init__.py +31 -0
- esphome/components/tuya/switch/tuya_switch.cpp +28 -0
- esphome/components/tuya/switch/tuya_switch.h +26 -0
- esphome/components/tuya/text_sensor/__init__.py +32 -0
- esphome/components/tuya/text_sensor/tuya_text_sensor.cpp +41 -0
- esphome/components/tuya/text_sensor/tuya_text_sensor.h +24 -0
- esphome/components/tuya/tuya.cpp +714 -0
- esphome/components/tuya/tuya.h +166 -0
- esphome/components/tx20/__init__.py +0 -0
- esphome/components/tx20/sensor.py +54 -0
- esphome/components/tx20/tx20.cpp +197 -0
- esphome/components/tx20/tx20.h +52 -0
- esphome/components/uart/__init__.py +440 -0
- esphome/components/uart/automation.h +38 -0
- esphome/components/uart/button/__init__.py +35 -0
- esphome/components/uart/button/uart_button.cpp +17 -0
- esphome/components/uart/button/uart_button.h +24 -0
- esphome/components/uart/switch/__init__.py +58 -0
- esphome/components/uart/switch/uart_switch.cpp +61 -0
- esphome/components/uart/switch/uart_switch.h +35 -0
- esphome/components/uart/uart.cpp +47 -0
- esphome/components/uart/uart.h +72 -0
- esphome/components/uart/uart_component.cpp +24 -0
- esphome/components/uart/uart_component.h +175 -0
- esphome/components/uart/uart_component_esp32_arduino.cpp +213 -0
- esphome/components/uart/uart_component_esp32_arduino.h +60 -0
- esphome/components/uart/uart_component_esp8266.cpp +320 -0
- esphome/components/uart/uart_component_esp8266.h +94 -0
- esphome/components/uart/uart_component_esp_idf.cpp +248 -0
- esphome/components/uart/uart_component_esp_idf.h +58 -0
- esphome/components/uart/uart_component_host.cpp +299 -0
- esphome/components/uart/uart_component_host.h +38 -0
- esphome/components/uart/uart_component_libretiny.cpp +168 -0
- esphome/components/uart/uart_component_libretiny.h +43 -0
- esphome/components/uart/uart_component_rp2040.cpp +184 -0
- esphome/components/uart/uart_component_rp2040.h +46 -0
- esphome/components/uart/uart_debugger.cpp +202 -0
- esphome/components/uart/uart_debugger.h +101 -0
- esphome/components/udp/__init__.py +158 -0
- esphome/components/udp/binary_sensor.py +27 -0
- esphome/components/udp/sensor.py +27 -0
- esphome/components/udp/udp_component.cpp +635 -0
- esphome/components/udp/udp_component.h +160 -0
- esphome/components/ufire_ec/__init__.py +1 -0
- esphome/components/ufire_ec/sensor.py +126 -0
- esphome/components/ufire_ec/ufire_ec.cpp +118 -0
- esphome/components/ufire_ec/ufire_ec.h +87 -0
- esphome/components/ufire_ise/__init__.py +1 -0
- esphome/components/ufire_ise/sensor.py +127 -0
- esphome/components/ufire_ise/ufire_ise.cpp +153 -0
- esphome/components/ufire_ise/ufire_ise.h +95 -0
- esphome/components/uln2003/__init__.py +0 -0
- esphome/components/uln2003/stepper.py +56 -0
- esphome/components/uln2003/uln2003.cpp +92 -0
- esphome/components/uln2003/uln2003.h +44 -0
- esphome/components/ultrasonic/__init__.py +1 -0
- esphome/components/ultrasonic/sensor.py +53 -0
- esphome/components/ultrasonic/ultrasonic_sensor.cpp +63 -0
- esphome/components/ultrasonic/ultrasonic_sensor.h +46 -0
- esphome/components/update/__init__.py +132 -0
- esphome/components/update/automation.h +23 -0
- esphome/components/update/update_entity.cpp +38 -0
- esphome/components/update/update_entity.h +53 -0
- esphome/components/uponor_smatrix/__init__.py +78 -0
- esphome/components/uponor_smatrix/climate/__init__.py +33 -0
- esphome/components/uponor_smatrix/climate/uponor_smatrix_climate.cpp +101 -0
- esphome/components/uponor_smatrix/climate/uponor_smatrix_climate.h +28 -0
- esphome/components/uponor_smatrix/sensor/__init__.py +70 -0
- esphome/components/uponor_smatrix/sensor/uponor_smatrix_sensor.cpp +37 -0
- esphome/components/uponor_smatrix/sensor/uponor_smatrix_sensor.h +23 -0
- esphome/components/uponor_smatrix/uponor_smatrix.cpp +227 -0
- esphome/components/uponor_smatrix/uponor_smatrix.h +129 -0
- esphome/components/uptime/__init__.py +0 -0
- esphome/components/uptime/sensor.py +61 -0
- esphome/components/uptime/uptime_seconds_sensor.cpp +38 -0
- esphome/components/uptime/uptime_seconds_sensor.h +23 -0
- esphome/components/uptime/uptime_timestamp_sensor.cpp +39 -0
- esphome/components/uptime/uptime_timestamp_sensor.h +30 -0
- esphome/components/valve/__init__.py +204 -0
- esphome/components/valve/automation.h +129 -0
- esphome/components/valve/valve.cpp +179 -0
- esphome/components/valve/valve.h +152 -0
- esphome/components/valve/valve_traits.h +27 -0
- esphome/components/vbus/__init__.py +33 -0
- esphome/components/vbus/binary_sensor/__init__.py +348 -0
- esphome/components/vbus/binary_sensor/vbus_binary_sensor.cpp +165 -0
- esphome/components/vbus/binary_sensor/vbus_binary_sensor.h +136 -0
- esphome/components/vbus/sensor/__init__.py +690 -0
- esphome/components/vbus/sensor/vbus_sensor.cpp +250 -0
- esphome/components/vbus/sensor/vbus_sensor.h +182 -0
- esphome/components/vbus/vbus.cpp +125 -0
- esphome/components/vbus/vbus.h +52 -0
- esphome/components/veml3235/__init__.py +0 -0
- esphome/components/veml3235/sensor.py +84 -0
- esphome/components/veml3235/veml3235.cpp +230 -0
- esphome/components/veml3235/veml3235.h +109 -0
- esphome/components/veml7700/__init__.py +1 -0
- esphome/components/veml7700/sensor.py +190 -0
- esphome/components/veml7700/veml7700.cpp +437 -0
- esphome/components/veml7700/veml7700.h +202 -0
- esphome/components/version/__init__.py +1 -0
- esphome/components/version/text_sensor.py +33 -0
- esphome/components/version/version_text_sensor.cpp +24 -0
- esphome/components/version/version_text_sensor.h +22 -0
- esphome/components/vl53l0x/LICENSE.txt +80 -0
- esphome/components/vl53l0x/__init__.py +0 -0
- esphome/components/vl53l0x/sensor.py +76 -0
- esphome/components/vl53l0x/vl53l0x_sensor.cpp +534 -0
- esphome/components/vl53l0x/vl53l0x_sensor.h +75 -0
- esphome/components/voice_assistant/__init__.py +398 -0
- esphome/components/voice_assistant/voice_assistant.cpp +894 -0
- esphome/components/voice_assistant/voice_assistant.h +341 -0
- esphome/components/voltage_sampler/__init__.py +4 -0
- esphome/components/voltage_sampler/voltage_sampler.h +16 -0
- esphome/components/wake_on_lan/__init__.py +1 -0
- esphome/components/wake_on_lan/button.py +37 -0
- esphome/components/wake_on_lan/wake_on_lan.cpp +89 -0
- esphome/components/wake_on_lan/wake_on_lan.h +36 -0
- esphome/components/watchdog/__init__.py +1 -0
- esphome/components/watchdog/watchdog.cpp +74 -0
- esphome/components/watchdog/watchdog.h +24 -0
- esphome/components/waveshare_epaper/__init__.py +1 -0
- esphome/components/waveshare_epaper/display.py +234 -0
- esphome/components/waveshare_epaper/waveshare_213v3.cpp +186 -0
- esphome/components/waveshare_epaper/waveshare_epaper.cpp +3241 -0
- esphome/components/waveshare_epaper/waveshare_epaper.h +853 -0
- esphome/components/web_server/__init__.py +299 -0
- esphome/components/web_server/list_entities.cpp +192 -0
- esphome/components/web_server/list_entities.h +82 -0
- esphome/components/web_server/server_index_v2.h +646 -0
- esphome/components/web_server/server_index_v3.h +4030 -0
- esphome/components/web_server/web_server.cpp +1869 -0
- esphome/components/web_server/web_server.h +382 -0
- esphome/components/web_server/web_server_v1.cpp +217 -0
- esphome/components/web_server_base/__init__.py +40 -0
- esphome/components/web_server_base/web_server_base.cpp +125 -0
- esphome/components/web_server_base/web_server_base.h +149 -0
- esphome/components/web_server_idf/__init__.py +14 -0
- esphome/components/web_server_idf/utils.cpp +93 -0
- esphome/components/web_server_idf/utils.h +17 -0
- esphome/components/web_server_idf/web_server_idf.cpp +371 -0
- esphome/components/web_server_idf/web_server_idf.h +285 -0
- esphome/components/weikai/__init__.py +108 -0
- esphome/components/weikai/weikai.cpp +615 -0
- esphome/components/weikai/weikai.h +443 -0
- esphome/components/weikai/wk_reg_def.h +304 -0
- esphome/components/weikai_i2c/__init__.py +1 -0
- esphome/components/weikai_i2c/weikai_i2c.cpp +177 -0
- esphome/components/weikai_i2c/weikai_i2c.h +61 -0
- esphome/components/weikai_spi/__init__.py +1 -0
- esphome/components/weikai_spi/weikai_spi.cpp +189 -0
- esphome/components/weikai_spi/weikai_spi.h +54 -0
- esphome/components/whirlpool/__init__.py +0 -0
- esphome/components/whirlpool/climate.py +29 -0
- esphome/components/whirlpool/whirlpool.cpp +296 -0
- esphome/components/whirlpool/whirlpool.h +65 -0
- esphome/components/whynter/__init__.py +1 -0
- esphome/components/whynter/climate.py +23 -0
- esphome/components/whynter/whynter.cpp +181 -0
- esphome/components/whynter/whynter.h +53 -0
- esphome/components/wiegand/__init__.py +77 -0
- esphome/components/wiegand/wiegand.cpp +127 -0
- esphome/components/wiegand/wiegand.h +54 -0
- esphome/components/wifi/__init__.py +527 -0
- esphome/components/wifi/wifi_component.cpp +860 -0
- esphome/components/wifi/wifi_component.h +527 -0
- esphome/components/wifi/wifi_component_esp32_arduino.cpp +827 -0
- esphome/components/wifi/wifi_component_esp8266.cpp +854 -0
- esphome/components/wifi/wifi_component_esp_idf.cpp +1029 -0
- esphome/components/wifi/wifi_component_libretiny.cpp +486 -0
- esphome/components/wifi/wifi_component_pico_w.cpp +222 -0
- esphome/components/wifi/wpa2_eap.py +152 -0
- esphome/components/wifi_info/__init__.py +0 -0
- esphome/components/wifi_info/text_sensor.py +88 -0
- esphome/components/wifi_info/wifi_info_text_sensor.cpp +19 -0
- esphome/components/wifi_info/wifi_info_text_sensor.h +135 -0
- esphome/components/wifi_signal/__init__.py +0 -0
- esphome/components/wifi_signal/sensor.py +29 -0
- esphome/components/wifi_signal/wifi_signal_sensor.cpp +14 -0
- esphome/components/wifi_signal/wifi_signal_sensor.h +22 -0
- esphome/components/wireguard/__init__.py +184 -0
- esphome/components/wireguard/binary_sensor.py +36 -0
- esphome/components/wireguard/sensor.py +29 -0
- esphome/components/wireguard/text_sensor.py +26 -0
- esphome/components/wireguard/wireguard.cpp +292 -0
- esphome/components/wireguard/wireguard.h +174 -0
- esphome/components/wk2132_i2c/__init__.py +30 -0
- esphome/components/wk2132_i2c/wk2132_i2c.cpp +4 -0
- esphome/components/wk2132_spi/__init__.py +31 -0
- esphome/components/wk2168_i2c/__init__.py +64 -0
- esphome/components/wk2168_spi/__init__.py +62 -0
- esphome/components/wk2204_i2c/__init__.py +30 -0
- esphome/components/wk2204_spi/__init__.py +30 -0
- esphome/components/wk2212_i2c/__init__.py +64 -0
- esphome/components/wk2212_spi/__init__.py +62 -0
- esphome/components/wl_134/__init__.py +0 -0
- esphome/components/wl_134/text_sensor.py +31 -0
- esphome/components/wl_134/wl_134.cpp +113 -0
- esphome/components/wl_134/wl_134.h +63 -0
- esphome/components/wled/__init__.py +30 -0
- esphome/components/wled/wled_light_effect.cpp +287 -0
- esphome/components/wled/wled_light_effect.h +47 -0
- esphome/components/x9c/__init__.py +0 -0
- esphome/components/x9c/output.py +55 -0
- esphome/components/x9c/x9c.cpp +77 -0
- esphome/components/x9c/x9c.h +34 -0
- esphome/components/xgzp68xx/__init__.py +1 -0
- esphome/components/xgzp68xx/sensor.py +62 -0
- esphome/components/xgzp68xx/xgzp68xx.cpp +93 -0
- esphome/components/xgzp68xx/xgzp68xx.h +27 -0
- esphome/components/xiaomi_ble/__init__.py +22 -0
- esphome/components/xiaomi_ble/xiaomi_ble.cpp +398 -0
- esphome/components/xiaomi_ble/xiaomi_ble.h +83 -0
- esphome/components/xiaomi_cgd1/__init__.py +0 -0
- esphome/components/xiaomi_cgd1/sensor.py +76 -0
- esphome/components/xiaomi_cgd1/xiaomi_cgd1.cpp +73 -0
- esphome/components/xiaomi_cgd1/xiaomi_cgd1.h +36 -0
- esphome/components/xiaomi_cgdk2/__init__.py +0 -0
- esphome/components/xiaomi_cgdk2/sensor.py +76 -0
- esphome/components/xiaomi_cgdk2/xiaomi_cgdk2.cpp +73 -0
- esphome/components/xiaomi_cgdk2/xiaomi_cgdk2.h +36 -0
- esphome/components/xiaomi_cgg1/__init__.py +0 -0
- esphome/components/xiaomi_cgg1/sensor.py +77 -0
- esphome/components/xiaomi_cgg1/xiaomi_cgg1.cpp +73 -0
- esphome/components/xiaomi_cgg1/xiaomi_cgg1.h +37 -0
- esphome/components/xiaomi_cgpr1/__init__.py +0 -0
- esphome/components/xiaomi_cgpr1/binary_sensor.py +77 -0
- esphome/components/xiaomi_cgpr1/xiaomi_cgpr1.cpp +75 -0
- esphome/components/xiaomi_cgpr1/xiaomi_cgpr1.h +40 -0
- esphome/components/xiaomi_gcls002/__init__.py +0 -0
- esphome/components/xiaomi_gcls002/sensor.py +84 -0
- esphome/components/xiaomi_gcls002/xiaomi_gcls002.cpp +62 -0
- esphome/components/xiaomi_gcls002/xiaomi_gcls002.h +37 -0
- esphome/components/xiaomi_hhccjcy01/__init__.py +0 -0
- esphome/components/xiaomi_hhccjcy01/sensor.py +97 -0
- esphome/components/xiaomi_hhccjcy01/xiaomi_hhccjcy01.cpp +65 -0
- esphome/components/xiaomi_hhccjcy01/xiaomi_hhccjcy01.h +39 -0
- esphome/components/xiaomi_hhccjcy10/__init__.py +1 -0
- esphome/components/xiaomi_hhccjcy10/sensor.py +96 -0
- esphome/components/xiaomi_hhccjcy10/xiaomi_hhccjcy10.cpp +68 -0
- esphome/components/xiaomi_hhccjcy10/xiaomi_hhccjcy10.h +38 -0
- esphome/components/xiaomi_hhccpot002/__init__.py +0 -0
- esphome/components/xiaomi_hhccpot002/sensor.py +60 -0
- esphome/components/xiaomi_hhccpot002/xiaomi_hhccpot002.cpp +56 -0
- esphome/components/xiaomi_hhccpot002/xiaomi_hhccpot002.h +33 -0
- esphome/components/xiaomi_jqjcy01ym/__init__.py +0 -0
- esphome/components/xiaomi_jqjcy01ym/sensor.py +85 -0
- esphome/components/xiaomi_jqjcy01ym/xiaomi_jqjcy01ym.cpp +62 -0
- esphome/components/xiaomi_jqjcy01ym/xiaomi_jqjcy01ym.h +37 -0
- esphome/components/xiaomi_lywsd02/__init__.py +0 -0
- esphome/components/xiaomi_lywsd02/sensor.py +73 -0
- esphome/components/xiaomi_lywsd02/xiaomi_lywsd02.cpp +59 -0
- esphome/components/xiaomi_lywsd02/xiaomi_lywsd02.h +35 -0
- esphome/components/xiaomi_lywsd02mmc/__init__.py +0 -0
- esphome/components/xiaomi_lywsd02mmc/sensor.py +77 -0
- esphome/components/xiaomi_lywsd02mmc/xiaomi_lywsd02mmc.cpp +73 -0
- esphome/components/xiaomi_lywsd02mmc/xiaomi_lywsd02mmc.h +37 -0
- esphome/components/xiaomi_lywsd03mmc/__init__.py +0 -0
- esphome/components/xiaomi_lywsd03mmc/sensor.py +78 -0
- esphome/components/xiaomi_lywsd03mmc/xiaomi_lywsd03mmc.cpp +77 -0
- esphome/components/xiaomi_lywsd03mmc/xiaomi_lywsd03mmc.h +36 -0
- esphome/components/xiaomi_lywsdcgq/__init__.py +0 -0
- esphome/components/xiaomi_lywsdcgq/sensor.py +73 -0
- esphome/components/xiaomi_lywsdcgq/xiaomi_lywsdcgq.cpp +59 -0
- esphome/components/xiaomi_lywsdcgq/xiaomi_lywsdcgq.h +35 -0
- esphome/components/xiaomi_mhoc303/__init__.py +1 -0
- esphome/components/xiaomi_mhoc303/sensor.py +73 -0
- esphome/components/xiaomi_mhoc303/xiaomi_mhoc303.cpp +59 -0
- esphome/components/xiaomi_mhoc303/xiaomi_mhoc303.h +35 -0
- esphome/components/xiaomi_mhoc401/__init__.py +0 -0
- esphome/components/xiaomi_mhoc401/sensor.py +77 -0
- esphome/components/xiaomi_mhoc401/xiaomi_mhoc401.cpp +77 -0
- esphome/components/xiaomi_mhoc401/xiaomi_mhoc401.h +36 -0
- esphome/components/xiaomi_miscale/__init__.py +0 -0
- esphome/components/xiaomi_miscale/sensor.py +62 -0
- esphome/components/xiaomi_miscale/xiaomi_miscale.cpp +169 -0
- esphome/components/xiaomi_miscale/xiaomi_miscale.h +47 -0
- esphome/components/xiaomi_miscale2/__init__.py +0 -0
- esphome/components/xiaomi_miscale2/sensor.py +5 -0
- esphome/components/xiaomi_mjyd02yla/__init__.py +0 -0
- esphome/components/xiaomi_mjyd02yla/binary_sensor.py +89 -0
- esphome/components/xiaomi_mjyd02yla/xiaomi_mjyd02yla.cpp +78 -0
- esphome/components/xiaomi_mjyd02yla/xiaomi_mjyd02yla.h +42 -0
- esphome/components/xiaomi_mue4094rt/__init__.py +0 -0
- esphome/components/xiaomi_mue4094rt/binary_sensor.py +45 -0
- esphome/components/xiaomi_mue4094rt/xiaomi_mue4094rt.cpp +55 -0
- esphome/components/xiaomi_mue4094rt/xiaomi_mue4094rt.h +33 -0
- esphome/components/xiaomi_rtcgq02lm/__init__.py +36 -0
- esphome/components/xiaomi_rtcgq02lm/binary_sensor.py +63 -0
- esphome/components/xiaomi_rtcgq02lm/sensor.py +37 -0
- esphome/components/xiaomi_rtcgq02lm/xiaomi_rtcgq02lm.cpp +91 -0
- esphome/components/xiaomi_rtcgq02lm/xiaomi_rtcgq02lm.h +61 -0
- esphome/components/xiaomi_wx08zm/__init__.py +0 -0
- esphome/components/xiaomi_wx08zm/binary_sensor.py +64 -0
- esphome/components/xiaomi_wx08zm/xiaomi_wx08zm.cpp +60 -0
- esphome/components/xiaomi_wx08zm/xiaomi_wx08zm.h +36 -0
- esphome/components/xl9535/__init__.py +79 -0
- esphome/components/xl9535/xl9535.cpp +122 -0
- esphome/components/xl9535/xl9535.h +54 -0
- esphome/components/xpt2046/__init__.py +5 -0
- esphome/components/xpt2046/touchscreen/__init__.py +43 -0
- esphome/components/xpt2046/touchscreen/xpt2046.cpp +112 -0
- esphome/components/xpt2046/touchscreen/xpt2046.h +41 -0
- esphome/components/yashima/__init__.py +0 -0
- esphome/components/yashima/climate.py +39 -0
- esphome/components/yashima/yashima.cpp +197 -0
- esphome/components/yashima/yashima.h +40 -0
- esphome/components/zhlt01/__init__.py +0 -0
- esphome/components/zhlt01/climate.py +19 -0
- esphome/components/zhlt01/zhlt01.cpp +238 -0
- esphome/components/zhlt01/zhlt01.h +167 -0
- esphome/components/zio_ultrasonic/__init__.py +0 -0
- esphome/components/zio_ultrasonic/sensor.py +34 -0
- esphome/components/zio_ultrasonic/zio_ultrasonic.cpp +31 -0
- esphome/components/zio_ultrasonic/zio_ultrasonic.h +22 -0
- esphome/components/zyaura/__init__.py +0 -0
- esphome/components/zyaura/sensor.py +71 -0
- esphome/components/zyaura/zyaura.cpp +125 -0
- esphome/components/zyaura/zyaura.h +86 -0
- esphome/config.py +1124 -0
- esphome/config_helpers.py +105 -0
- esphome/config_validation.py +2223 -0
- esphome/const.py +1232 -0
- esphome/core/__init__.py +868 -0
- esphome/core/application.cpp +155 -0
- esphome/core/application.h +555 -0
- esphome/core/automation.h +255 -0
- esphome/core/base_automation.h +407 -0
- esphome/core/color.cpp +11 -0
- esphome/core/color.h +177 -0
- esphome/core/component.cpp +243 -0
- esphome/core/component.h +332 -0
- esphome/core/component_iterator.cpp +395 -0
- esphome/core/component_iterator.h +174 -0
- esphome/core/config.py +407 -0
- esphome/core/controller.cpp +132 -0
- esphome/core/controller.h +135 -0
- esphome/core/datatypes.h +61 -0
- esphome/core/defines.h +177 -0
- esphome/core/entity_base.cpp +96 -0
- esphome/core/entity_base.h +88 -0
- esphome/core/entity_helpers.py +56 -0
- esphome/core/gpio.h +99 -0
- esphome/core/hal.h +48 -0
- esphome/core/helpers.cpp +786 -0
- esphome/core/helpers.h +751 -0
- esphome/core/log.cpp +62 -0
- esphome/core/log.h +198 -0
- esphome/core/macros.h +4 -0
- esphome/core/optional.h +215 -0
- esphome/core/preferences.h +70 -0
- esphome/core/ring_buffer.cpp +127 -0
- esphome/core/ring_buffer.h +98 -0
- esphome/core/scheduler.cpp +364 -0
- esphome/core/scheduler.h +84 -0
- esphome/core/string_ref.cpp +12 -0
- esphome/core/string_ref.h +135 -0
- esphome/core/time.cpp +243 -0
- esphome/core/time.h +118 -0
- esphome/core/util.cpp +37 -0
- esphome/core/util.h +15 -0
- esphome/core/version.h +12 -0
- esphome/coroutine.py +253 -0
- esphome/cpp_generator.py +1034 -0
- esphome/cpp_helpers.py +148 -0
- esphome/cpp_types.py +43 -0
- esphome/dashboard/__init__.py +0 -0
- esphome/dashboard/const.py +12 -0
- esphome/dashboard/core.py +179 -0
- esphome/dashboard/dashboard.py +153 -0
- esphome/dashboard/dns.py +43 -0
- esphome/dashboard/entries.py +397 -0
- esphome/dashboard/enum.py +20 -0
- esphome/dashboard/settings.py +93 -0
- esphome/dashboard/status/__init__.py +0 -0
- esphome/dashboard/status/mdns.py +97 -0
- esphome/dashboard/status/mqtt.py +67 -0
- esphome/dashboard/status/ping.py +107 -0
- esphome/dashboard/util/__init__.py +0 -0
- esphome/dashboard/util/file.py +63 -0
- esphome/dashboard/util/itertools.py +22 -0
- esphome/dashboard/util/password.py +11 -0
- esphome/dashboard/util/subprocess.py +31 -0
- esphome/dashboard/util/text.py +25 -0
- esphome/dashboard/web_server.py +1231 -0
- esphome/espota2.py +360 -0
- esphome/external_files.py +107 -0
- esphome/final_validate.py +58 -0
- esphome/git.py +175 -0
- esphome/helpers.py +422 -0
- esphome/loader.py +207 -0
- esphome/log.py +90 -0
- esphome/mqtt.py +285 -0
- esphome/pins.py +334 -0
- esphome/platformio_api.py +334 -0
- esphome/schema_extractors.py +93 -0
- esphome/storage_json.py +286 -0
- esphome/types.py +19 -0
- esphome/util.py +312 -0
- esphome/voluptuous_schema.py +231 -0
- esphome/vscode.py +113 -0
- esphome/wizard.py +514 -0
- esphome/writer.py +378 -0
- esphome/yaml_util.py +584 -0
- esphome/zeroconf.py +201 -0
- esphome-2024.12.3.dist-info/LICENSE +709 -0
- esphome-2024.12.3.dist-info/METADATA +80 -0
- esphome-2024.12.3.dist-info/RECORD +3393 -0
- esphome-2024.12.3.dist-info/WHEEL +5 -0
- esphome-2024.12.3.dist-info/entry_points.txt +2 -0
- esphome-2024.12.3.dist-info/top_level.txt +1 -0
@@ -0,0 +1,2223 @@
|
|
1
|
+
"""Helpers for config validation using voluptuous."""
|
2
|
+
|
3
|
+
from contextlib import contextmanager
|
4
|
+
from dataclasses import dataclass
|
5
|
+
from datetime import datetime
|
6
|
+
import logging
|
7
|
+
import os
|
8
|
+
import re
|
9
|
+
from string import ascii_letters, digits
|
10
|
+
import uuid as uuid_
|
11
|
+
|
12
|
+
import voluptuous as vol
|
13
|
+
|
14
|
+
from esphome import core
|
15
|
+
import esphome.codegen as cg
|
16
|
+
from esphome.config_helpers import Extend, Remove
|
17
|
+
from esphome.const import (
|
18
|
+
ALLOWED_NAME_CHARS,
|
19
|
+
CONF_AVAILABILITY,
|
20
|
+
CONF_COMMAND_RETAIN,
|
21
|
+
CONF_COMMAND_TOPIC,
|
22
|
+
CONF_DAY,
|
23
|
+
CONF_DISABLED_BY_DEFAULT,
|
24
|
+
CONF_DISCOVERY,
|
25
|
+
CONF_ENTITY_CATEGORY,
|
26
|
+
CONF_HOUR,
|
27
|
+
CONF_ICON,
|
28
|
+
CONF_ID,
|
29
|
+
CONF_INTERNAL,
|
30
|
+
CONF_MINUTE,
|
31
|
+
CONF_MONTH,
|
32
|
+
CONF_NAME,
|
33
|
+
CONF_PASSWORD,
|
34
|
+
CONF_PATH,
|
35
|
+
CONF_PAYLOAD_AVAILABLE,
|
36
|
+
CONF_PAYLOAD_NOT_AVAILABLE,
|
37
|
+
CONF_QOS,
|
38
|
+
CONF_REF,
|
39
|
+
CONF_RETAIN,
|
40
|
+
CONF_SECOND,
|
41
|
+
CONF_SETUP_PRIORITY,
|
42
|
+
CONF_STATE_TOPIC,
|
43
|
+
CONF_SUBSCRIBE_QOS,
|
44
|
+
CONF_TOPIC,
|
45
|
+
CONF_TYPE,
|
46
|
+
CONF_TYPE_ID,
|
47
|
+
CONF_UPDATE_INTERVAL,
|
48
|
+
CONF_URL,
|
49
|
+
CONF_USERNAME,
|
50
|
+
CONF_VALUE,
|
51
|
+
CONF_YEAR,
|
52
|
+
ENTITY_CATEGORY_CONFIG,
|
53
|
+
ENTITY_CATEGORY_DIAGNOSTIC,
|
54
|
+
ENTITY_CATEGORY_NONE,
|
55
|
+
KEY_CORE,
|
56
|
+
KEY_FRAMEWORK_VERSION,
|
57
|
+
KEY_TARGET_FRAMEWORK,
|
58
|
+
KEY_TARGET_PLATFORM,
|
59
|
+
PLATFORM_ESP32,
|
60
|
+
PLATFORM_ESP8266,
|
61
|
+
PLATFORM_RP2040,
|
62
|
+
TYPE_GIT,
|
63
|
+
TYPE_LOCAL,
|
64
|
+
VALID_SUBSTITUTIONS_CHARACTERS,
|
65
|
+
__version__ as ESPHOME_VERSION,
|
66
|
+
)
|
67
|
+
from esphome.core import (
|
68
|
+
CORE,
|
69
|
+
HexInt,
|
70
|
+
IPAddress,
|
71
|
+
Lambda,
|
72
|
+
TimePeriod,
|
73
|
+
TimePeriodMicroseconds,
|
74
|
+
TimePeriodMilliseconds,
|
75
|
+
TimePeriodMinutes,
|
76
|
+
TimePeriodNanoseconds,
|
77
|
+
TimePeriodSeconds,
|
78
|
+
)
|
79
|
+
from esphome.helpers import add_class_to_obj, list_starts_with
|
80
|
+
from esphome.schema_extractors import (
|
81
|
+
SCHEMA_EXTRACT,
|
82
|
+
schema_extractor,
|
83
|
+
schema_extractor_list,
|
84
|
+
schema_extractor_registry,
|
85
|
+
schema_extractor_typed,
|
86
|
+
)
|
87
|
+
from esphome.util import parse_esphome_version
|
88
|
+
from esphome.voluptuous_schema import _Schema
|
89
|
+
from esphome.yaml_util import make_data_base
|
90
|
+
|
91
|
+
_LOGGER = logging.getLogger(__name__)
|
92
|
+
|
93
|
+
# pylint: disable=consider-using-f-string
|
94
|
+
VARIABLE_PROG = re.compile(
|
95
|
+
f"\\$([{VALID_SUBSTITUTIONS_CHARACTERS}]+|\\{{[{VALID_SUBSTITUTIONS_CHARACTERS}]*\\}})"
|
96
|
+
)
|
97
|
+
|
98
|
+
# pylint: disable=invalid-name
|
99
|
+
|
100
|
+
Schema = _Schema
|
101
|
+
All = vol.All
|
102
|
+
Coerce = vol.Coerce
|
103
|
+
Range = vol.Range
|
104
|
+
Invalid = vol.Invalid
|
105
|
+
MultipleInvalid = vol.MultipleInvalid
|
106
|
+
Any = vol.Any
|
107
|
+
Lower = vol.Lower
|
108
|
+
Upper = vol.Upper
|
109
|
+
Length = vol.Length
|
110
|
+
Exclusive = vol.Exclusive
|
111
|
+
Inclusive = vol.Inclusive
|
112
|
+
ALLOW_EXTRA = vol.ALLOW_EXTRA
|
113
|
+
UNDEFINED = vol.UNDEFINED
|
114
|
+
RequiredFieldInvalid = vol.RequiredFieldInvalid
|
115
|
+
# this sentinel object can be placed in an 'Invalid' path to say
|
116
|
+
# the rest of the error path is relative to the root config path
|
117
|
+
ROOT_CONFIG_PATH = object()
|
118
|
+
|
119
|
+
RESERVED_IDS = [
|
120
|
+
# C++ keywords http://en.cppreference.com/w/cpp/keyword
|
121
|
+
"alarm",
|
122
|
+
"alignas",
|
123
|
+
"alignof",
|
124
|
+
"and",
|
125
|
+
"and_eq",
|
126
|
+
"asm",
|
127
|
+
"auto",
|
128
|
+
"bitand",
|
129
|
+
"bitor",
|
130
|
+
"bool",
|
131
|
+
"break",
|
132
|
+
"case",
|
133
|
+
"catch",
|
134
|
+
"char",
|
135
|
+
"char16_t",
|
136
|
+
"char32_t",
|
137
|
+
"class",
|
138
|
+
"clock",
|
139
|
+
"compl",
|
140
|
+
"concept",
|
141
|
+
"const",
|
142
|
+
"constexpr",
|
143
|
+
"const_cast",
|
144
|
+
"continue",
|
145
|
+
"decltype",
|
146
|
+
"default",
|
147
|
+
"delete",
|
148
|
+
"do",
|
149
|
+
"double",
|
150
|
+
"dynamic_cast",
|
151
|
+
"else",
|
152
|
+
"enum",
|
153
|
+
"explicit",
|
154
|
+
"export",
|
155
|
+
"export",
|
156
|
+
"extern",
|
157
|
+
"false",
|
158
|
+
"float",
|
159
|
+
"for",
|
160
|
+
"friend",
|
161
|
+
"goto",
|
162
|
+
"if",
|
163
|
+
"inline",
|
164
|
+
"int",
|
165
|
+
"long",
|
166
|
+
"mutable",
|
167
|
+
"namespace",
|
168
|
+
"new",
|
169
|
+
"noexcept",
|
170
|
+
"not",
|
171
|
+
"not_eq",
|
172
|
+
"nullptr",
|
173
|
+
"operator",
|
174
|
+
"or",
|
175
|
+
"or_eq",
|
176
|
+
"private",
|
177
|
+
"protected",
|
178
|
+
"public",
|
179
|
+
"register",
|
180
|
+
"reinterpret_cast",
|
181
|
+
"requires",
|
182
|
+
"return",
|
183
|
+
"short",
|
184
|
+
"signed",
|
185
|
+
"sizeof",
|
186
|
+
"static",
|
187
|
+
"static_assert",
|
188
|
+
"static_cast",
|
189
|
+
"struct",
|
190
|
+
"switch",
|
191
|
+
"template",
|
192
|
+
"text",
|
193
|
+
"this",
|
194
|
+
"thread_local",
|
195
|
+
"throw",
|
196
|
+
"true",
|
197
|
+
"try",
|
198
|
+
"typedef",
|
199
|
+
"typeid",
|
200
|
+
"typename",
|
201
|
+
"union",
|
202
|
+
"unsigned",
|
203
|
+
"using",
|
204
|
+
"virtual",
|
205
|
+
"void",
|
206
|
+
"volatile",
|
207
|
+
"wchar_t",
|
208
|
+
"while",
|
209
|
+
"xor",
|
210
|
+
"xor_eq",
|
211
|
+
"App",
|
212
|
+
"pinMode",
|
213
|
+
"delay",
|
214
|
+
"delayMicroseconds",
|
215
|
+
"digitalRead",
|
216
|
+
"digitalWrite",
|
217
|
+
"INPUT",
|
218
|
+
"OUTPUT",
|
219
|
+
"uint8_t",
|
220
|
+
"uint16_t",
|
221
|
+
"uint32_t",
|
222
|
+
"uint64_t",
|
223
|
+
"int8_t",
|
224
|
+
"int16_t",
|
225
|
+
"int32_t",
|
226
|
+
"int64_t",
|
227
|
+
"close",
|
228
|
+
"pause",
|
229
|
+
"sleep",
|
230
|
+
"open",
|
231
|
+
"setup",
|
232
|
+
"loop",
|
233
|
+
"uart0",
|
234
|
+
"uart1",
|
235
|
+
"uart2",
|
236
|
+
]
|
237
|
+
|
238
|
+
|
239
|
+
class Optional(vol.Optional):
|
240
|
+
"""Mark a field as optional and optionally define a default for the field.
|
241
|
+
|
242
|
+
When no default is defined, the validated config will not contain the key.
|
243
|
+
You can check if the key is defined with 'CONF_<KEY> in config'. Or to access
|
244
|
+
the key and return None if it does not exist, call config.get(CONF_<KEY>)
|
245
|
+
|
246
|
+
If a default *is* set, the resulting validated config will always contain the
|
247
|
+
default value. You can therefore directly access the value using the
|
248
|
+
'config[CONF_<KEY>]' syntax.
|
249
|
+
|
250
|
+
In ESPHome, all configuration defaults should be defined with the Optional class
|
251
|
+
during config validation - specifically *not* in the C++ code or the code generation
|
252
|
+
phase.
|
253
|
+
"""
|
254
|
+
|
255
|
+
def __init__(self, key, default=UNDEFINED):
|
256
|
+
super().__init__(key, default=default)
|
257
|
+
|
258
|
+
|
259
|
+
class Required(vol.Required):
|
260
|
+
"""Define a field to be required to be set. The validated configuration is guaranteed
|
261
|
+
to contain this key.
|
262
|
+
|
263
|
+
All required values should be acceessed with the `config[CONF_<KEY>]` syntax in code
|
264
|
+
- *not* the `config.get(CONF_<KEY>)` syntax.
|
265
|
+
"""
|
266
|
+
|
267
|
+
def __init__(self, key, msg=None):
|
268
|
+
super().__init__(key, msg=msg)
|
269
|
+
|
270
|
+
|
271
|
+
class FinalExternalInvalid(Invalid):
|
272
|
+
"""Represents an invalid value in the final validation phase where the path should not be prepended."""
|
273
|
+
|
274
|
+
|
275
|
+
def check_not_templatable(value):
|
276
|
+
if isinstance(value, Lambda):
|
277
|
+
raise Invalid("This option is not templatable!")
|
278
|
+
|
279
|
+
|
280
|
+
def alphanumeric(value):
|
281
|
+
if value is None:
|
282
|
+
raise Invalid("string value is None")
|
283
|
+
value = str(value)
|
284
|
+
if not value.isalnum():
|
285
|
+
raise Invalid(f"{value} is not alphanumeric")
|
286
|
+
return value
|
287
|
+
|
288
|
+
|
289
|
+
def valid_name(value):
|
290
|
+
value = string_strict(value)
|
291
|
+
|
292
|
+
if CORE.vscode:
|
293
|
+
# If the value is a substitution, it can't be validated until the substitution
|
294
|
+
# is actually made.
|
295
|
+
sub_match = VARIABLE_PROG.search(value)
|
296
|
+
if sub_match:
|
297
|
+
return value
|
298
|
+
|
299
|
+
for c in value:
|
300
|
+
if c not in ALLOWED_NAME_CHARS:
|
301
|
+
raise Invalid(
|
302
|
+
f"'{c}' is an invalid character for names. Valid characters are: "
|
303
|
+
f"{ALLOWED_NAME_CHARS} (lowercase, no spaces)"
|
304
|
+
)
|
305
|
+
return value
|
306
|
+
|
307
|
+
|
308
|
+
def string(value):
|
309
|
+
"""Validate that a configuration value is a string. If not, automatically converts to a string.
|
310
|
+
|
311
|
+
Note that this can be lossy, for example the input value 60.00 (float) will be turned into
|
312
|
+
"60.0" (string). For values where this could be a problem `string_strict` has to be used.
|
313
|
+
"""
|
314
|
+
check_not_templatable(value)
|
315
|
+
if isinstance(value, (dict, list)):
|
316
|
+
raise Invalid("string value cannot be dictionary or list.")
|
317
|
+
if isinstance(value, bool):
|
318
|
+
raise Invalid(
|
319
|
+
"Auto-converted this value to boolean, please wrap the value in quotes."
|
320
|
+
)
|
321
|
+
if isinstance(value, str):
|
322
|
+
return value
|
323
|
+
if value is not None:
|
324
|
+
return str(value)
|
325
|
+
raise Invalid("string value is None")
|
326
|
+
|
327
|
+
|
328
|
+
def string_strict(value):
|
329
|
+
"""Like string, but only allows strings, and does not automatically convert other types to
|
330
|
+
strings."""
|
331
|
+
check_not_templatable(value)
|
332
|
+
if isinstance(value, str):
|
333
|
+
return value
|
334
|
+
raise Invalid(
|
335
|
+
f"Must be string, got {type(value)}. did you forget putting quotes around the value?"
|
336
|
+
)
|
337
|
+
|
338
|
+
|
339
|
+
def icon(value):
|
340
|
+
"""Validate that a given config value is a valid icon."""
|
341
|
+
value = string_strict(value)
|
342
|
+
if not value:
|
343
|
+
return value
|
344
|
+
if re.match("^[\\w\\-]+:[\\w\\-]+$", value):
|
345
|
+
return value
|
346
|
+
raise Invalid(
|
347
|
+
'Icons must match the format "[icon pack]:[icon]", e.g. "mdi:home-assistant"'
|
348
|
+
)
|
349
|
+
|
350
|
+
|
351
|
+
def boolean(value):
|
352
|
+
"""Validate the given config option to be a boolean.
|
353
|
+
|
354
|
+
This option allows a bunch of different ways of expressing boolean values:
|
355
|
+
- instance of boolean
|
356
|
+
- 'true'/'false'
|
357
|
+
- 'yes'/'no'
|
358
|
+
- 'enable'/disable
|
359
|
+
"""
|
360
|
+
check_not_templatable(value)
|
361
|
+
if isinstance(value, bool):
|
362
|
+
return value
|
363
|
+
if isinstance(value, str):
|
364
|
+
value = value.lower()
|
365
|
+
if value in ("true", "yes", "on", "enable"):
|
366
|
+
return True
|
367
|
+
if value in ("false", "no", "off", "disable"):
|
368
|
+
return False
|
369
|
+
raise Invalid(
|
370
|
+
f"Expected boolean value, but cannot convert {value} to a boolean. Please use 'true' or 'false'"
|
371
|
+
)
|
372
|
+
|
373
|
+
|
374
|
+
def boolean_false(value):
|
375
|
+
"""Validate the given config option to be a boolean, set to False.
|
376
|
+
|
377
|
+
This option allows a bunch of different ways of expressing boolean values:
|
378
|
+
- instance of boolean
|
379
|
+
- 'true'/'false'
|
380
|
+
- 'yes'/'no'
|
381
|
+
- 'enable'/disable
|
382
|
+
"""
|
383
|
+
if boolean(value):
|
384
|
+
raise Invalid("Expected boolean value to be false")
|
385
|
+
return False
|
386
|
+
|
387
|
+
|
388
|
+
@schema_extractor_list
|
389
|
+
def ensure_list(*validators):
|
390
|
+
"""Validate this configuration option to be a list.
|
391
|
+
|
392
|
+
If the config value is not a list, it is automatically converted to a
|
393
|
+
single-item list.
|
394
|
+
|
395
|
+
None and empty dictionaries are converted to empty lists.
|
396
|
+
"""
|
397
|
+
user = All(*validators)
|
398
|
+
list_schema = Schema([user])
|
399
|
+
|
400
|
+
def validator(value):
|
401
|
+
check_not_templatable(value)
|
402
|
+
if value is None or (isinstance(value, dict) and not value):
|
403
|
+
return []
|
404
|
+
if not isinstance(value, list):
|
405
|
+
return [user(value)]
|
406
|
+
return list_schema(value)
|
407
|
+
|
408
|
+
return validator
|
409
|
+
|
410
|
+
|
411
|
+
def hex_int(value):
|
412
|
+
"""Validate the given value to be a hex integer. This is mostly for cosmetic
|
413
|
+
purposes of the generated code.
|
414
|
+
"""
|
415
|
+
return HexInt(int_(value))
|
416
|
+
|
417
|
+
|
418
|
+
def int_(value):
|
419
|
+
"""Validate that the config option is an integer.
|
420
|
+
|
421
|
+
Automatically also converts strings to ints.
|
422
|
+
"""
|
423
|
+
check_not_templatable(value)
|
424
|
+
if isinstance(value, int):
|
425
|
+
return value
|
426
|
+
if isinstance(value, float):
|
427
|
+
if int(value) == value:
|
428
|
+
return int(value)
|
429
|
+
raise Invalid(
|
430
|
+
f"This option only accepts integers with no fractional part. Please remove the fractional part from {value}"
|
431
|
+
)
|
432
|
+
value = string_strict(value).lower()
|
433
|
+
base = 10
|
434
|
+
if value.startswith("0x"):
|
435
|
+
base = 16
|
436
|
+
try:
|
437
|
+
return int(value, base)
|
438
|
+
except ValueError:
|
439
|
+
# pylint: disable=raise-missing-from
|
440
|
+
raise Invalid(f"Expected integer, but cannot parse {value} as an integer")
|
441
|
+
|
442
|
+
|
443
|
+
def int_range(min=None, max=None, min_included=True, max_included=True):
|
444
|
+
"""Validate that the config option is an integer in the given range."""
|
445
|
+
if min is not None:
|
446
|
+
assert isinstance(min, int)
|
447
|
+
if max is not None:
|
448
|
+
assert isinstance(max, int)
|
449
|
+
return All(
|
450
|
+
int_,
|
451
|
+
Range(min=min, max=max, min_included=min_included, max_included=max_included),
|
452
|
+
)
|
453
|
+
|
454
|
+
|
455
|
+
def hex_int_range(min=None, max=None, min_included=True, max_included=True):
|
456
|
+
"""Validate that the config option is an integer in the given range."""
|
457
|
+
return All(
|
458
|
+
hex_int,
|
459
|
+
Range(min=min, max=max, min_included=min_included, max_included=max_included),
|
460
|
+
)
|
461
|
+
|
462
|
+
|
463
|
+
def float_range(min=None, max=None, min_included=True, max_included=True):
|
464
|
+
"""Validate that the config option is a floating point number in the given range."""
|
465
|
+
if min is not None:
|
466
|
+
assert isinstance(min, (int, float))
|
467
|
+
if max is not None:
|
468
|
+
assert isinstance(max, (int, float))
|
469
|
+
return All(
|
470
|
+
float_,
|
471
|
+
Range(min=min, max=max, min_included=min_included, max_included=max_included),
|
472
|
+
)
|
473
|
+
|
474
|
+
|
475
|
+
port = int_range(min=1, max=65535)
|
476
|
+
float_ = Coerce(float)
|
477
|
+
positive_float = float_range(min=0)
|
478
|
+
zero_to_one_float = float_range(min=0, max=1)
|
479
|
+
negative_one_to_one_float = float_range(min=-1, max=1)
|
480
|
+
positive_int = int_range(min=0)
|
481
|
+
positive_not_null_int = int_range(min=0, min_included=False)
|
482
|
+
positive_not_null_float = float_range(min=0, min_included=False)
|
483
|
+
|
484
|
+
|
485
|
+
def validate_id_name(value):
|
486
|
+
"""Validate that the given value would be a valid C++ identifier name."""
|
487
|
+
value = string(value)
|
488
|
+
if not value:
|
489
|
+
raise Invalid("ID must not be empty")
|
490
|
+
if value[0].isdigit():
|
491
|
+
raise Invalid("First character in ID cannot be a digit.")
|
492
|
+
if "-" in value:
|
493
|
+
raise Invalid(
|
494
|
+
"Dashes are not supported in IDs, please use underscores instead."
|
495
|
+
)
|
496
|
+
|
497
|
+
if CORE.vscode:
|
498
|
+
# If the value is a substitution, it can't be validated until the substitution
|
499
|
+
# is actually made
|
500
|
+
sub_match = VARIABLE_PROG.match(value)
|
501
|
+
if sub_match:
|
502
|
+
return value
|
503
|
+
|
504
|
+
valid_chars = f"{ascii_letters + digits}_"
|
505
|
+
for char in value:
|
506
|
+
if char not in valid_chars:
|
507
|
+
raise Invalid(
|
508
|
+
f"IDs must only consist of upper/lowercase characters, the underscorecharacter and numbers. The character '{char}' cannot be used"
|
509
|
+
)
|
510
|
+
if value in RESERVED_IDS:
|
511
|
+
raise Invalid(f"ID '{value}' is reserved internally and cannot be used")
|
512
|
+
if value in CORE.loaded_integrations:
|
513
|
+
raise Invalid(
|
514
|
+
f"ID '{value}' conflicts with the name of an esphome integration, please use another ID name."
|
515
|
+
)
|
516
|
+
return value
|
517
|
+
|
518
|
+
|
519
|
+
def use_id(type):
|
520
|
+
"""Declare that this configuration option should point to an ID with the given type."""
|
521
|
+
|
522
|
+
@schema_extractor("use_id")
|
523
|
+
def validator(value):
|
524
|
+
if value == SCHEMA_EXTRACT:
|
525
|
+
return type
|
526
|
+
|
527
|
+
check_not_templatable(value)
|
528
|
+
if value is None:
|
529
|
+
return core.ID(None, is_declaration=False, type=type)
|
530
|
+
if (
|
531
|
+
isinstance(value, core.ID)
|
532
|
+
and value.is_declaration is False
|
533
|
+
and value.type is type
|
534
|
+
):
|
535
|
+
return value
|
536
|
+
|
537
|
+
return core.ID(validate_id_name(value), is_declaration=False, type=type)
|
538
|
+
|
539
|
+
return validator
|
540
|
+
|
541
|
+
|
542
|
+
def declare_id(type):
|
543
|
+
"""Declare that this configuration option should be used to declare a variable ID
|
544
|
+
with the given type.
|
545
|
+
|
546
|
+
If two IDs with the same name exist, a validation error is thrown.
|
547
|
+
"""
|
548
|
+
|
549
|
+
@schema_extractor("declare_id")
|
550
|
+
def validator(value):
|
551
|
+
if value == SCHEMA_EXTRACT:
|
552
|
+
return type
|
553
|
+
|
554
|
+
check_not_templatable(value)
|
555
|
+
if value is None:
|
556
|
+
return core.ID(None, is_declaration=True, type=type)
|
557
|
+
|
558
|
+
if isinstance(value, Extend):
|
559
|
+
raise Invalid(f"Source for extension of ID '{value.value}' was not found.")
|
560
|
+
|
561
|
+
if isinstance(value, Remove):
|
562
|
+
raise Invalid(f"Source for Removal of ID '{value.value}' was not found.")
|
563
|
+
|
564
|
+
return core.ID(validate_id_name(value), is_declaration=True, type=type)
|
565
|
+
|
566
|
+
return validator
|
567
|
+
|
568
|
+
|
569
|
+
def templatable(other_validators):
|
570
|
+
"""Validate that the configuration option can (optionally) be templated.
|
571
|
+
|
572
|
+
The user can declare a value as template by using the '!lambda' tag. In that case,
|
573
|
+
validation is skipped. Otherwise (if the value is not templated) the validator given
|
574
|
+
as the first argument to this method is called.
|
575
|
+
"""
|
576
|
+
schema = Schema(other_validators)
|
577
|
+
|
578
|
+
@schema_extractor("templatable")
|
579
|
+
def validator(value):
|
580
|
+
if value == SCHEMA_EXTRACT:
|
581
|
+
return other_validators
|
582
|
+
|
583
|
+
if isinstance(value, Lambda):
|
584
|
+
return returning_lambda(value)
|
585
|
+
if isinstance(other_validators, dict):
|
586
|
+
return schema(value)
|
587
|
+
return schema(value)
|
588
|
+
|
589
|
+
return validator
|
590
|
+
|
591
|
+
|
592
|
+
def only_on(platforms):
|
593
|
+
"""Validate that this option can only be specified on the given target platforms."""
|
594
|
+
if not isinstance(platforms, list):
|
595
|
+
platforms = [platforms]
|
596
|
+
|
597
|
+
def validator_(obj):
|
598
|
+
if CORE.target_platform not in platforms:
|
599
|
+
raise Invalid(f"This feature is only available on {platforms}")
|
600
|
+
return obj
|
601
|
+
|
602
|
+
return validator_
|
603
|
+
|
604
|
+
|
605
|
+
def only_with_framework(frameworks):
|
606
|
+
"""Validate that this option can only be specified on the given frameworks."""
|
607
|
+
if not isinstance(frameworks, list):
|
608
|
+
frameworks = [frameworks]
|
609
|
+
|
610
|
+
def validator_(obj):
|
611
|
+
if CORE.target_framework not in frameworks:
|
612
|
+
raise Invalid(
|
613
|
+
f"This feature is only available with frameworks {frameworks}"
|
614
|
+
)
|
615
|
+
return obj
|
616
|
+
|
617
|
+
return validator_
|
618
|
+
|
619
|
+
|
620
|
+
only_on_esp32 = only_on(PLATFORM_ESP32)
|
621
|
+
only_on_esp8266 = only_on(PLATFORM_ESP8266)
|
622
|
+
only_on_rp2040 = only_on(PLATFORM_RP2040)
|
623
|
+
only_with_arduino = only_with_framework("arduino")
|
624
|
+
only_with_esp_idf = only_with_framework("esp-idf")
|
625
|
+
|
626
|
+
|
627
|
+
# Adapted from:
|
628
|
+
# https://github.com/alecthomas/voluptuous/issues/115#issuecomment-144464666
|
629
|
+
def has_at_least_one_key(*keys):
|
630
|
+
"""Validate that at least one of the given keys exist in the config."""
|
631
|
+
|
632
|
+
def validate(obj):
|
633
|
+
"""Test keys exist in dict."""
|
634
|
+
if not isinstance(obj, dict):
|
635
|
+
raise Invalid("expected dictionary")
|
636
|
+
|
637
|
+
if not any(k in keys for k in obj):
|
638
|
+
raise Invalid(f"Must contain at least one of {', '.join(keys)}.")
|
639
|
+
return obj
|
640
|
+
|
641
|
+
return validate
|
642
|
+
|
643
|
+
|
644
|
+
def has_exactly_one_key(*keys):
|
645
|
+
"""Validate that exactly one of the given keys exist in the config."""
|
646
|
+
|
647
|
+
def validate(obj):
|
648
|
+
if not isinstance(obj, dict):
|
649
|
+
raise Invalid("expected dictionary")
|
650
|
+
|
651
|
+
number = sum(k in keys for k in obj)
|
652
|
+
if number > 1:
|
653
|
+
raise Invalid(f"Cannot specify more than one of {', '.join(keys)}.")
|
654
|
+
if number < 1:
|
655
|
+
raise Invalid(f"Must contain exactly one of {', '.join(keys)}.")
|
656
|
+
return obj
|
657
|
+
|
658
|
+
return validate
|
659
|
+
|
660
|
+
|
661
|
+
def has_at_most_one_key(*keys):
|
662
|
+
"""Validate that at most one of the given keys exist in the config."""
|
663
|
+
|
664
|
+
def validate(obj):
|
665
|
+
if not isinstance(obj, dict):
|
666
|
+
raise Invalid("expected dictionary")
|
667
|
+
|
668
|
+
number = sum(k in keys for k in obj)
|
669
|
+
if number > 1:
|
670
|
+
raise Invalid(f"Cannot specify more than one of {', '.join(keys)}.")
|
671
|
+
return obj
|
672
|
+
|
673
|
+
return validate
|
674
|
+
|
675
|
+
|
676
|
+
def has_none_or_all_keys(*keys):
|
677
|
+
"""Validate that none or all of the given keys exist in the config."""
|
678
|
+
|
679
|
+
def validate(obj):
|
680
|
+
if not isinstance(obj, dict):
|
681
|
+
raise Invalid("expected dictionary")
|
682
|
+
|
683
|
+
number = sum(k in keys for k in obj)
|
684
|
+
if number != 0 and number != len(keys):
|
685
|
+
raise Invalid(f"Must specify either none or all of {', '.join(keys)}.")
|
686
|
+
return obj
|
687
|
+
|
688
|
+
return validate
|
689
|
+
|
690
|
+
|
691
|
+
TIME_PERIOD_ERROR = (
|
692
|
+
"Time period {} should be format number + unit, for example 5ms, 5s, 5min, 5h"
|
693
|
+
)
|
694
|
+
|
695
|
+
time_period_dict = All(
|
696
|
+
Schema(
|
697
|
+
{
|
698
|
+
Optional("days"): float_,
|
699
|
+
Optional("hours"): float_,
|
700
|
+
Optional("minutes"): float_,
|
701
|
+
Optional("seconds"): float_,
|
702
|
+
Optional("milliseconds"): float_,
|
703
|
+
Optional("microseconds"): float_,
|
704
|
+
}
|
705
|
+
),
|
706
|
+
has_at_least_one_key(
|
707
|
+
"days", "hours", "minutes", "seconds", "milliseconds", "microseconds"
|
708
|
+
),
|
709
|
+
lambda value: TimePeriod(**value),
|
710
|
+
)
|
711
|
+
|
712
|
+
|
713
|
+
def time_period_str_colon(value):
|
714
|
+
"""Validate and transform time offset with format HH:MM[:SS]."""
|
715
|
+
if isinstance(value, int):
|
716
|
+
raise Invalid("Make sure you wrap time values in quotes")
|
717
|
+
if not isinstance(value, str):
|
718
|
+
raise Invalid(TIME_PERIOD_ERROR.format(value))
|
719
|
+
|
720
|
+
try:
|
721
|
+
parsed = [int(x) for x in value.split(":")]
|
722
|
+
except ValueError:
|
723
|
+
# pylint: disable=raise-missing-from
|
724
|
+
raise Invalid(TIME_PERIOD_ERROR.format(value))
|
725
|
+
|
726
|
+
if len(parsed) == 2:
|
727
|
+
hour, minute = parsed
|
728
|
+
second = 0
|
729
|
+
elif len(parsed) == 3:
|
730
|
+
hour, minute, second = parsed
|
731
|
+
else:
|
732
|
+
raise Invalid(TIME_PERIOD_ERROR.format(value))
|
733
|
+
|
734
|
+
return TimePeriod(hours=hour, minutes=minute, seconds=second)
|
735
|
+
|
736
|
+
|
737
|
+
def time_period_str_unit(value):
|
738
|
+
"""Validate and transform time period with time unit and integer value."""
|
739
|
+
check_not_templatable(value)
|
740
|
+
|
741
|
+
if isinstance(value, int):
|
742
|
+
raise Invalid(
|
743
|
+
f"Don't know what '{value}' means as it has no time *unit*! Did you mean '{value}s'?"
|
744
|
+
)
|
745
|
+
if isinstance(value, TimePeriod):
|
746
|
+
value = str(value)
|
747
|
+
if not isinstance(value, str):
|
748
|
+
raise Invalid("Expected string for time period with unit.")
|
749
|
+
|
750
|
+
unit_to_kwarg = {
|
751
|
+
"ns": "nanoseconds",
|
752
|
+
"nanoseconds": "nanoseconds",
|
753
|
+
"us": "microseconds",
|
754
|
+
"µs": "microseconds",
|
755
|
+
"microseconds": "microseconds",
|
756
|
+
"ms": "milliseconds",
|
757
|
+
"milliseconds": "milliseconds",
|
758
|
+
"s": "seconds",
|
759
|
+
"sec": "seconds",
|
760
|
+
"seconds": "seconds",
|
761
|
+
"min": "minutes",
|
762
|
+
"minutes": "minutes",
|
763
|
+
"h": "hours",
|
764
|
+
"hours": "hours",
|
765
|
+
"d": "days",
|
766
|
+
"days": "days",
|
767
|
+
}
|
768
|
+
|
769
|
+
match = re.match(r"^([-+]?[0-9]*\.?[0-9]*)\s*(\w*)$", value)
|
770
|
+
|
771
|
+
if match is None:
|
772
|
+
raise Invalid(f"Expected time period with unit, got {value}")
|
773
|
+
kwarg = unit_to_kwarg[one_of(*unit_to_kwarg)(match.group(2))]
|
774
|
+
|
775
|
+
try:
|
776
|
+
return TimePeriod(**{kwarg: float(match.group(1))})
|
777
|
+
except ValueError as e:
|
778
|
+
raise Invalid(e) from e
|
779
|
+
|
780
|
+
|
781
|
+
def time_period_in_milliseconds_(value):
|
782
|
+
if value.microseconds is not None and value.microseconds != 0:
|
783
|
+
raise Invalid("Maximum precision is milliseconds")
|
784
|
+
return TimePeriodMilliseconds(**value.as_dict())
|
785
|
+
|
786
|
+
|
787
|
+
def time_period_in_microseconds_(value):
|
788
|
+
if value.nanoseconds is not None and value.nanoseconds != 0:
|
789
|
+
raise Invalid("Maximum precision is microseconds")
|
790
|
+
return TimePeriodMicroseconds(**value.as_dict())
|
791
|
+
|
792
|
+
|
793
|
+
def time_period_in_nanoseconds_(value):
|
794
|
+
return TimePeriodNanoseconds(**value.as_dict())
|
795
|
+
|
796
|
+
|
797
|
+
def time_period_in_seconds_(value):
|
798
|
+
if value.nanoseconds is not None and value.nanoseconds != 0:
|
799
|
+
raise Invalid("Maximum precision is seconds")
|
800
|
+
if value.microseconds is not None and value.microseconds != 0:
|
801
|
+
raise Invalid("Maximum precision is seconds")
|
802
|
+
if value.milliseconds is not None and value.milliseconds != 0:
|
803
|
+
raise Invalid("Maximum precision is seconds")
|
804
|
+
return TimePeriodSeconds(**value.as_dict())
|
805
|
+
|
806
|
+
|
807
|
+
def time_period_in_minutes_(value):
|
808
|
+
if value.nanoseconds is not None and value.nanoseconds != 0:
|
809
|
+
raise Invalid("Maximum precision is minutes")
|
810
|
+
if value.microseconds is not None and value.microseconds != 0:
|
811
|
+
raise Invalid("Maximum precision is minutes")
|
812
|
+
if value.milliseconds is not None and value.milliseconds != 0:
|
813
|
+
raise Invalid("Maximum precision is minutes")
|
814
|
+
if value.seconds is not None and value.seconds != 0:
|
815
|
+
raise Invalid("Maximum precision is minutes")
|
816
|
+
return TimePeriodMinutes(**value.as_dict())
|
817
|
+
|
818
|
+
|
819
|
+
def update_interval(value):
|
820
|
+
if value == "never":
|
821
|
+
return 4294967295 # uint32_t max
|
822
|
+
return positive_time_period_milliseconds(value)
|
823
|
+
|
824
|
+
|
825
|
+
time_period = Any(time_period_str_unit, time_period_str_colon, time_period_dict)
|
826
|
+
positive_time_period = All(time_period, Range(min=TimePeriod()))
|
827
|
+
positive_time_period_milliseconds = All(
|
828
|
+
positive_time_period, time_period_in_milliseconds_
|
829
|
+
)
|
830
|
+
positive_time_period_seconds = All(positive_time_period, time_period_in_seconds_)
|
831
|
+
positive_time_period_minutes = All(positive_time_period, time_period_in_minutes_)
|
832
|
+
time_period_microseconds = All(time_period, time_period_in_microseconds_)
|
833
|
+
positive_time_period_microseconds = All(
|
834
|
+
positive_time_period, time_period_in_microseconds_
|
835
|
+
)
|
836
|
+
positive_time_period_nanoseconds = All(
|
837
|
+
positive_time_period, time_period_in_nanoseconds_
|
838
|
+
)
|
839
|
+
positive_not_null_time_period = All(
|
840
|
+
time_period, Range(min=TimePeriod(), min_included=False)
|
841
|
+
)
|
842
|
+
|
843
|
+
|
844
|
+
def time_of_day(value):
|
845
|
+
return date_time(date=False, time=True)(value)
|
846
|
+
|
847
|
+
|
848
|
+
def date_time(date: bool, time: bool):
|
849
|
+
pattern_str = r"^" # Start of string
|
850
|
+
if date:
|
851
|
+
pattern_str += r"\d{4}-\d{1,2}-\d{1,2}"
|
852
|
+
if time:
|
853
|
+
pattern_str += r" "
|
854
|
+
if time:
|
855
|
+
pattern_str += (
|
856
|
+
r"\d{1,2}:\d{2}" # Hour/Minute
|
857
|
+
r"(:\d{2})?" # 1. Seconds
|
858
|
+
r"(" # 2. Optional AM/PM group
|
859
|
+
r"(\s)?" # 3. Optional Space
|
860
|
+
r"(?:AM|PM|am|pm)" # AM/PM string matching
|
861
|
+
r")?" # End optional AM/PM group
|
862
|
+
)
|
863
|
+
pattern_str += r"$" # End of string
|
864
|
+
|
865
|
+
pattern = re.compile(pattern_str)
|
866
|
+
|
867
|
+
exc_message = ""
|
868
|
+
if date:
|
869
|
+
exc_message += "date"
|
870
|
+
if time:
|
871
|
+
exc_message += "time"
|
872
|
+
|
873
|
+
schema = Schema({})
|
874
|
+
if date:
|
875
|
+
schema = schema.extend(
|
876
|
+
{
|
877
|
+
Required(CONF_YEAR): int_range(min=1970, max=3000),
|
878
|
+
Required(CONF_MONTH): int_range(min=1, max=12),
|
879
|
+
Required(CONF_DAY): int_range(min=1, max=31),
|
880
|
+
}
|
881
|
+
)
|
882
|
+
if time:
|
883
|
+
schema = schema.extend(
|
884
|
+
{
|
885
|
+
Required(CONF_HOUR): int_range(min=0, max=23),
|
886
|
+
Required(CONF_MINUTE): int_range(min=0, max=59),
|
887
|
+
Required(CONF_SECOND): int_range(min=0, max=59),
|
888
|
+
}
|
889
|
+
)
|
890
|
+
|
891
|
+
def validator(value):
|
892
|
+
if isinstance(value, dict):
|
893
|
+
return schema(value)
|
894
|
+
value = string(value)
|
895
|
+
|
896
|
+
match = pattern.match(value)
|
897
|
+
if match is None:
|
898
|
+
# pylint: disable=raise-missing-from
|
899
|
+
raise Invalid(f"Invalid {exc_message}: {value}")
|
900
|
+
|
901
|
+
if time:
|
902
|
+
has_seconds = match[1] is not None
|
903
|
+
has_ampm = match[2] is not None
|
904
|
+
has_ampm_space = match[3] is not None
|
905
|
+
|
906
|
+
format = ""
|
907
|
+
if date:
|
908
|
+
format += "%Y-%m-%d"
|
909
|
+
if time:
|
910
|
+
format += " "
|
911
|
+
if time:
|
912
|
+
if has_ampm:
|
913
|
+
format += "%I:%M"
|
914
|
+
else:
|
915
|
+
format += "%H:%M"
|
916
|
+
if has_seconds:
|
917
|
+
format += ":%S"
|
918
|
+
if has_ampm_space:
|
919
|
+
format += " "
|
920
|
+
if has_ampm:
|
921
|
+
format += "%p"
|
922
|
+
|
923
|
+
try:
|
924
|
+
date_obj = datetime.strptime(value, format)
|
925
|
+
except ValueError as err:
|
926
|
+
# pylint: disable=raise-missing-from
|
927
|
+
raise Invalid(f"Invalid {exc_message}: {err}")
|
928
|
+
|
929
|
+
return_value = {}
|
930
|
+
if date:
|
931
|
+
return_value[CONF_YEAR] = date_obj.year
|
932
|
+
return_value[CONF_MONTH] = date_obj.month
|
933
|
+
return_value[CONF_DAY] = date_obj.day
|
934
|
+
|
935
|
+
if time:
|
936
|
+
return_value[CONF_HOUR] = date_obj.hour
|
937
|
+
return_value[CONF_MINUTE] = date_obj.minute
|
938
|
+
return_value[CONF_SECOND] = date_obj.second if has_seconds else 0
|
939
|
+
|
940
|
+
return schema(return_value)
|
941
|
+
|
942
|
+
return validator
|
943
|
+
|
944
|
+
|
945
|
+
def mac_address(value):
|
946
|
+
value = string_strict(value)
|
947
|
+
parts = value.split(":")
|
948
|
+
if len(parts) != 6:
|
949
|
+
raise Invalid("MAC Address must consist of 6 : (colon) separated parts")
|
950
|
+
parts_int = []
|
951
|
+
if any(len(part) != 2 for part in parts):
|
952
|
+
raise Invalid("MAC Address must be format XX:XX:XX:XX:XX:XX")
|
953
|
+
for part in parts:
|
954
|
+
try:
|
955
|
+
parts_int.append(int(part, 16))
|
956
|
+
except ValueError:
|
957
|
+
# pylint: disable=raise-missing-from
|
958
|
+
raise Invalid("MAC Address parts must be hexadecimal values from 00 to FF")
|
959
|
+
|
960
|
+
return core.MACAddress(*parts_int)
|
961
|
+
|
962
|
+
|
963
|
+
def bind_key(value):
|
964
|
+
value = string_strict(value)
|
965
|
+
parts = [value[i : i + 2] for i in range(0, len(value), 2)]
|
966
|
+
if len(parts) != 16:
|
967
|
+
raise Invalid("Bind key must consist of 16 hexadecimal numbers")
|
968
|
+
parts_int = []
|
969
|
+
if any(len(part) != 2 for part in parts):
|
970
|
+
raise Invalid("Bind key must be format XX")
|
971
|
+
for part in parts:
|
972
|
+
try:
|
973
|
+
parts_int.append(int(part, 16))
|
974
|
+
except ValueError:
|
975
|
+
# pylint: disable=raise-missing-from
|
976
|
+
raise Invalid("Bind key must be hex values from 00 to FF")
|
977
|
+
|
978
|
+
return "".join(f"{part:02X}" for part in parts_int)
|
979
|
+
|
980
|
+
|
981
|
+
def uuid(value):
|
982
|
+
return Coerce(uuid_.UUID)(value)
|
983
|
+
|
984
|
+
|
985
|
+
METRIC_SUFFIXES = {
|
986
|
+
"E": 1e18,
|
987
|
+
"P": 1e15,
|
988
|
+
"T": 1e12,
|
989
|
+
"G": 1e9,
|
990
|
+
"M": 1e6,
|
991
|
+
"k": 1e3,
|
992
|
+
"da": 10,
|
993
|
+
"d": 1e-1,
|
994
|
+
"c": 1e-2,
|
995
|
+
"m": 0.001,
|
996
|
+
"µ": 1e-6,
|
997
|
+
"u": 1e-6,
|
998
|
+
"n": 1e-9,
|
999
|
+
"p": 1e-12,
|
1000
|
+
"f": 1e-15,
|
1001
|
+
"a": 1e-18,
|
1002
|
+
"": 1,
|
1003
|
+
}
|
1004
|
+
|
1005
|
+
|
1006
|
+
def float_with_unit(quantity, regex_suffix, optional_unit=False):
|
1007
|
+
pattern = re.compile(
|
1008
|
+
f"^([-+]?[0-9]*\\.?[0-9]*)\\s*(\\w*?){regex_suffix}$", re.UNICODE
|
1009
|
+
)
|
1010
|
+
|
1011
|
+
def validator(value):
|
1012
|
+
if optional_unit:
|
1013
|
+
try:
|
1014
|
+
return float_(value)
|
1015
|
+
except Invalid:
|
1016
|
+
pass
|
1017
|
+
match = pattern.match(string(value))
|
1018
|
+
|
1019
|
+
if match is None:
|
1020
|
+
raise Invalid(f"Expected {quantity} with unit, got {value}")
|
1021
|
+
|
1022
|
+
mantissa = float(match.group(1))
|
1023
|
+
if match.group(2) not in METRIC_SUFFIXES:
|
1024
|
+
raise Invalid(f"Invalid {quantity} suffix {match.group(2)}")
|
1025
|
+
|
1026
|
+
multiplier = METRIC_SUFFIXES[match.group(2)]
|
1027
|
+
return mantissa * multiplier
|
1028
|
+
|
1029
|
+
return validator
|
1030
|
+
|
1031
|
+
|
1032
|
+
frequency = float_with_unit("frequency", "(Hz|HZ|hz)?")
|
1033
|
+
resistance = float_with_unit("resistance", "(Ω|Ω|ohm|Ohm|OHM)?")
|
1034
|
+
current = float_with_unit("current", "(a|A|amp|Amp|amps|Amps|ampere|Ampere)?")
|
1035
|
+
voltage = float_with_unit("voltage", "(v|V|volt|Volts)?")
|
1036
|
+
distance = float_with_unit("distance", "(m)")
|
1037
|
+
framerate = float_with_unit("framerate", "(FPS|fps|Fps|FpS|Hz)")
|
1038
|
+
angle = float_with_unit("angle", "(°|deg)", optional_unit=True)
|
1039
|
+
_temperature_c = float_with_unit("temperature", "(°C|° C|°|C)?")
|
1040
|
+
_temperature_k = float_with_unit("temperature", "(° K|° K|K)?")
|
1041
|
+
_temperature_f = float_with_unit("temperature", "(°F|° F|F)?")
|
1042
|
+
decibel = float_with_unit("decibel", "(dB|dBm|db|dbm)", optional_unit=True)
|
1043
|
+
pressure = float_with_unit("pressure", "(bar|Bar)", optional_unit=True)
|
1044
|
+
|
1045
|
+
|
1046
|
+
def temperature(value):
|
1047
|
+
err = None
|
1048
|
+
try:
|
1049
|
+
return _temperature_c(value)
|
1050
|
+
except Invalid as orig_err:
|
1051
|
+
err = orig_err
|
1052
|
+
|
1053
|
+
try:
|
1054
|
+
kelvin = _temperature_k(value)
|
1055
|
+
return kelvin - 273.15
|
1056
|
+
except Invalid:
|
1057
|
+
pass
|
1058
|
+
|
1059
|
+
try:
|
1060
|
+
fahrenheit = _temperature_f(value)
|
1061
|
+
return (fahrenheit - 32) * (5 / 9)
|
1062
|
+
except Invalid:
|
1063
|
+
pass
|
1064
|
+
|
1065
|
+
raise err
|
1066
|
+
|
1067
|
+
|
1068
|
+
def temperature_delta(value):
|
1069
|
+
err = None
|
1070
|
+
try:
|
1071
|
+
return _temperature_c(value)
|
1072
|
+
except Invalid as orig_err:
|
1073
|
+
err = orig_err
|
1074
|
+
|
1075
|
+
try:
|
1076
|
+
return _temperature_k(value)
|
1077
|
+
except Invalid:
|
1078
|
+
pass
|
1079
|
+
|
1080
|
+
try:
|
1081
|
+
fahrenheit = _temperature_f(value)
|
1082
|
+
return fahrenheit * (5 / 9)
|
1083
|
+
except Invalid:
|
1084
|
+
pass
|
1085
|
+
|
1086
|
+
raise err
|
1087
|
+
|
1088
|
+
|
1089
|
+
_color_temperature_mireds = float_with_unit("Color Temperature", r"(mireds|Mireds)")
|
1090
|
+
_color_temperature_kelvin = float_with_unit("Color Temperature", r"(K|Kelvin)")
|
1091
|
+
|
1092
|
+
|
1093
|
+
def color_temperature(value):
|
1094
|
+
try:
|
1095
|
+
val = _color_temperature_mireds(value)
|
1096
|
+
except Invalid:
|
1097
|
+
val = 1000000.0 / _color_temperature_kelvin(value)
|
1098
|
+
if val < 0:
|
1099
|
+
raise Invalid("Color temperature cannot be negative")
|
1100
|
+
return val
|
1101
|
+
|
1102
|
+
|
1103
|
+
def validate_bytes(value):
|
1104
|
+
value = string(value)
|
1105
|
+
match = re.match(r"^([0-9]+)\s*(\w*?)(?:byte|B|b)?s?$", value)
|
1106
|
+
|
1107
|
+
if match is None:
|
1108
|
+
raise Invalid(f"Expected number of bytes with unit, got {value}")
|
1109
|
+
|
1110
|
+
mantissa = int(match.group(1))
|
1111
|
+
if match.group(2) not in METRIC_SUFFIXES:
|
1112
|
+
raise Invalid(f"Invalid metric suffix {match.group(2)}")
|
1113
|
+
multiplier = METRIC_SUFFIXES[match.group(2)]
|
1114
|
+
if multiplier < 1:
|
1115
|
+
raise Invalid(
|
1116
|
+
f"Only suffixes with positive exponents are supported. Got {match.group(2)}"
|
1117
|
+
)
|
1118
|
+
return int(mantissa * multiplier)
|
1119
|
+
|
1120
|
+
|
1121
|
+
def hostname(value):
|
1122
|
+
value = string(value)
|
1123
|
+
if re.match(r"^[a-z0-9-]{1,63}$", value, re.IGNORECASE) is not None:
|
1124
|
+
return value
|
1125
|
+
raise Invalid(f"Invalid hostname: {value}")
|
1126
|
+
|
1127
|
+
|
1128
|
+
def domain(value):
|
1129
|
+
value = string(value)
|
1130
|
+
if re.match(vol.DOMAIN_REGEX, value) is not None:
|
1131
|
+
return value
|
1132
|
+
try:
|
1133
|
+
return str(ipv4(value))
|
1134
|
+
except Invalid as err:
|
1135
|
+
raise Invalid(f"Invalid domain: {value}") from err
|
1136
|
+
|
1137
|
+
|
1138
|
+
def domain_name(value):
|
1139
|
+
value = string_strict(value)
|
1140
|
+
if not value:
|
1141
|
+
return value
|
1142
|
+
if not value.startswith("."):
|
1143
|
+
raise Invalid("Domain name must start with .")
|
1144
|
+
if value.startswith(".."):
|
1145
|
+
raise Invalid("Domain name must start with single .")
|
1146
|
+
for c in value:
|
1147
|
+
if not (c.isalnum() or c in "._-"):
|
1148
|
+
raise Invalid(
|
1149
|
+
"Domain name can only have alphanumeric characters and _ or -"
|
1150
|
+
)
|
1151
|
+
return value
|
1152
|
+
|
1153
|
+
|
1154
|
+
def ssid(value):
|
1155
|
+
value = string_strict(value)
|
1156
|
+
if not value:
|
1157
|
+
raise Invalid("SSID can't be empty.")
|
1158
|
+
if len(value) > 32:
|
1159
|
+
raise Invalid("SSID can't be longer than 32 characters")
|
1160
|
+
return value
|
1161
|
+
|
1162
|
+
|
1163
|
+
def ipv4(value):
|
1164
|
+
if isinstance(value, list):
|
1165
|
+
parts = value
|
1166
|
+
elif isinstance(value, str):
|
1167
|
+
parts = value.split(".")
|
1168
|
+
elif isinstance(value, IPAddress):
|
1169
|
+
return value
|
1170
|
+
else:
|
1171
|
+
raise Invalid("IPv4 address must consist of either string or integer list")
|
1172
|
+
if len(parts) != 4:
|
1173
|
+
raise Invalid("IPv4 address must consist of four point-separated integers")
|
1174
|
+
parts_ = list(map(int, parts))
|
1175
|
+
if not all(0 <= x < 256 for x in parts_):
|
1176
|
+
raise Invalid("IPv4 address parts must be in range from 0 to 255")
|
1177
|
+
return IPAddress(*parts_)
|
1178
|
+
|
1179
|
+
|
1180
|
+
def _valid_topic(value):
|
1181
|
+
"""Validate that this is a valid topic name/filter."""
|
1182
|
+
if value is None: # Used to disable publishing and subscribing
|
1183
|
+
return ""
|
1184
|
+
if isinstance(value, dict):
|
1185
|
+
raise Invalid("Can't use dictionary with topic")
|
1186
|
+
value = string(value)
|
1187
|
+
try:
|
1188
|
+
raw_value = value.encode("utf-8")
|
1189
|
+
except UnicodeError as err:
|
1190
|
+
raise Invalid("MQTT topic name/filter must be valid UTF-8 string.") from err
|
1191
|
+
if not raw_value:
|
1192
|
+
raise Invalid("MQTT topic name/filter must not be empty.")
|
1193
|
+
if len(raw_value) > 65535:
|
1194
|
+
raise Invalid(
|
1195
|
+
"MQTT topic name/filter must not be longer than 65535 encoded bytes."
|
1196
|
+
)
|
1197
|
+
if "\0" in value:
|
1198
|
+
raise Invalid("MQTT topic name/filter must not contain null character.")
|
1199
|
+
return value
|
1200
|
+
|
1201
|
+
|
1202
|
+
def subscribe_topic(value):
|
1203
|
+
"""Validate that we can subscribe using this MQTT topic."""
|
1204
|
+
value = _valid_topic(value)
|
1205
|
+
for i in (i for i, c in enumerate(value) if c == "+"):
|
1206
|
+
if (i > 0 and value[i - 1] != "/") or (
|
1207
|
+
i < len(value) - 1 and value[i + 1] != "/"
|
1208
|
+
):
|
1209
|
+
raise Invalid(
|
1210
|
+
"Single-level wildcard must occupy an entire level of the filter"
|
1211
|
+
)
|
1212
|
+
|
1213
|
+
index = value.find("#")
|
1214
|
+
if index != -1:
|
1215
|
+
if index != len(value) - 1:
|
1216
|
+
# If there are multiple wildcards, this will also trigger
|
1217
|
+
raise Invalid(
|
1218
|
+
"Multi-level wildcard must be the last "
|
1219
|
+
"character in the topic filter."
|
1220
|
+
)
|
1221
|
+
if len(value) > 1 and value[index - 1] != "/":
|
1222
|
+
raise Invalid("Multi-level wildcard must be after a topic level separator.")
|
1223
|
+
|
1224
|
+
return value
|
1225
|
+
|
1226
|
+
|
1227
|
+
def publish_topic(value):
|
1228
|
+
"""Validate that we can publish using this MQTT topic."""
|
1229
|
+
value = _valid_topic(value)
|
1230
|
+
if "+" in value or "#" in value:
|
1231
|
+
raise Invalid("Wildcards can not be used in topic names")
|
1232
|
+
return value
|
1233
|
+
|
1234
|
+
|
1235
|
+
def mqtt_payload(value):
|
1236
|
+
if value is None:
|
1237
|
+
return ""
|
1238
|
+
return string(value)
|
1239
|
+
|
1240
|
+
|
1241
|
+
def mqtt_qos(value):
|
1242
|
+
try:
|
1243
|
+
value = int(value)
|
1244
|
+
except (TypeError, ValueError):
|
1245
|
+
# pylint: disable=raise-missing-from
|
1246
|
+
raise Invalid(f"MQTT Quality of Service must be integer, got {value}")
|
1247
|
+
return one_of(0, 1, 2)(value)
|
1248
|
+
|
1249
|
+
|
1250
|
+
def requires_component(comp):
|
1251
|
+
"""Validate that this option can only be specified when the component `comp` is loaded."""
|
1252
|
+
|
1253
|
+
def validator(value):
|
1254
|
+
if comp not in CORE.loaded_integrations:
|
1255
|
+
raise Invalid(f"This option requires component {comp}")
|
1256
|
+
return value
|
1257
|
+
|
1258
|
+
return validator
|
1259
|
+
|
1260
|
+
|
1261
|
+
uint8_t = int_range(min=0, max=255)
|
1262
|
+
uint16_t = int_range(min=0, max=65535)
|
1263
|
+
uint32_t = int_range(min=0, max=4294967295)
|
1264
|
+
uint64_t = int_range(min=0, max=18446744073709551615)
|
1265
|
+
hex_uint8_t = hex_int_range(min=0, max=255)
|
1266
|
+
hex_uint16_t = hex_int_range(min=0, max=65535)
|
1267
|
+
hex_uint32_t = hex_int_range(min=0, max=4294967295)
|
1268
|
+
hex_uint64_t = hex_int_range(min=0, max=18446744073709551615)
|
1269
|
+
i2c_address = hex_uint8_t
|
1270
|
+
|
1271
|
+
|
1272
|
+
def percentage(value):
|
1273
|
+
"""Validate that the value is a percentage.
|
1274
|
+
|
1275
|
+
The resulting value is an integer in the range 0.0 to 1.0.
|
1276
|
+
"""
|
1277
|
+
value = possibly_negative_percentage(value)
|
1278
|
+
return zero_to_one_float(value)
|
1279
|
+
|
1280
|
+
|
1281
|
+
def possibly_negative_percentage(value):
|
1282
|
+
has_percent_sign = False
|
1283
|
+
if isinstance(value, str):
|
1284
|
+
try:
|
1285
|
+
if value.endswith("%"):
|
1286
|
+
has_percent_sign = True
|
1287
|
+
value = float(value[:-1].rstrip()) / 100.0
|
1288
|
+
else:
|
1289
|
+
value = float(value)
|
1290
|
+
except ValueError:
|
1291
|
+
# pylint: disable=raise-missing-from
|
1292
|
+
raise Invalid("invalid number")
|
1293
|
+
try:
|
1294
|
+
if value > 1:
|
1295
|
+
msg = "Percentage must not be higher than 100%."
|
1296
|
+
if not has_percent_sign:
|
1297
|
+
msg += " Please put a percent sign after the number!"
|
1298
|
+
raise Invalid(msg)
|
1299
|
+
if value < -1:
|
1300
|
+
msg = "Percentage must not be smaller than -100%."
|
1301
|
+
if not has_percent_sign:
|
1302
|
+
msg += " Please put a percent sign after the number!"
|
1303
|
+
raise Invalid(msg)
|
1304
|
+
except TypeError:
|
1305
|
+
raise Invalid( # pylint: disable=raise-missing-from
|
1306
|
+
"Expected percentage or float between -1.0 and 1.0"
|
1307
|
+
)
|
1308
|
+
return negative_one_to_one_float(value)
|
1309
|
+
|
1310
|
+
|
1311
|
+
def percentage_int(value):
|
1312
|
+
if isinstance(value, str) and value.endswith("%"):
|
1313
|
+
value = int(value[:-1].rstrip())
|
1314
|
+
return value
|
1315
|
+
|
1316
|
+
|
1317
|
+
def invalid(message):
|
1318
|
+
"""Mark this value as invalid. Each time *any* value is passed here it will result in a
|
1319
|
+
validation error with the given message.
|
1320
|
+
"""
|
1321
|
+
|
1322
|
+
def validator(value):
|
1323
|
+
raise Invalid(message)
|
1324
|
+
|
1325
|
+
return validator
|
1326
|
+
|
1327
|
+
|
1328
|
+
def valid(value):
|
1329
|
+
"""A validator that is always valid and returns the value as-is."""
|
1330
|
+
return value
|
1331
|
+
|
1332
|
+
|
1333
|
+
@contextmanager
|
1334
|
+
def prepend_path(path):
|
1335
|
+
"""A contextmanager helper to prepend a path to all voluptuous errors."""
|
1336
|
+
if not isinstance(path, (list, tuple)):
|
1337
|
+
path = [path]
|
1338
|
+
try:
|
1339
|
+
yield
|
1340
|
+
except vol.Invalid as e:
|
1341
|
+
e.prepend(path)
|
1342
|
+
raise e
|
1343
|
+
|
1344
|
+
|
1345
|
+
@contextmanager
|
1346
|
+
def remove_prepend_path(path):
|
1347
|
+
"""A contextmanager helper to remove a path from a voluptuous error."""
|
1348
|
+
if not isinstance(path, (list, tuple)):
|
1349
|
+
path = [path]
|
1350
|
+
try:
|
1351
|
+
yield
|
1352
|
+
except vol.Invalid as e:
|
1353
|
+
if list_starts_with(e.path, path):
|
1354
|
+
# Can't set e.path (namedtuple
|
1355
|
+
for _ in range(len(path)):
|
1356
|
+
e.path.pop(0)
|
1357
|
+
raise e
|
1358
|
+
|
1359
|
+
|
1360
|
+
def one_of(*values, **kwargs):
|
1361
|
+
"""Validate that the config option is one of the given values.
|
1362
|
+
|
1363
|
+
:param values: The valid values for this type
|
1364
|
+
|
1365
|
+
:Keyword Arguments:
|
1366
|
+
- *lower* (``bool``, default=False): Whether to convert the incoming values to lowercase
|
1367
|
+
strings.
|
1368
|
+
- *upper* (``bool``, default=False): Whether to convert the incoming values to uppercase
|
1369
|
+
strings.
|
1370
|
+
- *int* (``bool``, default=False): Whether to convert the incoming values to integers.
|
1371
|
+
- *float* (``bool``, default=False): Whether to convert the incoming values to floats.
|
1372
|
+
- *space* (``str``, default=' '): What to convert spaces in the input string to.
|
1373
|
+
"""
|
1374
|
+
options = ", ".join(f"'{x}'" for x in values)
|
1375
|
+
lower = kwargs.pop("lower", False)
|
1376
|
+
upper = kwargs.pop("upper", False)
|
1377
|
+
string_ = kwargs.pop("string", False) or lower or upper
|
1378
|
+
to_int = kwargs.pop("int", False)
|
1379
|
+
to_float = kwargs.pop("float", False)
|
1380
|
+
space = kwargs.pop("space", " ")
|
1381
|
+
if kwargs:
|
1382
|
+
raise ValueError
|
1383
|
+
|
1384
|
+
@schema_extractor("one_of")
|
1385
|
+
def validator(value):
|
1386
|
+
if value == SCHEMA_EXTRACT:
|
1387
|
+
return values
|
1388
|
+
|
1389
|
+
if string_:
|
1390
|
+
value = string(value)
|
1391
|
+
value = value.replace(" ", space)
|
1392
|
+
if to_int:
|
1393
|
+
value = int_(value)
|
1394
|
+
if to_float:
|
1395
|
+
value = float_(value)
|
1396
|
+
if lower:
|
1397
|
+
value = Lower(value)
|
1398
|
+
if upper:
|
1399
|
+
value = Upper(value)
|
1400
|
+
if value not in values:
|
1401
|
+
import difflib
|
1402
|
+
|
1403
|
+
options_ = [str(x) for x in values]
|
1404
|
+
option = str(value)
|
1405
|
+
matches = difflib.get_close_matches(option, options_)
|
1406
|
+
if matches:
|
1407
|
+
matches_str = ", ".join(f"'{x}'" for x in matches)
|
1408
|
+
raise Invalid(f"Unknown value '{value}', did you mean {matches_str}?")
|
1409
|
+
raise Invalid(f"Unknown value '{value}', valid options are {options}.")
|
1410
|
+
return value
|
1411
|
+
|
1412
|
+
return validator
|
1413
|
+
|
1414
|
+
|
1415
|
+
def enum(mapping, **kwargs):
|
1416
|
+
"""Validate this config option against an enum mapping.
|
1417
|
+
|
1418
|
+
The mapping should be a dictionary with the key representing the config value name and
|
1419
|
+
a value representing the expression to set during code generation.
|
1420
|
+
|
1421
|
+
Accepts all kwargs of one_of.
|
1422
|
+
"""
|
1423
|
+
assert isinstance(mapping, dict)
|
1424
|
+
one_of_validator = one_of(*mapping, **kwargs)
|
1425
|
+
|
1426
|
+
@schema_extractor("enum")
|
1427
|
+
def validator(value):
|
1428
|
+
if value == SCHEMA_EXTRACT:
|
1429
|
+
return mapping
|
1430
|
+
|
1431
|
+
value = one_of_validator(value)
|
1432
|
+
value = add_class_to_obj(value, core.EnumValue)
|
1433
|
+
value.enum_value = mapping[value]
|
1434
|
+
return value
|
1435
|
+
|
1436
|
+
return validator
|
1437
|
+
|
1438
|
+
|
1439
|
+
LAMBDA_ENTITY_ID_PROG = re.compile(r"\Wid\(\s*([a-zA-Z0-9_]+\.[.a-zA-Z0-9_]+)\s*\)")
|
1440
|
+
|
1441
|
+
|
1442
|
+
def lambda_(value):
|
1443
|
+
"""Coerce this configuration option to a lambda."""
|
1444
|
+
if not isinstance(value, Lambda):
|
1445
|
+
value = make_data_base(Lambda(string_strict(value)), value)
|
1446
|
+
entity_id_parts = re.split(LAMBDA_ENTITY_ID_PROG, value.value)
|
1447
|
+
if len(entity_id_parts) != 1:
|
1448
|
+
entity_ids = " ".join(
|
1449
|
+
f"'{entity_id_parts[i]}'" for i in range(1, len(entity_id_parts), 2)
|
1450
|
+
)
|
1451
|
+
raise Invalid(
|
1452
|
+
f"Lambda contains reference to entity-id-style ID {entity_ids}. The id() wrapper only works for ESPHome-internal types. For importing states from Home Assistant use the 'homeassistant' sensor platforms."
|
1453
|
+
)
|
1454
|
+
return value
|
1455
|
+
|
1456
|
+
|
1457
|
+
def returning_lambda(value):
|
1458
|
+
"""Coerce this configuration option to a lambda.
|
1459
|
+
|
1460
|
+
Additionally, make sure the lambda returns something.
|
1461
|
+
"""
|
1462
|
+
value = lambda_(value)
|
1463
|
+
if "return" not in value.value:
|
1464
|
+
raise Invalid(
|
1465
|
+
"Lambda doesn't contain a 'return' statement, but the lambda "
|
1466
|
+
"is expected to return a value. \n"
|
1467
|
+
"Please make sure the lambda contains at least one "
|
1468
|
+
"return statement."
|
1469
|
+
)
|
1470
|
+
return value
|
1471
|
+
|
1472
|
+
|
1473
|
+
def dimensions(value):
|
1474
|
+
if isinstance(value, list):
|
1475
|
+
if len(value) != 2:
|
1476
|
+
raise Invalid(f"Dimensions must have a length of two, not {len(value)}")
|
1477
|
+
try:
|
1478
|
+
width, height = int(value[0]), int(value[1])
|
1479
|
+
except ValueError:
|
1480
|
+
# pylint: disable=raise-missing-from
|
1481
|
+
raise Invalid("Width and height dimensions must be integers")
|
1482
|
+
if width <= 0 or height <= 0:
|
1483
|
+
raise Invalid("Width and height must at least be 1")
|
1484
|
+
return [width, height]
|
1485
|
+
value = string(value)
|
1486
|
+
match = re.match(r"\s*([0-9]+)\s*[xX]\s*([0-9]+)\s*", value)
|
1487
|
+
if not match:
|
1488
|
+
raise Invalid(
|
1489
|
+
"Invalid value '{}' for dimensions. Only WIDTHxHEIGHT is allowed."
|
1490
|
+
)
|
1491
|
+
return dimensions([match.group(1), match.group(2)])
|
1492
|
+
|
1493
|
+
|
1494
|
+
def directory(value):
|
1495
|
+
import json
|
1496
|
+
|
1497
|
+
value = string(value)
|
1498
|
+
path = CORE.relative_config_path(value)
|
1499
|
+
|
1500
|
+
if CORE.vscode and (
|
1501
|
+
not CORE.ace or os.path.abspath(path) == os.path.abspath(CORE.config_path)
|
1502
|
+
):
|
1503
|
+
print(
|
1504
|
+
json.dumps(
|
1505
|
+
{
|
1506
|
+
"type": "check_directory_exists",
|
1507
|
+
"path": path,
|
1508
|
+
}
|
1509
|
+
)
|
1510
|
+
)
|
1511
|
+
data = json.loads(input())
|
1512
|
+
assert data["type"] == "directory_exists_response"
|
1513
|
+
if data["content"]:
|
1514
|
+
return value
|
1515
|
+
raise Invalid(
|
1516
|
+
f"Could not find directory '{path}'. Please make sure it exists (full path: {os.path.abspath(path)})."
|
1517
|
+
)
|
1518
|
+
|
1519
|
+
if not os.path.exists(path):
|
1520
|
+
raise Invalid(
|
1521
|
+
f"Could not find directory '{path}'. Please make sure it exists (full path: {os.path.abspath(path)})."
|
1522
|
+
)
|
1523
|
+
if not os.path.isdir(path):
|
1524
|
+
raise Invalid(
|
1525
|
+
f"Path '{path}' is not a directory (full path: {os.path.abspath(path)})."
|
1526
|
+
)
|
1527
|
+
return value
|
1528
|
+
|
1529
|
+
|
1530
|
+
def file_(value):
|
1531
|
+
import json
|
1532
|
+
|
1533
|
+
value = string(value)
|
1534
|
+
path = CORE.relative_config_path(value)
|
1535
|
+
|
1536
|
+
if CORE.vscode and (
|
1537
|
+
not CORE.ace or os.path.abspath(path) == os.path.abspath(CORE.config_path)
|
1538
|
+
):
|
1539
|
+
print(
|
1540
|
+
json.dumps(
|
1541
|
+
{
|
1542
|
+
"type": "check_file_exists",
|
1543
|
+
"path": path,
|
1544
|
+
}
|
1545
|
+
)
|
1546
|
+
)
|
1547
|
+
data = json.loads(input())
|
1548
|
+
assert data["type"] == "file_exists_response"
|
1549
|
+
if data["content"]:
|
1550
|
+
return value
|
1551
|
+
raise Invalid(
|
1552
|
+
f"Could not find file '{path}'. Please make sure it exists (full path: {os.path.abspath(path)})."
|
1553
|
+
)
|
1554
|
+
|
1555
|
+
if not os.path.exists(path):
|
1556
|
+
raise Invalid(
|
1557
|
+
f"Could not find file '{path}'. Please make sure it exists (full path: {os.path.abspath(path)})."
|
1558
|
+
)
|
1559
|
+
if not os.path.isfile(path):
|
1560
|
+
raise Invalid(
|
1561
|
+
f"Path '{path}' is not a file (full path: {os.path.abspath(path)})."
|
1562
|
+
)
|
1563
|
+
return value
|
1564
|
+
|
1565
|
+
|
1566
|
+
ENTITY_ID_CHARACTERS = "abcdefghijklmnopqrstuvwxyz0123456789_"
|
1567
|
+
|
1568
|
+
|
1569
|
+
def entity_id(value):
|
1570
|
+
"""Validate that this option represents a valid Home Assistant entity id.
|
1571
|
+
|
1572
|
+
Should only be used for 'homeassistant' platforms.
|
1573
|
+
"""
|
1574
|
+
value = string_strict(value).lower()
|
1575
|
+
if value.count(".") != 1:
|
1576
|
+
raise Invalid("Entity ID must have exactly one dot in it")
|
1577
|
+
for x in value.split("."):
|
1578
|
+
for c in x:
|
1579
|
+
if c not in ENTITY_ID_CHARACTERS:
|
1580
|
+
raise Invalid(f"Invalid character for entity ID: {c}")
|
1581
|
+
return value
|
1582
|
+
|
1583
|
+
|
1584
|
+
def extract_keys(schema):
|
1585
|
+
"""Extract the names of the keys from the given schema."""
|
1586
|
+
if isinstance(schema, Schema):
|
1587
|
+
schema = schema.schema
|
1588
|
+
assert isinstance(schema, dict)
|
1589
|
+
keys = []
|
1590
|
+
for skey in list(schema.keys()):
|
1591
|
+
if isinstance(skey, str):
|
1592
|
+
keys.append(skey)
|
1593
|
+
elif isinstance(skey, vol.Marker) and isinstance(skey.schema, str):
|
1594
|
+
keys.append(skey.schema)
|
1595
|
+
else:
|
1596
|
+
raise ValueError()
|
1597
|
+
keys.sort()
|
1598
|
+
return keys
|
1599
|
+
|
1600
|
+
|
1601
|
+
@schema_extractor_typed
|
1602
|
+
def typed_schema(schemas, **kwargs):
|
1603
|
+
"""Create a schema that has a key to distinguish between schemas"""
|
1604
|
+
key = kwargs.pop("key", CONF_TYPE)
|
1605
|
+
default_schema_option = kwargs.pop("default_type", None)
|
1606
|
+
enum_mapping = kwargs.pop("enum", None)
|
1607
|
+
if enum_mapping is not None:
|
1608
|
+
assert isinstance(enum_mapping, dict)
|
1609
|
+
assert set(enum_mapping.keys()) == set(schemas.keys())
|
1610
|
+
key_validator = one_of(*schemas, **kwargs)
|
1611
|
+
|
1612
|
+
def validator(value):
|
1613
|
+
if not isinstance(value, dict):
|
1614
|
+
raise Invalid("Value must be dict")
|
1615
|
+
value = value.copy()
|
1616
|
+
schema_option = value.pop(key, default_schema_option)
|
1617
|
+
if schema_option is None:
|
1618
|
+
raise Invalid(f"{key} not specified!")
|
1619
|
+
key_v = key_validator(schema_option)
|
1620
|
+
if enum_mapping is not None:
|
1621
|
+
key_v = add_class_to_obj(key_v, core.EnumValue)
|
1622
|
+
key_v.enum_value = enum_mapping[key_v]
|
1623
|
+
value = Schema(schemas[key_v])(value)
|
1624
|
+
value[key] = key_v
|
1625
|
+
return value
|
1626
|
+
|
1627
|
+
return validator
|
1628
|
+
|
1629
|
+
|
1630
|
+
class GenerateID(Optional):
|
1631
|
+
"""Mark this key as being an auto-generated ID key."""
|
1632
|
+
|
1633
|
+
def __init__(self, key=CONF_ID):
|
1634
|
+
super().__init__(key, default=lambda: None)
|
1635
|
+
|
1636
|
+
|
1637
|
+
def _get_priority_default(*args):
|
1638
|
+
for arg in args:
|
1639
|
+
if arg is not vol.UNDEFINED:
|
1640
|
+
return arg
|
1641
|
+
return vol.UNDEFINED
|
1642
|
+
|
1643
|
+
|
1644
|
+
class SplitDefault(Optional):
|
1645
|
+
"""Mark this key to have a split default for ESP8266/ESP32."""
|
1646
|
+
|
1647
|
+
def __init__(
|
1648
|
+
self,
|
1649
|
+
key,
|
1650
|
+
esp8266=vol.UNDEFINED,
|
1651
|
+
esp32=vol.UNDEFINED,
|
1652
|
+
esp32_arduino=vol.UNDEFINED,
|
1653
|
+
esp32_idf=vol.UNDEFINED,
|
1654
|
+
esp32_s2=vol.UNDEFINED,
|
1655
|
+
esp32_s2_arduino=vol.UNDEFINED,
|
1656
|
+
esp32_s2_idf=vol.UNDEFINED,
|
1657
|
+
esp32_s3=vol.UNDEFINED,
|
1658
|
+
esp32_s3_arduino=vol.UNDEFINED,
|
1659
|
+
esp32_s3_idf=vol.UNDEFINED,
|
1660
|
+
esp32_c3=vol.UNDEFINED,
|
1661
|
+
esp32_c3_arduino=vol.UNDEFINED,
|
1662
|
+
esp32_c3_idf=vol.UNDEFINED,
|
1663
|
+
rp2040=vol.UNDEFINED,
|
1664
|
+
bk72xx=vol.UNDEFINED,
|
1665
|
+
rtl87xx=vol.UNDEFINED,
|
1666
|
+
host=vol.UNDEFINED,
|
1667
|
+
):
|
1668
|
+
super().__init__(key)
|
1669
|
+
self._esp8266_default = vol.default_factory(esp8266)
|
1670
|
+
self._esp32_arduino_default = vol.default_factory(
|
1671
|
+
_get_priority_default(esp32_arduino, esp32)
|
1672
|
+
)
|
1673
|
+
self._esp32_idf_default = vol.default_factory(
|
1674
|
+
_get_priority_default(esp32_idf, esp32)
|
1675
|
+
)
|
1676
|
+
self._esp32_s2_arduino_default = vol.default_factory(
|
1677
|
+
_get_priority_default(esp32_s2_arduino, esp32_s2, esp32_arduino, esp32)
|
1678
|
+
)
|
1679
|
+
self._esp32_s2_idf_default = vol.default_factory(
|
1680
|
+
_get_priority_default(esp32_s2_idf, esp32_s2, esp32_idf, esp32)
|
1681
|
+
)
|
1682
|
+
self._esp32_s3_arduino_default = vol.default_factory(
|
1683
|
+
_get_priority_default(esp32_s3_arduino, esp32_s3, esp32_arduino, esp32)
|
1684
|
+
)
|
1685
|
+
self._esp32_s3_idf_default = vol.default_factory(
|
1686
|
+
_get_priority_default(esp32_s3_idf, esp32_s3, esp32_idf, esp32)
|
1687
|
+
)
|
1688
|
+
self._esp32_c3_arduino_default = vol.default_factory(
|
1689
|
+
_get_priority_default(esp32_c3_arduino, esp32_c3, esp32_arduino, esp32)
|
1690
|
+
)
|
1691
|
+
self._esp32_c3_idf_default = vol.default_factory(
|
1692
|
+
_get_priority_default(esp32_c3_idf, esp32_c3, esp32_idf, esp32)
|
1693
|
+
)
|
1694
|
+
self._rp2040_default = vol.default_factory(rp2040)
|
1695
|
+
self._bk72xx_default = vol.default_factory(bk72xx)
|
1696
|
+
self._rtl87xx_default = vol.default_factory(rtl87xx)
|
1697
|
+
self._host_default = vol.default_factory(host)
|
1698
|
+
|
1699
|
+
@property
|
1700
|
+
def default(self):
|
1701
|
+
if CORE.is_esp8266:
|
1702
|
+
return self._esp8266_default
|
1703
|
+
if CORE.is_esp32:
|
1704
|
+
from esphome.components.esp32 import get_esp32_variant
|
1705
|
+
from esphome.components.esp32.const import (
|
1706
|
+
VARIANT_ESP32C3,
|
1707
|
+
VARIANT_ESP32S2,
|
1708
|
+
VARIANT_ESP32S3,
|
1709
|
+
)
|
1710
|
+
|
1711
|
+
variant = get_esp32_variant()
|
1712
|
+
if variant == VARIANT_ESP32S2:
|
1713
|
+
if CORE.using_arduino:
|
1714
|
+
return self._esp32_s2_arduino_default
|
1715
|
+
if CORE.using_esp_idf:
|
1716
|
+
return self._esp32_s2_idf_default
|
1717
|
+
elif variant == VARIANT_ESP32S3:
|
1718
|
+
if CORE.using_arduino:
|
1719
|
+
return self._esp32_s3_arduino_default
|
1720
|
+
if CORE.using_esp_idf:
|
1721
|
+
return self._esp32_s3_idf_default
|
1722
|
+
elif variant == VARIANT_ESP32C3:
|
1723
|
+
if CORE.using_arduino:
|
1724
|
+
return self._esp32_c3_arduino_default
|
1725
|
+
if CORE.using_esp_idf:
|
1726
|
+
return self._esp32_c3_idf_default
|
1727
|
+
else:
|
1728
|
+
if CORE.using_arduino:
|
1729
|
+
return self._esp32_arduino_default
|
1730
|
+
if CORE.using_esp_idf:
|
1731
|
+
return self._esp32_idf_default
|
1732
|
+
if CORE.is_rp2040:
|
1733
|
+
return self._rp2040_default
|
1734
|
+
if CORE.is_bk72xx:
|
1735
|
+
return self._bk72xx_default
|
1736
|
+
if CORE.is_rtl87xx:
|
1737
|
+
return self._rtl87xx_default
|
1738
|
+
if CORE.is_host:
|
1739
|
+
return self._host_default
|
1740
|
+
raise NotImplementedError
|
1741
|
+
|
1742
|
+
@default.setter
|
1743
|
+
def default(self, value):
|
1744
|
+
# Ignore default set from vol.Optional
|
1745
|
+
pass
|
1746
|
+
|
1747
|
+
|
1748
|
+
class OnlyWith(Optional):
|
1749
|
+
"""Set the default value only if the given component is loaded."""
|
1750
|
+
|
1751
|
+
def __init__(self, key, component, default=None):
|
1752
|
+
super().__init__(key)
|
1753
|
+
self._component = component
|
1754
|
+
self._default = vol.default_factory(default)
|
1755
|
+
|
1756
|
+
@property
|
1757
|
+
def default(self):
|
1758
|
+
if self._component in CORE.loaded_integrations:
|
1759
|
+
return self._default
|
1760
|
+
return vol.UNDEFINED
|
1761
|
+
|
1762
|
+
@default.setter
|
1763
|
+
def default(self, value):
|
1764
|
+
# Ignore default set from vol.Optional
|
1765
|
+
pass
|
1766
|
+
|
1767
|
+
|
1768
|
+
def _entity_base_validator(config):
|
1769
|
+
if CONF_NAME not in config and CONF_ID not in config:
|
1770
|
+
raise Invalid("At least one of 'id:' or 'name:' is required!")
|
1771
|
+
if CONF_NAME not in config:
|
1772
|
+
id = config[CONF_ID]
|
1773
|
+
if not id.is_manual:
|
1774
|
+
raise Invalid("At least one of 'id:' or 'name:' is required!")
|
1775
|
+
config[CONF_NAME] = id.id
|
1776
|
+
config[CONF_INTERNAL] = True
|
1777
|
+
return config
|
1778
|
+
if config[CONF_NAME] is None:
|
1779
|
+
config[CONF_NAME] = ""
|
1780
|
+
return config
|
1781
|
+
|
1782
|
+
|
1783
|
+
def ensure_schema(schema):
|
1784
|
+
if not isinstance(schema, vol.Schema):
|
1785
|
+
return Schema(schema)
|
1786
|
+
return schema
|
1787
|
+
|
1788
|
+
|
1789
|
+
def validate_registry_entry(name, registry):
|
1790
|
+
base_schema = ensure_schema(registry.base_schema).extend(
|
1791
|
+
{
|
1792
|
+
Optional(CONF_TYPE_ID): valid,
|
1793
|
+
},
|
1794
|
+
extra=ALLOW_EXTRA,
|
1795
|
+
)
|
1796
|
+
ignore_keys = extract_keys(base_schema)
|
1797
|
+
|
1798
|
+
@schema_extractor_registry(registry)
|
1799
|
+
def validator(value):
|
1800
|
+
if isinstance(value, str):
|
1801
|
+
value = {value: {}}
|
1802
|
+
if not isinstance(value, dict):
|
1803
|
+
raise Invalid(
|
1804
|
+
f"{name.title()} must consist of key-value mapping! Got {value}"
|
1805
|
+
)
|
1806
|
+
key = next((x for x in value if x not in ignore_keys), None)
|
1807
|
+
if key is None:
|
1808
|
+
raise Invalid(f"Key missing from {name}! Got {value}")
|
1809
|
+
if key not in registry:
|
1810
|
+
raise Invalid(f"Unable to find {name} with the name '{key}'", [key])
|
1811
|
+
key2 = next((x for x in value if x != key and x not in ignore_keys), None)
|
1812
|
+
if key2 is not None:
|
1813
|
+
raise Invalid(
|
1814
|
+
f"Cannot have two {name}s in one item. Key '{key}' overrides '{key2}'! "
|
1815
|
+
f"Did you forget to indent the block inside the {key}?"
|
1816
|
+
)
|
1817
|
+
|
1818
|
+
if value[key] is None:
|
1819
|
+
value[key] = {}
|
1820
|
+
|
1821
|
+
registry_entry = registry[key]
|
1822
|
+
|
1823
|
+
value = value.copy()
|
1824
|
+
|
1825
|
+
with prepend_path([key]):
|
1826
|
+
value[key] = registry_entry.schema(value[key])
|
1827
|
+
|
1828
|
+
if registry_entry.type_id is not None:
|
1829
|
+
my_base_schema = base_schema.extend(
|
1830
|
+
{GenerateID(CONF_TYPE_ID): declare_id(registry_entry.type_id)}
|
1831
|
+
)
|
1832
|
+
value = my_base_schema(value)
|
1833
|
+
|
1834
|
+
return value
|
1835
|
+
|
1836
|
+
return validator
|
1837
|
+
|
1838
|
+
|
1839
|
+
def none(value):
|
1840
|
+
if value in ("none", "None"):
|
1841
|
+
return None
|
1842
|
+
raise Invalid("Must be none")
|
1843
|
+
|
1844
|
+
|
1845
|
+
def requires_friendly_name(message):
|
1846
|
+
def validate(value):
|
1847
|
+
if CORE.friendly_name is None:
|
1848
|
+
raise Invalid(message)
|
1849
|
+
return value
|
1850
|
+
|
1851
|
+
return validate
|
1852
|
+
|
1853
|
+
|
1854
|
+
def validate_registry(name, registry):
|
1855
|
+
return ensure_list(validate_registry_entry(name, registry))
|
1856
|
+
|
1857
|
+
|
1858
|
+
def maybe_simple_value(*validators, **kwargs):
|
1859
|
+
key = kwargs.pop("key", CONF_VALUE)
|
1860
|
+
validator = All(*validators)
|
1861
|
+
|
1862
|
+
@schema_extractor("maybe")
|
1863
|
+
def validate(value):
|
1864
|
+
if value == SCHEMA_EXTRACT:
|
1865
|
+
return (validator, key)
|
1866
|
+
|
1867
|
+
if isinstance(value, dict) and key in value:
|
1868
|
+
return validator(value)
|
1869
|
+
return validator({key: value})
|
1870
|
+
|
1871
|
+
return validate
|
1872
|
+
|
1873
|
+
|
1874
|
+
ENTITY_CATEGORIES = {
|
1875
|
+
ENTITY_CATEGORY_NONE: cg.EntityCategory.ENTITY_CATEGORY_NONE,
|
1876
|
+
ENTITY_CATEGORY_CONFIG: cg.EntityCategory.ENTITY_CATEGORY_CONFIG,
|
1877
|
+
ENTITY_CATEGORY_DIAGNOSTIC: cg.EntityCategory.ENTITY_CATEGORY_DIAGNOSTIC,
|
1878
|
+
}
|
1879
|
+
|
1880
|
+
|
1881
|
+
def entity_category(value):
|
1882
|
+
return enum(ENTITY_CATEGORIES, lower=True)(value)
|
1883
|
+
|
1884
|
+
|
1885
|
+
MQTT_COMPONENT_AVAILABILITY_SCHEMA = Schema(
|
1886
|
+
{
|
1887
|
+
Required(CONF_TOPIC): subscribe_topic,
|
1888
|
+
Optional(CONF_PAYLOAD_AVAILABLE, default="online"): mqtt_payload,
|
1889
|
+
Optional(CONF_PAYLOAD_NOT_AVAILABLE, default="offline"): mqtt_payload,
|
1890
|
+
}
|
1891
|
+
)
|
1892
|
+
|
1893
|
+
MQTT_COMPONENT_SCHEMA = Schema(
|
1894
|
+
{
|
1895
|
+
Optional(CONF_QOS): All(requires_component("mqtt"), mqtt_qos),
|
1896
|
+
Optional(CONF_RETAIN): All(requires_component("mqtt"), boolean),
|
1897
|
+
Optional(CONF_DISCOVERY): All(requires_component("mqtt"), boolean),
|
1898
|
+
Optional(CONF_SUBSCRIBE_QOS): All(requires_component("mqtt"), mqtt_qos),
|
1899
|
+
Optional(CONF_STATE_TOPIC): All(requires_component("mqtt"), publish_topic),
|
1900
|
+
Optional(CONF_AVAILABILITY): All(
|
1901
|
+
requires_component("mqtt"), Any(None, MQTT_COMPONENT_AVAILABILITY_SCHEMA)
|
1902
|
+
),
|
1903
|
+
}
|
1904
|
+
)
|
1905
|
+
|
1906
|
+
MQTT_COMMAND_COMPONENT_SCHEMA = MQTT_COMPONENT_SCHEMA.extend(
|
1907
|
+
{
|
1908
|
+
Optional(CONF_COMMAND_TOPIC): All(requires_component("mqtt"), subscribe_topic),
|
1909
|
+
Optional(CONF_COMMAND_RETAIN): All(requires_component("mqtt"), boolean),
|
1910
|
+
}
|
1911
|
+
)
|
1912
|
+
|
1913
|
+
|
1914
|
+
def _validate_entity_name(value):
|
1915
|
+
value = string(value)
|
1916
|
+
try:
|
1917
|
+
value = none(value) # pylint: disable=assignment-from-none
|
1918
|
+
except Invalid:
|
1919
|
+
pass
|
1920
|
+
else:
|
1921
|
+
requires_friendly_name(
|
1922
|
+
"Name cannot be None when esphome->friendly_name is not set!"
|
1923
|
+
)(value)
|
1924
|
+
return value
|
1925
|
+
|
1926
|
+
|
1927
|
+
ENTITY_BASE_SCHEMA = Schema(
|
1928
|
+
{
|
1929
|
+
Optional(CONF_NAME): _validate_entity_name,
|
1930
|
+
Optional(CONF_INTERNAL): boolean,
|
1931
|
+
Optional(CONF_DISABLED_BY_DEFAULT, default=False): boolean,
|
1932
|
+
Optional(CONF_ICON): icon,
|
1933
|
+
Optional(CONF_ENTITY_CATEGORY): entity_category,
|
1934
|
+
}
|
1935
|
+
)
|
1936
|
+
|
1937
|
+
ENTITY_BASE_SCHEMA.add_extra(_entity_base_validator)
|
1938
|
+
|
1939
|
+
COMPONENT_SCHEMA = Schema({Optional(CONF_SETUP_PRIORITY): float_})
|
1940
|
+
|
1941
|
+
|
1942
|
+
def polling_component_schema(default_update_interval):
|
1943
|
+
"""Validate that this component represents a PollingComponent with a configurable
|
1944
|
+
update_interval.
|
1945
|
+
|
1946
|
+
:param default_update_interval: The default update interval to set for the integration.
|
1947
|
+
"""
|
1948
|
+
if default_update_interval is None:
|
1949
|
+
return COMPONENT_SCHEMA.extend(
|
1950
|
+
{
|
1951
|
+
Required(CONF_UPDATE_INTERVAL): default_update_interval,
|
1952
|
+
}
|
1953
|
+
)
|
1954
|
+
assert isinstance(default_update_interval, str)
|
1955
|
+
return COMPONENT_SCHEMA.extend(
|
1956
|
+
{
|
1957
|
+
Optional(
|
1958
|
+
CONF_UPDATE_INTERVAL, default=default_update_interval
|
1959
|
+
): update_interval,
|
1960
|
+
}
|
1961
|
+
)
|
1962
|
+
|
1963
|
+
|
1964
|
+
def url(value):
|
1965
|
+
import urllib.parse
|
1966
|
+
|
1967
|
+
value = string_strict(value)
|
1968
|
+
try:
|
1969
|
+
parsed = urllib.parse.urlparse(value)
|
1970
|
+
except ValueError as e:
|
1971
|
+
raise Invalid("Not a valid URL") from e
|
1972
|
+
|
1973
|
+
if parsed.scheme and parsed.netloc or parsed.scheme == "file":
|
1974
|
+
return parsed.geturl()
|
1975
|
+
raise Invalid("Expected a file scheme or a URL scheme with host")
|
1976
|
+
|
1977
|
+
|
1978
|
+
def git_ref(value):
|
1979
|
+
if re.match(r"[a-zA-Z0-9_./-]+", value) is None:
|
1980
|
+
raise Invalid("Not a valid git ref")
|
1981
|
+
return value
|
1982
|
+
|
1983
|
+
|
1984
|
+
def source_refresh(value: str):
|
1985
|
+
if value.lower() == "always":
|
1986
|
+
return source_refresh("0s")
|
1987
|
+
if value.lower() == "never":
|
1988
|
+
return source_refresh("365250d")
|
1989
|
+
return positive_time_period_seconds(value)
|
1990
|
+
|
1991
|
+
|
1992
|
+
@dataclass(frozen=True, order=True)
|
1993
|
+
class Version:
|
1994
|
+
major: int
|
1995
|
+
minor: int
|
1996
|
+
patch: int
|
1997
|
+
|
1998
|
+
def __str__(self):
|
1999
|
+
return f"{self.major}.{self.minor}.{self.patch}"
|
2000
|
+
|
2001
|
+
@classmethod
|
2002
|
+
def parse(cls, value: str) -> "Version":
|
2003
|
+
match = re.match(r"^(\d+).(\d+).(\d+)-?\w*$", value)
|
2004
|
+
if match is None:
|
2005
|
+
raise ValueError(f"Not a valid version number {value}")
|
2006
|
+
major = int(match[1])
|
2007
|
+
minor = int(match[2])
|
2008
|
+
patch = int(match[3])
|
2009
|
+
return Version(major=major, minor=minor, patch=patch)
|
2010
|
+
|
2011
|
+
|
2012
|
+
def version_number(value):
|
2013
|
+
value = string_strict(value)
|
2014
|
+
try:
|
2015
|
+
return str(Version.parse(value))
|
2016
|
+
except ValueError as e:
|
2017
|
+
raise Invalid("Not a valid version number") from e
|
2018
|
+
|
2019
|
+
|
2020
|
+
def validate_esphome_version(value: str):
|
2021
|
+
min_version = Version.parse(value)
|
2022
|
+
current_version = Version.parse(ESPHOME_VERSION)
|
2023
|
+
if current_version < min_version:
|
2024
|
+
raise Invalid(
|
2025
|
+
f"Your ESPHome version is too old. Please update to at least {min_version}"
|
2026
|
+
)
|
2027
|
+
return value
|
2028
|
+
|
2029
|
+
|
2030
|
+
def platformio_version_constraint(value):
|
2031
|
+
# for documentation on valid version constraints:
|
2032
|
+
# https://docs.platformio.org/en/latest/core/userguide/platforms/cmd_install.html#cmd-platform-install
|
2033
|
+
|
2034
|
+
value = string_strict(value)
|
2035
|
+
constraints = []
|
2036
|
+
for item in value.split(","):
|
2037
|
+
# find and strip prefix operator
|
2038
|
+
op = None
|
2039
|
+
for test_op in ("^", "~", ">=", ">", "<=", "<", "!="):
|
2040
|
+
if item.startswith(test_op):
|
2041
|
+
op = test_op
|
2042
|
+
item = item[len(test_op) :]
|
2043
|
+
break
|
2044
|
+
|
2045
|
+
constraints.append((op, version_number(item)))
|
2046
|
+
return constraints
|
2047
|
+
|
2048
|
+
|
2049
|
+
def require_framework_version(
|
2050
|
+
*,
|
2051
|
+
esp_idf=None,
|
2052
|
+
esp32_arduino=None,
|
2053
|
+
esp8266_arduino=None,
|
2054
|
+
rp2040_arduino=None,
|
2055
|
+
bk72xx_libretiny=None,
|
2056
|
+
host=None,
|
2057
|
+
max_version=False,
|
2058
|
+
extra_message=None,
|
2059
|
+
):
|
2060
|
+
def validator(value):
|
2061
|
+
core_data = CORE.data[KEY_CORE]
|
2062
|
+
framework = core_data[KEY_TARGET_FRAMEWORK]
|
2063
|
+
if framework == "esp-idf":
|
2064
|
+
if esp_idf is None:
|
2065
|
+
msg = "This feature is incompatible with esp-idf"
|
2066
|
+
if extra_message:
|
2067
|
+
msg += f". {extra_message}"
|
2068
|
+
raise Invalid(msg)
|
2069
|
+
required = esp_idf
|
2070
|
+
elif CORE.is_bk72xx and framework == "arduino":
|
2071
|
+
if bk72xx_libretiny is None:
|
2072
|
+
msg = "This feature is incompatible with BK72XX"
|
2073
|
+
if extra_message:
|
2074
|
+
msg += f". {extra_message}"
|
2075
|
+
raise Invalid(msg)
|
2076
|
+
required = bk72xx_libretiny
|
2077
|
+
elif CORE.is_esp32 and framework == "arduino":
|
2078
|
+
if esp32_arduino is None:
|
2079
|
+
msg = "This feature is incompatible with ESP32 using arduino framework"
|
2080
|
+
if extra_message:
|
2081
|
+
msg += f". {extra_message}"
|
2082
|
+
raise Invalid(msg)
|
2083
|
+
required = esp32_arduino
|
2084
|
+
elif CORE.is_esp8266 and framework == "arduino":
|
2085
|
+
if esp8266_arduino is None:
|
2086
|
+
msg = "This feature is incompatible with ESP8266"
|
2087
|
+
if extra_message:
|
2088
|
+
msg += f". {extra_message}"
|
2089
|
+
raise Invalid(msg)
|
2090
|
+
required = esp8266_arduino
|
2091
|
+
elif CORE.is_rp2040 and framework == "arduino":
|
2092
|
+
if rp2040_arduino is None:
|
2093
|
+
msg = "This feature is incompatible with RP2040"
|
2094
|
+
if extra_message:
|
2095
|
+
msg += f". {extra_message}"
|
2096
|
+
raise Invalid(msg)
|
2097
|
+
required = rp2040_arduino
|
2098
|
+
elif CORE.is_host and framework == "host":
|
2099
|
+
if host is None:
|
2100
|
+
msg = "This feature is incompatible with host platform"
|
2101
|
+
if extra_message:
|
2102
|
+
msg += f". {extra_message}"
|
2103
|
+
raise Invalid(msg)
|
2104
|
+
required = host
|
2105
|
+
else:
|
2106
|
+
raise Invalid(
|
2107
|
+
f"""
|
2108
|
+
Internal Error: require_framework_version does not support this platform configuration
|
2109
|
+
platform: {core_data[KEY_TARGET_PLATFORM]}
|
2110
|
+
framework: {framework}
|
2111
|
+
|
2112
|
+
Please report this issue on GitHub -> https://github.com/esphome/issues/issues/new?template=bug_report.yml.
|
2113
|
+
"""
|
2114
|
+
)
|
2115
|
+
|
2116
|
+
if max_version:
|
2117
|
+
if core_data[KEY_FRAMEWORK_VERSION] > required:
|
2118
|
+
msg = f"This feature requires framework version {required} or lower"
|
2119
|
+
if extra_message:
|
2120
|
+
msg += f". {extra_message}"
|
2121
|
+
raise Invalid(msg)
|
2122
|
+
return value
|
2123
|
+
|
2124
|
+
if core_data[KEY_FRAMEWORK_VERSION] < required:
|
2125
|
+
msg = f"This feature requires at least framework version {required}"
|
2126
|
+
if extra_message:
|
2127
|
+
msg += f". {extra_message}"
|
2128
|
+
raise Invalid(msg)
|
2129
|
+
return value
|
2130
|
+
|
2131
|
+
return validator
|
2132
|
+
|
2133
|
+
|
2134
|
+
def require_esphome_version(year, month, patch):
|
2135
|
+
def validator(value):
|
2136
|
+
esphome_version = parse_esphome_version()
|
2137
|
+
if esphome_version < (year, month, patch):
|
2138
|
+
requires_version = f"{year}.{month}.{patch}"
|
2139
|
+
raise Invalid(
|
2140
|
+
f"This component requires at least ESPHome version {requires_version}"
|
2141
|
+
)
|
2142
|
+
return value
|
2143
|
+
|
2144
|
+
return validator
|
2145
|
+
|
2146
|
+
|
2147
|
+
@contextmanager
|
2148
|
+
def suppress_invalid():
|
2149
|
+
try:
|
2150
|
+
yield
|
2151
|
+
except vol.Invalid:
|
2152
|
+
pass
|
2153
|
+
|
2154
|
+
|
2155
|
+
GIT_SCHEMA = Schema(
|
2156
|
+
{
|
2157
|
+
Required(CONF_URL): url,
|
2158
|
+
Optional(CONF_REF): git_ref,
|
2159
|
+
Optional(CONF_USERNAME): string,
|
2160
|
+
Optional(CONF_PASSWORD): string,
|
2161
|
+
Optional(CONF_PATH): string,
|
2162
|
+
}
|
2163
|
+
)
|
2164
|
+
LOCAL_SCHEMA = Schema(
|
2165
|
+
{
|
2166
|
+
Required(CONF_PATH): directory,
|
2167
|
+
}
|
2168
|
+
)
|
2169
|
+
|
2170
|
+
|
2171
|
+
def validate_source_shorthand(value):
|
2172
|
+
if not isinstance(value, str):
|
2173
|
+
raise Invalid("Shorthand only for strings")
|
2174
|
+
try:
|
2175
|
+
return SOURCE_SCHEMA({CONF_TYPE: TYPE_LOCAL, CONF_PATH: value})
|
2176
|
+
except Invalid:
|
2177
|
+
pass
|
2178
|
+
# Regex for GitHub repo name with optional branch/tag
|
2179
|
+
# Note: git allows other branch/tag names as well, but never seen them used before
|
2180
|
+
m = re.match(
|
2181
|
+
r"github://(?:([a-zA-Z0-9\-]+)/([a-zA-Z0-9\-\._]+)(?:@([a-zA-Z0-9\-_.\./]+))?|pr#([0-9]+))",
|
2182
|
+
value,
|
2183
|
+
)
|
2184
|
+
if m is None:
|
2185
|
+
raise Invalid(
|
2186
|
+
"Source is not a file system path, in expected github://username/name[@branch-or-tag] or github://pr#1234 format!"
|
2187
|
+
)
|
2188
|
+
if m.group(4):
|
2189
|
+
conf = {
|
2190
|
+
CONF_TYPE: TYPE_GIT,
|
2191
|
+
CONF_URL: "https://github.com/esphome/esphome.git",
|
2192
|
+
CONF_REF: f"pull/{m.group(4)}/head",
|
2193
|
+
}
|
2194
|
+
else:
|
2195
|
+
conf = {
|
2196
|
+
CONF_TYPE: TYPE_GIT,
|
2197
|
+
CONF_URL: f"https://github.com/{m.group(1)}/{m.group(2)}.git",
|
2198
|
+
}
|
2199
|
+
if m.group(3):
|
2200
|
+
conf[CONF_REF] = m.group(3)
|
2201
|
+
|
2202
|
+
return SOURCE_SCHEMA(conf)
|
2203
|
+
|
2204
|
+
|
2205
|
+
SOURCE_SCHEMA = Any(
|
2206
|
+
validate_source_shorthand,
|
2207
|
+
typed_schema(
|
2208
|
+
{
|
2209
|
+
TYPE_GIT: GIT_SCHEMA,
|
2210
|
+
TYPE_LOCAL: LOCAL_SCHEMA,
|
2211
|
+
}
|
2212
|
+
),
|
2213
|
+
)
|
2214
|
+
|
2215
|
+
|
2216
|
+
def rename_key(old_key, new_key):
|
2217
|
+
def validator(config: dict) -> dict:
|
2218
|
+
config = config.copy()
|
2219
|
+
if old_key in config:
|
2220
|
+
config[new_key] = config.pop(old_key)
|
2221
|
+
return config
|
2222
|
+
|
2223
|
+
return validator
|