Skip to content

Commit 59a2ea0

Browse files
authored
Case-insensitive comparison of architecture values (#1378)
1 parent a186f28 commit 59a2ea0

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/wled/models.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -407,7 +407,7 @@ def used_percentage(self) -> int:
407407
class Info(BaseModel): # pylint: disable=too-many-instance-attributes
408408
"""Object holding information from WLED."""
409409

410-
architecture: str = field(default="Unknown", metadata=field_options(alias="arch"))
410+
architecture: str = field(default="unknown", metadata=field_options(alias="arch"))
411411
"""Name of the platform."""
412412

413413
arduino_core_version: str = field(
@@ -488,6 +488,9 @@ def __post_deserialize__(cls, obj: Info) -> Info:
488488
if obj.websocket == -1:
489489
obj.websocket = None
490490

491+
# We want the architecture in lower case
492+
obj.architecture = obj.architecture.lower()
493+
491494
# We can tweak the architecture name based on the filesystem size.
492495
if obj.filesystem is not None and obj.architecture == "esp8266":
493496
if obj.filesystem.total <= 256:

0 commit comments

Comments
 (0)