diff --git a/components/esp_matter/data_model/esp_matter_feature.cpp b/components/esp_matter/data_model/esp_matter_feature.cpp index 251d37557..91c93db23 100644 --- a/components/esp_matter/data_model/esp_matter_feature.cpp +++ b/components/esp_matter/data_model/esp_matter_feature.cpp @@ -2843,13 +2843,13 @@ uint32_t get_id() return (uint32_t)DoorLock::Feature::kYearDayAccessSchedules; } -esp_err_t add(cluster_t *cluster) +esp_err_t add(cluster_t *cluster, config_t *config) { VerifyOrReturnError(cluster, ESP_ERR_INVALID_ARG, ESP_LOGE(TAG, "Cluster cannot be NULL")); update_feature_map(cluster, get_id()); /* Attributes not managed internally */ - attribute::create_number_of_year_day_schedules_supported_per_user(cluster, 1); + attribute::create_number_of_year_day_schedules_supported_per_user(cluster, config->number_of_year_day_schedules_supported_per_user); /* Commands */ command::create_set_year_day_schedule(cluster); @@ -2869,13 +2869,13 @@ uint32_t get_id() return (uint32_t)DoorLock::Feature::kHolidaySchedules; } -esp_err_t add(cluster_t *cluster) +esp_err_t add(cluster_t *cluster, config_t *config) { VerifyOrReturnError(cluster, ESP_ERR_INVALID_ARG, ESP_LOGE(TAG, "Cluster cannot be NULL")); update_feature_map(cluster, get_id()); /* Attributes not managed internally */ - attribute::create_number_of_holiday_schedules_supported(cluster, 1); + attribute::create_number_of_holiday_schedules_supported(cluster, config->number_of_holiday_schedules_supported); /* Commands */ command::create_set_holiday_schedule(cluster); diff --git a/components/esp_matter/data_model/esp_matter_feature.h b/components/esp_matter/data_model/esp_matter_feature.h index 0de82e0e9..d98a01259 100644 --- a/components/esp_matter/data_model/esp_matter_feature.h +++ b/components/esp_matter/data_model/esp_matter_feature.h @@ -1356,14 +1356,24 @@ esp_err_t add(cluster_t *cluster, config_t *config); namespace year_day_access_schedules { +typedef struct config { + uint8_t number_of_year_day_schedules_supported_per_user; + config() : number_of_year_day_schedules_supported_per_user(1) {} +} config_t; + uint32_t get_id(); -esp_err_t add(cluster_t *cluster); +esp_err_t add(cluster_t *cluster, config_t *config); } /* year_day_access_schedules */ namespace holiday_schedules { +typedef struct config { + uint8_t number_of_holiday_schedules_supported; + config() : number_of_holiday_schedules_supported(1) {} +} config_t; + uint32_t get_id(); -esp_err_t add(cluster_t *cluster); +esp_err_t add(cluster_t *cluster, config_t *config); } /* holiday_schedules */ namespace unbolting {