Get preference status.
(self)
| 524 | info("Preferences cleared") |
| 525 | |
| 526 | def status(self) -> Dict[str, Any]: |
| 527 | """Get preference status.""" |
| 528 | return { |
| 529 | "preferences": self.get_all(), |
| 530 | "confidence": { |
| 531 | cat: self.get_confidence(cat) |
| 532 | for cat in self.CATEGORIES |
| 533 | }, |
| 534 | "total_observations": sum( |
| 535 | self._cache.get(cat, {}).get("observations", 0) |
| 536 | for cat in self.CATEGORIES |
| 537 | ), |
| 538 | } |
| 539 | |
| 540 | |
| 541 | # Global singleton |