Determine status level (ok, warning, critical) based on value and thresholds
(self, value, warning_threshold, critical_threshold)
| 203 | 'healthy': True # Fail open if we can't check |
| 204 | } |
| 205 | |
| 206 | def get_power_status(self): |
| 207 | """Raspberry Pi power health from the SoC's throttle register. |
| 208 | |
| 209 | Matters because Ragnar's own peripherals cause the failure: USB Wi-Fi |
| 210 | adapters (an Alfa draws ~0.5-1 A) can pull the 5 V rail below spec, and |
| 211 | an under-volting Pi resets the whole board — which presents as "Ragnar |
| 212 | crashed" with nothing in the logs, because the OS never got to write |
| 213 | any. Without this the condition is invisible. |
| 214 | |
| 215 | Returns {'supported', 'undervoltage_now', 'undervoltage_occurred', |