Hola,
Para información de la comunidad, hay un error cuando se crea un gráfico con colores diferentes a los predeterminados.
He creado un gráfico con 2 sensores de temperatura, he modificado los colores asociados a estos dos sensores y al momento de guardar, se bloquea (la página se queda en la animación de carga y se ven errores en la consola del navegador).
@pierre-gilles he creado el issue:
ouvert 05:22PM - 20 Dec 24 UTC
fermé 02:07PM - 23 Jan 25 UTC
**Describe the bug**
When creating a new chart with two sources, selecting anot… her color than the default generates an error "UNPROCESSABLE_ENTITY".
**To Reproduce**
Steps to reproduce the behavior:
1. Create a new dashboard (or edit one)
2. Add a new chart
3. Add two sources (like two temperature devices)
4. Select colors different than the default selected
5. Click on "save"
6. See error, the page is stuck on "loading"
**Expected behavior**
Choosing any color should work as expected
**Screen Recording**
https://github.com/user-attachments/assets/15f95606-7ce7-4c5a-b3ca-abe0dabccd79
**Your Gladys installation (please complete the following information):**
- Docker
- Official last image v4.50.2
**Web browser error**
```
Uncaught (in promise) TypeError: s is undefined
value apexcharts.common.js:6
value apexcharts.common.js:6
value apexcharts.common.js:6
value apexcharts.common.js:6
value apexcharts.common.js:14
value apexcharts.common.js:6
value apexcharts.common.js:14
value apexcharts.common.js:14
c ApexChartComponent.jsx:218
componentDidMount ApexChartComponent.jsx:222
Preact 7
a Chart.jsx:259
componentDidMount Chart.jsx:290
Preact 7
a EditChart.jsx:67
S Preact
```
```
{
"response": {
"status": 422,
"data": {
"status": 422,
"code": "UNPROCESSABLE_ENTITY",
"properties": [
{
"message": "\"[2][0].colors[0]\" must be a string",
"attribute": "boxes",
"value": [
[
{
"type": "temperature-in-room",
"room": "salle-de-bain"
},
{
"type": "humidity-in-room",
"room": "salle-de-bain"
}
],
[
{
"type": "temperature-in-room",
"room": "salle-de-douche"
},
{
"type": "humidity-in-room",
"room": "salle-de-douche"
}
],
[
{
"type": "chart",
"device_feature_names": [
"Salle de bain",
"Douche"
],
"device_features": [
"zigbee2mqtt-sdd-temp-sonoff-temperature-sensor-decimal-temperature",
"zigbee2mqtt-sdb-temp-sonoff-temperature-sensor-decimal-temperature"
],
"title": "Salles d'eau",
"chart_type": "area",
"colors": [
null,
"#00cec9"
],
"display_axes": true,
"display_variation": true,
"interval": "last-day"
}
]
],
"type": "Validation error"
}
]
}
}
}
```
Gracias por la respuesta muy completa ¡Efectivamente es un error!
Lo miro en cuanto termine todas mis tareas de vuelta al cole