diff --git a/esphome/components/icnt86/icnt86.cpp b/esphome/components/icnt86/icnt86.cpp index 7c910890ae..8eadc69cee 100644 --- a/esphome/components/icnt86/icnt86.cpp +++ b/esphome/components/icnt86/icnt86.cpp @@ -23,6 +23,7 @@ void ICNT86Touchscreen::setup() { this->reset_pin_->setup(); this->reset_(); } + this->conversion_to_resolution_ = false; // Trigger initial read to activate the interrupt this->store_.touched = true; } diff --git a/esphome/components/touchscreen/touchscreen.cpp b/esphome/components/touchscreen/touchscreen.cpp index da90487dd8..21b9122be5 100644 --- a/esphome/components/touchscreen/touchscreen.cpp +++ b/esphome/components/touchscreen/touchscreen.cpp @@ -94,8 +94,10 @@ void Touchscreen::add_raw_touch_position_(uint8_t id, int16_t x_raw, int16_t y_r std::swap(x, y); } - tp.x = (uint16_t) ((int) x * this->display_width_ / 0x1000); - tp.y = (uint16_t) ((int) y * this->display_height_ / 0x1000); + if (this->conversion_to_resolution_) { + tp.x = (uint16_t) ((int) x * this->display_width_ / 0x1000); + tp.y = (uint16_t) ((int) y * this->display_height_ / 0x1000); + } } else { tp.state |= STATE_CALIBRATE; } diff --git a/esphome/components/touchscreen/touchscreen.h b/esphome/components/touchscreen/touchscreen.h index 21111f87b3..5f1a984b29 100644 --- a/esphome/components/touchscreen/touchscreen.h +++ b/esphome/components/touchscreen/touchscreen.h @@ -117,6 +117,7 @@ class Touchscreen : public PollingComponent { bool is_touched_{false}; bool was_touched_{false}; bool skip_update_{false}; + bool conversion_to_resolution_{true}; }; } // namespace touchscreen