List of LVGL's functions supported

Hi here !
I try to manage a shopping list with HA on a Waveshare ESP32 S3 7" touch display. I managed to get the list from HA in a list of stuff separated by a “,”. Now, I want to dynamically create checkboxes depending on this list. Here is a part of my code. containertaches is a lvgl obj which acts as a parent for my checkboxes

text_sensor:
# Get open ToDos
  - platform: homeassistant
    id: todo_taches
    entity_id: sensor.todo_taches_items
    internal: true
    on_value:
      lambda: |-
        // Erase datas
        lv_obj_clean(containertaches);

        //  Get string from HA
        std::string items = id(todo_taches).state;

        //  create an array with datas
        std::vector<std::string> list;
        size_t start = 0, end;
        while ((end = items.find(',', start)) != std::string::npos) {
          list.push_back(items.substr(start, end - start));
          start = end + 1;
        }
        list.push_back(items.substr(start));
          
        //  Generate checkboxes
        for (auto & item : list) {
          lv_obj_t * cb = lv_obj_create(containertaches);
          lv_obj_set_text(cb, item.c_str());
        }

I have this error : error: ‘lv_checkbox_create’ was not declared in this scope

lv_obj_clean above works so compilator can get access to lgvl’s functions but not these one which exists in LVGL’s docs. When I look in Esphome’s docs, it sends me to the LVGL’s doc. Is there a list somewhere of functions actually supported by Esphome ? If you have any idea on how to fix this, I would be very happy also.
Thank you for your help.

I am assuming the code you posted was not the code that generates the error.

ESPHome dynamically includes libraries based on your yaml. If you want to use LVGL checkbox functions, you must manually create at least one checkbox in your yaml. You can have it hidden, it just needs to exist.

Also welcome to the HA forums. :slight_smile:

1 Like

If you’re using LVGL calls directly you will want to read the docs at lvgl.io. There are defines that need to be set to conditionally compile parts of LVGL, you can add those as required in the esphome: build_flags section.

2 Likes

Or what Clyde said… He wrote the stuff! :smiley:

2 Likes

Thank you @zoogara . It compiles and kind of work (but this not linked to my initial issue). Obviously, I didn’t put the code as I use many files and it is already quite large.