[core] Add a DOMAIN constant to every component (#20395)

This commit is contained in:
Jesse Hills
2026-10-08 14:04:26 -10:00
committed by GitHub
parent b4bd95b2ac
commit e03db60a52
729 changed files with 863 additions and 3 deletions
+5
View File
@@ -230,6 +230,10 @@ file does, and it is the authority when they disagree. The most useful starting
```
* **Component Metadata:**
- `DOMAIN`: Required in every component's `__init__.py`, set to the component's own name as a plain
string (e.g. `DOMAIN = "my_component"`). Other code refers to the component through it, e.g.
`from esphome.components.my_component import DOMAIN`. Keep it in alphabetical order with the other
metadata constants. CI (`lint_component_domain`) fails without it.
- `DEPENDENCIES`: List of required components
- `AUTO_LOAD`: Components to automatically load
- `CONFLICTS_WITH`: Incompatible components
@@ -243,6 +247,7 @@ file does, and it is the authority when they disagree. The most useful starting
import esphome.config_validation as cv
from esphome.const import CONF_KEY, CONF_ID
DOMAIN = "my_component"
CONF_PARAM = "param" # A constant that does not yet exist in esphome/const.py
my_component_ns = cg.esphome_ns.namespace("my_component")
+1
View File
@@ -188,6 +188,7 @@ esphome/components/esp32_rmt_led_strip/* @jesserockz
esphome/components/esp8266/* @esphome/core
esphome/components/esp_ldo/* @clydebarrow
esphome/components/espectre/* @francescopace
esphome/components/esphome/ota/* @esphome/core
esphome/components/espnow/* @jesserockz
esphome/components/espnow/packet_transport/* @EasilyBoredEngineer
esphome/components/ethernet_info/* @gtjadsonsantos
+1
View File
@@ -1 +1,2 @@
CODEOWNERS = ["@MrSuicideParrot"]
DOMAIN = "a01nyub"
+1
View File
@@ -1 +1,2 @@
CODEOWNERS = ["@TH-Braemer"]
DOMAIN = "a02yyuw"
+1
View File
@@ -0,0 +1 @@
DOMAIN = "a4988"
@@ -1 +1,2 @@
CODEOWNERS = ["@DAVe3283"]
DOMAIN = "absolute_humidity"
+1
View File
@@ -0,0 +1 @@
DOMAIN = "ac_dimmer"
+1
View File
@@ -9,6 +9,7 @@ from esphome.cpp_generator import MockObj
from esphome.types import ConfigType
DEPENDENCIES = ["uart"]
DOMAIN = "adalight"
adalight_ns = cg.esphome_ns.namespace("adalight")
AdalightLightEffect = adalight_ns.class_(
+1
View File
@@ -22,6 +22,7 @@ from esphome.core import CORE
from esphome.types import ConfigType
CODEOWNERS = ["@esphome/core"]
DOMAIN = "adc"
adc_ns = cg.esphome_ns.namespace("adc")
@@ -5,6 +5,7 @@ from esphome.const import CONF_ID
from esphome.types import ConfigType
DEPENDENCIES = ["spi"]
DOMAIN = "adc128s102"
MULTI_CONF = True
CODEOWNERS = ["@DeerMaximum"]
@@ -0,0 +1 @@
DOMAIN = "addressable_light"
+1
View File
@@ -0,0 +1 @@
DOMAIN = "ade7880"
+1
View File
@@ -1 +1,2 @@
CODEOWNERS = ["@angelnu"]
DOMAIN = "ade7953"
@@ -27,6 +27,7 @@ from esphome.cpp_generator import MockObj
from esphome.types import ConfigType
CODEOWNERS = ["@angelnu"]
DOMAIN = "ade7953_base"
CONF_CURRENT_A = "current_a"
CONF_CURRENT_B = "current_b"
@@ -1 +1,2 @@
CODEOWNERS = ["@angelnu"]
DOMAIN = "ade7953_i2c"
@@ -1 +1,2 @@
CODEOWNERS = ["@angelnu"]
DOMAIN = "ade7953_spi"
+1
View File
@@ -5,6 +5,7 @@ from esphome.const import CONF_ID
from esphome.types import ConfigType
DEPENDENCIES = ["i2c"]
DOMAIN = "ads1115"
MULTI_CONF = True
ads1115_ns = cg.esphome_ns.namespace("ads1115")
+1
View File
@@ -6,6 +6,7 @@ from esphome.types import ConfigType
CODEOWNERS = ["@solomondg1"]
DEPENDENCIES = ["spi"]
DOMAIN = "ads1118"
MULTI_CONF = True
CONF_ADS1118_ID = "ads1118_id"
+1
View File
@@ -1 +1,2 @@
CODEOWNERS = ["@mak-42"]
DOMAIN = "ags10"
+1
View File
@@ -0,0 +1 @@
DOMAIN = "aht10"
+1
View File
@@ -0,0 +1 @@
DOMAIN = "aic3204"
@@ -6,6 +6,7 @@ from esphome.types import ConfigType
AUTO_LOAD = ["ble_device_base"]
CODEOWNERS = ["@jeromelaban"]
DOMAIN = "airthings_ble"
airthings_ble_ns = cg.esphome_ns.namespace("airthings_ble")
AirthingsListener = airthings_ble_ns.class_(
@@ -24,6 +24,7 @@ from esphome.cpp_generator import MockObj
from esphome.types import ConfigType
CODEOWNERS = ["@ncareau", "@jeromelaban"]
DOMAIN = "airthings_wave_base"
DEPENDENCIES = ["ble_client"]
@@ -1 +1,2 @@
CODEOWNERS = ["@ncareau"]
DOMAIN = "airthings_wave_mini"
@@ -1 +1,2 @@
CODEOWNERS = ["@jeromelaban", "@precurse"]
DOMAIN = "airthings_wave_plus"
@@ -21,6 +21,7 @@ from esphome.core.entity_helpers import (
from esphome.cpp_generator import MockObjClass
CODEOWNERS = ["@grahambrown11", "@hwstar"]
DOMAIN = "alarm_control_panel"
IS_PLATFORM_COMPONENT = True
CONF_ON_TRIGGERED = "on_triggered"
+1
View File
@@ -1 +1,2 @@
CODEOWNERS = ["@jan-hofmeier"]
DOMAIN = "alpha3"
+1
View File
@@ -1 +1,2 @@
CODEOWNERS = ["@swoboda1337"]
DOMAIN = "am2315c"
+1
View File
@@ -0,0 +1 @@
DOMAIN = "am2320"
+1
View File
@@ -1 +1,2 @@
CODEOWNERS = ["@buxtronix"]
DOMAIN = "am43"
@@ -1 +1,2 @@
CODEOWNERS = ["@ianchi"]
DOMAIN = "analog_threshold"
+1
View File
@@ -0,0 +1 @@
DOMAIN = "anova"
+1
View File
@@ -2,3 +2,4 @@
# https://www.mouser.ca/datasheet/2/678/AVGO_S_A0002854364_1-2574547.pdf
CODEOWNERS = ["@aodrenah"]
DOMAIN = "apds9306"
+1
View File
@@ -5,6 +5,7 @@ from esphome.const import CONF_ID
from esphome.types import ConfigType
DEPENDENCIES = ["i2c"]
DOMAIN = "apds9960"
MULTI_CONF = True
CONF_APDS9960_ID = "apds9960_id"
+1
View File
@@ -1,6 +1,7 @@
import esphome.codegen as cg
CODEOWNERS = ["@jasstrong", "@ximex", "@freekode"]
DOMAIN = "aqi"
aqi_ns = cg.esphome_ns.namespace("aqi")
AQICalculatorType = aqi_ns.enum("AQICalculatorType")
+1
View File
@@ -17,6 +17,7 @@ from esphome.const import (
from esphome.cpp_generator import MockObj
from esphome.types import ConfigType
DOMAIN = "as3935"
MULTI_CONF = True
CONF_AS3935_ID = "as3935_id"
@@ -6,6 +6,7 @@ from esphome.types import ConfigType
AUTO_LOAD = ["as3935"]
DEPENDENCIES = ["i2c"]
DOMAIN = "as3935_i2c"
as3935_i2c_ns = cg.esphome_ns.namespace("as3935_i2c")
I2CAS3935 = as3935_i2c_ns.class_("I2CAS3935Component", as3935.AS3935, i2c.I2CDevice)
@@ -6,6 +6,7 @@ from esphome.types import ConfigType
AUTO_LOAD = ["as3935"]
DEPENDENCIES = ["spi"]
DOMAIN = "as3935_spi"
as3935_spi_ns = cg.esphome_ns.namespace("as3935_spi")
SPIAS3935 = as3935_spi_ns.class_("SPIAS3935Component", as3935.AS3935, spi.SPIDevice)
+1
View File
@@ -18,6 +18,7 @@ from esphome.types import ConfigType
CODEOWNERS = ["@ammmze"]
DEPENDENCIES = ["i2c"]
DOMAIN = "as5600"
MULTI_CONF = True
as5600_ns = cg.esphome_ns.namespace("as5600")
+1
View File
@@ -0,0 +1 @@
DOMAIN = "as7341"
+1
View File
@@ -6,6 +6,7 @@ from esphome.types import ConfigType
CODEOWNERS = ["@esphome/core"]
DEPENDENCIES = ["network"]
DOMAIN = "async_tcp"
def AUTO_LOAD() -> list[str]:
+1
View File
@@ -8,6 +8,7 @@ from esphome.types import ConfigType
CODEOWNERS = ["@X-Ryl669"]
DEPENDENCIES = ["i2c"]
DOMAIN = "at581x"
MULTI_CONF = True
@@ -0,0 +1 @@
DOMAIN = "atc_mithermometer"
+1
View File
@@ -1 +1,2 @@
CODEOWNERS = ["@danieltwagner"]
DOMAIN = "atm90e26"
+1
View File
@@ -1,6 +1,7 @@
import esphome.codegen as cg
CODEOWNERS = ["@circuitsetup", "@descipher"]
DOMAIN = "atm90e32"
atm90e32_ns = cg.esphome_ns.namespace("atm90e32")
ATM90E32Component = atm90e32_ns.class_("ATM90E32Component", cg.Component)
+1
View File
@@ -6,6 +6,7 @@ from esphome.core import CoroPriority, coroutine_with_priority
from esphome.types import ConfigType
CODEOWNERS = ["@kbx81"]
DOMAIN = "audio_adc"
IS_PLATFORM_COMPONENT = True
audio_adc_ns = cg.esphome_ns.namespace("audio_adc")
+1
View File
@@ -7,6 +7,7 @@ from esphome.core import CoroPriority, coroutine_with_priority
from esphome.types import ConfigType
CODEOWNERS = ["@kbx81"]
DOMAIN = "audio_dac"
IS_PLATFORM_COMPONENT = True
audio_dac_ns = cg.esphome_ns.namespace("audio_dac")
@@ -0,0 +1 @@
DOMAIN = "audio_http"
+1
View File
@@ -2,5 +2,6 @@ import esphome.codegen as cg
CODEOWNERS = ["@clydebarrow"]
DEPENDENCIES = ["i2c"]
DOMAIN = "axs15231"
axs15231_ns = cg.esphome_ns.namespace("axs15231")
@@ -0,0 +1 @@
DOMAIN = "b_parasite"
+1
View File
@@ -0,0 +1 @@
DOMAIN = "ballu"
+1
View File
@@ -1 +1,2 @@
CODEOWNERS = ["@OttoWinter"]
DOMAIN = "bang_bang"
+1
View File
@@ -7,6 +7,7 @@ from esphome.types import ConfigType
CODEOWNERS = ["@jhansche"]
DEPENDENCIES = ["ble_client"]
DOMAIN = "bedjet"
MULTI_CONF = True
CONF_BEDJET_ID = "bedjet_id"
@@ -0,0 +1 @@
DOMAIN = "beken_spi_led_strip"
+1
View File
@@ -0,0 +1 @@
DOMAIN = "bh1750"
+1
View File
@@ -0,0 +1 @@
DOMAIN = "bh1900nux"
+2
View File
@@ -1,3 +1,5 @@
import esphome.codegen as cg
DOMAIN = "binary"
binary_ns = cg.esphome_ns.namespace("binary")
@@ -106,6 +106,7 @@ DEVICE_CLASSES = [
DEVICE_CLASS_VIBRATION,
DEVICE_CLASS_WINDOW,
]
DOMAIN = "binary_sensor"
IS_PLATFORM_COMPONENT = True
@@ -0,0 +1 @@
DOMAIN = "binary_sensor_map"
+1
View File
@@ -35,6 +35,7 @@ from .boards import BK72XX_BOARD_PINS, BK72XX_BOARDS
CODEOWNERS = ["@kuba2k2"]
AUTO_LOAD = ["libretiny"]
DOMAIN = "bk72xx"
IS_TARGET_PLATFORM = True
COMPONENT_DATA = LibreTinyComponent(
@@ -38,6 +38,7 @@ from esphome.types import ConfigType
DEPENDENCIES = ["bk72xx"]
CODEOWNERS = ["@Bl00d-B0b"]
DOMAIN = "bk72xx_ble"
_LOGGER = logging.getLogger(__name__)
@@ -44,6 +44,7 @@ CONF_BK72XX_BLE_ID = "bk72xx_ble_id"
DEPENDENCIES = ["bk72xx"]
AUTO_LOAD = ["ble_device_base", "bk72xx_ble"]
CODEOWNERS = ["@Bl00d-B0b"]
DOMAIN = "bk72xx_ble_tracker"
ble_device_base.register_hub_provider("bk72xx_ble_tracker")
+1
View File
@@ -1 +1,2 @@
CODEOWNERS = ["@athom-tech", "@tarontop", "@jesserockz"]
DOMAIN = "bl0906"
+1
View File
@@ -1 +1,2 @@
CODEOWNERS = ["@ziceva"]
DOMAIN = "bl0939"
+1
View File
@@ -1,6 +1,7 @@
import esphome.codegen as cg
CODEOWNERS = ["@tobias-", "@dan-s-github"]
DOMAIN = "bl0940"
CONF_BL0940_ID = "bl0940_id"
bl0940_ns = cg.esphome_ns.namespace("bl0940")
+1
View File
@@ -1 +1,2 @@
CODEOWNERS = ["@dbuezas", "@dwmw2"]
DOMAIN = "bl0942"
@@ -22,6 +22,7 @@ from esphome.types import ConfigType
AUTO_LOAD = ["esp32_ble_client"]
CODEOWNERS = ["@buxtronix", "@clydebarrow"]
DEPENDENCIES = ["esp32_ble_tracker"]
DOMAIN = "ble_client"
CONF_DESCRIPTOR_UUID = "descriptor_uuid"
CONF_ON_NOTIFY = "on_notify"
@@ -41,6 +41,7 @@ from esphome.core import CORE, ID, KEY_CORE, TimePeriod
from esphome.types import ConfigType
CODEOWNERS = ["@Bl00d-B0b"]
DOMAIN = "ble_device_base"
CONF_BLE_HUB_ID = "ble_hub_id"
+1
View File
@@ -21,6 +21,7 @@ from esphome.types import ConfigType
AUTO_LOAD = ["zephyr_ble_server", "uart"]
CODEOWNERS = ["@tomaszduda23"]
DOMAIN = "ble_nus"
ble_nus_ns = cg.esphome_ns.namespace("ble_nus")
BLENUS = ble_nus_ns.class_("BLENUS", cg.Component, UARTComponent)
@@ -0,0 +1 @@
DOMAIN = "ble_presence"
+1
View File
@@ -0,0 +1 @@
DOMAIN = "ble_rssi"
@@ -0,0 +1 @@
DOMAIN = "ble_scanner"
@@ -58,6 +58,7 @@ _HUB_PLATFORMS = (PLATFORM_BK72XX, PLATFORM_LN882X, PLATFORM_RP2)
DEPENDENCIES = ["api"]
CODEOWNERS = ["@jesserockz", "@bdraco"]
DOMAIN = "bluetooth_proxy"
_LOGGER = logging.getLogger(__name__)
+1
View File
@@ -1 +1,2 @@
CODEOWNERS = ["@abmantis"]
DOMAIN = "bm8563"
@@ -20,6 +20,7 @@ from esphome.cpp_generator import MockObj
from esphome.types import ConfigType
CODEOWNERS = ["@esphome/core"]
DOMAIN = "bme280_base"
bme280_ns = cg.esphome_ns.namespace("bme280_base")
BME280Oversampling = bme280_ns.enum("BME280Oversampling")
@@ -0,0 +1 @@
DOMAIN = "bme280_i2c"
@@ -0,0 +1 @@
DOMAIN = "bme280_spi"
+1
View File
@@ -0,0 +1 @@
DOMAIN = "bme680"
@@ -9,6 +9,7 @@ CODEOWNERS = ["@trvrnrth"]
DEPENDENCIES = ["i2c"]
AUTO_LOAD = ["sensor", "text_sensor"]
CONFLICTS_WITH = ["bme68x_bsec2"]
DOMAIN = "bme680_bsec"
MULTI_CONF = True
CONF_BME680_BSEC_ID = "bme680_bsec_id"
@@ -9,6 +9,7 @@ import esphome.config_validation as cv
from esphome.types import ConfigType
CODEOWNERS = ["@neffs", "@kbx81"]
DOMAIN = "bme68x_bsec2_i2c"
AUTO_LOAD = ["bme68x_bsec2"]
DEPENDENCIES = ["i2c"]
+1
View File
@@ -1 +1,2 @@
CODEOWNERS = ["@flaviut"]
DOMAIN = "bmi160"
+1
View File
@@ -3,6 +3,7 @@ from esphome.components import i2c
from esphome.components.motion import MotionComponent
CODEOWNERS = ["@clydebarrow"]
DOMAIN = "bmi270"
CONF_BMI270_ID = "bmi270_id"
# C++ namespace / class
+1
View File
@@ -0,0 +1 @@
DOMAIN = "bmp085"
+1
View File
@@ -0,0 +1 @@
DOMAIN = "bmp280"
@@ -17,6 +17,7 @@ from esphome.cpp_generator import MockObj
from esphome.types import ConfigType
CODEOWNERS = ["@ademuri"]
DOMAIN = "bmp280_base"
bmp280_ns = cg.esphome_ns.namespace("bmp280_base")
BMP280Oversampling = bmp280_ns.enum("BMP280Oversampling")
@@ -0,0 +1 @@
DOMAIN = "bmp280_i2c"
@@ -0,0 +1 @@
DOMAIN = "bmp280_spi"
+1
View File
@@ -0,0 +1 @@
DOMAIN = "bmp3xx"
@@ -17,6 +17,7 @@ from esphome.cpp_generator import MockObj
from esphome.types import ConfigType
CODEOWNERS = ["@martgras", "@latonita"]
DOMAIN = "bmp3xx_base"
bmp3xx_ns = cg.esphome_ns.namespace("bmp3xx_base")
Oversampling = bmp3xx_ns.enum("Oversampling")
@@ -0,0 +1 @@
DOMAIN = "bmp3xx_i2c"
@@ -0,0 +1 @@
DOMAIN = "bmp3xx_spi"
+1
View File
@@ -0,0 +1 @@
DOMAIN = "bmp581"
@@ -19,6 +19,7 @@ from esphome.cpp_generator import MockObj
from esphome.types import ConfigType
CODEOWNERS = ["@kahrendt", "@danielkent-net"]
DOMAIN = "bmp581_base"
bmp581_ns = cg.esphome_ns.namespace("bmp581_base")
@@ -0,0 +1 @@
DOMAIN = "bmp581_i2c"
@@ -0,0 +1 @@
DOMAIN = "bmp581_spi"
+1
View File
@@ -5,6 +5,7 @@ from esphome.const import CONF_CLOCK_PIN, CONF_DATA_PIN, CONF_ID
from esphome.types import ConfigType
CODEOWNERS = ["@Cossid"]
DOMAIN = "bp1658cj"
MULTI_CONF = True
CONF_MAX_POWER_COLOR_CHANNELS = "max_power_color_channels"
+1
View File
@@ -5,6 +5,7 @@ from esphome.const import CONF_CLOCK_PIN, CONF_DATA_PIN, CONF_ID
from esphome.types import ConfigType
CODEOWNERS = ["@Cossid"]
DOMAIN = "bp5758d"
MULTI_CONF = True
AUTO_LOAD = ["output"]
@@ -8,6 +8,7 @@ from esphome.types import ConfigType
CODEOWNERS = ["@nagyrobi"]
AUTO_LOAD = ["ble_device_base"]
DOMAIN = "bthome_mithermometer"
bthome_mithermometer_ns = cg.esphome_ns.namespace("bthome_mithermometer")
+1
View File
@@ -28,6 +28,7 @@ from esphome.cpp_generator import MockObj, MockObjClass
from esphome.types import ConfigType, SafeExpType
CODEOWNERS = ["@esphome/core"]
DOMAIN = "button"
IS_PLATFORM_COMPONENT = True
DEVICE_CLASSES = [
@@ -1,4 +1,5 @@
CODEOWNERS = ["@clydebarrow"]
DOMAIN = "bytebuffer"
# Allows bytebuffer to be configured in yaml, to allow use of the C++ api.

Some files were not shown because too many files have changed in this diff Show More