1
0
mirror of https://github.com/esphome/esphome.git synced 2025-03-15 15:18:16 +00:00

Make logic more sensible

This commit is contained in:
bdm310 2025-02-21 20:39:57 -08:00
parent 768e7a2fe1
commit 2525c7543f

View File

@ -67,11 +67,11 @@ class ArcType(NumberType):
lv.arc_set_mode(w.obj, literal(config[CONF_MODE])) lv.arc_set_mode(w.obj, literal(config[CONF_MODE]))
lv.arc_set_change_rate(w.obj, config[CONF_CHANGE_RATE]) lv.arc_set_change_rate(w.obj, config[CONF_CHANGE_RATE])
adjustable = config.get(CONF_ADJUSTABLE) if CONF_ADJUSTABLE in config:
if adjustable is False: if not config[CONF_ADJUSTABLE]:
lv_obj.remove_style(w.obj, nullptr, literal("LV_PART_KNOB")) lv_obj.remove_style(w.obj, nullptr, literal("LV_PART_KNOB"))
w.clear_flag("LV_OBJ_FLAG_CLICKABLE") w.clear_flag("LV_OBJ_FLAG_CLICKABLE")
elif adjustable is True and CONF_GROUP not in config: elif CONF_GROUP not in config:
# For some reason arc does not get automatically added to the default group # For some reason arc does not get automatically added to the default group
lv.group_add_obj(lv_expr.group_get_default(), w.obj) lv.group_add_obj(lv_expr.group_get_default(), w.obj)