Log current system status
(self)
| 221 | 'throttling_occurred': False, 'raw': None, |
| 222 | 'status': 'unknown', 'message': None} |
| 223 | try: |
| 224 | r = subprocess.run(['vcgencmd', 'get_throttled'], |
| 225 | capture_output=True, text=True, timeout=3) |
| 226 | if r.returncode != 0 or '=' not in (r.stdout or ''): |
| 227 | return info |
| 228 | value = int(r.stdout.strip().split('=', 1)[1], 16) |
| 229 | except (OSError, ValueError, subprocess.SubprocessError): |
| 230 | return info # not a Pi, or vcgencmd unavailable |
| 231 | |
| 232 | info.update({ |
| 233 | 'supported': True, |
| 234 | 'raw': hex(value), |
| 235 | # Live bits (condition present right now) |
no test coverage detected