@@ -3651,6 +3651,49 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
3651
3651
}
3652
3652
} /* water_heater_mode */
3653
3653
3654
+ namespace energy_preference {
3655
+ const function_generic_t *function_list = NULL ;
3656
+ const int function_flags = CLUSTER_FLAG_NONE;
3657
+
3658
+ cluster_t *create (endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_t features)
3659
+ {
3660
+ cluster_t *cluster = cluster::create (endpoint, EnergyPreference::Id, flags);
3661
+ if (!cluster) {
3662
+ ESP_LOGE (TAG, " Could not create cluster" );
3663
+ return NULL ;
3664
+ }
3665
+ if (flags & CLUSTER_FLAG_SERVER) {
3666
+ if (config -> delegate != nullptr ) {
3667
+ static const auto delegate_init_cb = EnergyPreferenceDelegateInitCB;
3668
+ set_delegate_and_init_callback (cluster, delegate_init_cb, config->delegate );
3669
+ }
3670
+ static const auto plugin_server_init_cb = CALL_ONCE (MatterEnergyPreferencePluginServerInitCallback);
3671
+ set_plugin_server_init_callback (cluster, plugin_server_init_cb);
3672
+ add_function_list (cluster, function_list, function_flags);
3673
+
3674
+ /* Attributes managed internally */
3675
+ global::attribute::create_feature_map (cluster, 0 );
3676
+
3677
+ /* * Attributes not managed internally **/
3678
+ global::attribute::create_cluster_revision (cluster, cluster_revision);
3679
+ }
3680
+
3681
+ if (flags & CLUSTER_FLAG_CLIENT) {
3682
+ create_default_binding_cluster (endpoint);
3683
+ }
3684
+
3685
+ /* Features */
3686
+ if (features & feature::energy_balance::get_id ()) {
3687
+ feature::energy_balance::add (cluster, &(config->energy_balance ));
3688
+ }
3689
+ if (features & feature::low_power_mode_sensitivity::get_id ()) {
3690
+ feature::low_power_mode_sensitivity::add (cluster, &(config->low_power_mode_sensitivity ));
3691
+ }
3692
+
3693
+ return cluster;
3694
+ }
3695
+ } /* energy_preference */
3696
+
3654
3697
// namespace binary_input_basic {
3655
3698
// // ToDo
3656
3699
// } /* binary_input_basic */
0 commit comments