supla-device
Loading...
Searching...
No Matches
actions.h
1/*
2 Copyright (C) AC SOFTWARE SP. Z O.O.
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License
6 as published by the Free Software Foundation; either version 2
7 of the License, or (at your option) any later version.
8 This program is distributed in the hope that it will be useful,
9 but WITHOUT ANY WARRANTY; without even the implied warranty of
10 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 GNU General Public License for more details.
12 You should have received a copy of the GNU General Public License
13 along with this program; if not, write to the Free Software
14 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
15*/
16
17#ifndef SRC_SUPLA_ACTIONS_H_
18#define SRC_SUPLA_ACTIONS_H_
19
20#include <stdint.h>
21
22// Actions are used in ActionHandler elements. They are grouped by most common
23// usage, but you should not rely on it. Please check exact supported actions
24// in ActionHandler's element documentation
25
26namespace Supla {
27enum Action {
28 // Relays
29 TURN_ON,
30 TURN_ON_WITHOUT_TIMER, // used with staircase timer function, when
31 // timer should not be used this time
32 TURN_OFF,
33 TOGGLE,
34 TOGGLE_WITH_POSTPONED_COMM,
35
36 // Settable binary sensors
37 SET,
38 CLEAR,
39
40 // Roller shutters
41 OPEN,
42 CLOSE,
43 STOP,
44 OPEN_OR_STOP,
45 CLOSE_OR_STOP,
46 COMFORT_UP_POSITION,
47 COMFORT_DOWN_POSITION,
48 STEP_BY_STEP,
49 MOVE_UP,
50 MOVE_DOWN,
51 MOVE_UP_OR_STOP,
52 MOVE_DOWN_OR_STOP,
53 // "Internal button" actions are inverted when "invert button" config is set
54 INTERNAL_BUTTON_MOVE_UP_OR_STOP,
55 INTERNAL_BUTTON_MOVE_DOWN_OR_STOP,
56 INTERNAL_BUTTON_MOVE_UP,
57 INTERNAL_BUTTON_MOVE_DOWN,
58 INTERNAL_BUTTON_COMFORT_UP,
59 INTERNAL_BUTTON_COMFORT_DOWN,
60
61 // Dimmable light, RGB(W) LEDs
62 BRIGHTEN_ALL,
63 DIM_ALL,
64 BRIGHTEN_R,
65 BRIGHTEN_G,
66 BRIGHTEN_B,
67 BRIGHTEN_W,
68 BRIGHTEN_RGB,
69 DIM_R,
70 DIM_G,
71 DIM_B,
72 DIM_W,
73 DIM_RGB,
74 TURN_ON_RGB,
75 TURN_OFF_RGB,
76 TOGGLE_RGB,
77 TURN_ON_W,
78 TURN_OFF_W,
79 TOGGLE_W,
80 TURN_ON_RGB_DIMMED,
81 TURN_ON_W_DIMMED,
82 TURN_ON_ALL_DIMMED,
83 ITERATE_DIM_RGB,
84 ITERATE_DIM_W,
85 ITERATE_DIM_ALL,
86
87 // Impulse counter
88 RESET,
89 INCREMENT,
90 DECREMENT,
91 ENABLE,
92 DISABLE,
93
94 // Action trigger
95 SEND_AT_TURN_ON,
96 SEND_AT_TURN_OFF,
97 SEND_AT_TOGGLE_x1,
98 SEND_AT_TOGGLE_x2,
99 SEND_AT_TOGGLE_x3,
100 SEND_AT_TOGGLE_x4,
101 SEND_AT_TOGGLE_x5,
102 SEND_AT_HOLD,
103 SEND_AT_SHORT_PRESS_x1,
104 SEND_AT_SHORT_PRESS_x2,
105 SEND_AT_SHORT_PRESS_x3,
106 SEND_AT_SHORT_PRESS_x4,
107 SEND_AT_SHORT_PRESS_x5,
108
109 // SuplaDevice
110 ENTER_CONFIG_MODE,
111 TOGGLE_CONFIG_MODE,
112 RESET_TO_FACTORY_SETTINGS,
113 SOFT_RESTART,
114 START_LOCAL_WEB_SERVER,
115 STOP_LOCAL_WEB_SERVER,
116 CHECK_SW_UPDATE,
117 LEAVE_CONFIG_MODE_AND_RESET,
118 ENTER_CONFIG_MODE_OR_RESET_TO_FACTORY,
119
120 // Weight sensor
121 TARE_SCALES,
122
123 VOLUME_UP,
124 VOLUME_DOWN,
125 MUTE_SOUND_ALARM,
126 ENABLE_EXTERNAL_SOUND_ALARM,
127 DISABLE_EXTERNAL_SOUND_ALARM,
128
129 // Thermostat
130 INCREASE_TEMPERATURE,
131 DECREASE_TEMPERATURE,
132 INCREASE_HEATING_TEMPERATURE,
133 DECREASE_HEATING_TEMPERATURE,
134 INCREASE_COOLING_TEMPERATURE,
135 DECREASE_COOLING_TEMPERATURE,
136 SWITCH_TO_MANUAL_MODE,
137 SWITCH_TO_WEEKLY_SCHEDULE_MODE,
138 SWITCH_TO_MANUAL_MODE_HEAT,
139 SWITCH_TO_MANUAL_MODE_COOL,
140 SWITCH_TO_MANUAL_MODE_HEAT_COOL,
141 TOGGLE_MANUAL_WEEKLY_SCHEDULE_MODES,
142 TOGGLE_OFF_MANUAL_WEEKLY_SCHEDULE_MODES,
143
144 // Keep it as last item
145 ACTION_ID_MAX
146};
147} // namespace Supla
148
149// Internally, action ids are stored as uint16_t
150static_assert(Supla::ACTION_ID_MAX <= UINT16_MAX);
151
152#endif // SRC_SUPLA_ACTIONS_H_