From bdec4251d9da5c76f23bb62e9be400034dbbd598 Mon Sep 17 00:00:00 2001 From: christian Date: Tue, 13 Oct 2026 10:17:58 -0400 Subject: [PATCH] Spotify: grey when closed or paused outside services Co-Authored-By: Claude Opus 5.5 --- status_panel.py | 2 +- tests/test_status_panel.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/status_panel.py b/status_panel.py index 2194378..b1c9922 100644 --- a/status_panel.py +++ b/status_panel.py @@ -431,7 +431,7 @@ def check_spotify(chk, snap, ctx): return [("spotify", Result(OK))] # not read yet state = "CLOSED" if not sp_.get("running") else (sp_.get("state") or "?").upper() if not in_windows(chk.get("windows", []), ctx["now"]): - return [("spotify", Result(OK, info=state))] + return [("spotify", Result(OK if state == "PLAYING" else OFF, info=state))] # grey when not playing if not sp_.get("running"): return [("spotify", Result(ERR, "SPOTIFY CLOSED", named=True))] if state != "PLAYING": diff --git a/tests/test_status_panel.py b/tests/test_status_panel.py index 048a3f7..fa5128b 100644 --- a/tests/test_status_panel.py +++ b/tests/test_status_panel.py @@ -115,7 +115,7 @@ class TestChecks(unittest.TestCase): self.assertEqual(msg().level, sp.OK) # not read yet s.spotify = {"running": False} self.assertEqual(msg().msg, "SPOTIFY CLOSED") - self.assertEqual(msg({"now": WEDNESDAY}).level, sp.OK) # only during services + self.assertEqual(msg({"now": WEDNESDAY}).level, sp.OFF) # grey, not an alarm, outside services s.spotify = {"running": True, "state": "paused", "track": "spotify:track:a"} self.assertEqual(msg().msg, "NOT PLAYING") s.spotify["state"] = "playing"