FreeOpcUa / opcua-asyncio

OPC UA library for python >= 3.7
GNU Lesser General Public License v3.0
1.11k stars 358 forks source link

Don't reset attribute_value_callback on write #1668

Closed IIIMADDINIII closed 3 months ago

IIIMADDINIII commented 3 months ago

Currently i am using set_attribute_value_callback and set_attribute_value_setter on the Server. I do this to be able to manage the Value in my own Data structure. Currently i have the problem, that when ever the Value is written by write_attribute_value i can not read the value again. This is because attval.value_callback is reset to None even if a value setter is used. This causes the Value and the value callback to be None, which will result in None being returned by read_attribute_value which cant be serialized.

This fixes this Problem by only setting the attval.value_callback to None if no value Setter is defined.