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.32k stars 49 forks source link

REopen settings of "HomeAssistant Media Players" provider shows "m,e" instead of player name in "Player entities" field #2605

Closed ulflulfl closed 2 months ago

ulflulfl commented 2 months ago

What version of Music Assistant has the issue?

2.1.0.b14

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

none (HACS not installed)

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 select one or more HASS player(s) in the "HomeAssistant Media Player" settings "Player entities" field and use the player(s) as expected. However, if I REopen these settings, the previously selected player in the "Player entities" field is replaced with the string: m,e and this cannot be saved.

As the player is working and displayed ok anywhere else, this looks like a bug in the code to populate the "Player entities" field if a player was previously selected.

Remarks:

How to reproduce

Open "Settings > Player providers > HomeAssistant Media Players" In the "Player entities" field, select one of the players -> the players name correctly appears in the field Save <if the player is available on the network, it can be used now> Reopen "Settings > Player providers > HomeAssistant Media Players" The "Player entities" field now shows "m,e" instead of the previously selected player Save -> Error dialog with "players has unexpected type: <class 'NoneType'>"


Settings after selecting the player:

Player entered

Settings after save and reopen showing "m,e":

Player reopened with me

Resulting error if trying to save now:

Player save fails

Music Providers

local disk provider

Player Providers

HomeAssistant Media Players

Full log output

music-assistant(2).log

Sorry, again log with DEBUG level. The error is multiple times in the log, e.g. around line 3189

Additional information

No response

What version of Home Assistant Core are your running

2024.7.1

What type of installation are you running?

Home Assistant Container

On what type of hardware are you running?

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

ulflulfl commented 2 months ago

Just started to look around in the discord channels and found out that marcel mentioned this bug is already fixed in b15:

https://discord.com/channels/753947050995089438/1242741503642570752

ulflulfl commented 2 months ago

Just tried with b15 and the bug no longer appears, thanks!