Fix DataStore subscript access for ADS-B tracking

Add __getitem__, __setitem__, and __delitem__ methods to DataStore
class to support dict-style subscript notation (store[key]).

Fixes TypeError: 'DataStore' object is not subscriptable

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Smittix
2026-01-06 20:35:51 +00:00
parent 5c6bd5d65a
commit 0d5310eb4b
2 changed files with 17 additions and 0 deletions
Binary file not shown.
+17
View File
@@ -99,6 +99,23 @@ class DataStore:
with self._lock:
return key in self.data
def __getitem__(self, key: str) -> Any:
"""Get an entry using subscript notation."""
with self._lock:
return self.data[key]
def __setitem__(self, key: str, value: Any) -> None:
"""Set an entry using subscript notation."""
with self._lock:
self.data[key] = value
self.timestamps[key] = time.time()
def __delitem__(self, key: str) -> None:
"""Delete an entry using subscript notation."""
with self._lock:
del self.data[key]
del self.timestamps[key]
def cleanup(self) -> int:
"""
Remove entries older than max_age.