@@ -15,9 +15,7 @@ FSTR(BUTTONSTATE, longPress); // Long press state value
1515FSTR (BUTTONSTATE, setSmartButtonState); // Set state action name
1616
1717// Callback type definitions for different button press events
18- using SmartButtonSinglePressCallback = std::function<bool (const String &)>;
19- using SmartButtonDoublePressCallback = std::function<bool (const String &)>;
20- using SmartButtonLongPressCallback = std::function<bool (const String &)>;
18+ using SmartButtonPressCallback = std::function<bool (const String &)>;
2119
2220/* *
2321 * @brief Controller class for managing smart button state and interactions
@@ -37,19 +35,19 @@ class SmartButtonStateController {
3735 * @brief Register callback for single press event from app
3836 * @param cb Callback function to handle single press
3937 */
40- void onSinglePress (SmartButtonSinglePressCallback cb);
38+ void onSinglePress (SmartButtonPressCallback cb);
4139
4240 /* *
4341 * @brief Register callback for double press event from app
4442 * @param cb Callback function to handle double press
4543 */
46- void onDoublePress (SmartButtonDoublePressCallback cb);
44+ void onDoublePress (SmartButtonPressCallback cb);
4745
4846 /* *
4947 * @brief Register callback for long press event from app
5048 * @param cb Callback function to handle long press
5149 */
52- void onLongPress (SmartButtonLongPressCallback cb);
50+ void onLongPress (SmartButtonPressCallback cb);
5351
5452protected:
5553 /* *
@@ -60,9 +58,9 @@ class SmartButtonStateController {
6058 bool handleSmartButtonStateController (SinricProRequest &request);
6159
6260private:
63- SmartButtonSinglePressCallback smartButtonSinglePressCallback;
64- SmartButtonDoublePressCallback smartButtonDoublePressCallback;
65- SmartButtonLongPressCallback smartButtonLongPressCallback;
61+ SmartButtonPressCallback smartButtonSinglePressCallback;
62+ SmartButtonPressCallback smartButtonDoublePressCallback;
63+ SmartButtonPressCallback smartButtonLongPressCallback;
6664
6765 /* *
6866 * returns true if states match, false otherwise
@@ -85,17 +83,17 @@ SmartButtonStateController<T>::SmartButtonStateController() {
8583}
8684
8785template <typename T>
88- void SmartButtonStateController<T>::onSinglePress(SmartButtonSinglePressCallback cb) {
86+ void SmartButtonStateController<T>::onSinglePress(SmartButtonPressCallback cb) {
8987 smartButtonSinglePressCallback = cb;
9088}
9189
9290template <typename T>
93- void SmartButtonStateController<T>::onDoublePress(SmartButtonDoublePressCallback cb) {
91+ void SmartButtonStateController<T>::onDoublePress(SmartButtonPressCallback cb) {
9492 smartButtonDoublePressCallback = cb;
9593}
9694
9795template <typename T>
98- void SmartButtonStateController<T>::onLongPress(SmartButtonLongPressCallback cb) {
96+ void SmartButtonStateController<T>::onLongPress(SmartButtonPressCallback cb) {
9997 smartButtonLongPressCallback = cb;
10098}
10199
0 commit comments