In [1]:
from pyluos import Robot

In [2]:
canard = Robot('wifi_canard.local')

In [3]:
canard.modules


Out[3]:
[<Potard alias="potard_banane" id=2 state=49>,
 <Potard alias="potard_pomme" id=3 state=58>,
 <Motor alias="motor_hallah" id=4 state=0>]

In [5]:
pigeon = Robot('wifi_pigeon.local')

In [6]:
pigeon.modules


Out[6]:
[<Potard alias="potard_kiwi" id=2 state=3>,
 <Motor alias="motor_zeus" id=3 state=0>,
 <LED alias="led_disco" id=4 state=(0, 0, 0)>]

In [7]:
def disco(evt):
    pigeon.led_disco.color = (0, 0, evt.new_value * 2.55)
    
canard.potard_banane.add_callback('moved', disco)

In [8]:
def move(evt):
    canard.motor_hallah.position = evt.new_value * 1.8
    
pigeon.potard_kiwi.add_callback('moved', move)

In [9]:
canard.potard_pomme.add_callback('moved', move)

In [ ]: