It would be nice to have in new style PyTango servers a way to say that setting a new value to a property should automatically update the value in the database.
Proposed solution example:
from PyTango.server import Device, DeviceMeta, command, device_property
class MyDevice(Device):
__metaclass__ = DeviceMeta
port = device_property(dtype='uint16', update_db=True)
def init_device(self):
Device.init_device(self)
print("Using port: {0}".format(self.port))
@command(dtype_in='uint16')
def change_port(self, port):
# this will update the device property port in the database !
self.port = port
Will be implemented in next PyTango 8.1.7