all_device_types_app: Fix the fan control clusters delegate and add comment.

This commit is contained in:
Rohit
2025-11-27 21:47:20 +05:30
parent 8462ff05f0
commit 19fb282d5f
2 changed files with 4 additions and 2 deletions
@@ -141,7 +141,9 @@ esp_err_t app_driver_init();
class FanDelegateImpl:public chip::app::Clusters::FanControl::Delegate
{
public:
FanDelegateImpl(uint16_t aEndpoint):Delegate(aEndpoint){}
// Constructor to match the base class design, however endpoint_id set here is not being using at all.
// FanControlDelegateInitCB sets the delegate on correct endpoint while initialization.
FanDelegateImpl():Delegate(chip::kInvalidEndpointId) {}
chip::Protocols::InteractionModel::Status HandleStep(chip::app::Clusters::FanControl::StepDirectionEnum aDirection, bool aWrap, bool aLowestOff);
};
@@ -230,7 +230,7 @@ int create(uint8_t device_type_index)
case ESP_MATTER_FAN: {
esp_matter::endpoint::fan::config_t fan_config;
#if CONFIG_IDF_TARGET_ESP32 || CONFIG_IDF_TARGET_ESP32S3
static FanDelegateImpl fan_delegate(app_endpoint_id);
static FanDelegateImpl fan_delegate;
fan_config.fan_control.delegate = &fan_delegate;
#endif
endpoint = esp_matter::endpoint::fan::create(node, &fan_config, ENDPOINT_FLAG_NONE, NULL);