We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 04d7dba commit 3ff3c2cCopy full SHA for 3ff3c2c
src/wled/models.py
@@ -612,6 +612,15 @@ class Preset(BaseModel):
612
)
613
"""Segments are individual parts of the LED strip."""
614
615
+ @classmethod
616
+ def __pre_deserialize__(cls, d: dict[Any, Any]) -> dict[Any, Any]:
617
+ """Pre deserialize hook for Preset object."""
618
+ # If the segment is a single value, we will convert it to a list.
619
+ if "seg" in d and not isinstance(d["seg"], list):
620
+ d["seg"] = [d["seg"]]
621
+
622
+ return d
623
624
@classmethod
625
def __post_deserialize__(cls, obj: Preset) -> Preset:
626
"""Post deserialize hook for Preset object."""
0 commit comments