Browse Source

Battery voltages and weights can now be retrieved on the network port

master
klonfish 7 years ago committed by klonfish
parent
commit
46c8208e26
  1. 14
      wii-pair/daemon.py

14
wii-pair/daemon.py

@ -190,6 +190,20 @@ try: @@ -190,6 +190,20 @@ try:
r = b''
for w in wiis:
if m[0] == ord('w'):
# Return weight
v = 0
if w.weight is not None:
v = round(w.weight)
r += struct.pack('b', v)
elif m[0] == ord('b'):
# Return battery
v = 0
if w.board.battery is not None:
v = round(w.board.battery*100)
r += struct.pack('b', v)
else:
# Return balance
if w.pos_x is None:
v = -128
else:

Loading…
Cancel
Save