Get all discovered Bluetooth devices.
(self)
| 803 | now = time.time() |
| 804 | if hasattr(self, '_stats_cache') and self._stats_cache and now - self._stats_cache_time < 5: |
| 805 | return self._stats_cache |
| 806 | with self._lock: |
| 807 | try: |
| 808 | with sqlite3.connect(self.db_path) as conn: |
| 809 | conn.row_factory = sqlite3.Row |
| 810 | # Single query for band + security counts |
| 811 | row = conn.execute(""" |
| 812 | SELECT |
| 813 | COUNT(*) AS total, |
| 814 | SUM(CASE WHEN security IN ('', '--', 'OWE') THEN 1 ELSE 0 END) AS open_nets, |
| 815 | SUM(CASE WHEN security LIKE '%WEP%' THEN 1 ELSE 0 END) AS wep_nets, |
| 816 | SUM(CASE WHEN security LIKE '%WPA%' THEN 1 ELSE 0 END) AS wpa_nets, |
| 817 | SUM(CASE WHEN band = '2.4GHz' THEN 1 ELSE 0 END) AS band_24, |
| 818 | SUM(CASE WHEN band = '5GHz' THEN 1 ELSE 0 END) AS band_5, |
| 819 | SUM(CASE WHEN band = '6GHz' THEN 1 ELSE 0 END) AS band_6, |
no test coverage detected