Open marek-vrana opened 1 year ago
when I declare custom service in esphome like this:
- service: send_command variables: cmd: string then: - lambda: "id(nspanel).send_custom_command(cmd.c_str());"
I'm able to pass new line in description {{'\r\n'}}
{{'\r\n'}}
service: esphome.nspanel_send_command data: cmd: >- entityUpdateDetail~id~~65535~~3840~~61440~{{'\r\n'}}Description~52457~0~3~~52457
Now I'd like to define a new service, so that a new line can be included in the passed variable:
- service: notify_fullscreen variables: description: string then: - lambda: |- id(nspanel).send_custom_command("pageType~popupNotify"); std::string cmd = "entityUpdateDetail~id~~65535~~3840~~61440~" + description + "~52457~0~3~~52457"; id(nspanel).send_custom_command(cmd.c_str());
My idea is to call it like this:
service: esphome.nspanel_notify_fullscreen data: description: "{{'\r\n'}}Description"
But that either ignores a new line or shows the escaped characters.
Can anyone help me out finding a proper syntax for it? Workarounds, e.g. replace with another string, are also appreciated. It's driving me nuts, can't figure it out.
when I declare custom service in esphome like this:
I'm able to pass new line in description
{{'\r\n'}}
Now I'd like to define a new service, so that a new line can be included in the passed variable:
My idea is to call it like this:
But that either ignores a new line or shows the escaped characters.
Can anyone help me out finding a proper syntax for it? Workarounds, e.g. replace with another string, are also appreciated. It's driving me nuts, can't figure it out.