Skip to content

LVGL spinbox examples use step and are unclear regarding the value #5495

@numo68

Description

@numo68

Feedback

The documentation of the LVGL spinbox could use some improvements

  1. The examples still use step, that was converted to selected_digitrecently
  2. The documentation of the increment and decrement actions reference step
  3. The update action seems to be just a binding for the low-level LVGL spinbox and its value needs to be scaled; if decimal_places is 1, I need to update to 200, not 20.0 to see 20.0. Not sure this is intended though, will create an issue in the main repo for that.
  4. the configuration value also does not seem to be scaled in the code - there is just lv.spinbox_set_value(w.obj, await lv_float.process(value)) - but I am currently not able to get value here working at all, so will also investigate and create an issue in the main repo.

Regarding the points 3 and 4, generally, a user unfamiliar with the details of the low-level LVGL library is unaware of the fact that the spinbox only processes integers there and any scaling between the float values in the ESPHome application realm and that integer according to the decimal_places has to happen somewhere.

I don't know what the developers' take on this is and whether the users should be completely shielded from that until they need to use low-level lv_spinbox_... at which point they probably know what they are doing, or whether they need to take the intricacies of the LVGL into account. If the latter, the fact should probably be mentioned in the documentation. I think that they should be shielded, meaning that for the 3 and 4 the code needs to be changed, and for 1 and 2 the documentation should, but that's just my opinion.

Thanks

URL

https://esphome.io/components/lvgl/widgets/#spinbox

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions