From 27a339fa12169e8bfcbf528ece73e8affcc694fc Mon Sep 17 00:00:00 2001 From: Jesse Hills <3060199+jesserockz@users.noreply.github.com> Date: Thu, 10 Nov 2022 22:49:04 +1300 Subject: [PATCH] Move CONF_INTERRUPT_PIN to const.py (#4014) --- esphome/components/ektf2232/touchscreen.py | 4 +--- esphome/components/lilygo_t5_47/touchscreen/__init__.py | 4 +--- esphome/components/xpt2046/touchscreen.py | 9 +++++---- esphome/const.py | 1 + 4 files changed, 8 insertions(+), 10 deletions(-) diff --git a/esphome/components/ektf2232/touchscreen.py b/esphome/components/ektf2232/touchscreen.py index b3513b2670..d937265e7a 100644 --- a/esphome/components/ektf2232/touchscreen.py +++ b/esphome/components/ektf2232/touchscreen.py @@ -3,7 +3,7 @@ import esphome.config_validation as cv from esphome import pins from esphome.components import i2c, touchscreen -from esphome.const import CONF_ID +from esphome.const import CONF_ID, CONF_INTERRUPT_PIN CODEOWNERS = ["@jesserockz"] DEPENDENCIES = ["i2c"] @@ -17,10 +17,8 @@ EKTF2232Touchscreen = ektf2232_ns.class_( ) CONF_EKTF2232_ID = "ektf2232_id" -CONF_INTERRUPT_PIN = "interrupt_pin" CONF_RTS_PIN = "rts_pin" - CONFIG_SCHEMA = touchscreen.TOUCHSCREEN_SCHEMA.extend( cv.Schema( { diff --git a/esphome/components/lilygo_t5_47/touchscreen/__init__.py b/esphome/components/lilygo_t5_47/touchscreen/__init__.py index 9ec6c925ee..fe94120644 100644 --- a/esphome/components/lilygo_t5_47/touchscreen/__init__.py +++ b/esphome/components/lilygo_t5_47/touchscreen/__init__.py @@ -3,7 +3,7 @@ import esphome.config_validation as cv from esphome import pins from esphome.components import i2c, touchscreen -from esphome.const import CONF_ID +from esphome.const import CONF_ID, CONF_INTERRUPT_PIN from .. import lilygo_t5_47_ns @@ -18,8 +18,6 @@ LilygoT547Touchscreen = lilygo_t5_47_ns.class_( ) CONF_LILYGO_T5_47_TOUCHSCREEN_ID = "lilygo_t5_47_touchscreen_id" -CONF_INTERRUPT_PIN = "interrupt_pin" - CONFIG_SCHEMA = touchscreen.TOUCHSCREEN_SCHEMA.extend( cv.Schema( diff --git a/esphome/components/xpt2046/touchscreen.py b/esphome/components/xpt2046/touchscreen.py index 868525ccb1..e45b723179 100644 --- a/esphome/components/xpt2046/touchscreen.py +++ b/esphome/components/xpt2046/touchscreen.py @@ -3,18 +3,19 @@ import esphome.config_validation as cv from esphome import pins from esphome.components import spi, touchscreen -from esphome.const import CONF_ID, CONF_THRESHOLD +from esphome.const import CONF_ID, CONF_THRESHOLD, CONF_INTERRUPT_PIN CODEOWNERS = ["@numo68", "@nielsnl68"] DEPENDENCIES = ["spi"] XPT2046_ns = cg.esphome_ns.namespace("xpt2046") XPT2046Component = XPT2046_ns.class_( - "XPT2046Component", touchscreen.Touchscreen, cg.PollingComponent, spi.SPIDevice + "XPT2046Component", + touchscreen.Touchscreen, + cg.PollingComponent, + spi.SPIDevice, ) -CONF_INTERRUPT_PIN = "interrupt_pin" - CONF_REPORT_INTERVAL = "report_interval" CONF_CALIBRATION_X_MIN = "calibration_x_min" CONF_CALIBRATION_X_MAX = "calibration_x_max" diff --git a/esphome/const.py b/esphome/const.py index 4b259984eb..af5adcf26d 100644 --- a/esphome/const.py +++ b/esphome/const.py @@ -322,6 +322,7 @@ CONF_INTERNAL = "internal" CONF_INTERNAL_FILTER = "internal_filter" CONF_INTERNAL_FILTER_MODE = "internal_filter_mode" CONF_INTERRUPT = "interrupt" +CONF_INTERRUPT_PIN = "interrupt_pin" CONF_INTERVAL = "interval" CONF_INVALID_COOLDOWN = "invalid_cooldown" CONF_INVERT = "invert"