Skip to content

Commit 58a1199

Browse files
committed
Merge branch 'fix/remove-optional-attributes' into 'main'
Remove optional attributes from feature::add method See merge request app-frameworks/esp-matter!1265
2 parents de28147 + b9f8f1d commit 58a1199

File tree

6 files changed

+20
-51
lines changed

6 files changed

+20
-51
lines changed

RELEASE_NOTES.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
## 31-Oct-2025
2+
### API Changes: `feature::add()` Function
3+
The following APIs have been updated — the config parameter has been removed, as the corresponding attributes are optional.
4+
```
5+
window_covering::feature::lift::add(cluster_t *cluster);
6+
window_covering::feature::tilt::add(cluster_t *cluster);
7+
```
8+
19
## 21-Oct-2025
210
### API Changes: `feature::add()` Function
311
The following APIs have been updated — the config parameter has been removed, as the corresponding attributes are internally managed and not user-configurable:

components/esp_matter/data_model/esp_matter_cluster.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2052,14 +2052,14 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
20522052
feature::lift::get_id(), feature::tilt::get_id());
20532053

20542054
if (has(feature::lift::get_id())) {
2055-
feature::lift::add(cluster, &(config->features.lift));
2055+
feature::lift::add(cluster);
20562056
// optional if lift is supported
20572057
if (has(feature::position_aware_lift::get_id())) {
20582058
feature::position_aware_lift::add(cluster, &(config->features.position_aware_lift));
20592059
}
20602060
}
20612061
if (has(feature::tilt::get_id())) {
2062-
feature::tilt::add(cluster, &(config->features.tilt));
2062+
feature::tilt::add(cluster);
20632063
// optional if tilt is supported
20642064
if (has(feature::position_aware_tilt::get_id())) {
20652065
feature::position_aware_tilt::add(cluster, &(config->features.position_aware_tilt));

components/esp_matter/data_model/esp_matter_cluster.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -537,8 +537,6 @@ typedef struct config {
537537
const uint8_t end_product_type;
538538
uint8_t mode;
539539
struct {
540-
feature::lift::config_t lift;
541-
feature::tilt::config_t tilt;
542540
feature::position_aware_lift::config_t position_aware_lift;
543541
feature::absolute_position::config_t absolute_position;
544542
feature::position_aware_tilt::config_t position_aware_tilt;

components/esp_matter/data_model/esp_matter_feature.cpp

Lines changed: 4 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -535,8 +535,6 @@ esp_err_t add(cluster_t *cluster, config_t *config)
535535

536536
/* Attributes not managed internally */
537537
attribute::create_remaining_time(cluster, config->remaining_time);
538-
attribute::create_min_level(cluster, config->min_level);
539-
attribute::create_max_level(cluster, config->max_level);
540538
attribute::create_start_up_current_level(cluster, config->start_up_current_level);
541539

542540
return ESP_OK;
@@ -755,13 +753,11 @@ uint32_t get_id()
755753
return (uint32_t)WindowCovering::Feature::kLift;
756754
}
757755

758-
esp_err_t add(cluster_t *cluster, config_t *config)
756+
esp_err_t add(cluster_t *cluster)
759757
{
760758
VerifyOrReturnError(cluster, ESP_ERR_INVALID_ARG, ESP_LOGE(TAG, "Cluster cannot be NULL"));
761759
update_feature_map(cluster, get_id());
762760

763-
attribute::create_number_of_actuations_lift(cluster, config->number_of_actuations_lift);
764-
765761
return ESP_OK;
766762
}
767763

@@ -774,13 +770,11 @@ uint32_t get_id()
774770
return (uint32_t)WindowCovering::Feature::kTilt;
775771
}
776772

777-
esp_err_t add(cluster_t *cluster, config_t *config)
773+
esp_err_t add(cluster_t *cluster)
778774
{
779775
VerifyOrReturnError(cluster, ESP_ERR_INVALID_ARG, ESP_LOGE(TAG, "Cluster cannot be NULL"));
780776
update_feature_map(cluster, get_id());
781777

782-
attribute::create_number_of_actuations_tilt(cluster, config->number_of_actuations_tilt);
783-
784778
return ESP_OK;
785779
}
786780

@@ -798,10 +792,8 @@ esp_err_t add(cluster_t *cluster, config_t *config)
798792
VerifyOrReturnError(cluster, ESP_ERR_INVALID_ARG, ESP_LOGE(TAG, "Cluster cannot be NULL"));
799793
uint32_t lift_feature_map = feature::lift::get_id();
800794
if ((get_feature_map_value(cluster) & lift_feature_map) == lift_feature_map) {
801-
802795
update_feature_map(cluster, get_id());
803796

804-
attribute::create_current_position_lift_percentage(cluster, config->current_position_lift_percentage);
805797
attribute::create_target_position_lift_percent_100ths(cluster, config->target_position_lift_percent_100ths);
806798
attribute::create_current_position_lift_percent_100ths(cluster, config->current_position_lift_percent_100ths);
807799

@@ -849,17 +841,13 @@ esp_err_t add(cluster_t *cluster, config_t *config)
849841
return ESP_ERR_NOT_SUPPORTED;
850842
}
851843
if ((get_feature_map_value(cluster) & abs_and_pa_lf_and_lf_feature_map) == abs_and_pa_lf_and_lf_feature_map) {
852-
attribute::create_physical_closed_limit_lift(cluster, config->physical_closed_limit_lift);
853-
attribute::create_current_position_lift(cluster, config->current_position_lift);
854844
attribute::create_installed_open_limit_lift(cluster, config->installed_open_limit_lift);
855845
attribute::create_installed_closed_limit_lift(cluster, config->installed_closed_limit_lift);
856846
} else {
857847
ESP_LOGW(TAG, "Lift related attributes were not created because cluster does not support Position_Aware_Lift feature");
858848
}
859849

860850
if ((get_feature_map_value(cluster) & abs_and_pa_tl_and_tl_feature_map) == abs_and_pa_tl_and_tl_feature_map) {
861-
attribute::create_physical_closed_limit_tilt(cluster, config->physical_closed_limit_tilt);
862-
attribute::create_current_position_tilt(cluster, config->current_position_tilt);
863851
attribute::create_installed_open_limit_tilt(cluster, config->installed_open_limit_tilt);
864852
attribute::create_installed_closed_limit_tilt(cluster, config->installed_closed_limit_tilt);
865853
} else {
@@ -898,7 +886,6 @@ esp_err_t add(cluster_t *cluster, config_t *config)
898886

899887
update_feature_map(cluster, get_id());
900888

901-
attribute::create_current_position_tilt_percentage(cluster, config->current_position_tilt_percentage);
902889
attribute::create_target_position_tilt_percent_100ths(cluster, config->target_position_tilt_percent_100ths);
903890
attribute::create_current_position_tilt_percent_100ths(cluster, config->current_position_tilt_percent_100ths);
904891

@@ -1391,6 +1378,7 @@ esp_err_t add(cluster_t *cluster, config_t *config)
13911378

13921379
update_feature_map(cluster, get_id());
13931380

1381+
attribute::create_spin_speeds(cluster, NULL, 0, 0);
13941382
attribute::create_spin_speed_current(cluster, config->spin_speed_current);
13951383

13961384
return ESP_OK;
@@ -1412,6 +1400,7 @@ esp_err_t add(cluster_t *cluster, config_t *config)
14121400
update_feature_map(cluster, get_id());
14131401

14141402
attribute::create_number_of_rinses(cluster, config->number_of_rinses);
1403+
attribute::create_supported_rinses(cluster, NULL, 0, 0);
14151404

14161405
return ESP_OK;
14171406
}
@@ -1437,8 +1426,6 @@ esp_err_t add(cluster_t *cluster)
14371426
update_feature_map(cluster, get_id());
14381427

14391428
attribute::create_smoke_state(cluster, 0);
1440-
attribute::create_contamination_state(cluster, 0);
1441-
attribute::create_smoke_sensitivity_level(cluster, 0);
14421429

14431430
event::create_smoke_alarm(cluster);
14441431
event::create_interconnect_smoke_alarm(cluster);
@@ -2723,9 +2710,6 @@ esp_err_t add(cluster_t *cluster)
27232710

27242711
/* Attributes not managed internally */
27252712
attribute::create_door_state(cluster, 0);
2726-
attribute::create_door_open_events(cluster, 0);
2727-
attribute::create_door_close_events(cluster, 0);
2728-
attribute::create_open_period(cluster, 0);
27292713

27302714
/* events */
27312715
event::create_door_state_change(cluster);
@@ -2798,7 +2782,6 @@ esp_err_t add(cluster_t *cluster, config_t *config)
27982782
attribute::create_number_of_total_users_supported(cluster, config->number_of_total_user_supported);
27992783
attribute::create_credential_rules_support(cluster, config->credential_rules_supported);
28002784
attribute::create_number_of_credentials_supported_per_user(cluster, config->number_of_credentials_supported_per_user);
2801-
attribute::create_expiring_user_timeout(cluster, config->expiring_user_timeout);
28022785

28032786
/* Commands */
28042787
command::create_set_user(cluster);

components/esp_matter/data_model/esp_matter_feature.h

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,6 @@ esp_err_t add(cluster_t *cluster);
172172
namespace icd_management {
173173
namespace feature {
174174
namespace check_in_protocol_support {
175-
176175
uint32_t get_id();
177176
esp_err_t add(cluster_t *cluster);
178177

@@ -360,25 +359,15 @@ namespace feature {
360359

361360
namespace lift {
362361

363-
typedef struct config {
364-
uint16_t number_of_actuations_lift;
365-
config() : number_of_actuations_lift(0) {}
366-
} config_t;
367-
368362
uint32_t get_id();
369-
esp_err_t add(cluster_t *cluster, config_t *config);
363+
esp_err_t add(cluster_t *cluster);
370364

371365
} /* lift */
372366

373367
namespace tilt {
374368

375-
typedef struct config {
376-
uint16_t number_of_actuations_tilt;
377-
config() : number_of_actuations_tilt(0) {}
378-
} config_t;
379-
380369
uint32_t get_id();
381-
esp_err_t add(cluster_t *cluster, config_t *config);
370+
esp_err_t add(cluster_t *cluster);
382371

383372
} /* tilt */
384373

@@ -388,10 +377,9 @@ esp_err_t add(cluster_t *cluster, config_t *config);
388377
namespace position_aware_lift {
389378

390379
typedef struct config {
391-
nullable<uint8_t> current_position_lift_percentage;
392380
nullable<uint16_t> target_position_lift_percent_100ths;
393381
nullable<uint16_t> current_position_lift_percent_100ths;
394-
config() : current_position_lift_percentage(), target_position_lift_percent_100ths(), current_position_lift_percent_100ths() {}
382+
config() : target_position_lift_percent_100ths(), current_position_lift_percent_100ths() {}
395383
} config_t;
396384

397385
uint32_t get_id();
@@ -405,15 +393,11 @@ esp_err_t add(cluster_t *cluster, config_t *config);
405393
namespace absolute_position {
406394

407395
typedef struct config {
408-
uint16_t physical_closed_limit_lift;
409-
nullable<uint16_t> current_position_lift;
410396
uint16_t installed_open_limit_lift;
411397
uint16_t installed_closed_limit_lift;
412-
uint16_t physical_closed_limit_tilt;
413-
nullable<uint16_t> current_position_tilt;
414398
uint16_t installed_open_limit_tilt;
415399
uint16_t installed_closed_limit_tilt;
416-
config() : physical_closed_limit_lift(0), current_position_lift(), installed_open_limit_lift(0), installed_closed_limit_lift(65534), physical_closed_limit_tilt(0), current_position_tilt(), installed_open_limit_tilt(0), installed_closed_limit_tilt(65534) {}
400+
config() : installed_open_limit_lift(0), installed_closed_limit_lift(65534), installed_open_limit_tilt(0), installed_closed_limit_tilt(65534) {}
417401
} config_t;
418402

419403
uint32_t get_id();
@@ -427,10 +411,9 @@ esp_err_t add(cluster_t *cluster, config_t *config);
427411
namespace position_aware_tilt {
428412

429413
typedef struct config {
430-
nullable<uint8_t> current_position_tilt_percentage;
431414
nullable<uint16_t> target_position_tilt_percent_100ths;
432415
nullable<uint16_t> current_position_tilt_percent_100ths;
433-
config() : current_position_tilt_percentage(), target_position_tilt_percent_100ths(), current_position_tilt_percent_100ths() {}
416+
config() : target_position_tilt_percent_100ths(), current_position_tilt_percent_100ths() {}
434417
} config_t;
435418

436419
uint32_t get_id();
@@ -1344,10 +1327,9 @@ esp_err_t add(cluster_t *cluster, config_t *config);
13441327
namespace user {
13451328
typedef struct config {
13461329
uint16_t number_of_total_user_supported;
1347-
uint16_t expiring_user_timeout;
13481330
uint8_t credential_rules_supported;
13491331
uint8_t number_of_credentials_supported_per_user;
1350-
config() : number_of_total_user_supported(5), expiring_user_timeout(5), credential_rules_supported(0), number_of_credentials_supported_per_user(3) {}
1332+
config() : number_of_total_user_supported(5), credential_rules_supported(0), number_of_credentials_supported_per_user(3) {}
13511333
} config_t;
13521334

13531335
uint32_t get_id();

examples/all_device_types_app/main/esp_matter_console_helpers.cpp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -293,9 +293,7 @@ int create(uint8_t device_type_index)
293293
cluster::window_covering::feature::position_aware_lift::config_t position_aware_lift;
294294
cluster::window_covering::feature::absolute_position::config_t absolute_position;
295295

296-
nullable<uint8_t> percentage = nullable<uint8_t>(0);
297296
nullable<uint16_t> percentage_100ths = nullable<uint16_t>(0);
298-
position_aware_lift.current_position_lift_percentage = percentage;
299297
position_aware_lift.target_position_lift_percent_100ths = percentage_100ths;
300298
position_aware_lift.current_position_lift_percent_100ths = percentage_100ths;
301299

0 commit comments

Comments
 (0)