diff --git a/esphome/components/const/__init__.py b/esphome/components/const/__init__.py index 97d757c9d4..b67964d47f 100644 --- a/esphome/components/const/__init__.py +++ b/esphome/components/const/__init__.py @@ -41,7 +41,9 @@ CONF_ON_SCAN_END = "on_scan_end" CONF_ON_STATE_CHANGE = "on_state_change" CONF_PARITY = "parity" CONF_RECEIVER_FREQUENCY = "receiver_frequency" +CONF_RECONNECT_INTERVAL = "reconnect_interval" CONF_REQUEST_HEADERS = "request_headers" +CONF_ROLE = "role" CONF_ROWS = "rows" CONF_SCAN_PARAMETERS = "scan_parameters" CONF_SHA256 = "sha256" diff --git a/esphome/components/modbus/__init__.py b/esphome/components/modbus/__init__.py index fe93758726..db7484e306 100644 --- a/esphome/components/modbus/__init__.py +++ b/esphome/components/modbus/__init__.py @@ -7,6 +7,7 @@ from typing import Any, Literal, NamedTuple from esphome import pins import esphome.codegen as cg from esphome.components import uart +from esphome.components.const import CONF_ROLE import esphome.config_validation as cv from esphome.const import CONF_ADDRESS, CONF_CONTINUOUS, CONF_FLOW_CONTROL_PIN, CONF_ID from esphome.cpp_generator import MockObj @@ -45,7 +46,6 @@ MULTI_CONF = True CONF_ALLOW_BROADCAST_READ = "allow_broadcast_read" CONF_EXPECT_BROADCAST_WRITE_RESPONSE = "expect_broadcast_write_response" -CONF_ROLE = "role" CONF_MODBUS_ID = "modbus_id" CONF_SEND_WAIT_TIME = "send_wait_time" CONF_TURNAROUND_TIME = "turnaround_time" diff --git a/esphome/components/openthread_info/text_sensor.py b/esphome/components/openthread_info/text_sensor.py index da789ae706..4d3e8cd6c3 100644 --- a/esphome/components/openthread_info/text_sensor.py +++ b/esphome/components/openthread_info/text_sensor.py @@ -1,5 +1,6 @@ import esphome.codegen as cg from esphome.components import text_sensor +from esphome.components.const import CONF_ROLE from esphome.components.openthread.const import ( CONF_EXT_PAN_ID, CONF_NETWORK_KEY, @@ -10,7 +11,6 @@ import esphome.config_validation as cv from esphome.const import CONF_CHANNEL, CONF_IP_ADDRESS, ENTITY_CATEGORY_DIAGNOSTIC from esphome.types import ConfigType -CONF_ROLE = "role" CONF_RLOC16 = "rloc16" CONF_EUI64 = "eui64" CONF_EXT_ADDR = "ext_addr" diff --git a/esphome/components/tcp_uart/__init__.py b/esphome/components/tcp_uart/__init__.py index 20866d1a0c..e46e4dbfd0 100644 --- a/esphome/components/tcp_uart/__init__.py +++ b/esphome/components/tcp_uart/__init__.py @@ -4,6 +4,7 @@ from esphome.components.const import ( CONF_DATA_BITS, CONF_HOST, CONF_PARITY, + CONF_RECONNECT_INTERVAL, CONF_STOP_BITS, ) import esphome.config_validation as cv @@ -24,7 +25,6 @@ MULTI_CONF = True tcp_uart_ns = cg.esphome_ns.namespace("tcp_uart") TcpUart = tcp_uart_ns.class_("TcpUart", uart.UARTComponent, cg.Component) -CONF_RECONNECT_INTERVAL = "reconnect_interval" CONF_CONNECTED = "connected" diff --git a/tests/integration/fixtures/external_components/tcp_client_link_test_component/__init__.py b/tests/integration/fixtures/external_components/tcp_client_link_test_component/__init__.py index 24637ae586..58affd23b7 100644 --- a/tests/integration/fixtures/external_components/tcp_client_link_test_component/__init__.py +++ b/tests/integration/fixtures/external_components/tcp_client_link_test_component/__init__.py @@ -1,14 +1,12 @@ import esphome.codegen as cg from esphome.components import socket -from esphome.components.const import CONF_HOST +from esphome.components.const import CONF_HOST, CONF_RECONNECT_INTERVAL import esphome.config_validation as cv from esphome.const import CONF_ID, CONF_PORT from esphome.types import ConfigType AUTO_LOAD = ["socket"] -CONF_RECONNECT_INTERVAL = "reconnect_interval" - tcp_client_link_test_component_ns = cg.esphome_ns.namespace( "tcp_client_link_test_component" )