@@ -41,8 +41,8 @@ def _get_config_entry(
4141def get_mass_queue_entry (hass , entity_id ):
4242 """Gets the actions for the selected entity."""
4343 mass_entry = get_mass_entry (hass , entity_id )
44- mass = mass_entry .runtime_data . mass . connection . ws_server_url
45- return find_mass_queue_entry (hass , mass )
44+ unique_id = mass_entry .unique_id
45+ return find_mass_queue_entry_from_unique_id (hass , unique_id )
4646
4747
4848def get_entity_actions_controller (hass , entity_id ):
@@ -69,14 +69,13 @@ def _get_mass_entity_config_entry_id(hass, entity_id):
6969 return registry .async_get (entity_id ).config_entry_id
7070
7171
72- def find_mass_queue_entry (hass , mass_url ):
72+ def find_mass_queue_entry_from_unique_id (hass : HomeAssistant , unique_id : str ):
7373 """Finds the mass_queue entry for the given MA URL."""
7474 entries = _get_mass_queue_entries (hass )
7575 for entry in entries :
76- entry_url = entry .runtime_data .mass .connection .ws_server_url
77- if entry_url == mass_url :
76+ if entry .unique_id == unique_id :
7877 return entry
79- msg = f"Cannot find entry for Music Assistant at { mass_url } "
78+ msg = f"Cannot find entry for Music Assistant with unique ID { unique_id } "
8079 raise ServiceValidationError (msg )
8180
8281
0 commit comments