(self, hud: HUD, output: str)
| 43 | |
| 44 | |
| 45 | def smelt(self, hud: HUD, output: str): |
| 46 | output_char = name_char_map[output] |
| 47 | (temp, _, buf_out) = self.stat() |
| 48 | previous_count = buf_out[output_char] |
| 49 | while True: |
| 50 | if hud.accumulator_charge() == 0: |
| 51 | seconds = 60 |
| 52 | print(f"ACC CHARGE 0, powering off for {seconds} sec") |
| 53 | self.power_off() |
| 54 | sleep(seconds) |
| 55 | (temp, _, buf_out) = self.stat() |
| 56 | if temp < (min_smelt + 50): |
| 57 | self.power_on() |
| 58 | if temp > (max_smelt - 50): |
| 59 | self.power_off() |
| 60 | if buf_out[output_char] > previous_count: |
| 61 | self.power_off() |
| 62 | break |
| 63 | # an unluckily timed dog pick could cause this to fail |
| 64 | previous_count = buf_out[output_char] |
| 65 | |
| 66 | |
| 67 |
no test coverage detected