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 endpoint identification in read handlers + command structures fix#11425

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

Merged
me-no-dev merged 4 commits intomasterfromfeat/zigbee-endpoint-identification
Jun 4, 2025

Conversation

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

@P-R-O-C-H-YP-R-O-C-H-Y commentedJun 3, 2025
edited
Loading

Description of Change

This pull request introduces significant updates to the Zigbee thermostat and Zigbee device handling codebase, focusing on enhancing functionality, improving clarity, and ensuring safer initialization of structures. Key changes include adding support for receiving temperature data with source information, updating device configuration handling, and initializing Zigbee command structures to prevent undefined behavior.

Tests scenarios

Tested using Thermostat + Temperature sensor examples.

Related links

Closes#11168

@P-R-O-C-H-YP-R-O-C-H-Y self-assigned thisJun 3, 2025
@P-R-O-C-H-YP-R-O-C-H-Y added Status: Review neededIssue or PR is awaiting review Area: ZigbeeIssues and Feature Request about Zigbee labelsJun 3, 2025
@github-actionsGitHub Actions
Copy link
Contributor

github-actionsbot commentedJun 3, 2025
edited
Loading

Messages
📖🎉 Good Job! All checks are passing!

👋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.
- 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 against4eee08f

@github-actionsGitHub Actions
Copy link
Contributor

github-actionsbot commentedJun 3, 2025
edited
Loading

Test Results

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

Results for commit4eee08f.

♻️ This comment has been updated with latest results.

Copy link
Contributor

@CopilotCopilotAI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR enhances Zigbee endpoint functionality by adding source-aware temperature callbacks and expanding command methods to target groups, specific endpoints, and IEEE addresses, while also zero-initializing command structs to prevent undefined behavior.

  • AddedonTempRecieveWithSource callback and updatedzbAttributeRead signature to include source endpoint and address.
  • Introduced overloads forgetTemperature,getSensorSettings, andsetTemperatureReporting to support group, endpoint, and IEEE address targets.
  • Zero-initialized local Zigbee command structures across multiple endpoint implementations and updated example to demonstrate the new APIs.

Reviewed Changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated 1 comment.

Show a summary per file
FileDescription
libraries/Zigbee/src/ep/ZigbeeThermostat.hAdded source-aware callback, new overloads for read/report methods.
libraries/Zigbee/src/ep/ZigbeeThermostat.cppImplemented overloads, logging, zero-initialized structs, extended read handler.
libraries/Zigbee/src/ep/ZigbeeSwitch.cppZero-initializedesp_zb_zcl_on_off_cmd_t instances.
libraries/Zigbee/src/ep/ZigbeeColorDimmerSwitch.cppZero-initialized various ZCL command structs.
libraries/Zigbee/src/ZigbeeHandlers.cppForwarded newsrc_endpoint andsrc_address parameters.
libraries/Zigbee/src/ZigbeeEP.hUpdatedzbAttributeRead virtual signature.
libraries/Zigbee/src/ZigbeeEP.cppZero-initialized multiple read/report command structs.
libraries/Zigbee/examples/Zigbee_Thermostat/Zigbee_Thermostat.inoUpdated endpoint macro, example logic for source callbacks and bound devices.
Comments suppressed due to low confidence (4)

libraries/Zigbee/src/ep/ZigbeeThermostat.h:37

  • [nitpick] The method nameonTempRecieve is misspelled. Consider renaming toonTempReceive (and similarly_on_temp_recieve to_on_temp_receive) for correct spelling.
void onTempRecieve(void (*callback)(float)) {

libraries/Zigbee/src/ep/ZigbeeThermostat.cpp:119

  • Using a static local variableread_config inzbAttributeRead can cause race conditions when multiple endpoints or concurrent reads are processed. Consider making this state an instance member so it's scoped per object.
static uint8_t read_config = 0;

libraries/Zigbee/src/ep/ZigbeeThermostat.cpp:182

  • The macroZB_ARRAY_LENTH appears misspelled. Confirm whether this should beZB_ARRAY_LENGTH or correct the macro name to avoid compile errors.
read_req.attr_number = ZB_ARRAY_LENTH(attributes);

libraries/Zigbee/examples/Zigbee_Thermostat/Zigbee_Thermostat.ino:129

  • The example usesgetBoundDevices() andprintBoundDevices(), but these methods are not declared onZigbeeThermostat. Either add these API methods to the class or remove/replace their usage in the example to ensure it compiles.
std::list<zb_device_params_t *> boundSensors = zbThermostat.getBoundDevices();

Copy link
Collaborator

@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

@me-no-devme-no-dev added Status: Pending MergePull Request is ready to be merged and removed Status: Review neededIssue or PR is awaiting review labelsJun 4, 2025
@me-no-devme-no-dev merged commitcae66e6 intomasterJun 4, 2025
56 checks passed
@me-no-devme-no-dev deleted the feat/zigbee-endpoint-identification branchJune 4, 2025 14:40
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

Copilot code reviewCopilotCopilot left review comments

@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
No milestone
Development

Successfully merging this pull request may close these issues.

Support Endpoint Identification from Multiple Zigbee Devices
3 participants
@P-R-O-C-H-Y@me-no-dev@lucasssvaz

[8]ページ先頭

©2009-2025 Movatter.jp