Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat(zigbee): Add check, boolean returns, fix Analog, add optional reset on factoryReset#11153

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@P-R-O-C-H-Y
Copy link
Member

@P-R-O-C-H-YP-R-O-C-H-Y commentedMar 20, 2025
edited
Loading

Description of Change

  • Fix memory leak
  • Updated almost all methods to return a boolean value and print error message with code and string of the error.
  • factoryReset method now have an optional parameterbool restart, by default its set to TRUE, but if false is passed, the Zigbee will just erase the nvram and the reset or reboot will need to be managed in user sketch. Example of how it can be used is the Temperature Humidity Sleepy example.
  • Simplified theAnalogSensor Endpoint -> removed AnalogValue, as its not commonly used in any device
  • FixedAnalogSensor compilation warning message

Tests scenarios

Related links

Closes#11178

@github-actions
Copy link
Contributor

github-actionsbot commentedMar 20, 2025
edited
Loading

Warnings
⚠️

Some issues found for the commit messages in this PR:

  • the commit message"fix(zigbee): Fix memory leak, print esp_zb_zcl_status_t error, remove analogValue from analog EP":
    • summary appears to be too long
  • the commit message"fix(zigbee): Hope its finished now..":
    • summary should not end with a period (full stop)
  • the commit message"fix/zigbee): Add missing return in WindowCovering":
    • summary looks empty
    • type/action looks empty

Please fix these commit messages - here are some basic tips:

  • followConventional Commits style
  • correct format of commit message should be:<type/action>(<scope/component>): <summary>, for examplefix(esp32): Fixed startup timeout issue
  • allowed types are:change,ci,docs,feat,fix,refactor,remove,revert,test
  • sufficiently descriptive message summary should be between 10 to 72 characters and start with upper case letter
  • avoid Jira references in commit messages (unavailable/irrelevant for our customers)

TIP: Install pre-commit hooks and run this check when committing (uses theConventional Precommit Linter).

Messages
📖This PR seems to be quite large (total lines of code: 1266), you might consider splitting it into smaller PRs

👋Hello P-R-O-C-H-Y, we appreciate your contribution to this project!


📘 Please review the project'sContributions Guide for key guidelines on code, documentation, testing, and more.

🖊️ Please also make sure you haveread and signed theContributor License Agreement for this project.

Click to see more instructions ...


This automated output is generated by thePR linter DangerJS, which checks if your Pull Request meets the project's requirements and helps you fix potential issues.

DangerJS is triggered with eachpush event to a Pull Request and modify the contents of this comment.

Please consider the following:
- Danger mainly focuses on the PR structure and formatting and can't understand the meaning behind your code or changes.
- Danger isnot a substitute for human code reviews; it's still important to request a code review from your colleagues.
-Resolve all warnings (⚠️ ) before requesting a review from human reviewers - they will appreciate it.
- Addressing info messages (📖) is strongly recommended; they're less critical but valuable.
- To manuallyretry these Danger checks, please navigate to theActions tab and re-run last Danger workflow.

Review and merge process you can expect ...


We do welcome contributions in the form of bug reports, feature requests and pull requests.

1. An internal issue has been created for the PR, we assign it to the relevant engineer.
2. They review the PR and either approve it or ask you for changes or clarifications.
3. Once the GitHub PR is approved we do the final review, collect approvals from core owners and make sure all the automated tests are passing.
- At this point we may do some adjustments to the proposed change, or extend it by adding tests or documentation.
4. If the change is approved and passes the tests it is merged into the default branch.

Generated by 🚫dangerJS against3bebb79

@P-R-O-C-H-YP-R-O-C-H-Y added the Status: In Progress ⚠️Issue is in progress labelMar 20, 2025
@github-actions
Copy link
Contributor

github-actionsbot commentedMar 20, 2025
edited
Loading

Test Results

 76 files   76 suites   13m 27s ⏱️
 38 tests  38 ✅ 0 💤 0 ❌
241 runs  241 ✅ 0 💤 0 ❌

Results for commit3bebb79.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Contributor

github-actionsbot commentedMar 20, 2025
edited
Loading

Memory usage test (comparing PR against master branch)

The table below shows the summary of memory usage change (decrease - increase) in bytes and percentage for each target.

