move constant to consts.py

This commit is contained in:
Anton Viktorov 2024-09-03 12:48:54 +02:00
parent 5f8f94aee1
commit 55a43a6755
5 changed files with 18 additions and 19 deletions

View file

@ -429,8 +429,6 @@ CONF_LVGL_ID = "lvgl_id"
CONF_LONG_MODE = "long_mode" CONF_LONG_MODE = "long_mode"
CONF_MSGBOXES = "msgboxes" CONF_MSGBOXES = "msgboxes"
CONF_OBJ = "obj" CONF_OBJ = "obj"
CONF_OFFSET_X = "offset_x"
CONF_OFFSET_Y = "offset_y"
CONF_ONE_CHECKED = "one_checked" CONF_ONE_CHECKED = "one_checked"
CONF_ONE_LINE = "one_line" CONF_ONE_LINE = "one_line"
CONF_ON_SELECT = "on_select" CONF_ON_SELECT = "on_select"

View file

@ -1,11 +1,9 @@
import esphome.config_validation as cv import esphome.config_validation as cv
from esphome.const import CONF_ANGLE, CONF_MODE from esphome.const import CONF_ANGLE, CONF_MODE, CONF_OFFSET_X, CONF_OFFSET_Y
from ..defines import ( from ..defines import (
CONF_ANTIALIAS, CONF_ANTIALIAS,
CONF_MAIN, CONF_MAIN,
CONF_OFFSET_X,
CONF_OFFSET_Y,
CONF_PIVOT_X, CONF_PIVOT_X,
CONF_PIVOT_Y, CONF_PIVOT_Y,
CONF_SRC, CONF_SRC,

View file

@ -1,7 +1,7 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import i2c
from esphome import automation from esphome import automation
import esphome.codegen as cg
from esphome.components import i2c
import esphome.config_validation as cv
from esphome.const import ( from esphome.const import (
CONF_ADDRESS, CONF_ADDRESS,
CONF_CALIBRATION, CONF_CALIBRATION,
@ -9,6 +9,9 @@ from esphome.const import (
CONF_MIRROR_X, CONF_MIRROR_X,
CONF_MIRROR_Y, CONF_MIRROR_Y,
CONF_MODEL, CONF_MODEL,
CONF_OFFSET_X,
CONF_OFFSET_Y,
CONF_OFFSET_Z,
CONF_RANGE, CONF_RANGE,
CONF_RESOLUTION, CONF_RESOLUTION,
CONF_SWAP_XY, CONF_SWAP_XY,
@ -22,9 +25,6 @@ DEPENDENCIES = ["i2c"]
CONF_MSA3XX_ID = "msa3xx_id" CONF_MSA3XX_ID = "msa3xx_id"
CONF_MIRROR_Z = "mirror_z" CONF_MIRROR_Z = "mirror_z"
CONF_OFFSET_X = "offset_x"
CONF_OFFSET_Y = "offset_y"
CONF_OFFSET_Z = "offset_z"
CONF_ON_ACTIVE = "on_active" CONF_ON_ACTIVE = "on_active"
CONF_ON_DOUBLE_TAP = "on_double_tap" CONF_ON_DOUBLE_TAP = "on_double_tap"
CONF_ON_FREEFALL = "on_freefall" CONF_ON_FREEFALL = "on_freefall"

View file

@ -1,15 +1,17 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import pins from esphome import pins
import esphome.codegen as cg
from esphome.components import display from esphome.components import display
import esphome.config_validation as cv
from esphome.const import ( from esphome.const import (
CONF_EXTERNAL_VCC,
CONF_LAMBDA,
CONF_MODEL,
CONF_RESET_PIN,
CONF_BRIGHTNESS, CONF_BRIGHTNESS,
CONF_CONTRAST, CONF_CONTRAST,
CONF_EXTERNAL_VCC,
CONF_INVERT, CONF_INVERT,
CONF_LAMBDA,
CONF_MODEL,
CONF_OFFSET_X,
CONF_OFFSET_Y,
CONF_RESET_PIN,
) )
ssd1306_base_ns = cg.esphome_ns.namespace("ssd1306_base") ssd1306_base_ns = cg.esphome_ns.namespace("ssd1306_base")
@ -18,8 +20,6 @@ SSD1306Model = ssd1306_base_ns.enum("SSD1306Model")
CONF_FLIP_X = "flip_x" CONF_FLIP_X = "flip_x"
CONF_FLIP_Y = "flip_y" CONF_FLIP_Y = "flip_y"
CONF_OFFSET_X = "offset_x"
CONF_OFFSET_Y = "offset_y"
MODELS = { MODELS = {
"SSD1306_128X32": SSD1306Model.SSD1306_MODEL_128_32, "SSD1306_128X32": SSD1306Model.SSD1306_MODEL_128_32,

View file

@ -533,6 +533,9 @@ CONF_OFF_SPEED_CYCLE = "off_speed_cycle"
CONF_OFFSET = "offset" CONF_OFFSET = "offset"
CONF_OFFSET_HEIGHT = "offset_height" CONF_OFFSET_HEIGHT = "offset_height"
CONF_OFFSET_WIDTH = "offset_width" CONF_OFFSET_WIDTH = "offset_width"
CONF_OFFSET_X = "offset_x"
CONF_OFFSET_Y = "offset_y"
CONF_OFFSET_Z = "offset_z"
CONF_ON = "on" CONF_ON = "on"
CONF_ON_BLE_ADVERTISE = "on_ble_advertise" CONF_ON_BLE_ADVERTISE = "on_ble_advertise"
CONF_ON_BLE_MANUFACTURER_DATA_ADVERTISE = "on_ble_manufacturer_data_advertise" CONF_ON_BLE_MANUFACTURER_DATA_ADVERTISE = "on_ble_manufacturer_data_advertise"