@@ -543,29 +543,6 @@ esp_err_t add(cluster_t *cluster, config_t *config)
543543
544544} /* lighting */
545545
546- namespace frequency {
547-
548- uint32_t get_id ()
549- {
550- return (uint32_t )LevelControl::Feature::kFrequency ;
551- }
552-
553- esp_err_t add (cluster_t *cluster, config_t *config)
554- {
555- VerifyOrReturnError (cluster, ESP_ERR_INVALID_ARG, ESP_LOGE (TAG, " Cluster cannot be NULL" ));
556- update_feature_map (cluster, get_id ());
557-
558- /* Attributes not managed internally */
559- attribute::create_current_frequency (cluster, config->current_frequency );
560- attribute::create_min_frequency (cluster, config->min_frequency );
561- attribute::create_max_frequency (cluster, config->max_frequency );
562-
563- /* Commands */
564- command::create_move_to_closest_frequency (cluster);
565-
566- return ESP_OK;
567- }
568- } /* frequency */
569546} /* feature */
570547} /* level_control */
571548
@@ -822,66 +799,6 @@ esp_err_t add(cluster_t *cluster, config_t *config)
822799}
823800} /* position_aware_lift */
824801
825- namespace absolute_position {
826-
827- uint32_t get_id ()
828- {
829- return (uint32_t )WindowCovering::Feature::kAbsolutePosition ;
830- }
831-
832- esp_err_t add (cluster_t *cluster, config_t *config)
833- {
834- VerifyOrReturnError (cluster, ESP_ERR_INVALID_ARG, ESP_LOGE (TAG, " Cluster cannot be NULL" ));
835- update_feature_map (cluster, get_id ());
836-
837- uint32_t abs_and_pa_lf_and_lf_feature_map = get_id () | feature::position_aware_lift::get_id () | feature::lift::get_id ();
838- uint32_t abs_and_pa_tl_and_tl_feature_map = get_id () | feature::position_aware_tilt::get_id () | feature::tilt::get_id ();
839- uint32_t abs_and_lift_feature_map = get_id () | feature::lift::get_id ();
840- uint32_t abs_and_tilt_feature_map = get_id () | feature::tilt::get_id ();
841- if (
842- (get_feature_map_value (cluster) & abs_and_pa_lf_and_lf_feature_map) != abs_and_pa_lf_and_lf_feature_map
843- && (get_feature_map_value (cluster) & abs_and_pa_tl_and_tl_feature_map) != abs_and_pa_tl_and_tl_feature_map
844- && (get_feature_map_value (cluster) & abs_and_lift_feature_map) != abs_and_lift_feature_map
845- && (get_feature_map_value (cluster) & abs_and_tilt_feature_map) != abs_and_tilt_feature_map
846- ) {
847- ESP_LOGE (TAG, " Cluster shall support Lift (and optionally Position_Aware_Lift) and/or Tilt (and optionally Position_Aware_Tilt) features" );
848- return ESP_ERR_NOT_SUPPORTED;
849- }
850- if ((get_feature_map_value (cluster) & abs_and_pa_lf_and_lf_feature_map) == abs_and_pa_lf_and_lf_feature_map) {
851- attribute::create_physical_closed_limit_lift (cluster, config->physical_closed_limit_lift );
852- attribute::create_current_position_lift (cluster, config->current_position_lift );
853- attribute::create_installed_open_limit_lift (cluster, config->installed_open_limit_lift );
854- attribute::create_installed_closed_limit_lift (cluster, config->installed_closed_limit_lift );
855- } else {
856- ESP_LOGW (TAG, " Lift related attributes were not created because cluster does not support Position_Aware_Lift feature" );
857- }
858-
859- if ((get_feature_map_value (cluster) & abs_and_pa_tl_and_tl_feature_map) == abs_and_pa_tl_and_tl_feature_map) {
860- attribute::create_physical_closed_limit_tilt (cluster, config->physical_closed_limit_tilt );
861- attribute::create_current_position_tilt (cluster, config->current_position_tilt );
862- attribute::create_installed_open_limit_tilt (cluster, config->installed_open_limit_tilt );
863- attribute::create_installed_closed_limit_tilt (cluster, config->installed_closed_limit_tilt );
864- } else {
865- ESP_LOGW (TAG, " Tilt related attributes were not created because cluster does not support Position_Aware_Tilt feature" );
866- }
867-
868- if ((get_feature_map_value (cluster) & abs_and_lift_feature_map) == abs_and_lift_feature_map) {
869- command::create_go_to_lift_value (cluster);
870- } else {
871- ESP_LOGW (TAG, " Lift commands were not created because cluster does not support Lift feature" );
872- }
873-
874- if ((get_feature_map_value (cluster) & abs_and_tilt_feature_map) == abs_and_tilt_feature_map) {
875- command::create_go_to_tilt_value (cluster);
876- } else {
877- ESP_LOGW (TAG, " Tilt commands were not created because cluster does not support Tilt feature" );
878- }
879-
880- return ESP_OK;
881- }
882-
883- } /* absolute_position */
884-
885802namespace position_aware_tilt {
886803
887804uint32_t get_id ()
@@ -2634,30 +2551,6 @@ esp_err_t add(cluster_t *cluster, config_t *config)
26342551
26352552} /* rfid_credential */
26362553
2637- namespace finger_credentials {
2638-
2639- uint32_t get_id ()
2640- {
2641- return (uint32_t )DoorLock::Feature::kFingerCredentials ;
2642- }
2643-
2644- esp_err_t add (cluster_t *cluster)
2645- {
2646- VerifyOrReturnError (cluster, ESP_ERR_INVALID_ARG, ESP_LOGE (TAG, " Cluster cannot be NULL" ));
2647- update_feature_map (cluster, get_id ());
2648-
2649- uint32_t usr_feature_map = feature::user::get_id ();
2650- if (!(get_feature_map_value (cluster) & usr_feature_map)) {
2651- /* todo: some commands for !USR & FGP feature not define in the
2652- connectedhomeip/connectedhomeip/zzz_generated/app-common/app-common/zap-generated/ids/Commands.h
2653- will update when added*/
2654- }
2655-
2656- return ESP_OK;
2657- }
2658-
2659- } /* finger_credentials */
2660-
26612554namespace logging {
26622555
26632556uint32_t get_id ()
@@ -2734,23 +2627,6 @@ esp_err_t add(cluster_t *cluster)
27342627
27352628} /* door_position_sensor */
27362629
2737- namespace face_credentials {
2738-
2739- uint32_t get_id ()
2740- {
2741- return (uint32_t )DoorLock::Feature::kFaceCredentials ;
2742- }
2743-
2744- esp_err_t add (cluster_t *cluster)
2745- {
2746- VerifyOrReturnError (cluster, ESP_ERR_INVALID_ARG, ESP_LOGE (TAG, " Cluster cannot be NULL" ));
2747- update_feature_map (cluster, get_id ());
2748-
2749- return ESP_OK;
2750- }
2751-
2752- } /* face_credentials */
2753-
27542630namespace credential_over_the_air_access {
27552631
27562632uint32_t get_id ()
@@ -2786,10 +2662,8 @@ esp_err_t add(cluster_t *cluster, config_t *config)
27862662 VerifyOrReturnError (cluster, ESP_ERR_INVALID_ARG, ESP_LOGE (TAG, " Cluster cannot be NULL" ));
27872663 uint32_t pin = feature::pin_credential::get_id ();
27882664 uint32_t rid = feature::rfid_credential::get_id ();
2789- uint32_t fgp = feature::finger_credentials::get_id ();
2790- uint32_t face = feature::face_credentials::get_id ();
27912665 uint32_t feature = get_feature_map_value (cluster);
2792- VerifyOrReturnError ((feature & (pin | rid | fgp | face )) != 0 , ESP_FAIL, ESP_LOGE (TAG, " Should add at least one of PIN, RID, FGP and FACE feature before add USR feature" ));
2666+ VerifyOrReturnError ((feature & (pin | rid)) != 0 , ESP_FAIL, ESP_LOGE (TAG, " Should add at least one of PIN, RID feature before add USR feature" ));
27932667
27942668 update_feature_map (cluster, get_id ());
27952669
@@ -2995,46 +2869,6 @@ esp_err_t add(cluster_t *cluster)
29952869
29962870} /* charging_preferences */
29972871
2998- namespace soc_reporting {
2999-
3000- uint32_t get_id ()
3001- {
3002- return (uint32_t )EnergyEvse::Feature::kSoCReporting ;
3003- }
3004-
3005- esp_err_t add (cluster_t *cluster)
3006- {
3007- VerifyOrReturnError (cluster, ESP_ERR_INVALID_ARG, ESP_LOGE (TAG, " Cluster cannot be NULL" ));
3008- update_feature_map (cluster, get_id ());
3009-
3010- /* Attributes managed internally */
3011- attribute::create_state_of_charge (cluster, 0 );
3012- attribute::create_battery_capacity (cluster, 0 );
3013-
3014- return ESP_OK;
3015- }
3016-
3017- } /* soc_reporting */
3018-
3019- namespace plug_and_charge {
3020-
3021- uint32_t get_id ()
3022- {
3023- return (uint32_t )EnergyEvse::Feature::kPlugAndCharge ;
3024- }
3025-
3026- esp_err_t add (cluster_t *cluster)
3027- {
3028- VerifyOrReturnError (cluster, ESP_ERR_INVALID_ARG, ESP_LOGE (TAG, " Cluster cannot be NULL" ));
3029- update_feature_map (cluster, get_id ());
3030-
3031- /* Attributes managed internally */
3032- attribute::create_vehicle_id (cluster, NULL , 0 );
3033-
3034- return ESP_OK;
3035- }
3036-
3037- } /* plug_and_charge */
30382872
30392873namespace rfid {
30402874
@@ -3053,30 +2887,6 @@ esp_err_t add(cluster_t *cluster)
30532887
30542888} /* rfid */
30552889
3056- namespace v2x {
3057-
3058- uint32_t get_id ()
3059- {
3060- return (uint32_t )EnergyEvse::Feature::kV2x ;
3061- }
3062-
3063- esp_err_t add (cluster_t *cluster)
3064- {
3065- VerifyOrReturnError (cluster, ESP_ERR_INVALID_ARG, ESP_LOGE (TAG, " Cluster cannot be NULL" ));
3066- update_feature_map (cluster, get_id ());
3067-
3068- /* Attributes managed internally */
3069- attribute::create_discharging_enabled_until (cluster, 0 );
3070- attribute::create_maximum_discharge_current (cluster, 0 );
3071- attribute::create_session_energy_discharged (cluster, 0 );
3072-
3073- /* Commands */
3074- command::create_enable_discharging (cluster);
3075- return ESP_OK;
3076- }
3077-
3078- } /* v2x*/
3079-
30802890} /* feature */
30812891} /* energy_evse */
30822892
@@ -3093,45 +2903,14 @@ uint32_t get_id()
30932903esp_err_t add (cluster_t *cluster)
30942904{
30952905 VerifyOrReturnError (cluster, ESP_ERR_INVALID_ARG, ESP_LOGE (TAG, " Cluster cannot be NULL" ));
3096- uint32_t power_in_watts_feature_map = feature::power_in_watts::get_id ();
3097- if ((get_feature_map_value (cluster) & power_in_watts_feature_map) != power_in_watts_feature_map) {
3098- update_feature_map (cluster, get_id ());
3099- /* Attributes managed internally */
3100- attribute::create_power_setting (cluster, 0 );
3101- } else {
3102- ESP_LOGE (TAG, " Cluster shall support either PowerAsNumber or PowerInWatts feature" );
3103- return ESP_ERR_NOT_SUPPORTED;
3104- }
2906+ update_feature_map (cluster, get_id ());
2907+ /* Attributes managed internally */
2908+ attribute::create_power_setting (cluster, 0 );
31052909
31062910 return ESP_OK;
31072911}
31082912} /* power_as_number */
31092913
3110- namespace power_in_watts {
3111-
3112- uint32_t get_id ()
3113- {
3114- return (uint32_t )MicrowaveOvenControl::Feature::kPowerInWatts ;
3115- }
3116-
3117- esp_err_t add (cluster_t *cluster)
3118- {
3119- VerifyOrReturnError (cluster, ESP_ERR_INVALID_ARG, ESP_LOGE (TAG, " Cluster cannot be NULL" ));
3120- uint32_t power_as_number_feature_map = feature::power_as_number::get_id ();
3121- if ((get_feature_map_value (cluster) & power_as_number_feature_map) != power_as_number_feature_map) {
3122- update_feature_map (cluster, get_id ());
3123- /* Attributes managed internally */
3124- attribute::create_supported_watts (cluster, NULL , 0 , 0 );
3125- attribute::create_selected_watt_index (cluster, 0 );
3126- } else {
3127- ESP_LOGE (TAG, " Cluster shall support either PowerInWatts or PowerAsNumber feature" );
3128- return ESP_ERR_NOT_SUPPORTED;
3129- }
3130-
3131- return ESP_OK;
3132- }
3133- } /* power_in_watts */
3134-
31352914namespace power_number_limits {
31362915
31372916uint32_t get_id ()
0 commit comments