supla-device
Loading...
Searching...
No Matches
events.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_EVENTS_H_
18#define SRC_SUPLA_EVENTS_H_
19
20#include <stdint.h>
21
22namespace Supla {
23
24enum Event {
25 // Supla::Control::Button events
26 ON_PRESS, // Triggered on transition to valueOnPress()
27 ON_RELEASE, // Triggered on transition from valueOnPress()
28 ON_CHANGE, // Triggered on all transitions
29 ON_HOLD, // Triggered when button is hold
30 ON_CLICK_1, // ON_MULTI_x is triggered when multiclick is detected
31 ON_CLICK_2,
32 ON_CLICK_3,
33 ON_CLICK_4,
34 ON_CLICK_5,
35 ON_CLICK_6,
36 ON_CLICK_7,
37 ON_CLICK_8,
38 ON_CLICK_9,
39 ON_CLICK_10,
40 ON_CRAZY_CLICKER, // triggered on >= 10 clicks
41 ON_SEQUENCE_MATCH, // triggered by SequenceButton
42 ON_SEQUENCE_DOESNT_MATCH, // triggered by SequenceButton
43 ON_TURN_ON,
44 ON_TURN_OFF,
45 ON_SECONDARY_CHANNEL_CHANGE,
46 ON_LONG_CLICK_0,
47 ON_LONG_CLICK_1,
48 ON_LONG_CLICK_2,
49 ON_LONG_CLICK_3,
50 ON_LONG_CLICK_4,
51 ON_LONG_CLICK_5,
52 ON_LONG_CLICK_6,
53 ON_LONG_CLICK_7,
54 ON_LONG_CLICK_8,
55 ON_LONG_CLICK_9,
56 ON_LONG_CLICK_10,
57 // Conditional events are triggered only when no on_hold was send
58 // and we are not in the middle of muliclick detection.
59 // Otherwise they work as standard events.
60 // Conditional on_press is send on first press in multiclick detection
61 // and on_release is send only after first button release in multiclick
62 // detection (when no on_hold was send)
63 CONDITIONAL_ON_PRESS,
64 CONDITIONAL_ON_RELEASE,
65 CONDITIONAL_ON_CHANGE,
66 ON_HOLD_RELEASE,
67
68 // SuplaDeviceClass events
69 ON_DEVICE_STATUS_CHANGE,
70 ON_IDENTIFY,
71
72 // Html TextCmdInputParameter
73 ON_EVENT_1,
74 ON_EVENT_2,
75 ON_EVENT_3,
76 ON_EVENT_4,
77 ON_EVENT_5,
78 ON_EVENT_6,
79 ON_EVENT_7,
80 ON_EVENT_8,
81 ON_EVENT_9,
82 ON_EVENT_10,
83
84 // RGBW/DIMMER events
85 ON_DIMMER_TURN_ON, // when "brightness" changes from 0 to non-0
86 ON_DIMMER_TURN_OFF, // when "brightness" changes from non-0 to 0
87 ON_DIMMER_BRIGHTNESS_CHANGE, // on every change of "brightness"
88 ON_COLOR_TURN_ON, // when "color brightness" changes from 0 to non-0
89 ON_COLOR_TURN_OFF, // when "color brightness" changes from non-0 to 0
90 ON_COLOR_BRIGHTNESS_CHANGE, // on every change of "color brightness"
91 ON_RED_TURN_ON, // when "red" changes from 0 to non-0
92 ON_RED_TURN_OFF, // when "red" changes from non-0 to 0
93 ON_RED_CHANGE, // on every change of "red"
94 ON_GREEN_TURN_ON, // when "green" changes from 0 to non-0
95 ON_GREEN_TURN_OFF, // when "green" changes from non-0 to 0
96 ON_GREEN_CHANGE, // on every change of "green"
97 ON_BLUE_TURN_ON, // when "blue" changes from 0 to non-0
98 ON_BLUE_TURN_OFF, // when "blue" changes from non-0 to 0
99 ON_BLUE_CHANGE, // on every change of "blue"
100
101 ON_CHANNEL_OFFLINE,
102 ON_CHANNEL_ONLINE,
103 ON_CHANNEL_FUNCTION_CHANGE,
104
105 ON_HVAC_HEATING,
106 ON_HVAC_COOLING,
107 ON_HVAC_STANDBY,
108 ON_HVAC_WEEKLY_SCHEDULE_ENABLED,
109 ON_HVAC_WEEKLY_SCHEDULE_DISABLED,
110 ON_HVAC_MODE_OFF,
111 ON_HVAC_MODE_HEAT,
112 ON_HVAC_MODE_COOL,
113 ON_HVAC_MODE_HEAT_COOL,
114
115 ON_ERROR,
116 ON_ERROR_CLEAR,
117
118 // Container events
119 ON_CONTAINER_ALARM_ACTIVE,
120 ON_CONTAINER_ALARM_INACTIVE,
121 ON_CONTAINER_WARNING_ACTIVE,
122 ON_CONTAINER_WARNING_INACTIVE,
123 ON_CONTAINER_INVALID_SENSOR_STATE_ACTIVE,
124 ON_CONTAINER_INVALID_SENSOR_STATE_INACTIVE,
125 ON_CONTAINER_SOUND_ALARM_ACTIVE,
126 ON_CONTAINER_SOUND_ALARM_INACTIVE,
127 ON_CONTAINER_SENSOR_OFFLINE_ACTIVE,
128 ON_CONTAINER_SENSOR_OFFLINE_INACTIVE,
129 ON_CONTAINER_SOUND_ALARM_MUTED,
130
131 // Valve events
132 ON_OPEN,
133 ON_CLOSE,
134 ON_FLOODING_ACTIVE,
135 ON_FLOODING_INACTIVE,
136 ON_VALVE_MANUALLY_CLOSED_ACTIVE,
137 ON_VALVE_MANUALLY_CLOSED_INACTIVE,
138 ON_MOTOR_PROBLEM_ACTIVE,
139 ON_MOTOR_PROBLEM_INACTIVE,
140
141 ON_SUBDEVICE_PAIRING_START,
142 ON_SUBDEVICE_PAIRING_END,
143
144 // Keep it as last item
145 EVENT_ID_MAX
146};
147
148// Internally, event ids are stored as uint16_t
149static_assert(Supla::EVENT_ID_MAX <= UINT16_MAX);
150
151}; // namespace Supla
152
153#endif // SRC_SUPLA_EVENTS_H_