mirror of
https://github.com/tiqi-group/pydase.git
synced 2026-02-14 14:28:40 +01:00
fixes state manager enum handlign
This commit is contained in:
@@ -251,7 +251,9 @@ class StateManager:
|
|||||||
|
|
||||||
if attr_cache_type in ("ColouredEnum", "Enum"):
|
if attr_cache_type in ("ColouredEnum", "Enum"):
|
||||||
enum_attr = get_object_attr_from_path_list(target_obj, [attr_name])
|
enum_attr = get_object_attr_from_path_list(target_obj, [attr_name])
|
||||||
setattr(target_obj, attr_name, enum_attr.__class__[value])
|
# take the value of the existing enum class
|
||||||
|
# TODO: this might break when you set a value from a different enum
|
||||||
|
setattr(target_obj, attr_name, enum_attr.__class__[value.name])
|
||||||
elif attr_cache_type == "list":
|
elif attr_cache_type == "list":
|
||||||
list_obj = get_object_attr_from_path_list(target_obj, [attr_name])
|
list_obj = get_object_attr_from_path_list(target_obj, [attr_name])
|
||||||
list_obj[index] = value
|
list_obj[index] = value
|
||||||
|
|||||||
Reference in New Issue
Block a user