diff --git a/esphome/components/const/__init__.py b/esphome/components/const/__init__.py index b67964d47f..6e98162baa 100644 --- a/esphome/components/const/__init__.py +++ b/esphome/components/const/__init__.py @@ -7,6 +7,7 @@ BYTE_ORDER_BIG = "big_endian" CONF_ACCELEROMETER_ODR = "accelerometer_odr" CONF_ACCELEROMETER_RANGE = "accelerometer_range" +CONF_ALLOWED_IPS = "allowed_ips" CONF_B_CONSTANT = "b_constant" CONF_BREATH_VOC_EQUIVALENT = "breath_voc_equivalent" CONF_BYTE_ORDER = "byte_order" @@ -15,6 +16,7 @@ CONF_CLIMATE_ID = "climate_id" CONF_CO2_EQUIVALENT = "co2_equivalent" CONF_COLOR_DEPTH = "color_depth" CONF_COLUMNS = "columns" +CONF_CONNECTED = "connected" CONF_CONVERSION_RATE = "conversion_rate" CONF_CRC_ENABLE = "crc_enable" CONF_DATA_BITS = "data_bits" diff --git a/esphome/components/tcp_uart/__init__.py b/esphome/components/tcp_uart/__init__.py index dbe805c281..8e14e690f9 100644 --- a/esphome/components/tcp_uart/__init__.py +++ b/esphome/components/tcp_uart/__init__.py @@ -1,6 +1,8 @@ import esphome.codegen as cg from esphome.components import binary_sensor, socket, uart from esphome.components.const import ( + CONF_ALLOWED_IPS, + CONF_CONNECTED, CONF_DATA_BITS, CONF_HOST, CONF_PARITY, @@ -26,9 +28,6 @@ MULTI_CONF = True tcp_uart_ns = cg.esphome_ns.namespace("tcp_uart") TcpUart = tcp_uart_ns.class_("TcpUart", uart.UARTComponent, cg.Component) -CONF_ALLOWED_IPS = "allowed_ips" -CONF_CONNECTED = "connected" - BASE_SCHEMA = cv.Schema( { diff --git a/esphome/components/uart_tcp/__init__.py b/esphome/components/uart_tcp/__init__.py index cd56e2c8bc..3829f046ca 100644 --- a/esphome/components/uart_tcp/__init__.py +++ b/esphome/components/uart_tcp/__init__.py @@ -1,6 +1,12 @@ import esphome.codegen as cg from esphome.components import binary_sensor, socket, uart -from esphome.components.const import CONF_HOST, CONF_RECONNECT_INTERVAL, CONF_ROLE +from esphome.components.const import ( + CONF_ALLOWED_IPS, + CONF_CONNECTED, + CONF_HOST, + CONF_RECONNECT_INTERVAL, + CONF_ROLE, +) import esphome.config_validation as cv from esphome.const import ( CONF_ID, @@ -19,9 +25,6 @@ MULTI_CONF = True uart_tcp_ns = cg.esphome_ns.namespace("uart_tcp") UartTcp = uart_tcp_ns.class_("UartTcp", cg.Component, uart.UARTDevice) -CONF_ALLOWED_IPS = "allowed_ips" -CONF_CONNECTED = "connected" - BASE_SCHEMA = cv.Schema( {