Skip to content

Commit

Permalink
Fix playback on Home Assistant Voice PE
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelveldt committed Jan 2, 2025
1 parent a8910a1 commit 08e859f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion music_assistant/providers/hass_players/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -253,7 +253,10 @@ async def cmd_pause(self, player_id: str) -> None:

async def play_media(self, player_id: str, media: PlayerMedia) -> None:
"""Handle PLAY MEDIA on given player."""
if self.mass.config.get_raw_player_config_value(player_id, CONF_ENFORCE_MP3, True):
is_voice_pe = self.mass.players.get(player_id).device_info.model in VOICE_PE_MODELS
if self.mass.config.get_raw_player_config_value(
player_id, CONF_ENFORCE_MP3, not is_voice_pe
):
media.uri = media.uri.replace(".flac", ".mp3")
player = self.mass.players.get(player_id, True)
assert player
Expand Down

0 comments on commit 08e859f

Please sign in to comment.