From 11495781f232621890333ab2fee7d5fb7a5ec7ba Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 5 Jan 2023 07:26:37 -0500 Subject: [PATCH] Move weakly typed enum list back into Matter repository. (#24270) Instead of hardcoding this list in the helper (in the ZAP repository), it should be data in the Matter repository. Then we can remove things from the list without having to synchronize with ZAP changes. This change on its own does not make ZAP use this YAML instead of the hardcoded list; that will need to be a separate ZAP change after this merges. --- src/app/common/templates/templates.json | 3 ++ src/app/common/templates/weak-enum-list.yaml | 39 ++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/app/common/templates/weak-enum-list.yaml diff --git a/src/app/common/templates/templates.json b/src/app/common/templates/templates.json index 03327d0469b013..400511cce6ff86 100644 --- a/src/app/common/templates/templates.json +++ b/src/app/common/templates/templates.json @@ -8,6 +8,9 @@ "templates/app/helper.js", "templates/chip/helper.js" ], + "resources": { + "weak-enum-list": "weak-enum-list.yaml" + }, "override": "../../zap-templates/common/override.js", "partials": [ { diff --git a/src/app/common/templates/weak-enum-list.yaml b/src/app/common/templates/weak-enum-list.yaml new file mode 100644 index 00000000000000..24e3fc3b89de4a --- /dev/null +++ b/src/app/common/templates/weak-enum-list.yaml @@ -0,0 +1,39 @@ +# Allow-list of enums that we generate as enums, not enum classes. The goal is +# to drive this down to 0. +- AttributeWritePermission +- BarrierControlBarrierPosition +- BarrierControlMovingState +- ColorControlOptions +- ColorLoopAction +- ColorLoopDirection +- ColorMode +- ContentLaunchStatus +- ContentLaunchStreamingType +- EnhancedColorMode +- HardwareFaultType +- HueDirection +- HueMoveMode +- HueStepMode +- IdentifyEffectIdentifier +- IdentifyEffectVariant +- IdentifyIdentifyType +- InterfaceType +- KeypadLockout +- LevelControlOptions +- MoveMode +- NetworkFaultType +- OnOffDelayedAllOffEffectVariant +- OnOffDyingLightEffectVariant +- OnOffEffectIdentifier +- PHYRateType +- RadioFaultType +- RoutingRole +- SaturationMoveMode +- SaturationStepMode +- SecurityType +- SetpointAdjustMode +- StartUpOnOffValue +- StatusCode +- StepMode +- TemperatureDisplayMode +- WiFiVersionType