-
Notifications
You must be signed in to change notification settings - Fork 7.4k
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
feat(zigbee): Add Zigbee library #10265
base: master
Are you sure you want to change the base?
Conversation
Fixed ep_thermostat to compile successfully Removed cb from all EP, as it have been removed, virtual methods will be used instead. Moved zigbee handlers out of Zigbee_core to Zigbee_handlers for better readability. Fixed zigbeeInit to be bool and return status of initialization for begin function. Updated examples with edited roles and custom method for on_off light
Implemented basic function calls of switch commands to on/off light: lightToggle, lightOn, lightOff, ... Implemented virtual methods for on/off light that have to be override in user code: setOnOff, sceneControl, setOnOffTime, setOffWaitTime APIs can be changed, still early development.
Implemented Factory reset of Zigbee device, in order to connect to new network without reflashing/erasing flash Implemented optional setting for Manufacturer and Model names Added option to allow endpoint to have multiple endpoint connected -> switch - 2 lights (tested) Minor sketches update
Implemented easy transfer from device it to Device type (0x0000 = ESP_ZB_HA_ON_OFF_SWITCH_DEVICE_ID -> "General On/Off switch".
Implemeted color dimmable light and color dimmer switch HA devices + examples. Removed unnecessary stored attribute cluster Renamed on/off light and switch examples
Implemented Zigbee network scanning (async) to mostly match WiFi scan APIs. Added Zigbee_Scan_Networks example
Implemeted thermostat and temperature sensor HA devices + examples. Implemented configure report handler. Updated READMEs and description of examples. Minor code updates
Simplified bounded device print as the structure is common for any EP type Allowed setting custom app version for EP, default is 0 Small fixes and code updates
👋 Hello P-R-O-C-H-Y, we appreciate your contribution to this project! Click to see more instructions ...
Review and merge process you can expect ...
|
Test Results 56 files - 83 56 suites - 83 4m 40s ⏱️ - 1h 37m 48s Results for commit 9a354ae. ± Comparison against base commit cbe0f2f. This pull request removes 9 tests.
♻️ This comment has been updated with latest results. |
First like the great work you are doing! |
e6f2769
to
7693a16
Compare
if((millis() - startTime) > 3000) { | ||
// If key pressed for more than 3secs, factory reset Zigbee and reboot | ||
Serial.printf("Reseting Zigbee to factory settings, reboot.\n"); | ||
Zigbee.factoryReset(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe break here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need, the Zigbee.factoryReset();
will reboot the device.
if((millis() - startTime) > 3000) { | ||
// If key pressed for more than 3secs, factory reset Zigbee and reboot | ||
Serial.printf("Reseting Zigbee to factory settings, reboot.\n"); | ||
Zigbee.factoryReset(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
break here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or wait for the button to be released
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No need, the Zigbee.factoryReset();
will reboot the device.
//Do what you want with the model string | ||
Serial.printf("Model: %s\n", model); | ||
} | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this class required here, if it's only to read manufacturer and model?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not required there, I just wanted to have it implemented in some example so users can see how to use it if they want to. I can remove it if you prefer, as its not necessary for the example.
libraries/Zigbee/examples/Zigbee_On_Off_Switch/Zigbee_On_Off_Switch.ino
Outdated
Show resolved
Hide resolved
libraries/Zigbee/examples/Zigbee_On_Off_Switch/Zigbee_On_Off_Switch.ino
Outdated
Show resolved
Hide resolved
libraries/Zigbee/examples/Zigbee_On_Off_Switch/Zigbee_On_Off_Switch.ino
Outdated
Show resolved
Hide resolved
libraries/Zigbee/examples/Zigbee_On_Off_Switch/Zigbee_On_Off_Switch.ino
Outdated
Show resolved
Hide resolved
libraries/Zigbee/examples/Zigbee_On_Off_Switch/Zigbee_On_Off_Switch.ino
Outdated
Show resolved
Hide resolved
libraries/Zigbee/examples/Zigbee_On_Off_Switch/Zigbee_On_Off_Switch.ino
Outdated
Show resolved
Hide resolved
libraries/Zigbee/examples/Zigbee_On_Off_Switch/Zigbee_On_Off_Switch.ino
Outdated
Show resolved
Hide resolved
libraries/Zigbee/examples/Zigbee_On_Off_Switch/Zigbee_On_Off_Switch.ino
Outdated
Show resolved
Hide resolved
Overall I like it, but take action to format the examples properly as I noted on one of them. |
Description of Change
Introducing Zigbee Arduino library (wrapper for esp-zigbee-sdk).
Tests scenarios
Locally with all included examples.
Related links
Relates to issue #10135
ZB_STRUCT warnings fix espressif/esp-zigbee-sdk#416