music-assistant / hass-music-assistant

Turn your Home Assistant instance into a jukebox, hassle free streaming of your favorite media to Home Assistant media players.
Apache License 2.0
1.37k stars 52 forks source link

pyscript compatibility #2980

Open dirtyharryiv opened 1 month ago

dirtyharryiv commented 1 month ago

What version of Music Assistant has the issue?

2.2.6

What version of the Home Assistant Integration have you got installed?

2024.9.1

Have you tried everything in the Troubleshooting FAQ and reviewed the Open and Closed Issues and Discussions to resolve this yourself?

The problem

I can't call the mass.search service via pyscript. When i try to call the service with minimal params i get the folowing error: TypeError: Function.service_call() got multiple values for argument 'name'

If somebody could change line 23 in services.py from ATTR_SEARCH_NAME = "name" to ATTR_SEARCH_NAME = "searchname" i'm pretty sure it would work again.

How to reproduce

In pyscript do: service.call("mass", "search", name="queen")

Music Providers

youtube music

Player Providers

chromecast

Full log output

No response

Additional information

No response

What version of Home Assistant Core are your running

2024.9.3

What type of installation are you running?

Home Assistant OS

On what type of hardware are you running?

Generic x86-64 (e.g. Intel NUC)

OzGav commented 3 weeks ago

You can mess around with the custom component directly. So you can change that line 23 and reboot HA and see how you go.

dirtyharryiv commented 3 weeks ago

Thanks for your answer! I did what you suggested before opening the issue and it works. But would be nice if the next update wouldn't break it.

OzGav commented 3 weeks ago

You can open a PR and see what the devs think