(ip)
| 4628 | 'state': state, |
| 4629 | 'message': message, |
| 4630 | 'phase': phase, |
| 4631 | 'timestamp': datetime.utcnow().isoformat() + 'Z' |
| 4632 | }) |
| 4633 | |
| 4634 | status_path = getattr(shared_data, 'pwnagotchi_status_file', os.path.join(shared_data.datadir, 'pwnagotchi_status.json')) |
| 4635 | os.makedirs(os.path.dirname(status_path), exist_ok=True) |
| 4636 | |
| 4637 | try: |
| 4638 | with open(status_path, 'w', encoding='utf-8') as handle: |
| 4639 | json.dump(payload, handle, indent=2) |
| 4640 | except Exception as exc: |
| 4641 | logger.error(f"Failed to update Pwnagotchi status file: {exc}") |
no test coverage detected