2
2
#if CONFIG_ZB_ENABLED
3
3
4
4
ZigbeeFanControl::ZigbeeFanControl (uint8_t endpoint) : ZigbeeEP(endpoint) {
5
- _device_id = ESP_ZB_HA_SIMPLE_SENSOR_DEVICE_ID;
5
+ _device_id = ESP_ZB_HA_THERMOSTAT_DEVICE_ID; // There is no FAN_CONTROL_DEVICE_ID in the Zigbee spec
6
6
7
7
// Create basic analog sensor clusters without configuration
8
8
_cluster_list = esp_zb_zcl_cluster_list_create ();
@@ -26,7 +26,7 @@ bool ZigbeeFanControl::setFanModeSequence(ZigbeeFanModeSequence sequence) {
26
26
// Set initial fan mode to OFF
27
27
ret = esp_zb_cluster_update_attr (fan_control_cluster, ESP_ZB_ZCL_ATTR_FAN_CONTROL_FAN_MODE_ID, (void *)&_current_fan_mode);
28
28
if (ret != ESP_OK) {
29
- log_e (" Failed to set min value : 0x%x: %s" , ret, esp_err_to_name (ret));
29
+ log_e (" Failed to set fan mode : 0x%x: %s" , ret, esp_err_to_name (ret));
30
30
return false ;
31
31
}
32
32
return true ;
@@ -40,18 +40,18 @@ void ZigbeeFanControl::zbAttributeSet(const esp_zb_zcl_set_attr_value_message_t
40
40
_current_fan_mode = *(ZigbeeFanMode *)message->attribute .data .value ;
41
41
fanModeChanged ();
42
42
} else {
43
- log_w (" Received message ignored. Attribute ID: %d not supported for On/Off Light " , message->attribute .id );
43
+ log_w (" Received message ignored. Attribute ID: %d not supported for Fan Control " , message->attribute .id );
44
44
}
45
45
} else {
46
- log_w (" Received message ignored. Cluster ID: %d not supported for On/Off Light " , message->info .cluster );
46
+ log_w (" Received message ignored. Cluster ID: %d not supported for Fan Control " , message->info .cluster );
47
47
}
48
48
}
49
49
50
50
void ZigbeeFanControl::fanModeChanged () {
51
51
if (_on_fan_mode_change) {
52
52
_on_fan_mode_change (_current_fan_mode);
53
53
} else {
54
- log_w (" No callback function set for light change" );
54
+ log_w (" No callback function set for fan mode change" );
55
55
}
56
56
}
57
57
0 commit comments