Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ The following are **not** considered security vulnerabilities in this project:
- Issues only reproducible on Python versions older than those listed as
supported in `pyproject.toml`.
- Issues in the WLED firmware itself; please report those directly to
the [WLED project](https://github.com/Aircoookie/WLED/security/policy).
the [WLED project](https://github.com/wled/WLED/security/policy).
- Denial-of-service or data-exposure conditions resulting from malformed or
hostile responses from a WLED device the client is explicitly pointed at.
This library assumes the configured endpoint is trusted.
Expand Down
4 changes: 2 additions & 2 deletions src/wled/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -271,12 +271,12 @@ async def command_releases() -> None:
table.add_row(
"Stable",
latest.stable,
f"https://github.com/Aircoookie/WLED/releases/v{latest.stable}",
f"https://github.com/wled/WLED/releases/v{latest.stable}",
)
table.add_row(
"Beta",
latest.beta,
f"https://github.com/Aircoookie/WLED/releases/v{latest.beta}",
f"https://github.com/wled/WLED/releases/v{latest.beta}",
)

console.print(table)
Expand Down
2 changes: 1 addition & 1 deletion src/wled/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -751,7 +751,7 @@ def __pre_deserialize__(cls, d: dict[Any, Any]) -> dict[Any, Any]:
# will return `null`.
# Refs:
# - https://github.com/home-assistant/core/issues/123506
# - https://github.com/Aircoookie/WLED/issues/1974
# - https://github.com/wled/WLED/issues/1974
d["palettes"] = {}

if _presets := d.get("presets"):
Expand Down
7 changes: 3 additions & 4 deletions src/wled/wled.py
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ async def upgrade(self, *, version: str | AwesomeVersion) -> None:
ethernet = "_Ethernet"

# Determine if this is a 2M ESP8266 board.
# See issue `https://github.com/Aircoookie/WLED/issues/3257`
# See issue `https://github.com/wled/WLED/issues/3257`
gzip = ""
if self._device.info.architecture == "esp02":
gzip = ".gz"
Expand All @@ -637,8 +637,7 @@ async def upgrade(self, *, version: str | AwesomeVersion) -> None:
architecture = self._device.info.architecture.upper()
update_file = f"WLED_{version}_{architecture}{ethernet}.bin{gzip}"
download_url = (
"https://github.com/Aircoookie/WLED/releases/download"
f"/v{version}/{update_file}"
f"https://github.com/wled/WLED/releases/download/v{version}/{update_file}"
)

try:
Expand Down Expand Up @@ -739,7 +738,7 @@ async def releases(self) -> Releases:
try:
async with asyncio.timeout(self.request_timeout):
response = await self.session.get(
"https://api.github.com/repos/Aircoookie/WLED/releases",
"https://api.github.com/repos/wled/WLED/releases",
headers={"Accept": "application/json"},
)
except TimeoutError as exception:
Expand Down
20 changes: 10 additions & 10 deletions tests/__snapshots__/test_cli.ambr
Original file line number Diff line number Diff line change
Expand Up @@ -232,16 +232,16 @@
# ---
# name: test_releases_command
'''
Found WLED Releases
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
┃ Release channel ┃ Latest version ┃ Release notes
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
│ Stable │ 0.14.0 │ https://github.com/Aircoookie/WLED/releases/v0.14.0 │
├─────────────────┼────────────────┼───────────────────────────────────────────────────────
│ Beta │ 0.15.0b1 │ https://github.com/Aircoookie/WLED/releases/v0.15.0b1 │
└─────────────────┴────────────────┴───────────────────────────────────────────────────────


Found WLED Releases
┏━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Release channel ┃ Latest version ┃ Release notes ┃
┡━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ Stable │ 0.14.0 │ https://github.com/wled/WLED/releases/v0.14.0 │
├─────────────────┼────────────────┼─────────────────────────────────────────────────┤
│ Beta │ 0.15.0b1 │ https://github.com/wled/WLED/releases/v0.15.0b1 │
└─────────────────┴────────────────┴─────────────────────────────────────────────────┘

'''
# ---
Expand Down
44 changes: 22 additions & 22 deletions tests/test_wled.py
Original file line number Diff line number Diff line change
Expand Up @@ -1127,7 +1127,7 @@ async def test_upgrade_calls_update_when_no_device() -> None:
mock_json_and_presets(mocked)
# Mock the download and upload
mocked.get(
"https://github.com/Aircoookie/WLED/releases/download/v0.15.0/WLED_0.15.0_ESP32.bin",
"https://github.com/wled/WLED/releases/download/v0.15.0/WLED_0.15.0_ESP32.bin",
status=200,
body=b"fake firmware",
)
Expand Down Expand Up @@ -1159,7 +1159,7 @@ async def test_upgrade_success() -> None:
async with aiohttp.ClientSession() as session:
wled = await _get_wled_with_device_for_upgrade(mocked, session)
mocked.get(
"https://github.com/Aircoookie/WLED/releases/download/v0.15.0/WLED_0.15.0_ESP32.bin",
"https://github.com/wled/WLED/releases/download/v0.15.0/WLED_0.15.0_ESP32.bin",
status=200,
body=b"fake firmware",
)
Expand All @@ -1180,7 +1180,7 @@ async def test_upgrade_ethernet_board() -> None:
mocked, session, wifi_bssid=""
)
mocked.get(
"https://github.com/Aircoookie/WLED/releases/download/v0.15.0/WLED_0.15.0_ESP32_Ethernet.bin",
"https://github.com/wled/WLED/releases/download/v0.15.0/WLED_0.15.0_ESP32_Ethernet.bin",
status=200,
body=b"fake firmware",
)
Expand Down Expand Up @@ -1217,7 +1217,7 @@ async def test_upgrade_esp02_gzip() -> None:
wled = WLED("example.com", session=session)
await wled.update()
mocked.get(
"https://github.com/Aircoookie/WLED/releases/download/v0.15.0/WLED_0.15.0_ESP02.bin.gz",
"https://github.com/wled/WLED/releases/download/v0.15.0/WLED_0.15.0_ESP02.bin.gz",
status=200,
body=b"fake firmware",
)
Expand All @@ -1236,7 +1236,7 @@ async def test_upgrade_404() -> None:
async with aiohttp.ClientSession() as session:
wled = await _get_wled_with_device_for_upgrade(mocked, session)
mocked.get(
"https://github.com/Aircoookie/WLED/releases/download/v0.99.0/WLED_0.99.0_ESP32.bin",
"https://github.com/wled/WLED/releases/download/v0.99.0/WLED_0.99.0_ESP32.bin",
status=404,
)
with pytest.raises(WLEDUpgradeError, match="does not exist"):
Expand All @@ -1249,7 +1249,7 @@ async def test_upgrade_other_http_error() -> None:
async with aiohttp.ClientSession() as session:
wled = await _get_wled_with_device_for_upgrade(mocked, session)
mocked.get(
"https://github.com/Aircoookie/WLED/releases/download/v0.15.0/WLED_0.15.0_ESP32.bin",
"https://github.com/wled/WLED/releases/download/v0.15.0/WLED_0.15.0_ESP32.bin",
status=500,
)
with pytest.raises(WLEDUpgradeError, match="Could not download"):
Expand All @@ -1262,7 +1262,7 @@ async def test_upgrade_connection_error() -> None:
async with aiohttp.ClientSession() as session:
wled = await _get_wled_with_device_for_upgrade(mocked, session)
mocked.get(
"https://github.com/Aircoookie/WLED/releases/download/v0.15.0/WLED_0.15.0_ESP32.bin",
"https://github.com/wled/WLED/releases/download/v0.15.0/WLED_0.15.0_ESP32.bin",
exception=aiohttp.ClientError("fail"),
)
with pytest.raises(WLEDConnectionError):
Expand All @@ -1276,7 +1276,7 @@ async def test_upgrade_timeout() -> None:
wled = await _get_wled_with_device_for_upgrade(mocked, session)
wled.request_timeout = 0.001
mocked.get(
"https://github.com/Aircoookie/WLED/releases/download/v0.15.0/WLED_0.15.0_ESP32.bin",
"https://github.com/wled/WLED/releases/download/v0.15.0/WLED_0.15.0_ESP32.bin",
exception=TimeoutError(),
)
with pytest.raises(WLEDConnectionTimeoutError):
Expand All @@ -1302,7 +1302,7 @@ async def test_releases_success() -> None:
]
with aioresponses() as mocked:
mocked.get(
"https://api.github.com/repos/Aircoookie/WLED/releases",
"https://api.github.com/repos/wled/WLED/releases",
status=200,
body=json.dumps(releases_data),
content_type="application/json",
Expand Down Expand Up @@ -1331,7 +1331,7 @@ async def test_releases_with_b_in_tag_name() -> None:
]
with aioresponses() as mocked:
mocked.get(
"https://api.github.com/repos/Aircoookie/WLED/releases",
"https://api.github.com/repos/wled/WLED/releases",
status=200,
body=json.dumps(releases_data),
content_type="application/json",
Expand All @@ -1355,7 +1355,7 @@ async def test_releases_no_beta() -> None:
]
with aioresponses() as mocked:
mocked.get(
"https://api.github.com/repos/Aircoookie/WLED/releases",
"https://api.github.com/repos/wled/WLED/releases",
status=200,
body=json.dumps(releases_data),
content_type="application/json",
Expand All @@ -1374,7 +1374,7 @@ async def test_releases_context_manager() -> None:
]
with aioresponses() as mocked:
mocked.get(
"https://api.github.com/repos/Aircoookie/WLED/releases",
"https://api.github.com/repos/wled/WLED/releases",
status=200,
body=json.dumps(releases_data),
content_type="application/json",
Expand All @@ -1391,7 +1391,7 @@ async def test_releases_internal_session() -> None:
]
with aioresponses() as mocked:
mocked.get(
"https://api.github.com/repos/Aircoookie/WLED/releases",
"https://api.github.com/repos/wled/WLED/releases",
status=200,
body=json.dumps(releases_data),
content_type="application/json",
Expand All @@ -1416,7 +1416,7 @@ async def test_releases_http_error() -> None:
"""Test releases raises WLEDError on HTTP error."""
with aioresponses() as mocked:
mocked.get(
"https://api.github.com/repos/Aircoookie/WLED/releases",
"https://api.github.com/repos/wled/WLED/releases",
status=500,
body='{"message": "error"}',
content_type="application/json",
Expand All @@ -1431,7 +1431,7 @@ async def test_releases_http_error_text() -> None:
"""Test releases raises WLEDError on HTTP error with text."""
with aioresponses() as mocked:
mocked.get(
"https://api.github.com/repos/Aircoookie/WLED/releases",
"https://api.github.com/repos/wled/WLED/releases",
status=403,
body="Forbidden",
content_type="text/plain",
Expand All @@ -1446,7 +1446,7 @@ async def test_releases_non_json_response() -> None:
"""Test releases raises WLEDError on non-JSON response."""
with aioresponses() as mocked:
mocked.get(
"https://api.github.com/repos/Aircoookie/WLED/releases",
"https://api.github.com/repos/wled/WLED/releases",
status=200,
body="Not JSON",
content_type="text/plain",
Expand All @@ -1461,15 +1461,15 @@ async def test_releases_timeout() -> None:
"""Test releases raises on timeout."""
with aioresponses() as mocked:
mocked.get(
"https://api.github.com/repos/Aircoookie/WLED/releases",
"https://api.github.com/repos/wled/WLED/releases",
exception=TimeoutError(),
)
mocked.get(
"https://api.github.com/repos/Aircoookie/WLED/releases",
"https://api.github.com/repos/wled/WLED/releases",
exception=TimeoutError(),
)
mocked.get(
"https://api.github.com/repos/Aircoookie/WLED/releases",
"https://api.github.com/repos/wled/WLED/releases",
exception=TimeoutError(),
)
async with aiohttp.ClientSession() as session:
Expand All @@ -1483,15 +1483,15 @@ async def test_releases_connection_error() -> None:
"""Test releases raises on connection error."""
with aioresponses() as mocked:
mocked.get(
"https://api.github.com/repos/Aircoookie/WLED/releases",
"https://api.github.com/repos/wled/WLED/releases",
exception=aiohttp.ClientError("fail"),
)
mocked.get(
"https://api.github.com/repos/Aircoookie/WLED/releases",
"https://api.github.com/repos/wled/WLED/releases",
exception=aiohttp.ClientError("fail"),
)
mocked.get(
"https://api.github.com/repos/Aircoookie/WLED/releases",
"https://api.github.com/repos/wled/WLED/releases",
exception=aiohttp.ClientError("fail"),
)
async with aiohttp.ClientSession() as session:
Expand Down
Loading