File tree Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Expand file tree Collapse file tree 1 file changed +5
-4
lines changed Original file line number Diff line number Diff line change 1
1
#include " ZigbeeAnalog.h"
2
2
#if CONFIG_ZB_ENABLED
3
+ #include < cfloat>
3
4
4
5
ZigbeeAnalog::ZigbeeAnalog (uint8_t endpoint) : ZigbeeEP(endpoint) {
5
6
_device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID;
@@ -20,8 +21,8 @@ bool ZigbeeAnalog::addAnalogInput() {
20
21
" Analog Input" ;
21
22
uint32_t application_type = 0x00000000 | (ESP_ZB_ZCL_AI_GROUP_ID << 24 );
22
23
float resolution = 0.1 ; // Default resolution of 0.1
23
- float min = -3.402823e+38 ; // Default min value for float
24
- float max = 3.402823e+38 ; // Default max value for float
24
+ float min = -FLT_MAX ; // Default min value for float
25
+ float max = FLT_MAX ; // Default max value for float
25
26
26
27
esp_err_t ret = esp_zb_analog_input_cluster_add_attr (esp_zb_analog_input_cluster, ESP_ZB_ZCL_ATTR_ANALOG_INPUT_DESCRIPTION_ID, (void *)default_description);
27
28
if (ret != ESP_OK) {
@@ -91,8 +92,8 @@ bool ZigbeeAnalog::addAnalogOutput() {
91
92
" Analog Output" ;
92
93
uint32_t application_type = 0x00000000 | (ESP_ZB_ZCL_AO_GROUP_ID << 24 );
93
94
float resolution = 1 ; // Default resolution of 1
94
- float min = -3.402823e+38 ; // Default min value for float
95
- float max = 3.402823e+38 ; // Default max value for float
95
+ float min = -FLT_MAX ; // Default min value for float
96
+ float max = FLT_MAX ; // Default max value for float
96
97
97
98
esp_err_t ret =
98
99
esp_zb_analog_output_cluster_add_attr (esp_zb_analog_output_cluster, ESP_ZB_ZCL_ATTR_ANALOG_OUTPUT_DESCRIPTION_ID, (void *)default_description);
You can’t perform that action at this time.
0 commit comments