mirror of
https://github.com/esphome/esphome.git
synced 2025-09-05 21:02:20 +01:00
[lvgl] Various validation fixes (#10141)
This commit is contained in:
@@ -287,10 +287,14 @@ def angle(value):
|
||||
:param value: The input in the range 0..360
|
||||
:return: An angle in 1/10 degree units.
|
||||
"""
|
||||
return int(cv.float_range(0.0, 360.0)(cv.angle(value)) * 10)
|
||||
return cv.float_range(0.0, 360.0)(cv.angle(value))
|
||||
|
||||
|
||||
lv_angle = LValidator(angle, uint32)
|
||||
# Validator for angles in LVGL expressed in 1/10 degree units.
|
||||
lv_angle = LValidator(angle, uint32, retmapper=lambda x: int(x * 10))
|
||||
|
||||
# Validator for angles in LVGL expressed in whole degrees
|
||||
lv_angle_degrees = LValidator(angle, uint32, retmapper=int)
|
||||
|
||||
|
||||
@schema_extractor("one_of")
|
||||
|
Reference in New Issue
Block a user