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

Appearance settings

Commit ea0e160

Browse filesBrowse files
Add an overloaded constructor to ZigbeeEP device classes to support app_device_version parameter.
1 parent 422e526 commit ea0e160
Copy full SHA for ea0e160

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Dismiss banner
Expand file treeCollapse file tree

48 files changed

+117
-48
lines changed

‎libraries/Zigbee/src/ep/ZigbeeAnalog.cpp

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeAnalog.cpp
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,18 @@
22
#if CONFIG_ZB_ENABLED
33
#include <cfloat>
44

5-
ZigbeeAnalog::ZigbeeAnalog(uint8_t endpoint) : ZigbeeEP(endpoint) {
5+
ZigbeeAnalog::ZigbeeAnalog(uint8_t endpoint, uint8_t app_device_version) : ZigbeeEP(endpoint) {
66
_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID;
77

88
//Create basic analog sensor clusters without configuration
99
_cluster_list = esp_zb_zcl_cluster_list_create();
1010
esp_zb_cluster_list_add_basic_cluster(_cluster_list, esp_zb_basic_cluster_create(NULL), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
1111
esp_zb_cluster_list_add_identify_cluster(_cluster_list, esp_zb_identify_cluster_create(NULL), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
1212

13-
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0};
13+
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = app_device_version};
14+
}
15+
16+
ZigbeeAnalog::ZigbeeAnalog(uint8_t endpoint) : ZigbeeAnalog(endpoint, 0) {
1417
}
1518

1619
bool ZigbeeAnalog::addAnalogInput() {

‎libraries/Zigbee/src/ep/ZigbeeAnalog.h

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeAnalog.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ typedef struct zigbee_analog_cfg_s {
2525
class ZigbeeAnalog : public ZigbeeEP {
2626
public:
2727
ZigbeeAnalog(uint8_t endpoint);
28+
ZigbeeAnalog(uint8_t endpoint, uint8_t app_device_version);
2829
~ZigbeeAnalog() {}
2930

3031
// Add analog clusters

‎libraries/Zigbee/src/ep/ZigbeeBinary.cpp

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeBinary.cpp
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
#include "ZigbeeBinary.h"
22
#if CONFIG_ZB_ENABLED
33

4-
ZigbeeBinary::ZigbeeBinary(uint8_t endpoint) : ZigbeeEP(endpoint) {
4+
ZigbeeBinary::ZigbeeBinary(uint8_t endpoint, uint8_t app_device_version) : ZigbeeEP(endpoint) {
55
_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID;
66

77
//Create basic binary sensor clusters without configuration
88
_cluster_list = esp_zb_zcl_cluster_list_create();
99
esp_zb_cluster_list_add_basic_cluster(_cluster_list, esp_zb_basic_cluster_create(NULL), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
1010
esp_zb_cluster_list_add_identify_cluster(_cluster_list, esp_zb_identify_cluster_create(NULL), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
1111

12-
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0};
12+
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = app_device_version};
13+
}
14+
15+
ZigbeeBinary::ZigbeeBinary(uint8_t endpoint) : ZigbeeBinary(endpoint, 0) {
1316
}
1417

1518
bool ZigbeeBinary::addBinaryInput() {

‎libraries/Zigbee/src/ep/ZigbeeBinary.h

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeBinary.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ typedef struct zigbee_binary_cfg_s {
4848
class ZigbeeBinary : public ZigbeeEP {
4949
public:
5050
ZigbeeBinary(uint8_t endpoint);
51+
ZigbeeBinary(uint8_t endpoint, uint8_t app_device_version);
5152
~ZigbeeBinary() {}
5253

5354
// Add binary cluster

‎libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.cpp

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.cpp
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,17 @@ esp_zb_cluster_list_t *zigbee_carbon_dioxide_sensor_clusters_create(zigbee_carbo
1414
return cluster_list;
1515
}
1616

17-
ZigbeeCarbonDioxideSensor::ZigbeeCarbonDioxideSensor(uint8_t endpoint) : ZigbeeEP(endpoint) {
17+
ZigbeeCarbonDioxideSensor::ZigbeeCarbonDioxideSensor(uint8_t endpoint, uint8_t app_device_version) : ZigbeeEP(endpoint) {
1818
_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID;
1919

2020
//Create custom pressure sensor configuration
2121
zigbee_carbon_dioxide_sensor_cfg_t carbon_dioxide_sensor_cfg = ZIGBEE_DEFAULT_CARBON_DIOXIDE_SENSOR_CONFIG();
2222
_cluster_list = zigbee_carbon_dioxide_sensor_clusters_create(&carbon_dioxide_sensor_cfg);
2323

24-
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0};
24+
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = app_device_version};
25+
}
26+
27+
ZigbeeCarbonDioxideSensor::ZigbeeCarbonDioxideSensor(uint8_t endpoint) : ZigbeeCarbonDioxideSensor(endpoint, 0) {
2528
}
2629

2730
bool ZigbeeCarbonDioxideSensor::setMinMaxValue(float min, float max) {

‎libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.h

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeCarbonDioxideSensor.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ typedef struct zigbee_carbon_dioxide_sensor_cfg_s {
3939
class ZigbeeCarbonDioxideSensor : public ZigbeeEP {
4040
public:
4141
ZigbeeCarbonDioxideSensor(uint8_t endpoint);
42+
ZigbeeCarbonDioxideSensor(uint8_t endpoint, uint8_t app_device_version);
4243
~ZigbeeCarbonDioxideSensor() {}
4344

4445
// Set the carbon dioxide value in ppm

‎libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.cpp

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.cpp
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#include "ZigbeeColorDimmableLight.h"
22
#if CONFIG_ZB_ENABLED
33

4-
ZigbeeColorDimmableLight::ZigbeeColorDimmableLight(uint8_t endpoint) : ZigbeeEP(endpoint) {
4+
ZigbeeColorDimmableLight::ZigbeeColorDimmableLight(uint8_t endpoint, uint8_t app_device_version) : ZigbeeEP(endpoint) {
55
_device_id = ESP_ZB_HA_COLOR_DIMMABLE_LIGHT_DEVICE_ID;
66

77
esp_zb_color_dimmable_light_cfg_t light_cfg = ZIGBEE_DEFAULT_COLOR_DIMMABLE_LIGHT_CONFIG();
@@ -16,7 +16,7 @@ ZigbeeColorDimmableLight::ZigbeeColorDimmableLight(uint8_t endpoint) : ZigbeeEP(
1616
esp_zb_color_control_cluster_add_attr(color_cluster, ESP_ZB_ZCL_ATTR_COLOR_CONTROL_CURRENT_SATURATION_ID, &saturation);
1717

1818
_ep_config = {
19-
.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_COLOR_DIMMABLE_LIGHT_DEVICE_ID, .app_device_version = 0
19+
.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_COLOR_DIMMABLE_LIGHT_DEVICE_ID, .app_device_version = app_device_version
2020
};
2121

2222
//set default values
@@ -25,6 +25,9 @@ ZigbeeColorDimmableLight::ZigbeeColorDimmableLight(uint8_t endpoint) : ZigbeeEP(
2525
_current_color = {255, 255, 255};
2626
}
2727

28+
ZigbeeColorDimmableLight::ZigbeeColorDimmableLight(uint8_t endpoint) : ZigbeeColorDimmableLight(endpoint, 0) {
29+
}
30+
2831
uint16_t ZigbeeColorDimmableLight::getCurrentColorX() {
2932
return (*(uint16_t *)esp_zb_zcl_get_attribute(
3033
_endpoint, ESP_ZB_ZCL_CLUSTER_ID_COLOR_CONTROL, ESP_ZB_ZCL_CLUSTER_SERVER_ROLE, ESP_ZB_ZCL_ATTR_COLOR_CONTROL_CURRENT_X_ID

‎libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.h

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeColorDimmableLight.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,7 @@
5353
class ZigbeeColorDimmableLight : public ZigbeeEP {
5454
public:
5555
ZigbeeColorDimmableLight(uint8_t endpoint);
56+
ZigbeeColorDimmableLight(uint8_t endpoint, uint8_t app_device_version);
5657
~ZigbeeColorDimmableLight() {}
5758

5859
void onLightChange(void (*callback)(bool, uint8_t, uint8_t, uint8_t, uint8_t)) {

‎libraries/Zigbee/src/ep/ZigbeeColorDimmerSwitch.cpp

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeColorDimmerSwitch.cpp
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// Initialize the static instance pointer
55
ZigbeeColorDimmerSwitch *ZigbeeColorDimmerSwitch::_instance = nullptr;
66

7-
ZigbeeColorDimmerSwitch::ZigbeeColorDimmerSwitch(uint8_t endpoint) : ZigbeeEP(endpoint) {
7+
ZigbeeColorDimmerSwitch::ZigbeeColorDimmerSwitch(uint8_t endpoint, uint8_t app_device_version) : ZigbeeEP(endpoint) {
88
_device_id = ESP_ZB_HA_COLOR_DIMMER_SWITCH_DEVICE_ID;
99
_instance = this; // Set the static pointer to this instance
1010
_device = nullptr; // Initialize light pointer to null
@@ -13,10 +13,13 @@ ZigbeeColorDimmerSwitch::ZigbeeColorDimmerSwitch(uint8_t endpoint) : ZigbeeEP(en
1313
_cluster_list = esp_zb_color_dimmable_switch_clusters_create(&switch_cfg);
1414

1515
_ep_config = {
16-
.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_COLOR_DIMMER_SWITCH_DEVICE_ID, .app_device_version = 0
16+
.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_COLOR_DIMMER_SWITCH_DEVICE_ID, .app_device_version = app_device_version
1717
};
1818
}
1919

20+
ZigbeeColorDimmerSwitch::ZigbeeColorDimmerSwitch(uint8_t endpoint) : ZigbeeColorDimmerSwitch(endpoint, 0) {
21+
}
22+
2023
void ZigbeeColorDimmerSwitch::bindCb(esp_zb_zdp_status_t zdo_status, void *user_ctx) {
2124
ZigbeeColorDimmerSwitch *instance = static_cast<ZigbeeColorDimmerSwitch *>(user_ctx);
2225
if (zdo_status == ESP_ZB_ZDP_STATUS_SUCCESS) {

‎libraries/Zigbee/src/ep/ZigbeeColorDimmerSwitch.h

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeColorDimmerSwitch.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
class ZigbeeColorDimmerSwitch : public ZigbeeEP {
1313
public:
1414
ZigbeeColorDimmerSwitch(uint8_t endpoint);
15+
ZigbeeColorDimmerSwitch(uint8_t endpoint, uint8_t app_device_version);
1516
~ZigbeeColorDimmerSwitch() {}
1617

1718
// methods to control the color dimmable light

‎libraries/Zigbee/src/ep/ZigbeeContactSwitch.cpp

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeContactSwitch.cpp
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ esp_zb_cluster_list_t *zigbee_contact_switch_clusters_create(zigbee_contact_swit
1212
return cluster_list;
1313
}
1414

15-
ZigbeeContactSwitch::ZigbeeContactSwitch(uint8_t endpoint) : ZigbeeEP(endpoint) {
15+
ZigbeeContactSwitch::ZigbeeContactSwitch(uint8_t endpoint, uint8_t app_device_version) : ZigbeeEP(endpoint) {
1616
_device_id = ESP_ZB_HA_IAS_ZONE_ID;
1717
_zone_status = 0;
1818
_zone_id = 0xff;
@@ -22,7 +22,10 @@ ZigbeeContactSwitch::ZigbeeContactSwitch(uint8_t endpoint) : ZigbeeEP(endpoint)
2222
zigbee_contact_switch_cfg_t contact_switch_cfg = ZIGBEE_DEFAULT_CONTACT_SWITCH_CONFIG();
2323
_cluster_list = zigbee_contact_switch_clusters_create(&contact_switch_cfg);
2424

25-
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_IAS_ZONE_ID, .app_device_version = 0};
25+
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_IAS_ZONE_ID, .app_device_version = app_device_version};
26+
}
27+
28+
ZigbeeContactSwitch::ZigbeeContactSwitch(uint8_t endpoint) : ZigbeeContactSwitch(endpoint, 0) {
2629
}
2730

2831
void ZigbeeContactSwitch::setIASClientEndpoint(uint8_t ep_number) {

‎libraries/Zigbee/src/ep/ZigbeeContactSwitch.h

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeContactSwitch.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ typedef struct zigbee_contact_switch_cfg_s {
4242
class ZigbeeContactSwitch : public ZigbeeEP {
4343
public:
4444
ZigbeeContactSwitch(uint8_t endpoint);
45+
ZigbeeContactSwitch(uint8_t endpoint, uint8_t app_device_version);
4546
~ZigbeeContactSwitch() {}
4647

4748
// Set the IAS Client endpoint number (default is 1)

‎libraries/Zigbee/src/ep/ZigbeeDimmableLight.cpp

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeDimmableLight.cpp
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,22 @@
33

44
#include "esp_zigbee_cluster.h"
55

6-
ZigbeeDimmableLight::ZigbeeDimmableLight(uint8_t endpoint) : ZigbeeEP(endpoint) {
6+
ZigbeeDimmableLight::ZigbeeDimmableLight(uint8_t endpoint, uint8_t app_device_version) : ZigbeeEP(endpoint) {
77
_device_id = ESP_ZB_HA_DIMMABLE_LIGHT_DEVICE_ID;
88

99
zigbee_dimmable_light_cfg_t light_cfg = ZIGBEE_DEFAULT_DIMMABLE_LIGHT_CONFIG();
1010
_cluster_list = zigbee_dimmable_light_clusters_create(&light_cfg);
1111

12-
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_DIMMABLE_LIGHT_DEVICE_ID, .app_device_version = 0};
12+
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_DIMMABLE_LIGHT_DEVICE_ID, .app_device_version = app_device_version};
1313

1414
// set default values
1515
_current_state = false;
1616
_current_level = 255;
1717
}
1818

19+
ZigbeeDimmableLight::ZigbeeDimmableLight(uint8_t endpoint) : ZigbeeDimmableLight(endpoint, 0) {
20+
}
21+
1922
// set attribute method -> method overridden in child class
2023
void ZigbeeDimmableLight::zbAttributeSet(const esp_zb_zcl_set_attr_value_message_t *message) {
2124
// check the data and call right method

‎libraries/Zigbee/src/ep/ZigbeeDimmableLight.h

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeDimmableLight.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,7 @@ typedef struct zigbee_dimmable_light_cfg_s {
6767
class ZigbeeDimmableLight : public ZigbeeEP {
6868
public:
6969
ZigbeeDimmableLight(uint8_t endpoint);
70+
ZigbeeDimmableLight(uint8_t endpoint, uint8_t app_device_version);
7071
~ZigbeeDimmableLight() {}
7172

7273
void onLightChange(void (*callback)(bool, uint8_t)) {

‎libraries/Zigbee/src/ep/ZigbeeDoorWindowHandle.cpp

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeDoorWindowHandle.cpp
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ esp_zb_cluster_list_t *zigbee_door_window_handle_clusters_create(zigbee_door_win
1212
return cluster_list;
1313
}
1414

15-
ZigbeeDoorWindowHandle::ZigbeeDoorWindowHandle(uint8_t endpoint) : ZigbeeEP(endpoint) {
15+
ZigbeeDoorWindowHandle::ZigbeeDoorWindowHandle(uint8_t endpoint, uint8_t app_device_version) : ZigbeeEP(endpoint) {
1616
_device_id = ESP_ZB_HA_IAS_ZONE_ID;
1717
_zone_status = 0;
1818
_zone_id = 0xff;
@@ -22,7 +22,10 @@ ZigbeeDoorWindowHandle::ZigbeeDoorWindowHandle(uint8_t endpoint) : ZigbeeEP(endp
2222
zigbee_door_window_handle_cfg_t door_window_handle_cfg = ZIGBEE_DEFAULT_DOOR_WINDOW_HANDLE_CONFIG();
2323
_cluster_list = zigbee_door_window_handle_clusters_create(&door_window_handle_cfg);
2424

25-
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_IAS_ZONE_ID, .app_device_version = 0};
25+
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_IAS_ZONE_ID, .app_device_version = app_device_version};
26+
}
27+
28+
ZigbeeDoorWindowHandle::ZigbeeDoorWindowHandle(uint8_t endpoint) : ZigbeeDoorWindowHandle(endpoint, 0) {
2629
}
2730

2831
void ZigbeeDoorWindowHandle::setIASClientEndpoint(uint8_t ep_number) {

‎libraries/Zigbee/src/ep/ZigbeeDoorWindowHandle.h

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeDoorWindowHandle.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ typedef struct zigbee_door_window_handle_cfg_s {
4343
class ZigbeeDoorWindowHandle : public ZigbeeEP {
4444
public:
4545
ZigbeeDoorWindowHandle(uint8_t endpoint);
46+
ZigbeeDoorWindowHandle(uint8_t endpoint, uint8_t app_device_version);
4647
~ZigbeeDoorWindowHandle() {}
4748

4849
// Set the IAS Client endpoint number (default is 1)

‎libraries/Zigbee/src/ep/ZigbeeElectricalMeasurement.cpp

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeElectricalMeasurement.cpp
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,18 +17,21 @@ esp_zb_cluster_list_t *zigbee_electrical_measurement_clusters_create(zigbee_elec
1717
return cluster_list;
1818
}
1919

20-
ZigbeeElectricalMeasurement::ZigbeeElectricalMeasurement(uint8_t endpoint) : ZigbeeEP(endpoint) {
20+
ZigbeeElectricalMeasurement::ZigbeeElectricalMeasurement(uint8_t endpoint, uint8_t app_device_version) : ZigbeeEP(endpoint) {
2121
_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID;
2222

2323
//Create custom pressure sensor configuration
2424
zigbee_electrical_measurement_cfg_t electrical_measurement_cfg = ZIGBEE_DEFAULT_ELECTRICAL_MEASUREMENT_CONFIG();
2525
_cluster_list = zigbee_electrical_measurement_clusters_create(&electrical_measurement_cfg);
2626

2727
_ep_config = {
28-
.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_METER_INTERFACE_DEVICE_ID, .app_device_version = 0
28+
.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_METER_INTERFACE_DEVICE_ID, .app_device_version = app_device_version
2929
};
3030
}
3131

32+
ZigbeeElectricalMeasurement::ZigbeeElectricalMeasurement(uint8_t endpoint) : ZigbeeElectricalMeasurement(endpoint, 0) {
33+
}
34+
3235
/* DC MEASUREMENT */
3336

3437
bool ZigbeeElectricalMeasurement::addDCMeasurement(ZIGBEE_DC_MEASUREMENT_TYPE measurement_type) {

‎libraries/Zigbee/src/ep/ZigbeeElectricalMeasurement.h

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeElectricalMeasurement.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ typedef struct zigbee_electrical_measurement_cfg_s {
5858
class ZigbeeElectricalMeasurement : public ZigbeeEP {
5959
public:
6060
ZigbeeElectricalMeasurement(uint8_t endpoint);
61+
ZigbeeElectricalMeasurement(uint8_t endpoint, uint8_t app_device_version);
6162
~ZigbeeElectricalMeasurement() {}
6263

6364
/**

‎libraries/Zigbee/src/ep/ZigbeeFlowSensor.cpp

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeFlowSensor.cpp
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,17 @@ esp_zb_cluster_list_t *zigbee_flow_sensor_clusters_create(zigbee_flow_sensor_cfg
1212
return cluster_list;
1313
}
1414

15-
ZigbeeFlowSensor::ZigbeeFlowSensor(uint8_t endpoint) : ZigbeeEP(endpoint) {
15+
ZigbeeFlowSensor::ZigbeeFlowSensor(uint8_t endpoint, uint8_t app_device_version) : ZigbeeEP(endpoint) {
1616
_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID;
1717

1818
//Create custom pressure sensor configuration
1919
zigbee_flow_sensor_cfg_t flow_sensor_cfg = ZIGBEE_DEFAULT_FLOW_SENSOR_CONFIG();
2020
_cluster_list = zigbee_flow_sensor_clusters_create(&flow_sensor_cfg);
2121

22-
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = 0};
22+
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID, .app_device_version = app_device_version};
23+
}
24+
25+
ZigbeeFlowSensor::ZigbeeFlowSensor(uint8_t endpoint) : ZigbeeFlowSensor(endpoint, 0) {
2326
}
2427

2528
bool ZigbeeFlowSensor::setMinMaxValue(float min, float max) {

‎libraries/Zigbee/src/ep/ZigbeeFlowSensor.h

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeFlowSensor.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ typedef struct zigbee_flow_sensor_cfg_s {
3939
class ZigbeeFlowSensor : public ZigbeeEP {
4040
public:
4141
ZigbeeFlowSensor(uint8_t endpoint);
42+
ZigbeeFlowSensor(uint8_t endpoint, uint8_t app_device_version);
4243
~ZigbeeFlowSensor() {}
4344

4445
// Set the flow value in 0,1 m3/h
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
#include "ZigbeeGateway.h"
22
#if CONFIG_ZB_ENABLED
33

4-
ZigbeeGateway::ZigbeeGateway(uint8_t endpoint) : ZigbeeEP(endpoint) {
4+
ZigbeeGateway::ZigbeeGateway(uint8_t endpoint, uint8_t app_device_version) : ZigbeeEP(endpoint) {
55
_device_id = ESP_ZB_HA_HOME_GATEWAY_DEVICE_ID;
66

77
_cluster_list = esp_zb_zcl_cluster_list_create();
88
esp_zb_cluster_list_add_basic_cluster(_cluster_list, esp_zb_basic_cluster_create(NULL), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
99
esp_zb_cluster_list_add_identify_cluster(_cluster_list, esp_zb_identify_cluster_create(NULL), ESP_ZB_ZCL_CLUSTER_SERVER_ROLE);
1010
esp_zb_cluster_list_add_identify_cluster(_cluster_list, esp_zb_zcl_attr_list_create(ESP_ZB_ZCL_CLUSTER_ID_IDENTIFY), ESP_ZB_ZCL_CLUSTER_CLIENT_ROLE);
1111

12-
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_HOME_GATEWAY_DEVICE_ID, .app_device_version = 0};
12+
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_HOME_GATEWAY_DEVICE_ID, .app_device_version = app_device_version};
13+
}
14+
15+
ZigbeeGateway::ZigbeeGateway(uint8_t endpoint) : ZigbeeGateway(endpoint, 0) {
1316
}
1417

1518
#endif // CONFIG_ZB_ENABLED

‎libraries/Zigbee/src/ep/ZigbeeGateway.h

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeGateway.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
class ZigbeeGateway : public ZigbeeEP {
1313
public:
1414
ZigbeeGateway(uint8_t endpoint);
15+
ZigbeeGateway(uint8_t endpoint, uint8_t app_device_version);
1516
~ZigbeeGateway() {}
1617
};
1718

‎libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.cpp

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.cpp
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
#include "ZigbeeIlluminanceSensor.h"
22
#if CONFIG_ZB_ENABLED
33

4-
ZigbeeIlluminanceSensor::ZigbeeIlluminanceSensor(uint8_t endpoint) : ZigbeeEP(endpoint) {
4+
ZigbeeIlluminanceSensor::ZigbeeIlluminanceSensor(uint8_t endpoint, uint8_t app_device_version) : ZigbeeEP(endpoint) {
55
_device_id = ESP_ZB_HA_LIGHT_SENSOR_DEVICE_ID;
66

77
esp_zb_light_sensor_cfg_t light_sensor_cfg = ZIGBEE_DEFAULT_ILLUMINANCE_SENSOR_CONFIG();
88
_cluster_list = esp_zb_light_sensor_clusters_create(&light_sensor_cfg);
99

10-
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_LIGHT_SENSOR_DEVICE_ID, .app_device_version = 0};
10+
_ep_config = {.endpoint = _endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_LIGHT_SENSOR_DEVICE_ID, .app_device_version = app_device_version};
11+
}
12+
13+
ZigbeeIlluminanceSensor::ZigbeeIlluminanceSensor(uint8_t endpoint) : ZigbeeIlluminanceSensor(endpoint, 0) {
1114
}
1215

1316
bool ZigbeeIlluminanceSensor::setMinMaxValue(uint16_t min, uint16_t max) {

‎libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.h

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeIlluminanceSensor.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
class ZigbeeIlluminanceSensor : public ZigbeeEP {
3131
public:
3232
ZigbeeIlluminanceSensor(uint8_t endpoint);
33+
ZigbeeIlluminanceSensor(uint8_t endpoint, uint8_t app_device_version);
3334
~ZigbeeIlluminanceSensor() {}
3435

3536
// Set the illuminance value

‎libraries/Zigbee/src/ep/ZigbeeLight.cpp

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeLight.cpp
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,18 @@
11
#include "ZigbeeLight.h"
22
#if CONFIG_ZB_ENABLED
33

4-
ZigbeeLight::ZigbeeLight(uint8_t endpoint) : ZigbeeEP(endpoint) {
4+
ZigbeeLight::ZigbeeLight(uint8_t endpoint, uint8_t app_device_version) : ZigbeeEP(endpoint) {
55
_device_id = ESP_ZB_HA_ON_OFF_LIGHT_DEVICE_ID;
66

77
esp_zb_on_off_light_cfg_t light_cfg = ESP_ZB_DEFAULT_ON_OFF_LIGHT_CONFIG();
88
_cluster_list = esp_zb_on_off_light_clusters_create(&light_cfg); // use esp_zb_zcl_cluster_list_create() instead of esp_zb_on_off_light_clusters_create()
9-
_ep_config = {.endpoint = endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_ON_OFF_LIGHT_DEVICE_ID, .app_device_version = 0};
9+
_ep_config = {.endpoint = endpoint, .app_profile_id = ESP_ZB_AF_HA_PROFILE_ID, .app_device_id = ESP_ZB_HA_ON_OFF_LIGHT_DEVICE_ID, .app_device_version = app_device_version};
1010
log_v("Light endpoint created %d", _endpoint);
1111
}
1212

13+
ZigbeeLight::ZigbeeLight(uint8_t endpoint) : ZigbeeLight(endpoint, 0) {
14+
}
15+
1316
//set attribute method -> method overridden in child class
1417
void ZigbeeLight::zbAttributeSet(const esp_zb_zcl_set_attr_value_message_t *message) {
1518
//check the data and call right method

‎libraries/Zigbee/src/ep/ZigbeeLight.h

Copy file name to clipboardExpand all lines: libraries/Zigbee/src/ep/ZigbeeLight.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
class ZigbeeLight : public ZigbeeEP {
1313
public:
1414
ZigbeeLight(uint8_t endpoint);
15+
ZigbeeLight(uint8_t endpointex, uint8_t app_device_version);
1516
~ZigbeeLight() {}
1617

1718
// Use to set a cb function to be called on light change

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.