strange-v / ha_deck

Config-driven Home Assistant dashboard (built on top of ESPHome)
MIT License
150 stars 42 forks source link

Lambda on value-card text #15

Closed set-st closed 4 months ago

set-st commented 5 months ago

Can you make ability to use lambdas on value-card text attribute? Like

    on_time:
      - cron: '* * * * * *'
        then:
          lambda: |-
            char buff[10] = "-";
            auto time = id(homeassistant_time).now();
            if (time.is_valid())
              sprintf(buff, "%02d:%02d:%02d", time.hour, time.minute, time.second);
            id(local_time).set_text(std::string(buff));
strange-v commented 4 months ago

I have no plans to enhance v1 in any way. Only bug fixes might be applied. But yes, I'm considering accepting lambdas for text properties in v2.