/**
 * @license
 * Copyright 2022-2026 Matter.js Authors
 * SPDX-License-Identifier: Apache-2.0
 */

/*** THIS FILE IS GENERATED, DO NOT EDIT ***/

import { Resource } from "#models/Resource.js";

Resource.add({
    tag: "cluster", name: "ScenesManagement", pics: "S", xref: "cluster§1.4",

    details: "The Scenes Management cluster provides attributes and commands for setting up and recalling scenes. " +
        "Each scene corresponds to a set of stored values of specified attributes for one or more clusters on " +
        "the same end point as the Scenes Management cluster." +
        "\n" +
        "In most cases scenes are associated with a particular group identifier. Scenes may also exist " +
        "without a group, in which case the value 0 replaces the group identifier. Note that extra care is " +
        "required in these cases to avoid a scene identifier collision, and that commands related to scenes " +
        "without a group may only be unicast, i.e., they shall NOT be multicast or broadcast.",

    children: [
        {
            tag: "attribute", name: "FeatureMap", xref: "cluster§1.4.4",
            children: [{
                tag: "field", name: "SN", xref: "cluster§1.4.4.1",
                details: "This feature indicates the ability to store a name for a scene when a scene is added."
            }]
        },

        { tag: "attribute", name: "DoNotUse", xref: "cluster§1.4.8" },

        {
            tag: "attribute", name: "SceneTableSize", xref: "cluster§1.4.8.1",
            details: "Indicates the number of entries in the Scene Table on this endpoint. This is the total across all " +
                "fabrics; note that a single fabric cannot use all those entries (see Handling of fabric-scoping). " +
                "The minimum size of this table, (i.e., the minimum number of scenes to support across all fabrics " +
                "per endpoint) shall be 16, unless a device type in which this cluster is used, defines a larger " +
                "value in the device type definition."
        },

        {
            tag: "attribute", name: "FabricSceneInfo", xref: "cluster§1.4.8.2",
            details: "Indicates a list of fabric scoped information about scenes on this endpoint." +
                "\n" +
                "The number of list entries for this attribute shall NOT exceed the number of supported fabrics by " +
                "the device."
        },

        {
            tag: "command", name: "AddScene", xref: "cluster§1.4.9.2",
            details: "This command is used to add a new scene." +
                "\n" +
                "It is not mandatory for an extension field set to be included in the command for every cluster on " +
                "that endpoint that has a defined extension field set. Extension field sets may be omitted, including " +
                "the case of no extension field sets at all.",

            children: [
                {
                    tag: "field", name: "GroupId", xref: "cluster§1.4.9.2.1",
                    details: "This field shall indicate the group identifier in the Group Table."
                },
                {
                    tag: "field", name: "SceneId", xref: "cluster§1.4.9.2.2",
                    details: "This field shall indicate the scene identifier in the Scene Table."
                },
                {
                    tag: "field", name: "TransitionTime", xref: "cluster§1.4.9.2.3",
                    details: "This field shall indicate the transition time of the scene, measured in milliseconds."
                },
                {
                    tag: "field", name: "SceneName", xref: "cluster§1.4.9.2.4",
                    details: "This field shall indicate the name of the scene."
                },
                {
                    tag: "field", name: "ExtensionFieldSetStructs", xref: "cluster§1.4.9.2.5",
                    details: "This field shall contains the list of extension fields."
                }
            ]
        },

        {
            tag: "command", name: "AddSceneResponse", xref: "cluster§1.4.9.3",
            details: "This command is sent in response to the AddScene command.",

            children: [
                {
                    tag: "field", name: "Status", xref: "cluster§1.4.9.3.1",
                    details: "This field shall be set according to the Effect on Receipt section for AddScene command."
                },
                {
                    tag: "field", name: "GroupId", xref: "cluster§1.4.9.3.2",
                    details: "The GroupID field shall be set to the corresponding field of the received AddScene command."
                },
                {
                    tag: "field", name: "SceneId", xref: "cluster§1.4.9.3.3",
                    details: "The SceneID field shall be set to the corresponding field of the received AddScene command."
                }
            ]
        },

        {
            tag: "command", name: "ViewScene", xref: "cluster§1.4.9.4",
            details: "This command returns the details for the requested scene.",

            children: [
                {
                    tag: "field", name: "GroupId", xref: "cluster§1.4.9.4.1",
                    details: "This field shall indicate the group identifier in the Group Table."
                },
                {
                    tag: "field", name: "SceneId", xref: "cluster§1.4.9.4.2",
                    details: "This field shall indicate the scene identifier in the Scene Table."
                }
            ]
        },

        {
            tag: "command", name: "ViewSceneResponse", xref: "cluster§1.4.9.5",
            details: "This command is sent in response to the ViewScene command.",

            children: [
                {
                    tag: "field", name: "Status", xref: "cluster§1.4.9.5.1",
                    details: "This field shall be set according to the Effect on Receipt section for ViewScene command."
                },
                {
                    tag: "field", name: "GroupId", xref: "cluster§1.4.9.5.2",
                    details: "The GroupID field shall be set to the corresponding field of the received ViewScene command."
                },
                {
                    tag: "field", name: "SceneId", xref: "cluster§1.4.9.5.3",
                    details: "The SceneID field shall be set to the corresponding field of the received ViewScene command."
                },
                {
                    tag: "field", name: "TransitionTime", xref: "cluster§1.4.9.5.4",
                    details: "This field shall be set to the corresponding field in the Scene Table entry."
                },
                {
                    tag: "field", name: "SceneName", xref: "cluster§1.4.9.5.5",
                    details: "This field shall be set to the corresponding field in the Scene Table entry."
                },
                {
                    tag: "field", name: "ExtensionFieldSetStructs", xref: "cluster§1.4.9.5.6",
                    details: "This field shall be set to the corresponding field in the Scene Table entry."
                }
            ]
        },

        {
            tag: "command", name: "RemoveScene", xref: "cluster§1.4.9.6",
            details: "This command removes the specified scene.",

            children: [
                {
                    tag: "field", name: "GroupId", xref: "cluster§1.4.9.6.1",
                    details: "This field shall indicate the group identifier in the Group Table."
                },
                {
                    tag: "field", name: "SceneId", xref: "cluster§1.4.9.6.2",
                    details: "This field shall indicate the scene identifier in the Scene Table."
                }
            ]
        },

        {
            tag: "command", name: "RemoveSceneResponse", xref: "cluster§1.4.9.7",
            details: "This command is sent in response to the RemoveScene command.",

            children: [
                {
                    tag: "field", name: "Status", xref: "cluster§1.4.9.7.1",
                    details: "This field shall be set according to the Effect on Receipt section for RemoveScene command."
                },
                {
                    tag: "field", name: "GroupId", xref: "cluster§1.4.9.7.2",
                    details: "The GroupID field shall be set to the corresponding field of the received RemoveScene command."
                },
                {
                    tag: "field", name: "SceneId", xref: "cluster§1.4.9.7.3",
                    details: "The SceneID field shall be set to the corresponding field of the received RemoveScene command."
                }
            ]
        },

        {
            tag: "command", name: "RemoveAllScenes", xref: "cluster§1.4.9.8",
            details: "This command removes all scenes for the specified GroupID.",
            children: [{
                tag: "field", name: "GroupId", xref: "cluster§1.4.9.8.1",
                details: "This field shall indicate the group identifier in the Group Table."
            }]
        },

        {
            tag: "command", name: "RemoveAllScenesResponse", xref: "cluster§1.4.9.9",
            details: "This command is sent in response to the RemoveAllScenes command.",

            children: [
                {
                    tag: "field", name: "Status", xref: "cluster§1.4.9.9.1",
                    details: "This field shall be set according to the Effect on Receipt section for RemoveAllScenes command."
                },
                {
                    tag: "field", name: "GroupId", xref: "cluster§1.4.9.9.2",
                    details: "The GroupID field shall be set to the corresponding field of the received RemoveAllScenes command."
                }
            ]
        },

        {
            tag: "command", name: "StoreScene", xref: "cluster§1.4.9.10",
            details: "This command will create a new entry for the requested scene.",

            children: [
                {
                    tag: "field", name: "GroupId", xref: "cluster§1.4.9.10.1",
                    details: "This field shall indicate the group identifier in the Group Table."
                },
                {
                    tag: "field", name: "SceneId", xref: "cluster§1.4.9.10.2",
                    details: "This field shall indicate the scene identifier in the Scene Table."
                }
            ]
        },

        {
            tag: "command", name: "StoreSceneResponse", xref: "cluster§1.4.9.11",
            details: "This command is sent in response to the StoreScene command.",

            children: [
                {
                    tag: "field", name: "Status", xref: "cluster§1.4.9.11.1",
                    details: "This field shall be set according to the Effect on Receipt section for StoreScene command."
                },
                {
                    tag: "field", name: "GroupId", xref: "cluster§1.4.9.11.2",
                    details: "The GroupID field shall be set to the corresponding field of the received StoreScene command."
                },
                {
                    tag: "field", name: "SceneId", xref: "cluster§1.4.9.11.3",
                    details: "The SceneID field shall be set to the corresponding field of the received StoreScene command."
                }
            ]
        },

        {
            tag: "command", name: "RecallScene", xref: "cluster§1.4.9.12",
            details: "This command will cause the specified scene to be recalled.",

            children: [
                {
                    tag: "field", name: "GroupId", xref: "cluster§1.4.9.12.1",
                    details: "This field shall indicate the group identifier in the Group Table."
                },
                {
                    tag: "field", name: "SceneId", xref: "cluster§1.4.9.12.2",
                    details: "This field shall indicate the scene identifier in the Scene Table."
                },
                {
                    tag: "field", name: "TransitionTime", xref: "cluster§1.4.9.12.3",
                    details: "This field shall indicate the transition time of the scene, measured in milliseconds."
                }
            ]
        },

        {
            tag: "command", name: "GetSceneMembership", xref: "cluster§1.4.9.13",
            details: "This command can be used to get the used scene identifiers within a certain group, for the endpoint " +
                "that implements this cluster.",
            children: [{
                tag: "field", name: "GroupId", xref: "cluster§1.4.9.13.1",
                details: "This field shall indicate the group identifier in the Group Table."
            }]
        },

        {
            tag: "command", name: "GetSceneMembershipResponse", xref: "cluster§1.4.9.14",
            details: "This command is sent in response to the GetSceneMembership command.",

            children: [
                {
                    tag: "field", name: "Status", xref: "cluster§1.4.9.14.1",
                    details: "This field shall be set according to the Effect on Receipt section for GetSceneMembership command."
                },

                {
                    tag: "field", name: "Capacity", xref: "cluster§1.4.9.14.2",

                    details: "This field shall contain the remaining capacity of the Scene Table of the server (for all groups for " +
                        "the accessing fabric). The following values apply:" +
                        "\n" +
                        "  - 0 - No further scenes may be added." +
                        "\n" +
                        "  - 0 < Capacity < 0xFE - Capacity holds the number of scenes that may be added." +
                        "\n" +
                        "  - 0xFE - At least 1 further scene may be added (exact number is unknown)." +
                        "\n" +
                        "  - null - It is unknown if any further scenes may be added."
                },

                {
                    tag: "field", name: "GroupId", xref: "cluster§1.4.9.14.3",
                    details: "This field shall be set to the corresponding field of the received GetSceneMembership command."
                },
                {
                    tag: "field", name: "SceneList", xref: "cluster§1.4.9.14.4",
                    details: "If the status is not SUCCESS then this field shall be omitted, else this field shall contain the " +
                        "identifiers of all the scenes in the Scene Table with the corresponding Group ID."
                }
            ]
        },

        {
            tag: "command", name: "CopyScene", xref: "cluster§1.4.9.15",
            details: "This command allows a client to efficiently copy scenes from one group/scene identifier pair to " +
                "another group/scene identifier pair.",

            children: [
                {
                    tag: "field", name: "Mode", xref: "cluster§1.4.9.15.1",
                    details: "This field shall contain the information of how the scene copy is to proceed." +
                        "\n" +
                        "The CopyAllScenes bit of the Mode indicates whether all scenes are to be copied. If this value is " +
                        "set to 1, all scenes are to be copied and the SceneIdentifierFrom and SceneIdentifierTo fields shall " +
                        "be ignored. Otherwise this bit is set to 0."
                },

                {
                    tag: "field", name: "GroupIdentifierFrom", xref: "cluster§1.4.9.15.2",
                    details: "This field shall indicate the identifier of the group from which the scene is to be copied. Together " +
                        "with the SceneIdentifierFrom field, this field uniquely identifies the scene to copy from the Scene " +
                        "Table."
                },

                {
                    tag: "field", name: "SceneIdentifierFrom", xref: "cluster§1.4.9.15.3",
                    details: "This field shall indicate the identifier of the scene from which the scene is to be copied. Together " +
                        "with the GroupIdentifierFrom field, this field uniquely identifies the scene to copy from the Scene " +
                        "Table."
                },

                {
                    tag: "field", name: "GroupIdentifierTo", xref: "cluster§1.4.9.15.4",
                    details: "This field shall indicate the identifier of the group to which the scene is to be copied. Together " +
                        "with the SceneIdentifierTo field, this field uniquely identifies the scene to copy to the Scene " +
                        "Table."
                },

                {
                    tag: "field", name: "SceneIdentifierTo", xref: "cluster§1.4.9.15.5",
                    details: "This field shall indicate the identifier of the scene to which the scene is to be copied. Together " +
                        "with the GroupIdentifierTo field, this field uniquely identifies the scene to copy to the Scene " +
                        "Table."
                }
            ]
        },

        {
            tag: "command", name: "CopySceneResponse", xref: "cluster§1.4.9.16",
            details: "This command is sent in response to the CopyScene command.",

            children: [
                {
                    tag: "field", name: "Status", xref: "cluster§1.4.9.16.1",
                    details: "This field shall be set according to the Effect on Receipt section for the CopyScene command."
                },
                {
                    tag: "field", name: "GroupIdentifierFrom", xref: "cluster§1.4.9.16.2",
                    details: "This field shall be set to the same values as in the corresponding fields of the received CopyScene " +
                        "command."
                },
                {
                    tag: "field", name: "SceneIdentifierFrom", xref: "cluster§1.4.9.16.3",
                    details: "This field shall be set to the same values as in the corresponding fields of the received CopyScene " +
                        "command."
                }
            ]
        },

        {
            tag: "datatype", name: "CopyModeBitmap", xref: "cluster§1.4.7.1",
            children: [{ tag: "field", name: "CopyAllScenes", description: "Copy all scenes in the scene table" }]
        },

        {
            tag: "datatype", name: "SceneInfoStruct", xref: "cluster§1.4.7.2",

            children: [
                {
                    tag: "field", name: "SceneCount", xref: "cluster§1.4.7.2.1",
                    details: "This field shall indicate the number of scenes currently used in the server's Scene Table on the " +
                        "endpoint where the Scenes Management cluster appears." +
                        "\n" +
                        "This only includes the count for the associated fabric."
                },

                {
                    tag: "field", name: "CurrentScene", xref: "cluster§1.4.7.2.2",
                    details: "This field shall indicate the scene identifier of the scene last invoked on the associated fabric. " +
                        "If no scene has been invoked, the value of this field shall be 0xFF, the undefined scene identifier."
                },
                {
                    tag: "field", name: "CurrentGroup", xref: "cluster§1.4.7.2.3",
                    details: "This field shall indicate the group identifier of the scene last invoked on the associated fabric, " +
                        "or 0 if the scene last invoked is not associated with a group."
                },

                {
                    tag: "field", name: "SceneValid", xref: "cluster§1.4.7.2.4",

                    details: "This field shall indicate whether the state of the server corresponds to that associated with the " +
                        "CurrentScene and CurrentGroup fields of the SceneInfoStruct they belong to. TRUE indicates that " +
                        "these fields are valid, FALSE indicates that they are not valid." +
                        "\n" +
                        "This field shall be set to False for all other fabrics when an attribute with the Scenes (\"S\") " +
                        "designation in the Quality column of another cluster present on the same endpoint is modified or " +
                        "when the current scene is modified by a fabric through the RecallScene or StoreScene commands, " +
                        "regardless of the fabric-scoped access quality of the command." +
                        "\n" +
                        "In the event where the SceneValid field is set to False for a fabric, the CurrentScene and " +
                        "CurrentGroup fields shall be the last invoked scene and group for that fabric. In the event where no " +
                        "scene was previously invoked for that fabric, the CurrentScene and CurrentGroup fields shall be " +
                        "their default values."
                },

                {
                    tag: "field", name: "RemainingCapacity", xref: "cluster§1.4.7.2.5",
                    details: "This field shall indicate the remaining capacity of the Scene Table on this endpoint for the " +
                        "accessing fabric. Note that this value may change between reads, even if no entries are added or " +
                        "deleted on the accessing fabric, due to other clients associated with other fabrics adding or " +
                        "deleting entries that impact the resource usage on the device."
                }
            ]
        },

        {
            tag: "datatype", name: "AttributeValuePairStruct", xref: "cluster§1.4.7.3",
            details: "This data type indicates a combination of an identifier and the value of an attribute.",

            children: [{
                tag: "field", name: "AttributeId", xref: "cluster§1.4.7.3.1",

                details: "This field shall be present for all instances in a given ExtensionFieldSetStruct." +
                    "\n" +
                    "Which Value field is used shall be determined based on the data type of the attribute indicated by " +
                    "AttributeID, as described in the Value Fields subsection." +
                    "\n" +
                    "The AttributeID field shall NOT refer to an attribute without the Scenes (\"S\") designation in the " +
                    "Quality column of the cluster specification."
            }]
        },

        {
            tag: "datatype", name: "ExtensionFieldSetStruct", xref: "cluster§1.4.7.4",
            details: "This data type indicates for a given cluster a set of attributes and their values.",

            children: [
                {
                    tag: "field", name: "ClusterId", xref: "cluster§1.4.7.4.1",
                    details: "This field shall indicate the cluster-id of the cluster whose attributes are in the " +
                        "AttributeValueList field."
                },

                {
                    tag: "field", name: "AttributeValueList", xref: "cluster§1.4.7.4.2",
                    details: "This field shall indicate a set of attributes and their values which are stored as part of a scene." +
                        "\n" +
                        "Attributes which do not have the Scenes (\"S\") designation in the Quality column of their cluster " +
                        "specification shall NOT be used in the AttributeValueList field."
                }
            ]
        },

        {
            tag: "datatype", name: "LogicalSceneTable", xref: "cluster§1.4.7.5",

            details: "The Scene Table is used to store information for each scene capable of being invoked on the server. " +
                "Each scene is defined for a particular group. The Scene Table is defined here as a conceptual " +
                "illustration to assist in understanding the underlying data to be stored when scenes are defined. " +
                "Though the Scene Table is defined here using the data model architecture rules and format, the " +
                "design is not normative." +
                "\n" +
                "The Scene table is logically a list of fabric-scoped structs. The logical fields of each Scene Table " +
                "entry struct are illustrated below. An ExtensionFieldSetStruct may be present for each " +
                "Scenes-supporting cluster implemented on the same endpoint.",

            children: [
                {
                    tag: "field", name: "SceneGroupId", xref: "cluster§1.4.7.5.1",
                    details: "This field is the group identifier for which this scene applies, or 0 if the scene is not associated " +
                        "with a group."
                },
                {
                    tag: "field", name: "SceneId", xref: "cluster§1.4.7.5.2",
                    details: "This field is unique within this group, which is used to identify this scene."
                },

                {
                    tag: "field", name: "SceneName", xref: "cluster§1.4.7.5.3",
                    details: "The field is the name of the scene." +
                        "\n" +
                        "If scene names are not supported, any commands that write a scene name shall simply discard the " +
                        "name, and any command that returns a scene name shall return an empty string."
                },

                {
                    tag: "field", name: "SceneTransitionTime", xref: "cluster§1.4.7.5.4",
                    details: "This field is the amount of time, in milliseconds, it will take for a cluster to change from its " +
                        "current state to the requested state."
                },

                {
                    tag: "field", name: "ExtensionFields", xref: "cluster§1.4.7.5.5",
                    details: "See the Scene Table Extensions subsections of individual clusters. A Scene Table Extension shall " +
                        "only use attributes with the Scene quality. Each ExtensionFieldSetStruct holds a set of values of " +
                        "these attributes for a cluster implemented on the same endpoint where the Scene (\"S\") designation " +
                        "appears in the quality column. A scene is the aggregate of all such fields across all clusters on " +
                        "the endpoint."
                }
            ]
        }
    ]
});
