Open sphaero opened 9 years ago
A capability that wants to send ("emit") a signal (ie: tell subscribed nodes that its value has changed) calls emit_signal.
A node that receives a signal from another node implements on_peer_signaled to act on the received signal. See the definition of on_peer_signaled: https://github.com/z25/pyZOCP/blob/master/src/zocp.py#L499
Note: nodes would not normally override emit_signal. Emit_signal is the method for sending, on_peer_signaled is the callback for receiving.
What's the best approach to handling a received signal on a sensor? It seems emit_signal is called? However no signal will be emitted?
I could check the value of the sensor everytime I receive a message but this is inefficient...