Yes, NetworkTables has a class called IRemoteConnectionListener that you can use with the AddConnectionListener/RemoveConnectionListener. I use the following code.
Code:
class RemoteListener(IRemoteConnectionListener):
'''Calls a function when a table value is updated'''
def __init__(self, connect_fn, disconnect_fn):
'''fn must be a callable that takes (value)'''
IRemoteConnectionListener.__init__(self)
self.connect_fn = connect_fn
self.disconnect_fn = disconnect_fn
def attach(self, table):
self.table = table
table.AddConnectionListener(self, True)
def detach(self):
if hasattr(self, 'table'):
self.table.RemoveConnectionListener(self)
def Connected(self, remote):
self.connect_fn(remote)
def Disconnected(self, remote):
self.disconnect_fn(remote)