mirror of
https://github.com/esphome/esphome.git
synced 2024-11-22 15:08:10 +01:00
My Home-IoT
11f1e28139
Currently, in each loop during DisplayBuffer::update_() the display is cleared by calling DisplayBuffer::clear(). This prevents more efficient display usages that do not render the screen in each loop, but only if necessary. This can be helpful, for example, if images are rendered. This would cause the loop time to be exceeded frequently. This change adds a new optional flag "auto_clear" that can be used to control the clearing behavior. If unset, the DisplayBuffer defaults to enabled auto clearing, the current behavior and thus backward compatible. This flag applies to displays that use DisplayBuffer. Example excerpt: globals: - id: state type: bool restore_value: no initial_value: "false" - id: state_processed type: bool restore_value: no initial_value: "false" switch: - platform: template name: "State" id: state_switch lambda: |- return id(state); turn_on_action: - globals.set: id: state value: "true" - globals.set: id: state_processed value: "false" turn_off_action: - globals.set: id: state value: "false" - globals.set: id: state_processed value: "false" display: - platform: ili9341 # ... auto_clear_enabled: false lambda: |- if (!id(state_processed)) { it.fill(COLOR_WHITE); if (id(state)) { it.image(80, 20, id(image1)); } else { it.image(80, 20, id(image2)); } id(state_processed) = true; } Co-authored-by: Tim Niemueller <timdn@google.com> |
||
---|---|---|
.devcontainer | ||
.github | ||
.vscode | ||
docker | ||
esphome | ||
script | ||
tests | ||
.clang-format | ||
.clang-tidy | ||
.coveragerc | ||
.dockerignore | ||
.editorconfig | ||
.gitattributes | ||
.gitignore | ||
.gitpod.yml | ||
.pre-commit-config.yaml | ||
CODE_OF_CONDUCT.md | ||
CODEOWNERS | ||
CONTRIBUTING.md | ||
LICENSE | ||
MANIFEST.in | ||
platformio.ini | ||
pylintrc | ||
pyproject.toml | ||
pytest.ini | ||
README.md | ||
requirements.txt | ||
requirements_optional.txt | ||
requirements_test.txt | ||
sdkconfig.defaults | ||
setup.cfg | ||
setup.py |
ESPHome
Documentation: https://esphome.io/
For issues, please go to the issue tracker.
For feature requests, please see feature requests.