@@ -2023,6 +2023,25 @@ const function_generic_t function_list[] = {
2023
2023
};
2024
2024
const int function_flags = CLUSTER_FLAG_INIT_FUNCTION;
2025
2025
2026
+ static bool check_feature_map (uint32_t features) {
2027
+ if ((features & feature::other::get_id ()) == feature::other::get_id ())
2028
+ return true ;
2029
+ if ((features & feature::passive_infrared::get_id ()) == feature::passive_infrared::get_id ())
2030
+ return true ;
2031
+ if ((features & feature::ultrasonic::get_id ()) == feature::ultrasonic::get_id ())
2032
+ return true ;
2033
+ if ((features & feature::physical_contact::get_id ()) == feature::physical_contact::get_id ())
2034
+ return true ;
2035
+ if ((features & feature::active_infrared::get_id ()) == feature::active_infrared::get_id ())
2036
+ return true ;
2037
+ if ((features & feature::radar::get_id ()) == feature::radar::get_id ())
2038
+ return true ;
2039
+ if ((features & feature::rf_sensing::get_id ()) == feature::rf_sensing::get_id ())
2040
+ return true ;
2041
+ if ((features & feature::vision::get_id ()) == feature::vision::get_id ())
2042
+ return true ;
2043
+ return false ;
2044
+ }
2026
2045
cluster_t *create (endpoint_t *endpoint, config_t *config, uint8_t flags)
2027
2046
{
2028
2047
cluster_t *cluster = cluster::create (endpoint, OccupancySensing::Id, flags);
@@ -2051,6 +2070,34 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
2051
2070
create_default_binding_cluster (endpoint);
2052
2071
}
2053
2072
2073
+ if (config != nullptr && check_feature_map (config->features )) {
2074
+ if (config->features & feature::other::get_id ()) {
2075
+ feature::other::add (cluster);
2076
+ }
2077
+ if (config->features & feature::passive_infrared::get_id ()) {
2078
+ feature::passive_infrared::add (cluster);
2079
+ }
2080
+ if (config->features & feature::ultrasonic::get_id ()) {
2081
+ feature::ultrasonic::add (cluster);
2082
+ }
2083
+ if (config->features & feature::physical_contact::get_id ()) {
2084
+ feature::physical_contact::add (cluster);
2085
+ }
2086
+ if (config->features & feature::active_infrared::get_id ()) {
2087
+ feature::active_infrared::add (cluster);
2088
+ }
2089
+ if (config->features & feature::radar::get_id ()) {
2090
+ feature::radar::add (cluster);
2091
+ }
2092
+ if (config->features & feature::rf_sensing::get_id ()) {
2093
+ feature::rf_sensing::add (cluster);
2094
+ }
2095
+ if (config->features & feature::vision::get_id ()) {
2096
+ feature::vision::add (cluster);
2097
+ }
2098
+ } else {
2099
+ ESP_LOGE (TAG, " Config is NULL or mandatory features are missing." );
2100
+ }
2054
2101
return cluster;
2055
2102
}
2056
2103
} /* occupancy_sensing */
@@ -2326,6 +2373,20 @@ const function_generic_t function_list[] = {
2326
2373
const int function_flags =
2327
2374
CLUSTER_FLAG_INIT_FUNCTION | CLUSTER_FLAG_ATTRIBUTE_CHANGED_FUNCTION | CLUSTER_FLAG_PRE_ATTRIBUTE_CHANGED_FUNCTION;
2328
2375
2376
+ static bool check_feature_map (uint32_t features) {
2377
+ if ((features & feature::constant_pressure::get_id ()) == feature::constant_pressure::get_id ())
2378
+ return true ;
2379
+ if ((features & feature::compensated_pressure::get_id ()) == feature::compensated_pressure::get_id ())
2380
+ return true ;
2381
+ if ((features & feature::constant_flow::get_id ()) == feature::constant_flow::get_id ())
2382
+ return true ;
2383
+ if ((features & feature::constant_speed::get_id ()) == feature::constant_speed::get_id ())
2384
+ return true ;
2385
+ if ((features & feature::constant_temperature::get_id ()) == feature::constant_temperature::get_id ())
2386
+ return true ;
2387
+ return false ;
2388
+ }
2389
+
2329
2390
cluster_t *create (endpoint_t *endpoint, config_t *config, uint8_t flags)
2330
2391
{
2331
2392
cluster_t *cluster = cluster::create (endpoint, PumpConfigurationAndControl::Id, flags);
@@ -2357,6 +2418,31 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
2357
2418
create_default_binding_cluster (endpoint);
2358
2419
}
2359
2420
2421
+ if (config != nullptr && check_feature_map (config->features )) {
2422
+ if (config->features & feature::constant_pressure::get_id ()) {
2423
+ feature::constant_pressure::add (cluster, &config->constant_pressure );
2424
+ }
2425
+ if (config->features & feature::compensated_pressure::get_id ()) {
2426
+ feature::compensated_pressure::add (cluster, &config->compensated_pressure );
2427
+ }
2428
+ if (config->features & feature::constant_flow::get_id ()) {
2429
+ feature::constant_flow::add (cluster, &config->constant_flow );
2430
+ }
2431
+ if (config->features & feature::constant_speed::get_id ()) {
2432
+ feature::constant_speed::add (cluster, &config->constant_speed );
2433
+ }
2434
+ if (config->features & feature::constant_temperature::get_id ()) {
2435
+ feature::constant_temperature::add (cluster, &config->constant_temperature );
2436
+ }
2437
+ if (config->features & feature::automatic::get_id ()) {
2438
+ feature::automatic::add (cluster);
2439
+ }
2440
+ if (config->features & feature::local_operation::get_id ()) {
2441
+ feature::local_operation::add (cluster);
2442
+ }
2443
+ } else {
2444
+ ESP_LOGE (TAG, " Config is NULL or mandatory features are missing." );
2445
+ }
2360
2446
return cluster;
2361
2447
}
2362
2448
} /* pump_configuration_and_control */
@@ -2563,6 +2649,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
2563
2649
2564
2650
/* Commands */
2565
2651
mode_base::command::create_change_to_mode (cluster);
2652
+ mode_base::command::create_change_to_mode_response (cluster);
2566
2653
2567
2654
return cluster;
2568
2655
}
@@ -2600,6 +2687,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
2600
2687
2601
2688
/* Commands */
2602
2689
mode_base::command::create_change_to_mode (cluster);
2690
+ mode_base::command::create_change_to_mode_response (cluster);
2603
2691
2604
2692
return cluster;
2605
2693
}
@@ -2636,6 +2724,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
2636
2724
2637
2725
/* Commands */
2638
2726
mode_base::command::create_change_to_mode (cluster);
2727
+ mode_base::command::create_change_to_mode_response (cluster);
2639
2728
2640
2729
return cluster;
2641
2730
}
@@ -2728,6 +2817,12 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
2728
2817
/* Attributes managed internally */
2729
2818
global::attribute::create_feature_map (cluster, 0 );
2730
2819
2820
+ operational_state::attribute::create_phase_list (cluster, NULL , 0 , 0 );
2821
+ operational_state::attribute::create_current_phase (cluster, 0 );
2822
+ operational_state::attribute::create_operational_state_list (cluster, NULL , 0 , 0 );
2823
+ operational_state::attribute::create_operational_state (cluster, 0 );
2824
+ operational_state::attribute::create_operational_error (cluster, 0 );
2825
+
2731
2826
/* Attributes not managed internally */
2732
2827
global::attribute::create_cluster_revision (cluster, cluster_revision);
2733
2828
}
@@ -2949,6 +3044,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
2949
3044
2950
3045
/* Commands */
2951
3046
mode_base::command::create_change_to_mode (cluster);
3047
+ mode_base::command::create_change_to_mode_response (cluster);
2952
3048
2953
3049
return cluster;
2954
3050
}
@@ -3152,6 +3248,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
3152
3248
}
3153
3249
3154
3250
/* Commands */
3251
+ mode_base::command::create_change_to_mode_response (cluster);
3155
3252
mode_base::command::create_change_to_mode (cluster);
3156
3253
3157
3254
return cluster;
@@ -3365,7 +3462,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags, uint32_
3365
3462
global::attribute::create_cluster_revision (cluster, cluster_revision);
3366
3463
attribute::create_heater_types (cluster, config->heater_types );
3367
3464
attribute::create_heat_demand (cluster, config->heat_demand );
3368
- attribute::create_tank_volume (cluster, config->tank_volume );
3465
+ attribute::create_boost_state (cluster, config->boost_state );
3369
3466
}
3370
3467
3371
3468
if (features & feature::energy_management::get_id ()) {
@@ -3416,6 +3513,7 @@ cluster_t *create(endpoint_t *endpoint, config_t *config, uint8_t flags)
3416
3513
3417
3514
/* Commands */
3418
3515
mode_base::command::create_change_to_mode (cluster);
3516
+ mode_base::command::create_change_to_mode_response (cluster);
3419
3517
3420
3518
return cluster;
3421
3519
}
0 commit comments