mirror of
				https://github.com/esphome/esphome.git
				synced 2025-10-30 22:53:59 +00:00 
			
		
		
		
	[lvgl] Allow strings to be interpreted as integers (Bugfix) (#7652)
This commit is contained in:
		| @@ -274,10 +274,8 @@ def size_validator(value): | |||||||
|         return ["SIZE_CONTENT", "number of pixels", "percentage"] |         return ["SIZE_CONTENT", "number of pixels", "percentage"] | ||||||
|     if isinstance(value, str) and value.lower().endswith("px"): |     if isinstance(value, str) and value.lower().endswith("px"): | ||||||
|         value = cv.int_(value[:-2]) |         value = cv.int_(value[:-2]) | ||||||
|     if isinstance(value, str) and not value.endswith("%"): |     if isinstance(value, str) and value.upper() == "SIZE_CONTENT": | ||||||
|         if value.upper() == "SIZE_CONTENT": |         return "LV_SIZE_CONTENT" | ||||||
|             return "LV_SIZE_CONTENT" |  | ||||||
|         raise cv.Invalid("must be 'size_content', a percentage or an integer (pixels)") |  | ||||||
|     return pixels_or_percent_validator(value) |     return pixels_or_percent_validator(value) | ||||||
|  |  | ||||||
|  |  | ||||||
|   | |||||||
| @@ -422,7 +422,7 @@ lvgl: | |||||||
|             id: lv_image |             id: lv_image | ||||||
|             src: cat_image |             src: cat_image | ||||||
|             align: top_left |             align: top_left | ||||||
|             y: 50 |             y: "50" | ||||||
|         - tileview: |         - tileview: | ||||||
|             id: tileview_id |             id: tileview_id | ||||||
|             scrollbar_mode: active |             scrollbar_mode: active | ||||||
| @@ -461,7 +461,7 @@ lvgl: | |||||||
|               bg_opa: transp |               bg_opa: transp | ||||||
|             knob: |             knob: | ||||||
|               radius: 1 |               radius: 1 | ||||||
|               width: 4 |               width: "4" | ||||||
|               height: 10% |               height: 10% | ||||||
|               bg_color: 0x000000 |               bg_color: 0x000000 | ||||||
|             width: 100% |             width: 100% | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user