My Home-IoT
Find a file
Michael Davidson adb7aa6950
Thermostat preset with modes (#3298)
* Rework HOME/AWAY support to being driven via a map of ClimatePreset/ThermostatClimateTargetTempConfig
This opens up to theoretically being able to support other presets (ECO, SLEEP, etc)

* Add support for additional presets
Configuration takes the form;
```
climate:
  platform: preset
  ...
  preset:
    [eco | away | boost | comfort | home | sleep | activity]:
      default_target_temperature_low: 20
      default_target_temperature_high: 24
```

These will be available in the Home Assistant UI and, like the existing Home/Away config will reset the temperature in line with these defaults when selected. The existing away_config/home_config is still respected (although preset->home/preset->away will be applied after them and override them if both styles are specified)

* Add support for specifying MODE, FAN_MODE and SWING_MODE on a preset
When switching presets these will implicitly flow through to the controller. However calls to climate.control which specify any of these will take precedence even when changing the mode (think of the preset version as the default for that preset)

* Add `preset_change` mode trigger
When defined this trigger will fire when the preset for the thermostat has been changed. The intent of this is similar to `auto_mode` - it's not intended to be used to control the preset's state (eg. communicate with the physical thermostat) but instead might be used to update a visual indicator, for instance.

* Apply lint, clang-format, and clang-tidy fixes

* Additional clang-format fixes

* Wrap log related strings in LOG_STR_ARG

* Add support for custom presets
This also changes the configuration syntax to;
```yaml
  preset:
    # Standard preset
    - name: [eco | away | boost | comfort | home | sleep | activity]
      default_target_temperature_low: 20
      ...
    # Custom preset
    - name: My custom preset
      default_target_temperature_low: 18
```

For the end user there is no difference between a custom and built in preset. For developers custom presets are set via `climate.control` `custom_preset` property instead of the `preset`

* Lint/clang-format/clang-tidy fixes

* Additional lint/clang-format/clang-tidy fixes

* Clang-tidy changes

* Sort imports

* Improve configuration validation for presets
- Unify temperature validation across default, away, and preset configuration
- Validate modes for presets have the required actions

* Trigger a refresh after changing internals of the thermostat

* Apply formatting fixes

* Validate mode, fan_mode, and swing_mode on presets

* Add preset temperature validation against visual min/max configuration

* Apply code formatting fixes

* Fix preset temperature validation
2022-05-24 22:44:26 -05:00
.devcontainer Redo docker build system with buildkit+multi-stage and cache pio packages (#2338) 2021-09-20 09:07:38 +02:00
.github Lint trailing whitespace (#3230) 2022-02-19 14:46:27 +01:00
.vscode Refactor clang-tidy script to use actual compiler flags and includes (#2133) 2021-08-09 22:43:18 +02:00
docker feat: add openssh-client on docker image (#1681) (#3319) 2022-04-26 10:09:49 +12:00
esphome Thermostat preset with modes (#3298) 2022-05-24 22:44:26 -05:00
script protobuf: fix incomplete 64 bits implementation (#3341) 2022-04-04 08:38:44 +12:00
tests midea: New power_toggle action. Auto-use remote transmitter. (#3496) 2022-05-23 20:51:45 +12:00
.clang-format Configure clang-format for consistent pointer alignment (#1890) 2021-06-10 12:55:20 +02:00
.clang-tidy Force braces around multi-line statements (#3094) 2022-01-25 08:56:36 +13:00
.coveragerc Unittests for esphome python code (#931) 2020-03-12 14:27:22 -07:00
.dockerignore More VSCode devcontainer improvements (#1934) 2021-06-22 16:37:05 +02:00
.editorconfig Adds support cpp to vscode (#1828) 2021-06-15 10:45:22 +12:00
.gitattributes Fix line endings normalization (#2407) 2021-09-30 18:07:28 +02:00
.gitignore Raise minimum python version to 3.8 (#3176) 2022-02-10 09:55:11 +01:00
.gitpod.yml Fix argument order in gitpod config file (#3058) 2022-01-16 23:40:27 +01:00
.pre-commit-config.yaml Bump black from 22.1.0 to 22.3.0 (#3357) 2022-04-05 11:50:51 +02:00
CODE_OF_CONDUCT.md Update email addresses (#1733) 2021-05-03 11:51:10 +12:00
CODEOWNERS Add support for SGP41 (#3382) 2022-05-19 12:47:33 +12:00
CONTRIBUTING.md Lint trailing whitespace (#3230) 2022-02-19 14:46:27 +01:00
LICENSE 🏗 Merge C++ into python codebase (#504) 2019-04-17 12:06:00 +02:00
MANIFEST.in Add *.py.script files to distributions (#3074) 2022-01-20 08:33:13 +13:00
platformio.ini Add support for SGP41 (#3382) 2022-05-19 12:47:33 +12:00
pylintrc add-black (#1593) 2021-03-07 16:03:16 -03:00
pyproject.toml add-black (#1593) 2021-03-07 16:03:16 -03:00
pytest.ini Unittests for esphome python code (#931) 2020-03-12 14:27:22 -07:00
README.md Rename master branch to release (#1976) 2021-07-02 15:42:36 +02:00
requirements.txt Bump esptool from 3.3 to 3.3.1 (#3468) 2022-05-13 13:44:24 +12:00
requirements_optional.txt Bump base image to 3.4.0 (#1879) 2021-06-08 22:03:04 +02:00
requirements_test.txt Bump pylint from 2.13.8 to 2.13.9 (#3470) 2022-05-15 19:46:36 +12:00
sdkconfig.defaults Set ESP32 watchdog to loop task (#2846) 2021-12-02 09:05:42 +13:00
setup.cfg add-black (#1593) 2021-03-07 16:03:16 -03:00
setup.py Raise minimum python version to 3.8 (#3176) 2022-02-10 09:55:11 +01:00

ESPHome Discord Chat GitHub release

ESPHome Logo

Documentation: https://esphome.io/

For issues, please go to the issue tracker.

For feature requests, please see feature requests.