Returning a timestamp from a lambda?

This is my yaml (based on this solution: Timestamp) which in 2019, they reported as working. I know it is a subtly different context (but its a start):

text_sensor:
- platform: custom
#/homeassistant/esphome/uart_read_line_sensor.h
  lambda: |-
    char str[17];
    time_t currTime = id(homeassistant_time).now().timestamp;
    strftime(str, sizeof(str), "%H:%M:%f", localtime(&currTime));
    return {str};
  text_sensors:
    -  id: "odb_timestamp"
       name: "OBD Timestamp"

I think that the lamda compilation is complaining about the return datatype?

Compiling .pioenvs/tinypico/src/main.cpp.o
<unicode string>: In lambda function:
<unicode string>:51:18: error: could not convert '{str}' from '<brace-enclosed initializer list>' to 'std::vector<esphome::text_sensor::TextSensor*>'
*** [.pioenvs/tinypico/src/main.cpp.o] Error 1
========================== [FAILED] Took 6.64 seconds ==========================

Any suggests to get me moving again, will be most welcome.

Regards, M.

It may be the ‘%f’ that’s causing the issue. I don’t see a '%f" listed as a format function in the Time function strftime table.

I don’t think so. The compilation error is the same with or without the %f.

You could test this exact config, which would help isolate whether it is related to your more customised implementation or an issue with the base logic.