From aa31c9ee594d94e99aba3553ec64c9b98f8232f9 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Thu, 9 Oct 2025 11:38:50 -1000 Subject: [PATCH] add modbus --- script/analyze_component_buses.py | 13 +++++++++++++ script/merge_component_configs.py | 9 ++++++++- tests/components/growatt_solar/common.yaml | 4 +--- .../components/growatt_solar/test.esp32-c3-idf.yaml | 2 +- tests/components/growatt_solar/test.esp32-idf.yaml | 2 +- .../components/growatt_solar/test.esp8266-ard.yaml | 2 +- tests/components/growatt_solar/test.rp2040-ard.yaml | 2 +- tests/components/havells_solar/common.yaml | 4 +--- .../components/havells_solar/test.esp32-c3-idf.yaml | 2 +- tests/components/havells_solar/test.esp32-idf.yaml | 2 +- .../components/havells_solar/test.esp8266-ard.yaml | 2 +- tests/components/havells_solar/test.rp2040-ard.yaml | 2 +- tests/components/kuntze/common.yaml | 4 +--- tests/components/kuntze/test.esp32-c3-idf.yaml | 2 +- tests/components/kuntze/test.esp32-idf.yaml | 2 +- tests/components/kuntze/test.esp8266-ard.yaml | 2 +- tests/components/kuntze/test.rp2040-ard.yaml | 2 +- tests/components/pzemac/common.yaml | 5 +---- tests/components/pzemac/test.esp32-c3-idf.yaml | 2 +- tests/components/pzemac/test.esp32-idf.yaml | 2 +- tests/components/pzemac/test.esp8266-ard.yaml | 2 +- tests/components/pzemac/test.rp2040-ard.yaml | 2 +- tests/components/pzemdc/common.yaml | 5 +---- tests/components/pzemdc/test.esp32-c3-idf.yaml | 2 +- tests/components/pzemdc/test.esp32-idf.yaml | 2 +- tests/components/pzemdc/test.esp8266-ard.yaml | 2 +- tests/components/pzemdc/test.rp2040-ard.yaml | 2 +- tests/components/sdm_meter/common.yaml | 1 + tests/components/sdm_meter/test.esp32-c3-idf.yaml | 2 +- tests/components/sdm_meter/test.esp32-idf.yaml | 2 +- tests/components/sdm_meter/test.esp8266-ard.yaml | 2 +- tests/components/sdm_meter/test.rp2040-ard.yaml | 2 +- .../common/modbus/bk72xx-ard.yaml | 12 ++++++++++++ .../common/modbus/esp32-ard.yaml | 12 ++++++++++++ .../common/modbus/esp32-c3-ard.yaml | 12 ++++++++++++ .../common/modbus/esp32-c3-idf.yaml | 12 ++++++++++++ .../common/modbus/esp32-idf.yaml | 13 +++++++++++++ .../common/modbus/esp32-s2-ard.yaml | 12 ++++++++++++ .../common/modbus/esp32-s2-idf.yaml | 12 ++++++++++++ .../common/modbus/esp32-s3-ard.yaml | 12 ++++++++++++ .../common/modbus/esp32-s3-idf.yaml | 12 ++++++++++++ .../common/modbus/esp8266-ard.yaml | 12 ++++++++++++ .../common/modbus/rp2040-ard.yaml | 12 ++++++++++++ 43 files changed, 184 insertions(+), 42 deletions(-) create mode 100644 tests/test_build_components/common/modbus/bk72xx-ard.yaml create mode 100644 tests/test_build_components/common/modbus/esp32-ard.yaml create mode 100644 tests/test_build_components/common/modbus/esp32-c3-ard.yaml create mode 100644 tests/test_build_components/common/modbus/esp32-c3-idf.yaml create mode 100644 tests/test_build_components/common/modbus/esp32-idf.yaml create mode 100644 tests/test_build_components/common/modbus/esp32-s2-ard.yaml create mode 100644 tests/test_build_components/common/modbus/esp32-s2-idf.yaml create mode 100644 tests/test_build_components/common/modbus/esp32-s3-ard.yaml create mode 100644 tests/test_build_components/common/modbus/esp32-s3-idf.yaml create mode 100644 tests/test_build_components/common/modbus/esp8266-ard.yaml create mode 100644 tests/test_build_components/common/modbus/rp2040-ard.yaml diff --git a/script/analyze_component_buses.py b/script/analyze_component_buses.py index 418576bf16..d01bd33dbd 100644 --- a/script/analyze_component_buses.py +++ b/script/analyze_component_buses.py @@ -40,6 +40,14 @@ from esphome.config_helpers import Extend, Remove # Path to common bus configs COMMON_BUS_PATH = Path("tests/test_build_components/common") +# Package dependencies - maps packages to the packages they include +# When a component uses a package on the left, it automatically gets +# the packages on the right as well +PACKAGE_DEPENDENCIES = { + "modbus": ["uart"], # modbus packages include uart packages + # Add more package dependencies here as needed +} + # Components that must be tested in isolation (not grouped or batched with others) # These have known build issues that prevent grouping # NOTE: This should be kept in sync with both test_build_components and split_components_for_ci.py @@ -208,6 +216,11 @@ def analyze_yaml_file(yaml_file: Path) -> dict[str, Any]: for pkg_name in packages: if pkg_name in valid_buses: result["buses"].add(pkg_name) + # Add any package dependencies (e.g., modbus includes uart) + if pkg_name in PACKAGE_DEPENDENCIES: + for dep in PACKAGE_DEPENDENCIES[pkg_name]: + if dep in valid_buses: + result["buses"].add(dep) return result diff --git a/script/merge_component_configs.py b/script/merge_component_configs.py index 64e8e7c5f9..57b9f4283c 100755 --- a/script/merge_component_configs.py +++ b/script/merge_component_configs.py @@ -26,7 +26,7 @@ sys.path.insert(0, str(Path(__file__).parent.parent)) from esphome import yaml_util from esphome.config_helpers import merge_config -from script.analyze_component_buses import get_common_bus_packages +from script.analyze_component_buses import PACKAGE_DEPENDENCIES, get_common_bus_packages def load_yaml_file(yaml_file: Path) -> dict: @@ -68,6 +68,13 @@ def extract_packages_from_yaml(data: dict) -> dict[str, str]: # Only include common bus packages, ignore component-specific ones if name in common_bus_packages: packages[name] = str(value) + # Also track package dependencies (e.g., modbus includes uart) + # This ensures components using modbus are grouped with uart + if name in PACKAGE_DEPENDENCIES: + for dep in PACKAGE_DEPENDENCIES[name]: + if dep in common_bus_packages: + # Mark as included via dependency + packages[f"_dep_{dep}"] = f"(included via {name})" return packages diff --git a/tests/components/growatt_solar/common.yaml b/tests/components/growatt_solar/common.yaml index 50e74285cb..f304e84fcf 100644 --- a/tests/components/growatt_solar/common.yaml +++ b/tests/components/growatt_solar/common.yaml @@ -1,8 +1,6 @@ -modbus: - flow_control_pin: ${flow_control_pin} - sensor: - platform: growatt_solar + modbus_id: modbus_bus update_interval: 10s protocol_version: RTU inverter_status: diff --git a/tests/components/growatt_solar/test.esp32-c3-idf.yaml b/tests/components/growatt_solar/test.esp32-c3-idf.yaml index 430c6818cb..17940aafcf 100644 --- a/tests/components/growatt_solar/test.esp32-c3-idf.yaml +++ b/tests/components/growatt_solar/test.esp32-c3-idf.yaml @@ -1,6 +1,6 @@ substitutions: flow_control_pin: GPIO3 packages: - uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml + modbus: !include ../../test_build_components/common/modbus/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/growatt_solar/test.esp32-idf.yaml b/tests/components/growatt_solar/test.esp32-idf.yaml index 8a08f8a821..a755bfa66a 100644 --- a/tests/components/growatt_solar/test.esp32-idf.yaml +++ b/tests/components/growatt_solar/test.esp32-idf.yaml @@ -4,6 +4,6 @@ substitutions: flow_control_pin: GPIO13 packages: - uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + modbus: !include ../../test_build_components/common/modbus/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/growatt_solar/test.esp8266-ard.yaml b/tests/components/growatt_solar/test.esp8266-ard.yaml index dfea36d957..6daa08c22b 100644 --- a/tests/components/growatt_solar/test.esp8266-ard.yaml +++ b/tests/components/growatt_solar/test.esp8266-ard.yaml @@ -4,6 +4,6 @@ substitutions: flow_control_pin: GPIO15 packages: - uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml + modbus: !include ../../test_build_components/common/modbus/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/growatt_solar/test.rp2040-ard.yaml b/tests/components/growatt_solar/test.rp2040-ard.yaml index 43f12ea28d..a00283a9e0 100644 --- a/tests/components/growatt_solar/test.rp2040-ard.yaml +++ b/tests/components/growatt_solar/test.rp2040-ard.yaml @@ -4,6 +4,6 @@ substitutions: flow_control_pin: GPIO3 packages: - uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + modbus: !include ../../test_build_components/common/modbus/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/havells_solar/common.yaml b/tests/components/havells_solar/common.yaml index 64e25d8404..2f00f61f14 100644 --- a/tests/components/havells_solar/common.yaml +++ b/tests/components/havells_solar/common.yaml @@ -1,8 +1,6 @@ -modbus: - flow_control_pin: ${flow_control_pin} - sensor: - platform: havells_solar + modbus_id: modbus_bus update_interval: 60s phase_a: voltage: diff --git a/tests/components/havells_solar/test.esp32-c3-idf.yaml b/tests/components/havells_solar/test.esp32-c3-idf.yaml index 430c6818cb..17940aafcf 100644 --- a/tests/components/havells_solar/test.esp32-c3-idf.yaml +++ b/tests/components/havells_solar/test.esp32-c3-idf.yaml @@ -1,6 +1,6 @@ substitutions: flow_control_pin: GPIO3 packages: - uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml + modbus: !include ../../test_build_components/common/modbus/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/havells_solar/test.esp32-idf.yaml b/tests/components/havells_solar/test.esp32-idf.yaml index 8a08f8a821..a755bfa66a 100644 --- a/tests/components/havells_solar/test.esp32-idf.yaml +++ b/tests/components/havells_solar/test.esp32-idf.yaml @@ -4,6 +4,6 @@ substitutions: flow_control_pin: GPIO13 packages: - uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + modbus: !include ../../test_build_components/common/modbus/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/havells_solar/test.esp8266-ard.yaml b/tests/components/havells_solar/test.esp8266-ard.yaml index dfea36d957..6daa08c22b 100644 --- a/tests/components/havells_solar/test.esp8266-ard.yaml +++ b/tests/components/havells_solar/test.esp8266-ard.yaml @@ -4,6 +4,6 @@ substitutions: flow_control_pin: GPIO15 packages: - uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml + modbus: !include ../../test_build_components/common/modbus/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/havells_solar/test.rp2040-ard.yaml b/tests/components/havells_solar/test.rp2040-ard.yaml index 43f12ea28d..a00283a9e0 100644 --- a/tests/components/havells_solar/test.rp2040-ard.yaml +++ b/tests/components/havells_solar/test.rp2040-ard.yaml @@ -4,6 +4,6 @@ substitutions: flow_control_pin: GPIO3 packages: - uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + modbus: !include ../../test_build_components/common/modbus/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/kuntze/common.yaml b/tests/components/kuntze/common.yaml index 4bf7255c2f..32c6fa3809 100644 --- a/tests/components/kuntze/common.yaml +++ b/tests/components/kuntze/common.yaml @@ -1,8 +1,6 @@ -modbus: - flow_control_pin: ${flow_control_pin} - sensor: - platform: kuntze + modbus_id: modbus_bus ph: name: Kuntze pH temperature: diff --git a/tests/components/kuntze/test.esp32-c3-idf.yaml b/tests/components/kuntze/test.esp32-c3-idf.yaml index 430c6818cb..17940aafcf 100644 --- a/tests/components/kuntze/test.esp32-c3-idf.yaml +++ b/tests/components/kuntze/test.esp32-c3-idf.yaml @@ -1,6 +1,6 @@ substitutions: flow_control_pin: GPIO3 packages: - uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml + modbus: !include ../../test_build_components/common/modbus/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/kuntze/test.esp32-idf.yaml b/tests/components/kuntze/test.esp32-idf.yaml index 8a08f8a821..a755bfa66a 100644 --- a/tests/components/kuntze/test.esp32-idf.yaml +++ b/tests/components/kuntze/test.esp32-idf.yaml @@ -4,6 +4,6 @@ substitutions: flow_control_pin: GPIO13 packages: - uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + modbus: !include ../../test_build_components/common/modbus/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/kuntze/test.esp8266-ard.yaml b/tests/components/kuntze/test.esp8266-ard.yaml index dfea36d957..6daa08c22b 100644 --- a/tests/components/kuntze/test.esp8266-ard.yaml +++ b/tests/components/kuntze/test.esp8266-ard.yaml @@ -4,6 +4,6 @@ substitutions: flow_control_pin: GPIO15 packages: - uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml + modbus: !include ../../test_build_components/common/modbus/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/kuntze/test.rp2040-ard.yaml b/tests/components/kuntze/test.rp2040-ard.yaml index 43f12ea28d..a00283a9e0 100644 --- a/tests/components/kuntze/test.rp2040-ard.yaml +++ b/tests/components/kuntze/test.rp2040-ard.yaml @@ -4,6 +4,6 @@ substitutions: flow_control_pin: GPIO3 packages: - uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + modbus: !include ../../test_build_components/common/modbus/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/pzemac/common.yaml b/tests/components/pzemac/common.yaml index 66cb418d07..2566051baa 100644 --- a/tests/components/pzemac/common.yaml +++ b/tests/components/pzemac/common.yaml @@ -3,12 +3,9 @@ esphome: then: - pzemac.reset_energy: pzemac1 -modbus: - - id: pzemac_modbus - sensor: - platform: pzemac - modbus_id: pzemac_modbus + modbus_id: modbus_bus id: pzemac1 voltage: name: PZEMAC Voltage diff --git a/tests/components/pzemac/test.esp32-c3-idf.yaml b/tests/components/pzemac/test.esp32-c3-idf.yaml index 4b7c8351a7..6c6e95488f 100644 --- a/tests/components/pzemac/test.esp32-c3-idf.yaml +++ b/tests/components/pzemac/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: packages: - uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml + modbus: !include ../../test_build_components/common/modbus/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pzemac/test.esp32-idf.yaml b/tests/components/pzemac/test.esp32-idf.yaml index b415125e84..37d98696cc 100644 --- a/tests/components/pzemac/test.esp32-idf.yaml +++ b/tests/components/pzemac/test.esp32-idf.yaml @@ -3,6 +3,6 @@ substitutions: rx_pin: GPIO5 packages: - uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + modbus: !include ../../test_build_components/common/modbus/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pzemac/test.esp8266-ard.yaml b/tests/components/pzemac/test.esp8266-ard.yaml index 96ab4ef6ac..421389ae97 100644 --- a/tests/components/pzemac/test.esp8266-ard.yaml +++ b/tests/components/pzemac/test.esp8266-ard.yaml @@ -3,6 +3,6 @@ substitutions: rx_pin: GPIO2 packages: - uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml + modbus: !include ../../test_build_components/common/modbus/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pzemac/test.rp2040-ard.yaml b/tests/components/pzemac/test.rp2040-ard.yaml index b28f2b5e05..d78d84c983 100644 --- a/tests/components/pzemac/test.rp2040-ard.yaml +++ b/tests/components/pzemac/test.rp2040-ard.yaml @@ -3,6 +3,6 @@ substitutions: rx_pin: GPIO5 packages: - uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + modbus: !include ../../test_build_components/common/modbus/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/pzemdc/common.yaml b/tests/components/pzemdc/common.yaml index 272d1578fc..78a0ab0d07 100644 --- a/tests/components/pzemdc/common.yaml +++ b/tests/components/pzemdc/common.yaml @@ -3,12 +3,9 @@ esphome: then: - pzemdc.reset_energy: pzemdc1 -modbus: - - id: pzemdc_modbus - sensor: - platform: pzemdc - modbus_id: pzemdc_modbus + modbus_id: modbus_bus id: pzemdc1 voltage: name: PZEMDC Voltage diff --git a/tests/components/pzemdc/test.esp32-c3-idf.yaml b/tests/components/pzemdc/test.esp32-c3-idf.yaml index 4b7c8351a7..6c6e95488f 100644 --- a/tests/components/pzemdc/test.esp32-c3-idf.yaml +++ b/tests/components/pzemdc/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: packages: - uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml + modbus: !include ../../test_build_components/common/modbus/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pzemdc/test.esp32-idf.yaml b/tests/components/pzemdc/test.esp32-idf.yaml index b415125e84..37d98696cc 100644 --- a/tests/components/pzemdc/test.esp32-idf.yaml +++ b/tests/components/pzemdc/test.esp32-idf.yaml @@ -3,6 +3,6 @@ substitutions: rx_pin: GPIO5 packages: - uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + modbus: !include ../../test_build_components/common/modbus/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pzemdc/test.esp8266-ard.yaml b/tests/components/pzemdc/test.esp8266-ard.yaml index 96ab4ef6ac..421389ae97 100644 --- a/tests/components/pzemdc/test.esp8266-ard.yaml +++ b/tests/components/pzemdc/test.esp8266-ard.yaml @@ -3,6 +3,6 @@ substitutions: rx_pin: GPIO2 packages: - uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml + modbus: !include ../../test_build_components/common/modbus/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pzemdc/test.rp2040-ard.yaml b/tests/components/pzemdc/test.rp2040-ard.yaml index b28f2b5e05..d78d84c983 100644 --- a/tests/components/pzemdc/test.rp2040-ard.yaml +++ b/tests/components/pzemdc/test.rp2040-ard.yaml @@ -3,6 +3,6 @@ substitutions: rx_pin: GPIO5 packages: - uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + modbus: !include ../../test_build_components/common/modbus/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/sdm_meter/common.yaml b/tests/components/sdm_meter/common.yaml index dd2244cf91..760f134451 100644 --- a/tests/components/sdm_meter/common.yaml +++ b/tests/components/sdm_meter/common.yaml @@ -1,5 +1,6 @@ sensor: - platform: sdm_meter + modbus_id: modbus_bus phase_a: current: name: Phase A Current diff --git a/tests/components/sdm_meter/test.esp32-c3-idf.yaml b/tests/components/sdm_meter/test.esp32-c3-idf.yaml index 4b7c8351a7..6c6e95488f 100644 --- a/tests/components/sdm_meter/test.esp32-c3-idf.yaml +++ b/tests/components/sdm_meter/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: packages: - uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml + modbus: !include ../../test_build_components/common/modbus/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sdm_meter/test.esp32-idf.yaml b/tests/components/sdm_meter/test.esp32-idf.yaml index b415125e84..37d98696cc 100644 --- a/tests/components/sdm_meter/test.esp32-idf.yaml +++ b/tests/components/sdm_meter/test.esp32-idf.yaml @@ -3,6 +3,6 @@ substitutions: rx_pin: GPIO5 packages: - uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + modbus: !include ../../test_build_components/common/modbus/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sdm_meter/test.esp8266-ard.yaml b/tests/components/sdm_meter/test.esp8266-ard.yaml index 96ab4ef6ac..421389ae97 100644 --- a/tests/components/sdm_meter/test.esp8266-ard.yaml +++ b/tests/components/sdm_meter/test.esp8266-ard.yaml @@ -3,6 +3,6 @@ substitutions: rx_pin: GPIO2 packages: - uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml + modbus: !include ../../test_build_components/common/modbus/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sdm_meter/test.rp2040-ard.yaml b/tests/components/sdm_meter/test.rp2040-ard.yaml index b28f2b5e05..d78d84c983 100644 --- a/tests/components/sdm_meter/test.rp2040-ard.yaml +++ b/tests/components/sdm_meter/test.rp2040-ard.yaml @@ -3,6 +3,6 @@ substitutions: rx_pin: GPIO5 packages: - uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + modbus: !include ../../test_build_components/common/modbus/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/test_build_components/common/modbus/bk72xx-ard.yaml b/tests/test_build_components/common/modbus/bk72xx-ard.yaml new file mode 100644 index 0000000000..c428f0a7be --- /dev/null +++ b/tests/test_build_components/common/modbus/bk72xx-ard.yaml @@ -0,0 +1,12 @@ +# Common Modbus configuration for BK72XX Arduino tests + +packages: + uart: !include ../uart/bk72xx-ard.yaml + +substitutions: + flow_control_pin: P6 + +modbus: + - id: modbus_bus + uart_id: uart_bus + flow_control_pin: ${flow_control_pin} diff --git a/tests/test_build_components/common/modbus/esp32-ard.yaml b/tests/test_build_components/common/modbus/esp32-ard.yaml new file mode 100644 index 0000000000..f327cf266e --- /dev/null +++ b/tests/test_build_components/common/modbus/esp32-ard.yaml @@ -0,0 +1,12 @@ +# Common Modbus configuration for ESP32 Arduino tests + +packages: + uart: !include ../uart/esp32-ard.yaml + +substitutions: + flow_control_pin: GPIO4 + +modbus: + - id: modbus_bus + uart_id: uart_bus + flow_control_pin: ${flow_control_pin} diff --git a/tests/test_build_components/common/modbus/esp32-c3-ard.yaml b/tests/test_build_components/common/modbus/esp32-c3-ard.yaml new file mode 100644 index 0000000000..f12e5518c0 --- /dev/null +++ b/tests/test_build_components/common/modbus/esp32-c3-ard.yaml @@ -0,0 +1,12 @@ +# Common Modbus configuration for ESP32-C3 Arduino tests + +packages: + uart: !include ../uart/esp32-c3-ard.yaml + +substitutions: + flow_control_pin: GPIO4 + +modbus: + - id: modbus_bus + uart_id: uart_bus + flow_control_pin: ${flow_control_pin} diff --git a/tests/test_build_components/common/modbus/esp32-c3-idf.yaml b/tests/test_build_components/common/modbus/esp32-c3-idf.yaml new file mode 100644 index 0000000000..98fc11b0b7 --- /dev/null +++ b/tests/test_build_components/common/modbus/esp32-c3-idf.yaml @@ -0,0 +1,12 @@ +# Common Modbus configuration for ESP32-C3 IDF tests + +packages: + uart: !include ../uart/esp32-c3-idf.yaml + +substitutions: + flow_control_pin: GPIO4 + +modbus: + - id: modbus_bus + uart_id: uart_bus + flow_control_pin: ${flow_control_pin} diff --git a/tests/test_build_components/common/modbus/esp32-idf.yaml b/tests/test_build_components/common/modbus/esp32-idf.yaml new file mode 100644 index 0000000000..c2d777c3d7 --- /dev/null +++ b/tests/test_build_components/common/modbus/esp32-idf.yaml @@ -0,0 +1,13 @@ +# Common Modbus configuration for ESP32 IDF tests +# Provides a shared Modbus bus that all components can use + +packages: + uart: !include ../uart/esp32-idf.yaml + +substitutions: + flow_control_pin: GPIO4 + +modbus: + - id: modbus_bus + uart_id: uart_bus + flow_control_pin: ${flow_control_pin} diff --git a/tests/test_build_components/common/modbus/esp32-s2-ard.yaml b/tests/test_build_components/common/modbus/esp32-s2-ard.yaml new file mode 100644 index 0000000000..a47036f379 --- /dev/null +++ b/tests/test_build_components/common/modbus/esp32-s2-ard.yaml @@ -0,0 +1,12 @@ +# Common Modbus configuration for ESP32-S2 Arduino tests + +packages: + uart: !include ../uart/esp32-s2-ard.yaml + +substitutions: + flow_control_pin: GPIO4 + +modbus: + - id: modbus_bus + uart_id: uart_bus + flow_control_pin: ${flow_control_pin} diff --git a/tests/test_build_components/common/modbus/esp32-s2-idf.yaml b/tests/test_build_components/common/modbus/esp32-s2-idf.yaml new file mode 100644 index 0000000000..2cac82aa15 --- /dev/null +++ b/tests/test_build_components/common/modbus/esp32-s2-idf.yaml @@ -0,0 +1,12 @@ +# Common Modbus configuration for ESP32-S2 IDF tests + +packages: + uart: !include ../uart/esp32-s2-idf.yaml + +substitutions: + flow_control_pin: GPIO4 + +modbus: + - id: modbus_bus + uart_id: uart_bus + flow_control_pin: ${flow_control_pin} diff --git a/tests/test_build_components/common/modbus/esp32-s3-ard.yaml b/tests/test_build_components/common/modbus/esp32-s3-ard.yaml new file mode 100644 index 0000000000..3031f57159 --- /dev/null +++ b/tests/test_build_components/common/modbus/esp32-s3-ard.yaml @@ -0,0 +1,12 @@ +# Common Modbus configuration for ESP32-S3 Arduino tests + +packages: + uart: !include ../uart/esp32-s3-ard.yaml + +substitutions: + flow_control_pin: GPIO4 + +modbus: + - id: modbus_bus + uart_id: uart_bus + flow_control_pin: ${flow_control_pin} diff --git a/tests/test_build_components/common/modbus/esp32-s3-idf.yaml b/tests/test_build_components/common/modbus/esp32-s3-idf.yaml new file mode 100644 index 0000000000..0a0d4dbd07 --- /dev/null +++ b/tests/test_build_components/common/modbus/esp32-s3-idf.yaml @@ -0,0 +1,12 @@ +# Common Modbus configuration for ESP32-S3 IDF tests + +packages: + uart: !include ../uart/esp32-s3-idf.yaml + +substitutions: + flow_control_pin: GPIO4 + +modbus: + - id: modbus_bus + uart_id: uart_bus + flow_control_pin: ${flow_control_pin} diff --git a/tests/test_build_components/common/modbus/esp8266-ard.yaml b/tests/test_build_components/common/modbus/esp8266-ard.yaml new file mode 100644 index 0000000000..fce4c6df1d --- /dev/null +++ b/tests/test_build_components/common/modbus/esp8266-ard.yaml @@ -0,0 +1,12 @@ +# Common Modbus configuration for ESP8266 Arduino tests + +packages: + uart: !include ../uart/esp8266-ard.yaml + +substitutions: + flow_control_pin: GPIO5 + +modbus: + - id: modbus_bus + uart_id: uart_bus + flow_control_pin: ${flow_control_pin} diff --git a/tests/test_build_components/common/modbus/rp2040-ard.yaml b/tests/test_build_components/common/modbus/rp2040-ard.yaml new file mode 100644 index 0000000000..264ad8944f --- /dev/null +++ b/tests/test_build_components/common/modbus/rp2040-ard.yaml @@ -0,0 +1,12 @@ +# Common Modbus configuration for RP2040 Arduino tests + +packages: + uart: !include ../uart/rp2040-ard.yaml + +substitutions: + flow_control_pin: GPIO2 + +modbus: + - id: modbus_bus + uart_id: uart_bus + flow_control_pin: ${flow_control_pin}