-
Hello Berry experts, i am using berry more and more, and i was wondering if i can use f-strings to format time. I know, i could first materialize "tasmota.strftime("%H:%M:%S", 1745191441)" to a variable and then use that again in an f-string, but was wondering if there is a way in doing that without that tweak. Thanks in advance
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Don't expect "any expression" to get past the lexer within f-strings. While it can handle more than just simple variables, the colon will be problematic as it is also part of the syntax for the f-string. One additional workaround could be to have the |
Beta Was this translation helpful? Give feedback.
Don't expect "any expression" to get past the lexer within f-strings. While it can handle more than just simple variables, the colon will be problematic as it is also part of the syntax for the f-string.
One additional workaround could be to have the
strftime
pattern in a variable or function call.