Migrate some constants to core code (#6692)

This commit is contained in:
Clyde Stubbs 2024-05-08 05:26:04 +10:00 committed by GitHub
parent 5edf4970bd
commit 829bfbdaa4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
9 changed files with 17 additions and 15 deletions

View file

@ -54,7 +54,6 @@ FAST_FILTER = {
"LSB10": 7,
}
CONF_ANGLE = "angle"
CONF_RAW_ANGLE = "raw_angle"
CONF_RAW_POSITION = "raw_position"
CONF_WATCHDOG = "watchdog"

View file

@ -11,6 +11,7 @@ from esphome.const import (
CONF_MAGNITUDE,
CONF_STATUS,
CONF_POSITION,
CONF_ANGLE,
)
from .. import as5600_ns, AS5600Component
@ -19,7 +20,6 @@ DEPENDENCIES = ["as5600"]
AS5600Sensor = as5600_ns.class_("AS5600Sensor", sensor.Sensor, cg.PollingComponent)
CONF_ANGLE = "angle"
CONF_RAW_ANGLE = "raw_angle"
CONF_RAW_POSITION = "raw_position"
CONF_WATCHDOG = "watchdog"

View file

@ -23,7 +23,6 @@ CODEOWNERS = ["@numo68"]
display_menu_base_ns = cg.esphome_ns.namespace("display_menu_base")
CONF_DISPLAY_ID = "display_id"
CONF_ROTARY = "rotary"
CONF_JOYSTICK = "joystick"

View file

@ -3,6 +3,7 @@ import esphome.config_validation as cv
from esphome.const import (
CONF_ID,
CONF_DIMENSIONS,
CONF_DISPLAY_ID,
)
from esphome.core.entity_helpers import inherit_property_from
from esphome.components import lcd_base
@ -18,8 +19,6 @@ AUTO_LOAD = ["display_menu_base"]
lcd_menu_ns = cg.esphome_ns.namespace("lcd_menu")
CONF_DISPLAY_ID = "display_id"
CONF_MARK_SELECTED = "mark_selected"
CONF_MARK_EDITING = "mark_editing"
CONF_MARK_SUBMENU = "mark_submenu"

View file

@ -1,12 +1,9 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import binary_sensor
from esphome.const import CONF_ID, CONF_KEY
from esphome.const import CONF_ID, CONF_KEY, CONF_ROW, CONF_COL
from .. import MatrixKeypad, matrix_keypad_ns, CONF_KEYPAD_ID
CONF_ROW = "row"
CONF_COL = "col"
DEPENDENCIES = ["matrix_keypad"]
MatrixKeypadBinarySensor = matrix_keypad_ns.class_(

View file

@ -3,7 +3,13 @@ import esphome.config_validation as cv
import esphome.codegen as cg
from esphome.automation import maybe_simple_id
from esphome.const import CONF_ID, CONF_ON_STATE, CONF_TRIGGER_ID, CONF_VOLUME
from esphome.const import (
CONF_ID,
CONF_ON_STATE,
CONF_TRIGGER_ID,
CONF_VOLUME,
CONF_ON_IDLE,
)
from esphome.core import CORE
from esphome.coroutine import coroutine_with_priority
from esphome.cpp_helpers import setup_entity
@ -43,7 +49,6 @@ VolumeSetAction = media_player_ns.class_(
)
CONF_ON_IDLE = "on_idle"
CONF_ON_PLAY = "on_play"
CONF_ON_PAUSE = "on_pause"
CONF_MEDIA_URL = "media_url"

View file

@ -1,12 +1,10 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import binary_sensor
from esphome.const import CONF_ROW, CONF_COL
from .. import SX1509Component, sx1509_ns, CONF_SX1509_ID
CONF_ROW = "row"
CONF_COL = "col"
DEPENDENCIES = ["sx1509"]
SX1509BinarySensor = sx1509_ns.class_("SX1509BinarySensor", binary_sensor.BinarySensor)

View file

@ -8,6 +8,7 @@ from esphome.const import (
CONF_MEDIA_PLAYER,
CONF_ON_CLIENT_CONNECTED,
CONF_ON_CLIENT_DISCONNECTED,
CONF_ON_IDLE,
)
from esphome import automation
from esphome.automation import register_action, register_condition
@ -32,7 +33,6 @@ CONF_ON_TTS_START = "on_tts_start"
CONF_ON_TTS_STREAM_START = "on_tts_stream_start"
CONF_ON_TTS_STREAM_END = "on_tts_stream_end"
CONF_ON_WAKE_WORD_DETECTED = "on_wake_word_detected"
CONF_ON_IDLE = "on_idle"
CONF_SILENCE_DETECTION = "silence_detection"
CONF_USE_WAKE_WORD = "use_wake_word"

View file

@ -51,6 +51,7 @@ CONF_ALPHA = "alpha"
CONF_ALTITUDE = "altitude"
CONF_ANALOG = "analog"
CONF_AND = "and"
CONF_ANGLE = "angle"
CONF_AP = "ap"
CONF_APPARENT_POWER = "apparent_power"
CONF_ARDUINO_VERSION = "arduino_version"
@ -124,6 +125,7 @@ CONF_CLOSE_DURATION = "close_duration"
CONF_CLOSE_ENDSTOP = "close_endstop"
CONF_CO2 = "co2"
CONF_CODE = "code"
CONF_COL = "col"
CONF_COLD_WHITE = "cold_white"
CONF_COLD_WHITE_COLOR_TEMPERATURE = "cold_white_color_temperature"
CONF_COLOR = "color"
@ -218,6 +220,7 @@ CONF_DISCOVERY_PREFIX = "discovery_prefix"
CONF_DISCOVERY_RETAIN = "discovery_retain"
CONF_DISCOVERY_UNIQUE_ID_GENERATOR = "discovery_unique_id_generator"
CONF_DISPLAY = "display"
CONF_DISPLAY_ID = "display_id"
CONF_DISTANCE = "distance"
CONF_DITHER = "dither"
CONF_DIV_RATIO = "div_ratio"
@ -539,6 +542,7 @@ CONF_ON_FINGER_SCAN_MISPLACED = "on_finger_scan_misplaced"
CONF_ON_FINGER_SCAN_START = "on_finger_scan_start"
CONF_ON_FINGER_SCAN_UNMATCHED = "on_finger_scan_unmatched"
CONF_ON_FINISHED_WRITE = "on_finished_write"
CONF_ON_IDLE = "on_idle"
CONF_ON_JSON_MESSAGE = "on_json_message"
CONF_ON_LOCK = "on_lock"
CONF_ON_LOOP = "on_loop"
@ -702,6 +706,7 @@ CONF_RGBW = "rgbw"
CONF_RISING_EDGE = "rising_edge"
CONF_RMT_CHANNEL = "rmt_channel"
CONF_ROTATION = "rotation"
CONF_ROW = "row"
CONF_RS_PIN = "rs_pin"
CONF_RTD_NOMINAL_RESISTANCE = "rtd_nominal_resistance"
CONF_RTD_WIRES = "rtd_wires"