MCPcopy Create free account
hub / github.com/JoshuaPostel/texaform / send

Method send

python/dog.py:40–54  ·  view source on GitHub ↗
(self, msg: str)

Source from the content-addressed store, hash-verified

38
39
40 def send(self, msg: str) -> str:
41 resp = super().send(msg)
42 if resp == "ERRR low battery":
43 seconds = 200
44 print(f"sleeping for {seconds} to let dog charge")
45 time.sleep(seconds)
46 (pos, facing, _, _) = self.stat()
47 self.charge_if_needed()
48 print("returning to position")
49 self.goto(pos)
50 self.face(facing)
51 print("resuming")
52 return self.send(msg)
53
54 return resp
55
56 def pick(self, char: str, target: Optional[Point] = None):
57 self.send(f"PICK {char}")

Callers 15

charge_if_neededMethod · 0.95
pickMethod · 0.95
statMethod · 0.95
scanMethod · 0.95
turn_rightMethod · 0.95
turn_leftMethod · 0.95
moveMethod · 0.95
drop_offMethod · 0.95
drop_withinMethod · 0.95
build_atMethod · 0.95
power_onMethod · 0.45
power_offMethod · 0.45

Calls 4

statMethod · 0.95
charge_if_neededMethod · 0.95
gotoMethod · 0.95
faceMethod · 0.95

Tested by

no test coverage detected