Merge pull request #15586 from s-hadinger/openhasp_fix_val

OpenHSAP fix `val` attribute for `roller` and `slider`
This commit is contained in:
s-hadinger 2022-05-10 21:43:49 +02:00 committed by GitHub
commit a7439cf853
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 2626 additions and 2441 deletions

File diff suppressed because it is too large Load Diff

Binary file not shown.

View File

@ -112,7 +112,7 @@ class lvh_obj
# #
"min": nil, "min": nil,
"max": nil, "max": nil,
"val": "value", "val": nil,
"rotation": "rotation", "rotation": "rotation",
# img # img
"src": "src", "src": "src",
@ -611,6 +611,12 @@ class lvh_obj
def get_pad_all() def get_pad_all()
end end
def set_val(t)
self._lv_obj.set_value(t)
end
def get_val()
return self._lv_obj.get_value()
end
#==================================================================== #====================================================================
# `radius2` # `radius2`
#==================================================================== #====================================================================
@ -987,6 +993,25 @@ class lvh_qrcode : lvh_obj
def get_qr_text() end def get_qr_text() end
end end
class lvh_slider : lvh_obj
static _lv_class = lv.slider
def set_val(t)
self._lv_obj.set_value(t, 0) # add second parameter - no animation
end
end
class lvh_roller : lvh_obj
static _lv_class = lv.roller
def set_val(t)
self._lv_obj.set_selected(t, 0) # add second parameter - no animation
end
def get_val()
return self._lv_obj.get_selected()
end
end
################################################################################# #################################################################################
# #
# All other subclasses than just map the LVGL object # All other subclasses than just map the LVGL object
@ -999,8 +1024,6 @@ class lvh_btnmatrix : lvh_obj static _lv_class = lv.btnmatrix end
class lvh_checkbox : lvh_obj static _lv_class = lv.checkbox end class lvh_checkbox : lvh_obj static _lv_class = lv.checkbox end
class lvh_dropdown : lvh_obj static _lv_class = lv.dropdown end class lvh_dropdown : lvh_obj static _lv_class = lv.dropdown end
class lvh_line : lvh_obj static _lv_class = lv.line end class lvh_line : lvh_obj static _lv_class = lv.line end
class lvh_roller : lvh_obj static _lv_class = lv.roller end
class lvh_slider : lvh_obj static _lv_class = lv.slider end
class lvh_textarea : lvh_obj static _lv_class = lv.textarea end class lvh_textarea : lvh_obj static _lv_class = lv.textarea end
# special case for scr (which is actually lv_obj) # special case for scr (which is actually lv_obj)
class lvh_scr : lvh_obj static _lv_class = nil end # no class for screen class lvh_scr : lvh_obj static _lv_class = nil end # no class for screen