Do not create a HA mediaplayer for the builtin Music Assistant player (#142192)

Do not create a HA mediaplayer for the builtin Music player
This commit is contained in:
Marcel van der Veldt 2025-04-03 22:26:56 +02:00 committed by Franck Nijhof
parent 2a4996055a
commit c43a4682b9
No known key found for this signature in database
GPG Key ID: D62583BA8AB11CA3

View File

@ -151,6 +151,8 @@ async def async_setup_entry(
assert event.object_id is not None
if event.object_id in added_ids:
return
if not player.expose_to_ha:
return
added_ids.add(event.object_id)
async_add_entities([MusicAssistantPlayer(mass, event.object_id)])
@ -159,6 +161,8 @@ async def async_setup_entry(
mass_players = []
# add all current players
for player in mass.players:
if not player.expose_to_ha:
continue
added_ids.add(player.player_id)
mass_players.append(MusicAssistantPlayer(mass, player.player_id))