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): Extend switch EPs with get Light methods#11902

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-switch-enhancement
Oct 8, 2025

Conversation

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

@P-R-O-C-H-YP-R-O-C-H-Y commentedOct 7, 2025
edited
Loading

Description of Change

This pull request introduces significant improvements to the Zigbee switch and color dimmer switch functionality, focusing on enhanced state polling, attribute readback, and callback handling for light state, level, and color changes. The changes improve how the switch tracks and reports the state of bound lights, and add flexible mechanisms for polling and responding to changes in light attributes.

Enhanced Zigbee Switch State Polling and Reporting:

  • Added a periodic task (periodicTask) inZigbee_On_Off_Switch.ino to poll the light state every second and print bound devices every 10 seconds, improving real-time tracking of connected lights.[1][2]
  • Introduced theonLightStateChange callback andlight_state tracking to log state changes and ensure the application responds only to actual changes.[1][2]

Expanded ZigbeeColorDimmerSwitch Attribute Handling and Callbacks:

  • Implemented multiplegetLightState,getLightLevel, andgetLightColor methods to support polling light state, level, and color for various addressing modes (group, endpoint, IEEE address), enabling more flexible device management.[1][2]
  • Added callback setters (onLightStateChange,onLightLevelChange,onLightColorChange, etc.) to allow users to register handlers for state, level, and color changes, both with and without source information.[1][2]
  • Enhanced the attribute readback logic inzbAttributeRead, including robust parsing and callback invocation for ON/OFF, level, and color attributes, with proper handling of XY and HS color updates and conversion to RGB.

These changes collectively make the Zigbee switch and color dimmer switch more responsive, extensible, and easier to integrate into applications requiring real-time light state monitoring and control.

Test Scenarios

Tested with Updated On/Off switch + Light example and Customized ColorDimmableSwitch + ColorDimmableLight examples.

Related links

Closes#11886

@P-R-O-C-H-YP-R-O-C-H-Y self-assigned thisOct 7, 2025
@P-R-O-C-H-YP-R-O-C-H-Y added the Area: ZigbeeIssues and Feature Request about Zigbee labelOct 7, 2025
@github-actions
Copy link
Contributor

github-actionsbot commentedOct 7, 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 against1366fbf

@github-actions
Copy link
Contributor

github-actionsbot commentedOct 7, 2025
edited
Loading

Test Results

 76 files   76 suites   14m 19s ⏱️
 38 tests  38 ✅ 0 💤 0 ❌
241 runs  241 ✅ 0 💤 0 ❌

Results for commit1366fbf.

♻️ This comment has been updated with latest results.

