Skip to content

Commit cceb573

Browse files
committed
Use device-reported repo for firmware releases and upgrades
1 parent ea7e0e2 commit cceb573

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

src/wled/models.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
from mashumaro.types import SerializableType, SerializationStrategy
1515

1616
from .const import (
17+
DEFAULT_REPO,
1718
MIN_REQUIRED_VERSION,
1819
LightCapability,
1920
LiveDataOverride,
@@ -489,6 +490,11 @@ class Info(BaseModel): # pylint: disable=too-many-instance-attributes
489490
product: str = "DIY Light"
490491
"""The product name. Always FOSS for standard installations."""
491492

493+
repo: str = field(default=DEFAULT_REPO, metadata=field_options(alias="repo"))
494+
"""GitHub repository in 'org/repo' format reported by the device firmware.
495+
Used in preference to the default repo when fetching releases or upgrading.
496+
"""
497+
492498
release: str | None = None
493499
"""The release name of the firmware build.
494500

src/wled/wled.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,10 @@ async def upgrade( # noqa: PLR0912
654654
msg = "Device already running the requested version"
655655
raise WLEDUpgradeError(msg)
656656

657+
# Prefer the repo reported by the device itself; older firmware that does
658+
# not include the field will have fallen back to DEFAULT_REPO already.
659+
repo = self._device.info.repo
660+
657661
# Determine if this is an Ethernet board
658662
ethernet = ""
659663
if (

0 commit comments

Comments
 (0)