Skip to content

Commit 473b851

Browse files
feat(zigbee): Add Zigbee library (#10265)
* Initial commit - light bulb + switch working * Add Thermostat + fix enum * Dev update: roles, cb removal, handlers 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 * Dev update: implement on/off light and switch methods 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. * Dev update: Factory reset, names, multiple EPs 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 * Dev update: Device ID to string Implemented easy transfer from device it to Device type (0x0000 = ESP_ZB_HA_ON_OFF_SWITCH_DEVICE_ID -> "General On/Off switch". * Implement cmd default response handler * Remove unused _identify_cluster * Dev Update: Color DImmable light + switch implemented Implemeted color dimmable light and color dimmer switch HA devices + examples. Removed unnecessary stored attribute cluster Renamed on/off light and switch examples * Implement Network Scanning Implemented Zigbee network scanning (async) to mostly match WiFi scan APIs. Added Zigbee_Scan_Networks example * Dev Update: Thermostat and Temperature sensor EP Implemeted thermostat and temperature sensor HA devices + examples. Implemented configure report handler. Updated READMEs and description of examples. Minor code updates * fix(): Replace deprecated function * Remove ported IDF examples * Update Zigbee examples with new APIs * Dev Update: Version setting, Thermostat fix, ... 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 * Remove EP template + add lib to CMakeLists * Rename classes to have proper naming * Add check for SOC_IEEE802154_SUPPORTED * Ignore false positive unused variable/function * Fix compilation errors in examples * Fill keyworkds.txt, remove unnecessary defines * Rename methods, variables + make private/protected * Remove unnecesary defaults defines * Remove outdated comments * Update Scan networks Readme * fix(example): Use proper naming of func and variables * Change virtual methods to callbacks (TODO) * Refactor classes methods + implement Identify command * Apply suggestions from code review by @lucasssvaz Co-authored-by: Lucas Saavedra Vaz <[email protected]> * Update READMEs + add openNetwork fucntion * Use [[maybe_unused]] instead of #pragma * Use gpio calls for OnOff Light example * ci(pre-commit): Apply automatic fixes * fix(): Codespell issues --------- Co-authored-by: Lucas Saavedra Vaz <[email protected]>
1 parent 19f611d commit 473b851

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+3718
-1549
lines changed

CMakeLists.txt

+13
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ set(ARDUINO_ALL_LIBRARIES
112112
WiFi
113113
WiFiProv
114114
Wire
115+
Zigbee
115116
)
116117

117118
set(ARDUINO_LIBRARY_ArduinoOTA_SRCS libraries/ArduinoOTA/src/ArduinoOTA.cpp)
@@ -240,6 +241,18 @@ set(ARDUINO_LIBRARY_WiFiProv_SRCS libraries/WiFiProv/src/WiFiProv.cpp)
240241

241242
set(ARDUINO_LIBRARY_Wire_SRCS libraries/Wire/src/Wire.cpp)
242243

244+
set(ARDUINO_LIBRARY_Zigbee_SRCS
245+
libraries/Zigbee/src/ZigbeeCore.cpp
246+
libraries/Zigbee/src/ZigbeeEP.cpp
247+
libraries/Zigbee/src/ZigbeeHandlers.cpp
248+
libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.cpp
249+
libraries/Zigbee/src/ep/ZigbeeColorDimmerSwitch.cpp
250+
libraries/Zigbee/src/ep/ZigbeeLight.cpp
251+
libraries/Zigbee/src/ep/ZigbeeSwitch.cpp
252+
libraries/Zigbee/src/ep/ZigbeeTempSensor.cpp
253+
libraries/Zigbee/src/ep/ZigbeeThermostat.cpp
254+
)
255+
243256
set(ARDUINO_LIBRARY_BLE_SRCS
244257
libraries/BLE/src/BLE2901.cpp
245258
libraries/BLE/src/BLE2902.cpp

boards.txt

+42-42
Large diffs are not rendered by default.

libraries/ESP32/examples/Zigbee/Zigbee_Light_Bulb/Zigbee_Light_Bulb.ino

-183
This file was deleted.

libraries/ESP32/examples/Zigbee/Zigbee_Light_Bulb/ci.json

-10
This file was deleted.

0 commit comments

Comments
 (0)