Skip to content

Conversation

@frenck
Copy link
Owner

@frenck frenck commented May 18, 2024

fixes #1140

Adds support for upgrading ESP32-C3, ESP32-S2, and ESP32-S3 board types in the WLED project.

  • Updates the upgrade method in src/wled/wled.py to include ESP32-C3, ESP32-S2, and ESP32-S3 alongside the previously supported ESP01, ESP02, ESP32, and ESP8266 devices.
  • Modifies the architecture check within the upgrade method to recognize and allow upgrades for the new board types.
  • Adjusts the error message in the WLEDUpgradeError exception to reflect the inclusion of the new supported board types.

For more details, open the Copilot Workspace session.

Summary by CodeRabbit

  • New Features
    • Added support for upgrading additional ESP32 variants (esp32-c3, esp32-s2, esp32-s3) in the WLED module.
  • Improvements
    • Enhanced error messages for unsupported ESP32 variants during upgrades.

@frenck frenck added the new-feature New features or options. label May 18, 2024
@codecov
Copy link

codecov bot commented May 18, 2024

Codecov Report

Attention: Patch coverage is 0% with 1 lines in your changes are missing coverage. Please review.

Project coverage is 58.56%. Comparing base (15622f2) to head (479cfce).
Report is 1 commits behind head on main.

Current head 479cfce differs from pull request most recent head a2bf53f

Please upload reports for the commit a2bf53f to get more accurate results.

Files Patch % Lines
src/wled/wled.py 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1332   +/-   ##
=======================================
  Coverage   58.56%   58.56%           
=======================================
  Files           4        4           
  Lines         613      613           
  Branches      139      139           
=======================================
  Hits          359      359           
  Misses        233      233           
  Partials       21       21           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@frenck
Copy link
Owner Author

frenck commented May 18, 2024

@coderabbitai review

@coderabbitai
Copy link

coderabbitai bot commented May 18, 2024

Actions Performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@coderabbitai
Copy link

coderabbitai bot commented May 18, 2024

Walkthrough

The upgrade method of the WLED class in wled.py has been enhanced to support additional ESP32 variants (esp32-c3, esp32-s2, esp32-s3). This update ensures a broader range of ESP32 devices can now benefit from the upgrade functionality with tailored error messages for each variant.

Changes

File Change Summary
src/wled/wled.py Added support for esp32-c3, esp32-s2, and esp32-s3 in the upgrade method with updated error messages.

In the code, new variants bloom,
For upgrades, there's more room.
ESP32's family grows,
With error messages that show,
A brighter path for all to zoom! 🚀


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

Share
Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 15622f2 and 479cfce.
Files selected for processing (1)
  • src/wled/wled.py (1 hunks)
Additional Context Used
Ruff (1)
src/wled/wled.py (1)

677-677: Line too long (119 > 88)

GitHub Check Runs (2)
codecov/patch failure (1)

src/wled/wled.py: [warning] 677-677: src/wled/wled.py#L677
Added line #L677 was not covered by tests

Ruff failure (2)

src/wled/wled.py: [failure] 677-677: Ruff (E501)
src/wled/wled.py:677:89: E501 Line too long (119 > 88)

Additional comments not posted (1)
src/wled/wled.py (1)

673-675: LGTM! The addition of new ESP32 board types is correctly implemented.

@sonarqubecloud
Copy link

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

Review Details

Configuration used: CodeRabbit UI
Review profile: CHILL

Commits Files that changed from the base of the PR and between 479cfce and a2bf53f.
Files selected for processing (1)
  • src/wled/wled.py (1 hunks)
Files skipped from review as they are similar to previous changes (1)
  • src/wled/wled.py

@frenck frenck merged commit 1eede67 into main May 20, 2024
@frenck frenck deleted the support-esp32-boards branch May 20, 2024 09:42
"Upgrade is only supported on ESP01, ESP02, ESP32, ESP8266, "
"ESP32-C3, ESP32-S2, and ESP32-S3 devices"
)
raise WLEDUpgradeError(msg)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You also need logic to choose the right firmware

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No? Please ellaborate, as the board type is used to pick it up.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The ESP32-S3 build is called WLED_0.14.4_ESP32-S3_8MB.bin for example

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Aah yup you are right...

sigh, I'm not understanding why that is different upstream (inconsistent AF).
Anyways, will adjust thanks! 👍

../Frenck

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wait, in v0.15 is becomes worse:

CleanShot 2024-05-20 at 12 40 23@2x

Ok, this needs more work in figuring out where is coming from. Need to order a few boards as it seems.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also worth noting that the logic doesn't support the ESP32_audioreactive build or the experimental _160 builds.

Copy link
Contributor

@jamesmyatt jamesmyatt May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since build 2405030 and wled/WLED@674481f, Aircoookie WLED 0.15 now has a "release" name field in the info API following wled/WLED#3497

Copy link
Contributor

@jamesmyatt jamesmyatt May 20, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

However the challenge is really "Given the version number and architecture/release name/etc of the currently installed firmware, then guess the name of the best build of the latest firmware"

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also worth noting that the logic doesn't support the ESP32_audioreactive build

That has never been supported by this library.

@github-actions github-actions bot locked and limited conversation to collaborators May 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

new-feature New features or options.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add support for upgrading new ESP32 board types

3 participants