From a8ff0a89134b271da6990c62ae00599510745d4c Mon Sep 17 00:00:00 2001 From: Gustavo Ambrozio Date: Mon, 10 Oct 2022 16:22:13 -0700 Subject: [PATCH] Exposing coordinates from touchscreen binary sensor (#3891) --- .../touchscreen/binary_sensor/touchscreen_binary_sensor.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/esphome/components/touchscreen/binary_sensor/touchscreen_binary_sensor.h b/esphome/components/touchscreen/binary_sensor/touchscreen_binary_sensor.h index d7e53962e2..701468aa1e 100644 --- a/esphome/components/touchscreen/binary_sensor/touchscreen_binary_sensor.h +++ b/esphome/components/touchscreen/binary_sensor/touchscreen_binary_sensor.h @@ -23,6 +23,12 @@ class TouchscreenBinarySensor : public binary_sensor::BinarySensor, this->y_min_ = y_min; this->y_max_ = y_max; } + int16_t get_x_min() { return this->x_min_; } + int16_t get_x_max() { return this->x_max_; } + int16_t get_y_min() { return this->y_min_; } + int16_t get_y_max() { return this->y_max_; } + int16_t get_width() { return this->x_max_ - this->x_min_; } + int16_t get_height() { return this->y_max_ - this->y_min_; } void set_page(display::DisplayPage *page) { this->page_ = page; }