Skip to content

Commit

Permalink
feat(zigbee): Add Zigbee library (#10265)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
P-R-O-C-H-Y and lucasssvaz authored Oct 2, 2024
1 parent 19f611d commit 473b851
Show file tree
Hide file tree
Showing 50 changed files with 3,718 additions and 1,549 deletions.
13 changes: 13 additions & 0 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,7 @@ set(ARDUINO_ALL_LIBRARIES
WiFi
WiFiProv
Wire
Zigbee
)

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

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

set(ARDUINO_LIBRARY_Zigbee_SRCS
libraries/Zigbee/src/ZigbeeCore.cpp
libraries/Zigbee/src/ZigbeeEP.cpp
libraries/Zigbee/src/ZigbeeHandlers.cpp
libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.cpp
libraries/Zigbee/src/ep/ZigbeeColorDimmerSwitch.cpp
libraries/Zigbee/src/ep/ZigbeeLight.cpp
libraries/Zigbee/src/ep/ZigbeeSwitch.cpp
libraries/Zigbee/src/ep/ZigbeeTempSensor.cpp
libraries/Zigbee/src/ep/ZigbeeThermostat.cpp
)

set(ARDUINO_LIBRARY_BLE_SRCS
libraries/BLE/src/BLE2901.cpp
libraries/BLE/src/BLE2902.cpp
Expand Down
84 changes: 42 additions & 42 deletions boards.txt

Large diffs are not rendered by default.

This file was deleted.

10 changes: 0 additions & 10 deletions libraries/ESP32/examples/Zigbee/Zigbee_Light_Bulb/ci.json

This file was deleted.

Loading

0 comments on commit 473b851

Please sign in to comment.