-
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathpage_screensaver.h
More file actions
57 lines (42 loc) · 1.74 KB
/
page_screensaver.h
File metadata and controls
57 lines (42 loc) · 1.74 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
// page_screensaver.h
#pragma once
#ifdef NSPANEL_EASY_PAGE_SCREENSAVER
#include "nextion_components.h" // For HMIComponent
#include "pages.h" // For page_names and get_page_id
/**
* @file page_screensaver.h
* @brief Nextion component definitions for the Screensaver page.
*
* This file contains all component constants specific to the Screensaver page
* of the NSPanel interface, along with the persistent visibility flag used to
* avoid redundant display updates.
*/
namespace esphome {
namespace nspanel_easy {
namespace hmi {
namespace screensaver {
/**
* @namespace screensaver
* @brief Components for the Screensaver page.
*
* Component ID mapping for the Screensaver page (index 9 in page_names array).
* Based on the Nextion HMI design file.
* Note: All components are local scope, so names do not include a page prefix.
*/
// Page definition
constexpr HMIComponent PAGE = {"screensaver", get_page_id("screensaver")};
// Display components
constexpr HMIComponent TEXT = {"text", 4}; ///< Time/clock label (word-wrap enabled, 1000 chars max)
// Touch capture components
constexpr HMIComponent WAKEUP = {"wakeup", 1}; ///< Full-screen wake-up touch area
constexpr HMIComponent SWIPE = {"swipe", 2}; ///< Swipe gesture capture area
// Timers (for reference — not visual, excluded from ALL[])
constexpr HMIComponent TIMER_SWIPESTORE = {"swipestore", 3}; ///< Swipe coordinate sampling timer (50 ms)
// All visual components for iteration (timers and touch caps excluded)
constexpr HMIComponent ALL[] = {PAGE, TEXT};
constexpr size_t COMPONENT_COUNT = sizeof(ALL) / sizeof(ALL[0]);
} // namespace screensaver
} // namespace hmi
} // namespace nspanel_easy
} // namespace esphome
#endif // NSPANEL_EASY_PAGE_SCREENSAVER