From 1399506a62ef41ef3029c0c498093079a6449892 Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Wed, 1 Mar 2023 15:12:19 +0100 Subject: [PATCH] Remove LevelControlFeature from the allow list of defines (#25369) * Remove LevelControlFeature from the allow list of defines * Update generated code --- src/app/clusters/level-control/level-control.cpp | 4 +--- src/app/common/templates/config-data.yaml | 1 - zzz_generated/app-common/app-common/zap-generated/enums.h | 6 ------ 3 files changed, 1 insertion(+), 10 deletions(-) diff --git a/src/app/clusters/level-control/level-control.cpp b/src/app/clusters/level-control/level-control.cpp index 8ad6844775226a..77242ea554f39d 100644 --- a/src/app/clusters/level-control/level-control.cpp +++ b/src/app/clusters/level-control/level-control.cpp @@ -1223,9 +1223,7 @@ void emberAfLevelControlClusterServerInitCallback(EndpointId endpoint) Attributes::MinLevel::Get(endpoint, &state->minLevel); Attributes::MaxLevel::Get(endpoint, &state->maxLevel); - uint32_t featureMap; - if (Attributes::FeatureMap::Get(endpoint, &featureMap) == EMBER_ZCL_STATUS_SUCCESS && - READBITS(featureMap, EMBER_AF_LEVEL_CONTROL_FEATURE_LIGHTING)) + if (LevelControlHasFeature(endpoint, LevelControlFeature::kLighting)) { if (state->minLevel < LEVEL_CONTROL_LIGHTING_MIN_LEVEL) { diff --git a/src/app/common/templates/config-data.yaml b/src/app/common/templates/config-data.yaml index 59c94bb62c1eee..c30b43d7267ed2 100644 --- a/src/app/common/templates/config-data.yaml +++ b/src/app/common/templates/config-data.yaml @@ -31,7 +31,6 @@ DefineBitmaps: - BarrierControlCapabilities - BarrierControlSafetyStatus - ColorLoopUpdateFlags - - LevelControlFeature # We need a more configurable way of deciding which clusters have which init functions.... # See https://github.com/project-chip/connectedhomeip/issues/4369 diff --git a/zzz_generated/app-common/app-common/zap-generated/enums.h b/zzz_generated/app-common/app-common/zap-generated/enums.h index db52df2fdd3394..97e4e536571461 100644 --- a/zzz_generated/app-common/app-common/zap-generated/enums.h +++ b/zzz_generated/app-common/app-common/zap-generated/enums.h @@ -251,9 +251,3 @@ enum EmberAfStepMode : uint8_t #define EMBER_AF_COLOR_LOOP_UPDATE_FLAGS_UPDATE_TIME_OFFSET (2) #define EMBER_AF_COLOR_LOOP_UPDATE_FLAGS_UPDATE_START_HUE (8) #define EMBER_AF_COLOR_LOOP_UPDATE_FLAGS_UPDATE_START_HUE_OFFSET (3) -#define EMBER_AF_LEVEL_CONTROL_FEATURE_ON_OFF (1) -#define EMBER_AF_LEVEL_CONTROL_FEATURE_ON_OFF_OFFSET (0) -#define EMBER_AF_LEVEL_CONTROL_FEATURE_LIGHTING (2) -#define EMBER_AF_LEVEL_CONTROL_FEATURE_LIGHTING_OFFSET (1) -#define EMBER_AF_LEVEL_CONTROL_FEATURE_FREQUENCY (4) -#define EMBER_AF_LEVEL_CONTROL_FEATURE_FREQUENCY_OFFSET (2)