MemoryFLASH [bytes]FLASH [%]RAM [bytes]RAM [%]
TargetDECINCDECINCDECINCDECINC
ESP32S3💚 -440💚 -0.010.00000.000.00
ESP32S2💚 -520💚 -0.010.00000.000.00
ESP32C3💚 -540💚 -0.010.00000.000.00
ESP32C6💚 -88⚠️ +432💚 -0.02⚠️ +0.08000.000.00
ESP32H2💚 -786⚠️ +448💚 -0.13⚠️ +0.08000.000.00
ESP32💚 -520💚 -0.010.00000.000.00
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
libraries/Zigbee/examples/Zigbee_Color_Dimmer_Switch💚 -440💚 -520💚 -540💚 -540💚 -540💚 -520
libraries/Zigbee/examples/Zigbee_Gateway💚 -40💚 -40💚 -320----💚 -200
libraries/Zigbee/examples/Zigbee_On_Off_Switch💚 -280💚 -160💚 -300💚 -280💚 -300💚 -280
libraries/Zigbee/examples/Zigbee_Range_Extender💚 -20000💚 -420💚 -420💚 -380💚 -200
libraries/Zigbee/examples/Zigbee_Thermostat💚 -240💚 -200💚 -380💚 -380💚 -380💚 -280
libraries/Zigbee/examples/Zigbee_Analog_Input_Output------💚 -880💚 -880--
libraries/Zigbee/examples/Zigbee_CarbonDioxide_Sensor------00💚 -20--
libraries/Zigbee/examples/Zigbee_Color_Dimmable_Light------💚 -280💚 -280--
libraries/Zigbee/examples/Zigbee_Contact_Switch------00💚 -40--
libraries/Zigbee/examples/Zigbee_Dimmable_Light------💚 -300💚 -300--
libraries/Zigbee/examples/Zigbee_Illuminance_Sensor------⚠️ +280⚠️ +280--
libraries/Zigbee/examples/Zigbee_OTA_Client------💚 -240💚 -7860--
libraries/Zigbee/examples/Zigbee_Occupancy_Sensor------💚 -220💚 -220--
libraries/Zigbee/examples/Zigbee_On_Off_Light------💚 -340💚 -300--
libraries/Zigbee/examples/Zigbee_Pressure_Flow_Sensor------⚠️ +460⚠️ +460--
libraries/Zigbee/examples/Zigbee_Scan_Networks------0000--
libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy------⚠️ +4320⚠️ +4480--
libraries/Zigbee/examples/Zigbee_Temperature_Sensor------⚠️ +300⚠️ +320--
libraries/Zigbee/examples/Zigbee_Vibration_Sensor------💚 -260💚 -260--
libraries/Zigbee/examples/Zigbee_Wind_Speed_Sensor------⚠️ +20⚠️ +20--
libraries/Zigbee/examples/Zigbee_Window_Covering------⚠️ +100⚠️ +100--

@me-no-dev
Copy link
Member

Please format errors like this:

esp_err_t err = esp_wifi_set_max_tx_power(power);if (err != ESP_OK) {log_e("Failed to set TX Power: 0x%x: %s", err,esp_err_to_name(err));  }
P-R-O-C-H-Y reacted with thumbs up emoji

@P-R-O-C-H-YP-R-O-C-H-Yforce-pushed thefeat/zigbee-commands-return-check branch from104a381 to80eba94CompareMarch 21, 2025 11:43
@P-R-O-C-H-YP-R-O-C-H-Y added Status: Review neededIssue or PR is awaiting review and removed Status: In Progress ⚠️Issue is in progress labelsMar 24, 2025
@P-R-O-C-H-YP-R-O-C-H-Y marked this pull request as ready for reviewMarch 24, 2025 13:10
@SuGlider
Copy link
Collaborator

SuGlider commentedMar 27, 2025
edited
Loading

@P-R-O-C-H-Y - please review the code in ZigbeeEP.cpp ::void ZigbeeEP::zbReadBasicCluster(const esp_zb_zcl_attribute_t *attribute). It has 2malloc() with no correspondentfree(). This will certainly cause memory leak.

Better think and review the whole zigbee code whenever usingnew ormalloc.

@SuGliderSuGlider self-requested a reviewMarch 27, 2025 02:55
Copy link
Collaborator

@SuGliderSuGlider left a comment

Choose a reason for hiding this comment

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

From a fast code read, I understand that ZigbeeEP.cpp can cause memory leaks.
It may happen in other code files as well.

I recommend reviewing all places wherenew ormalloc is used.

@me-no-devme-no-dev marked this pull request as draftMarch 27, 2025 10:32
@P-R-O-C-H-Y
Copy link
MemberAuthor

Thanks@SuGlider, will take a look.

SuGlider reacted with thumbs up emoji

@P-R-O-C-H-YP-R-O-C-H-Y added Status: In Progress ⚠️Issue is in progress and removed Status: Review neededIssue or PR is awaiting review labelsMar 27, 2025
@P-R-O-C-H-YP-R-O-C-H-Y marked this pull request as ready for reviewMarch 27, 2025 14:13
@P-R-O-C-H-YP-R-O-C-H-Y changed the titlefeat(zigbee): Add checks on set attributes and commandsfeat(zigbee): Add check, boolean returns, fix Analog, add optional reset on factoryResetMar 27, 2025
@P-R-O-C-H-YP-R-O-C-H-Y added Status: Review neededIssue or PR is awaiting review and removed Status: In Progress ⚠️Issue is in progress labelsMar 27, 2025
@P-R-O-C-H-YP-R-O-C-H-Y modified the milestones:3.3.0,3.2.0Mar 27, 2025
Copy link
Member

@lucasssvazlucasssvaz left a comment

Choose a reason for hiding this comment

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

LGTM

@P-R-O-C-H-YP-R-O-C-H-Yforce-pushed thefeat/zigbee-commands-return-check branch from909606a tof5e28e1CompareMarch 27, 2025 16:02
@P-R-O-C-H-Y
Copy link
MemberAuthor

All done now.

lucasssvaz reacted with thumbs up emoji

@P-R-O-C-H-YP-R-O-C-H-Y added Status: Pending MergePull Request is ready to be merged and removed Status: Review neededIssue or PR is awaiting review labelsMar 27, 2025
@me-no-devme-no-dev merged commita3b6fe6 intoespressif:masterMar 27, 2025
56 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@me-no-devme-no-devme-no-dev approved these changes

@lucasssvazlucasssvazlucasssvaz approved these changes

@SuGliderSuGliderAwaiting requested review from SuGlider

Assignees

@P-R-O-C-H-YP-R-O-C-H-Y

Labels

Area: ZigbeeIssues and Feature Request about ZigbeeStatus: Pending MergePull Request is ready to be merged

Projects

Milestone

3.2.0

Development

Successfully merging this pull request may close these issues.

Make Reboot after Factory Reset on an EP optional

4 participants

@P-R-O-C-H-Y@me-no-dev@SuGlider@lucasssvaz

[8]ページ先頭

©2009-2025 Movatter.jp