Set "CONF_" CI counter to fail on 3 or more definitions (#6668)

This commit is contained in:
Jesse Hills 2024-05-05 17:32:47 +12:00 committed by GitHub
parent c7c0d97a5e
commit ccbf5148aa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
55 changed files with 95 additions and 81 deletions

View file

@ -19,6 +19,7 @@ from esphome.const import (
CONF_RESET_PIN,
CONF_REVERSE_ACTIVE_ENERGY,
CONF_VOLTAGE,
CONF_VOLTAGE_GAIN,
DEVICE_CLASS_APPARENT_POWER,
DEVICE_CLASS_CURRENT,
DEVICE_CLASS_ENERGY,
@ -47,7 +48,6 @@ CONF_CURRENT_GAIN = "current_gain"
CONF_IRQ0_PIN = "irq0_pin"
CONF_IRQ1_PIN = "irq1_pin"
CONF_POWER_GAIN = "power_gain"
CONF_VOLTAGE_GAIN = "voltage_gain"
CONF_NEUTRAL = "neutral"

View file

@ -6,6 +6,7 @@ from esphome.const import (
CONF_IRQ_PIN,
CONF_VOLTAGE,
CONF_FREQUENCY,
CONF_VOLTAGE_GAIN,
DEVICE_CLASS_CURRENT,
DEVICE_CLASS_APPARENT_POWER,
DEVICE_CLASS_POWER,
@ -36,7 +37,6 @@ CONF_POWER_FACTOR_B = "power_factor_b"
CONF_VOLTAGE_PGA_GAIN = "voltage_pga_gain"
CONF_CURRENT_PGA_GAIN_A = "current_pga_gain_a"
CONF_CURRENT_PGA_GAIN_B = "current_pga_gain_b"
CONF_VOLTAGE_GAIN = "voltage_gain"
CONF_CURRENT_GAIN_A = "current_gain_a"
CONF_CURRENT_GAIN_B = "current_gain_b"
CONF_ACTIVE_POWER_GAIN_A = "active_power_gain_a"

View file

@ -22,7 +22,6 @@ CONF_AT581X_ID = "at581x_id"
CONF_SENSING_DISTANCE = "sensing_distance"
CONF_SENSITIVITY = "sensitivity"
CONF_POWERON_SELFCHECK_TIME = "poweron_selfcheck_time"
CONF_PROTECT_TIME = "protect_time"
CONF_TRIGGER_BASE = "trigger_base"

View file

@ -6,6 +6,7 @@ from esphome.const import (
CONF_ENERGY,
CONF_EXTERNAL_TEMPERATURE,
CONF_ID,
CONF_INTERNAL_TEMPERATURE,
CONF_POWER,
CONF_VOLTAGE,
DEVICE_CLASS_CURRENT,
@ -24,7 +25,6 @@ from esphome.const import (
DEPENDENCIES = ["uart"]
CONF_INTERNAL_TEMPERATURE = "internal_temperature"
bl0940_ns = cg.esphome_ns.namespace("bl0940")
BL0940 = bl0940_ns.class_("BL0940", cg.PollingComponent, uart.UARTDevice)

View file

@ -1,7 +1,7 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import i2c, esp32
from esphome.const import CONF_ID
from esphome.const import CONF_ID, CONF_TEMPERATURE_OFFSET
CODEOWNERS = ["@trvrnrth"]
DEPENDENCIES = ["i2c"]
@ -9,7 +9,6 @@ AUTO_LOAD = ["sensor", "text_sensor"]
MULTI_CONF = True
CONF_BME680_BSEC_ID = "bme680_bsec_id"
CONF_TEMPERATURE_OFFSET = "temperature_offset"
CONF_IAQ_MODE = "iaq_mode"
CONF_SUPPLY_VOLTAGE = "supply_voltage"
CONF_SAMPLE_RATE = "sample_rate"

View file

@ -6,6 +6,7 @@ from esphome.const import (
CONF_ID,
CONF_POWER,
CONF_VOLTAGE,
CONF_VOLTAGE_GAIN,
UNIT_VOLT,
UNIT_AMPERE,
UNIT_WATT,
@ -33,7 +34,6 @@ CONF_SAMPLES = "samples"
CONF_PHASE_OFFSET = "phase_offset"
CONF_PGA_GAIN = "pga_gain"
CONF_CURRENT_GAIN = "current_gain"
CONF_VOLTAGE_GAIN = "voltage_gain"
CONF_CURRENT_HPF = "current_hpf"
CONF_VOLTAGE_HPF = "voltage_hpf"
CONF_PULSE_ENERGY = "pulse_energy"

View file

@ -1,14 +1,13 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import climate_ir
from esphome.const import CONF_ID
from esphome.const import CONF_ID, CONF_USE_FAHRENHEIT
AUTO_LOAD = ["climate_ir"]
daikin_brc_ns = cg.esphome_ns.namespace("daikin_brc")
DaikinBrcClimate = daikin_brc_ns.class_("DaikinBrcClimate", climate_ir.ClimateIR)
CONF_USE_FAHRENHEIT = "use_fahrenheit"
CONFIG_SCHEMA = climate_ir.CLIMATE_IR_WITH_RECEIVER_SCHEMA.extend(
{

View file

@ -2,7 +2,7 @@ import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation
from esphome.automation import maybe_simple_id
from esphome.const import CONF_ID
from esphome.const import CONF_FACTORY_RESET, CONF_ID, CONF_SENSITIVITY
from esphome.components import uart
CODEOWNERS = ["@niklasweber"]
@ -28,8 +28,6 @@ CONF_DELAY_AFTER_DETECT = "delay_after_detect"
CONF_DELAY_AFTER_DISAPPEAR = "delay_after_disappear"
CONF_DETECTION_SEGMENTS = "detection_segments"
CONF_OUTPUT_LATENCY = "output_latency"
CONF_FACTORY_RESET = "factory_reset"
CONF_SENSITIVITY = "sensitivity"
CONFIG_SCHEMA = cv.All(
cv.Schema(

View file

@ -4,6 +4,7 @@ from esphome.components import sensor
from esphome.const import (
CONF_EXTERNAL_TEMPERATURE,
CONF_ID,
CONF_INTERNAL_TEMPERATURE,
CONF_SPEED,
DEVICE_CLASS_TEMPERATURE,
STATE_CLASS_MEASUREMENT,
@ -16,7 +17,6 @@ from .. import EMC2101_COMPONENT_SCHEMA, CONF_EMC2101_ID, emc2101_ns
DEPENDENCIES = ["emc2101"]
CONF_INTERNAL_TEMPERATURE = "internal_temperature"
CONF_DUTY_CYCLE = "duty_cycle"
EMC2101Sensor = emc2101_ns.class_("EMC2101Sensor", cg.PollingComponent)

View file

@ -2,6 +2,7 @@ import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import i2c, sensor
from esphome.const import (
CONF_COMPENSATION,
CONF_ECO2,
CONF_HUMIDITY,
CONF_ID,
@ -27,7 +28,6 @@ ENS160Component = ens160_ns.class_(
)
CONF_AQI = "aqi"
CONF_COMPENSATION = "compensation"
UNIT_INDEX = "index"
CONFIG_SCHEMA = (

View file

@ -1,7 +1,7 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation
from esphome.const import CONF_ID
from esphome.const import CONF_ENABLE_ON_BOOT, CONF_ID
from esphome.core import CORE
from esphome.components.esp32 import add_idf_sdkconfig_option, get_esp32_variant, const
@ -11,7 +11,6 @@ CONFLICTS_WITH = ["esp32_ble_beacon"]
CONF_BLE_ID = "ble_id"
CONF_IO_CAPABILITY = "io_capability"
CONF_ENABLE_ON_BOOT = "enable_on_boot"
NO_BLUETOOTH_VARIANTS = [const.VARIANT_ESP32S2]

View file

@ -14,6 +14,7 @@ from esphome.const import (
CONF_BRIGHTNESS,
CONF_CONTRAST,
CONF_TRIGGER_ID,
CONF_VSYNC_PIN,
)
from esphome.core import CORE
from esphome.components.esp32 import add_idf_sdkconfig_option
@ -112,7 +113,6 @@ ENUM_SPECIAL_EFFECT = {
}
# pin assignment
CONF_VSYNC_PIN = "vsync_pin"
CONF_HREF_PIN = "href_pin"
CONF_PIXEL_CLOCK_PIN = "pixel_clock_pin"
CONF_EXTERNAL_CLOCK = "external_clock"

View file

@ -1,7 +1,7 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import display, font, color
from esphome.const import CONF_ID, CONF_TRIGGER_ID
from esphome.const import CONF_DISPLAY, CONF_ID, CONF_TRIGGER_ID
from esphome import automation, core
from esphome.components.display_menu_base import (
@ -10,7 +10,6 @@ from esphome.components.display_menu_base import (
display_menu_to_code,
)
CONF_DISPLAY = "display"
CONF_FONT = "font"
CONF_MENU_ITEM_VALUE = "menu_item_value"
CONF_FOREGROUND_COLOR = "foreground_color"

View file

@ -6,12 +6,14 @@ from esphome.components import uart, climate, logger
from esphome import automation
from esphome.const import (
CONF_BEEPER,
CONF_DISPLAY,
CONF_ID,
CONF_LEVEL,
CONF_LOGGER,
CONF_LOGS,
CONF_MAX_TEMPERATURE,
CONF_MIN_TEMPERATURE,
CONF_OUTDOOR_TEMPERATURE,
CONF_PROTOCOL,
CONF_SUPPORTED_MODES,
CONF_SUPPORTED_PRESETS,
@ -43,11 +45,9 @@ CONF_ALTERNATIVE_SWING_CONTROL = "alternative_swing_control"
CONF_ANSWER_TIMEOUT = "answer_timeout"
CONF_CONTROL_METHOD = "control_method"
CONF_CONTROL_PACKET_SIZE = "control_packet_size"
CONF_DISPLAY = "display"
CONF_HORIZONTAL_AIRFLOW = "horizontal_airflow"
CONF_ON_ALARM_START = "on_alarm_start"
CONF_ON_ALARM_END = "on_alarm_end"
CONF_OUTDOOR_TEMPERATURE = "outdoor_temperature"
CONF_VERTICAL_AIRFLOW = "vertical_airflow"
CONF_WIFI_SIGNAL = "wifi_signal"

View file

@ -2,6 +2,7 @@ import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import sensor
from esphome.const import (
CONF_OUTDOOR_TEMPERATURE,
CONF_POWER,
CONF_HUMIDITY,
DEVICE_CLASS_CURRENT,
@ -41,7 +42,6 @@ CONF_OUTDOOR_COIL_TEMPERATURE = "outdoor_coil_temperature"
CONF_OUTDOOR_DEFROST_TEMPERATURE = "outdoor_defrost_temperature"
CONF_OUTDOOR_IN_AIR_TEMPERATURE = "outdoor_in_air_temperature"
CONF_OUTDOOR_OUT_AIR_TEMPERATURE = "outdoor_out_air_temperature"
CONF_OUTDOOR_TEMPERATURE = "outdoor_temperature"
# Additional icons
ICON_SNOWFLAKE_THERMOMETER = "mdi:snowflake-thermometer"

View file

@ -6,6 +6,7 @@ from esphome.const import (
CONF_FIELD_STRENGTH_X,
CONF_FIELD_STRENGTH_Y,
CONF_FIELD_STRENGTH_Z,
CONF_HEADING,
CONF_ID,
CONF_OVERSAMPLING,
CONF_RANGE,
@ -21,7 +22,6 @@ DEPENDENCIES = ["i2c"]
hmc5883l_ns = cg.esphome_ns.namespace("hmc5883l")
CONF_HEADING = "heading"
HMC5883LComponent = hmc5883l_ns.class_(
"HMC5883LComponent", cg.PollingComponent, i2c.I2CDevice

View file

@ -7,6 +7,7 @@ from esphome.const import (
CONF_ID,
CONF_LAMBDA,
CONF_MODEL,
CONF_OE_PIN,
CONF_PAGES,
CONF_WAKEUP_PIN,
)
@ -29,7 +30,6 @@ CONF_GREYSCALE = "greyscale"
CONF_GMOD_PIN = "gmod_pin"
CONF_GPIO0_ENABLE_PIN = "gpio0_enable_pin"
CONF_LE_PIN = "le_pin"
CONF_OE_PIN = "oe_pin"
CONF_PARTIAL_UPDATING = "partial_updating"
CONF_POWERUP_PIN = "powerup_pin"
CONF_SPH_PIN = "sph_pin"

View file

@ -3,6 +3,7 @@ import esphome.config_validation as cv
from esphome.components import i2c, sensor
from esphome.const import (
CONF_ID,
CONF_INTERNAL_TEMPERATURE,
CONF_TEMPERATURE,
DEVICE_CLASS_TEMPERATURE,
STATE_CLASS_MEASUREMENT,
@ -10,7 +11,6 @@ from esphome.const import (
ENTITY_CATEGORY_DIAGNOSTIC,
)
CONF_INTERNAL_TEMPERATURE = "internal_temperature"
DEPENDENCIES = ["i2c"]
kmeteriso_ns = cg.esphome_ns.namespace("kmeteriso")

View file

@ -8,13 +8,13 @@ from esphome.const import (
ENTITY_CATEGORY_DIAGNOSTIC,
ICON_MOTION_SENSOR,
ICON_ACCOUNT,
CONF_HAS_TARGET,
CONF_HAS_MOVING_TARGET,
CONF_HAS_STILL_TARGET,
)
from . import CONF_LD2410_ID, LD2410Component
DEPENDENCIES = ["ld2410"]
CONF_HAS_TARGET = "has_target"
CONF_HAS_MOVING_TARGET = "has_moving_target"
CONF_HAS_STILL_TARGET = "has_still_target"
CONF_OUT_PIN_PRESENCE_STATUS = "out_pin_presence_status"
CONFIG_SCHEMA = {

View file

@ -2,6 +2,8 @@ import esphome.codegen as cg
from esphome.components import button
import esphome.config_validation as cv
from esphome.const import (
CONF_FACTORY_RESET,
CONF_RESTART,
DEVICE_CLASS_RESTART,
ENTITY_CATEGORY_DIAGNOSTIC,
ENTITY_CATEGORY_CONFIG,
@ -15,8 +17,6 @@ QueryButton = ld2410_ns.class_("QueryButton", button.Button)
ResetButton = ld2410_ns.class_("ResetButton", button.Button)
RestartButton = ld2410_ns.class_("RestartButton", button.Button)
CONF_FACTORY_RESET = "factory_reset"
CONF_RESTART = "restart"
CONF_QUERY_PARAMS = "query_params"
CONFIG_SCHEMA = {

View file

@ -1,14 +1,13 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import binary_sensor
from esphome.const import CONF_ID, DEVICE_CLASS_OCCUPANCY
from esphome.const import CONF_ID, DEVICE_CLASS_OCCUPANCY, CONF_HAS_TARGET
from .. import ld2420_ns, LD2420Component, CONF_LD2420_ID
LD2420BinarySensor = ld2420_ns.class_(
"LD2420BinarySensor", binary_sensor.BinarySensor, cg.Component
)
CONF_HAS_TARGET = "has_target"
CONFIG_SCHEMA = cv.All(
cv.COMPONENT_SCHEMA.extend(

View file

@ -2,6 +2,7 @@ import esphome.codegen as cg
from esphome.components import button
import esphome.config_validation as cv
from esphome.const import (
CONF_FACTORY_RESET,
DEVICE_CLASS_RESTART,
ENTITY_CATEGORY_DIAGNOSTIC,
ENTITY_CATEGORY_CONFIG,
@ -19,7 +20,6 @@ LD2420FactoryResetButton = ld2420_ns.class_("LD2420FactoryResetButton", button.B
CONF_APPLY_CONFIG = "apply_config"
CONF_REVERT_CONFIG = "revert_config"
CONF_RESTART_MODULE = "restart_module"
CONF_FACTORY_RESET = "factory_reset"
CONFIG_SCHEMA = {

View file

@ -4,6 +4,7 @@ from esphome.components import sensor, voltage_sampler
from esphome.const import (
CONF_ID,
CONF_NUMBER,
CONF_REFERENCE_VOLTAGE,
UNIT_VOLT,
STATE_CLASS_MEASUREMENT,
DEVICE_CLASS_VOLTAGE,
@ -22,7 +23,6 @@ MCP3008Sensor = mcp3008_ns.class_(
voltage_sampler.VoltageSampler,
cg.Parented.template(MCP3008),
)
CONF_REFERENCE_VOLTAGE = "reference_voltage"
CONF_MCP3008_ID = "mcp3008_id"
CONFIG_SCHEMA = (

View file

@ -1,7 +1,7 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import spi
from esphome.const import CONF_ID
from esphome.const import CONF_ID, CONF_REFERENCE_VOLTAGE
DEPENDENCIES = ["spi"]
MULTI_CONF = True
@ -10,7 +10,6 @@ CODEOWNERS = ["@rsumner"]
mcp3204_ns = cg.esphome_ns.namespace("mcp3204")
MCP3204 = mcp3204_ns.class_("MCP3204", cg.Component, spi.SPIDevice)
CONF_REFERENCE_VOLTAGE = "reference_voltage"
CONFIG_SCHEMA = cv.Schema(
{

View file

@ -11,6 +11,7 @@ from esphome.const import (
CONF_CUSTOM_PRESETS,
CONF_ID,
CONF_NUM_ATTEMPTS,
CONF_OUTDOOR_TEMPERATURE,
CONF_PERIOD,
CONF_SUPPORTED_MODES,
CONF_SUPPORTED_PRESETS,
@ -37,7 +38,6 @@ from esphome.components.climate import (
CODEOWNERS = ["@dudanov"]
DEPENDENCIES = ["climate", "uart"]
AUTO_LOAD = ["sensor"]
CONF_OUTDOOR_TEMPERATURE = "outdoor_temperature"
CONF_POWER_USAGE = "power_usage"
CONF_HUMIDITY_SETPOINT = "humidity_setpoint"
midea_ac_ns = cg.esphome_ns.namespace("midea").namespace("ac")

View file

@ -1,7 +1,7 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import climate_ir
from esphome.const import CONF_ID
from esphome.const import CONF_ID, CONF_USE_FAHRENHEIT
AUTO_LOAD = ["climate_ir", "coolix"]
CODEOWNERS = ["@dudanov"]
@ -9,7 +9,6 @@ CODEOWNERS = ["@dudanov"]
midea_ir_ns = cg.esphome_ns.namespace("midea_ir")
MideaIR = midea_ir_ns.class_("MideaIR", climate_ir.ClimateIR)
CONF_USE_FAHRENHEIT = "use_fahrenheit"
CONFIG_SCHEMA = climate_ir.CLIMATE_IR_WITH_RECEIVER_SCHEMA.extend(
{

View file

@ -6,6 +6,7 @@ from esphome.const import (
CONF_FIELD_STRENGTH_X,
CONF_FIELD_STRENGTH_Y,
CONF_FIELD_STRENGTH_Z,
CONF_HEADING,
CONF_ID,
ICON_MAGNET,
STATE_CLASS_MEASUREMENT,
@ -19,8 +20,6 @@ DEPENDENCIES = ["i2c"]
mmc5603_ns = cg.esphome_ns.namespace("mmc5603")
CONF_HEADING = "heading"
MMC5603Component = mmc5603_ns.class_(
"MMC5603Component", cg.PollingComponent, i2c.I2CDevice
)

View file

@ -2,14 +2,19 @@ import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation
from esphome.components import nfc
from esphome.const import CONF_ID, CONF_ON_TAG_REMOVED, CONF_ON_TAG, CONF_TRIGGER_ID
from esphome.const import (
CONF_ID,
CONF_ON_FINISHED_WRITE,
CONF_ON_TAG_REMOVED,
CONF_ON_TAG,
CONF_TRIGGER_ID,
)
CODEOWNERS = ["@OttoWinter", "@jesserockz"]
AUTO_LOAD = ["binary_sensor", "nfc"]
MULTI_CONF = True
CONF_PN532_ID = "pn532_id"
CONF_ON_FINISHED_WRITE = "on_finished_write"
pn532_ns = cg.esphome_ns.namespace("pn532")
PN532 = pn532_ns.class_("PN532", cg.PollingComponent)

View file

@ -6,6 +6,8 @@ from esphome.components import nfc
from esphome.const import (
CONF_ID,
CONF_IRQ_PIN,
CONF_MESSAGE,
CONF_ON_FINISHED_WRITE,
CONF_ON_TAG_REMOVED,
CONF_ON_TAG,
CONF_TRIGGER_ID,
@ -18,8 +20,6 @@ CONF_EMULATION_MESSAGE = "emulation_message"
CONF_EMULATION_OFF = "emulation_off"
CONF_EMULATION_ON = "emulation_on"
CONF_INCLUDE_ANDROID_APP_RECORD = "include_android_app_record"
CONF_MESSAGE = "message"
CONF_ON_FINISHED_WRITE = "on_finished_write"
CONF_ON_EMULATED_TAG_SCAN = "on_emulated_tag_scan"
CONF_PN7150_ID = "pn7150_id"
CONF_POLLING_OFF = "polling_off"

View file

@ -6,6 +6,8 @@ from esphome.components import nfc
from esphome.const import (
CONF_ID,
CONF_IRQ_PIN,
CONF_MESSAGE,
CONF_ON_FINISHED_WRITE,
CONF_ON_TAG_REMOVED,
CONF_ON_TAG,
CONF_TRIGGER_ID,
@ -19,8 +21,6 @@ CONF_EMULATION_MESSAGE = "emulation_message"
CONF_EMULATION_OFF = "emulation_off"
CONF_EMULATION_ON = "emulation_on"
CONF_INCLUDE_ANDROID_APP_RECORD = "include_android_app_record"
CONF_MESSAGE = "message"
CONF_ON_FINISHED_WRITE = "on_finished_write"
CONF_ON_EMULATED_TAG_SCAN = "on_emulated_tag_scan"
CONF_PN7160_ID = "pn7160_id"
CONF_POLLING_OFF = "polling_off"

View file

@ -1,15 +1,19 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import pins
from esphome.const import CONF_ENABLE_TIME, CONF_ID, CONF_KEEP_ON_TIME, CONF_PIN
from esphome.const import (
CONF_ENABLE_ON_BOOT,
CONF_ENABLE_TIME,
CONF_ID,
CONF_KEEP_ON_TIME,
CONF_PIN,
)
CODEOWNERS = ["@esphome/core"]
power_supply_ns = cg.esphome_ns.namespace("power_supply")
PowerSupply = power_supply_ns.class_("PowerSupply", cg.Component)
MULTI_CONF = True
CONF_ENABLE_ON_BOOT = "enable_on_boot"
CONFIG_SCHEMA = cv.Schema(
{
cv.Required(CONF_ID): cv.declare_id(PowerSupply),

View file

@ -6,6 +6,7 @@ from esphome.const import (
CONF_FIELD_STRENGTH_X,
CONF_FIELD_STRENGTH_Y,
CONF_FIELD_STRENGTH_Z,
CONF_HEADING,
CONF_TEMPERATURE,
CONF_ID,
CONF_OVERSAMPLING,
@ -24,8 +25,6 @@ DEPENDENCIES = ["i2c"]
qmc5883l_ns = cg.esphome_ns.namespace("qmc5883l")
CONF_HEADING = "heading"
QMC5883LComponent = qmc5883l_ns.class_(
"QMC5883LComponent", cg.PollingComponent, i2c.I2CDevice
)

View file

@ -2,6 +2,7 @@ import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import sensor, resistance_sampler
from esphome.const import (
CONF_REFERENCE_VOLTAGE,
CONF_SENSOR,
STATE_CLASS_MEASUREMENT,
UNIT_OHM,
@ -18,7 +19,6 @@ ResistanceSensor = resistance_ns.class_(
resistance_sampler.ResistanceSampler,
)
CONF_REFERENCE_VOLTAGE = "reference_voltage"
CONF_CONFIGURATION = "configuration"
CONF_RESISTOR = "resistor"

View file

@ -3,11 +3,13 @@ import esphome.config_validation as cv
from esphome import pins
from esphome.components import display
from esphome.const import (
CONF_HSYNC_PIN,
CONF_RESET_PIN,
CONF_DATA_PINS,
CONF_ID,
CONF_IGNORE_STRAPPING_WARNING,
CONF_DIMENSIONS,
CONF_VSYNC_PIN,
CONF_WIDTH,
CONF_HEIGHT,
CONF_LAMBDA,
@ -29,8 +31,6 @@ DEPENDENCIES = ["esp32"]
CONF_DE_PIN = "de_pin"
CONF_PCLK_PIN = "pclk_pin"
CONF_HSYNC_PIN = "hsync_pin"
CONF_VSYNC_PIN = "vsync_pin"
CONF_HSYNC_FRONT_PORCH = "hsync_front_porch"
CONF_HSYNC_PULSE_WIDTH = "hsync_pulse_width"

View file

@ -8,6 +8,7 @@ from esphome.const import (
CONF_HUMIDITY,
CONF_TEMPERATURE,
CONF_CO2,
CONF_TEMPERATURE_OFFSET,
CONF_UPDATE_INTERVAL,
CONF_VALUE,
DEVICE_CLASS_CARBON_DIOXIDE,
@ -36,7 +37,6 @@ ForceRecalibrationWithReference = scd30_ns.class_(
CONF_AUTOMATIC_SELF_CALIBRATION = "automatic_self_calibration"
CONF_ALTITUDE_COMPENSATION = "altitude_compensation"
CONF_AMBIENT_PRESSURE_COMPENSATION = "ambient_pressure_compensation"
CONF_TEMPERATURE_OFFSET = "temperature_offset"
CONFIG_SCHEMA = (

View file

@ -10,6 +10,7 @@ from esphome.const import (
CONF_CO2,
CONF_HUMIDITY,
CONF_TEMPERATURE,
CONF_TEMPERATURE_OFFSET,
CONF_VALUE,
DEVICE_CLASS_CARBON_DIOXIDE,
DEVICE_CLASS_HUMIDITY,
@ -52,7 +53,6 @@ CONF_AMBIENT_PRESSURE_COMPENSATION = "ambient_pressure_compensation"
CONF_AMBIENT_PRESSURE_COMPENSATION_SOURCE = "ambient_pressure_compensation_source"
CONF_AUTOMATIC_SELF_CALIBRATION = "automatic_self_calibration"
CONF_MEASUREMENT_MODE = "measurement_mode"
CONF_TEMPERATURE_OFFSET = "temperature_offset"
CONFIG_SCHEMA = (

View file

@ -2,7 +2,7 @@ import esphome.codegen as cg
import esphome.config_validation as cv
from esphome import automation
from esphome.automation import maybe_simple_id
from esphome.const import CONF_ID, CONF_MODE, CONF_PARAMETERS
from esphome.const import CONF_ID, CONF_MODE, CONF_PARAMETERS, CONF_RESTART
from esphome.core import CORE, EsphomeError
CODEOWNERS = ["@esphome/core"]
@ -19,7 +19,6 @@ ParallelScript = script_ns.class_("ParallelScript", Script)
CONF_SCRIPT = "script"
CONF_SINGLE = "single"
CONF_RESTART = "restart"
CONF_QUEUED = "queued"
CONF_PARALLEL = "parallel"
CONF_MAX_RUNS = "max_runs"

View file

@ -3,10 +3,10 @@ from esphome.components import binary_sensor
import esphome.config_validation as cv
from esphome.const import (
DEVICE_CLASS_OCCUPANCY,
CONF_HAS_TARGET,
)
from . import CONF_MR24HPC1_ID, MR24HPC1Component
CONF_HAS_TARGET = "has_target"
CONFIG_SCHEMA = {
cv.GenerateID(CONF_MR24HPC1_ID): cv.use_id(MR24HPC1Component),

View file

@ -2,6 +2,7 @@ import esphome.codegen as cg
from esphome.components import button
import esphome.config_validation as cv
from esphome.const import (
CONF_RESTART,
DEVICE_CLASS_RESTART,
ENTITY_CATEGORY_CONFIG,
ICON_RESTART_ALERT,
@ -11,7 +12,6 @@ from .. import CONF_MR24HPC1_ID, MR24HPC1Component, mr24hpc1_ns
RestartButton = mr24hpc1_ns.class_("RestartButton", button.Button)
CustomSetEndButton = mr24hpc1_ns.class_("CustomSetEndButton", button.Button)
CONF_RESTART = "restart"
CONF_CUSTOM_SET_END = "custom_set_end"
CONFIG_SCHEMA = {

View file

@ -2,6 +2,7 @@ import esphome.codegen as cg
from esphome.components import number
import esphome.config_validation as cv
from esphome.const import (
CONF_SENSITIVITY,
ENTITY_CATEGORY_CONFIG,
)
from .. import CONF_MR24HPC1_ID, MR24HPC1Component, mr24hpc1_ns
@ -14,7 +15,6 @@ MotionTriggerTimeNumber = mr24hpc1_ns.class_("MotionTriggerTimeNumber", number.N
MotionToRestTimeNumber = mr24hpc1_ns.class_("MotionToRestTimeNumber", number.Number)
CustomUnmanTimeNumber = mr24hpc1_ns.class_("CustomUnmanTimeNumber", number.Number)
CONF_SENSITIVITY = "sensitivity"
CONF_CUSTOM_MODE = "custom_mode"
CONF_EXISTENCE_THRESHOLD = "existence_threshold"
CONF_MOTION_THRESHOLD = "motion_threshold"

View file

@ -3,6 +3,7 @@ import esphome.config_validation as cv
from esphome.components import i2c, sensor, sensirion_common
from esphome.const import (
CONF_COMPENSATION,
CONF_ID,
CONF_BASELINE,
CONF_ECO2,
@ -30,7 +31,6 @@ SGP30Component = sgp30_ns.class_(
CONF_ECO2_BASELINE = "eco2_baseline"
CONF_TVOC_BASELINE = "tvoc_baseline"
CONF_UPTIME = "uptime"
CONF_COMPENSATION = "compensation"
CONF_HUMIDITY_SOURCE = "humidity_source"

View file

@ -2,6 +2,7 @@ import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import i2c, sensor, sensirion_common
from esphome.const import (
CONF_COMPENSATION,
CONF_ID,
CONF_STORE_BASELINE,
CONF_TEMPERATURE_SOURCE,
@ -23,7 +24,6 @@ SGP4xComponent = sgp4x_ns.class_(
)
CONF_ALGORITHM_TUNING = "algorithm_tuning"
CONF_COMPENSATION = "compensation"
CONF_GAIN_FACTOR = "gain_factor"
CONF_GATING_MAX_DURATION_MINUTES = "gating_max_duration_minutes"
CONF_HUMIDITY_SOURCE = "humidity_source"

View file

@ -3,6 +3,7 @@ import esphome.config_validation as cv
from esphome import automation
from esphome.const import (
CONF_ID,
CONF_MESSAGE,
CONF_TRIGGER_ID,
)
from esphome.components import uart
@ -52,7 +53,6 @@ CONF_ON_INCOMING_CALL = "on_incoming_call"
CONF_ON_CALL_CONNECTED = "on_call_connected"
CONF_ON_CALL_DISCONNECTED = "on_call_disconnected"
CONF_RECIPIENT = "recipient"
CONF_MESSAGE = "message"
CONF_USSD = "ussd"
CONFIG_SCHEMA = cv.All(

View file

@ -8,6 +8,7 @@ from esphome.const import (
CONF_INVERTED,
CONF_DATA_PIN,
CONF_CLOCK_PIN,
CONF_OE_PIN,
CONF_OUTPUT,
CONF_TYPE,
)
@ -30,7 +31,6 @@ SN74HC595GPIOPin = sn74hc595_ns.class_(
CONF_SN74HC595 = "sn74hc595"
CONF_LATCH_PIN = "latch_pin"
CONF_OE_PIN = "oe_pin"
CONF_SR_COUNT = "sr_count"
TYPE_GPIO = "gpio"

View file

@ -7,10 +7,12 @@ from esphome.components import (
)
from esphome.const import (
CONF_DC_PIN,
CONF_HSYNC_PIN,
CONF_RESET_PIN,
CONF_DATA_PINS,
CONF_ID,
CONF_DIMENSIONS,
CONF_VSYNC_PIN,
CONF_WIDTH,
CONF_HEIGHT,
CONF_LAMBDA,
@ -44,8 +46,6 @@ from .init_sequences import (
CONF_INIT_SEQUENCE = "init_sequence"
CONF_DE_PIN = "de_pin"
CONF_PCLK_PIN = "pclk_pin"
CONF_HSYNC_PIN = "hsync_pin"
CONF_VSYNC_PIN = "vsync_pin"
CONF_HSYNC_PULSE_WIDTH = "hsync_pulse_width"
CONF_HSYNC_BACK_PORCH = "hsync_back_porch"

View file

@ -9,10 +9,10 @@ from esphome.const import (
CONF_DATA_PIN,
CONF_ID,
CONF_NUM_CHIPS,
CONF_OE_PIN,
)
CONF_LAT_PIN = "lat_pin"
CONF_OE_PIN = "oe_pin"
CODEOWNERS = ["@rnauber"]

View file

@ -5,6 +5,7 @@ from esphome.components import display
from esphome import automation
from esphome.const import (
CONF_DISPLAY,
CONF_ON_TOUCH,
CONF_ON_RELEASE,
CONF_ON_UPDATE,
@ -31,7 +32,6 @@ TouchPoints_t = cg.std_vector.template(TouchPoint)
TouchPoints_t_const_ref = TouchPoints_t.operator("ref").operator("const")
TouchListener = touchscreen_ns.class_("TouchListener")
CONF_DISPLAY = "display"
CONF_TOUCHSCREEN_ID = "touchscreen_id"
CONF_REPORT_INTERVAL = "report_interval" # not used yet:
CONF_TOUCH_TIMEOUT = "touch_timeout"

View file

@ -1,14 +1,13 @@
import esphome.codegen as cg
import esphome.config_validation as cv
from esphome.components import climate_ir
from esphome.const import CONF_ID
from esphome.const import CONF_ID, CONF_USE_FAHRENHEIT
AUTO_LOAD = ["climate_ir"]
whynter_ns = cg.esphome_ns.namespace("whynter")
Whynter = whynter_ns.class_("Whynter", climate_ir.ClimateIR)
CONF_USE_FAHRENHEIT = "use_fahrenheit"
CONFIG_SCHEMA = climate_ir.CLIMATE_IR_WITH_RECEIVER_SCHEMA.extend(
{

View file

@ -11,6 +11,7 @@ from esphome.const import (
CONF_DNS2,
CONF_DOMAIN,
CONF_ENABLE_BTM,
CONF_ENABLE_ON_BOOT,
CONF_ENABLE_RRM,
CONF_FAST_CONNECT,
CONF_GATEWAY,
@ -268,7 +269,6 @@ def _validate(config):
CONF_OUTPUT_POWER = "output_power"
CONF_PASSIVE_SCAN = "passive_scan"
CONF_ENABLE_ON_BOOT = "enable_on_boot"
CONFIG_SCHEMA = cv.All(
cv.Schema(
{

View file

@ -22,6 +22,8 @@ CONF_PEER_ALLOWED_IPS = "peer_allowed_ips"
CONF_PEER_PERSISTENT_KEEPALIVE = "peer_persistent_keepalive"
CONF_REQUIRE_CONNECTION_TO_PROCEED = "require_connection_to_proceed"
CONF_WIREGUARD_ID = "wireguard_id"
DEPENDENCIES = ["time"]
CODEOWNERS = ["@lhoracek", "@droscy", "@thomas0bernard"]

View file

@ -7,9 +7,8 @@ from esphome.const import (
ENTITY_CATEGORY_DIAGNOSTIC,
)
from . import Wireguard
from . import CONF_WIREGUARD_ID, Wireguard
CONF_WIREGUARD_ID = "wireguard_id"
CONF_ENABLED = "enabled"
DEPENDENCIES = ["wireguard"]

View file

@ -6,9 +6,8 @@ from esphome.const import (
ENTITY_CATEGORY_DIAGNOSTIC,
)
from . import Wireguard
from . import CONF_WIREGUARD_ID, Wireguard
CONF_WIREGUARD_ID = "wireguard_id"
CONF_LATEST_HANDSHAKE = "latest_handshake"
DEPENDENCIES = ["wireguard"]

View file

@ -6,9 +6,7 @@ from esphome.const import (
ENTITY_CATEGORY_DIAGNOSTIC,
)
from . import Wireguard
CONF_WIREGUARD_ID = "wireguard_id"
from . import CONF_WIREGUARD_ID, Wireguard
DEPENDENCIES = ["wireguard"]

View file

@ -141,6 +141,7 @@ CONF_COMMAND_RETAIN = "command_retain"
CONF_COMMAND_TOPIC = "command_topic"
CONF_COMMENT = "comment"
CONF_COMMIT = "commit"
CONF_COMPENSATION = "compensation"
CONF_COMPILE_PROCESS_LIMIT = "compile_process_limit"
CONF_COMPONENT_ID = "component_id"
CONF_COMPONENTS = "components"
@ -216,6 +217,7 @@ CONF_DISCOVERY_OBJECT_ID_GENERATOR = "discovery_object_id_generator"
CONF_DISCOVERY_PREFIX = "discovery_prefix"
CONF_DISCOVERY_RETAIN = "discovery_retain"
CONF_DISCOVERY_UNIQUE_ID_GENERATOR = "discovery_unique_id_generator"
CONF_DISPLAY = "display"
CONF_DISTANCE = "distance"
CONF_DITHER = "dither"
CONF_DIV_RATIO = "div_ratio"
@ -239,6 +241,7 @@ CONF_EFFECTS = "effects"
CONF_ELSE = "else"
CONF_ENABLE_BTM = "enable_btm"
CONF_ENABLE_IPV6 = "enable_ipv6"
CONF_ENABLE_ON_BOOT = "enable_on_boot"
CONF_ENABLE_PIN = "enable_pin"
CONF_ENABLE_PRIVATE_NETWORK_ACCESS = "enable_private_network_access"
CONF_ENABLE_RRM = "enable_rrm"
@ -261,6 +264,7 @@ CONF_EXTERNAL_CLOCK_INPUT = "external_clock_input"
CONF_EXTERNAL_COMPONENTS = "external_components"
CONF_EXTERNAL_TEMPERATURE = "external_temperature"
CONF_EXTERNAL_VCC = "external_vcc"
CONF_FACTORY_RESET = "factory_reset"
CONF_FALLING_EDGE = "falling_edge"
CONF_FAMILY = "family"
CONF_FAN_MODE = "fan_mode"
@ -323,7 +327,11 @@ CONF_GYROSCOPE_X = "gyroscope_x"
CONF_GYROSCOPE_Y = "gyroscope_y"
CONF_GYROSCOPE_Z = "gyroscope_z"
CONF_HARDWARE_UART = "hardware_uart"
CONF_HAS_MOVING_TARGET = "has_moving_target"
CONF_HAS_STILL_TARGET = "has_still_target"
CONF_HAS_TARGET = "has_target"
CONF_HEAD = "head"
CONF_HEADING = "heading"
CONF_HEARTBEAT = "heartbeat"
CONF_HEAT_ACTION = "heat_action"
CONF_HEAT_DEADBAND = "heat_deadband"
@ -337,6 +345,7 @@ CONF_HIGH = "high"
CONF_HIGH_VOLTAGE_REFERENCE = "high_voltage_reference"
CONF_HOUR = "hour"
CONF_HOURS = "hours"
CONF_HSYNC_PIN = "hsync_pin"
CONF_HUMIDITY = "humidity"
CONF_HUMIDITY_SENSOR = "humidity_sensor"
CONF_HYSTERESIS = "hysteresis"
@ -377,6 +386,7 @@ CONF_INTERLOCK = "interlock"
CONF_INTERNAL = "internal"
CONF_INTERNAL_FILTER = "internal_filter"
CONF_INTERNAL_FILTER_MODE = "internal_filter_mode"
CONF_INTERNAL_TEMPERATURE = "internal_temperature"
CONF_INTERRUPT = "interrupt"
CONF_INTERRUPT_PIN = "interrupt_pin"
CONF_INTERVAL = "interval"
@ -446,6 +456,7 @@ CONF_MEASUREMENT_SEQUENCE_NUMBER = "measurement_sequence_number"
CONF_MEDIA_PLAYER = "media_player"
CONF_MEDIUM = "medium"
CONF_MEMORY_BLOCKS = "memory_blocks"
CONF_MESSAGE = "message"
CONF_METHOD = "method"
CONF_MICROPHONE = "microphone"
CONF_MIN_BRIGHTNESS = "min_brightness"
@ -499,6 +510,7 @@ CONF_NUM_LEDS = "num_leds"
CONF_NUM_SCANS = "num_scans"
CONF_NUMBER = "number"
CONF_NUMBER_DATAPOINT = "number_datapoint"
CONF_OE_PIN = "oe_pin"
CONF_OFF_MODE = "off_mode"
CONF_OFF_SPEED_CYCLE = "off_speed_cycle"
CONF_OFFSET = "offset"
@ -526,6 +538,7 @@ CONF_ON_FINGER_SCAN_MATCHED = "on_finger_scan_matched"
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_JSON_MESSAGE = "on_json_message"
CONF_ON_LOCK = "on_lock"
CONF_ON_LOOP = "on_loop"
@ -568,6 +581,7 @@ CONF_OSCILLATION_COMMAND_TOPIC = "oscillation_command_topic"
CONF_OSCILLATION_OUTPUT = "oscillation_output"
CONF_OSCILLATION_STATE_TOPIC = "oscillation_state_topic"
CONF_OTA = "ota"
CONF_OUTDOOR_TEMPERATURE = "outdoor_temperature"
CONF_OUTPUT = "output"
CONF_OUTPUT_ID = "output_id"
CONF_OUTPUTS = "outputs"
@ -666,6 +680,7 @@ CONF_RED = "red"
CONF_REF = "ref"
CONF_REFERENCE_RESISTANCE = "reference_resistance"
CONF_REFERENCE_TEMPERATURE = "reference_temperature"
CONF_REFERENCE_VOLTAGE = "reference_voltage"
CONF_REFRESH = "refresh"
CONF_RELABEL = "relabel"
CONF_REPEAT = "repeat"
@ -674,6 +689,7 @@ CONF_RESET_DURATION = "reset_duration"
CONF_RESET_PIN = "reset_pin"
CONF_RESIZE = "resize"
CONF_RESOLUTION = "resolution"
CONF_RESTART = "restart"
CONF_RESTORE = "restore"
CONF_RESTORE_MODE = "restore_mode"
CONF_RESTORE_STATE = "restore_state"
@ -711,6 +727,7 @@ CONF_SEL_PIN = "sel_pin"
CONF_SEND_EVERY = "send_every"
CONF_SEND_FIRST_AT = "send_first_at"
CONF_SENSING_PIN = "sensing_pin"
CONF_SENSITIVITY = "sensitivity"
CONF_SENSOR = "sensor"
CONF_SENSOR_DATAPOINT = "sensor_datapoint"
CONF_SENSOR_ID = "sensor_id"
@ -804,6 +821,7 @@ CONF_TARGET_TEMPERATURE_LOW_COMMAND_TOPIC = "target_temperature_low_command_topi
CONF_TARGET_TEMPERATURE_LOW_STATE_TOPIC = "target_temperature_low_state_topic"
CONF_TARGET_TEMPERATURE_STATE_TOPIC = "target_temperature_state_topic"
CONF_TEMPERATURE = "temperature"
CONF_TEMPERATURE_OFFSET = "temperature_offset"
CONF_TEMPERATURE_SOURCE = "temperature_source"
CONF_TEMPERATURE_STEP = "temperature_step"
CONF_TEXT_SENSORS = "text_sensors"
@ -852,6 +870,7 @@ CONF_UPDATE_ON_BOOT = "update_on_boot"
CONF_URL = "url"
CONF_USE_ABBREVIATIONS = "use_abbreviations"
CONF_USE_ADDRESS = "use_address"
CONF_USE_FAHRENHEIT = "use_fahrenheit"
CONF_USERNAME = "username"
CONF_UUID = "uuid"
CONF_VALIDITY_PERIOD = "validity_period"
@ -865,7 +884,9 @@ CONF_VISUAL = "visual"
CONF_VOLTAGE = "voltage"
CONF_VOLTAGE_ATTENUATION = "voltage_attenuation"
CONF_VOLTAGE_DIVIDER = "voltage_divider"
CONF_VOLTAGE_GAIN = "voltage_gain"
CONF_VOLUME = "volume"
CONF_VSYNC_PIN = "vsync_pin"
CONF_WAIT_TIME = "wait_time"
CONF_WAIT_UNTIL = "wait_until"
CONF_WAKEUP_PIN = "wakeup_pin"

View file

@ -476,7 +476,7 @@ def lint_no_byte_datatype(fname, match):
def lint_constants_usage():
errs = []
for constant, uses in CONSTANTS_USES.items():
if len(uses) < 4:
if len(uses) < 3:
continue
errs.append(
f"Constant {highlight(constant)} is defined in {len(uses)} files. Please move all definitions of the "