From da246f2e427c39a77ced061731fbd18bd3630287 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Thu, 23 Jan 2025 22:06:51 +0100 Subject: [PATCH] Chore: don't try to save (fake) power state Players should provide their own power state or we add a user configurable powercommand handler --- music_assistant/controllers/players.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/music_assistant/controllers/players.py b/music_assistant/controllers/players.py index b2498c90..7f02e129 100644 --- a/music_assistant/controllers/players.py +++ b/music_assistant/controllers/players.py @@ -358,9 +358,6 @@ class PlayerController(CoreController): # allow the stop command to process and prevent race conditions await asyncio.sleep(0.2) - # store last power state in cache - await self.mass.cache.set(player_id, powered, base_key="player_power") - # always optimistically set the power state to update the UI # as fast as possible and prevent race conditions player.powered = powered @@ -847,12 +844,6 @@ class PlayerController(CoreController): if not player.enabled: return - # restore powered state from cache - if player.state == PlayerState.PLAYING: - player.powered = True - elif (cache := await self.mass.cache.get(player_id, base_key="player_power")) is not None: - player.powered = cache - self.logger.info( "Player registered: %s/%s", player_id, -- 2.34.1