@@ -3612,6 +3612,45 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_
3612
3612
3613
3613
} /* water_heater_management */
3614
3614
3615
+ namespace water_heater_mode {
3616
+ const function_generic_t *function_list = NULL ;
3617
+ const int function_flags = CLUSTER_FLAG_NONE;
3618
+
3619
+ cluster_t *create (endpoint_t *endpoint, config_t *config, uint8_t flags)
3620
+ {
3621
+ cluster_t *cluster = cluster::create (endpoint, WaterHeaterMode::Id, flags);
3622
+ if (!cluster) {
3623
+ ESP_LOGE (TAG, " Could not create cluster" );
3624
+ return NULL ;
3625
+ }
3626
+
3627
+ if (flags & CLUSTER_FLAG_SERVER) {
3628
+ if (config && config -> delegate != nullptr ) {
3629
+ static const auto delegate_init_cb = WaterHeaterModeDelegateInitCB;
3630
+ set_delegate_and_init_callback (cluster, delegate_init_cb, config->delegate );
3631
+ }
3632
+ add_function_list (cluster, function_list, function_flags);
3633
+
3634
+ /* Attributes managed internally */
3635
+ global::attribute::create_feature_map (cluster, 0 );
3636
+ mode_base::attribute::create_supported_modes (cluster, NULL , 0 , 0 );
3637
+
3638
+ /* Attributes not managed internally */
3639
+ global::attribute::create_cluster_revision (cluster, cluster_revision);
3640
+ if (config) {
3641
+ mode_base::attribute::create_current_mode (cluster, config->current_mode );
3642
+ } else {
3643
+ ESP_LOGE (TAG, " Config is NULL. Cannot add some attributes." );
3644
+ }
3645
+ }
3646
+
3647
+ /* Commands */
3648
+ mode_base::command::create_change_to_mode (cluster);
3649
+
3650
+ return cluster;
3651
+ }
3652
+ } /* water_heater_mode */
3653
+
3615
3654
// namespace binary_input_basic {
3616
3655
// // ToDo
3617
3656
// } /* binary_input_basic */
0 commit comments