1
0
mirror of https://github.com/esphome/esphome.git synced 2025-10-30 06:33:51 +00:00

brightness support for nextion (#1109)

This commit is contained in:
vxider
2020-07-13 02:12:28 +08:00
committed by GitHub
parent 1a47e4b524
commit 5d136a18af
3 changed files with 7 additions and 1 deletions

View File

@@ -365,6 +365,7 @@ class Nextion : public PollingComponent, public uart::UARTDevice {
// (In most use cases you won't need these)
void register_touch_component(NextionTouchComponent *obj) { this->touch_.push_back(obj); }
void setup() override;
void set_brightness(float brightness) { this->brightness_ = brightness; }
float get_setup_priority() const override;
void update() override;
void loop() override;
@@ -392,6 +393,7 @@ class Nextion : public PollingComponent, public uart::UARTDevice {
std::vector<NextionTouchComponent *> touch_;
optional<nextion_writer_t> writer_;
bool wait_for_ack_{true};
float brightness_{1.0};
};
class NextionTouchComponent : public binary_sensor::BinarySensorInitiallyOff {