Skip to content

Commit 305299d

Browse files
committed
fix(zigbee): Update logs and change device_id
1 parent 46e9353 commit 305299d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

libraries/Zigbee/src/ep/ZigbeeFanControl.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#if CONFIG_ZB_ENABLED
33

44
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
66

77
//Create basic analog sensor clusters without configuration
88
_cluster_list = esp_zb_zcl_cluster_list_create();
@@ -26,7 +26,7 @@ bool ZigbeeFanControl::setFanModeSequence(ZigbeeFanModeSequence sequence) {
2626
// Set initial fan mode to OFF
2727
ret = esp_zb_cluster_update_attr(fan_control_cluster, ESP_ZB_ZCL_ATTR_FAN_CONTROL_FAN_MODE_ID, (void *)&_current_fan_mode);
2828
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));
3030
return false;
3131
}
3232
return true;
@@ -40,18 +40,18 @@ void ZigbeeFanControl::zbAttributeSet(const esp_zb_zcl_set_attr_value_message_t
4040
_current_fan_mode = *(ZigbeeFanMode *)message->attribute.data.value;
4141
fanModeChanged();
4242
} 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);
4444
}
4545
} 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);
4747
}
4848
}
4949

5050
void ZigbeeFanControl::fanModeChanged() {
5151
if (_on_fan_mode_change) {
5252
_on_fan_mode_change(_current_fan_mode);
5353
} else {
54-
log_w("No callback function set for light change");
54+
log_w("No callback function set for fan mode change");
5555
}
5656
}
5757

0 commit comments

Comments
 (0)