PyS2OPC disconnect and datachanged callbacks non homogeneous
Description
Files: s2opc.py
and connection.py
on_disconnect
and on_datachanged
can/should be redefined as a subclass to be used with pys2opc.connect(...)
.
on_datachanged
is called by an internal callback _on_datachanged
whereas on_disconnect
is called directly and does update the connected
property.
It is safe for the user to redefine on_datachanged
without calling the super.
However, redefining on_disconnect
without calling the super removes the connected
property update.
Proposed fix
- add an internal callback
_on_disconnect
which update theconnected
property, and calls theon_disconnect
callback.