/src/connectedhomeip/src/app/clusters/on-off-server/OnOffEffectDelegate.h
Line | Count | Source |
1 | | /* |
2 | | * Copyright (c) 2026 Project CHIP Authors |
3 | | * |
4 | | * Licensed under the Apache License, Version 2.0 (the "License"); |
5 | | * you may not use this file except in compliance with the License. |
6 | | * You may obtain a copy of the License at |
7 | | * |
8 | | * http://www.apache.org/licenses/LICENSE-2.0 |
9 | | * |
10 | | * Unless required by applicable law or agreed to in writing, software |
11 | | * distributed under the License is distributed on an "AS IS" BASIS, |
12 | | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
13 | | * See the License for the specific language governing permissions and |
14 | | * limitations under the License. |
15 | | */ |
16 | | |
17 | | #pragma once |
18 | | |
19 | | #include <app/data-model-provider/ActionReturnStatus.h> |
20 | | #include <clusters/OnOff/Enums.h> |
21 | | |
22 | | #include <cstdint> |
23 | | |
24 | | namespace chip::app::Clusters { |
25 | | |
26 | | /// Interface for handling lighting effects. |
27 | | class OnOffEffectDelegate |
28 | | { |
29 | | public: |
30 | | virtual ~OnOffEffectDelegate() = default; |
31 | | |
32 | | virtual DataModel::ActionReturnStatus TriggerEffect(OnOff::EffectIdentifierEnum effectId, uint8_t effectVariant) |
33 | 0 | { |
34 | 0 | switch (effectId) |
35 | 0 | { |
36 | 0 | case OnOff::EffectIdentifierEnum::kDelayedAllOff: |
37 | 0 | return TriggerDelayedAllOff(static_cast<OnOff::DelayedAllOffEffectVariantEnum>(effectVariant)); |
38 | 0 | case OnOff::EffectIdentifierEnum::kDyingLight: |
39 | 0 | return TriggerDyingLight(static_cast<OnOff::DyingLightEffectVariantEnum>(effectVariant)); |
40 | 0 | default: |
41 | 0 | return Protocols::InteractionModel::Status::InvalidCommand; |
42 | 0 | } |
43 | 0 | } |
44 | | |
45 | | virtual DataModel::ActionReturnStatus TriggerDelayedAllOff(OnOff::DelayedAllOffEffectVariantEnum) |
46 | 0 | { |
47 | 0 | return Protocols::InteractionModel::Status::UnsupportedCommand; |
48 | 0 | } |
49 | | |
50 | | virtual DataModel::ActionReturnStatus TriggerDyingLight(OnOff::DyingLightEffectVariantEnum) |
51 | 0 | { |
52 | 0 | return Protocols::InteractionModel::Status::UnsupportedCommand; |
53 | 0 | } |
54 | | }; |
55 | | |
56 | | } // namespace chip::app::Clusters |