1*0c4b1574SMatthew Barth /**
2*0c4b1574SMatthew Barth  * Copyright © 2020 IBM Corporation
3*0c4b1574SMatthew Barth  *
4*0c4b1574SMatthew Barth  * Licensed under the Apache License, Version 2.0 (the "License");
5*0c4b1574SMatthew Barth  * you may not use this file except in compliance with the License.
6*0c4b1574SMatthew Barth  * You may obtain a copy of the License at
7*0c4b1574SMatthew Barth  *
8*0c4b1574SMatthew Barth  *     http://www.apache.org/licenses/LICENSE-2.0
9*0c4b1574SMatthew Barth  *
10*0c4b1574SMatthew Barth  * Unless required by applicable law or agreed to in writing, software
11*0c4b1574SMatthew Barth  * distributed under the License is distributed on an "AS IS" BASIS,
12*0c4b1574SMatthew Barth  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*0c4b1574SMatthew Barth  * See the License for the specific language governing permissions and
14*0c4b1574SMatthew Barth  * limitations under the License.
15*0c4b1574SMatthew Barth  */
16*0c4b1574SMatthew Barth #pragma once
17*0c4b1574SMatthew Barth 
18*0c4b1574SMatthew Barth #include "action.hpp"
19*0c4b1574SMatthew Barth #include "types.hpp"
20*0c4b1574SMatthew Barth 
21*0c4b1574SMatthew Barth #include <nlohmann/json.hpp>
22*0c4b1574SMatthew Barth 
23*0c4b1574SMatthew Barth namespace phosphor::fan::control::json
24*0c4b1574SMatthew Barth {
25*0c4b1574SMatthew Barth 
26*0c4b1574SMatthew Barth using json = nlohmann::json;
27*0c4b1574SMatthew Barth 
28*0c4b1574SMatthew Barth /**
29*0c4b1574SMatthew Barth  * @class DefaultFloor - Action to default the fan floor speed
30*0c4b1574SMatthew Barth  *
31*0c4b1574SMatthew Barth  * Sets the fan floor to the defined default fan floor speed when a
32*0c4b1574SMatthew Barth  * service associated to a given group has terminated. Once all services
33*0c4b1574SMatthew Barth  * are functional and providing the sensors, the fan floor is allowed
34*0c4b1574SMatthew Barth  * to be set normally again.
35*0c4b1574SMatthew Barth  */
36*0c4b1574SMatthew Barth class DefaultFloor : public ActionBase, public ActionRegister<DefaultFloor>
37*0c4b1574SMatthew Barth {
38*0c4b1574SMatthew Barth   public:
39*0c4b1574SMatthew Barth     /* Name of this action */
40*0c4b1574SMatthew Barth     static constexpr auto name = "default_floor_on_missing_owner";
41*0c4b1574SMatthew Barth 
42*0c4b1574SMatthew Barth     DefaultFloor() = delete;
43*0c4b1574SMatthew Barth     DefaultFloor(const DefaultFloor&) = delete;
44*0c4b1574SMatthew Barth     DefaultFloor(DefaultFloor&&) = delete;
45*0c4b1574SMatthew Barth     DefaultFloor& operator=(const DefaultFloor&) = delete;
46*0c4b1574SMatthew Barth     DefaultFloor& operator=(DefaultFloor&&) = delete;
47*0c4b1574SMatthew Barth     ~DefaultFloor() = default;
48*0c4b1574SMatthew Barth 
49*0c4b1574SMatthew Barth     explicit DefaultFloor(const json&);
50*0c4b1574SMatthew Barth 
51*0c4b1574SMatthew Barth     const Action getAction() override;
52*0c4b1574SMatthew Barth };
53*0c4b1574SMatthew Barth 
54*0c4b1574SMatthew Barth } // namespace phosphor::fan::control::json
55