@ -617,13 +617,54 @@ Experienced programmers can use these public methods:
To use the display without homeassistant automations, you may use the [advanced functionality](#change-configuration-during-runtime) with triggers. The triggers can be fired by sensors, time or by the ehmtx component.
To use the display without homeassistant automations, you may use the [advanced functionality](#change-configuration-during-runtime) with triggers. The triggers can be fired by sensors, time or by the ehmtx component.
#### on_add_screen
There is a trigger available to do some local magic. The trigger ```on_add_screen``` is triggered every time a new screen with icon is added to the queue. In lambda's you can use two local variables:
**icon** (Name of the icon, std::string): value to use in lambda
**mode** ([mode](#modes) of the screen, uint8_t): value to use in lambda
See the examples:
##### Write information to esphome log
```yaml
ehmtxv2:
....
on_add_screen:
then:
- logger.log:
format: 'add screen: %s, mode: %d'
tag: "EHMTXv2 sample"
args:
- icon.c_str()
- mode
```
#### on_icon_error
The trigger ```on_icon_error``` is triggered if you try to add a screen with a non defined icon. In lambda's you can use one local string variable:
**icon** (Name of the icon, std::string): value to use in lambda
There is a trigger available to do some local magic. The trigger ```on_next_screen``` is triggered every time a new screen is displayed (it doesn't trigger on the clock/date display!!). In lambda's you can use two local string variables:
The trigger ```on_next_screen``` is triggered every time a new screen is displayed (it doesn't trigger on the clock/date display!!). In lambda's you can use two local string variables:
**x** (Name of the icon, std::string): value to use in lambda
**icon** (Name of the icon, std::string): value to use in lambda
**y** (displayed text, std::string): value to use in lambda
**text** (displayed text, std::string): value to use in lambda