mirror of
https://github.com/home-assistant/core.git
synced 2025-07-14 08:47:10 +00:00
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:
parent
2a4996055a
commit
c43a4682b9
@ -151,6 +151,8 @@ async def async_setup_entry(
|
|||||||
assert event.object_id is not None
|
assert event.object_id is not None
|
||||||
if event.object_id in added_ids:
|
if event.object_id in added_ids:
|
||||||
return
|
return
|
||||||
|
if not player.expose_to_ha:
|
||||||
|
return
|
||||||
added_ids.add(event.object_id)
|
added_ids.add(event.object_id)
|
||||||
async_add_entities([MusicAssistantPlayer(mass, event.object_id)])
|
async_add_entities([MusicAssistantPlayer(mass, event.object_id)])
|
||||||
|
|
||||||
@ -159,6 +161,8 @@ async def async_setup_entry(
|
|||||||
mass_players = []
|
mass_players = []
|
||||||
# add all current players
|
# add all current players
|
||||||
for player in mass.players:
|
for player in mass.players:
|
||||||
|
if not player.expose_to_ha:
|
||||||
|
continue
|
||||||
added_ids.add(player.player_id)
|
added_ids.add(player.player_id)
|
||||||
mass_players.append(MusicAssistantPlayer(mass, player.player_id))
|
mass_players.append(MusicAssistantPlayer(mass, player.player_id))
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user