-
-
Notifications
You must be signed in to change notification settings - Fork 31
Device release aware update #1646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
ad80d3d
64f892f
d0352a6
8f794f9
ebb015f
913ebc8
ccedaf9
436f1ee
4c8e50b
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,11 +2,16 @@ | |
"""Asynchronous Python client for WLED.""" | ||
|
||
import asyncio | ||
import sys | ||
|
||
from wled import WLED, WLEDReleases | ||
|
||
|
||
async def main() -> None: | ||
if len(sys.argv) < 2: | ||
print("Usage: python upgrade.py <ip_address>") | ||
sys.exit(1) | ||
|
||
Comment on lines
+11
to
+14
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. ?? If we wanted to do proper arg handling in the example, we'd do it differently. Let's remove it. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Forgive my inexperience with python, if there is a better way please suggest rather than rejecting an improvement |
||
"""Show example on upgrade your WLED device.""" | ||
async with WLEDReleases() as releases: | ||
latest = await releases.releases() | ||
|
@@ -17,7 +22,7 @@ async def main() -> None: | |
print("No stable version found") | ||
return | ||
|
||
async with WLED("10.10.11.54") as led: | ||
async with WLED(sys.argv[1]) as led: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. let's remove this is just an example There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's easier to run the example to test the behaviour against many different devices in you don't have to edit the file by hand reach each find |
||
device = await led.update() | ||
print(f"Current version: {device.info.version}") | ||
|
||
|
Uh oh!
There was an error while loading. Please reload this page.