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:
1 parent
1f0a4b2021
commit
bc457baae7
3 files changed
+140
-2
No files matched your search
@@ -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")
|
||||
|
||||
Reference in new issue
Block a user