Skip to content

Commit 3c8119e

Browse files
committed
feat(docs): Updaze Zigbee docs with latest changes
1 parent c369dca commit 3c8119e

File tree

3 files changed

+159
-0
lines changed

3 files changed

+159
-0
lines changed

docs/en/zigbee/ep_fan_control.rst

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
################
2+
ZigbeeFanControl
3+
################
4+
5+
About
6+
-----
7+
8+
The ``ZigbeeFanControl`` class provides a Zigbee endpoint for controlling fan devices in a Home Automation (HA) network. This endpoint implements the Fan Control cluster and allows for controlling fan modes and sequences.
9+
10+
**Features:**
11+
* Fan mode control (OFF, LOW, MEDIUM, HIGH, ON, AUTO, SMART)
12+
* Fan mode sequence configuration
13+
* State change callbacks
14+
* Zigbee HA standard compliance
15+
16+
**Use Cases:**
17+
* Smart ceiling fans
18+
* HVAC system fans
19+
* Exhaust fans
20+
* Any device requiring fan speed control
21+
22+
Fan Mode Enums
23+
--------------
24+
25+
ZigbeeFanMode
26+
^^^^^^^^^^^^^
27+
28+
Available fan modes for controlling the fan speed and operation.
29+
30+
.. code-block:: arduino
31+
32+
enum ZigbeeFanMode {
33+
FAN_MODE_OFF, // Fan is off
34+
FAN_MODE_LOW, // Low speed
35+
FAN_MODE_MEDIUM, // Medium speed
36+
FAN_MODE_HIGH, // High speed
37+
FAN_MODE_ON, // Fan is on (full speed)
38+
FAN_MODE_AUTO, // Automatic mode
39+
FAN_MODE_SMART, // Smart mode
40+
};
41+
42+
ZigbeeFanModeSequence
43+
^^^^^^^^^^^^^^^^^^^^^
44+
45+
Available fan mode sequences that define which modes are available for the fan.
46+
47+
.. code-block:: arduino
48+
49+
enum ZigbeeFanModeSequence {
50+
FAN_MODE_SEQUENCE_LOW_MED_HIGH, // Low -> Medium -> High
51+
FAN_MODE_SEQUENCE_LOW_HIGH, // Low -> High
52+
FAN_MODE_SEQUENCE_LOW_MED_HIGH_AUTO, // Low -> Medium -> High -> Auto
53+
FAN_MODE_SEQUENCE_LOW_HIGH_AUTO, // Low -> High -> Auto
54+
FAN_MODE_SEQUENCE_ON_AUTO, // On -> Auto
55+
};
56+
57+
API Reference
58+
-------------
59+
60+
Constructor
61+
***********
62+
63+
ZigbeeFanControl
64+
^^^^^^^^^^^^^^^^
65+
66+
Creates a new Zigbee fan control endpoint.
67+
68+
.. code-block:: arduino
69+
70+
ZigbeeFanControl(uint8_t endpoint);
71+
72+
* ``endpoint`` - Endpoint number (1-254)
73+
74+
API Methods
75+
***********
76+
77+
setFanModeSequence
78+
^^^^^^^^^^^^^^^^^^
79+
80+
Sets the fan mode sequence and initializes the fan control.
81+
82+
.. code-block:: arduino
83+
84+
bool setFanModeSequence(ZigbeeFanModeSequence sequence);
85+
86+
* ``sequence`` - The fan mode sequence to set
87+
88+
This function will return ``true`` if successful, ``false`` otherwise.
89+
90+
getFanMode
91+
^^^^^^^^^^
92+
93+
Gets the current fan mode.
94+
95+
.. code-block:: arduino
96+
97+
ZigbeeFanMode getFanMode();
98+
99+
This function will return current fan mode.
100+
101+
getFanModeSequence
102+
^^^^^^^^^^^^^^^^^^
103+
104+
Gets the current fan mode sequence.
105+
106+
.. code-block:: arduino
107+
108+
ZigbeeFanModeSequence getFanModeSequence();
109+
110+
This function will return current fan mode sequence.
111+
112+
Event Handling
113+
**************
114+
115+
onFanModeChange
116+
^^^^^^^^^^^^^^^
117+
118+
Sets a callback function to be called when the fan mode changes.
119+
120+
.. code-block:: arduino
121+
122+
void onFanModeChange(void (*callback)(ZigbeeFanMode mode));
123+
124+
* ``callback`` - Function to call when fan mode changes
125+
126+
Example
127+
-------
128+
129+
Fan Control Implementation
130+
**************************
131+
132+
.. literalinclude:: ../../../libraries/Zigbee/examples/Zigbee_Fan_Control/Zigbee_Fan_Control.ino
133+
:language: arduino

docs/en/zigbee/zigbee_core.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,19 @@ Performs a factory reset, clearing all network settings.
345345
346346
* ``restart`` - ``true`` to restart after reset (default: ``true``)
347347

348+
onGlobalDefaultResponse
349+
^^^^^^^^^^^^^^^^^^^^^^^
350+
351+
Sets a global callback for default response messages.
352+
353+
.. code-block:: arduino
354+
355+
void onGlobalDefaultResponse(void (*callback)(zb_cmd_type_t resp_to_cmd, esp_zb_zcl_status_t status, uint8_t endpoint, uint16_t cluster));
356+
357+
* ``callback`` - Function pointer to the callback function
358+
359+
This callback will be called for all endpoints when a default response is received.
360+
348361
Utility Functions
349362
*****************
350363

docs/en/zigbee/zigbee_ep.rst

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -345,6 +345,19 @@ Sets a callback function for identify events.
345345
* ``callback`` - Function to call when identify event occurs
346346
* ``time`` - Identify time in seconds
347347

348+
onDefaultResponse
349+
^^^^^^^^^^^^^^^^^
350+
351+
Sets a callback for default response messages for this endpoint.
352+
353+
.. code-block:: arduino
354+
355+
void onDefaultResponse(void (*callback)(zb_cmd_type_t resp_to_cmd, esp_zb_zcl_status_t status));
356+
357+
* ``callback`` - Function pointer to the callback function
358+
359+
This callback will be called when a default response is received for this specific endpoint.
360+
348361
Supported Endpoints
349362
-------------------
350363

0 commit comments

Comments
 (0)