mirror of
https://github.com/tiqi-group/pydase.git
synced 2025-04-19 16:10:01 +02:00
fix: adds observable to an observable object accessed via a property
When an observable is stored returned by a property, this adds the parent object as an observer to the observable returned by the property.
This commit is contained in:
parent
c36cebf17c
commit
f2c0a94904
@ -55,6 +55,10 @@ class Observable(ObservableObject):
|
||||
value = super().__getattribute__(name)
|
||||
|
||||
if is_property_attribute(self, name):
|
||||
# fixes https://github.com/tiqi-group/pydase/issues/187 and
|
||||
# https://github.com/tiqi-group/pydase/issues/192
|
||||
if isinstance(value, ObservableObject):
|
||||
value.add_observer(self, name)
|
||||
self._notify_changed(name, value)
|
||||
|
||||
return value
|
||||
|
Loading…
x
Reference in New Issue
Block a user