feat(media_player): foreground tier in the state ladder with app-source now-playing (last-known → last_channel → audio hint), sensor reads the store's foreground priority chain (P3-3a,c)

This commit is contained in:
James Mackay committed 2026-10-08 10:45:58 +01:00
1 parent 1f0a4b2021
commit bc457baae7
3 files changed
+140 -2

No files matched your search

+5 -1
View File
@@ -105,9 +105,13 @@ class NvidiaShieldCurrentAppSensor(NvidiaShieldSensorBase):
if state:
return state.attributes.get("app_name") or state.attributes.get("app_id")
# androidtv entity unavailable — StateStore fallback (ADB recents)
# androidtv entity unavailable — StateStore priority chain (P3-3c):
# protocol current_app push → ADB mResumedActivity → ADB recents
manager = self._manager()
if manager is not None:
foreground = manager.foreground_app
if foreground:
return foreground
running = manager.running_apps
if running:
return running[0].get("package")