diff --git a/esphome/components/ili9xxx/display.py b/esphome/components/ili9xxx/display.py index cd68f1ae27..b3fe8b2b41 100644 --- a/esphome/components/ili9xxx/display.py +++ b/esphome/components/ili9xxx/display.py @@ -17,6 +17,14 @@ from esphome.const import ( CONF_WIDTH, CONF_HEIGHT, CONF_ROTATION, + CONF_MIRROR_X, + CONF_MIRROR_Y, + CONF_SWAP_XY, + CONF_COLOR_ORDER, + CONF_OFFSET_HEIGHT, + CONF_OFFSET_WIDTH, + CONF_TRANSFORM, + CONF_INVERT_COLORS, ) DEPENDENCIES = ["spi"] @@ -70,14 +78,6 @@ COLOR_PALETTE = cv.one_of("NONE", "GRAYSCALE", "IMAGE_ADAPTIVE") CONF_LED_PIN = "led_pin" CONF_COLOR_PALETTE_IMAGES = "color_palette_images" CONF_INVERT_DISPLAY = "invert_display" -CONF_INVERT_COLORS = "invert_colors" -CONF_MIRROR_X = "mirror_x" -CONF_MIRROR_Y = "mirror_y" -CONF_SWAP_XY = "swap_xy" -CONF_COLOR_ORDER = "color_order" -CONF_OFFSET_HEIGHT = "offset_height" -CONF_OFFSET_WIDTH = "offset_width" -CONF_TRANSFORM = "transform" def _validate(config): diff --git a/esphome/components/st7567_base/__init__.py b/esphome/components/st7567_base/__init__.py index 462d7be6a1..7ce50fd99f 100644 --- a/esphome/components/st7567_base/__init__.py +++ b/esphome/components/st7567_base/__init__.py @@ -5,6 +5,10 @@ from esphome.components import display from esphome.const import ( CONF_LAMBDA, CONF_RESET_PIN, + CONF_MIRROR_X, + CONF_MIRROR_Y, + CONF_TRANSFORM, + CONF_INVERT_COLORS, ) CODEOWNERS = ["@latonita"] @@ -14,10 +18,6 @@ ST7567 = st7567_base_ns.class_("ST7567", cg.PollingComponent, display.DisplayBuf ST7567Model = st7567_base_ns.enum("ST7567Model") # todo in future: reuse following constants from const.py when they are released -CONF_INVERT_COLORS = "invert_colors" -CONF_TRANSFORM = "transform" -CONF_MIRROR_X = "mirror_x" -CONF_MIRROR_Y = "mirror_y" ST7567_SCHEMA = display.FULL_DISPLAY_SCHEMA.extend( diff --git a/esphome/components/st7735/display.py b/esphome/components/st7735/display.py index 4ff5cafaf8..d5bb2fa3d6 100644 --- a/esphome/components/st7735/display.py +++ b/esphome/components/st7735/display.py @@ -10,6 +10,7 @@ from esphome.const import ( CONF_MODEL, CONF_RESET_PIN, CONF_PAGES, + CONF_INVERT_COLORS, ) from . import st7735_ns @@ -23,7 +24,6 @@ CONF_ROW_START = "row_start" CONF_COL_START = "col_start" CONF_EIGHT_BIT_COLOR = "eight_bit_color" CONF_USE_BGR = "use_bgr" -CONF_INVERT_COLORS = "invert_colors" SPIST7735 = st7735_ns.class_( "ST7735", cg.PollingComponent, display.DisplayBuffer, spi.SPIDevice diff --git a/esphome/components/st7789v/display.py b/esphome/components/st7789v/display.py index 5b2b5a126c..04dce2cf6c 100644 --- a/esphome/components/st7789v/display.py +++ b/esphome/components/st7789v/display.py @@ -14,12 +14,12 @@ from esphome.const import ( CONF_POWER_SUPPLY, CONF_ROTATION, CONF_CS_PIN, + CONF_OFFSET_HEIGHT, + CONF_OFFSET_WIDTH, ) from . import st7789v_ns CONF_EIGHTBITCOLOR = "eightbitcolor" -CONF_OFFSET_HEIGHT = "offset_height" -CONF_OFFSET_WIDTH = "offset_width" CODEOWNERS = ["@kbx81"] diff --git a/esphome/components/touchscreen/__init__.py b/esphome/components/touchscreen/__init__.py index 99aee5c9fb..c4945617f9 100644 --- a/esphome/components/touchscreen/__init__.py +++ b/esphome/components/touchscreen/__init__.py @@ -3,7 +3,14 @@ import esphome.codegen as cg from esphome.components import display from esphome import automation -from esphome.const import CONF_ON_TOUCH, CONF_ON_RELEASE +from esphome.const import ( + CONF_ON_TOUCH, + CONF_ON_RELEASE, + CONF_MIRROR_X, + CONF_MIRROR_Y, + CONF_SWAP_XY, + CONF_TRANSFORM, +) from esphome.core import coroutine_with_priority CODEOWNERS = ["@jesserockz", "@nielsnl68"] @@ -26,11 +33,6 @@ CONF_REPORT_INTERVAL = "report_interval" # not used yet: CONF_ON_UPDATE = "on_update" CONF_TOUCH_TIMEOUT = "touch_timeout" -CONF_MIRROR_X = "mirror_x" -CONF_MIRROR_Y = "mirror_y" -CONF_SWAP_XY = "swap_xy" -CONF_TRANSFORM = "transform" - def touchscreen_schema(default_touch_timeout): return cv.Schema( diff --git a/esphome/const.py b/esphome/const.py index 4a4a59f659..7e27254d76 100644 --- a/esphome/const.py +++ b/esphome/const.py @@ -127,6 +127,7 @@ CONF_COLOR_BRIGHTNESS = "color_brightness" CONF_COLOR_CORRECT = "color_correct" CONF_COLOR_INTERLOCK = "color_interlock" CONF_COLOR_MODE = "color_mode" +CONF_COLOR_ORDER = "color_order" CONF_COLOR_PALETTE = "color_palette" CONF_COLOR_TEMPERATURE = "color_temperature" CONF_COLORS = "colors" @@ -370,6 +371,7 @@ CONF_INTERRUPT_PIN = "interrupt_pin" CONF_INTERVAL = "interval" CONF_INVALID_COOLDOWN = "invalid_cooldown" CONF_INVERT = "invert" +CONF_INVERT_COLORS = "invert_colors" CONF_INVERTED = "inverted" CONF_IP_ADDRESS = "ip_address" CONF_IRQ_PIN = "irq_pin" @@ -454,6 +456,8 @@ CONF_MIN_VALUE = "min_value" CONF_MIN_VERSION = "min_version" CONF_MINUTE = "minute" CONF_MINUTES = "minutes" +CONF_MIRROR_X = "mirror_x" +CONF_MIRROR_Y = "mirror_y" CONF_MISO_PIN = "miso_pin" CONF_MODE = "mode" CONF_MODE_COMMAND_TOPIC = "mode_command_topic" @@ -485,6 +489,8 @@ CONF_NUMBER_DATAPOINT = "number_datapoint" CONF_OFF_MODE = "off_mode" CONF_OFF_SPEED_CYCLE = "off_speed_cycle" CONF_OFFSET = "offset" +CONF_OFFSET_HEIGHT = "offset_height" +CONF_OFFSET_WIDTH = "offset_width" CONF_ON = "on" CONF_ON_BLE_ADVERTISE = "on_ble_advertise" CONF_ON_BLE_MANUFACTURER_DATA_ADVERTISE = "on_ble_manufacturer_data_advertise" @@ -749,6 +755,7 @@ CONF_SUPPORTED_PRESETS = "supported_presets" CONF_SUPPORTED_SWING_MODES = "supported_swing_modes" CONF_SUPPORTS_COOL = "supports_cool" CONF_SUPPORTS_HEAT = "supports_heat" +CONF_SWAP_XY = "swap_xy" CONF_SWING_BOTH_ACTION = "swing_both_action" CONF_SWING_HORIZONTAL_ACTION = "swing_horizontal_action" CONF_SWING_MODE = "swing_mode" @@ -799,6 +806,7 @@ CONF_TOPIC_PREFIX = "topic_prefix" CONF_TOTAL = "total" CONF_TOTAL_POWER = "total_power" CONF_TRACES = "traces" +CONF_TRANSFORM = "transform" CONF_TRANSITION_LENGTH = "transition_length" CONF_TRIGGER_ID = "trigger_id" CONF_TRIGGER_PIN = "trigger_pin"