bvhme
(Bo)
April 12, 2023, 10:41am
1
Is there a way to get the IP address of a media_player?
Context:
I’ve written a script that uses the rest_command
functionality in order to get over a bug in the Bluesound plugin. This way I can still write scripts that use the functionality of my players correctly.
However, in order to get to the player I need an IP adress. I now get these from selecting the entity from my router’s integration. However I would much rather couple this to the media_player entity to remove the extra complexity.
More on the script and Bluesound plugin:
opened 10:32AM - 07 Apr 23 UTC
integration: bluesound
### Feedback
What I want to do: unjoin a primary from a group
Expected: anot… her player becomes the primary and the selected player leaves the group
I often when I go to another room tranfer my music along by, in the Bluesound app, adding another player to my group and then removing the original, it seamlessly transitions my music from one room to the other.
I want to assign a button on my wall to do this.
I see the command that is sent by the app to the original primary when I do this is:
`http://[primary-ip]:11000/RemoveSlave?slave=[primary-ip]&port=11000&force=0`
If I look in the code of the integration ([line 888](https://github.com/home-assistant/core/blob/dev/homeassistant/components/bluesound/media_player.py#LL888C1-L894C52)) I see:
```python
async def async_unjoin(self):
"""Unjoin the player from a group."""
if self._master is None:
return
_LOGGER.debug("Trying to unjoin player: %s", self.id)
await self._master.async_remove_slave(self)
```
Perhaps this return statement is interfering with the unjoining.
Alternatively, if I tell my secondary device to kick out the primary nothing happens, only if I tell the primary to kick itself out. Perhaps this is what goes wrong. I see that the unjoin functionality doesn't have the 'coordinator' functionality.
### URL
https://www.home-assistant.io/integrations/bluesound/
### Version
2023.4.1
### Additional information
_No response_