8000 Escape characters in texts, eg. `label` · Issue #40 · clydebarrow/esphome · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Escape characters in texts, eg. label #40
Closed
@nagyrobi

Description

@nagyrobi

label supports multiline texts: https://docs.lvgl.io/8.3/widgets/core/label.html#newline
\n should start a new line. Currently:

        - label:
            align: center
            id: lbl_id
            y: 30
            recolor: true
            text: 'Write a #ff0000 red# word\nand a #0000ff blue# one'

produces:
kép
looks like \n is interpreted textually, not being escaped.

Other escape sequences like \u, \U should be supported on long term...

Also LVGL supports formatting with printf which is also ESPHome-friendly: https://docs.lvgl.io/8.3/widgets/core/label.html#set-text this could be usable when updating labels from lambdas.

Maybe some configurable options would be needed? Like escape_chars: true and use_printf: true?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0