From 6682c43dfaeb1c006943ae546145e5f22262cadb Mon Sep 17 00:00:00 2001 From: Otto Winter Date: Wed, 17 Apr 2019 12:06:00 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=97=20Merge=20C++=20into=20python=20co?= =?UTF-8?q?debase=20(#504)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ## Description: Move esphome-core codebase into esphome (and a bunch of other refactors). See https://github.com/esphome/feature-requests/issues/97 Yes this is a shit ton of work and no there's no way to automate it :( But it will be worth it 👍 Progress: - Core support (file copy etc): 80% - Base Abstractions (light, switch): ~50% - Integrations: ~10% - Working? Yes, (but only with ported components). Other refactors: - Moves all codegen related stuff into a single class: `esphome.codegen` (imported as `cg`) - Rework coroutine syntax - Move from `component/platform.py` to `domain/component.py` structure as with HA - Move all defaults out of C++ and into config validation. - Remove `make_...` helpers from Application class. Reason: Merge conflicts with every single new integration. - Pointer Variables are stored globally instead of locally in setup(). Reason: stack size limit. Future work: - Rework const.py - Move all `CONF_...` into a conf class (usage `conf.UPDATE_INTERVAL` vs `CONF_UPDATE_INTERVAL`). Reason: Less convoluted import block - Enable loading from `custom_components` folder. **Related issue (if applicable):** https://github.com/esphome/feature-requests/issues/97 **Pull request in [esphome-docs](https://github.com/esphome/esphome-docs) with documentation (if applicable):** esphome/esphome-docs# ## Checklist: - [ ] The code change is tested and works locally. - [ ] Tests have been added to verify that the new code works (under `tests/` folder). If user exposed functionality or configuration variables are added/changed: - [ ] Documentation added/updated in [esphomedocs](https://github.com/OttoWinter/esphomedocs). --- .clang-format | 137 ++ .clang-tidy | 127 ++ .gitignore | 80 +- .travis.yml | 38 +- LICENSE | 692 +++++++++- MANIFEST.in | 5 +- esphome/__main__.py | 87 +- esphome/automation.py | 84 +- esphome/codegen.py | 26 + esphome/components/a4988/__init__.py | 0 esphome/components/a4988/a4988.cpp | 49 + esphome/components/a4988/a4988.h | 27 + esphome/components/a4988/stepper.py | 28 + esphome/components/adc/__init__.py | 0 esphome/components/adc/adc_sensor.cpp | 89 ++ esphome/components/adc/adc_sensor.h | 43 + esphome/components/adc/sensor.py | 52 + esphome/components/ads1115.py | 27 - esphome/components/ads1115/__init__.py | 21 + esphome/components/ads1115/ads1115.cpp | 158 +++ esphome/components/ads1115/ads1115.h | 69 + .../{sensor/ads1115.py => ads1115/sensor.py} | 47 +- esphome/components/apds9960.py | 33 - esphome/components/apds9960/__init__.py | 24 + esphome/components/apds9960/apds9960.cpp | 374 +++++ esphome/components/apds9960/apds9960.h | 62 + esphome/components/apds9960/binary_sensor.py | 27 + esphome/components/apds9960/sensor.py | 32 + .../components/{api.py => api/__init__.py} | 102 +- esphome/components/api/api.proto | 506 +++++++ esphome/components/api/api_message.cpp | 87 ++ esphome/components/api/api_message.h | 79 ++ esphome/components/api/api_server.cpp | 1202 +++++++++++++++++ esphome/components/api/api_server.h | 245 ++++ esphome/components/api/basic_messages.cpp | 57 + esphome/components/api/basic_messages.h | 63 + esphome/components/api/command_messages.cpp | 417 ++++++ esphome/components/api/command_messages.h | 162 +++ esphome/components/api/list_entities.cpp | 190 +++ esphome/components/api/list_entities.h | 57 + .../components/api/service_call_message.cpp | 49 + esphome/components/api/service_call_message.h | 53 + esphome/components/api/subscribe_logs.cpp | 26 + esphome/components/api/subscribe_logs.h | 24 + esphome/components/api/subscribe_state.cpp | 77 ++ esphome/components/api/subscribe_state.h | 70 + esphome/components/api/user_services.cpp | 74 + esphome/components/api/user_services.h | 125 ++ esphome/components/api/util.cpp | 353 +++++ esphome/components/api/util.h | 127 ++ esphome/components/bang_bang/__init__.py | 0 .../bang_bang/bang_bang_climate.cpp | 159 +++ .../components/bang_bang/bang_bang_climate.h | 89 ++ esphome/components/bang_bang/climate.py | 57 + esphome/components/bh1750/__init__.py | 0 esphome/components/bh1750/bh1750.cpp | 81 ++ esphome/components/bh1750/bh1750.h | 48 + esphome/components/bh1750/sensor.py | 32 + esphome/components/binary/__init__.py | 3 + esphome/components/binary/fan/__init__.py | 25 + esphome/components/binary/fan/binary_fan.cpp | 48 + esphome/components/binary/fan/binary_fan.h | 27 + esphome/components/binary/light/__init__.py | 18 + .../binary/light/binary_light_output.h | 32 + esphome/components/binary_sensor/__init__.py | 319 ++--- esphome/components/binary_sensor/apds9960.py | 31 - .../components/binary_sensor/automation.cpp | 113 ++ esphome/components/binary_sensor/automation.h | 161 +++ .../binary_sensor/binary_sensor.cpp | 71 + .../components/binary_sensor/binary_sensor.h | 90 ++ esphome/components/binary_sensor/custom.py | 34 - .../binary_sensor/esp32_ble_tracker.py | 24 - .../components/binary_sensor/esp32_touch.py | 56 - esphome/components/binary_sensor/filter.cpp | 68 + esphome/components/binary_sensor/filter.h | 77 ++ esphome/components/binary_sensor/gpio.py | 29 - .../components/binary_sensor/homeassistant.py | 26 - esphome/components/binary_sensor/mpr121.py | 23 - esphome/components/binary_sensor/nextion.py | 28 - esphome/components/binary_sensor/pn532.py | 44 - esphome/components/binary_sensor/rdm6300.py | 25 - .../binary_sensor/remote_receiver.py | 146 -- esphome/components/binary_sensor/status.py | 24 - esphome/components/binary_sensor/template.py | 53 - .../components/binary_sensor/ttp229_lsf.py | 23 - esphome/components/ble_presence/__init__.py | 0 .../components/ble_presence/binary_sensor.py | 24 + .../ble_presence/ble_presence_device.cpp | 16 + .../ble_presence/ble_presence_device.h | 44 + esphome/components/ble_rssi/__init__.py | 0 .../components/ble_rssi/ble_rssi_sensor.cpp | 16 + esphome/components/ble_rssi/ble_rssi_sensor.h | 42 + esphome/components/ble_rssi/sensor.py | 29 + esphome/components/bme280/__init__.py | 0 esphome/components/bme280/bme280.cpp | 318 +++++ esphome/components/bme280/bme280.h | 112 ++ esphome/components/bme280/sensor.py | 77 ++ esphome/components/bme680/__init__.py | 0 esphome/components/bme680/bme680.cpp | 483 +++++++ esphome/components/bme680/bme680.h | 141 ++ esphome/components/bme680/sensor.py | 101 ++ esphome/components/bmp085/__init__.py | 0 esphome/components/bmp085/bmp085.cpp | 138 ++ esphome/components/bmp085/bmp085.h | 47 + esphome/components/bmp085/sensor.py | 35 + esphome/components/bmp280/__init__.py | 0 esphome/components/bmp280/bmp280.cpp | 239 ++++ esphome/components/bmp280/bmp280.h | 95 ++ esphome/components/bmp280/sensor.py | 64 + esphome/components/climate/__init__.py | 110 +- esphome/components/climate/automation.h | 33 + esphome/components/climate/bang_bang.py | 65 - esphome/components/climate/climate.cpp | 259 ++++ esphome/components/climate/climate.h | 218 +++ esphome/components/climate/climate_mode.cpp | 22 + esphome/components/climate/climate_mode.h | 24 + esphome/components/climate/climate_traits.cpp | 57 + esphome/components/climate/climate_traits.h | 68 + esphome/components/cover/__init__.py | 139 +- esphome/components/cover/automation.h | 113 ++ esphome/components/cover/cover.cpp | 214 +++ esphome/components/cover/cover.h | 179 +++ esphome/components/cover/cover_traits.h | 24 + esphome/components/cover/endstop.py | 55 - esphome/components/cover/template.py | 93 -- esphome/components/cover/time_based.py | 44 - esphome/components/cse7766/__init__.py | 0 esphome/components/cse7766/cse7766.cpp | 178 +++ esphome/components/cse7766/cse7766.h | 43 + esphome/components/cse7766/sensor.py | 39 + esphome/components/custom/__init__.py | 3 + .../custom/binary_sensor/__init__.py | 26 + .../binary_sensor/custom_binary_sensor.cpp | 16 + .../binary_sensor/custom_binary_sensor.h | 24 + .../custom.py => custom/output/__init__.py} | 46 +- .../components/custom/output/custom_output.h | 31 + esphome/components/custom/sensor/__init__.py | 27 + .../custom/sensor/custom_sensor.cpp | 16 + .../components/custom/sensor/custom_sensor.h | 22 + esphome/components/custom/switch/__init__.py | 29 + .../custom/switch/custom_switch.cpp | 16 + .../components/custom/switch/custom_switch.h | 22 + .../components/custom/text_sensor/__init__.py | 29 + .../custom/text_sensor/custom_text_sensor.cpp | 16 + .../custom/text_sensor/custom_text_sensor.h | 24 + esphome/components/custom_component.py | 32 - .../components/custom_component/__init__.py | 26 + .../custom_component/custom_component.h | 26 + esphome/components/cwww/__init__.py | 0 esphome/components/cwww/cwww_light_output.h | 41 + esphome/components/cwww/light.py | 25 + esphome/components/dallas.py | 27 - esphome/components/dallas/__init__.py | 26 + .../components/dallas/dallas_component.cpp | 269 ++++ esphome/components/dallas/dallas_component.h | 78 ++ esphome/components/dallas/esp_one_wire.cpp | 217 +++ esphome/components/dallas/esp_one_wire.h | 71 + esphome/components/dallas/sensor.py | 34 + esphome/components/debug.py | 14 - esphome/components/debug/__init__.py | 17 + esphome/components/debug/debug_component.cpp | 210 +++ esphome/components/debug/debug_component.h | 19 + esphome/components/deep_sleep.py | 115 -- esphome/components/deep_sleep/__init__.py | 106 ++ .../deep_sleep/deep_sleep_component.cpp | 93 ++ .../deep_sleep/deep_sleep_component.h | 111 ++ esphome/components/dht/__init__.py | 0 esphome/components/dht/dht.cpp | 194 +++ esphome/components/dht/dht.h | 67 + esphome/components/dht/sensor.py | 50 + esphome/components/dht12/__init__.py | 0 esphome/components/dht12/dht12.cpp | 70 + esphome/components/dht12/dht12.h | 30 + esphome/components/dht12/sensor.py | 33 + esphome/components/display/__init__.py | 112 +- esphome/components/display/display_buffer.cpp | 449 ++++++ esphome/components/display/display_buffer.h | 428 ++++++ esphome/components/display/lcd_gpio.py | 70 - esphome/components/display/lcd_pcf8574.py | 39 - esphome/components/display/max7219.py | 48 - esphome/components/display/nextion.py | 34 - esphome/components/display/ssd1306_i2c.py | 46 - esphome/components/display/ssd1306_spi.py | 66 - .../components/display/waveshare_epaper.py | 87 -- esphome/components/duty_cycle/__init__.py | 0 .../duty_cycle/duty_cycle_sensor.cpp | 60 + .../components/duty_cycle/duty_cycle_sensor.h | 38 + esphome/components/duty_cycle/sensor.py | 23 + esphome/components/endstop/__init__.py | 0 esphome/components/endstop/cover.py | 46 + esphome/components/endstop/endstop_cover.cpp | 173 +++ esphome/components/endstop/endstop_cover.h | 59 + esphome/components/esp32_ble_beacon.py | 40 - .../components/esp32_ble_beacon/__init__.py | 29 + .../esp32_ble_beacon/esp32_ble_beacon.cpp | 134 ++ .../esp32_ble_beacon/esp32_ble_beacon.h | 57 + esphome/components/esp32_ble_tracker.py | 40 - .../components/esp32_ble_tracker/__init__.py | 26 + .../esp32_ble_tracker/binary_sensor.py | 3 + .../esp32_ble_tracker/esp32_ble_tracker.cpp | 480 +++++++ .../esp32_ble_tracker/esp32_ble_tracker.h | 134 ++ .../__init__.py} | 96 +- .../components/esp32_camera/esp32_camera.cpp | 306 +++++ .../components/esp32_camera/esp32_camera.h | 113 ++ esphome/components/esp32_hall/__init__.py | 0 esphome/components/esp32_hall/esp32_hall.cpp | 23 + esphome/components/esp32_hall/esp32_hall.h | 26 + esphome/components/esp32_hall/sensor.py | 25 + esphome/components/esp32_touch.py | 89 -- esphome/components/esp32_touch/__init__.py | 80 ++ .../components/esp32_touch/binary_sensor.py | 50 + .../components/esp32_touch/esp32_touch.cpp | 164 +++ esphome/components/esp32_touch/esp32_touch.h | 70 + esphome/components/esp8266_pwm/__init__.py | 0 .../components/esp8266_pwm/esp8266_pwm.cpp | 49 + esphome/components/esp8266_pwm/esp8266_pwm.h | 30 + esphome/components/esp8266_pwm/output.py | 32 + esphome/components/ethernet.py | 84 -- esphome/components/ethernet/__init__.py | 101 ++ .../ethernet/ethernet_component.cpp | 254 ++++ .../components/ethernet/ethernet_component.h | 81 ++ esphome/components/fan/__init__.py | 164 ++- esphome/components/fan/automation.cpp | 10 + esphome/components/fan/automation.h | 60 + esphome/components/fan/binary.py | 28 - esphome/components/fan/fan_state.cpp | 107 ++ esphome/components/fan/fan_state.h | 76 ++ esphome/components/fan/fan_traits.h | 26 + esphome/components/fan/speed.py | 42 - esphome/components/fastled_base/__init__.py | 46 + .../components/fastled_base/fastled_light.cpp | 61 + .../components/fastled_base/fastled_light.h | 252 ++++ .../components/fastled_clockless/__init__.py | 0 esphome/components/fastled_clockless/light.py | 55 + esphome/components/fastled_spi/__init__.py | 0 esphome/components/fastled_spi/light.py | 35 + .../components/{font.py => font/__init__.py} | 42 +- esphome/components/globals.py | 35 - esphome/components/globals/__init__.py | 39 + .../components/globals/globals_component.h | 53 + esphome/components/gpio/__init__.py | 3 + .../components/gpio/binary_sensor/__init__.py | 21 + .../gpio/binary_sensor/gpio_binary_sensor.cpp | 26 + .../gpio/binary_sensor/gpio_binary_sensor.h | 28 + esphome/components/gpio/output/__init__.py | 21 + .../gpio/output/gpio_binary_output.cpp | 16 + .../gpio/output/gpio_binary_output.h | 29 + esphome/components/gpio/switch/__init__.py | 41 + .../components/gpio/switch/gpio_switch.cpp | 90 ++ esphome/components/gpio/switch/gpio_switch.h | 39 + esphome/components/hdc1080/__init__.py | 0 esphome/components/hdc1080/hdc1080.cpp | 60 + esphome/components/hdc1080/hdc1080.h | 32 + esphome/components/hdc1080/sensor.py | 33 + esphome/components/hlw8012/__init__.py | 0 esphome/components/hlw8012/hlw8012.cpp | 91 ++ esphome/components/hlw8012/hlw8012.h | 48 + esphome/components/hlw8012/sensor.py | 57 + esphome/components/hmc5883l/__init__.py | 0 esphome/components/hmc5883l/hmc5883l.cpp | 145 ++ esphome/components/hmc5883l/hmc5883l.h | 50 + esphome/components/hmc5883l/sensor.py | 71 + esphome/components/homeassistant/__init__.py | 3 + .../homeassistant/binary_sensor/__init__.py | 20 + .../homeassistant_binary_sensor.cpp | 38 + .../homeassistant_binary_sensor.h | 21 + .../homeassistant/sensor/__init__.py | 20 + .../sensor/homeassistant_sensor.cpp | 32 + .../sensor/homeassistant_sensor.h | 21 + .../homeassistant/text_sensor/__init__.py | 21 + .../text_sensor/homeassistant_text_sensor.cpp | 22 + .../text_sensor/homeassistant_text_sensor.h | 21 + .../components/homeassistant/time/__init__.py | 20 + .../homeassistant/time/homeassistant_time.cpp | 40 + .../homeassistant/time/homeassistant_time.h | 27 + esphome/components/htu21d/__init__.py | 0 esphome/components/htu21d/htu21d.cpp | 63 + esphome/components/htu21d/htu21d.h | 30 + esphome/components/htu21d/sensor.py | 33 + esphome/components/hx711/__init__.py | 0 esphome/components/hx711/hx711.cpp | 67 + esphome/components/hx711/hx711.h | 36 + esphome/components/hx711/sensor.py | 37 + esphome/components/i2c.py | 38 - esphome/components/i2c/__init__.py | 47 + esphome/components/i2c/i2c.cpp | 205 +++ esphome/components/i2c/i2c.h | 207 +++ .../{image.py => image/__init__.py} | 24 +- esphome/components/ina219/__init__.py | 0 esphome/components/ina219/ina219.cpp | 195 +++ esphome/components/ina219/ina219.h | 38 + esphome/components/ina219/sensor.py | 51 + esphome/components/ina3221/__init__.py | 0 esphome/components/ina3221/ina3221.cpp | 133 ++ esphome/components/ina3221/ina3221.h | 41 + esphome/components/ina3221/sensor.py | 58 + esphome/components/interval.py | 24 - esphome/components/interval/__init__.py | 19 + esphome/components/interval/interval.h | 17 + esphome/components/json/__init__.py | 9 + esphome/components/json/json_util.cpp | 129 ++ esphome/components/json/json_util.h | 62 + esphome/components/lcd_base/__init__.py | 36 + esphome/components/lcd_base/lcd_display.cpp | 162 +++ esphome/components/lcd_base/lcd_display.h | 67 + esphome/components/lcd_gpio/__init__.py | 0 esphome/components/lcd_gpio/display.py | 45 + .../components/lcd_gpio/gpio_lcd_display.cpp | 59 + .../components/lcd_gpio/gpio_lcd_display.h | 48 + esphome/components/lcd_pcf8574/__init__.py | 0 esphome/components/lcd_pcf8574/display.py | 20 + .../lcd_pcf8574/pcf8574_display.cpp | 46 + .../components/lcd_pcf8574/pcf8574_display.h | 23 + esphome/components/ledc/__init__.py | 0 esphome/components/ledc/ledc_output.cpp | 44 + esphome/components/ledc/ledc_output.h | 43 + esphome/components/ledc/output.py | 39 + esphome/components/light/__init__.py | 658 ++++----- esphome/components/light/addressable_light.h | 449 ++++++ .../light/addressable_light_effect.h | 350 +++++ esphome/components/light/automation.h | 79 ++ esphome/components/light/base_light_effects.h | 143 ++ esphome/components/light/binary.py | 21 - esphome/components/light/cwww.py | 30 - esphome/components/light/fastled_clockless.py | 97 -- esphome/components/light/fastled_spi.py | 80 -- esphome/components/light/light_color_values.h | 272 ++++ esphome/components/light/light_effect.h | 43 + esphome/components/light/light_output.h | 24 + esphome/components/light/light_state.cpp | 703 ++++++++++ esphome/components/light/light_state.h | 319 +++++ esphome/components/light/light_traits.h | 38 + esphome/components/light/light_transformer.h | 86 ++ esphome/components/light/monochromatic.py | 21 - esphome/components/light/neopixelbus.py | 181 --- esphome/components/light/partition.py | 43 - esphome/components/light/rgb.py | 25 - esphome/components/light/rgbw.py | 27 - esphome/components/light/rgbww.py | 47 - esphome/components/logger.py | 183 --- esphome/components/logger/__init__.py | 185 +++ esphome/components/logger/logger.cpp | 149 ++ esphome/components/logger/logger.h | 85 ++ esphome/components/max31855/__init__.py | 0 esphome/components/max31855/max31855.cpp | 91 ++ esphome/components/max31855/max31855.h | 27 + esphome/components/max31855/sensor.py | 21 + esphome/components/max6675/__init__.py | 0 esphome/components/max6675/max6675.cpp | 57 + esphome/components/max6675/max6675.h | 27 + esphome/components/max6675/sensor.py | 21 + esphome/components/max7219/__init__.py | 0 esphome/components/max7219/display.py | 33 + esphome/components/max7219/max7219.cpp | 228 ++++ esphome/components/max7219/max7219.h | 68 + esphome/components/mcp23017.py | 35 - esphome/components/mcp23017/__init__.py | 52 + esphome/components/mcp23017/mcp23017.cpp | 96 ++ esphome/components/mcp23017/mcp23017.h | 82 ++ esphome/components/mhz19/__init__.py | 0 esphome/components/mhz19/mhz19.cpp | 73 + esphome/components/mhz19/mhz19.h | 30 + esphome/components/mhz19/sensor.py | 34 + esphome/components/monochromatic/__init__.py | 0 esphome/components/monochromatic/light.py | 18 + .../monochromatic_light_output.h | 29 + esphome/components/mpr121.py | 29 - esphome/components/mpr121/__init__.py | 22 + esphome/components/mpr121/binary_sensor.py | 21 + esphome/components/mpr121/mpr121.cpp | 76 ++ esphome/components/mpr121/mpr121.h | 75 + esphome/components/mpu6050/__init__.py | 0 esphome/components/mpu6050/mpu6050.cpp | 145 ++ esphome/components/mpu6050/mpu6050.h | 41 + esphome/components/mpu6050/sensor.py | 54 + esphome/components/mqtt.py | 295 ---- esphome/components/mqtt/__init__.py | 314 +++++ .../components/mqtt/mqtt_binary_sensor.cpp | 54 + esphome/components/mqtt/mqtt_binary_sensor.h | 44 + esphome/components/mqtt/mqtt_client.cpp | 554 ++++++++ esphome/components/mqtt/mqtt_client.h | 345 +++++ esphome/components/mqtt/mqtt_climate.cpp | 177 +++ esphome/components/mqtt/mqtt_climate.h | 45 + esphome/components/mqtt/mqtt_component.cpp | 199 +++ esphome/components/mqtt/mqtt_component.h | 179 +++ esphome/components/mqtt/mqtt_cover.cpp | 111 ++ esphome/components/mqtt/mqtt_cover.h | 42 + esphome/components/mqtt/mqtt_fan.cpp | 124 ++ esphome/components/mqtt/mqtt_fan.h | 47 + esphome/components/mqtt/mqtt_light.cpp | 60 + esphome/components/mqtt/mqtt_light.h | 41 + esphome/components/mqtt/mqtt_sensor.cpp | 77 ++ esphome/components/mqtt/mqtt_sensor.h | 60 + esphome/components/mqtt/mqtt_switch.cpp | 60 + esphome/components/mqtt/mqtt_switch.h | 41 + esphome/components/mqtt/mqtt_text_sensor.cpp | 47 + esphome/components/mqtt/mqtt_text_sensor.h | 40 + esphome/components/mqtt_subscribe/__init__.py | 3 + .../mqtt_subscribe/sensor/__init__.py | 27 + .../sensor/mqtt_subscribe_sensor.cpp | 32 + .../sensor/mqtt_subscribe_sensor.h | 28 + .../mqtt_subscribe/text_sensor/__init__.py | 28 + .../mqtt_subscribe_text_sensor.cpp | 22 + .../text_sensor/mqtt_subscribe_text_sensor.h | 27 + esphome/components/ms5611/__init__.py | 0 esphome/components/ms5611/ms5611.cpp | 111 ++ esphome/components/ms5611/ms5611.h | 32 + esphome/components/ms5611/sensor.py | 33 + esphome/components/my9231.py | 44 - esphome/components/my9231/__init__.py | 30 + esphome/components/my9231/my9231.cpp | 111 ++ esphome/components/my9231/my9231.h | 64 + esphome/components/my9231/output.py | 23 + esphome/components/neopixelbus/__init__.py | 0 esphome/components/neopixelbus/light.py | 169 +++ .../neopixelbus/neopixelbus_light.h | 180 +++ esphome/components/nextion/__init__.py | 3 + esphome/components/nextion/binary_sensor.py | 28 + esphome/components/nextion/display.py | 29 + esphome/components/nextion/nextion.cpp | 292 ++++ esphome/components/nextion/nextion.h | 234 ++++ esphome/components/ota.py | 56 - esphome/components/ota/__init__.py | 35 + esphome/components/ota/ota_component.cpp | 407 ++++++ esphome/components/ota/ota_component.h | 94 ++ esphome/components/output/__init__.py | 115 +- esphome/components/output/automation.cpp | 10 + esphome/components/output/automation.h | 52 + esphome/components/output/binary_output.h | 71 + esphome/components/output/copy.py | 56 - esphome/components/output/esp8266_pwm.py | 41 - esphome/components/output/float_output.cpp | 48 + esphome/components/output/float_output.h | 71 + esphome/components/output/gpio.py | 28 - esphome/components/output/ledc.py | 47 - esphome/components/output/my9231.py | 33 - esphome/components/output/pca9685.py | 31 - esphome/components/output/switch/__init__.py | 19 + .../output/switch/output_switch.cpp | 31 + .../components/output/switch/output_switch.h | 25 + esphome/components/partition/__init__.py | 0 esphome/components/partition/light.py | 36 + .../components/partition/light_partition.cpp | 10 + .../components/partition/light_partition.h | 84 ++ esphome/components/pca9685.py | 32 - esphome/components/pca9685/__init__.py | 22 + esphome/components/pca9685/output.py | 24 + esphome/components/pca9685/pca9685_output.cpp | 141 ++ esphome/components/pca9685/pca9685_output.h | 68 + esphome/components/pcf8574.py | 36 - esphome/components/pcf8574/__init__.py | 54 + esphome/components/pcf8574/pcf8574.cpp | 113 ++ esphome/components/pcf8574/pcf8574.h | 62 + esphome/components/pmsx003/__init__.py | 0 esphome/components/pmsx003/pmsx003.cpp | 169 +++ esphome/components/pmsx003/pmsx003.h | 49 + esphome/components/pmsx003/sensor.py | 91 ++ esphome/components/pn532.py | 44 - esphome/components/pn532/__init__.py | 32 + esphome/components/pn532/binary_sensor.py | 42 + esphome/components/pn532/pn532.cpp | 384 ++++++ esphome/components/pn532/pn532.h | 94 ++ esphome/components/power_supply.py | 35 - esphome/components/power_supply/__init__.py | 24 + .../components/power_supply/power_supply.cpp | 67 + .../components/power_supply/power_supply.h | 41 + esphome/components/pulse_counter/__init__.py | 0 .../pulse_counter/pulse_counter_sensor.cpp | 165 +++ .../pulse_counter/pulse_counter_sensor.h | 78 ++ esphome/components/pulse_counter/sensor.py | 69 + esphome/components/pulse_width/__init__.py | 0 .../components/pulse_width/pulse_width.cpp | 31 + esphome/components/pulse_width/pulse_width.h | 44 + esphome/components/pulse_width/sensor.py | 26 + esphome/components/rdm6300.py | 26 - esphome/components/rdm6300/__init__.py | 30 + esphome/components/rdm6300/binary_sensor.py | 23 + esphome/components/rdm6300/rdm6300.cpp | 69 + esphome/components/rdm6300/rdm6300.h | 55 + esphome/components/remote_base/__init__.py | 658 +++++++++ .../components/remote_base/jvc_protocol.cpp | 51 + esphome/components/remote_base/jvc_protocol.h | 34 + .../components/remote_base/lg_protocol.cpp | 57 + esphome/components/remote_base/lg_protocol.h | 38 + .../components/remote_base/nec_protocol.cpp | 72 + esphome/components/remote_base/nec_protocol.h | 37 + .../remote_base/panasonic_protocol.cpp | 72 + .../remote_base/panasonic_protocol.h | 38 + .../components/remote_base/raw_protocol.cpp | 46 + esphome/components/remote_base/raw_protocol.h | 75 + .../components/remote_base/rc5_protocol.cpp | 62 + esphome/components/remote_base/rc5_protocol.h | 38 + .../remote_base/rc_switch_protocol.cpp | 245 ++++ .../remote_base/rc_switch_protocol.h | 204 +++ .../components/remote_base/remote_base.cpp | 59 + esphome/components/remote_base/remote_base.h | 343 +++++ .../remote_base/samsung_protocol.cpp | 58 + .../components/remote_base/samsung_protocol.h | 35 + .../components/remote_base/sony_protocol.cpp | 68 + .../components/remote_base/sony_protocol.h | 38 + esphome/components/remote_receiver.py | 75 - .../components/remote_receiver/__init__.py | 38 + .../remote_receiver/binary_sensor.py | 18 + .../remote_receiver/remote_receiver.h | 59 + .../remote_receiver/remote_receiver_esp32.cpp | 154 +++ .../remote_receiver_esp8266.cpp | 123 ++ esphome/components/remote_transmitter.py | 119 -- .../components/remote_transmitter/__init__.py | 26 + .../remote_transmitter/remote_transmitter.cpp | 11 + .../remote_transmitter/remote_transmitter.h | 43 + .../remote_transmitter_esp32.cpp | 134 ++ .../remote_transmitter_esp8266.cpp | 95 ++ .../components/remote_transmitter/switch.py | 30 + esphome/components/restart/__init__.py | 0 esphome/components/restart/restart_switch.cpp | 24 + esphome/components/restart/restart_switch.h | 20 + esphome/components/restart/switch.py | 20 + esphome/components/rgb/__init__.py | 0 esphome/components/rgb/light.py | 22 + esphome/components/rgb/rgb_light_output.h | 35 + esphome/components/rgbw/__init__.py | 0 esphome/components/rgbw/light.py | 24 + esphome/components/rgbw/rgbw_light_output.h | 39 + esphome/components/rgbww/__init__.py | 0 esphome/components/rgbww/light.py | 32 + esphome/components/rgbww/rgbww_light_output.h | 51 + esphome/components/rotary_encoder/__init__.py | 0 .../rotary_encoder/rotary_encoder.cpp | 150 ++ .../rotary_encoder/rotary_encoder.h | 66 + esphome/components/rotary_encoder/sensor.py | 61 + esphome/components/script.py | 50 - esphome/components/script/__init__.py | 40 + esphome/components/script/script.h | 40 + esphome/components/sds011/__init__.py | 0 esphome/components/sds011/sds011.cpp | 175 +++ esphome/components/sds011/sds011.h | 46 + esphome/components/sds011/sensor.py | 54 + esphome/components/sensor/__init__.py | 391 +++--- esphome/components/sensor/adc.py | 62 - esphome/components/sensor/apds9960.py | 30 - esphome/components/sensor/automation.cpp | 10 + esphome/components/sensor/automation.h | 113 ++ esphome/components/sensor/bh1750.py | 41 - esphome/components/sensor/ble_rssi.py | 25 - esphome/components/sensor/bme280.py | 87 -- esphome/components/sensor/bme680.py | 110 -- esphome/components/sensor/bmp085.py | 45 - esphome/components/sensor/bmp280.py | 77 -- esphome/components/sensor/cse7766.py | 58 - esphome/components/sensor/custom.py | 32 - esphome/components/sensor/dallas.py | 33 - esphome/components/sensor/dht.py | 58 - esphome/components/sensor/dht12.py | 42 - esphome/components/sensor/duty_cycle.py | 30 - esphome/components/sensor/esp32_hall.py | 28 - esphome/components/sensor/filter.cpp | 232 ++++ esphome/components/sensor/filter.h | 247 ++++ esphome/components/sensor/hdc1080.py | 42 - esphome/components/sensor/hlw8012.py | 67 - esphome/components/sensor/hmc5883l.py | 89 -- esphome/components/sensor/homeassistant.py | 25 - esphome/components/sensor/htu21d.py | 43 - esphome/components/sensor/hx711.py | 47 - esphome/components/sensor/ina219.py | 68 - esphome/components/sensor/ina3221.py | 79 -- esphome/components/sensor/max31855.py | 33 - esphome/components/sensor/max6675.py | 34 - esphome/components/sensor/mhz19.py | 46 - esphome/components/sensor/mpu6050.py | 92 -- esphome/components/sensor/mqtt_subscribe.py | 32 - esphome/components/sensor/ms5611.py | 46 - esphome/components/sensor/pmsx003.py | 96 -- esphome/components/sensor/pulse_counter.py | 77 -- esphome/components/sensor/rotary_encoder.py | 69 - esphome/components/sensor/sds011.py | 69 - esphome/components/sensor/sensor.cpp | 118 ++ esphome/components/sensor/sensor.h | 187 +++ esphome/components/sensor/sht3xd.py | 44 - esphome/components/sensor/tcs34725.py | 104 -- esphome/components/sensor/template.py | 51 - .../components/sensor/total_daily_energy.py | 32 - esphome/components/sensor/tsl2561.py | 65 - esphome/components/sensor/ultrasonic.py | 52 - esphome/components/sensor/uptime.py | 26 - esphome/components/sensor/wifi_signal.py | 26 - esphome/components/sensor/xiaomi_miflora.py | 43 - esphome/components/sensor/xiaomi_mijia.py | 35 - esphome/components/servo.py | 56 - esphome/components/servo/__init__.py | 54 + esphome/components/servo/servo.cpp | 19 + esphome/components/servo/servo.h | 88 ++ esphome/components/sht3xd/__init__.py | 0 esphome/components/sht3xd/sensor.py | 34 + esphome/components/sht3xd/sht3xd.cpp | 121 ++ esphome/components/sht3xd/sht3xd.h | 32 + esphome/components/shutdown/__init__.py | 0 .../components/shutdown/shutdown_switch.cpp | 30 + esphome/components/shutdown/shutdown_switch.h | 20 + esphome/components/shutdown/switch.py | 21 + esphome/components/sntp/__init__.py | 0 esphome/components/sntp/sntp_component.cpp | 64 + esphome/components/sntp/sntp_component.h | 39 + esphome/components/sntp/time.py | 28 + esphome/components/speed/__init__.py | 3 + esphome/components/speed/fan/__init__.py | 32 + esphome/components/speed/fan/speed_fan.cpp | 53 + esphome/components/speed/fan/speed_fan.h | 36 + esphome/components/spi.py | 37 - esphome/components/spi/__init__.py | 46 + esphome/components/spi/spi.cpp | 104 ++ esphome/components/spi/spi.h | 75 + esphome/components/ssd1306_base/__init__.py | 49 + .../components/ssd1306_base/ssd1306_base.cpp | 238 ++++ .../components/ssd1306_base/ssd1306_base.h | 58 + esphome/components/ssd1306_i2c/__init__.py | 0 esphome/components/ssd1306_i2c/display.py | 21 + .../components/ssd1306_i2c/ssd1306_i2c.cpp | 61 + esphome/components/ssd1306_i2c/ssd1306_i2c.h | 25 + esphome/components/ssd1306_spi/__init__.py | 0 esphome/components/ssd1306_spi/display.py | 25 + .../components/ssd1306_spi/ssd1306_spi.cpp | 58 + esphome/components/ssd1306_spi/ssd1306_spi.h | 29 + esphome/components/status/__init__.py | 0 esphome/components/status/binary_sensor.py | 20 + .../status/status_binary_sensor.cpp | 40 + .../components/status/status_binary_sensor.h | 28 + esphome/components/status_led.py | 25 - esphome/components/status_led/__init__.py | 23 + esphome/components/status_led/status_led.cpp | 35 + esphome/components/status_led/status_led.h | 26 + esphome/components/stepper/__init__.py | 99 +- esphome/components/stepper/a4988.py | 35 - esphome/components/stepper/stepper.cpp | 50 + esphome/components/stepper/stepper.h | 70 + esphome/components/stepper/uln2003.py | 51 - .../__init__.py} | 10 +- esphome/components/switch/__init__.py | 160 +-- esphome/components/switch/automation.cpp | 10 + esphome/components/switch/automation.h | 95 ++ esphome/components/switch/custom.py | 33 - esphome/components/switch/gpio.py | 48 - esphome/components/switch/output.py | 27 - .../components/switch/remote_transmitter.py | 165 --- esphome/components/switch/restart.py | 23 - esphome/components/switch/shutdown.py | 23 - esphome/components/switch/switch.cpp | 58 + esphome/components/switch/switch.h | 126 ++ esphome/components/switch/template.py | 71 - esphome/components/switch/uart.py | 45 - esphome/components/tcs34725/__init__.py | 0 esphome/components/tcs34725/sensor.py | 81 ++ esphome/components/tcs34725/tcs34725.cpp | 123 ++ esphome/components/tcs34725/tcs34725.h | 59 + esphome/components/template/__init__.py | 3 + .../template/binary_sensor/__init__.py | 39 + .../binary_sensor/template_binary_sensor.cpp | 21 + .../binary_sensor/template_binary_sensor.h | 25 + esphome/components/template/cover/__init__.py | 75 + .../template/cover/template_cover.cpp | 137 ++ .../template/cover/template_cover.h | 60 + .../components/template/sensor/__init__.py | 45 + .../template/sensor/template_sensor.cpp | 28 + .../template/sensor/template_sensor.h | 26 + .../components/template/switch/__init__.py | 54 + .../template/switch/template_switch.cpp | 66 + .../template/switch/template_switch.h | 42 + .../template/text_sensor/__init__.py | 42 + .../text_sensor/template_text_sensor.cpp | 25 + .../text_sensor/template_text_sensor.h | 27 + esphome/components/text_sensor/__init__.py | 70 +- esphome/components/text_sensor/automation.cpp | 10 + esphome/components/text_sensor/automation.h | 31 + esphome/components/text_sensor/custom.py | 33 - .../components/text_sensor/homeassistant.py | 26 - .../components/text_sensor/mqtt_subscribe.py | 33 - esphome/components/text_sensor/template.py | 52 - .../components/text_sensor/text_sensor.cpp | 33 + esphome/components/text_sensor/text_sensor.h | 52 + esphome/components/text_sensor/version.py | 23 - esphome/components/text_sensor/wifi_info.py | 45 - esphome/components/time/__init__.py | 195 ++- esphome/components/time/automation.cpp | 79 ++ esphome/components/time/automation.h | 41 + esphome/components/time/homeassistant.py | 24 - esphome/components/time/real_time_clock.cpp | 138 ++ esphome/components/time/real_time_clock.h | 99 ++ esphome/components/time/sntp.py | 30 - esphome/components/time_based/__init__.py | 0 esphome/components/time_based/cover.py | 35 + .../time_based/time_based_cover.cpp | 141 ++ .../components/time_based/time_based_cover.h | 48 + .../components/total_daily_energy/__init__.py | 0 .../components/total_daily_energy/sensor.py | 25 + .../total_daily_energy/total_daily_energy.cpp | 54 + .../total_daily_energy/total_daily_energy.h | 37 + esphome/components/tsl2561/__init__.py | 0 esphome/components/tsl2561/sensor.py | 49 + esphome/components/tsl2561/tsl2561.cpp | 166 +++ esphome/components/tsl2561/tsl2561.h | 89 ++ esphome/components/ttp229_lsf.py | 25 - esphome/components/ttp229_lsf/__init__.py | 22 + .../components/ttp229_lsf/binary_sensor.py | 21 + esphome/components/ttp229_lsf/ttp229.cpp | 43 + esphome/components/ttp229_lsf/ttp229.h | 36 + esphome/components/uart.py | 43 - esphome/components/uart/__init__.py | 46 + esphome/components/uart/switch/__init__.py | 38 + .../components/uart/switch/uart_switch.cpp | 26 + esphome/components/uart/switch/uart_switch.h | 22 + esphome/components/uart/uart.cpp | 350 +++++ esphome/components/uart/uart.h | 121 ++ esphome/components/uln2003/__init__.py | 0 esphome/components/uln2003/stepper.py | 41 + esphome/components/uln2003/uln2003.cpp | 97 ++ esphome/components/uln2003/uln2003.h | 42 + esphome/components/ultrasonic/__init__.py | 0 esphome/components/ultrasonic/sensor.py | 40 + .../ultrasonic/ultrasonic_sensor.cpp | 56 + .../components/ultrasonic/ultrasonic_sensor.h | 48 + esphome/components/uptime/__init__.py | 0 esphome/components/uptime/sensor.py | 24 + esphome/components/uptime/uptime_sensor.cpp | 34 + esphome/components/uptime/uptime_sensor.h | 24 + esphome/components/version/__init__.py | 0 esphome/components/version/text_sensor.py | 18 + .../version/version_text_sensor.cpp | 18 + .../components/version/version_text_sensor.h | 19 + .../components/waveshare_epaper/__init__.py | 0 .../components/waveshare_epaper/display.py | 81 ++ .../waveshare_epaper/waveshare_epaper.cpp | 623 +++++++++ .../waveshare_epaper/waveshare_epaper.h | 132 ++ esphome/components/web_server.py | 39 - esphome/components/web_server/__init__.py | 28 + esphome/components/web_server/web_server.cpp | 632 +++++++++ esphome/components/web_server/web_server.h | 142 ++ esphome/components/wifi.py | 203 --- esphome/components/wifi/__init__.py | 194 +++ esphome/components/wifi/wifi_component.cpp | 545 ++++++++ esphome/components/wifi/wifi_component.h | 236 ++++ .../components/wifi/wifi_component_esp32.cpp | 527 ++++++++ .../wifi/wifi_component_esp8266.cpp | 594 ++++++++ esphome/components/wifi_info/__init__.py | 0 esphome/components/wifi_info/text_sensor.py | 39 + .../wifi_info/wifi_info_text_sensor.h | 61 + esphome/components/wifi_signal/__init__.py | 0 esphome/components/wifi_signal/sensor.py | 24 + .../wifi_signal/wifi_signal_sensor.cpp | 12 + .../wifi_signal/wifi_signal_sensor.h | 24 + esphome/components/xiaomi_ble/__init__.py | 20 + esphome/components/xiaomi_ble/xiaomi_ble.cpp | 147 ++ esphome/components/xiaomi_ble/xiaomi_ble.h | 35 + esphome/components/xiaomi_miflora/__init__.py | 0 esphome/components/xiaomi_miflora/sensor.py | 69 + .../xiaomi_miflora/xiaomi_miflora.cpp | 23 + .../xiaomi_miflora/xiaomi_miflora.h | 59 + esphome/components/xiaomi_mijia/__init__.py | 0 esphome/components/xiaomi_mijia/sensor.py | 50 + .../components/xiaomi_mijia/xiaomi_mijia.cpp | 21 + .../components/xiaomi_mijia/xiaomi_mijia.h | 51 + esphome/config.py | 203 ++- esphome/config_validation.py | 429 +++--- esphome/const.py | 912 +++++++------ esphome/core.py | 300 +++- esphome/core/application.cpp | 113 ++ esphome/core/application.h | 271 ++++ esphome/core/automation.cpp | 33 + esphome/core/automation.h | 241 ++++ esphome/core/automation.tcc | 243 ++++ esphome/core/component.cpp | 251 ++++ esphome/core/component.h | 298 ++++ esphome/core/controller.cpp | 58 + esphome/core/controller.h | 60 + esphome/core/defines.h | 27 + esphome/core/esphal.cpp | 280 ++++ esphome/core/esphal.h | 118 ++ esphome/core/helpers.cpp | 307 +++++ esphome/core/helpers.h | 256 ++++ esphome/core/log.cpp | 67 + esphome/core/log.h | 173 +++ esphome/core/optional.h | 214 +++ esphome/core/preferences.cpp | 233 ++++ esphome/core/preferences.h | 92 ++ esphome/core/util.cpp | 120 ++ esphome/core/util.h | 18 + esphome/core_config.py | 252 ++-- esphome/cpp_generator.py | 204 ++- esphome/cpp_helpers.py | 82 +- esphome/cpp_types.py | 5 +- esphome/espota.py | 344 ----- esphome/espota2.py | 12 - esphome/helpers.py | 39 + esphome/pins.py | 135 +- esphome/platformio_api.py | 49 + esphome/py_compat.py | 4 +- esphome/storage_json.py | 22 +- esphome/util.py | 29 + esphome/voluptuous_schema.py | 2 + esphome/wizard.py | 9 +- esphome/writer.py | 360 ++--- esphome/yaml_util.py | 6 +- platformio.ini | 48 + requirements.txt | 3 +- requirements_test.txt | 18 + script/.neopixelbus.patch | 26 + script/ci-custom.py | 53 + script/ci-suggest-changes | 21 + script/clang-format.py | 164 +++ script/clang-tidy.py | 281 ++++ script/lint-cpp | 16 + script/lint-python | 10 + script/setup | 8 + script/test | 11 + tests/livingroom32.cpp | 28 + tests/livingroom8266.cpp | 34 + tests/test1.yaml | 195 ++- tests/test2.yaml | 9 +- tests/test3.yaml | 38 - 817 files changed, 54156 insertions(+), 10830 deletions(-) create mode 100644 .clang-format create mode 100644 .clang-tidy create mode 100644 esphome/codegen.py create mode 100644 esphome/components/a4988/__init__.py create mode 100644 esphome/components/a4988/a4988.cpp create mode 100644 esphome/components/a4988/a4988.h create mode 100644 esphome/components/a4988/stepper.py create mode 100644 esphome/components/adc/__init__.py create mode 100644 esphome/components/adc/adc_sensor.cpp create mode 100644 esphome/components/adc/adc_sensor.h create mode 100644 esphome/components/adc/sensor.py delete mode 100644 esphome/components/ads1115.py create mode 100644 esphome/components/ads1115/__init__.py create mode 100644 esphome/components/ads1115/ads1115.cpp create mode 100644 esphome/components/ads1115/ads1115.h rename esphome/components/{sensor/ads1115.py => ads1115/sensor.py} (54%) delete mode 100644 esphome/components/apds9960.py create mode 100644 esphome/components/apds9960/__init__.py create mode 100644 esphome/components/apds9960/apds9960.cpp create mode 100644 esphome/components/apds9960/apds9960.h create mode 100644 esphome/components/apds9960/binary_sensor.py create mode 100644 esphome/components/apds9960/sensor.py rename esphome/components/{api.py => api/__init__.py} (56%) create mode 100644 esphome/components/api/api.proto create mode 100644 esphome/components/api/api_message.cpp create mode 100644 esphome/components/api/api_message.h create mode 100644 esphome/components/api/api_server.cpp create mode 100644 esphome/components/api/api_server.h create mode 100644 esphome/components/api/basic_messages.cpp create mode 100644 esphome/components/api/basic_messages.h create mode 100644 esphome/components/api/command_messages.cpp create mode 100644 esphome/components/api/command_messages.h create mode 100644 esphome/components/api/list_entities.cpp create mode 100644 esphome/components/api/list_entities.h create mode 100644 esphome/components/api/service_call_message.cpp create mode 100644 esphome/components/api/service_call_message.h create mode 100644 esphome/components/api/subscribe_logs.cpp create mode 100644 esphome/components/api/subscribe_logs.h create mode 100644 esphome/components/api/subscribe_state.cpp create mode 100644 esphome/components/api/subscribe_state.h create mode 100644 esphome/components/api/user_services.cpp create mode 100644 esphome/components/api/user_services.h create mode 100644 esphome/components/api/util.cpp create mode 100644 esphome/components/api/util.h create mode 100644 esphome/components/bang_bang/__init__.py create mode 100644 esphome/components/bang_bang/bang_bang_climate.cpp create mode 100644 esphome/components/bang_bang/bang_bang_climate.h create mode 100644 esphome/components/bang_bang/climate.py create mode 100644 esphome/components/bh1750/__init__.py create mode 100644 esphome/components/bh1750/bh1750.cpp create mode 100644 esphome/components/bh1750/bh1750.h create mode 100644 esphome/components/bh1750/sensor.py create mode 100644 esphome/components/binary/__init__.py create mode 100644 esphome/components/binary/fan/__init__.py create mode 100644 esphome/components/binary/fan/binary_fan.cpp create mode 100644 esphome/components/binary/fan/binary_fan.h create mode 100644 esphome/components/binary/light/__init__.py create mode 100644 esphome/components/binary/light/binary_light_output.h delete mode 100644 esphome/components/binary_sensor/apds9960.py create mode 100644 esphome/components/binary_sensor/automation.cpp create mode 100644 esphome/components/binary_sensor/automation.h create mode 100644 esphome/components/binary_sensor/binary_sensor.cpp create mode 100644 esphome/components/binary_sensor/binary_sensor.h delete mode 100644 esphome/components/binary_sensor/custom.py delete mode 100644 esphome/components/binary_sensor/esp32_ble_tracker.py delete mode 100644 esphome/components/binary_sensor/esp32_touch.py create mode 100644 esphome/components/binary_sensor/filter.cpp create mode 100644 esphome/components/binary_sensor/filter.h delete mode 100644 esphome/components/binary_sensor/gpio.py delete mode 100644 esphome/components/binary_sensor/homeassistant.py delete mode 100644 esphome/components/binary_sensor/mpr121.py delete mode 100644 esphome/components/binary_sensor/nextion.py delete mode 100644 esphome/components/binary_sensor/pn532.py delete mode 100644 esphome/components/binary_sensor/rdm6300.py delete mode 100644 esphome/components/binary_sensor/remote_receiver.py delete mode 100644 esphome/components/binary_sensor/status.py delete mode 100644 esphome/components/binary_sensor/template.py delete mode 100644 esphome/components/binary_sensor/ttp229_lsf.py create mode 100644 esphome/components/ble_presence/__init__.py create mode 100644 esphome/components/ble_presence/binary_sensor.py create mode 100644 esphome/components/ble_presence/ble_presence_device.cpp create mode 100644 esphome/components/ble_presence/ble_presence_device.h create mode 100644 esphome/components/ble_rssi/__init__.py create mode 100644 esphome/components/ble_rssi/ble_rssi_sensor.cpp create mode 100644 esphome/components/ble_rssi/ble_rssi_sensor.h create mode 100644 esphome/components/ble_rssi/sensor.py create mode 100644 esphome/components/bme280/__init__.py create mode 100644 esphome/components/bme280/bme280.cpp create mode 100644 esphome/components/bme280/bme280.h create mode 100644 esphome/components/bme280/sensor.py create mode 100644 esphome/components/bme680/__init__.py create mode 100644 esphome/components/bme680/bme680.cpp create mode 100644 esphome/components/bme680/bme680.h create mode 100644 esphome/components/bme680/sensor.py create mode 100644 esphome/components/bmp085/__init__.py create mode 100644 esphome/components/bmp085/bmp085.cpp create mode 100644 esphome/components/bmp085/bmp085.h create mode 100644 esphome/components/bmp085/sensor.py create mode 100644 esphome/components/bmp280/__init__.py create mode 100644 esphome/components/bmp280/bmp280.cpp create mode 100644 esphome/components/bmp280/bmp280.h create mode 100644 esphome/components/bmp280/sensor.py create mode 100644 esphome/components/climate/automation.h delete mode 100644 esphome/components/climate/bang_bang.py create mode 100644 esphome/components/climate/climate.cpp create mode 100644 esphome/components/climate/climate.h create mode 100644 esphome/components/climate/climate_mode.cpp create mode 100644 esphome/components/climate/climate_mode.h create mode 100644 esphome/components/climate/climate_traits.cpp create mode 100644 esphome/components/climate/climate_traits.h create mode 100644 esphome/components/cover/automation.h create mode 100644 esphome/components/cover/cover.cpp create mode 100644 esphome/components/cover/cover.h create mode 100644 esphome/components/cover/cover_traits.h delete mode 100644 esphome/components/cover/endstop.py delete mode 100644 esphome/components/cover/template.py delete mode 100644 esphome/components/cover/time_based.py create mode 100644 esphome/components/cse7766/__init__.py create mode 100644 esphome/components/cse7766/cse7766.cpp create mode 100644 esphome/components/cse7766/cse7766.h create mode 100644 esphome/components/cse7766/sensor.py create mode 100644 esphome/components/custom/__init__.py create mode 100644 esphome/components/custom/binary_sensor/__init__.py create mode 100644 esphome/components/custom/binary_sensor/custom_binary_sensor.cpp create mode 100644 esphome/components/custom/binary_sensor/custom_binary_sensor.h rename esphome/components/{output/custom.py => custom/output/__init__.py} (52%) create mode 100644 esphome/components/custom/output/custom_output.h create mode 100644 esphome/components/custom/sensor/__init__.py create mode 100644 esphome/components/custom/sensor/custom_sensor.cpp create mode 100644 esphome/components/custom/sensor/custom_sensor.h create mode 100644 esphome/components/custom/switch/__init__.py create mode 100644 esphome/components/custom/switch/custom_switch.cpp create mode 100644 esphome/components/custom/switch/custom_switch.h create mode 100644 esphome/components/custom/text_sensor/__init__.py create mode 100644 esphome/components/custom/text_sensor/custom_text_sensor.cpp create mode 100644 esphome/components/custom/text_sensor/custom_text_sensor.h delete mode 100644 esphome/components/custom_component.py create mode 100644 esphome/components/custom_component/__init__.py create mode 100644 esphome/components/custom_component/custom_component.h create mode 100644 esphome/components/cwww/__init__.py create mode 100644 esphome/components/cwww/cwww_light_output.h create mode 100644 esphome/components/cwww/light.py delete mode 100644 esphome/components/dallas.py create mode 100644 esphome/components/dallas/__init__.py create mode 100644 esphome/components/dallas/dallas_component.cpp create mode 100644 esphome/components/dallas/dallas_component.h create mode 100644 esphome/components/dallas/esp_one_wire.cpp create mode 100644 esphome/components/dallas/esp_one_wire.h create mode 100644 esphome/components/dallas/sensor.py delete mode 100644 esphome/components/debug.py create mode 100644 esphome/components/debug/__init__.py create mode 100644 esphome/components/debug/debug_component.cpp create mode 100644 esphome/components/debug/debug_component.h delete mode 100644 esphome/components/deep_sleep.py create mode 100644 esphome/components/deep_sleep/__init__.py create mode 100644 esphome/components/deep_sleep/deep_sleep_component.cpp create mode 100644 esphome/components/deep_sleep/deep_sleep_component.h create mode 100644 esphome/components/dht/__init__.py create mode 100644 esphome/components/dht/dht.cpp create mode 100644 esphome/components/dht/dht.h create mode 100644 esphome/components/dht/sensor.py create mode 100644 esphome/components/dht12/__init__.py create mode 100644 esphome/components/dht12/dht12.cpp create mode 100644 esphome/components/dht12/dht12.h create mode 100644 esphome/components/dht12/sensor.py create mode 100644 esphome/components/display/display_buffer.cpp create mode 100644 esphome/components/display/display_buffer.h delete mode 100644 esphome/components/display/lcd_gpio.py delete mode 100644 esphome/components/display/lcd_pcf8574.py delete mode 100644 esphome/components/display/max7219.py delete mode 100644 esphome/components/display/nextion.py delete mode 100644 esphome/components/display/ssd1306_i2c.py delete mode 100644 esphome/components/display/ssd1306_spi.py delete mode 100644 esphome/components/display/waveshare_epaper.py create mode 100644 esphome/components/duty_cycle/__init__.py create mode 100644 esphome/components/duty_cycle/duty_cycle_sensor.cpp create mode 100644 esphome/components/duty_cycle/duty_cycle_sensor.h create mode 100644 esphome/components/duty_cycle/sensor.py create mode 100644 esphome/components/endstop/__init__.py create mode 100644 esphome/components/endstop/cover.py create mode 100644 esphome/components/endstop/endstop_cover.cpp create mode 100644 esphome/components/endstop/endstop_cover.h delete mode 100644 esphome/components/esp32_ble_beacon.py create mode 100644 esphome/components/esp32_ble_beacon/__init__.py create mode 100644 esphome/components/esp32_ble_beacon/esp32_ble_beacon.cpp create mode 100644 esphome/components/esp32_ble_beacon/esp32_ble_beacon.h delete mode 100644 esphome/components/esp32_ble_tracker.py create mode 100644 esphome/components/esp32_ble_tracker/__init__.py create mode 100644 esphome/components/esp32_ble_tracker/binary_sensor.py create mode 100644 esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp create mode 100644 esphome/components/esp32_ble_tracker/esp32_ble_tracker.h rename esphome/components/{esp32_camera.py => esp32_camera/__init__.py} (52%) create mode 100644 esphome/components/esp32_camera/esp32_camera.cpp create mode 100644 esphome/components/esp32_camera/esp32_camera.h create mode 100644 esphome/components/esp32_hall/__init__.py create mode 100644 esphome/components/esp32_hall/esp32_hall.cpp create mode 100644 esphome/components/esp32_hall/esp32_hall.h create mode 100644 esphome/components/esp32_hall/sensor.py delete mode 100644 esphome/components/esp32_touch.py create mode 100644 esphome/components/esp32_touch/__init__.py create mode 100644 esphome/components/esp32_touch/binary_sensor.py create mode 100644 esphome/components/esp32_touch/esp32_touch.cpp create mode 100644 esphome/components/esp32_touch/esp32_touch.h create mode 100644 esphome/components/esp8266_pwm/__init__.py create mode 100644 esphome/components/esp8266_pwm/esp8266_pwm.cpp create mode 100644 esphome/components/esp8266_pwm/esp8266_pwm.h create mode 100644 esphome/components/esp8266_pwm/output.py delete mode 100644 esphome/components/ethernet.py create mode 100644 esphome/components/ethernet/__init__.py create mode 100644 esphome/components/ethernet/ethernet_component.cpp create mode 100644 esphome/components/ethernet/ethernet_component.h create mode 100644 esphome/components/fan/automation.cpp create mode 100644 esphome/components/fan/automation.h delete mode 100644 esphome/components/fan/binary.py create mode 100644 esphome/components/fan/fan_state.cpp create mode 100644 esphome/components/fan/fan_state.h create mode 100644 esphome/components/fan/fan_traits.h delete mode 100644 esphome/components/fan/speed.py create mode 100644 esphome/components/fastled_base/__init__.py create mode 100644 esphome/components/fastled_base/fastled_light.cpp create mode 100644 esphome/components/fastled_base/fastled_light.h create mode 100644 esphome/components/fastled_clockless/__init__.py create mode 100644 esphome/components/fastled_clockless/light.py create mode 100644 esphome/components/fastled_spi/__init__.py create mode 100644 esphome/components/fastled_spi/light.py rename esphome/components/{font.py => font/__init__.py} (64%) delete mode 100644 esphome/components/globals.py create mode 100644 esphome/components/globals/__init__.py create mode 100644 esphome/components/globals/globals_component.h create mode 100644 esphome/components/gpio/__init__.py create mode 100644 esphome/components/gpio/binary_sensor/__init__.py create mode 100644 esphome/components/gpio/binary_sensor/gpio_binary_sensor.cpp create mode 100644 esphome/components/gpio/binary_sensor/gpio_binary_sensor.h create mode 100644 esphome/components/gpio/output/__init__.py create mode 100644 esphome/components/gpio/output/gpio_binary_output.cpp create mode 100644 esphome/components/gpio/output/gpio_binary_output.h create mode 100644 esphome/components/gpio/switch/__init__.py create mode 100644 esphome/components/gpio/switch/gpio_switch.cpp create mode 100644 esphome/components/gpio/switch/gpio_switch.h create mode 100644 esphome/components/hdc1080/__init__.py create mode 100644 esphome/components/hdc1080/hdc1080.cpp create mode 100644 esphome/components/hdc1080/hdc1080.h create mode 100644 esphome/components/hdc1080/sensor.py create mode 100644 esphome/components/hlw8012/__init__.py create mode 100644 esphome/components/hlw8012/hlw8012.cpp create mode 100644 esphome/components/hlw8012/hlw8012.h create mode 100644 esphome/components/hlw8012/sensor.py create mode 100644 esphome/components/hmc5883l/__init__.py create mode 100644 esphome/components/hmc5883l/hmc5883l.cpp create mode 100644 esphome/components/hmc5883l/hmc5883l.h create mode 100644 esphome/components/hmc5883l/sensor.py create mode 100644 esphome/components/homeassistant/__init__.py create mode 100644 esphome/components/homeassistant/binary_sensor/__init__.py create mode 100644 esphome/components/homeassistant/binary_sensor/homeassistant_binary_sensor.cpp create mode 100644 esphome/components/homeassistant/binary_sensor/homeassistant_binary_sensor.h create mode 100644 esphome/components/homeassistant/sensor/__init__.py create mode 100644 esphome/components/homeassistant/sensor/homeassistant_sensor.cpp create mode 100644 esphome/components/homeassistant/sensor/homeassistant_sensor.h create mode 100644 esphome/components/homeassistant/text_sensor/__init__.py create mode 100644 esphome/components/homeassistant/text_sensor/homeassistant_text_sensor.cpp create mode 100644 esphome/components/homeassistant/text_sensor/homeassistant_text_sensor.h create mode 100644 esphome/components/homeassistant/time/__init__.py create mode 100644 esphome/components/homeassistant/time/homeassistant_time.cpp create mode 100644 esphome/components/homeassistant/time/homeassistant_time.h create mode 100644 esphome/components/htu21d/__init__.py create mode 100644 esphome/components/htu21d/htu21d.cpp create mode 100644 esphome/components/htu21d/htu21d.h create mode 100644 esphome/components/htu21d/sensor.py create mode 100644 esphome/components/hx711/__init__.py create mode 100644 esphome/components/hx711/hx711.cpp create mode 100644 esphome/components/hx711/hx711.h create mode 100644 esphome/components/hx711/sensor.py delete mode 100644 esphome/components/i2c.py create mode 100644 esphome/components/i2c/__init__.py create mode 100644 esphome/components/i2c/i2c.cpp create mode 100644 esphome/components/i2c/i2c.h rename esphome/components/{image.py => image/__init__.py} (68%) create mode 100644 esphome/components/ina219/__init__.py create mode 100644 esphome/components/ina219/ina219.cpp create mode 100644 esphome/components/ina219/ina219.h create mode 100644 esphome/components/ina219/sensor.py create mode 100644 esphome/components/ina3221/__init__.py create mode 100644 esphome/components/ina3221/ina3221.cpp create mode 100644 esphome/components/ina3221/ina3221.h create mode 100644 esphome/components/ina3221/sensor.py delete mode 100644 esphome/components/interval.py create mode 100644 esphome/components/interval/__init__.py create mode 100644 esphome/components/interval/interval.h create mode 100644 esphome/components/json/__init__.py create mode 100644 esphome/components/json/json_util.cpp create mode 100644 esphome/components/json/json_util.h create mode 100644 esphome/components/lcd_base/__init__.py create mode 100644 esphome/components/lcd_base/lcd_display.cpp create mode 100644 esphome/components/lcd_base/lcd_display.h create mode 100644 esphome/components/lcd_gpio/__init__.py create mode 100644 esphome/components/lcd_gpio/display.py create mode 100644 esphome/components/lcd_gpio/gpio_lcd_display.cpp create mode 100644 esphome/components/lcd_gpio/gpio_lcd_display.h create mode 100644 esphome/components/lcd_pcf8574/__init__.py create mode 100644 esphome/components/lcd_pcf8574/display.py create mode 100644 esphome/components/lcd_pcf8574/pcf8574_display.cpp create mode 100644 esphome/components/lcd_pcf8574/pcf8574_display.h create mode 100644 esphome/components/ledc/__init__.py create mode 100644 esphome/components/ledc/ledc_output.cpp create mode 100644 esphome/components/ledc/ledc_output.h create mode 100644 esphome/components/ledc/output.py create mode 100644 esphome/components/light/addressable_light.h create mode 100644 esphome/components/light/addressable_light_effect.h create mode 100644 esphome/components/light/automation.h create mode 100644 esphome/components/light/base_light_effects.h delete mode 100644 esphome/components/light/binary.py delete mode 100644 esphome/components/light/cwww.py delete mode 100644 esphome/components/light/fastled_clockless.py delete mode 100644 esphome/components/light/fastled_spi.py create mode 100644 esphome/components/light/light_color_values.h create mode 100644 esphome/components/light/light_effect.h create mode 100644 esphome/components/light/light_output.h create mode 100644 esphome/components/light/light_state.cpp create mode 100644 esphome/components/light/light_state.h create mode 100644 esphome/components/light/light_traits.h create mode 100644 esphome/components/light/light_transformer.h delete mode 100644 esphome/components/light/monochromatic.py delete mode 100644 esphome/components/light/neopixelbus.py delete mode 100644 esphome/components/light/partition.py delete mode 100644 esphome/components/light/rgb.py delete mode 100644 esphome/components/light/rgbw.py delete mode 100644 esphome/components/light/rgbww.py delete mode 100644 esphome/components/logger.py create mode 100644 esphome/components/logger/__init__.py create mode 100644 esphome/components/logger/logger.cpp create mode 100644 esphome/components/logger/logger.h create mode 100644 esphome/components/max31855/__init__.py create mode 100644 esphome/components/max31855/max31855.cpp create mode 100644 esphome/components/max31855/max31855.h create mode 100644 esphome/components/max31855/sensor.py create mode 100644 esphome/components/max6675/__init__.py create mode 100644 esphome/components/max6675/max6675.cpp create mode 100644 esphome/components/max6675/max6675.h create mode 100644 esphome/components/max6675/sensor.py create mode 100644 esphome/components/max7219/__init__.py create mode 100644 esphome/components/max7219/display.py create mode 100644 esphome/components/max7219/max7219.cpp create mode 100644 esphome/components/max7219/max7219.h delete mode 100644 esphome/components/mcp23017.py create mode 100644 esphome/components/mcp23017/__init__.py create mode 100644 esphome/components/mcp23017/mcp23017.cpp create mode 100644 esphome/components/mcp23017/mcp23017.h create mode 100644 esphome/components/mhz19/__init__.py create mode 100644 esphome/components/mhz19/mhz19.cpp create mode 100644 esphome/components/mhz19/mhz19.h create mode 100644 esphome/components/mhz19/sensor.py create mode 100644 esphome/components/monochromatic/__init__.py create mode 100644 esphome/components/monochromatic/light.py create mode 100644 esphome/components/monochromatic/monochromatic_light_output.h delete mode 100644 esphome/components/mpr121.py create mode 100644 esphome/components/mpr121/__init__.py create mode 100644 esphome/components/mpr121/binary_sensor.py create mode 100644 esphome/components/mpr121/mpr121.cpp create mode 100644 esphome/components/mpr121/mpr121.h create mode 100644 esphome/components/mpu6050/__init__.py create mode 100644 esphome/components/mpu6050/mpu6050.cpp create mode 100644 esphome/components/mpu6050/mpu6050.h create mode 100644 esphome/components/mpu6050/sensor.py delete mode 100644 esphome/components/mqtt.py create mode 100644 esphome/components/mqtt/__init__.py create mode 100644 esphome/components/mqtt/mqtt_binary_sensor.cpp create mode 100644 esphome/components/mqtt/mqtt_binary_sensor.h create mode 100644 esphome/components/mqtt/mqtt_client.cpp create mode 100644 esphome/components/mqtt/mqtt_client.h create mode 100644 esphome/components/mqtt/mqtt_climate.cpp create mode 100644 esphome/components/mqtt/mqtt_climate.h create mode 100644 esphome/components/mqtt/mqtt_component.cpp create mode 100644 esphome/components/mqtt/mqtt_component.h create mode 100644 esphome/components/mqtt/mqtt_cover.cpp create mode 100644 esphome/components/mqtt/mqtt_cover.h create mode 100644 esphome/components/mqtt/mqtt_fan.cpp create mode 100644 esphome/components/mqtt/mqtt_fan.h create mode 100644 esphome/components/mqtt/mqtt_light.cpp create mode 100644 esphome/components/mqtt/mqtt_light.h create mode 100644 esphome/components/mqtt/mqtt_sensor.cpp create mode 100644 esphome/components/mqtt/mqtt_sensor.h create mode 100644 esphome/components/mqtt/mqtt_switch.cpp create mode 100644 esphome/components/mqtt/mqtt_switch.h create mode 100644 esphome/components/mqtt/mqtt_text_sensor.cpp create mode 100644 esphome/components/mqtt/mqtt_text_sensor.h create mode 100644 esphome/components/mqtt_subscribe/__init__.py create mode 100644 esphome/components/mqtt_subscribe/sensor/__init__.py create mode 100644 esphome/components/mqtt_subscribe/sensor/mqtt_subscribe_sensor.cpp create mode 100644 esphome/components/mqtt_subscribe/sensor/mqtt_subscribe_sensor.h create mode 100644 esphome/components/mqtt_subscribe/text_sensor/__init__.py create mode 100644 esphome/components/mqtt_subscribe/text_sensor/mqtt_subscribe_text_sensor.cpp create mode 100644 esphome/components/mqtt_subscribe/text_sensor/mqtt_subscribe_text_sensor.h create mode 100644 esphome/components/ms5611/__init__.py create mode 100644 esphome/components/ms5611/ms5611.cpp create mode 100644 esphome/components/ms5611/ms5611.h create mode 100644 esphome/components/ms5611/sensor.py delete mode 100644 esphome/components/my9231.py create mode 100644 esphome/components/my9231/__init__.py create mode 100644 esphome/components/my9231/my9231.cpp create mode 100644 esphome/components/my9231/my9231.h create mode 100644 esphome/components/my9231/output.py create mode 100644 esphome/components/neopixelbus/__init__.py create mode 100644 esphome/components/neopixelbus/light.py create mode 100644 esphome/components/neopixelbus/neopixelbus_light.h create mode 100644 esphome/components/nextion/__init__.py create mode 100644 esphome/components/nextion/binary_sensor.py create mode 100644 esphome/components/nextion/display.py create mode 100644 esphome/components/nextion/nextion.cpp create mode 100644 esphome/components/nextion/nextion.h delete mode 100644 esphome/components/ota.py create mode 100644 esphome/components/ota/__init__.py create mode 100644 esphome/components/ota/ota_component.cpp create mode 100644 esphome/components/ota/ota_component.h create mode 100644 esphome/components/output/automation.cpp create mode 100644 esphome/components/output/automation.h create mode 100644 esphome/components/output/binary_output.h delete mode 100644 esphome/components/output/copy.py delete mode 100644 esphome/components/output/esp8266_pwm.py create mode 100644 esphome/components/output/float_output.cpp create mode 100644 esphome/components/output/float_output.h delete mode 100644 esphome/components/output/gpio.py delete mode 100644 esphome/components/output/ledc.py delete mode 100644 esphome/components/output/my9231.py delete mode 100644 esphome/components/output/pca9685.py create mode 100644 esphome/components/output/switch/__init__.py create mode 100644 esphome/components/output/switch/output_switch.cpp create mode 100644 esphome/components/output/switch/output_switch.h create mode 100644 esphome/components/partition/__init__.py create mode 100644 esphome/components/partition/light.py create mode 100644 esphome/components/partition/light_partition.cpp create mode 100644 esphome/components/partition/light_partition.h delete mode 100644 esphome/components/pca9685.py create mode 100644 esphome/components/pca9685/__init__.py create mode 100644 esphome/components/pca9685/output.py create mode 100644 esphome/components/pca9685/pca9685_output.cpp create mode 100644 esphome/components/pca9685/pca9685_output.h delete mode 100644 esphome/components/pcf8574.py create mode 100644 esphome/components/pcf8574/__init__.py create mode 100644 esphome/components/pcf8574/pcf8574.cpp create mode 100644 esphome/components/pcf8574/pcf8574.h create mode 100644 esphome/components/pmsx003/__init__.py create mode 100644 esphome/components/pmsx003/pmsx003.cpp create mode 100644 esphome/components/pmsx003/pmsx003.h create mode 100644 esphome/components/pmsx003/sensor.py delete mode 100644 esphome/components/pn532.py create mode 100644 esphome/components/pn532/__init__.py create mode 100644 esphome/components/pn532/binary_sensor.py create mode 100644 esphome/components/pn532/pn532.cpp create mode 100644 esphome/components/pn532/pn532.h delete mode 100644 esphome/components/power_supply.py create mode 100644 esphome/components/power_supply/__init__.py create mode 100644 esphome/components/power_supply/power_supply.cpp create mode 100644 esphome/components/power_supply/power_supply.h create mode 100644 esphome/components/pulse_counter/__init__.py create mode 100644 esphome/components/pulse_counter/pulse_counter_sensor.cpp create mode 100644 esphome/components/pulse_counter/pulse_counter_sensor.h create mode 100644 esphome/components/pulse_counter/sensor.py create mode 100644 esphome/components/pulse_width/__init__.py create mode 100644 esphome/components/pulse_width/pulse_width.cpp create mode 100644 esphome/components/pulse_width/pulse_width.h create mode 100644 esphome/components/pulse_width/sensor.py delete mode 100644 esphome/components/rdm6300.py create mode 100644 esphome/components/rdm6300/__init__.py create mode 100644 esphome/components/rdm6300/binary_sensor.py create mode 100644 esphome/components/rdm6300/rdm6300.cpp create mode 100644 esphome/components/rdm6300/rdm6300.h create mode 100644 esphome/components/remote_base/__init__.py create mode 100644 esphome/components/remote_base/jvc_protocol.cpp create mode 100644 esphome/components/remote_base/jvc_protocol.h create mode 100644 esphome/components/remote_base/lg_protocol.cpp create mode 100644 esphome/components/remote_base/lg_protocol.h create mode 100644 esphome/components/remote_base/nec_protocol.cpp create mode 100644 esphome/components/remote_base/nec_protocol.h create mode 100644 esphome/components/remote_base/panasonic_protocol.cpp create mode 100644 esphome/components/remote_base/panasonic_protocol.h create mode 100644 esphome/components/remote_base/raw_protocol.cpp create mode 100644 esphome/components/remote_base/raw_protocol.h create mode 100644 esphome/components/remote_base/rc5_protocol.cpp create mode 100644 esphome/components/remote_base/rc5_protocol.h create mode 100644 esphome/components/remote_base/rc_switch_protocol.cpp create mode 100644 esphome/components/remote_base/rc_switch_protocol.h create mode 100644 esphome/components/remote_base/remote_base.cpp create mode 100644 esphome/components/remote_base/remote_base.h create mode 100644 esphome/components/remote_base/samsung_protocol.cpp create mode 100644 esphome/components/remote_base/samsung_protocol.h create mode 100644 esphome/components/remote_base/sony_protocol.cpp create mode 100644 esphome/components/remote_base/sony_protocol.h delete mode 100644 esphome/components/remote_receiver.py create mode 100644 esphome/components/remote_receiver/__init__.py create mode 100644 esphome/components/remote_receiver/binary_sensor.py create mode 100644 esphome/components/remote_receiver/remote_receiver.h create mode 100644 esphome/components/remote_receiver/remote_receiver_esp32.cpp create mode 100644 esphome/components/remote_receiver/remote_receiver_esp8266.cpp delete mode 100644 esphome/components/remote_transmitter.py create mode 100644 esphome/components/remote_transmitter/__init__.py create mode 100644 esphome/components/remote_transmitter/remote_transmitter.cpp create mode 100644 esphome/components/remote_transmitter/remote_transmitter.h create mode 100644 esphome/components/remote_transmitter/remote_transmitter_esp32.cpp create mode 100644 esphome/components/remote_transmitter/remote_transmitter_esp8266.cpp create mode 100644 esphome/components/remote_transmitter/switch.py create mode 100644 esphome/components/restart/__init__.py create mode 100644 esphome/components/restart/restart_switch.cpp create mode 100644 esphome/components/restart/restart_switch.h create mode 100644 esphome/components/restart/switch.py create mode 100644 esphome/components/rgb/__init__.py create mode 100644 esphome/components/rgb/light.py create mode 100644 esphome/components/rgb/rgb_light_output.h create mode 100644 esphome/components/rgbw/__init__.py create mode 100644 esphome/components/rgbw/light.py create mode 100644 esphome/components/rgbw/rgbw_light_output.h create mode 100644 esphome/components/rgbww/__init__.py create mode 100644 esphome/components/rgbww/light.py create mode 100644 esphome/components/rgbww/rgbww_light_output.h create mode 100644 esphome/components/rotary_encoder/__init__.py create mode 100644 esphome/components/rotary_encoder/rotary_encoder.cpp create mode 100644 esphome/components/rotary_encoder/rotary_encoder.h create mode 100644 esphome/components/rotary_encoder/sensor.py delete mode 100644 esphome/components/script.py create mode 100644 esphome/components/script/__init__.py create mode 100644 esphome/components/script/script.h create mode 100644 esphome/components/sds011/__init__.py create mode 100644 esphome/components/sds011/sds011.cpp create mode 100644 esphome/components/sds011/sds011.h create mode 100644 esphome/components/sds011/sensor.py delete mode 100644 esphome/components/sensor/adc.py delete mode 100644 esphome/components/sensor/apds9960.py create mode 100644 esphome/components/sensor/automation.cpp create mode 100644 esphome/components/sensor/automation.h delete mode 100644 esphome/components/sensor/bh1750.py delete mode 100644 esphome/components/sensor/ble_rssi.py delete mode 100644 esphome/components/sensor/bme280.py delete mode 100644 esphome/components/sensor/bme680.py delete mode 100644 esphome/components/sensor/bmp085.py delete mode 100644 esphome/components/sensor/bmp280.py delete mode 100644 esphome/components/sensor/cse7766.py delete mode 100644 esphome/components/sensor/custom.py delete mode 100644 esphome/components/sensor/dallas.py delete mode 100644 esphome/components/sensor/dht.py delete mode 100644 esphome/components/sensor/dht12.py delete mode 100644 esphome/components/sensor/duty_cycle.py delete mode 100644 esphome/components/sensor/esp32_hall.py create mode 100644 esphome/components/sensor/filter.cpp create mode 100644 esphome/components/sensor/filter.h delete mode 100644 esphome/components/sensor/hdc1080.py delete mode 100644 esphome/components/sensor/hlw8012.py delete mode 100644 esphome/components/sensor/hmc5883l.py delete mode 100644 esphome/components/sensor/homeassistant.py delete mode 100644 esphome/components/sensor/htu21d.py delete mode 100644 esphome/components/sensor/hx711.py delete mode 100644 esphome/components/sensor/ina219.py delete mode 100644 esphome/components/sensor/ina3221.py delete mode 100644 esphome/components/sensor/max31855.py delete mode 100644 esphome/components/sensor/max6675.py delete mode 100644 esphome/components/sensor/mhz19.py delete mode 100644 esphome/components/sensor/mpu6050.py delete mode 100644 esphome/components/sensor/mqtt_subscribe.py delete mode 100644 esphome/components/sensor/ms5611.py delete mode 100644 esphome/components/sensor/pmsx003.py delete mode 100644 esphome/components/sensor/pulse_counter.py delete mode 100644 esphome/components/sensor/rotary_encoder.py delete mode 100644 esphome/components/sensor/sds011.py create mode 100644 esphome/components/sensor/sensor.cpp create mode 100644 esphome/components/sensor/sensor.h delete mode 100644 esphome/components/sensor/sht3xd.py delete mode 100644 esphome/components/sensor/tcs34725.py delete mode 100644 esphome/components/sensor/template.py delete mode 100644 esphome/components/sensor/total_daily_energy.py delete mode 100644 esphome/components/sensor/tsl2561.py delete mode 100644 esphome/components/sensor/ultrasonic.py delete mode 100644 esphome/components/sensor/uptime.py delete mode 100644 esphome/components/sensor/wifi_signal.py delete mode 100644 esphome/components/sensor/xiaomi_miflora.py delete mode 100644 esphome/components/sensor/xiaomi_mijia.py delete mode 100644 esphome/components/servo.py create mode 100644 esphome/components/servo/__init__.py create mode 100644 esphome/components/servo/servo.cpp create mode 100644 esphome/components/servo/servo.h create mode 100644 esphome/components/sht3xd/__init__.py create mode 100644 esphome/components/sht3xd/sensor.py create mode 100644 esphome/components/sht3xd/sht3xd.cpp create mode 100644 esphome/components/sht3xd/sht3xd.h create mode 100644 esphome/components/shutdown/__init__.py create mode 100644 esphome/components/shutdown/shutdown_switch.cpp create mode 100644 esphome/components/shutdown/shutdown_switch.h create mode 100644 esphome/components/shutdown/switch.py create mode 100644 esphome/components/sntp/__init__.py create mode 100644 esphome/components/sntp/sntp_component.cpp create mode 100644 esphome/components/sntp/sntp_component.h create mode 100644 esphome/components/sntp/time.py create mode 100644 esphome/components/speed/__init__.py create mode 100644 esphome/components/speed/fan/__init__.py create mode 100644 esphome/components/speed/fan/speed_fan.cpp create mode 100644 esphome/components/speed/fan/speed_fan.h delete mode 100644 esphome/components/spi.py create mode 100644 esphome/components/spi/__init__.py create mode 100644 esphome/components/spi/spi.cpp create mode 100644 esphome/components/spi/spi.h create mode 100644 esphome/components/ssd1306_base/__init__.py create mode 100644 esphome/components/ssd1306_base/ssd1306_base.cpp create mode 100644 esphome/components/ssd1306_base/ssd1306_base.h create mode 100644 esphome/components/ssd1306_i2c/__init__.py create mode 100644 esphome/components/ssd1306_i2c/display.py create mode 100644 esphome/components/ssd1306_i2c/ssd1306_i2c.cpp create mode 100644 esphome/components/ssd1306_i2c/ssd1306_i2c.h create mode 100644 esphome/components/ssd1306_spi/__init__.py create mode 100644 esphome/components/ssd1306_spi/display.py create mode 100644 esphome/components/ssd1306_spi/ssd1306_spi.cpp create mode 100644 esphome/components/ssd1306_spi/ssd1306_spi.h create mode 100644 esphome/components/status/__init__.py create mode 100644 esphome/components/status/binary_sensor.py create mode 100644 esphome/components/status/status_binary_sensor.cpp create mode 100644 esphome/components/status/status_binary_sensor.h delete mode 100644 esphome/components/status_led.py create mode 100644 esphome/components/status_led/__init__.py create mode 100644 esphome/components/status_led/status_led.cpp create mode 100644 esphome/components/status_led/status_led.h delete mode 100644 esphome/components/stepper/a4988.py create mode 100644 esphome/components/stepper/stepper.cpp create mode 100644 esphome/components/stepper/stepper.h delete mode 100644 esphome/components/stepper/uln2003.py rename esphome/components/{substitutions.py => substitutions/__init__.py} (94%) create mode 100644 esphome/components/switch/automation.cpp create mode 100644 esphome/components/switch/automation.h delete mode 100644 esphome/components/switch/custom.py delete mode 100644 esphome/components/switch/gpio.py delete mode 100644 esphome/components/switch/output.py delete mode 100644 esphome/components/switch/remote_transmitter.py delete mode 100644 esphome/components/switch/restart.py delete mode 100644 esphome/components/switch/shutdown.py create mode 100644 esphome/components/switch/switch.cpp create mode 100644 esphome/components/switch/switch.h delete mode 100644 esphome/components/switch/template.py delete mode 100644 esphome/components/switch/uart.py create mode 100644 esphome/components/tcs34725/__init__.py create mode 100644 esphome/components/tcs34725/sensor.py create mode 100644 esphome/components/tcs34725/tcs34725.cpp create mode 100644 esphome/components/tcs34725/tcs34725.h create mode 100644 esphome/components/template/__init__.py create mode 100644 esphome/components/template/binary_sensor/__init__.py create mode 100644 esphome/components/template/binary_sensor/template_binary_sensor.cpp create mode 100644 esphome/components/template/binary_sensor/template_binary_sensor.h create mode 100644 esphome/components/template/cover/__init__.py create mode 100644 esphome/components/template/cover/template_cover.cpp create mode 100644 esphome/components/template/cover/template_cover.h create mode 100644 esphome/components/template/sensor/__init__.py create mode 100644 esphome/components/template/sensor/template_sensor.cpp create mode 100644 esphome/components/template/sensor/template_sensor.h create mode 100644 esphome/components/template/switch/__init__.py create mode 100644 esphome/components/template/switch/template_switch.cpp create mode 100644 esphome/components/template/switch/template_switch.h create mode 100644 esphome/components/template/text_sensor/__init__.py create mode 100644 esphome/components/template/text_sensor/template_text_sensor.cpp create mode 100644 esphome/components/template/text_sensor/template_text_sensor.h create mode 100644 esphome/components/text_sensor/automation.cpp create mode 100644 esphome/components/text_sensor/automation.h delete mode 100644 esphome/components/text_sensor/custom.py delete mode 100644 esphome/components/text_sensor/homeassistant.py delete mode 100644 esphome/components/text_sensor/mqtt_subscribe.py delete mode 100644 esphome/components/text_sensor/template.py create mode 100644 esphome/components/text_sensor/text_sensor.cpp create mode 100644 esphome/components/text_sensor/text_sensor.h delete mode 100644 esphome/components/text_sensor/version.py delete mode 100644 esphome/components/text_sensor/wifi_info.py create mode 100644 esphome/components/time/automation.cpp create mode 100644 esphome/components/time/automation.h delete mode 100644 esphome/components/time/homeassistant.py create mode 100644 esphome/components/time/real_time_clock.cpp create mode 100644 esphome/components/time/real_time_clock.h delete mode 100644 esphome/components/time/sntp.py create mode 100644 esphome/components/time_based/__init__.py create mode 100644 esphome/components/time_based/cover.py create mode 100644 esphome/components/time_based/time_based_cover.cpp create mode 100644 esphome/components/time_based/time_based_cover.h create mode 100644 esphome/components/total_daily_energy/__init__.py create mode 100644 esphome/components/total_daily_energy/sensor.py create mode 100644 esphome/components/total_daily_energy/total_daily_energy.cpp create mode 100644 esphome/components/total_daily_energy/total_daily_energy.h create mode 100644 esphome/components/tsl2561/__init__.py create mode 100644 esphome/components/tsl2561/sensor.py create mode 100644 esphome/components/tsl2561/tsl2561.cpp create mode 100644 esphome/components/tsl2561/tsl2561.h delete mode 100644 esphome/components/ttp229_lsf.py create mode 100644 esphome/components/ttp229_lsf/__init__.py create mode 100644 esphome/components/ttp229_lsf/binary_sensor.py create mode 100644 esphome/components/ttp229_lsf/ttp229.cpp create mode 100644 esphome/components/ttp229_lsf/ttp229.h delete mode 100644 esphome/components/uart.py create mode 100644 esphome/components/uart/__init__.py create mode 100644 esphome/components/uart/switch/__init__.py create mode 100644 esphome/components/uart/switch/uart_switch.cpp create mode 100644 esphome/components/uart/switch/uart_switch.h create mode 100644 esphome/components/uart/uart.cpp create mode 100644 esphome/components/uart/uart.h create mode 100644 esphome/components/uln2003/__init__.py create mode 100644 esphome/components/uln2003/stepper.py create mode 100644 esphome/components/uln2003/uln2003.cpp create mode 100644 esphome/components/uln2003/uln2003.h create mode 100644 esphome/components/ultrasonic/__init__.py create mode 100644 esphome/components/ultrasonic/sensor.py create mode 100644 esphome/components/ultrasonic/ultrasonic_sensor.cpp create mode 100644 esphome/components/ultrasonic/ultrasonic_sensor.h create mode 100644 esphome/components/uptime/__init__.py create mode 100644 esphome/components/uptime/sensor.py create mode 100644 esphome/components/uptime/uptime_sensor.cpp create mode 100644 esphome/components/uptime/uptime_sensor.h create mode 100644 esphome/components/version/__init__.py create mode 100644 esphome/components/version/text_sensor.py create mode 100644 esphome/components/version/version_text_sensor.cpp create mode 100644 esphome/components/version/version_text_sensor.h create mode 100644 esphome/components/waveshare_epaper/__init__.py create mode 100644 esphome/components/waveshare_epaper/display.py create mode 100644 esphome/components/waveshare_epaper/waveshare_epaper.cpp create mode 100644 esphome/components/waveshare_epaper/waveshare_epaper.h delete mode 100644 esphome/components/web_server.py create mode 100644 esphome/components/web_server/__init__.py create mode 100644 esphome/components/web_server/web_server.cpp create mode 100644 esphome/components/web_server/web_server.h delete mode 100644 esphome/components/wifi.py create mode 100644 esphome/components/wifi/__init__.py create mode 100644 esphome/components/wifi/wifi_component.cpp create mode 100644 esphome/components/wifi/wifi_component.h create mode 100644 esphome/components/wifi/wifi_component_esp32.cpp create mode 100644 esphome/components/wifi/wifi_component_esp8266.cpp create mode 100644 esphome/components/wifi_info/__init__.py create mode 100644 esphome/components/wifi_info/text_sensor.py create mode 100644 esphome/components/wifi_info/wifi_info_text_sensor.h create mode 100644 esphome/components/wifi_signal/__init__.py create mode 100644 esphome/components/wifi_signal/sensor.py create mode 100644 esphome/components/wifi_signal/wifi_signal_sensor.cpp create mode 100644 esphome/components/wifi_signal/wifi_signal_sensor.h create mode 100644 esphome/components/xiaomi_ble/__init__.py create mode 100644 esphome/components/xiaomi_ble/xiaomi_ble.cpp create mode 100644 esphome/components/xiaomi_ble/xiaomi_ble.h create mode 100644 esphome/components/xiaomi_miflora/__init__.py create mode 100644 esphome/components/xiaomi_miflora/sensor.py create mode 100644 esphome/components/xiaomi_miflora/xiaomi_miflora.cpp create mode 100644 esphome/components/xiaomi_miflora/xiaomi_miflora.h create mode 100644 esphome/components/xiaomi_mijia/__init__.py create mode 100644 esphome/components/xiaomi_mijia/sensor.py create mode 100644 esphome/components/xiaomi_mijia/xiaomi_mijia.cpp create mode 100644 esphome/components/xiaomi_mijia/xiaomi_mijia.h create mode 100644 esphome/core/application.cpp create mode 100644 esphome/core/application.h create mode 100644 esphome/core/automation.cpp create mode 100644 esphome/core/automation.h create mode 100644 esphome/core/automation.tcc create mode 100644 esphome/core/component.cpp create mode 100644 esphome/core/component.h create mode 100644 esphome/core/controller.cpp create mode 100644 esphome/core/controller.h create mode 100644 esphome/core/defines.h create mode 100644 esphome/core/esphal.cpp create mode 100644 esphome/core/esphal.h create mode 100644 esphome/core/helpers.cpp create mode 100644 esphome/core/helpers.h create mode 100644 esphome/core/log.cpp create mode 100644 esphome/core/log.h create mode 100644 esphome/core/optional.h create mode 100644 esphome/core/preferences.cpp create mode 100644 esphome/core/preferences.h create mode 100644 esphome/core/util.cpp create mode 100644 esphome/core/util.h delete mode 100755 esphome/espota.py create mode 100644 platformio.ini create mode 100644 requirements_test.txt create mode 100644 script/.neopixelbus.patch create mode 100755 script/ci-custom.py create mode 100755 script/ci-suggest-changes create mode 100755 script/clang-format.py create mode 100755 script/clang-tidy.py create mode 100755 script/lint-cpp create mode 100755 script/lint-python create mode 100755 script/setup create mode 100755 script/test create mode 100644 tests/livingroom32.cpp create mode 100644 tests/livingroom8266.cpp diff --git a/.clang-format b/.clang-format new file mode 100644 index 0000000000..a7c337f80e --- /dev/null +++ b/.clang-format @@ -0,0 +1,137 @@ +Language: Cpp +AccessModifierOffset: -1 +AlignAfterOpenBracket: Align +AlignConsecutiveAssignments: false +AlignConsecutiveDeclarations: false +AlignEscapedNewlines: DontAlign +AlignOperands: true +AlignTrailingComments: true +AllowAllParametersOfDeclarationOnNextLine: true +AllowShortBlocksOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: false +AllowShortFunctionsOnASingleLine: All +AllowShortIfStatementsOnASingleLine: false +AllowShortLoopsOnASingleLine: false +AlwaysBreakAfterReturnType: None +AlwaysBreakBeforeMultilineStrings: false +AlwaysBreakTemplateDeclarations: MultiLine +BinPackArguments: true +BinPackParameters: true +BraceWrapping: + AfterClass: false + AfterControlStatement: false + AfterEnum: false + AfterFunction: false + AfterNamespace: false + AfterObjCDeclaration: false + AfterStruct: false + AfterUnion: false + AfterExternBlock: false + BeforeCatch: false + BeforeElse: false + IndentBraces: false + SplitEmptyFunction: true + SplitEmptyRecord: true + SplitEmptyNamespace: true +BreakBeforeBinaryOperators: None +BreakBeforeBraces: Attach +BreakBeforeInheritanceComma: false +BreakInheritanceList: BeforeColon +BreakBeforeTernaryOperators: true +BreakConstructorInitializersBeforeComma: false +BreakConstructorInitializers: BeforeColon +BreakAfterJavaFieldAnnotations: false +BreakStringLiterals: true +ColumnLimit: 120 +CommentPragmas: '^ IWYU pragma:' +CompactNamespaces: false +ConstructorInitializerAllOnOneLineOrOnePerLine: true +ConstructorInitializerIndentWidth: 4 +ContinuationIndentWidth: 4 +Cpp11BracedListStyle: true +DerivePointerAlignment: true +DisableFormat: false +ExperimentalAutoDetectBinPacking: false +FixNamespaceComments: true +ForEachMacros: + - foreach + - Q_FOREACH + - BOOST_FOREACH +IncludeBlocks: Preserve +IncludeCategories: + - Regex: '^' + Priority: 2 + - Regex: '^<.*\.h>' + Priority: 1 + - Regex: '^<.*' + Priority: 2 + - Regex: '.*' + Priority: 3 +IncludeIsMainRegex: '([-_](test|unittest))?$' +IndentCaseLabels: true +IndentPPDirectives: None +IndentWidth: 2 +IndentWrappedFunctionNames: false +KeepEmptyLinesAtTheStartOfBlocks: false +MacroBlockBegin: '' +MacroBlockEnd: '' +MaxEmptyLinesToKeep: 1 +NamespaceIndentation: None +PenaltyBreakAssignment: 2 +PenaltyBreakBeforeFirstCallParameter: 1 +PenaltyBreakComment: 300 +PenaltyBreakFirstLessLess: 120 +PenaltyBreakString: 1000 +PenaltyBreakTemplateDeclaration: 10 +PenaltyExcessCharacter: 1000000 +PenaltyReturnTypeOnItsOwnLine: 2000 +PointerAlignment: Right +RawStringFormats: + - Language: Cpp + Delimiters: + - cc + - CC + - cpp + - Cpp + - CPP + - 'c++' + - 'C++' + CanonicalDelimiter: '' + BasedOnStyle: google + - Language: TextProto + Delimiters: + - pb + - PB + - proto + - PROTO + EnclosingFunctions: + - EqualsProto + - EquivToProto + - PARSE_PARTIAL_TEXT_PROTO + - PARSE_TEST_PROTO + - PARSE_TEXT_PROTO + - ParseTextOrDie + - ParseTextProtoOrDie + CanonicalDelimiter: '' + BasedOnStyle: google +ReflowComments: true +SortIncludes: false +SortUsingDeclarations: false +SpaceAfterCStyleCast: true +SpaceAfterTemplateKeyword: false +SpaceBeforeAssignmentOperators: true +SpaceBeforeCpp11BracedList: false +SpaceBeforeCtorInitializerColon: true +SpaceBeforeInheritanceColon: true +SpaceBeforeParens: ControlStatements +SpaceBeforeRangeBasedForLoopColon: true +SpaceInEmptyParentheses: false +SpacesBeforeTrailingComments: 2 +SpacesInAngles: false +SpacesInContainerLiterals: false +SpacesInCStyleCastParentheses: false +SpacesInParentheses: false +SpacesInSquareBrackets: false +Standard: Auto +TabWidth: 2 +UseTab: Never diff --git a/.clang-tidy b/.clang-tidy new file mode 100644 index 0000000000..5e486e6a0c --- /dev/null +++ b/.clang-tidy @@ -0,0 +1,127 @@ +--- +Checks: >- + *, + -abseil-*, + -android-*, + -boost-*, + -bugprone-macro-parentheses, + -cert-dcl50-cpp, + -cert-err58-cpp, + -clang-analyzer-core.CallAndMessage, + -clang-analyzer-osx.*, + -clang-analyzer-security.*, + -cppcoreguidelines-avoid-goto, + -cppcoreguidelines-c-copy-assignment-signature, + -cppcoreguidelines-owning-memory, + -cppcoreguidelines-pro-bounds-array-to-pointer-decay, + -cppcoreguidelines-pro-bounds-constant-array-index, + -cppcoreguidelines-pro-bounds-pointer-arithmetic, + -cppcoreguidelines-pro-type-const-cast, + -cppcoreguidelines-pro-type-cstyle-cast, + -cppcoreguidelines-pro-type-member-init, + -cppcoreguidelines-pro-type-reinterpret-cast, + -cppcoreguidelines-pro-type-static-cast-downcast, + -cppcoreguidelines-pro-type-union-access, + -cppcoreguidelines-pro-type-vararg, + -cppcoreguidelines-special-member-functions, + -fuchsia-*, + -fuchsia-default-arguments, + -fuchsia-multiple-inheritance, + -fuchsia-overloaded-operator, + -fuchsia-statically-constructed-objects, + -google-build-using-namespace, + -google-explicit-constructor, + -google-readability-braces-around-statements, + -google-readability-casting, + -google-readability-todo, + -google-runtime-int, + -google-runtime-references, + -hicpp-*, + -llvm-header-guard, + -llvm-include-order, + -misc-unconventional-assign-operator, + -misc-unused-parameters, + -modernize-deprecated-headers, + -modernize-pass-by-value, + -modernize-pass-by-value, + -modernize-return-braced-init-list, + -modernize-use-auto, + -modernize-use-default-member-init, + -modernize-use-equals-default, + -mpi-*, + -objc-*, + -performance-unnecessary-value-param, + -readability-braces-around-statements, + -readability-else-after-return, + -readability-implicit-bool-conversion, + -readability-named-parameter, + -readability-redundant-member-init, + -warnings-as-errors, + -zircon-* +WarningsAsErrors: '*' +HeaderFilterRegex: '^.*/src/esphome/.*' +AnalyzeTemporaryDtors: false +FormatStyle: google +CheckOptions: + - key: google-readability-braces-around-statements.ShortStatementLines + value: '1' + - key: google-readability-function-size.StatementThreshold + value: '800' + - key: google-readability-namespace-comments.ShortNamespaceLines + value: '10' + - key: google-readability-namespace-comments.SpacesBeforeComments + value: '2' + - key: modernize-loop-convert.MaxCopySize + value: '16' + - key: modernize-loop-convert.MinConfidence + value: reasonable + - key: modernize-loop-convert.NamingStyle + value: CamelCase + - key: modernize-pass-by-value.IncludeStyle + value: llvm + - key: modernize-replace-auto-ptr.IncludeStyle + value: llvm + - key: modernize-use-nullptr.NullMacros + value: 'NULL' + - key: readability-identifier-naming.LocalVariableCase + value: 'lower_case' + - key: readability-identifier-naming.ClassCase + value: 'CamelCase' + - key: readability-identifier-naming.StructCase + value: 'CamelCase' + - key: readability-identifier-naming.EnumCase + value: 'CamelCase' + - key: readability-identifier-naming.EnumConstantCase + value: 'UPPER_CASE' + - key: readability-identifier-naming.StaticConstantCase + value: 'UPPER_CASE' + - key: readability-identifier-naming.StaticVariableCase + value: 'UPPER_CASE' + - key: readability-identifier-naming.GlobalConstantCase + value: 'UPPER_CASE' + - key: readability-identifier-naming.ParameterCase + value: 'lower_case' + - key: readability-identifier-naming.PrivateMemberPrefix + value: 'NO_PRIVATE_MEMBERS_ALWAYS_USE_PROTECTED' + - key: readability-identifier-naming.PrivateMethodPrefix + value: 'NO_PRIVATE_METHODS_ALWAYS_USE_PROTECTED' + - key: readability-identifier-naming.ClassMemberCase + value: 'lower_case' + - key: readability-identifier-naming.ClassMemberCase + value: 'lower_case' + - key: readability-identifier-naming.ProtectedMemberCase + value: 'lower_case' + - key: readability-identifier-naming.ProtectedMemberSuffix + value: '_' + - key: readability-identifier-naming.FunctionCase + value: 'lower_case' + - key: readability-identifier-naming.ClassMethodCase + value: 'lower_case' + - key: readability-identifier-naming.ProtectedMethodCase + value: 'lower_case' + - key: readability-identifier-naming.ProtectedMethodSuffix + value: '_' + - key: readability-identifier-naming.VirtualMethodCase + value: 'lower_case' + - key: readability-identifier-naming.VirtualMethodSuffix + value: '' diff --git a/.gitignore b/.gitignore index c8a36dfd3a..6ca9361b11 100644 --- a/.gitignore +++ b/.gitignore @@ -25,12 +25,6 @@ wheels/ *.egg MANIFEST -# PyInstaller -# Usually these files are written by a python script from a template -# before PyInstaller builds the exe, so as to inject date/other infos into it. -*.manifest -*.spec - # Installer logs pip-log.txt pip-delete-this-directory.txt @@ -51,36 +45,9 @@ coverage.xml *.mo *.pot -# Django stuff: -*.log -local_settings.py -db.sqlite3 - -# Flask stuff: -instance/ -.webassets-cache - -# Scrapy stuff: -.scrapy - -# Sphinx documentation -docs/_build/ - -# PyBuilder -target/ - -# Jupyter Notebook -.ipynb_checkpoints - # pyenv .python-version -# celery beat schedule file -celerybeat-schedule - -# SageMath parsed files -*.sage.py - # Environments .env .venv @@ -90,19 +57,46 @@ ENV/ env.bak/ venv.bak/ -# Spyder project settings -.spyderproject -.spyproject - -# Rope project settings -.ropeproject - -# mkdocs documentation -/site - # mypy .mypy_cache/ +.pioenvs +.piolibdeps +.vscode +CMakeListsPrivate.txt +CMakeLists.txt + +# User-specific stuff: +.idea/**/workspace.xml +.idea/**/tasks.xml +.idea/dictionaries + +# Sensitive or high-churn files: +.idea/**/dataSources/ +.idea/**/dataSources.ids +.idea/**/dataSources.xml +.idea/**/dataSources.local.xml +.idea/**/dynamic.xml + +# CMake +cmake-build-debug/ +cmake-build-release/ + +CMakeCache.txt +CMakeFiles +CMakeScripts +Testing +Makefile +cmake_install.cmake +install_manifest.txt +compile_commands.json +CTestTestfile.cmake +/*.cbp + +.clang_complete +.gcc-flags.json + config/ tests/build/ tests/.esphome/ +/.temp-clang-tidy.cpp diff --git a/.travis.yml b/.travis.yml index 4b59e25817..b5642478f5 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,9 +1,10 @@ sudo: false language: python - +install: script/setup cache: directories: - "~/.platformio" + - "$TRAVIS_BUILD_DIR/.piolibdeps" - "$TRAVIS_BUILD_DIR/tests/build/test1/.piolibdeps" - "$TRAVIS_BUILD_DIR/tests/build/test2/.piolibdeps" - "$TRAVIS_BUILD_DIR/tests/build/test3/.piolibdeps" @@ -13,26 +14,43 @@ matrix: include: - python: "2.7" env: TARGET=Lint2.7 - install: pip install -e . && pip install flake8==3.6.0 pylint==1.9.4 pillow script: + - script/ci-custom.py - flake8 esphome - pylint esphome - python: "3.5.3" env: TARGET=Lint3.5 - install: pip install -U https://github.com/platformio/platformio-core/archive/develop.zip && pip install -e . && pip install flake8==3.6.0 pylint==2.3.0 pillow script: + - script/ci-custom.py - flake8 esphome - pylint esphome - python: "2.7" env: TARGET=Test2.7 - install: pip install -e . && pip install flake8==3.6.0 pylint==1.9.4 pillow script: - esphome tests/test1.yaml compile - esphome tests/test2.yaml compile - esphome tests/test3.yaml compile - #- python: "3.5.3" - # env: TARGET=Test3.5 - # install: pip install -U https://github.com/platformio/platformio-core/archive/develop.zip && pip install -e . && pip install flake8==3.6.0 pylint==2.3.0 pillow - # script: - # - esphome tests/test1.yaml compile - # - esphome tests/test2.yaml compile + - env: TARGET=Cpp-Lint + dist: trusty + sudo: required + addons: + apt: + sources: + - ubuntu-toolchain-r-test + - llvm-toolchain-trusty-7 + packages: + - clang-tidy-7 + - clang-format-7 + before_script: + - pio init --ide atom + - | + if ! patch -R -p0 -s -f --dry-run