InvalidFieldValue: Field "supported_commands"

Abierto Apto para principiantes
#278 2 comentarios 5 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
2/5
Tiempo estimado
1-3 horas
Aptitud para principiantes
74/100
Tipo de issue
Error
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
python

Línea de trabajo

Comienza comprobando la versión declarada de la dependencia aiosendspin y, a continuación, inspecciona aiosendspin/client/client.py en _handle_json_message, donde se analiza el mensaje del servidor. Confirma la compatibilidad con los comandos seek y seek_relative añadidos en aiosendspin 6.1.0 y verifica que el mensaje server/state notificado ya no produzca errores InvalidFieldValue.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

Just installed this as a daemon to give it a go and saw this in the logs, it does seem to work still but thought I should flag it.

After having a bit of a dig in the code, looks like this is happening because the aiosendspin dependency is out of date, we're on 6.0.5 and the seek and seek_relative types being sent by Music Assistant 2.10.1 were added in 6.1.0.

Sep 03 21:34:19 pi3 sendspin[687461]: ERROR:aiosendspin.client.client:Failed to parse server message: {"payload":{"controller":{"supported_commands":["unshuffle","repeat_all","seek_relative","repeat_off","volume","next","previous","mute","repeat_one","pause","stop","switch","play","shuffle"],"volume":86,"muted":false,"repeat":"off","shuffle":false}},"type":"server/state"}
Sep 03 21:34:19 pi3 sendspin[687461]: Traceback (most recent call last):
Sep 03 21:34:19 pi3 sendspin[687461]:   File "<string>", line 9, in __mashumaro_from_dict_json__
Sep 03 21:34:19 pi3 sendspin[687461]:   File "/home/sendspin/.local/share/uv/python/cpython-3.12.14-linux-aarch64-gnu/lib/python3.12/enum.py", line 751, in __call__
Sep 03 21:34:19 pi3 sendspin[687461]:     return cls.__new__(cls, value)
Sep 03 21:34:19 pi3 sendspin[687461]:            ^^^^^^^^^^^^^^^^^^^^^^^
Sep 03 21:34:19 pi3 sendspin[687461]:   File "/home/sendspin/.local/share/uv/python/cpython-3.12.14-linux-aarch64-gnu/lib/python3.12/enum.py", line 1170, in __new__
Sep 03 21:34:19 pi3 sendspin[687461]:     raise ve_exc
Sep 03 21:34:19 pi3 sendspin[687461]: ValueError: 'seek_relative' is not a valid MediaCommand
Sep 03 21:34:19 pi3 sendspin[687461]: During handling of the above exception, another exception occurred:
Sep 03 21:34:19 pi3 sendspin[687461]: Traceback (most recent call last):
Sep 03 21:34:19 pi3 sendspin[687461]:   File "<string>", line 16, in __mashumaro_from_dict_json__
Sep 03 21:34:19 pi3 sendspin[687461]:   File "<string>", line 11, in __mashumaro_from_dict_json__
Sep 03 21:34:19 pi3 sendspin[687461]: mashumaro.exceptions.InvalidFieldValue: Field "supported_commands" of type list[MediaCommand] in ControllerStatePayload has invalid value ['unshuffle', 'repeat_all', 'seek_relative', 'repeat_off', 'volume', 'next', 'previous', 'mute', 'repeat_one', 'pause', 'stop', 'switch', 'play', 'shuffle']
Sep 03 21:34:19 pi3 sendspin[687461]: During handling of the above exception, another exception occurred:
Sep 03 21:34:19 pi3 sendspin[687461]: Traceback (most recent call last):
Sep 03 21:34:19 pi3 sendspin[687461]:   File "<string>", line 9, in __mashumaro_from_dict_json__
Sep 03 21:34:19 pi3 sendspin[687461]:   File "<string>", line 18, in __mashumaro_from_dict_json__
Sep 03 21:34:19 pi3 sendspin[687461]: mashumaro.exceptions.InvalidFieldValue: Field "controller" of type Optional[ControllerStatePayload] in ServerStatePayload has invalid value {'supported_commands': ['unshuffle', 'repeat_all', 'seek_relative', 'repeat_off', 'volume', 'next', 'previous', 'mute', 'repeat_one', 'pause', 'stop', 'switch', 'play', 'shuffle'], 'volume': 86, 'muted': False, 'repeat': 'off', 'shuffle': False}
Sep 03 21:34:19 pi3 sendspin[687461]: During handling of the above exception, another exception occurred:
Sep 03 21:34:19 pi3 sendspin[687461]: Traceback (most recent call last):
Sep 03 21:34:19 pi3 sendspin[687461]:   File "/home/sendspin/.local/share/uv/tools/sendspin/lib/python3.12/site-packages/aiosendspin/client/client.py", line 823, in _handle_json_message
Sep 03 21:34:19 pi3 sendspin[687461]:     message = ServerMessage.from_json(data)
Sep 03 21:34:19 pi3 sendspin[687461]:               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sep 03 21:34:19 pi3 sendspin[687461]:   File "<string>", line 4, in __mashumaro_from_json__
Sep 03 21:34:19 pi3 sendspin[687461]:   File "<string>", line 8, in __unpack_ServerMessage__dfdf45fabe2d4dfaaa6a72d5101d132d
Sep 03 21:34:19 pi3 sendspin[687461]:   File "<string>", line 11, in __mashumaro_from_dict_json__
Sep 03 21:34:19 pi3 sendspin[687461]: mashumaro.exceptions.InvalidFieldValue: Field "payload" of type ServerStatePayload in ServerStateMessage has invalid value {'controller': {'supported_commands': ['unshuffle', 'repeat_all', 'seek_relative', 'repeat_off', 'volume', 'next', 'previous', 'mute', 'repeat_one', 'pause', 'stop', 'switch', 'play', 'shuffle'], 'volume': 86, 'muted': False, 'repeat': 'off', 'shuffle': False}}
Lenguaje dominante
Python
Estrellas
190
Forks
36
Merge medio
11 d 19 h
PR fusionados (30 d)
2

Guía de contribución

No hay ninguna guía de contribución indexada para este repositorio

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de Sendspin/sendspin-python-cli

Todos los issues de Sendspin/sendspin-python-cli

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.