@@ -3568,6 +3568,50 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_
3568
3568
}
3569
3569
} /* service_area */
3570
3570
3571
+ namespace water_heater_management {
3572
+ const function_generic_t *function_list = NULL ;
3573
+ const int function_flags = CLUSTER_FLAG_NONE;
3574
+
3575
+ cluster_t *create (endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_t features)
3576
+ {
3577
+ cluster_t *cluster = cluster::create (endpoint, WaterHeaterManagement::Id, flags);
3578
+ if (!cluster) {
3579
+ ESP_LOGE (TAG, " Could not create cluster" );
3580
+ return NULL ;
3581
+ }
3582
+ if (flags & CLUSTER_FLAG_SERVER) {
3583
+ if (config -> delegate != nullptr ) {
3584
+ static const auto delegate_init_cb = WaterHeaterManagementDelegateInitCB;
3585
+ set_delegate_and_init_callback (cluster, delegate_init_cb, config->delegate );
3586
+ }
3587
+ static const auto plugin_server_init_cb = CALL_ONCE (MatterWaterHeaterManagementPluginServerInitCallback);
3588
+ set_plugin_server_init_callback (cluster, plugin_server_init_cb);
3589
+ add_function_list (cluster, function_list, function_flags);
3590
+
3591
+ /* Attributes managed internally */
3592
+ global::attribute::create_feature_map (cluster, 0 );
3593
+
3594
+ /* * Attributes not managed internally **/
3595
+ global::attribute::create_cluster_revision (cluster, cluster_revision);
3596
+ attribute::create_heater_types (cluster, config->heater_types );
3597
+ attribute::create_heat_demand (cluster, config->heat_demand );
3598
+ attribute::create_tank_volume (cluster, config->tank_volume );
3599
+ }
3600
+
3601
+ if (features & feature::energy_management::get_id ()) {
3602
+ feature::energy_management::add (cluster, &(config->energy_management ));
3603
+ }
3604
+ if (features & feature::tank_percent::get_id ()) {
3605
+ feature::tank_percent::add (cluster, &(config->tank_percent ));
3606
+ }
3607
+
3608
+ event::create_boost_started (cluster);
3609
+ event::create_boost_ended (cluster);
3610
+ return cluster;
3611
+ }
3612
+
3613
+ } /* water_heater_management */
3614
+
3571
3615
// namespace binary_input_basic {
3572
3616
// // ToDo
3573
3617
// } /* binary_input_basic */
0 commit comments