Matthew Barth | 0c4b157 | 2020-10-22 14:39:46 -0500 | [diff] [blame] | 1 | /** |
| 2 | * Copyright © 2020 IBM Corporation |
| 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 | #pragma once |
| 17 | |
| 18 | #include "action.hpp" |
| 19 | #include "types.hpp" |
| 20 | |
| 21 | #include <nlohmann/json.hpp> |
| 22 | |
| 23 | namespace phosphor::fan::control::json |
| 24 | { |
| 25 | |
| 26 | using json = nlohmann::json; |
| 27 | |
| 28 | /** |
| 29 | * @class DefaultFloor - Action to default the fan floor speed |
| 30 | * |
| 31 | * Sets the fan floor to the defined default fan floor speed when a |
| 32 | * service associated to a given group has terminated. Once all services |
| 33 | * are functional and providing the sensors, the fan floor is allowed |
| 34 | * to be set normally again. |
| 35 | */ |
| 36 | class DefaultFloor : public ActionBase, public ActionRegister<DefaultFloor> |
| 37 | { |
| 38 | public: |
| 39 | /* Name of this action */ |
| 40 | static constexpr auto name = "default_floor_on_missing_owner"; |
| 41 | |
| 42 | DefaultFloor() = delete; |
| 43 | DefaultFloor(const DefaultFloor&) = delete; |
| 44 | DefaultFloor(DefaultFloor&&) = delete; |
| 45 | DefaultFloor& operator=(const DefaultFloor&) = delete; |
| 46 | DefaultFloor& operator=(DefaultFloor&&) = delete; |
| 47 | ~DefaultFloor() = default; |
| 48 | |
| 49 | explicit DefaultFloor(const json&); |
| 50 | |
| 51 | const Action getAction() override; |
| 52 | }; |
| 53 | |
| 54 | } // namespace phosphor::fan::control::json |