Check Wi-Fi connectivity (Pager + Pi compatible).
(self)
| 198 | self.shared_data.ragnarstatustext2 = "" |
| 199 | |
| 200 | def is_wifi_connected(self): |
| 201 | """Check Wi-Fi connectivity (Pager + Pi compatible).""" |
| 202 | try: |
| 203 | for iface in ['wlan0cli', 'br-lan', 'wlan0', 'eth0']: |
| 204 | result = subprocess.run(['ip', 'link', 'show', iface], |
| 205 | capture_output=True, text=True, timeout=5) |
| 206 | if 'state UP' in result.stdout: |
| 207 | return True |
| 208 | return False |
| 209 | except Exception as e: |
| 210 | logger.debug(f"WiFi check error: {e}") |
| 211 | return False |
| 212 | |
| 213 | |
| 214 | def handle_exit(sig, frame, display_thread, ragnar_thread, web_thread=None): |
no test coverage detected