Closed Iucimhub closed 1 year ago
Would you rather like to have the getter function called when the service starts? Should this behaviour be the same for all properties or only "specified" ones?
I think for most cases (i.e. a lab environment, where every device which has their own memory) it makes sense to call the getter instead of the setter. I can imagine that their are 'dumb' devices without own memory or which die when the service dies, but that seems to be the clear minority of use cases. I can't give you a good real world example of such a dumb device.
There might be several options to handle this:
I think the following approach makes sense:
pydase will not set properties unless specified through a decorator like @load_from_json
.
Is your feature request related to a problem? Please describe. It seems like pydase calls property setter functions when the app is restarted and previous values are loaded from the json file containing old values. This is problematic if for instance the variable controls the temperature of a fridge: The user may have used other means to change the temperature and would not like to revert the temperature to old values.
Describe the solution you'd like Use only getter functions at start up and not setter functions.