(self, msg: str)
| 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}") |
no test coverage detected