mirror of
https://github.com/esphome/esphome.git
synced 2026-10-11 22:04:16 +00:00
[epaper_spi] Add is_updating condition (#20261)
This commit is contained in:
@@ -27,3 +27,8 @@ binary_sensor:
|
||||
name: Trigger
|
||||
on_press:
|
||||
- epaper_spi.full_update_next: epaper_display
|
||||
- if:
|
||||
condition:
|
||||
epaper_spi.is_updating: epaper_display
|
||||
then:
|
||||
- component.update: epaper_display
|
||||
|
||||
@@ -551,6 +551,16 @@ def test_full_update_next_action_code_generation(
|
||||
assert "epaper_display->request_full_update();" in main_cpp
|
||||
|
||||
|
||||
def test_is_updating_condition_code_generation(
|
||||
generate_main: Callable[[str | Path], str],
|
||||
component_config_path: Callable[[str], Path],
|
||||
) -> None:
|
||||
"""The epaper_spi.is_updating condition checks the configured display."""
|
||||
main_cpp = generate_main(component_config_path("full_update_next_test.yaml"))
|
||||
|
||||
assert "epaper_display->is_updating()" in main_cpp
|
||||
|
||||
|
||||
def test_model_with_no_default_init_sequence_generates(
|
||||
generate_main: Callable[[str | Path], str],
|
||||
component_config_path: Callable[[str], Path],
|
||||
|
||||
Reference in New Issue
Block a user