@P-R-O-C-H-YP-R-O-C-H-Yforce-pushed thefeat/zigbee-switch-enhancement branch from400c8e6 to76b5a00CompareOctober 8, 2025 07:52
@github-actions
Copy link
Contributor

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
ESP32C50‼️ +2K0.00⚠️ +0.270⚠️ +560.00⚠️ +0.15
ESP32S30‼️ +2K0.00⚠️ +0.330⚠️ +400.00⚠️ +0.11
ESP32S20‼️ +2K0.00⚠️ +0.370⚠️ +400.00⚠️ +0.13
ESP32C30‼️ +2K0.00⚠️ +0.300⚠️ +400.00⚠️ +0.14
ESP32C60‼️ +2K0.00⚠️ +0.290⚠️ +560.00⚠️ +0.17
ESP32H20‼️ +2K0.00⚠️ +0.290⚠️ +560.00⚠️ +0.18
ESP320‼️ +2K0.00⚠️ +0.330⚠️ +480.00⚠️ +0.13
Click to expand the detailed deltas report [usage change in BYTES]
TargetESP32C5ESP32S3ESP32S2ESP32C3ESP32C6ESP32H2ESP32
ExampleFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAMFLASHRAM
libraries/Zigbee/examples/Zigbee_Analog_Input_Output00⚠️ +6160⚠️ +6160000000⚠️ +6160
libraries/Zigbee/examples/Zigbee_Binary_Input_Output00------0000--
libraries/Zigbee/examples/Zigbee_CarbonDioxide_Sensor00------0000--
libraries/Zigbee/examples/Zigbee_Color_Dimmable_Light00------0000--
libraries/Zigbee/examples/Zigbee_Color_Dimmer_Switch‼️ +2K⚠️ +56‼️ +2K⚠️ +40‼️ +2K⚠️ +40‼️ +2K⚠️ +40‼️ +2K⚠️ +56‼️ +2K⚠️ +56‼️ +2K⚠️ +48
libraries/Zigbee/examples/Zigbee_Contact_Switch00------0000--
libraries/Zigbee/examples/Zigbee_Dimmable_Light00------0000--
libraries/Zigbee/examples/Zigbee_Electrical_AC_Sensor00⚠️ +6160⚠️ +6160000000⚠️ +6160
libraries/Zigbee/examples/Zigbee_Electrical_AC_Sensor_MultiPhase00⚠️ +6160⚠️ +6160000000⚠️ +6160
libraries/Zigbee/examples/Zigbee_Electrical_DC_Sensor00------0000--
libraries/Zigbee/examples/Zigbee_Fan_Control00⚠️ +6160⚠️ +6160000000⚠️ +6160
libraries/Zigbee/examples/Zigbee_Gateway00⚠️ +6160⚠️ +616000----⚠️ +6160
libraries/Zigbee/examples/Zigbee_Illuminance_Sensor00------0000--
libraries/Zigbee/examples/Zigbee_Multistate_Input_Output00⚠️ +6160⚠️ +6160000000⚠️ +6160
libraries/Zigbee/examples/Zigbee_OTA_Client⚠️ +180------⚠️ +180⚠️ +180--
libraries/Zigbee/examples/Zigbee_Occupancy_Sensor00------0000--
libraries/Zigbee/examples/Zigbee_On_Off_Light00------0000--
libraries/Zigbee/examples/Zigbee_On_Off_MultiSwitch⚠️ +196⚠️ +16⚠️ +7160⚠️ +7200⚠️ +1960⚠️ +198⚠️ +16⚠️ +196⚠️ +16⚠️ +7320
libraries/Zigbee/examples/Zigbee_On_Off_Switch⚠️ +598⚠️ +24⚠️ +1044⚠️ +16⚠️ +1024⚠️ +16⚠️ +594⚠️ +24⚠️ +5880⚠️ +594⚠️ +24⚠️ +1064⚠️ +16
libraries/Zigbee/examples/Zigbee_PM25_Sensor00------0000--
libraries/Zigbee/examples/Zigbee_Power_Outlet00⚠️ +6160⚠️ +6160000000⚠️ +6160
libraries/Zigbee/examples/Zigbee_Pressure_Flow_Sensor00------0000--
libraries/Zigbee/examples/Zigbee_Range_Extender00⚠️ +6160⚠️ +6160000000⚠️ +6160
libraries/Zigbee/examples/Zigbee_Scan_Networks00------0000--
libraries/Zigbee/examples/Zigbee_Temp_Hum_Sensor_Sleepy00------0000--
libraries/Zigbee/examples/Zigbee_Temperature_Sensor00------0000--
libraries/Zigbee/examples/Zigbee_Thermostat00⚠️ +6160⚠️ +6160000000⚠️ +6200
libraries/Zigbee/examples/Zigbee_Vibration_Sensor00------0000--
libraries/Zigbee/examples/Zigbee_Wind_Speed_Sensor00------0000--
libraries/Zigbee/examples/Zigbee_Window_Covering00------0000--

@P-R-O-C-H-YP-R-O-C-H-Y added the Status: Review neededIssue or PR is awaiting review labelOct 8, 2025
@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 labelsOct 8, 2025
@me-no-devme-no-dev merged commit493c528 intomasterOct 8, 2025
53 checks passed
@me-no-devme-no-dev deleted the feat/zigbee-switch-enhancement branchOctober 8, 2025 10:26
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

@lucasssvazlucasssvazAwaiting requested review from lucasssvaz

@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

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

How to get the state of a ZIGBEE EP i.e. a lamp

3 participants

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

[8]ページ先頭

©2009-2025 Movatter.jp