ESPHome 2025.9.0-dev
Loading...
Searching...
No Matches
nextion_component.h
Go to the documentation of this file.
1#pragma once
4#include "nextion_base.h"
5
6namespace esphome {
7namespace nextion {
8class NextionComponent;
9
11 public:
12 void update_component_settings() override { this->update_component_settings(false); };
13
14 void update_component_settings(bool force_update) override;
15
20 void set_font_id(uint8_t font_id);
21 void set_visible(bool visible);
22
23 protected:
28 component_flags_ = {}; // Zero-initialize all state
29 component_flags_.visible = 1; // Set default visibility to true
30 }
31
33
34 // Color and styling properties
35 Color bco_; // Background color
36 Color bco2_; // Pressed background color
37 Color pco_; // Foreground color
38 Color pco2_; // Pressed foreground color
39 uint8_t font_id_ = 0;
40
54 // Background color flags
55 uint16_t bco_needs_update : 1;
56 uint16_t bco_is_set : 1;
57
58 // Pressed background color flags
59 uint16_t bco2_needs_update : 1;
60 uint16_t bco2_is_set : 1;
61
62 // Foreground color flags
63 uint16_t pco_needs_update : 1;
64 uint16_t pco_is_set : 1;
65
66 // Pressed foreground color flags
67 uint16_t pco2_needs_update : 1;
68 uint16_t pco2_is_set : 1;
69
70 // Font ID flags
72 uint16_t font_id_is_set : 1;
73
74 // Visibility flags
76 uint16_t visible_is_set : 1;
77 uint16_t visible : 1; // Actual visibility state
78
79 // Reserved bits for future expansion
80 uint16_t reserved : 3;
82};
83} // namespace nextion
84} // namespace esphome
NextionComponent()
Constructor initializes component state with visible=true (default state)
struct esphome::nextion::NextionComponent::ComponentState component_flags_
Providing packet encoding functions for exchanging data with a remote host.
Definition a01nyub.cpp:7
Component state management using compact bitfield structure.