diff --git a/.ai/instructions.md b/.ai/instructions.md index 1cd77b9136..5f314a0dc9 100644 --- a/.ai/instructions.md +++ b/.ai/instructions.md @@ -186,6 +186,11 @@ This document provides essential context for AI models interacting with this pro └── components/[component]/ # Component-specific tests ``` Run them using `script/test_build_components`. Use `-c ` to test specific components and `-t ` for specific platforms. + * **Testing All Components Together:** To verify that all components can be tested together without ID conflicts or configuration issues, use: + ```bash + ./script/test_component_grouping.py -e config --all + ``` + This tests all components in a single build to catch conflicts that might not appear when testing components individually. Use `-e config` for fast configuration validation, or `-e compile` for full compilation testing. * **Debugging and Troubleshooting:** * **Debug Tools:** - `esphome config .yaml` to validate configuration. @@ -216,6 +221,146 @@ This document provides essential context for AI models interacting with this pro * **Component Development:** Keep dependencies minimal, provide clear error messages, and write comprehensive docstrings and tests. * **Code Generation:** Generate minimal and efficient C++ code. Validate all user inputs thoroughly. Support multiple platform variations. * **Configuration Design:** Aim for simplicity with sensible defaults, while allowing for advanced customization. + * **Embedded Systems Optimization:** ESPHome targets resource-constrained microcontrollers. Be mindful of flash size and RAM usage. + + **STL Container Guidelines:** + + ESPHome runs on embedded systems with limited resources. Choose containers carefully: + + 1. **Compile-time-known sizes:** Use `std::array` instead of `std::vector` when size is known at compile time. + ```cpp + // Bad - generates STL realloc code + std::vector values; + + // Good - no dynamic allocation + std::array values; + ``` + Use `cg.add_define("MAX_VALUES", count)` to set the size from Python configuration. + + **For byte buffers:** Avoid `std::vector` unless the buffer needs to grow. Use `std::unique_ptr` instead. + + > **Note:** `std::unique_ptr` does **not** provide bounds checking or iterator support like `std::vector`. Use it only when you do not need these features and want minimal overhead. + + ```cpp + // Bad - STL overhead for simple byte buffer + std::vector buffer; + buffer.resize(256); + + // Good - minimal overhead, single allocation + std::unique_ptr buffer = std::make_unique(256); + // Or if size is constant: + std::array buffer; + ``` + + 2. **Compile-time-known fixed sizes with vector-like API:** Use `StaticVector` from `esphome/core/helpers.h` for fixed-size stack allocation with `push_back()` interface. + ```cpp + // Bad - generates STL realloc code (_M_realloc_insert) + std::vector services; + services.reserve(5); // Still includes reallocation machinery + + // Good - compile-time fixed size, stack allocated, no reallocation machinery + StaticVector services; // Allocates all MAX_SERVICES on stack + services.push_back(record1); // Tracks count but all slots allocated + ``` + Use `cg.add_define("MAX_SERVICES", count)` to set the size from Python configuration. + Like `std::array` but with vector-like API (`push_back()`, `size()`) and no STL reallocation code. + + 3. **Runtime-known sizes:** Use `FixedVector` from `esphome/core/helpers.h` when the size is only known at runtime initialization. + ```cpp + // Bad - generates STL realloc code (_M_realloc_insert) + std::vector txt_records; + txt_records.reserve(5); // Still includes reallocation machinery + + // Good - runtime size, single allocation, no reallocation machinery + FixedVector txt_records; + txt_records.init(record_count); // Initialize with exact size at runtime + ``` + **Benefits:** + - Eliminates `_M_realloc_insert`, `_M_default_append` template instantiations (saves 200-500 bytes per instance) + - Single allocation, no upper bound needed + - No reallocation overhead + - Compatible with protobuf code generation when using `[(fixed_vector) = true]` option + + 4. **Small datasets (1-16 elements):** Use `std::vector` or `std::array` with simple structs instead of `std::map`/`std::set`/`std::unordered_map`. + ```cpp + // Bad - 2KB+ overhead for red-black tree/hash table + std::map small_lookup; + std::unordered_map tiny_map; + + // Good - simple struct with linear search (std::vector is fine) + struct LookupEntry { + const char *key; + int value; + }; + std::vector small_lookup = { + {"key1", 10}, + {"key2", 20}, + {"key3", 30}, + }; + // Or std::array if size is compile-time constant: + // std::array small_lookup = {{ ... }}; + ``` + Linear search on small datasets (1-16 elements) is often faster than hashing/tree overhead, but this depends on lookup frequency and access patterns. For frequent lookups in hot code paths, the O(1) vs O(n) complexity difference may still matter even for small datasets. `std::vector` with simple structs is usually fine—it's the heavy containers (`map`, `set`, `unordered_map`) that should be avoided for small datasets unless profiling shows otherwise. + + 5. **Detection:** Look for these patterns in compiler output: + - Large code sections with STL symbols (vector, map, set) + - `alloc`, `realloc`, `dealloc` in symbol names + - `_M_realloc_insert`, `_M_default_append` (vector reallocation) + - Red-black tree code (`rb_tree`, `_Rb_tree`) + - Hash table infrastructure (`unordered_map`, `hash`) + + **When to optimize:** + - Core components (API, network, logger) + - Widely-used components (mdns, wifi, ble) + - Components causing flash size complaints + + **When not to optimize:** + - Single-use niche components + - Code where readability matters more than bytes + - Already using appropriate containers + + * **State Management:** Use `CORE.data` for component state that needs to persist during configuration generation. Avoid module-level mutable globals. + + **Bad Pattern (Module-Level Globals):** + ```python + # Don't do this - state persists between compilation runs + _component_state = [] + _use_feature = None + + def enable_feature(): + global _use_feature + _use_feature = True + ``` + + **Good Pattern (CORE.data with Helpers):** + ```python + from esphome.core import CORE + + # Keys for CORE.data storage + COMPONENT_STATE_KEY = "my_component_state" + USE_FEATURE_KEY = "my_component_use_feature" + + def _get_component_state() -> list: + """Get component state from CORE.data.""" + return CORE.data.setdefault(COMPONENT_STATE_KEY, []) + + def _get_use_feature() -> bool | None: + """Get feature flag from CORE.data.""" + return CORE.data.get(USE_FEATURE_KEY) + + def _set_use_feature(value: bool) -> None: + """Set feature flag in CORE.data.""" + CORE.data[USE_FEATURE_KEY] = value + + def enable_feature(): + _set_use_feature(True) + ``` + + **Why this matters:** + - Module-level globals persist between compilation runs if the dashboard doesn't fork/exec + - `CORE.data` automatically clears between runs + - Typed helper functions provide better IDE support and maintainability + - Encapsulation makes state management explicit and testable * **Security:** Be mindful of security when making changes to the API, web server, or any other network-related code. Do not hardcode secrets or keys. diff --git a/.clang-tidy.hash b/.clang-tidy.hash index 4901c0ccac..2cd4319325 100644 --- a/.clang-tidy.hash +++ b/.clang-tidy.hash @@ -1 +1 @@ -049d60eed541730efaa4c0dc5d337b4287bf29b6daa350b5dfc1f23915f1c52f +d7693a1e996cacd4a3d1c9a16336799c2a8cc3db02e4e74084151ce964581248 diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 1d7043c888..163e9ab9ec 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -114,8 +114,7 @@ jobs: matrix: python-version: - "3.11" - - "3.12" - - "3.13" + - "3.14" os: - ubuntu-latest - macOS-latest @@ -124,13 +123,9 @@ jobs: # Minimize CI resource usage # by only running the Python version # version used for docker images on Windows and macOS - - python-version: "3.13" + - python-version: "3.14" os: windows-latest - - python-version: "3.12" - os: windows-latest - - python-version: "3.13" - os: macOS-latest - - python-version: "3.12" + - python-version: "3.14" os: macOS-latest runs-on: ${{ matrix.os }} needs: @@ -177,6 +172,8 @@ jobs: clang-tidy: ${{ steps.determine.outputs.clang-tidy }} python-linters: ${{ steps.determine.outputs.python-linters }} changed-components: ${{ steps.determine.outputs.changed-components }} + changed-components-with-tests: ${{ steps.determine.outputs.changed-components-with-tests }} + directly-changed-components-with-tests: ${{ steps.determine.outputs.directly-changed-components-with-tests }} component-test-count: ${{ steps.determine.outputs.component-test-count }} steps: - name: Check out code from GitHub @@ -204,6 +201,8 @@ jobs: echo "clang-tidy=$(echo "$output" | jq -r '.clang_tidy')" >> $GITHUB_OUTPUT echo "python-linters=$(echo "$output" | jq -r '.python_linters')" >> $GITHUB_OUTPUT echo "changed-components=$(echo "$output" | jq -c '.changed_components')" >> $GITHUB_OUTPUT + echo "changed-components-with-tests=$(echo "$output" | jq -c '.changed_components_with_tests')" >> $GITHUB_OUTPUT + echo "directly-changed-components-with-tests=$(echo "$output" | jq -c '.directly_changed_components_with_tests')" >> $GITHUB_OUTPUT echo "component-test-count=$(echo "$output" | jq -r '.component_test_count')" >> $GITHUB_OUTPUT integration-tests: @@ -356,79 +355,64 @@ jobs: # yamllint disable-line rule:line-length if: always() - test-build-components: - name: Component test ${{ matrix.file }} - runs-on: ubuntu-24.04 - needs: - - common - - determine-jobs - if: github.event_name == 'pull_request' && fromJSON(needs.determine-jobs.outputs.component-test-count) > 0 && fromJSON(needs.determine-jobs.outputs.component-test-count) < 100 - strategy: - fail-fast: false - max-parallel: 2 - matrix: - file: ${{ fromJson(needs.determine-jobs.outputs.changed-components) }} - steps: - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install libsdl2-dev - - - name: Check out code from GitHub - uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - name: Restore Python - uses: ./.github/actions/restore-python - with: - python-version: ${{ env.DEFAULT_PYTHON }} - cache-key: ${{ needs.common.outputs.cache-key }} - - name: test_build_components -e config -c ${{ matrix.file }} - run: | - . venv/bin/activate - ./script/test_build_components -e config -c ${{ matrix.file }} - - name: test_build_components -e compile -c ${{ matrix.file }} - run: | - . venv/bin/activate - ./script/test_build_components -e compile -c ${{ matrix.file }} - test-build-components-splitter: - name: Split components for testing into 10 components per group + name: Split components for intelligent grouping (40 weighted per batch) runs-on: ubuntu-24.04 needs: - common - determine-jobs - if: github.event_name == 'pull_request' && fromJSON(needs.determine-jobs.outputs.component-test-count) >= 100 + if: github.event_name == 'pull_request' && fromJSON(needs.determine-jobs.outputs.component-test-count) > 0 outputs: matrix: ${{ steps.split.outputs.components }} steps: - name: Check out code from GitHub uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 - - name: Split components into groups of 10 + - name: Restore Python + uses: ./.github/actions/restore-python + with: + python-version: ${{ env.DEFAULT_PYTHON }} + cache-key: ${{ needs.common.outputs.cache-key }} + - name: Split components intelligently based on bus configurations id: split run: | - components=$(echo '${{ needs.determine-jobs.outputs.changed-components }}' | jq -c '.[]' | shuf | jq -s -c '[_nwise(10) | join(" ")]') - echo "components=$components" >> $GITHUB_OUTPUT + . venv/bin/activate + + # Use intelligent splitter that groups components with same bus configs + components='${{ needs.determine-jobs.outputs.changed-components-with-tests }}' + directly_changed='${{ needs.determine-jobs.outputs.directly-changed-components-with-tests }}' + + echo "Splitting components intelligently..." + output=$(python3 script/split_components_for_ci.py --components "$components" --directly-changed "$directly_changed" --batch-size 40 --output github) + + echo "$output" >> $GITHUB_OUTPUT test-build-components-split: - name: Test split components + name: Test components batch (${{ matrix.components }}) runs-on: ubuntu-24.04 needs: - common - determine-jobs - test-build-components-splitter - if: github.event_name == 'pull_request' && fromJSON(needs.determine-jobs.outputs.component-test-count) >= 100 + if: github.event_name == 'pull_request' && fromJSON(needs.determine-jobs.outputs.component-test-count) > 0 strategy: fail-fast: false - max-parallel: 4 + max-parallel: ${{ (github.base_ref == 'beta' || github.base_ref == 'release') && 8 || 4 }} matrix: components: ${{ fromJson(needs.test-build-components-splitter.outputs.matrix) }} steps: + - name: Show disk space + run: | + echo "Available disk space:" + df -h + - name: List components run: echo ${{ matrix.components }} - - name: Install dependencies - run: | - sudo apt-get update - sudo apt-get install libsdl2-dev + - name: Cache apt packages + uses: awalsh128/cache-apt-pkgs-action@acb598e5ddbc6f68a970c5da0688d2f3a9f04d05 # v1.5.3 + with: + packages: libsdl2-dev + version: 1.0 - name: Check out code from GitHub uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 @@ -437,20 +421,53 @@ jobs: with: python-version: ${{ env.DEFAULT_PYTHON }} cache-key: ${{ needs.common.outputs.cache-key }} - - name: Validate config + - name: Validate and compile components with intelligent grouping run: | . venv/bin/activate - for component in ${{ matrix.components }}; do - ./script/test_build_components -e config -c $component - done - - name: Compile config - run: | - . venv/bin/activate - mkdir build_cache - export PLATFORMIO_BUILD_CACHE_DIR=$PWD/build_cache - for component in ${{ matrix.components }}; do - ./script/test_build_components -e compile -c $component - done + # Use /mnt for build files (70GB available vs ~29GB on /) + # Bind mount PlatformIO directory to /mnt (tools, packages, build cache all go there) + sudo mkdir -p /mnt/platformio + sudo chown $USER:$USER /mnt/platformio + mkdir -p ~/.platformio + sudo mount --bind /mnt/platformio ~/.platformio + + # Bind mount test build directory to /mnt + sudo mkdir -p /mnt/test_build_components_build + sudo chown $USER:$USER /mnt/test_build_components_build + mkdir -p tests/test_build_components/build + sudo mount --bind /mnt/test_build_components_build tests/test_build_components/build + + # Convert space-separated components to comma-separated for Python script + components_csv=$(echo "${{ matrix.components }}" | tr ' ' ',') + + # Only isolate directly changed components when targeting dev branch + # For beta/release branches, group everything for faster CI + # + # WHY ISOLATE DIRECTLY CHANGED COMPONENTS? + # - Isolated tests run WITHOUT --testing-mode, enabling full validation + # - This catches pin conflicts and other issues in directly changed code + # - Grouped tests use --testing-mode to allow config merging (disables some checks) + # - Dependencies are safe to group since they weren't modified in this PR + if [ "${{ github.base_ref }}" = "beta" ] || [ "${{ github.base_ref }}" = "release" ]; then + directly_changed_csv="" + echo "Testing components: $components_csv" + echo "Target branch: ${{ github.base_ref }} - grouping all components" + else + directly_changed_csv=$(echo '${{ needs.determine-jobs.outputs.directly-changed-components-with-tests }}' | jq -r 'join(",")') + echo "Testing components: $components_csv" + echo "Target branch: ${{ github.base_ref }} - isolating directly changed components: $directly_changed_csv" + fi + echo "" + + # Run config validation with grouping and isolation + python3 script/test_build_components.py -e config -c "$components_csv" -f --isolate "$directly_changed_csv" + + echo "" + echo "Config validation passed! Starting compilation..." + echo "" + + # Run compilation with grouping and isolation + python3 script/test_build_components.py -e compile -c "$components_csv" -f --isolate "$directly_changed_csv" pre-commit-ci-lite: name: pre-commit.ci lite @@ -483,7 +500,6 @@ jobs: - integration-tests - clang-tidy - determine-jobs - - test-build-components - test-build-components-splitter - test-build-components-split - pre-commit-ci-lite diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index 59f58b7236..9aa7856116 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -58,7 +58,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL - uses: github/codeql-action/init@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4.30.7 + uses: github/codeql-action/init@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # v4.30.8 with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} @@ -86,6 +86,6 @@ jobs: exit 1 - name: Perform CodeQL Analysis - uses: github/codeql-action/analyze@e296a935590eb16afc0c0108289f68c87e2a89a5 # v4.30.7 + uses: github/codeql-action/analyze@f443b600d91635bebf5b0d9ebc620189c0d6fba5 # v4.30.8 with: category: "/language:${{matrix.language}}" diff --git a/esphome/__main__.py b/esphome/__main__.py index ab21142a3d..acc0ca72db 100644 --- a/esphome/__main__.py +++ b/esphome/__main__.py @@ -268,8 +268,10 @@ def has_ip_address() -> bool: def has_resolvable_address() -> bool: - """Check if CORE.address is resolvable (via mDNS or is an IP address).""" - return has_mdns() or has_ip_address() + """Check if CORE.address is resolvable (via mDNS, DNS, or is an IP address).""" + # Any address (IP, mDNS hostname, or regular DNS hostname) is resolvable + # The resolve_ip_address() function in helpers.py handles all types via AsyncResolver + return CORE.address is not None def mqtt_get_ip(config: ConfigType, username: str, password: str, client_id: str): @@ -578,11 +580,12 @@ def show_logs(config: ConfigType, args: ArgsProtocol, devices: list[str]) -> int if has_api(): addresses_to_use: list[str] | None = None - if port_type == "NETWORK" and (has_mdns() or is_ip_address(port)): + if port_type == "NETWORK": + # Network addresses (IPs, mDNS names, or regular DNS hostnames) can be used + # The resolve_ip_address() function in helpers.py handles all types addresses_to_use = devices - elif port_type in ("NETWORK", "MQTT", "MQTTIP") and has_mqtt_ip_lookup(): - # Only use MQTT IP lookup if the first condition didn't match - # (for MQTT/MQTTIP types, or for NETWORK when mdns/ip check fails) + elif port_type in ("MQTT", "MQTTIP") and has_mqtt_ip_lookup(): + # Use MQTT IP lookup for MQTT/MQTTIP types addresses_to_use = mqtt_get_ip( config, args.username, args.password, args.client_id ) @@ -1009,6 +1012,12 @@ def parse_args(argv): action="append", default=[], ) + options_parser.add_argument( + "--testing-mode", + help="Enable testing mode (disables validation checks for grouped component testing)", + action="store_true", + default=False, + ) parser = argparse.ArgumentParser( description=f"ESPHome {const.__version__}", parents=[options_parser] @@ -1278,6 +1287,7 @@ def run_esphome(argv): args = parse_args(argv) CORE.dashboard = args.dashboard + CORE.testing_mode = args.testing_mode # Create address cache from command-line arguments CORE.address_cache = AddressCache.from_cli_args( diff --git a/esphome/components/api/api.proto b/esphome/components/api/api.proto index 87f477799d..34864c5ce8 100644 --- a/esphome/components/api/api.proto +++ b/esphome/components/api/api.proto @@ -776,9 +776,9 @@ message HomeassistantActionRequest { option (ifdef) = "USE_API_HOMEASSISTANT_SERVICES"; string service = 1; - repeated HomeassistantServiceMap data = 2; - repeated HomeassistantServiceMap data_template = 3; - repeated HomeassistantServiceMap variables = 4; + repeated HomeassistantServiceMap data = 2 [(fixed_vector) = true]; + repeated HomeassistantServiceMap data_template = 3 [(fixed_vector) = true]; + repeated HomeassistantServiceMap variables = 4 [(fixed_vector) = true]; bool is_event = 5; uint32 call_id = 6 [(field_ifdef) = "USE_API_HOMEASSISTANT_ACTION_RESPONSES"]; bool wants_response = 7 [(field_ifdef) = "USE_API_HOMEASSISTANT_ACTION_RESPONSES_JSON"]; @@ -1519,7 +1519,7 @@ message BluetoothGATTCharacteristic { repeated uint64 uuid = 1 [(fixed_array_size) = 2, (fixed_array_skip_zero) = true]; uint32 handle = 2; uint32 properties = 3; - repeated BluetoothGATTDescriptor descriptors = 4; + repeated BluetoothGATTDescriptor descriptors = 4 [(fixed_vector) = true]; // New field for efficient UUID (v1.12+) // Only one of uuid or short_uuid will be set. @@ -1531,7 +1531,7 @@ message BluetoothGATTCharacteristic { message BluetoothGATTService { repeated uint64 uuid = 1 [(fixed_array_size) = 2, (fixed_array_skip_zero) = true]; uint32 handle = 2; - repeated BluetoothGATTCharacteristic characteristics = 3; + repeated BluetoothGATTCharacteristic characteristics = 3 [(fixed_vector) = true]; // New field for efficient UUID (v1.12+) // Only one of uuid or short_uuid will be set. diff --git a/esphome/components/api/api_options.proto b/esphome/components/api/api_options.proto index 633f39b552..ead8ac0bbc 100644 --- a/esphome/components/api/api_options.proto +++ b/esphome/components/api/api_options.proto @@ -64,4 +64,10 @@ extend google.protobuf.FieldOptions { // This is typically done through methods returning const T& or special accessor // methods like get_options() or supported_modes_for_api_(). optional string container_pointer = 50001; + + // fixed_vector: Use FixedVector instead of std::vector for repeated fields + // When set, the repeated field will use FixedVector which requires calling + // init(size) before adding elements. This eliminates std::vector template overhead + // and is ideal when the exact size is known before populating the array. + optional bool fixed_vector = 50013 [default=false]; } diff --git a/esphome/components/api/api_pb2.h b/esphome/components/api/api_pb2.h index d9e68ece9b..7d6b31ca3c 100644 --- a/esphome/components/api/api_pb2.h +++ b/esphome/components/api/api_pb2.h @@ -1110,9 +1110,9 @@ class HomeassistantActionRequest final : public ProtoMessage { #endif StringRef service_ref_{}; void set_service(const StringRef &ref) { this->service_ref_ = ref; } - std::vector data{}; - std::vector data_template{}; - std::vector variables{}; + FixedVector data{}; + FixedVector data_template{}; + FixedVector variables{}; bool is_event{false}; #ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES uint32_t call_id{0}; @@ -1923,7 +1923,7 @@ class BluetoothGATTCharacteristic final : public ProtoMessage { std::array uuid{}; uint32_t handle{0}; uint32_t properties{0}; - std::vector descriptors{}; + FixedVector descriptors{}; uint32_t short_uuid{0}; void encode(ProtoWriteBuffer buffer) const override; void calculate_size(ProtoSize &size) const override; @@ -1937,7 +1937,7 @@ class BluetoothGATTService final : public ProtoMessage { public: std::array uuid{}; uint32_t handle{0}; - std::vector characteristics{}; + FixedVector characteristics{}; uint32_t short_uuid{0}; void encode(ProtoWriteBuffer buffer) const override; void calculate_size(ProtoSize &size) const override; diff --git a/esphome/components/api/custom_api_device.h b/esphome/components/api/custom_api_device.h index 0c6e49d6ca..711eba2444 100644 --- a/esphome/components/api/custom_api_device.h +++ b/esphome/components/api/custom_api_device.h @@ -201,9 +201,9 @@ class CustomAPIDevice { void call_homeassistant_service(const std::string &service_name, const std::map &data) { HomeassistantActionRequest resp; resp.set_service(StringRef(service_name)); + resp.data.init(data.size()); for (auto &it : data) { - resp.data.emplace_back(); - auto &kv = resp.data.back(); + auto &kv = resp.data.emplace_back(); kv.set_key(StringRef(it.first)); kv.value = it.second; } @@ -244,9 +244,9 @@ class CustomAPIDevice { HomeassistantActionRequest resp; resp.set_service(StringRef(service_name)); resp.is_event = true; + resp.data.init(data.size()); for (auto &it : data) { - resp.data.emplace_back(); - auto &kv = resp.data.back(); + auto &kv = resp.data.emplace_back(); kv.set_key(StringRef(it.first)); kv.value = it.second; } diff --git a/esphome/components/api/homeassistant_service.h b/esphome/components/api/homeassistant_service.h index 730024f7b7..46e89cb39f 100644 --- a/esphome/components/api/homeassistant_service.h +++ b/esphome/components/api/homeassistant_service.h @@ -127,24 +127,9 @@ template class HomeAssistantServiceCallAction : public Actionservice_.value(x...); resp.set_service(StringRef(service_value)); resp.is_event = this->flags_.is_event; - for (auto &it : this->data_) { - resp.data.emplace_back(); - auto &kv = resp.data.back(); - kv.set_key(StringRef(it.key)); - kv.value = it.value.value(x...); - } - for (auto &it : this->data_template_) { - resp.data_template.emplace_back(); - auto &kv = resp.data_template.back(); - kv.set_key(StringRef(it.key)); - kv.value = it.value.value(x...); - } - for (auto &it : this->variables_) { - resp.variables.emplace_back(); - auto &kv = resp.variables.back(); - kv.set_key(StringRef(it.key)); - kv.value = it.value.value(x...); - } + this->populate_service_map(resp.data, this->data_, x...); + this->populate_service_map(resp.data_template, this->data_template_, x...); + this->populate_service_map(resp.variables, this->variables_, x...); #ifdef USE_API_HOMEASSISTANT_ACTION_RESPONSES if (this->flags_.wants_status) { @@ -189,6 +174,16 @@ template class HomeAssistantServiceCallAction : public Action + static void populate_service_map(VectorType &dest, SourceType &source, Ts... x) { + dest.init(source.size()); + for (auto &it : source) { + auto &kv = dest.emplace_back(); + kv.set_key(StringRef(it.key)); + kv.value = it.value.value(x...); + } + } + APIServer *parent_; TemplatableStringValue service_{}; std::vector> data_; diff --git a/esphome/components/api/proto.h b/esphome/components/api/proto.h index 9d780692ec..a6a09bf7c5 100644 --- a/esphome/components/api/proto.h +++ b/esphome/components/api/proto.h @@ -749,13 +749,29 @@ class ProtoSize { template inline void add_repeated_message(uint32_t field_id_size, const std::vector &messages) { // Skip if the vector is empty - if (messages.empty()) { - return; + if (!messages.empty()) { + // Use the force version for all messages in the repeated field + for (const auto &message : messages) { + add_message_object_force(field_id_size, message); + } } + } - // Use the force version for all messages in the repeated field - for (const auto &message : messages) { - add_message_object_force(field_id_size, message); + /** + * @brief Calculates and adds the sizes of all messages in a repeated field to the total message size (FixedVector + * version) + * + * @tparam MessageType The type of the nested messages in the FixedVector + * @param messages FixedVector of message objects + */ + template + inline void add_repeated_message(uint32_t field_id_size, const FixedVector &messages) { + // Skip if the fixed vector is empty + if (!messages.empty()) { + // Use the force version for all messages in the repeated field + for (const auto &message : messages) { + add_message_object_force(field_id_size, message); + } } } }; diff --git a/esphome/components/bluetooth_proxy/bluetooth_connection.cpp b/esphome/components/bluetooth_proxy/bluetooth_connection.cpp index cde82fbfb0..fcc344dda9 100644 --- a/esphome/components/bluetooth_proxy/bluetooth_connection.cpp +++ b/esphome/components/bluetooth_proxy/bluetooth_connection.cpp @@ -230,8 +230,8 @@ void BluetoothConnection::send_service_for_discovery_() { service_resp.handle = service_result.start_handle; if (total_char_count > 0) { - // Reserve space and process characteristics - service_resp.characteristics.reserve(total_char_count); + // Initialize FixedVector with exact count and process characteristics + service_resp.characteristics.init(total_char_count); uint16_t char_offset = 0; esp_gattc_char_elem_t char_result; while (true) { // characteristics @@ -253,9 +253,7 @@ void BluetoothConnection::send_service_for_discovery_() { service_resp.characteristics.emplace_back(); auto &characteristic_resp = service_resp.characteristics.back(); - fill_gatt_uuid(characteristic_resp.uuid, characteristic_resp.short_uuid, char_result.uuid, use_efficient_uuids); - characteristic_resp.handle = char_result.char_handle; characteristic_resp.properties = char_result.properties; char_offset++; @@ -271,12 +269,11 @@ void BluetoothConnection::send_service_for_discovery_() { return; } if (total_desc_count == 0) { - // No descriptors, continue to next characteristic continue; } - // Reserve space and process descriptors - characteristic_resp.descriptors.reserve(total_desc_count); + // Initialize FixedVector with exact count and process descriptors + characteristic_resp.descriptors.init(total_desc_count); uint16_t desc_offset = 0; esp_gattc_descr_elem_t desc_result; while (true) { // descriptors @@ -297,9 +294,7 @@ void BluetoothConnection::send_service_for_discovery_() { characteristic_resp.descriptors.emplace_back(); auto &descriptor_resp = characteristic_resp.descriptors.back(); - fill_gatt_uuid(descriptor_resp.uuid, descriptor_resp.short_uuid, desc_result.uuid, use_efficient_uuids); - descriptor_resp.handle = desc_result.handle; desc_offset++; } diff --git a/esphome/components/bluetooth_proxy/bluetooth_proxy.h b/esphome/components/bluetooth_proxy/bluetooth_proxy.h index 1ce2321bee..a5f0fbe32f 100644 --- a/esphome/components/bluetooth_proxy/bluetooth_proxy.h +++ b/esphome/components/bluetooth_proxy/bluetooth_proxy.h @@ -16,7 +16,9 @@ #include "bluetooth_connection.h" +#ifndef CONFIG_ESP_HOSTED_ENABLE_BT_BLUEDROID #include +#endif #include namespace esphome::bluetooth_proxy { diff --git a/esphome/components/esp32/__init__.py b/esphome/components/esp32/__init__.py index d9b8d067a4..92f5c57638 100644 --- a/esphome/components/esp32/__init__.py +++ b/esphome/components/esp32/__init__.py @@ -324,9 +324,9 @@ def _is_framework_url(source: str) -> str: # The default/recommended arduino framework version # - https://github.com/espressif/arduino-esp32/releases ARDUINO_FRAMEWORK_VERSION_LOOKUP = { - "recommended": cv.Version(3, 2, 1), - "latest": cv.Version(3, 3, 1), - "dev": cv.Version(3, 3, 1), + "recommended": cv.Version(3, 3, 2), + "latest": cv.Version(3, 3, 2), + "dev": cv.Version(3, 3, 2), } ARDUINO_PLATFORM_VERSION_LOOKUP = { cv.Version(3, 3, 2): cv.Version(55, 3, 31, "1"), @@ -343,7 +343,7 @@ ARDUINO_PLATFORM_VERSION_LOOKUP = { # The default/recommended esp-idf framework version # - https://github.com/espressif/esp-idf/releases ESP_IDF_FRAMEWORK_VERSION_LOOKUP = { - "recommended": cv.Version(5, 4, 2), + "recommended": cv.Version(5, 5, 1), "latest": cv.Version(5, 5, 1), "dev": cv.Version(5, 5, 1), } @@ -363,7 +363,7 @@ ESP_IDF_PLATFORM_VERSION_LOOKUP = { # The platform-espressif32 version # - https://github.com/pioarduino/platform-espressif32/releases PLATFORM_VERSION_LOOKUP = { - "recommended": cv.Version(54, 3, 21, "2"), + "recommended": cv.Version(55, 3, 31, "1"), "latest": cv.Version(55, 3, 31, "1"), "dev": cv.Version(55, 3, 31, "1"), } @@ -544,6 +544,7 @@ CONF_ENABLE_LWIP_MDNS_QUERIES = "enable_lwip_mdns_queries" CONF_ENABLE_LWIP_BRIDGE_INTERFACE = "enable_lwip_bridge_interface" CONF_ENABLE_LWIP_TCPIP_CORE_LOCKING = "enable_lwip_tcpip_core_locking" CONF_ENABLE_LWIP_CHECK_THREAD_SAFETY = "enable_lwip_check_thread_safety" +CONF_DISABLE_LIBC_LOCKS_IN_IRAM = "disable_libc_locks_in_iram" def _validate_idf_component(config: ConfigType) -> ConfigType: @@ -606,6 +607,9 @@ FRAMEWORK_SCHEMA = cv.All( cv.Optional( CONF_ENABLE_LWIP_CHECK_THREAD_SAFETY, default=True ): cv.boolean, + cv.Optional( + CONF_DISABLE_LIBC_LOCKS_IN_IRAM, default=True + ): cv.boolean, cv.Optional(CONF_EXECUTE_FROM_PSRAM): cv.boolean, } ), @@ -864,6 +868,12 @@ async def to_code(config): if advanced.get(CONF_ENABLE_LWIP_CHECK_THREAD_SAFETY, True): add_idf_sdkconfig_option("CONFIG_LWIP_CHECK_THREAD_SAFETY", True) + # Disable placing libc locks in IRAM to save RAM + # This is safe for ESPHome since no IRAM ISRs (interrupts that run while cache is disabled) + # use libc lock APIs. Saves approximately 1.3KB (1,356 bytes) of IRAM. + if advanced.get(CONF_DISABLE_LIBC_LOCKS_IN_IRAM, True): + add_idf_sdkconfig_option("CONFIG_LIBC_LOCKS_PLACE_IN_IRAM", False) + cg.add_platformio_option("board_build.partitions", "partitions.csv") if CONF_PARTITIONS in config: add_extra_build_file( diff --git a/esphome/components/esp32/boards.py b/esphome/components/esp32/boards.py index 5f039492c8..cbb314650a 100644 --- a/esphome/components/esp32/boards.py +++ b/esphome/components/esp32/boards.py @@ -1564,6 +1564,10 @@ BOARDS = { "name": "DFRobot Beetle ESP32-C3", "variant": VARIANT_ESP32C3, }, + "dfrobot_firebeetle2_esp32c6": { + "name": "DFRobot FireBeetle 2 ESP32-C6", + "variant": VARIANT_ESP32C6, + }, "dfrobot_firebeetle2_esp32e": { "name": "DFRobot Firebeetle 2 ESP32-E", "variant": VARIANT_ESP32, @@ -1604,6 +1608,22 @@ BOARDS = { "name": "Ai-Thinker ESP-C3-M1-I-Kit", "variant": VARIANT_ESP32C3, }, + "esp32-c5-devkitc-1": { + "name": "Espressif ESP32-C5-DevKitC-1 4MB no PSRAM", + "variant": VARIANT_ESP32C5, + }, + "esp32-c5-devkitc1-n16r4": { + "name": "Espressif ESP32-C5-DevKitC-1 N16R4 (16 MB Flash Quad, 4 MB PSRAM Quad)", + "variant": VARIANT_ESP32C5, + }, + "esp32-c5-devkitc1-n4": { + "name": "Espressif ESP32-C5-DevKitC-1 N4 (4MB no PSRAM)", + "variant": VARIANT_ESP32C5, + }, + "esp32-c5-devkitc1-n8r4": { + "name": "Espressif ESP32-C5-DevKitC-1 N8R4 (8 MB Flash Quad, 4 MB PSRAM Quad)", + "variant": VARIANT_ESP32C5, + }, "esp32-c6-devkitc-1": { "name": "Espressif ESP32-C6-DevKitC-1", "variant": VARIANT_ESP32C6, @@ -2048,6 +2068,10 @@ BOARDS = { "name": "M5Stack Station", "variant": VARIANT_ESP32, }, + "m5stack-tab5-p4": { + "name": "M5STACK Tab5 esp32-p4 Board", + "variant": VARIANT_ESP32P4, + }, "m5stack-timer-cam": { "name": "M5Stack Timer CAM", "variant": VARIANT_ESP32, @@ -2476,6 +2500,10 @@ BOARDS = { "name": "YelloByte YB-ESP32-S3-AMP (Rev.3)", "variant": VARIANT_ESP32S3, }, + "yb_esp32s3_drv": { + "name": "YelloByte YB-ESP32-S3-DRV", + "variant": VARIANT_ESP32S3, + }, "yb_esp32s3_eth": { "name": "YelloByte YB-ESP32-S3-ETH", "variant": VARIANT_ESP32S3, diff --git a/esphome/components/esp32_ble/__init__.py b/esphome/components/esp32_ble/__init__.py index 15afb22ab8..246ebf0729 100644 --- a/esphome/components/esp32_ble/__init__.py +++ b/esphome/components/esp32_ble/__init__.py @@ -1,4 +1,5 @@ from collections.abc import Callable, MutableMapping +from dataclasses import dataclass from enum import Enum import logging import re @@ -16,7 +17,7 @@ from esphome.const import ( CONF_NAME, CONF_NAME_ADD_MAC_SUFFIX, ) -from esphome.core import CORE, TimePeriod +from esphome.core import CORE, CoroPriority, TimePeriod, coroutine_with_priority import esphome.final_validate as fv DEPENDENCIES = ["esp32"] @@ -111,6 +112,58 @@ class BTLoggers(Enum): _required_loggers: set[BTLoggers] = set() +# Dataclass for handler registration counts +@dataclass +class HandlerCounts: + gap_event: int = 0 + gap_scan_event: int = 0 + gattc_event: int = 0 + gatts_event: int = 0 + ble_status_event: int = 0 + + +# Track handler registration counts for StaticVector sizing +_handler_counts = HandlerCounts() + + +def register_gap_event_handler(parent_var: cg.MockObj, handler_var: cg.MockObj) -> None: + """Register a GAP event handler and track the count.""" + _handler_counts.gap_event += 1 + cg.add(parent_var.register_gap_event_handler(handler_var)) + + +def register_gap_scan_event_handler( + parent_var: cg.MockObj, handler_var: cg.MockObj +) -> None: + """Register a GAP scan event handler and track the count.""" + _handler_counts.gap_scan_event += 1 + cg.add(parent_var.register_gap_scan_event_handler(handler_var)) + + +def register_gattc_event_handler( + parent_var: cg.MockObj, handler_var: cg.MockObj +) -> None: + """Register a GATTc event handler and track the count.""" + _handler_counts.gattc_event += 1 + cg.add(parent_var.register_gattc_event_handler(handler_var)) + + +def register_gatts_event_handler( + parent_var: cg.MockObj, handler_var: cg.MockObj +) -> None: + """Register a GATTs event handler and track the count.""" + _handler_counts.gatts_event += 1 + cg.add(parent_var.register_gatts_event_handler(handler_var)) + + +def register_ble_status_event_handler( + parent_var: cg.MockObj, handler_var: cg.MockObj +) -> None: + """Register a BLE status event handler and track the count.""" + _handler_counts.ble_status_event += 1 + cg.add(parent_var.register_ble_status_event_handler(handler_var)) + + def register_bt_logger(*loggers: BTLoggers) -> None: """Register Bluetooth logger categories that a component needs. @@ -285,6 +338,10 @@ def consume_connection_slots( def validate_connection_slots(max_connections: int) -> None: """Validate that BLE connection slots don't exceed the configured maximum.""" + # Skip validation in testing mode to allow component grouping + if CORE.testing_mode: + return + ble_data = CORE.data.get(KEY_ESP32_BLE, {}) used_slots = ble_data.get(KEY_USED_CONNECTION_SLOTS, []) num_used = len(used_slots) @@ -330,14 +387,27 @@ def final_validation(config): max_connections = config.get(CONF_MAX_CONNECTIONS, DEFAULT_MAX_CONNECTIONS) validate_connection_slots(max_connections) + # Check if hosted bluetooth is being used + if "esp32_hosted" in full_config: + add_idf_sdkconfig_option("CONFIG_BT_CLASSIC_ENABLED", False) + add_idf_sdkconfig_option("CONFIG_BT_BLE_ENABLED", True) + add_idf_sdkconfig_option("CONFIG_BT_BLUEDROID_ENABLED", True) + add_idf_sdkconfig_option("CONFIG_BT_CONTROLLER_DISABLED", True) + add_idf_sdkconfig_option("CONFIG_ESP_HOSTED_ENABLE_BT_BLUEDROID", True) + add_idf_sdkconfig_option("CONFIG_ESP_HOSTED_BLUEDROID_HCI_VHCI", True) + # Check if BLE Server is needed has_ble_server = "esp32_ble_server" in full_config - add_idf_sdkconfig_option("CONFIG_BT_GATTS_ENABLE", has_ble_server) # Check if BLE Client is needed (via esp32_ble_tracker or esp32_ble_client) has_ble_client = ( "esp32_ble_tracker" in full_config or "esp32_ble_client" in full_config ) + + # ESP-IDF BLE stack requires GATT Server to be enabled when GATT Client is enabled + # This is an internal dependency in the Bluedroid stack (tested ESP-IDF 5.4.2-5.5.1) + # See: https://github.com/espressif/esp-idf/issues/17724 + add_idf_sdkconfig_option("CONFIG_BT_GATTS_ENABLE", has_ble_server or has_ble_client) add_idf_sdkconfig_option("CONFIG_BT_GATTC_ENABLE", has_ble_client) # Handle max_connections: check for deprecated location in esp32_ble_tracker @@ -366,6 +436,36 @@ def final_validation(config): FINAL_VALIDATE_SCHEMA = final_validation +# This needs to be run as a job with CoroPriority.FINAL priority so that all components have +# a chance to register their handlers before the counts are added to defines. +@coroutine_with_priority(CoroPriority.FINAL) +async def _add_ble_handler_defines(): + # Add defines for StaticVector sizing based on handler registration counts + # Only define if count > 0 to avoid allocating unnecessary memory + if _handler_counts.gap_event > 0: + cg.add_define( + "ESPHOME_ESP32_BLE_GAP_EVENT_HANDLER_COUNT", _handler_counts.gap_event + ) + if _handler_counts.gap_scan_event > 0: + cg.add_define( + "ESPHOME_ESP32_BLE_GAP_SCAN_EVENT_HANDLER_COUNT", + _handler_counts.gap_scan_event, + ) + if _handler_counts.gattc_event > 0: + cg.add_define( + "ESPHOME_ESP32_BLE_GATTC_EVENT_HANDLER_COUNT", _handler_counts.gattc_event + ) + if _handler_counts.gatts_event > 0: + cg.add_define( + "ESPHOME_ESP32_BLE_GATTS_EVENT_HANDLER_COUNT", _handler_counts.gatts_event + ) + if _handler_counts.ble_status_event > 0: + cg.add_define( + "ESPHOME_ESP32_BLE_BLE_STATUS_EVENT_HANDLER_COUNT", + _handler_counts.ble_status_event, + ) + + async def to_code(config): var = cg.new_Pvariable(config[CONF_ID]) cg.add(var.set_enable_on_boot(config[CONF_ENABLE_ON_BOOT])) @@ -420,6 +520,9 @@ async def to_code(config): cg.add_define("USE_ESP32_BLE_ADVERTISING") cg.add_define("USE_ESP32_BLE_UUID") + # Schedule the handler defines to be added after all components register + CORE.add_job(_add_ble_handler_defines) + @automation.register_condition("ble.enabled", BLEEnabledCondition, cv.Schema({})) async def ble_enabled_to_code(config, condition_id, template_arg, args): diff --git a/esphome/components/esp32_ble/ble.cpp b/esphome/components/esp32_ble/ble.cpp index 41a90150ef..b66acb38ad 100644 --- a/esphome/components/esp32_ble/ble.cpp +++ b/esphome/components/esp32_ble/ble.cpp @@ -6,7 +6,15 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" +#ifndef CONFIG_ESP_HOSTED_ENABLE_BT_BLUEDROID #include +#else +extern "C" { +#include +#include +#include +} +#endif #include #include #include @@ -140,6 +148,7 @@ void ESP32BLE::advertising_init_() { bool ESP32BLE::ble_setup_() { esp_err_t err; +#ifndef CONFIG_ESP_HOSTED_ENABLE_BT_BLUEDROID #ifdef USE_ARDUINO if (!btStart()) { ESP_LOGE(TAG, "btStart failed: %d", esp_bt_controller_get_status()); @@ -173,6 +182,28 @@ bool ESP32BLE::ble_setup_() { #endif esp_bt_controller_mem_release(ESP_BT_MODE_CLASSIC_BT); +#else + esp_hosted_connect_to_slave(); // NOLINT + + if (esp_hosted_bt_controller_init() != ESP_OK) { + ESP_LOGW(TAG, "esp_hosted_bt_controller_init failed"); + return false; + } + + if (esp_hosted_bt_controller_enable() != ESP_OK) { + ESP_LOGW(TAG, "esp_hosted_bt_controller_enable failed"); + return false; + } + + hosted_hci_bluedroid_open(); + + esp_bluedroid_hci_driver_operations_t operations = { + .send = hosted_hci_bluedroid_send, + .check_send_available = hosted_hci_bluedroid_check_send_available, + .register_host_callback = hosted_hci_bluedroid_register_host_callback, + }; + esp_bluedroid_attach_hci_driver(&operations); +#endif err = esp_bluedroid_init(); if (err != ESP_OK) { @@ -185,31 +216,27 @@ bool ESP32BLE::ble_setup_() { return false; } - if (!this->gap_event_handlers_.empty()) { - err = esp_ble_gap_register_callback(ESP32BLE::gap_event_handler); - if (err != ESP_OK) { - ESP_LOGE(TAG, "esp_ble_gap_register_callback failed: %d", err); - return false; - } - } - -#ifdef USE_ESP32_BLE_SERVER - if (!this->gatts_event_handlers_.empty()) { - err = esp_ble_gatts_register_callback(ESP32BLE::gatts_event_handler); - if (err != ESP_OK) { - ESP_LOGE(TAG, "esp_ble_gatts_register_callback failed: %d", err); - return false; - } +#ifdef ESPHOME_ESP32_BLE_GAP_EVENT_HANDLER_COUNT + err = esp_ble_gap_register_callback(ESP32BLE::gap_event_handler); + if (err != ESP_OK) { + ESP_LOGE(TAG, "esp_ble_gap_register_callback failed: %d", err); + return false; } #endif -#ifdef USE_ESP32_BLE_CLIENT - if (!this->gattc_event_handlers_.empty()) { - err = esp_ble_gattc_register_callback(ESP32BLE::gattc_event_handler); - if (err != ESP_OK) { - ESP_LOGE(TAG, "esp_ble_gattc_register_callback failed: %d", err); - return false; - } +#if defined(USE_ESP32_BLE_SERVER) && defined(ESPHOME_ESP32_BLE_GATTS_EVENT_HANDLER_COUNT) + err = esp_ble_gatts_register_callback(ESP32BLE::gatts_event_handler); + if (err != ESP_OK) { + ESP_LOGE(TAG, "esp_ble_gatts_register_callback failed: %d", err); + return false; + } +#endif + +#if defined(USE_ESP32_BLE_CLIENT) && defined(ESPHOME_ESP32_BLE_GATTC_EVENT_HANDLER_COUNT) + err = esp_ble_gattc_register_callback(ESP32BLE::gattc_event_handler); + if (err != ESP_OK) { + ESP_LOGE(TAG, "esp_ble_gattc_register_callback failed: %d", err); + return false; } #endif @@ -217,8 +244,11 @@ bool ESP32BLE::ble_setup_() { if (this->name_.has_value()) { name = this->name_.value(); if (App.is_name_add_mac_suffix_enabled()) { - name += "-"; - name += get_mac_address().substr(6); + // MAC address suffix length (last 6 characters of 12-char MAC address string) + constexpr size_t mac_address_suffix_len = 6; + const std::string mac_addr = get_mac_address(); + const char *mac_suffix_ptr = mac_addr.c_str() + mac_address_suffix_len; + name = make_name_with_suffix(name, '-', mac_suffix_ptr, mac_address_suffix_len); } } else { name = App.get_name(); @@ -262,6 +292,7 @@ bool ESP32BLE::ble_dismantle_() { return false; } +#ifndef CONFIG_ESP_HOSTED_ENABLE_BT_BLUEDROID #ifdef USE_ARDUINO if (!btStop()) { ESP_LOGE(TAG, "btStop failed: %d", esp_bt_controller_get_status()); @@ -291,6 +322,19 @@ bool ESP32BLE::ble_dismantle_() { return false; } } +#endif +#else + if (esp_hosted_bt_controller_disable() != ESP_OK) { + ESP_LOGW(TAG, "esp_hosted_bt_controller_disable failed"); + return false; + } + + if (esp_hosted_bt_controller_deinit(false) != ESP_OK) { + ESP_LOGW(TAG, "esp_hosted_bt_controller_deinit failed"); + return false; + } + + hosted_hci_bluedroid_close(); #endif return true; } @@ -303,9 +347,11 @@ void ESP32BLE::loop() { case BLE_COMPONENT_STATE_DISABLE: { ESP_LOGD(TAG, "Disabling"); +#ifdef ESPHOME_ESP32_BLE_BLE_STATUS_EVENT_HANDLER_COUNT for (auto *ble_event_handler : this->ble_status_event_handlers_) { ble_event_handler->ble_before_disabled_event_handler(); } +#endif if (!ble_dismantle_()) { ESP_LOGE(TAG, "Could not be dismantled"); @@ -335,7 +381,7 @@ void ESP32BLE::loop() { BLEEvent *ble_event = this->ble_events_.pop(); while (ble_event != nullptr) { switch (ble_event->type_) { -#ifdef USE_ESP32_BLE_SERVER +#if defined(USE_ESP32_BLE_SERVER) && defined(ESPHOME_ESP32_BLE_GATTS_EVENT_HANDLER_COUNT) case BLEEvent::GATTS: { esp_gatts_cb_event_t event = ble_event->event_.gatts.gatts_event; esp_gatt_if_t gatts_if = ble_event->event_.gatts.gatts_if; @@ -347,7 +393,7 @@ void ESP32BLE::loop() { break; } #endif -#ifdef USE_ESP32_BLE_CLIENT +#if defined(USE_ESP32_BLE_CLIENT) && defined(ESPHOME_ESP32_BLE_GATTC_EVENT_HANDLER_COUNT) case BLEEvent::GATTC: { esp_gattc_cb_event_t event = ble_event->event_.gattc.gattc_event; esp_gatt_if_t gattc_if = ble_event->event_.gattc.gattc_if; @@ -363,10 +409,12 @@ void ESP32BLE::loop() { esp_gap_ble_cb_event_t gap_event = ble_event->event_.gap.gap_event; switch (gap_event) { case ESP_GAP_BLE_SCAN_RESULT_EVT: +#ifdef ESPHOME_ESP32_BLE_GAP_SCAN_EVENT_HANDLER_COUNT // Use the new scan event handler - no memcpy! for (auto *scan_handler : this->gap_scan_event_handlers_) { scan_handler->gap_scan_event_handler(ble_event->scan_result()); } +#endif break; // Scan complete events @@ -378,10 +426,12 @@ void ESP32BLE::loop() { // This is verified at compile-time by static_assert checks in ble_event.h // The struct already contains our copy of the status (copied in BLEEvent constructor) ESP_LOGV(TAG, "gap_event_handler - %d", gap_event); +#ifdef ESPHOME_ESP32_BLE_GAP_EVENT_HANDLER_COUNT for (auto *gap_handler : this->gap_event_handlers_) { gap_handler->gap_event_handler( gap_event, reinterpret_cast(&ble_event->event_.gap.scan_complete)); } +#endif break; // Advertising complete events @@ -392,19 +442,23 @@ void ESP32BLE::loop() { case ESP_GAP_BLE_ADV_STOP_COMPLETE_EVT: // All advertising complete events have the same structure with just status ESP_LOGV(TAG, "gap_event_handler - %d", gap_event); +#ifdef ESPHOME_ESP32_BLE_GAP_EVENT_HANDLER_COUNT for (auto *gap_handler : this->gap_event_handlers_) { gap_handler->gap_event_handler( gap_event, reinterpret_cast(&ble_event->event_.gap.adv_complete)); } +#endif break; // RSSI complete event case ESP_GAP_BLE_READ_RSSI_COMPLETE_EVT: ESP_LOGV(TAG, "gap_event_handler - %d", gap_event); +#ifdef ESPHOME_ESP32_BLE_GAP_EVENT_HANDLER_COUNT for (auto *gap_handler : this->gap_event_handlers_) { gap_handler->gap_event_handler( gap_event, reinterpret_cast(&ble_event->event_.gap.read_rssi_complete)); } +#endif break; // Security events @@ -414,10 +468,12 @@ void ESP32BLE::loop() { case ESP_GAP_BLE_PASSKEY_REQ_EVT: case ESP_GAP_BLE_NC_REQ_EVT: ESP_LOGV(TAG, "gap_event_handler - %d", gap_event); +#ifdef ESPHOME_ESP32_BLE_GAP_EVENT_HANDLER_COUNT for (auto *gap_handler : this->gap_event_handlers_) { gap_handler->gap_event_handler( gap_event, reinterpret_cast(&ble_event->event_.gap.security)); } +#endif break; default: diff --git a/esphome/components/esp32_ble/ble.h b/esphome/components/esp32_ble/ble.h index b49e5d12ee..03dd147bb2 100644 --- a/esphome/components/esp32_ble/ble.h +++ b/esphome/components/esp32_ble/ble.h @@ -126,19 +126,25 @@ class ESP32BLE : public Component { void advertising_register_raw_advertisement_callback(std::function &&callback); #endif +#ifdef ESPHOME_ESP32_BLE_GAP_EVENT_HANDLER_COUNT void register_gap_event_handler(GAPEventHandler *handler) { this->gap_event_handlers_.push_back(handler); } +#endif +#ifdef ESPHOME_ESP32_BLE_GAP_SCAN_EVENT_HANDLER_COUNT void register_gap_scan_event_handler(GAPScanEventHandler *handler) { this->gap_scan_event_handlers_.push_back(handler); } -#ifdef USE_ESP32_BLE_CLIENT +#endif +#if defined(USE_ESP32_BLE_CLIENT) && defined(ESPHOME_ESP32_BLE_GATTC_EVENT_HANDLER_COUNT) void register_gattc_event_handler(GATTcEventHandler *handler) { this->gattc_event_handlers_.push_back(handler); } #endif -#ifdef USE_ESP32_BLE_SERVER +#if defined(USE_ESP32_BLE_SERVER) && defined(ESPHOME_ESP32_BLE_GATTS_EVENT_HANDLER_COUNT) void register_gatts_event_handler(GATTsEventHandler *handler) { this->gatts_event_handlers_.push_back(handler); } #endif +#ifdef ESPHOME_ESP32_BLE_BLE_STATUS_EVENT_HANDLER_COUNT void register_ble_status_event_handler(BLEStatusEventHandler *handler) { this->ble_status_event_handlers_.push_back(handler); } +#endif void set_enable_on_boot(bool enable_on_boot) { this->enable_on_boot_ = enable_on_boot; } protected: @@ -160,16 +166,22 @@ class ESP32BLE : public Component { private: template friend void enqueue_ble_event(Args... args); - // Vectors (12 bytes each on 32-bit, naturally aligned to 4 bytes) - std::vector gap_event_handlers_; - std::vector gap_scan_event_handlers_; -#ifdef USE_ESP32_BLE_CLIENT - std::vector gattc_event_handlers_; + // Handler vectors - use StaticVector when counts are known at compile time +#ifdef ESPHOME_ESP32_BLE_GAP_EVENT_HANDLER_COUNT + StaticVector gap_event_handlers_; #endif -#ifdef USE_ESP32_BLE_SERVER - std::vector gatts_event_handlers_; +#ifdef ESPHOME_ESP32_BLE_GAP_SCAN_EVENT_HANDLER_COUNT + StaticVector gap_scan_event_handlers_; +#endif +#if defined(USE_ESP32_BLE_CLIENT) && defined(ESPHOME_ESP32_BLE_GATTC_EVENT_HANDLER_COUNT) + StaticVector gattc_event_handlers_; +#endif +#if defined(USE_ESP32_BLE_SERVER) && defined(ESPHOME_ESP32_BLE_GATTS_EVENT_HANDLER_COUNT) + StaticVector gatts_event_handlers_; +#endif +#ifdef ESPHOME_ESP32_BLE_BLE_STATUS_EVENT_HANDLER_COUNT + StaticVector ble_status_event_handlers_; #endif - std::vector ble_status_event_handlers_; // Large objects (size depends on template parameters, but typically aligned to 4 bytes) esphome::LockFreeQueue ble_events_; diff --git a/esphome/components/esp32_ble/ble_advertising.h b/esphome/components/esp32_ble/ble_advertising.h index 70d58d5ce9..66ff7984d3 100644 --- a/esphome/components/esp32_ble/ble_advertising.h +++ b/esphome/components/esp32_ble/ble_advertising.h @@ -10,7 +10,9 @@ #ifdef USE_ESP32 #ifdef USE_ESP32_BLE_ADVERTISING +#ifndef CONFIG_ESP_HOSTED_ENABLE_BT_BLUEDROID #include +#endif #include #include diff --git a/esphome/components/esp32_ble_beacon/__init__.py b/esphome/components/esp32_ble_beacon/__init__.py index 794f5637a4..ba5ae4331c 100644 --- a/esphome/components/esp32_ble_beacon/__init__.py +++ b/esphome/components/esp32_ble_beacon/__init__.py @@ -74,7 +74,7 @@ async def to_code(config): var = cg.new_Pvariable(config[CONF_ID], uuid_arr) parent = await cg.get_variable(config[esp32_ble.CONF_BLE_ID]) - cg.add(parent.register_gap_event_handler(var)) + esp32_ble.register_gap_event_handler(parent, var) await cg.register_component(var, config) cg.add(var.set_major(config[CONF_MAJOR])) diff --git a/esphome/components/esp32_ble_beacon/esp32_ble_beacon.cpp b/esphome/components/esp32_ble_beacon/esp32_ble_beacon.cpp index ee6eca99a7..6f7c0fa389 100644 --- a/esphome/components/esp32_ble_beacon/esp32_ble_beacon.cpp +++ b/esphome/components/esp32_ble_beacon/esp32_ble_beacon.cpp @@ -4,7 +4,9 @@ #ifdef USE_ESP32 +#ifndef CONFIG_ESP_HOSTED_ENABLE_BT_BLUEDROID #include +#endif #include #include #include diff --git a/esphome/components/esp32_ble_beacon/esp32_ble_beacon.h b/esphome/components/esp32_ble_beacon/esp32_ble_beacon.h index e37edf6cde..05afdc7379 100644 --- a/esphome/components/esp32_ble_beacon/esp32_ble_beacon.h +++ b/esphome/components/esp32_ble_beacon/esp32_ble_beacon.h @@ -5,7 +5,9 @@ #ifdef USE_ESP32 +#ifndef CONFIG_ESP_HOSTED_ENABLE_BT_BLUEDROID #include +#endif #include namespace esphome { diff --git a/esphome/components/esp32_ble_server/__init__.py b/esphome/components/esp32_ble_server/__init__.py index 10fa09fcc3..55310f3275 100644 --- a/esphome/components/esp32_ble_server/__init__.py +++ b/esphome/components/esp32_ble_server/__init__.py @@ -546,8 +546,8 @@ async def to_code(config): await cg.register_component(var, config) parent = await cg.get_variable(config[esp32_ble.CONF_BLE_ID]) - cg.add(parent.register_gatts_event_handler(var)) - cg.add(parent.register_ble_status_event_handler(var)) + esp32_ble.register_gatts_event_handler(parent, var) + esp32_ble.register_ble_status_event_handler(parent, var) cg.add(var.set_parent(parent)) cg.add(parent.advertising_set_appearance(config[CONF_APPEARANCE])) if CONF_MANUFACTURER_DATA in config: diff --git a/esphome/components/esp32_ble_server/ble_server.cpp b/esphome/components/esp32_ble_server/ble_server.cpp index 25cc97eeaf..0e58224a5a 100644 --- a/esphome/components/esp32_ble_server/ble_server.cpp +++ b/esphome/components/esp32_ble_server/ble_server.cpp @@ -10,7 +10,9 @@ #include #include #include +#ifndef CONFIG_ESP_HOSTED_ENABLE_BT_BLUEDROID #include +#endif #include #include diff --git a/esphome/components/esp32_ble_tracker/__init__.py b/esphome/components/esp32_ble_tracker/__init__.py index 247496ccd9..5910be67af 100644 --- a/esphome/components/esp32_ble_tracker/__init__.py +++ b/esphome/components/esp32_ble_tracker/__init__.py @@ -1,5 +1,6 @@ from __future__ import annotations +from dataclasses import dataclass import logging from esphome import automation @@ -52,9 +53,19 @@ class BLEFeatures(StrEnum): ESP_BT_DEVICE = "ESP_BT_DEVICE" +# Dataclass for registration counts +@dataclass +class RegistrationCounts: + listeners: int = 0 + clients: int = 0 + + # Set to track which features are needed by components _required_features: set[BLEFeatures] = set() +# Track registration counts for StaticVector sizing +_registration_counts = RegistrationCounts() + def register_ble_features(features: set[BLEFeatures]) -> None: """Register BLE features that a component needs. @@ -235,10 +246,10 @@ async def to_code(config): await cg.register_component(var, config) parent = await cg.get_variable(config[esp32_ble.CONF_BLE_ID]) - cg.add(parent.register_gap_event_handler(var)) - cg.add(parent.register_gap_scan_event_handler(var)) - cg.add(parent.register_gattc_event_handler(var)) - cg.add(parent.register_ble_status_event_handler(var)) + esp32_ble.register_gap_event_handler(parent, var) + esp32_ble.register_gap_scan_event_handler(parent, var) + esp32_ble.register_gattc_event_handler(parent, var) + esp32_ble.register_ble_status_event_handler(parent, var) cg.add(var.set_parent(parent)) params = config[CONF_SCAN_PARAMETERS] @@ -257,12 +268,14 @@ async def to_code(config): register_ble_features({BLEFeatures.ESP_BT_DEVICE}) for conf in config.get(CONF_ON_BLE_ADVERTISE, []): + _registration_counts.listeners += 1 trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var) if CONF_MAC_ADDRESS in conf: addr_list = [it.as_hex for it in conf[CONF_MAC_ADDRESS]] cg.add(trigger.set_addresses(addr_list)) await automation.build_automation(trigger, [(ESPBTDeviceConstRef, "x")], conf) for conf in config.get(CONF_ON_BLE_SERVICE_DATA_ADVERTISE, []): + _registration_counts.listeners += 1 trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var) if len(conf[CONF_SERVICE_UUID]) == len(bt_uuid16_format): cg.add(trigger.set_service_uuid16(as_hex(conf[CONF_SERVICE_UUID]))) @@ -275,6 +288,7 @@ async def to_code(config): cg.add(trigger.set_address(conf[CONF_MAC_ADDRESS].as_hex)) await automation.build_automation(trigger, [(adv_data_t_const_ref, "x")], conf) for conf in config.get(CONF_ON_BLE_MANUFACTURER_DATA_ADVERTISE, []): + _registration_counts.listeners += 1 trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var) if len(conf[CONF_MANUFACTURER_ID]) == len(bt_uuid16_format): cg.add(trigger.set_manufacturer_uuid16(as_hex(conf[CONF_MANUFACTURER_ID]))) @@ -287,6 +301,7 @@ async def to_code(config): cg.add(trigger.set_address(conf[CONF_MAC_ADDRESS].as_hex)) await automation.build_automation(trigger, [(adv_data_t_const_ref, "x")], conf) for conf in config.get(CONF_ON_SCAN_END, []): + _registration_counts.listeners += 1 trigger = cg.new_Pvariable(conf[CONF_TRIGGER_ID], var) await automation.build_automation(trigger, [], conf) @@ -320,6 +335,17 @@ async def _add_ble_features(): cg.add_define("USE_ESP32_BLE_DEVICE") cg.add_define("USE_ESP32_BLE_UUID") + # Add defines for StaticVector sizing based on registration counts + # Only define if count > 0 to avoid allocating unnecessary memory + if _registration_counts.listeners > 0: + cg.add_define( + "ESPHOME_ESP32_BLE_TRACKER_LISTENER_COUNT", _registration_counts.listeners + ) + if _registration_counts.clients > 0: + cg.add_define( + "ESPHOME_ESP32_BLE_TRACKER_CLIENT_COUNT", _registration_counts.clients + ) + ESP32_BLE_START_SCAN_ACTION_SCHEMA = cv.Schema( { @@ -369,6 +395,7 @@ async def register_ble_device( var: cg.SafeExpType, config: ConfigType ) -> cg.SafeExpType: register_ble_features({BLEFeatures.ESP_BT_DEVICE}) + _registration_counts.listeners += 1 paren = await cg.get_variable(config[CONF_ESP32_BLE_ID]) cg.add(paren.register_listener(var)) return var @@ -376,6 +403,7 @@ async def register_ble_device( async def register_client(var: cg.SafeExpType, config: ConfigType) -> cg.SafeExpType: register_ble_features({BLEFeatures.ESP_BT_DEVICE}) + _registration_counts.clients += 1 paren = await cg.get_variable(config[CONF_ESP32_BLE_ID]) cg.add(paren.register_client(var)) return var @@ -389,6 +417,7 @@ async def register_raw_ble_device( This does NOT register the ESP_BT_DEVICE feature, meaning ESPBTDevice will not be compiled in if this is the only registration method used. """ + _registration_counts.listeners += 1 paren = await cg.get_variable(config[CONF_ESP32_BLE_ID]) cg.add(paren.register_listener(var)) return var @@ -402,6 +431,7 @@ async def register_raw_client( This does NOT register the ESP_BT_DEVICE feature, meaning ESPBTDevice will not be compiled in if this is the only registration method used. """ + _registration_counts.clients += 1 paren = await cg.get_variable(config[CONF_ESP32_BLE_ID]) cg.add(paren.register_client(var)) return var diff --git a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp index 83f59d492e..8577f12a92 100644 --- a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp +++ b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.cpp @@ -7,7 +7,9 @@ #include "esphome/core/helpers.h" #include "esphome/core/log.h" +#ifndef CONFIG_ESP_HOSTED_ENABLE_BT_BLUEDROID #include +#endif #include #include #include @@ -74,9 +76,11 @@ void ESP32BLETracker::setup() { [this](ota::OTAState state, float progress, uint8_t error, ota::OTAComponent *comp) { if (state == ota::OTA_STARTED) { this->stop_scan(); +#ifdef ESPHOME_ESP32_BLE_TRACKER_CLIENT_COUNT for (auto *client : this->clients_) { client->disconnect(); } +#endif } }); #endif @@ -206,8 +210,10 @@ void ESP32BLETracker::start_scan_(bool first) { this->set_scanner_state_(ScannerState::STARTING); ESP_LOGD(TAG, "Starting scan, set scanner state to STARTING."); if (!first) { +#ifdef ESPHOME_ESP32_BLE_TRACKER_LISTENER_COUNT for (auto *listener : this->listeners_) listener->on_scan_end(); +#endif } #ifdef USE_ESP32_BLE_DEVICE this->already_discovered_.clear(); @@ -236,20 +242,25 @@ void ESP32BLETracker::start_scan_(bool first) { } void ESP32BLETracker::register_client(ESPBTClient *client) { +#ifdef ESPHOME_ESP32_BLE_TRACKER_CLIENT_COUNT client->app_id = ++this->app_id_; this->clients_.push_back(client); this->recalculate_advertisement_parser_types(); +#endif } void ESP32BLETracker::register_listener(ESPBTDeviceListener *listener) { +#ifdef ESPHOME_ESP32_BLE_TRACKER_LISTENER_COUNT listener->set_parent(this); this->listeners_.push_back(listener); this->recalculate_advertisement_parser_types(); +#endif } void ESP32BLETracker::recalculate_advertisement_parser_types() { this->raw_advertisements_ = false; this->parse_advertisements_ = false; +#ifdef ESPHOME_ESP32_BLE_TRACKER_LISTENER_COUNT for (auto *listener : this->listeners_) { if (listener->get_advertisement_parser_type() == AdvertisementParserType::PARSED_ADVERTISEMENTS) { this->parse_advertisements_ = true; @@ -257,6 +268,8 @@ void ESP32BLETracker::recalculate_advertisement_parser_types() { this->raw_advertisements_ = true; } } +#endif +#ifdef ESPHOME_ESP32_BLE_TRACKER_CLIENT_COUNT for (auto *client : this->clients_) { if (client->get_advertisement_parser_type() == AdvertisementParserType::PARSED_ADVERTISEMENTS) { this->parse_advertisements_ = true; @@ -264,6 +277,7 @@ void ESP32BLETracker::recalculate_advertisement_parser_types() { this->raw_advertisements_ = true; } } +#endif } void ESP32BLETracker::gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_gap_cb_param_t *param) { @@ -282,10 +296,12 @@ void ESP32BLETracker::gap_event_handler(esp_gap_ble_cb_event_t event, esp_ble_ga default: break; } - // Forward all events to clients (scan results are handled separately via gap_scan_event_handler) + // Forward all events to clients (scan results are handled separately via gap_scan_event_handler) +#ifdef ESPHOME_ESP32_BLE_TRACKER_CLIENT_COUNT for (auto *client : this->clients_) { client->gap_event_handler(event, param); } +#endif } void ESP32BLETracker::gap_scan_event_handler(const BLEScanResult &scan_result) { @@ -348,9 +364,11 @@ void ESP32BLETracker::gap_scan_stop_complete_(const esp_ble_gap_cb_param_t::ble_ void ESP32BLETracker::gattc_event_handler(esp_gattc_cb_event_t event, esp_gatt_if_t gattc_if, esp_ble_gattc_cb_param_t *param) { +#ifdef ESPHOME_ESP32_BLE_TRACKER_CLIENT_COUNT for (auto *client : this->clients_) { client->gattc_event_handler(event, gattc_if, param); } +#endif } void ESP32BLETracker::set_scanner_state_(ScannerState state) { @@ -704,12 +722,16 @@ bool ESPBTDevice::resolve_irk(const uint8_t *irk) const { void ESP32BLETracker::process_scan_result_(const BLEScanResult &scan_result) { // Process raw advertisements if (this->raw_advertisements_) { +#ifdef ESPHOME_ESP32_BLE_TRACKER_LISTENER_COUNT for (auto *listener : this->listeners_) { listener->parse_devices(&scan_result, 1); } +#endif +#ifdef ESPHOME_ESP32_BLE_TRACKER_CLIENT_COUNT for (auto *client : this->clients_) { client->parse_devices(&scan_result, 1); } +#endif } // Process parsed advertisements @@ -719,16 +741,20 @@ void ESP32BLETracker::process_scan_result_(const BLEScanResult &scan_result) { device.parse_scan_rst(scan_result); bool found = false; +#ifdef ESPHOME_ESP32_BLE_TRACKER_LISTENER_COUNT for (auto *listener : this->listeners_) { if (listener->parse_device(device)) found = true; } +#endif +#ifdef ESPHOME_ESP32_BLE_TRACKER_CLIENT_COUNT for (auto *client : this->clients_) { if (client->parse_device(device)) { found = true; } } +#endif if (!found && !this->scan_continuous_) { this->print_bt_device_info(device); @@ -745,8 +771,10 @@ void ESP32BLETracker::cleanup_scan_state_(bool is_stop_complete) { // Reset timeout state machine instead of cancelling scheduler timeout this->scan_timeout_state_ = ScanTimeoutState::INACTIVE; +#ifdef ESPHOME_ESP32_BLE_TRACKER_LISTENER_COUNT for (auto *listener : this->listeners_) listener->on_scan_end(); +#endif this->set_scanner_state_(ScannerState::IDLE); } @@ -770,6 +798,7 @@ void ESP32BLETracker::handle_scanner_failure_() { void ESP32BLETracker::try_promote_discovered_clients_() { // Only promote the first discovered client to avoid multiple simultaneous connections +#ifdef ESPHOME_ESP32_BLE_TRACKER_CLIENT_COUNT for (auto *client : this->clients_) { if (client->state() != ClientState::DISCOVERED) { continue; @@ -791,6 +820,7 @@ void ESP32BLETracker::try_promote_discovered_clients_() { client->connect(); break; } +#endif } const char *ESP32BLETracker::scanner_state_to_string_(ScannerState state) const { @@ -817,6 +847,7 @@ void ESP32BLETracker::log_unexpected_state_(const char *operation, ScannerState #ifdef USE_ESP32_BLE_SOFTWARE_COEXISTENCE void ESP32BLETracker::update_coex_preference_(bool force_ble) { +#ifndef CONFIG_ESP_HOSTED_ENABLE_BT_BLUEDROID if (force_ble && !this->coex_prefer_ble_) { ESP_LOGD(TAG, "Setting coexistence to Bluetooth to make connection."); this->coex_prefer_ble_ = true; @@ -826,6 +857,7 @@ void ESP32BLETracker::update_coex_preference_(bool force_ble) { this->coex_prefer_ble_ = false; esp_coex_preference_set(ESP_COEX_PREFER_BALANCE); // Reset to default } +#endif // CONFIG_ESP_HOSTED_ENABLE_BT_BLUEDROID } #endif diff --git a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.h b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.h index e53c2ac097..f80f3e2670 100644 --- a/esphome/components/esp32_ble_tracker/esp32_ble_tracker.h +++ b/esphome/components/esp32_ble_tracker/esp32_ble_tracker.h @@ -302,6 +302,7 @@ class ESP32BLETracker : public Component, /// Count clients in each state ClientStateCounts count_client_states_() const { ClientStateCounts counts; +#ifdef ESPHOME_ESP32_BLE_TRACKER_CLIENT_COUNT for (auto *client : this->clients_) { switch (client->state()) { case ClientState::DISCONNECTING: @@ -317,12 +318,17 @@ class ESP32BLETracker : public Component, break; } } +#endif return counts; } // Group 1: Large objects (12+ bytes) - vectors and callback manager - std::vector listeners_; - std::vector clients_; +#ifdef ESPHOME_ESP32_BLE_TRACKER_LISTENER_COUNT + StaticVector listeners_; +#endif +#ifdef ESPHOME_ESP32_BLE_TRACKER_CLIENT_COUNT + StaticVector clients_; +#endif CallbackManager scanner_state_callbacks_; #ifdef USE_ESP32_BLE_DEVICE /// Vector of addresses that have already been printed in print_bt_device_info diff --git a/esphome/components/esp32_hosted/__init__.py b/esphome/components/esp32_hosted/__init__.py index 9cea02c322..7e9f1b05b5 100644 --- a/esphome/components/esp32_hosted/__init__.py +++ b/esphome/components/esp32_hosted/__init__.py @@ -92,9 +92,14 @@ async def to_code(config): framework_ver: cv.Version = CORE.data[KEY_CORE][KEY_FRAMEWORK_VERSION] os.environ["ESP_IDF_VERSION"] = f"{framework_ver.major}.{framework_ver.minor}" - esp32.add_idf_component(name="espressif/esp_wifi_remote", ref="0.10.2") - esp32.add_idf_component(name="espressif/eppp_link", ref="0.2.0") - esp32.add_idf_component(name="espressif/esp_hosted", ref="2.0.11") + if framework_ver >= cv.Version(5, 5, 0): + esp32.add_idf_component(name="espressif/esp_wifi_remote", ref="1.1.5") + esp32.add_idf_component(name="espressif/eppp_link", ref="1.1.3") + esp32.add_idf_component(name="espressif/esp_hosted", ref="2.5.11") + else: + esp32.add_idf_component(name="espressif/esp_wifi_remote", ref="0.13.0") + esp32.add_idf_component(name="espressif/eppp_link", ref="0.2.0") + esp32.add_idf_component(name="espressif/esp_hosted", ref="2.0.11") esp32.add_extra_script( "post", "esp32_hosted.py", diff --git a/esphome/components/esp32_improv/esp32_improv_component.cpp b/esphome/components/esp32_improv/esp32_improv_component.cpp index f773083890..d83caf931b 100644 --- a/esphome/components/esp32_improv/esp32_improv_component.cpp +++ b/esphome/components/esp32_improv/esp32_improv_component.cpp @@ -143,6 +143,7 @@ void ESP32ImprovComponent::loop() { #else this->set_state_(improv::STATE_AUTHORIZED); #endif + this->check_wifi_connection_(); break; } case improv::STATE_AUTHORIZED: { @@ -156,31 +157,12 @@ void ESP32ImprovComponent::loop() { if (!this->check_identify_()) { this->set_status_indicator_state_((now % 1000) < 500); } + this->check_wifi_connection_(); break; } case improv::STATE_PROVISIONING: { this->set_status_indicator_state_((now % 200) < 100); - if (wifi::global_wifi_component->is_connected()) { - wifi::global_wifi_component->save_wifi_sta(this->connecting_sta_.get_ssid(), - this->connecting_sta_.get_password()); - this->connecting_sta_ = {}; - this->cancel_timeout("wifi-connect-timeout"); - this->set_state_(improv::STATE_PROVISIONED); - - std::vector urls = {ESPHOME_MY_LINK}; -#ifdef USE_WEBSERVER - for (auto &ip : wifi::global_wifi_component->wifi_sta_ip_addresses()) { - if (ip.is_ip4()) { - std::string webserver_url = "http://" + ip.str() + ":" + to_string(USE_WEBSERVER_PORT); - urls.push_back(webserver_url); - break; - } - } -#endif - std::vector data = improv::build_rpc_response(improv::WIFI_SETTINGS, urls); - this->send_response_(data); - this->stop(); - } + this->check_wifi_connection_(); break; } case improv::STATE_PROVISIONED: { @@ -392,6 +374,36 @@ void ESP32ImprovComponent::on_wifi_connect_timeout_() { wifi::global_wifi_component->clear_sta(); } +void ESP32ImprovComponent::check_wifi_connection_() { + if (!wifi::global_wifi_component->is_connected()) { + return; + } + + if (this->state_ == improv::STATE_PROVISIONING) { + wifi::global_wifi_component->save_wifi_sta(this->connecting_sta_.get_ssid(), this->connecting_sta_.get_password()); + this->connecting_sta_ = {}; + this->cancel_timeout("wifi-connect-timeout"); + + std::vector urls = {ESPHOME_MY_LINK}; +#ifdef USE_WEBSERVER + for (auto &ip : wifi::global_wifi_component->wifi_sta_ip_addresses()) { + if (ip.is_ip4()) { + std::string webserver_url = "http://" + ip.str() + ":" + to_string(USE_WEBSERVER_PORT); + urls.push_back(webserver_url); + break; + } + } +#endif + std::vector data = improv::build_rpc_response(improv::WIFI_SETTINGS, urls); + this->send_response_(data); + } else if (this->is_active() && this->state_ != improv::STATE_PROVISIONED) { + ESP_LOGD(TAG, "WiFi provisioned externally"); + } + + this->set_state_(improv::STATE_PROVISIONED); + this->stop(); +} + void ESP32ImprovComponent::advertise_service_data_() { uint8_t service_data[IMPROV_SERVICE_DATA_SIZE] = {}; service_data[0] = IMPROV_PROTOCOL_ID_1; // PR diff --git a/esphome/components/esp32_improv/esp32_improv_component.h b/esphome/components/esp32_improv/esp32_improv_component.h index eb07e09dce..6782430ffe 100644 --- a/esphome/components/esp32_improv/esp32_improv_component.h +++ b/esphome/components/esp32_improv/esp32_improv_component.h @@ -111,6 +111,7 @@ class ESP32ImprovComponent : public Component { void send_response_(std::vector &response); void process_incoming_data_(); void on_wifi_connect_timeout_(); + void check_wifi_connection_(); bool check_identify_(); void advertise_service_data_(); #if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_DEBUG diff --git a/esphome/components/esp32_rmt_led_strip/led_strip.cpp b/esphome/components/esp32_rmt_led_strip/led_strip.cpp index fa43aa5950..2c7963b366 100644 --- a/esphome/components/esp32_rmt_led_strip/led_strip.cpp +++ b/esphome/components/esp32_rmt_led_strip/led_strip.cpp @@ -42,6 +42,11 @@ static size_t IRAM_ATTR HOT encoder_callback(const void *data, size_t size, size symbols[i] = params->bit0; } } +#if ESP_IDF_VERSION >= ESP_IDF_VERSION_VAL(5, 5, 1) + if ((index + 1) >= size && params->reset.duration0 == 0 && params->reset.duration1 == 0) { + *done = true; + } +#endif return RMT_SYMBOLS_PER_BYTE; } diff --git a/esphome/components/esphome/ota/ota_esphome.cpp b/esphome/components/esphome/ota/ota_esphome.cpp index b65bfc5ab8..569268ea15 100644 --- a/esphome/components/esphome/ota/ota_esphome.cpp +++ b/esphome/components/esphome/ota/ota_esphome.cpp @@ -29,7 +29,7 @@ namespace esphome { static const char *const TAG = "esphome.ota"; static constexpr uint16_t OTA_BLOCK_SIZE = 8192; static constexpr size_t OTA_BUFFER_SIZE = 1024; // buffer size for OTA data transfer -static constexpr uint32_t OTA_SOCKET_TIMEOUT_HANDSHAKE = 10000; // milliseconds for initial handshake +static constexpr uint32_t OTA_SOCKET_TIMEOUT_HANDSHAKE = 20000; // milliseconds for initial handshake static constexpr uint32_t OTA_SOCKET_TIMEOUT_DATA = 90000; // milliseconds for data transfer #ifdef USE_OTA_PASSWORD diff --git a/esphome/components/ethernet/ethernet_component.cpp b/esphome/components/ethernet/ethernet_component.cpp index 28043dd969..24b6e8154b 100644 --- a/esphome/components/ethernet/ethernet_component.cpp +++ b/esphome/components/ethernet/ethernet_component.cpp @@ -689,12 +689,9 @@ void EthernetComponent::add_phy_register(PHYRegister register_value) { this->phy void EthernetComponent::set_type(EthernetType type) { this->type_ = type; } void EthernetComponent::set_manual_ip(const ManualIP &manual_ip) { this->manual_ip_ = manual_ip; } -std::string EthernetComponent::get_use_address() const { - if (this->use_address_.empty()) { - return App.get_name() + ".local"; - } - return this->use_address_; -} +// set_use_address() is guaranteed to be called during component setup by Python code generation, +// so use_address_ will always be valid when get_use_address() is called - no fallback needed. +const std::string &EthernetComponent::get_use_address() const { return this->use_address_; } void EthernetComponent::set_use_address(const std::string &use_address) { this->use_address_ = use_address; } diff --git a/esphome/components/ethernet/ethernet_component.h b/esphome/components/ethernet/ethernet_component.h index 6b4e342df5..d5dda3e3ae 100644 --- a/esphome/components/ethernet/ethernet_component.h +++ b/esphome/components/ethernet/ethernet_component.h @@ -88,7 +88,7 @@ class EthernetComponent : public Component { network::IPAddresses get_ip_addresses(); network::IPAddress get_dns_address(uint8_t num); - std::string get_use_address() const; + const std::string &get_use_address() const; void set_use_address(const std::string &use_address); void get_eth_mac_address_raw(uint8_t *mac); std::string get_eth_mac_address_pretty(); diff --git a/esphome/components/homeassistant/number/homeassistant_number.cpp b/esphome/components/homeassistant/number/homeassistant_number.cpp index c9fb006568..9963f3431d 100644 --- a/esphome/components/homeassistant/number/homeassistant_number.cpp +++ b/esphome/components/homeassistant/number/homeassistant_number.cpp @@ -90,13 +90,12 @@ void HomeassistantNumber::control(float value) { api::HomeassistantActionRequest resp; resp.set_service(SERVICE_NAME); - resp.data.emplace_back(); - auto &entity_id = resp.data.back(); + resp.data.init(2); + auto &entity_id = resp.data.emplace_back(); entity_id.set_key(ENTITY_ID_KEY); entity_id.value = this->entity_id_; - resp.data.emplace_back(); - auto &entity_value = resp.data.back(); + auto &entity_value = resp.data.emplace_back(); entity_value.set_key(VALUE_KEY); entity_value.value = to_string(value); diff --git a/esphome/components/homeassistant/switch/homeassistant_switch.cpp b/esphome/components/homeassistant/switch/homeassistant_switch.cpp index 8feec26fe6..27d3705fc2 100644 --- a/esphome/components/homeassistant/switch/homeassistant_switch.cpp +++ b/esphome/components/homeassistant/switch/homeassistant_switch.cpp @@ -51,8 +51,8 @@ void HomeassistantSwitch::write_state(bool state) { resp.set_service(SERVICE_OFF); } - resp.data.emplace_back(); - auto &entity_id_kv = resp.data.back(); + resp.data.init(1); + auto &entity_id_kv = resp.data.emplace_back(); entity_id_kv.set_key(ENTITY_ID_KEY); entity_id_kv.value = this->entity_id_; diff --git a/esphome/components/http_request/http_request.h b/esphome/components/http_request/http_request.h index 95515f731a..bb14cc6f51 100644 --- a/esphome/components/http_request/http_request.h +++ b/esphome/components/http_request/http_request.h @@ -167,8 +167,8 @@ class HttpRequestComponent : public Component { } protected: - virtual std::shared_ptr perform(std::string url, std::string method, std::string body, - std::list
request_headers, + virtual std::shared_ptr perform(const std::string &url, const std::string &method, + const std::string &body, const std::list
&request_headers, std::set collect_headers) = 0; const char *useragent_{nullptr}; bool follow_redirects_{}; diff --git a/esphome/components/http_request/http_request_arduino.cpp b/esphome/components/http_request/http_request_arduino.cpp index c009b33c2d..dfdbbd3fab 100644 --- a/esphome/components/http_request/http_request_arduino.cpp +++ b/esphome/components/http_request/http_request_arduino.cpp @@ -14,8 +14,9 @@ namespace http_request { static const char *const TAG = "http_request.arduino"; -std::shared_ptr HttpRequestArduino::perform(std::string url, std::string method, std::string body, - std::list
request_headers, +std::shared_ptr HttpRequestArduino::perform(const std::string &url, const std::string &method, + const std::string &body, + const std::list
&request_headers, std::set collect_headers) { if (!network::is_connected()) { this->status_momentary_error("failed", 1000); diff --git a/esphome/components/http_request/http_request_arduino.h b/esphome/components/http_request/http_request_arduino.h index 44744f8c78..c8208c74d8 100644 --- a/esphome/components/http_request/http_request_arduino.h +++ b/esphome/components/http_request/http_request_arduino.h @@ -31,8 +31,8 @@ class HttpContainerArduino : public HttpContainer { class HttpRequestArduino : public HttpRequestComponent { protected: - std::shared_ptr perform(std::string url, std::string method, std::string body, - std::list
request_headers, + std::shared_ptr perform(const std::string &url, const std::string &method, const std::string &body, + const std::list
&request_headers, std::set collect_headers) override; }; diff --git a/esphome/components/http_request/http_request_host.cpp b/esphome/components/http_request/http_request_host.cpp index 0b4c998a40..c20ea552b7 100644 --- a/esphome/components/http_request/http_request_host.cpp +++ b/esphome/components/http_request/http_request_host.cpp @@ -17,8 +17,9 @@ namespace http_request { static const char *const TAG = "http_request.host"; -std::shared_ptr HttpRequestHost::perform(std::string url, std::string method, std::string body, - std::list
request_headers, +std::shared_ptr HttpRequestHost::perform(const std::string &url, const std::string &method, + const std::string &body, + const std::list
&request_headers, std::set response_headers) { if (!network::is_connected()) { this->status_momentary_error("failed", 1000); diff --git a/esphome/components/http_request/http_request_host.h b/esphome/components/http_request/http_request_host.h index bbeed87f70..fdd72e7ea5 100644 --- a/esphome/components/http_request/http_request_host.h +++ b/esphome/components/http_request/http_request_host.h @@ -18,8 +18,8 @@ class HttpContainerHost : public HttpContainer { class HttpRequestHost : public HttpRequestComponent { public: - std::shared_ptr perform(std::string url, std::string method, std::string body, - std::list
request_headers, + std::shared_ptr perform(const std::string &url, const std::string &method, const std::string &body, + const std::list
&request_headers, std::set response_headers) override; void set_ca_path(const char *ca_path) { this->ca_path_ = ca_path; } diff --git a/esphome/components/http_request/http_request_idf.cpp b/esphome/components/http_request/http_request_idf.cpp index 89a0891b03..a91c0bfc25 100644 --- a/esphome/components/http_request/http_request_idf.cpp +++ b/esphome/components/http_request/http_request_idf.cpp @@ -52,8 +52,9 @@ esp_err_t HttpRequestIDF::http_event_handler(esp_http_client_event_t *evt) { return ESP_OK; } -std::shared_ptr HttpRequestIDF::perform(std::string url, std::string method, std::string body, - std::list
request_headers, +std::shared_ptr HttpRequestIDF::perform(const std::string &url, const std::string &method, + const std::string &body, + const std::list
&request_headers, std::set collect_headers) { if (!network::is_connected()) { this->status_momentary_error("failed", 1000); diff --git a/esphome/components/http_request/http_request_idf.h b/esphome/components/http_request/http_request_idf.h index 5c5b784853..90dee0be68 100644 --- a/esphome/components/http_request/http_request_idf.h +++ b/esphome/components/http_request/http_request_idf.h @@ -37,8 +37,8 @@ class HttpRequestIDF : public HttpRequestComponent { void set_buffer_size_tx(uint16_t buffer_size_tx) { this->buffer_size_tx_ = buffer_size_tx; } protected: - std::shared_ptr perform(std::string url, std::string method, std::string body, - std::list
request_headers, + std::shared_ptr perform(const std::string &url, const std::string &method, const std::string &body, + const std::list
&request_headers, std::set collect_headers) override; // if zero ESP-IDF will use DEFAULT_HTTP_BUF_SIZE uint16_t buffer_size_rx_{}; diff --git a/esphome/components/improv_serial/improv_serial_component.cpp b/esphome/components/improv_serial/improv_serial_component.cpp index 528a155a7f..28245dcfdf 100644 --- a/esphome/components/improv_serial/improv_serial_component.cpp +++ b/esphome/components/improv_serial/improv_serial_component.cpp @@ -218,7 +218,7 @@ bool ImprovSerialComponent::parse_improv_payload_(improv::ImprovCommand &command } case improv::GET_WIFI_NETWORKS: { std::vector networks; - auto results = wifi::global_wifi_component->get_scan_result(); + const auto &results = wifi::global_wifi_component->get_scan_result(); for (auto &scan : results) { if (scan.get_is_hidden()) continue; diff --git a/esphome/components/json/json_util.cpp b/esphome/components/json/json_util.cpp index dbdf6e3486..869d29f92e 100644 --- a/esphome/components/json/json_util.cpp +++ b/esphome/components/json/json_util.cpp @@ -8,6 +8,13 @@ namespace json { static const char *const TAG = "json"; +#ifdef USE_PSRAM +// Global allocator that outlives all JsonDocuments returned by parse_json() +// This prevents dangling pointer issues when JsonDocuments are returned from functions +// NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables) - Must be mutable for ArduinoJson::Allocator +static SpiRamAllocator global_json_allocator; +#endif + std::string build_json(const json_build_t &f) { // NOLINTBEGIN(clang-analyzer-cplusplus.NewDeleteLeaks) false positive with ArduinoJson JsonBuilder builder; @@ -33,8 +40,7 @@ JsonDocument parse_json(const uint8_t *data, size_t len) { return JsonObject(); // return unbound object } #ifdef USE_PSRAM - auto doc_allocator = SpiRamAllocator(); - JsonDocument json_document(&doc_allocator); + JsonDocument json_document(&global_json_allocator); #else JsonDocument json_document; #endif diff --git a/esphome/components/light/light_state.cpp b/esphome/components/light/light_state.cpp index f18d5ba1de..1d139e49e7 100644 --- a/esphome/components/light/light_state.cpp +++ b/esphome/components/light/light_state.cpp @@ -177,9 +177,10 @@ void LightState::set_gamma_correct(float gamma_correct) { this->gamma_correct_ = void LightState::set_restore_mode(LightRestoreMode restore_mode) { this->restore_mode_ = restore_mode; } void LightState::set_initial_state(const LightStateRTCState &initial_state) { this->initial_state_ = initial_state; } bool LightState::supports_effects() { return !this->effects_.empty(); } -const std::vector &LightState::get_effects() const { return this->effects_; } +const FixedVector &LightState::get_effects() const { return this->effects_; } void LightState::add_effects(const std::vector &effects) { - this->effects_.reserve(this->effects_.size() + effects.size()); + // Called once from Python codegen during setup with all effects from YAML config + this->effects_.init(effects.size()); for (auto *effect : effects) { this->effects_.push_back(effect); } diff --git a/esphome/components/light/light_state.h b/esphome/components/light/light_state.h index 1427c02c35..a07aeb6ae5 100644 --- a/esphome/components/light/light_state.h +++ b/esphome/components/light/light_state.h @@ -11,8 +11,9 @@ #include "light_traits.h" #include "light_transformer.h" -#include +#include "esphome/core/helpers.h" #include +#include namespace esphome { namespace light { @@ -159,7 +160,7 @@ class LightState : public EntityBase, public Component { bool supports_effects(); /// Get all effects for this light state. - const std::vector &get_effects() const; + const FixedVector &get_effects() const; /// Add effects for this light state. void add_effects(const std::vector &effects); @@ -260,7 +261,7 @@ class LightState : public EntityBase, public Component { /// The currently active transformer for this light (transition/flash). std::unique_ptr transformer_{nullptr}; /// List of effects for this light. - std::vector effects_; + FixedVector effects_; /// Object used to store the persisted values of the light. ESPPreferenceObject rtc_; /// Value for storing the index of the currently active effect. 0 if no effect is active diff --git a/esphome/components/lvgl/defines.py b/esphome/components/lvgl/defines.py index baee403b57..6464824c64 100644 --- a/esphome/components/lvgl/defines.py +++ b/esphome/components/lvgl/defines.py @@ -486,7 +486,6 @@ CONF_RESUME_ON_INPUT = "resume_on_input" CONF_RIGHT_BUTTON = "right_button" CONF_ROLLOVER = "rollover" CONF_ROOT_BACK_BTN = "root_back_btn" -CONF_ROWS = "rows" CONF_SCALE_LINES = "scale_lines" CONF_SCROLLBAR_MODE = "scrollbar_mode" CONF_SELECTED_INDEX = "selected_index" diff --git a/esphome/components/lvgl/widgets/buttonmatrix.py b/esphome/components/lvgl/widgets/buttonmatrix.py index c6b6d2440f..baeb1c8e3e 100644 --- a/esphome/components/lvgl/widgets/buttonmatrix.py +++ b/esphome/components/lvgl/widgets/buttonmatrix.py @@ -2,7 +2,7 @@ from esphome import automation import esphome.codegen as cg from esphome.components.key_provider import KeyProvider import esphome.config_validation as cv -from esphome.const import CONF_ID, CONF_ITEMS, CONF_TEXT, CONF_WIDTH +from esphome.const import CONF_ID, CONF_ITEMS, CONF_ROWS, CONF_TEXT, CONF_WIDTH from esphome.cpp_generator import MockObj from ..automation import action_to_code @@ -15,7 +15,6 @@ from ..defines import ( CONF_ONE_CHECKED, CONF_PAD_COLUMN, CONF_PAD_ROW, - CONF_ROWS, CONF_SELECTED, ) from ..helpers import lvgl_components_required diff --git a/esphome/components/matrix_keypad/__init__.py b/esphome/components/matrix_keypad/__init__.py index f7a1d622a1..2e123323a0 100644 --- a/esphome/components/matrix_keypad/__init__.py +++ b/esphome/components/matrix_keypad/__init__.py @@ -2,7 +2,7 @@ from esphome import automation, pins import esphome.codegen as cg from esphome.components import key_provider import esphome.config_validation as cv -from esphome.const import CONF_ID, CONF_ON_KEY, CONF_PIN, CONF_TRIGGER_ID +from esphome.const import CONF_ID, CONF_ON_KEY, CONF_PIN, CONF_ROWS, CONF_TRIGGER_ID CODEOWNERS = ["@ssieb"] @@ -19,7 +19,6 @@ MatrixKeyTrigger = matrix_keypad_ns.class_( ) CONF_KEYPAD_ID = "keypad_id" -CONF_ROWS = "rows" CONF_COLUMNS = "columns" CONF_KEYS = "keys" CONF_DEBOUNCE_TIME = "debounce_time" diff --git a/esphome/components/mdns/__init__.py b/esphome/components/mdns/__init__.py index 25c004ac5d..c6a9ee1a0c 100644 --- a/esphome/components/mdns/__init__.py +++ b/esphome/components/mdns/__init__.py @@ -1,6 +1,6 @@ import esphome.codegen as cg from esphome.components.esp32 import add_idf_component -from esphome.config_helpers import filter_source_files_from_platform +from esphome.config_helpers import filter_source_files_from_platform, get_logger_level import esphome.config_validation as cv from esphome.const import ( CONF_DISABLED, @@ -101,7 +101,7 @@ async def _mdns_txt_record_templated( def mdns_service( - service: str, proto: str, port: int, txt_records: list[dict[str, str]] + service: str, proto: str, port: int, txt_records: list[cg.RawExpression] ) -> cg.StructInitializer: """Create a mDNS service. @@ -125,6 +125,17 @@ def mdns_service( ) +def enable_mdns_storage(): + """Enable persistent storage of mDNS services in the MDNSComponent. + + Called by external components (like OpenThread) that need access to + services after setup() completes via get_services(). + + Public API for external components. Do not remove. + """ + cg.add_define("USE_MDNS_STORE_SERVICES") + + @coroutine_with_priority(CoroPriority.NETWORK_SERVICES) async def to_code(config): if config[CONF_DISABLED] is True: @@ -150,6 +161,8 @@ async def to_code(config): if config[CONF_SERVICES]: cg.add_define("USE_MDNS_EXTRA_SERVICES") + # Extra services need to be stored persistently + enable_mdns_storage() # Ensure at least 1 service (fallback service) cg.add_define("MDNS_SERVICE_COUNT", max(1, service_count)) @@ -171,6 +184,10 @@ async def to_code(config): # Ensure at least 1 to avoid zero-size array cg.add_define("MDNS_DYNAMIC_TXT_COUNT", max(1, dynamic_txt_count)) + # Enable storage if verbose logging is enabled (for dump_config) + if get_logger_level() in ("VERBOSE", "VERY_VERBOSE"): + enable_mdns_storage() + var = cg.new_Pvariable(config[CONF_ID]) await cg.register_component(var, config) diff --git a/esphome/components/mdns/mdns_component.cpp b/esphome/components/mdns/mdns_component.cpp index 9cb664c3c3..d476136554 100644 --- a/esphome/components/mdns/mdns_component.cpp +++ b/esphome/components/mdns/mdns_component.cpp @@ -36,7 +36,7 @@ MDNS_STATIC_CONST_CHAR(SERVICE_TCP, "_tcp"); // Wrap build-time defines into flash storage MDNS_STATIC_CONST_CHAR(VALUE_VERSION, ESPHOME_VERSION); -void MDNSComponent::compile_records_() { +void MDNSComponent::compile_records_(StaticVector &services) { this->hostname_ = App.get_name(); // IMPORTANT: The #ifdef blocks below must match COMPONENTS_WITH_MDNS_SERVICES @@ -53,7 +53,7 @@ void MDNSComponent::compile_records_() { MDNS_STATIC_CONST_CHAR(VALUE_BOARD, ESPHOME_BOARD); if (api::global_api_server != nullptr) { - auto &service = this->services_.emplace_next(); + auto &service = services.emplace_next(); service.service_type = MDNS_STR(SERVICE_ESPHOMELIB); service.proto = MDNS_STR(SERVICE_TCP); service.port = api::global_api_server->get_port(); @@ -83,7 +83,7 @@ void MDNSComponent::compile_records_() { #endif auto &txt_records = service.txt_records; - txt_records.reserve(txt_count); + txt_records.init(txt_count); if (!friendly_name_empty) { txt_records.push_back({MDNS_STR(TXT_FRIENDLY_NAME), MDNS_STR(friendly_name.c_str())}); @@ -146,7 +146,7 @@ void MDNSComponent::compile_records_() { #ifdef USE_PROMETHEUS MDNS_STATIC_CONST_CHAR(SERVICE_PROMETHEUS, "_prometheus-http"); - auto &prom_service = this->services_.emplace_next(); + auto &prom_service = services.emplace_next(); prom_service.service_type = MDNS_STR(SERVICE_PROMETHEUS); prom_service.proto = MDNS_STR(SERVICE_TCP); prom_service.port = USE_WEBSERVER_PORT; @@ -155,7 +155,7 @@ void MDNSComponent::compile_records_() { #ifdef USE_WEBSERVER MDNS_STATIC_CONST_CHAR(SERVICE_HTTP, "_http"); - auto &web_service = this->services_.emplace_next(); + auto &web_service = services.emplace_next(); web_service.service_type = MDNS_STR(SERVICE_HTTP); web_service.proto = MDNS_STR(SERVICE_TCP); web_service.port = USE_WEBSERVER_PORT; @@ -167,11 +167,11 @@ void MDNSComponent::compile_records_() { // Publish "http" service if not using native API or any other services // This is just to have *some* mDNS service so that .local resolution works - auto &fallback_service = this->services_.emplace_next(); + auto &fallback_service = services.emplace_next(); fallback_service.service_type = MDNS_STR(SERVICE_HTTP); fallback_service.proto = MDNS_STR(SERVICE_TCP); fallback_service.port = USE_WEBSERVER_PORT; - fallback_service.txt_records.push_back({MDNS_STR(TXT_VERSION), MDNS_STR(VALUE_VERSION)}); + fallback_service.txt_records = {{MDNS_STR(TXT_VERSION), MDNS_STR(VALUE_VERSION)}}; #endif } @@ -180,7 +180,7 @@ void MDNSComponent::dump_config() { "mDNS:\n" " Hostname: %s", this->hostname_.c_str()); -#if ESPHOME_LOG_LEVEL >= ESPHOME_LOG_LEVEL_VERBOSE +#ifdef USE_MDNS_STORE_SERVICES ESP_LOGV(TAG, " Services:"); for (const auto &service : this->services_) { ESP_LOGV(TAG, " - %s, %s, %d", MDNS_STR_ARG(service.service_type), MDNS_STR_ARG(service.proto), diff --git a/esphome/components/mdns/mdns_component.h b/esphome/components/mdns/mdns_component.h index 141e42d976..35371fd739 100644 --- a/esphome/components/mdns/mdns_component.h +++ b/esphome/components/mdns/mdns_component.h @@ -38,7 +38,7 @@ struct MDNSService { // as defined in RFC6763 Section 7, like "_tcp" or "_udp" const MDNSString *proto; TemplatableValue port; - std::vector txt_records; + FixedVector txt_records; }; class MDNSComponent : public Component { @@ -55,7 +55,9 @@ class MDNSComponent : public Component { void add_extra_service(MDNSService service) { this->services_.emplace_next() = std::move(service); } #endif +#ifdef USE_MDNS_STORE_SERVICES const StaticVector &get_services() const { return this->services_; } +#endif void on_shutdown() override; @@ -71,9 +73,11 @@ class MDNSComponent : public Component { StaticVector dynamic_txt_values_; protected: +#ifdef USE_MDNS_STORE_SERVICES StaticVector services_{}; +#endif std::string hostname_; - void compile_records_(); + void compile_records_(StaticVector &services); }; } // namespace mdns diff --git a/esphome/components/mdns/mdns_esp32.cpp b/esphome/components/mdns/mdns_esp32.cpp index e77c0b9b05..f2cb2d3ef5 100644 --- a/esphome/components/mdns/mdns_esp32.cpp +++ b/esphome/components/mdns/mdns_esp32.cpp @@ -12,7 +12,13 @@ namespace mdns { static const char *const TAG = "mdns"; void MDNSComponent::setup() { - this->compile_records_(); +#ifdef USE_MDNS_STORE_SERVICES + this->compile_records_(this->services_); + const auto &services = this->services_; +#else + StaticVector services; + this->compile_records_(services); +#endif esp_err_t err = mdns_init(); if (err != ESP_OK) { @@ -24,7 +30,7 @@ void MDNSComponent::setup() { mdns_hostname_set(this->hostname_.c_str()); mdns_instance_name_set(this->hostname_.c_str()); - for (const auto &service : this->services_) { + for (const auto &service : services) { std::vector txt_records; for (const auto &record : service.txt_records) { mdns_txt_item_t it{}; diff --git a/esphome/components/mdns/mdns_esp8266.cpp b/esphome/components/mdns/mdns_esp8266.cpp index f3779042ed..25a3defa7b 100644 --- a/esphome/components/mdns/mdns_esp8266.cpp +++ b/esphome/components/mdns/mdns_esp8266.cpp @@ -12,11 +12,17 @@ namespace esphome { namespace mdns { void MDNSComponent::setup() { - this->compile_records_(); +#ifdef USE_MDNS_STORE_SERVICES + this->compile_records_(this->services_); + const auto &services = this->services_; +#else + StaticVector services; + this->compile_records_(services); +#endif MDNS.begin(this->hostname_.c_str()); - for (const auto &service : this->services_) { + for (const auto &service : services) { // Strip the leading underscore from the proto and service_type. While it is // part of the wire protocol to have an underscore, and for example ESP-IDF // expects the underscore to be there, the ESP8266 implementation always adds diff --git a/esphome/components/mdns/mdns_host.cpp b/esphome/components/mdns/mdns_host.cpp index 78767ed136..f645d8d068 100644 --- a/esphome/components/mdns/mdns_host.cpp +++ b/esphome/components/mdns/mdns_host.cpp @@ -9,7 +9,9 @@ namespace esphome { namespace mdns { -void MDNSComponent::setup() { this->compile_records_(); } +void MDNSComponent::setup() { + // Host platform doesn't have actual mDNS implementation +} void MDNSComponent::on_shutdown() {} diff --git a/esphome/components/mdns/mdns_libretiny.cpp b/esphome/components/mdns/mdns_libretiny.cpp index 5540bf361a..a3e317a2bf 100644 --- a/esphome/components/mdns/mdns_libretiny.cpp +++ b/esphome/components/mdns/mdns_libretiny.cpp @@ -12,11 +12,17 @@ namespace esphome { namespace mdns { void MDNSComponent::setup() { - this->compile_records_(); +#ifdef USE_MDNS_STORE_SERVICES + this->compile_records_(this->services_); + const auto &services = this->services_; +#else + StaticVector services; + this->compile_records_(services); +#endif MDNS.begin(this->hostname_.c_str()); - for (const auto &service : this->services_) { + for (const auto &service : services) { // Strip the leading underscore from the proto and service_type. While it is // part of the wire protocol to have an underscore, and for example ESP-IDF // expects the underscore to be there, the ESP8266 implementation always adds diff --git a/esphome/components/mdns/mdns_rp2040.cpp b/esphome/components/mdns/mdns_rp2040.cpp index 5ad006f5d4..791fa3934d 100644 --- a/esphome/components/mdns/mdns_rp2040.cpp +++ b/esphome/components/mdns/mdns_rp2040.cpp @@ -12,11 +12,17 @@ namespace esphome { namespace mdns { void MDNSComponent::setup() { - this->compile_records_(); +#ifdef USE_MDNS_STORE_SERVICES + this->compile_records_(this->services_); + const auto &services = this->services_; +#else + StaticVector services; + this->compile_records_(services); +#endif MDNS.begin(this->hostname_.c_str()); - for (const auto &service : this->services_) { + for (const auto &service : services) { // Strip the leading underscore from the proto and service_type. While it is // part of the wire protocol to have an underscore, and for example ESP-IDF // expects the underscore to be there, the ESP8266 implementation always adds diff --git a/esphome/components/mipi_dsi/models/waveshare.py b/esphome/components/mipi_dsi/models/waveshare.py index 7cfd6f1645..c3d080f8b2 100644 --- a/esphome/components/mipi_dsi/models/waveshare.py +++ b/esphome/components/mipi_dsi/models/waveshare.py @@ -56,50 +56,41 @@ DriverChip( "WAVESHARE-P4-86-PANEL", height=720, width=720, - hsync_back_porch=80, + hsync_back_porch=50, hsync_pulse_width=20, - hsync_front_porch=80, - vsync_back_porch=12, + hsync_front_porch=50, + vsync_back_porch=20, vsync_pulse_width=4, - vsync_front_porch=30, - pclk_frequency="46MHz", - lane_bit_rate="1Gbps", + vsync_front_porch=20, + pclk_frequency="38MHz", + lane_bit_rate="480Mbps", swap_xy=cv.UNDEFINED, color_order="RGB", reset_pin=27, initsequence=[ (0xB9, 0xF1, 0x12, 0x83), - ( - 0xBA, 0x31, 0x81, 0x05, 0xF9, 0x0E, 0x0E, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x25, 0x00, - 0x90, 0x0A, 0x00, 0x00, 0x01, 0x4F, 0x01, 0x00, 0x00, 0x37, - ), - (0xB8, 0x25, 0x22, 0xF0, 0x63), - (0xBF, 0x02, 0x11, 0x00), + (0xB1, 0x00, 0x00, 0x00, 0xDA, 0x80), + (0xB2, 0x3C, 0x12, 0x30), (0xB3, 0x10, 0x10, 0x28, 0x28, 0x03, 0xFF, 0x00, 0x00, 0x00, 0x00), - (0xC0, 0x73, 0x73, 0x50, 0x50, 0x00, 0x00, 0x12, 0x70, 0x00), - (0xBC, 0x46), (0xCC, 0x0B), (0xB4, 0x80), (0xB2, 0x3C, 0x12, 0x30), - (0xE3, 0x07, 0x07, 0x0B, 0x0B, 0x03, 0x0B, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xC0, 0x10,), - (0xC1, 0x36, 0x00, 0x32, 0x32, 0x77, 0xF1, 0xCC, 0xCC, 0x77, 0x77, 0x33, 0x33), + (0xB4, 0x80), (0xB5, 0x0A, 0x0A), - (0xB6, 0xB2, 0xB2), - ( - 0xE9, 0xC8, 0x10, 0x0A, 0x10, 0x0F, 0xA1, 0x80, 0x12, 0x31, 0x23, 0x47, 0x86, 0xA1, 0x80, - 0x47, 0x08, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0D, 0x00, 0x00, 0x00, 0x48, - 0x02, 0x8B, 0xAF, 0x46, 0x02, 0x88, 0x88, 0x88, 0x88, 0x88, 0x48, 0x13, 0x8B, 0xAF, 0x57, - 0x13, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, - ), - ( - 0xEA, 0x96, 0x12, 0x01, 0x01, 0x01, 0x78, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x4F, 0x31, - 0x8B, 0xA8, 0x31, 0x75, 0x88, 0x88, 0x88, 0x88, 0x88, 0x4F, 0x20, 0x8B, 0xA8, 0x20, 0x64, - 0x88, 0x88, 0x88, 0x88, 0x88, 0x23, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0xA1, 0x80, 0x00, 0x00, - 0x00, 0x00, - ), - ( - 0xE0, 0x00, 0x0A, 0x0F, 0x29, 0x3B, 0x3F, 0x42, 0x39, 0x06, 0x0D, 0x10, 0x13, 0x15, 0x14, - 0x15, 0x10, 0x17, 0x00, 0x0A, 0x0F, 0x29, 0x3B, 0x3F, 0x42, 0x39, 0x06, 0x0D, 0x10, 0x13, - 0x15, 0x14, 0x15, 0x10, 0x17, - ), + (0xB6, 0x97, 0x97), + (0xB8, 0x26, 0x22, 0xF0, 0x13), + (0xBA, 0x31, 0x81, 0x0F, 0xF9, 0x0E, 0x06, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0x25, 0x00, 0x90, 0x0A, 0x00, 0x00, 0x01, 0x4F, 0x01, 0x00, 0x00, 0x37), + (0xBC, 0x47), + (0xBF, 0x02, 0x11, 0x00), + (0xC0, 0x73, 0x73, 0x50, 0x50, 0x00, 0x00, 0x12, 0x70, 0x00), + (0xC1, 0x25, 0x00, 0x32, 0x32, 0x77, 0xE4, 0xFF, 0xFF, 0xCC, 0xCC, 0x77, 0x77), + (0xC6, 0x82, 0x00, 0xBF, 0xFF, 0x00, 0xFF), + (0xC7, 0xB8, 0x00, 0x0A, 0x10, 0x01, 0x09), + (0xC8, 0x10, 0x40, 0x1E, 0x02), + (0xCC, 0x0B), + (0xE0, 0x00, 0x0B, 0x10, 0x2C, 0x3D, 0x3F, 0x42, 0x3A, 0x07, 0x0D, 0x0F, 0x13, 0x15, 0x13, 0x14, 0x0F, 0x16, 0x00, 0x0B, 0x10, 0x2C, 0x3D, 0x3F, 0x42, 0x3A, 0x07, 0x0D, 0x0F, 0x13, 0x15, 0x13, 0x14, 0x0F, 0x16), + (0xE3, 0x07, 0x07, 0x0B, 0x0B, 0x0B, 0x0B, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0xC0, 0x10), + (0xE9, 0xC8, 0x10, 0x0A, 0x00, 0x00, 0x80, 0x81, 0x12, 0x31, 0x23, 0x4F, 0x86, 0xA0, 0x00, 0x47, 0x08, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x98, 0x02, 0x8B, 0xAF, 0x46, 0x02, 0x88, 0x88, 0x88, 0x88, 0x88, 0x98, 0x13, 0x8B, 0xAF, 0x57, 0x13, 0x88, 0x88, 0x88, 0x88, 0x88, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00), + (0xEA, 0x97, 0x0C, 0x09, 0x09, 0x09, 0x78, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9F, 0x31, 0x8B, 0xA8, 0x31, 0x75, 0x88, 0x88, 0x88, 0x88, 0x88, 0x9F, 0x20, 0x8B, 0xA8, 0x20, 0x64, 0x88, 0x88, 0x88, 0x88, 0x88, 0x23, 0x00, 0x00, 0x02, 0x71, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x80, 0x81, 0x00, 0x00, 0x00, 0x00), + (0xEF, 0xFF, 0xFF, 0x01), + (0x11, 0x00), + (0x29, 0x00), ], ) diff --git a/esphome/components/mqtt/mqtt_client.cpp b/esphome/components/mqtt/mqtt_client.cpp index 7ab6efd1a1..16f54ab8a0 100644 --- a/esphome/components/mqtt/mqtt_client.cpp +++ b/esphome/components/mqtt/mqtt_client.cpp @@ -29,7 +29,8 @@ static const char *const TAG = "mqtt"; MQTTClientComponent::MQTTClientComponent() { global_mqtt_client = this; - this->credentials_.client_id = App.get_name() + "-" + get_mac_address(); + const std::string mac_addr = get_mac_address(); + this->credentials_.client_id = make_name_with_suffix(App.get_name(), '-', mac_addr.c_str(), mac_addr.size()); } // Connection diff --git a/esphome/components/network/util.cpp b/esphome/components/network/util.cpp index bf76aefc30..27ad9448a4 100644 --- a/esphome/components/network/util.cpp +++ b/esphome/components/network/util.cpp @@ -85,22 +85,25 @@ network::IPAddresses get_ip_addresses() { return {}; } -std::string get_use_address() { +const std::string &get_use_address() { + // Global component pointers are guaranteed to be set by component constructors when USE_* is defined #ifdef USE_ETHERNET - if (ethernet::global_eth_component != nullptr) - return ethernet::global_eth_component->get_use_address(); + return ethernet::global_eth_component->get_use_address(); #endif #ifdef USE_MODEM - if (modem::global_modem_component != nullptr) - return modem::global_modem_component->get_use_address(); + return modem::global_modem_component->get_use_address(); #endif #ifdef USE_WIFI - if (wifi::global_wifi_component != nullptr) - return wifi::global_wifi_component->get_use_address(); + return wifi::global_wifi_component->get_use_address(); +#endif + +#if !defined(USE_ETHERNET) && !defined(USE_MODEM) && !defined(USE_WIFI) + // Fallback when no network component is defined (e.g., host platform) + static const std::string empty; + return empty; #endif - return ""; } } // namespace network diff --git a/esphome/components/network/util.h b/esphome/components/network/util.h index b518696e68..b4a92f8bee 100644 --- a/esphome/components/network/util.h +++ b/esphome/components/network/util.h @@ -12,7 +12,7 @@ bool is_connected(); /// Return whether the network is disabled (only wifi for now) bool is_disabled(); /// Get the active network hostname -std::string get_use_address(); +const std::string &get_use_address(); IPAddresses get_ip_addresses(); } // namespace network diff --git a/esphome/components/openthread/__init__.py b/esphome/components/openthread/__init__.py index 2f085ebaae..3fac497c3d 100644 --- a/esphome/components/openthread/__init__.py +++ b/esphome/components/openthread/__init__.py @@ -5,7 +5,7 @@ from esphome.components.esp32 import ( add_idf_sdkconfig_option, only_on_variant, ) -from esphome.components.mdns import MDNSComponent +from esphome.components.mdns import MDNSComponent, enable_mdns_storage import esphome.config_validation as cv from esphome.const import CONF_CHANNEL, CONF_ENABLE_IPV6, CONF_ID import esphome.final_validate as fv @@ -141,6 +141,9 @@ FINAL_VALIDATE_SCHEMA = _final_validate async def to_code(config): cg.add_define("USE_OPENTHREAD") + # OpenThread SRP needs access to mDNS services after setup + enable_mdns_storage() + ot = cg.new_Pvariable(config[CONF_ID]) await cg.register_component(ot, config) diff --git a/esphome/components/psram/__init__.py b/esphome/components/psram/__init__.py index 6b85e7f720..8e4f9d7eac 100644 --- a/esphome/components/psram/__init__.py +++ b/esphome/components/psram/__init__.py @@ -63,6 +63,8 @@ SPIRAM_SPEEDS = { def supported() -> bool: + if not CORE.is_esp32: + return False variant = get_esp32_variant() return variant in SPIRAM_MODES diff --git a/esphome/components/socket/bsd_sockets_impl.cpp b/esphome/components/socket/bsd_sockets_impl.cpp index e056696bcf..c7cca62027 100644 --- a/esphome/components/socket/bsd_sockets_impl.cpp +++ b/esphome/components/socket/bsd_sockets_impl.cpp @@ -145,7 +145,7 @@ class BSDSocketImpl : public Socket { } ssize_t sendto(const void *buf, size_t len, int flags, const struct sockaddr *to, socklen_t tolen) override { - return ::sendto(fd_, buf, len, flags, to, tolen); + return ::sendto(fd_, buf, len, flags, to, tolen); // NOLINT(readability-suspicious-call-argument) } int setblocking(bool blocking) override { diff --git a/esphome/components/socket/lwip_raw_tcp_impl.cpp b/esphome/components/socket/lwip_raw_tcp_impl.cpp index 3377682474..4dedeffb6a 100644 --- a/esphome/components/socket/lwip_raw_tcp_impl.cpp +++ b/esphome/components/socket/lwip_raw_tcp_impl.cpp @@ -40,33 +40,14 @@ class LWIPRawImpl : public Socket { void init() { LWIP_LOG("init(%p)", pcb_); tcp_arg(pcb_, this); - tcp_accept(pcb_, LWIPRawImpl::s_accept_fn); tcp_recv(pcb_, LWIPRawImpl::s_recv_fn); tcp_err(pcb_, LWIPRawImpl::s_err_fn); } std::unique_ptr accept(struct sockaddr *addr, socklen_t *addrlen) override { - if (pcb_ == nullptr) { - errno = EBADF; - return nullptr; - } - if (this->accepted_socket_count_ == 0) { - errno = EWOULDBLOCK; - return nullptr; - } - // Take from front for FIFO ordering - std::unique_ptr sock = std::move(this->accepted_sockets_[0]); - // Shift remaining sockets forward - for (uint8_t i = 1; i < this->accepted_socket_count_; i++) { - this->accepted_sockets_[i - 1] = std::move(this->accepted_sockets_[i]); - } - this->accepted_socket_count_--; - LWIP_LOG("Connection accepted by application, queue size: %d", this->accepted_socket_count_); - if (addr != nullptr) { - sock->getpeername(addr, addrlen); - } - LWIP_LOG("accept(%p)", sock.get()); - return std::unique_ptr(std::move(sock)); + // Non-listening sockets return error + errno = EINVAL; + return nullptr; } int bind(const struct sockaddr *name, socklen_t addrlen) override { if (pcb_ == nullptr) { @@ -292,25 +273,10 @@ class LWIPRawImpl : public Socket { return -1; } int listen(int backlog) override { - if (pcb_ == nullptr) { - errno = EBADF; - return -1; - } - LWIP_LOG("tcp_listen_with_backlog(%p backlog=%d)", pcb_, backlog); - struct tcp_pcb *listen_pcb = tcp_listen_with_backlog(pcb_, backlog); - if (listen_pcb == nullptr) { - tcp_abort(pcb_); - pcb_ = nullptr; - errno = EOPNOTSUPP; - return -1; - } - // tcp_listen reallocates the pcb, replace ours - pcb_ = listen_pcb; - // set callbacks on new pcb - LWIP_LOG("tcp_arg(%p)", pcb_); - tcp_arg(pcb_, this); - tcp_accept(pcb_, LWIPRawImpl::s_accept_fn); - return 0; + // Regular sockets can't be converted to listening - this shouldn't happen + // as listen() should only be called on sockets created for listening + errno = EOPNOTSUPP; + return -1; } ssize_t read(void *buf, size_t len) override { if (pcb_ == nullptr) { @@ -491,29 +457,6 @@ class LWIPRawImpl : public Socket { return 0; } - err_t accept_fn(struct tcp_pcb *newpcb, err_t err) { - LWIP_LOG("accept(newpcb=%p err=%d)", newpcb, err); - if (err != ERR_OK || newpcb == nullptr) { - // "An error code if there has been an error accepting. Only return ERR_ABRT if you have - // called tcp_abort from within the callback function!" - // https://www.nongnu.org/lwip/2_1_x/tcp_8h.html#a00517abce6856d6c82f0efebdafb734d - // nothing to do here, we just don't push it to the queue - return ERR_OK; - } - // Check if we've reached the maximum accept queue size - if (this->accepted_socket_count_ >= MAX_ACCEPTED_SOCKETS) { - LWIP_LOG("Rejecting connection, queue full (%d)", this->accepted_socket_count_); - // Abort the connection when queue is full - tcp_abort(newpcb); - // Must return ERR_ABRT since we called tcp_abort() - return ERR_ABRT; - } - auto sock = make_unique(family_, newpcb); - sock->init(); - this->accepted_sockets_[this->accepted_socket_count_++] = std::move(sock); - LWIP_LOG("Accepted connection, queue size: %d", this->accepted_socket_count_); - return ERR_OK; - } void err_fn(err_t err) { LWIP_LOG("err(err=%d)", err); // "If a connection is aborted because of an error, the application is alerted of this event by @@ -545,11 +488,6 @@ class LWIPRawImpl : public Socket { return ERR_OK; } - static err_t s_accept_fn(void *arg, struct tcp_pcb *newpcb, err_t err) { - LWIPRawImpl *arg_this = reinterpret_cast(arg); - return arg_this->accept_fn(newpcb, err); - } - static void s_err_fn(void *arg, err_t err) { LWIPRawImpl *arg_this = reinterpret_cast(arg); arg_this->err_fn(err); @@ -601,7 +539,107 @@ class LWIPRawImpl : public Socket { return -1; } + // Member ordering optimized to minimize padding on 32-bit systems + // Largest members first (4 bytes), then smaller members (1 byte each) struct tcp_pcb *pcb_; + pbuf *rx_buf_ = nullptr; + size_t rx_buf_offset_ = 0; + bool rx_closed_ = false; + // don't use lwip nodelay flag, it sometimes causes reconnect + // instead use it for determining whether to call lwip_output + bool nodelay_ = false; + sa_family_t family_ = 0; +}; + +// Listening socket class - only allocates accept queue when needed (for bind+listen sockets) +// This saves 16 bytes (12 bytes array + 1 byte count + 3 bytes padding) for regular connected sockets on ESP8266/RP2040 +class LWIPRawListenImpl : public LWIPRawImpl { + public: + LWIPRawListenImpl(sa_family_t family, struct tcp_pcb *pcb) : LWIPRawImpl(family, pcb) {} + + void init() { + LWIP_LOG("init(%p)", pcb_); + tcp_arg(pcb_, this); + tcp_accept(pcb_, LWIPRawListenImpl::s_accept_fn); + tcp_err(pcb_, LWIPRawImpl::s_err_fn); // Use base class error handler + } + + std::unique_ptr accept(struct sockaddr *addr, socklen_t *addrlen) override { + if (pcb_ == nullptr) { + errno = EBADF; + return nullptr; + } + if (accepted_socket_count_ == 0) { + errno = EWOULDBLOCK; + return nullptr; + } + // Take from front for FIFO ordering + std::unique_ptr sock = std::move(accepted_sockets_[0]); + // Shift remaining sockets forward + for (uint8_t i = 1; i < accepted_socket_count_; i++) { + accepted_sockets_[i - 1] = std::move(accepted_sockets_[i]); + } + accepted_socket_count_--; + LWIP_LOG("Connection accepted by application, queue size: %d", accepted_socket_count_); + if (addr != nullptr) { + sock->getpeername(addr, addrlen); + } + LWIP_LOG("accept(%p)", sock.get()); + return std::unique_ptr(std::move(sock)); + } + + int listen(int backlog) override { + if (pcb_ == nullptr) { + errno = EBADF; + return -1; + } + LWIP_LOG("tcp_listen_with_backlog(%p backlog=%d)", pcb_, backlog); + struct tcp_pcb *listen_pcb = tcp_listen_with_backlog(pcb_, backlog); + if (listen_pcb == nullptr) { + tcp_abort(pcb_); + pcb_ = nullptr; + errno = EOPNOTSUPP; + return -1; + } + // tcp_listen reallocates the pcb, replace ours + pcb_ = listen_pcb; + // set callbacks on new pcb + LWIP_LOG("tcp_arg(%p)", pcb_); + tcp_arg(pcb_, this); + tcp_accept(pcb_, LWIPRawListenImpl::s_accept_fn); + return 0; + } + + private: + err_t accept_fn(struct tcp_pcb *newpcb, err_t err) { + LWIP_LOG("accept(newpcb=%p err=%d)", newpcb, err); + if (err != ERR_OK || newpcb == nullptr) { + // "An error code if there has been an error accepting. Only return ERR_ABRT if you have + // called tcp_abort from within the callback function!" + // https://www.nongnu.org/lwip/2_1_x/tcp_8h.html#a00517abce6856d6c82f0efebdafb734d + // nothing to do here, we just don't push it to the queue + return ERR_OK; + } + // Check if we've reached the maximum accept queue size + if (accepted_socket_count_ >= MAX_ACCEPTED_SOCKETS) { + LWIP_LOG("Rejecting connection, queue full (%d)", accepted_socket_count_); + // Abort the connection when queue is full + tcp_abort(newpcb); + // Must return ERR_ABRT since we called tcp_abort() + return ERR_ABRT; + } + auto sock = make_unique(family_, newpcb); + sock->init(); + accepted_sockets_[accepted_socket_count_++] = std::move(sock); + LWIP_LOG("Accepted connection, queue size: %d", accepted_socket_count_); + return ERR_OK; + } + + static err_t s_accept_fn(void *arg, struct tcp_pcb *newpcb, err_t err) { + LWIPRawListenImpl *arg_this = reinterpret_cast(arg); + return arg_this->accept_fn(newpcb, err); + } + // Accept queue - holds incoming connections briefly until the event loop calls accept() // This is NOT a connection pool - just a temporary queue between LWIP callbacks and the main loop // 3 slots is plenty since connections are pulled out quickly by the event loop @@ -613,23 +651,21 @@ class LWIPRawImpl : public Socket { // - std::array<3>: 12 bytes fixed (3 pointers × 4 bytes) // Saves ~44+ bytes RAM per listening socket + avoids ALL heap allocations // Used on ESP8266 and RP2040 (platforms using LWIP_TCP implementation) + // + // By using a separate listening socket class, regular connected sockets save + // 16 bytes (12 bytes array + 1 byte count + 3 bytes padding) of memory overhead on 32-bit systems static constexpr size_t MAX_ACCEPTED_SOCKETS = 3; std::array, MAX_ACCEPTED_SOCKETS> accepted_sockets_; uint8_t accepted_socket_count_ = 0; // Number of sockets currently in queue - bool rx_closed_ = false; - pbuf *rx_buf_ = nullptr; - size_t rx_buf_offset_ = 0; - // don't use lwip nodelay flag, it sometimes causes reconnect - // instead use it for determining whether to call lwip_output - bool nodelay_ = false; - sa_family_t family_ = 0; }; std::unique_ptr socket(int domain, int type, int protocol) { auto *pcb = tcp_new(); if (pcb == nullptr) return nullptr; - auto *sock = new LWIPRawImpl((sa_family_t) domain, pcb); // NOLINT(cppcoreguidelines-owning-memory) + // Create listening socket implementation since user sockets typically bind+listen + // Accepted connections are created directly as LWIPRawImpl in the accept callback + auto *sock = new LWIPRawListenImpl((sa_family_t) domain, pcb); // NOLINT(cppcoreguidelines-owning-memory) sock->init(); return std::unique_ptr{sock}; } diff --git a/esphome/components/speaker/media_player/__init__.py b/esphome/components/speaker/media_player/__init__.py index 69ea0a53c6..7537a61e4e 100644 --- a/esphome/components/speaker/media_player/__init__.py +++ b/esphome/components/speaker/media_player/__init__.py @@ -6,7 +6,7 @@ from pathlib import Path from esphome import automation, external_files import esphome.codegen as cg -from esphome.components import audio, esp32, media_player, speaker +from esphome.components import audio, esp32, media_player, psram, speaker import esphome.config_validation as cv from esphome.const import ( CONF_BUFFER_SIZE, @@ -26,10 +26,21 @@ from esphome.const import ( from esphome.core import CORE, HexInt from esphome.core.entity_helpers import inherit_property_from from esphome.external_files import download_content +from esphome.types import ConfigType _LOGGER = logging.getLogger(__name__) -AUTO_LOAD = ["audio", "psram"] + +def AUTO_LOAD(config: ConfigType) -> list[str]: + load = ["audio"] + if ( + not config + or config.get(CONF_TASK_STACK_IN_PSRAM) + or config.get(CONF_CODEC_SUPPORT_ENABLED) + ): + return load + ["psram"] + return load + CODEOWNERS = ["@kahrendt", "@synesthesiam"] DOMAIN = "media_player" @@ -279,7 +290,9 @@ CONFIG_SCHEMA = cv.All( cv.Optional(CONF_BUFFER_SIZE, default=1000000): cv.int_range( min=4000, max=4000000 ), - cv.Optional(CONF_CODEC_SUPPORT_ENABLED, default=True): cv.boolean, + cv.Optional( + CONF_CODEC_SUPPORT_ENABLED, default=psram.supported() + ): cv.boolean, cv.Optional(CONF_FILES): cv.ensure_list(MEDIA_FILE_TYPE_SCHEMA), cv.Optional(CONF_TASK_STACK_IN_PSRAM, default=False): cv.boolean, cv.Optional(CONF_VOLUME_INCREMENT, default=0.05): cv.percentage, diff --git a/esphome/components/uart/__init__.py b/esphome/components/uart/__init__.py index 764576744f..f8f927d469 100644 --- a/esphome/components/uart/__init__.py +++ b/esphome/components/uart/__init__.py @@ -347,7 +347,7 @@ def final_validate_device_schema( def validate_pin(opt, device): def validator(value): - if opt in device: + if opt in device and not CORE.testing_mode: raise cv.Invalid( f"The uart {opt} is used both by {name} and {device[opt]}, " f"but can only be used by one. Please create a new uart bus for {name}." diff --git a/esphome/components/usb_host/__init__.py b/esphome/components/usb_host/__init__.py index de734bf425..d452e0e9fa 100644 --- a/esphome/components/usb_host/__init__.py +++ b/esphome/components/usb_host/__init__.py @@ -9,6 +9,7 @@ from esphome.components.esp32 import ( import esphome.config_validation as cv from esphome.const import CONF_DEVICES, CONF_ID from esphome.cpp_types import Component +from esphome.types import ConfigType AUTO_LOAD = ["bytebuffer"] CODEOWNERS = ["@clydebarrow"] @@ -20,6 +21,7 @@ USBClient = usb_host_ns.class_("USBClient", Component) CONF_VID = "vid" CONF_PID = "pid" CONF_ENABLE_HUBS = "enable_hubs" +CONF_MAX_TRANSFER_REQUESTS = "max_transfer_requests" def usb_device_schema(cls=USBClient, vid: int = None, pid: [int] = None) -> cv.Schema: @@ -44,6 +46,9 @@ CONFIG_SCHEMA = cv.All( { cv.GenerateID(): cv.declare_id(USBHost), cv.Optional(CONF_ENABLE_HUBS, default=False): cv.boolean, + cv.Optional(CONF_MAX_TRANSFER_REQUESTS, default=16): cv.int_range( + min=1, max=32 + ), cv.Optional(CONF_DEVICES): cv.ensure_list(usb_device_schema()), } ), @@ -58,10 +63,14 @@ async def register_usb_client(config): return var -async def to_code(config): +async def to_code(config: ConfigType) -> None: add_idf_sdkconfig_option("CONFIG_USB_HOST_CONTROL_TRANSFER_MAX_SIZE", 1024) if config.get(CONF_ENABLE_HUBS): add_idf_sdkconfig_option("CONFIG_USB_HOST_HUBS_SUPPORTED", True) + + max_requests = config[CONF_MAX_TRANSFER_REQUESTS] + cg.add_define("USB_HOST_MAX_REQUESTS", max_requests) + var = cg.new_Pvariable(config[CONF_ID]) await cg.register_component(var, config) for device in config.get(CONF_DEVICES) or (): diff --git a/esphome/components/usb_host/usb_host.h b/esphome/components/usb_host/usb_host.h index 4f8d2ec9a8..43b24a54a5 100644 --- a/esphome/components/usb_host/usb_host.h +++ b/esphome/components/usb_host/usb_host.h @@ -2,6 +2,7 @@ // Should not be needed, but it's required to pass CI clang-tidy checks #if defined(USE_ESP32_VARIANT_ESP32S2) || defined(USE_ESP32_VARIANT_ESP32S3) || defined(USE_ESP32_VARIANT_ESP32P4) +#include "esphome/core/defines.h" #include "esphome/core/component.h" #include #include "usb/usb_host.h" @@ -16,23 +17,25 @@ namespace usb_host { // THREADING MODEL: // This component uses a dedicated USB task for event processing to prevent data loss. -// - USB Task (high priority): Handles USB events, executes transfer callbacks -// - Main Loop Task: Initiates transfers, processes completion events +// - USB Task (high priority): Handles USB events, executes transfer callbacks, releases transfer slots +// - Main Loop Task: Initiates transfers, processes device connect/disconnect events // // Thread-safe communication: // - Lock-free queues for USB task -> main loop events (SPSC pattern) -// - Lock-free TransferRequest pool using atomic bitmask (MCSP pattern) +// - Lock-free TransferRequest pool using atomic bitmask (MCMP pattern - multi-consumer, multi-producer) // // TransferRequest pool access pattern: // - get_trq_() [allocate]: Called from BOTH USB task and main loop threads // * USB task: via USB UART input callbacks that restart transfers immediately // * Main loop: for output transfers and flow-controlled input restarts -// - release_trq() [deallocate]: Called from main loop thread only +// - release_trq() [deallocate]: Called from BOTH USB task and main loop threads +// * USB task: immediately after transfer callback completes (critical for preventing slot exhaustion) +// * Main loop: when transfer submission fails // -// The multi-threaded allocation is intentional for performance: -// - USB task can immediately restart input transfers without context switching +// The multi-threaded allocation/deallocation is intentional for performance: +// - USB task can immediately restart input transfers and release slots without context switching // - Main loop controls backpressure by deciding when to restart after consuming data -// The atomic bitmask ensures thread-safe allocation without mutex blocking. +// The atomic bitmask ensures thread-safe allocation/deallocation without mutex blocking. static const char *const TAG = "usb_host"; @@ -52,8 +55,17 @@ static const uint8_t USB_DIR_IN = 1 << 7; static const uint8_t USB_DIR_OUT = 0; static const size_t SETUP_PACKET_SIZE = 8; -static const size_t MAX_REQUESTS = 16; // maximum number of outstanding requests possible. -static_assert(MAX_REQUESTS <= 16, "MAX_REQUESTS must be <= 16 to fit in uint16_t bitmask"); +static const size_t MAX_REQUESTS = USB_HOST_MAX_REQUESTS; // maximum number of outstanding requests possible. +static_assert(MAX_REQUESTS >= 1 && MAX_REQUESTS <= 32, "MAX_REQUESTS must be between 1 and 32"); + +// Select appropriate bitmask type for tracking allocation of TransferRequest slots. +// The bitmask must have at least as many bits as MAX_REQUESTS, so: +// - Use uint16_t for up to 16 requests (MAX_REQUESTS <= 16) +// - Use uint32_t for 17-32 requests (MAX_REQUESTS > 16) +// This is tied to the static_assert above, which enforces MAX_REQUESTS is between 1 and 32. +// If MAX_REQUESTS is increased above 32, this logic and the static_assert must be updated. +using trq_bitmask_t = std::conditional<(MAX_REQUESTS <= 16), uint16_t, uint32_t>::type; + static constexpr size_t USB_EVENT_QUEUE_SIZE = 32; // Size of event queue between USB task and main loop static constexpr size_t USB_TASK_STACK_SIZE = 4096; // Stack size for USB task (same as ESP-IDF USB examples) static constexpr UBaseType_t USB_TASK_PRIORITY = 5; // Higher priority than main loop (tskIDLE_PRIORITY + 5) @@ -83,8 +95,6 @@ struct TransferRequest { enum EventType : uint8_t { EVENT_DEVICE_NEW, EVENT_DEVICE_GONE, - EVENT_TRANSFER_COMPLETE, - EVENT_CONTROL_COMPLETE, }; struct UsbEvent { @@ -96,9 +106,6 @@ struct UsbEvent { struct { usb_device_handle_t handle; } device_gone; - struct { - TransferRequest *trq; - } transfer; } data; // Required for EventPool - no cleanup needed for POD types @@ -163,10 +170,9 @@ class USBClient : public Component { uint16_t pid_{}; // Lock-free pool management using atomic bitmask (no dynamic allocation) // Bit i = 1: requests_[i] is in use, Bit i = 0: requests_[i] is available - // Supports multiple concurrent consumers (both threads can allocate) - // Single producer for deallocation (main loop only) - // Limited to 16 slots by uint16_t size (enforced by static_assert) - std::atomic trq_in_use_; + // Supports multiple concurrent consumers and producers (both threads can allocate/deallocate) + // Bitmask type automatically selected: uint16_t for <= 16 slots, uint32_t for 17-32 slots + std::atomic trq_in_use_; TransferRequest requests_[MAX_REQUESTS]{}; }; class USBHost : public Component { diff --git a/esphome/components/usb_host/usb_host_client.cpp b/esphome/components/usb_host/usb_host_client.cpp index b26385a8ef..2139ed869a 100644 --- a/esphome/components/usb_host/usb_host_client.cpp +++ b/esphome/components/usb_host/usb_host_client.cpp @@ -228,12 +228,6 @@ void USBClient::loop() { case EVENT_DEVICE_GONE: this->on_removed(event->data.device_gone.handle); break; - case EVENT_TRANSFER_COMPLETE: - case EVENT_CONTROL_COMPLETE: { - auto *trq = event->data.transfer.trq; - this->release_trq(trq); - break; - } } // Return event to pool for reuse this->event_pool.release(event); @@ -313,25 +307,6 @@ void USBClient::on_removed(usb_device_handle_t handle) { } } -// Helper to queue transfer cleanup to main loop -static void queue_transfer_cleanup(TransferRequest *trq, EventType type) { - auto *client = trq->client; - - // Allocate event from pool - UsbEvent *event = client->event_pool.allocate(); - if (event == nullptr) { - // No events available - increment counter for periodic logging - client->event_queue.increment_dropped_count(); - return; - } - - event->type = type; - event->data.transfer.trq = trq; - - // Push to lock-free queue (always succeeds since pool size == queue size) - client->event_queue.push(event); -} - // CALLBACK CONTEXT: USB task (called from usb_host_client_handle_events in USB task) static void control_callback(const usb_transfer_t *xfer) { auto *trq = static_cast(xfer->context); @@ -346,8 +321,9 @@ static void control_callback(const usb_transfer_t *xfer) { trq->callback(trq->status); } - // Queue cleanup to main loop - queue_transfer_cleanup(trq, EVENT_CONTROL_COMPLETE); + // Release transfer slot immediately in USB task + // The release_trq() uses thread-safe atomic operations + trq->client->release_trq(trq); } // THREAD CONTEXT: Called from both USB task and main loop threads (multi-consumer) @@ -358,20 +334,20 @@ static void control_callback(const usb_transfer_t *xfer) { // This multi-threaded access is intentional for performance - USB task can // immediately restart transfers without waiting for main loop scheduling. TransferRequest *USBClient::get_trq_() { - uint16_t mask = this->trq_in_use_.load(std::memory_order_relaxed); + trq_bitmask_t mask = this->trq_in_use_.load(std::memory_order_relaxed); // Find first available slot (bit = 0) and try to claim it atomically // We use a while loop to allow retrying the same slot after CAS failure size_t i = 0; while (i != MAX_REQUESTS) { - if (mask & (1U << i)) { + if (mask & (static_cast(1) << i)) { // Slot is in use, move to next slot i++; continue; } // Slot i appears available, try to claim it atomically - uint16_t desired = mask | (1U << i); // Set bit i to mark as in-use + trq_bitmask_t desired = mask | (static_cast(1) << i); // Set bit i to mark as in-use if (this->trq_in_use_.compare_exchange_weak(mask, desired, std::memory_order_acquire, std::memory_order_relaxed)) { // Successfully claimed slot i - prepare the TransferRequest @@ -386,7 +362,7 @@ TransferRequest *USBClient::get_trq_() { i = 0; } - ESP_LOGE(TAG, "All %d transfer slots in use", MAX_REQUESTS); + ESP_LOGE(TAG, "All %zu transfer slots in use", MAX_REQUESTS); return nullptr; } void USBClient::disconnect() { @@ -452,8 +428,11 @@ static void transfer_callback(usb_transfer_t *xfer) { trq->callback(trq->status); } - // Queue cleanup to main loop - queue_transfer_cleanup(trq, EVENT_TRANSFER_COMPLETE); + // Release transfer slot AFTER callback completes to prevent slot exhaustion + // This is critical for high-throughput transfers (e.g., USB UART at 115200 baud) + // The callback has finished accessing xfer->data_buffer, so it's safe to release + // The release_trq() uses thread-safe atomic operations + trq->client->release_trq(trq); } /** * Performs a transfer input operation. @@ -521,12 +500,12 @@ void USBClient::dump_config() { " Product id %04X", this->vid_, this->pid_); } -// THREAD CONTEXT: Only called from main loop thread (single producer for deallocation) -// - Via event processing when handling EVENT_TRANSFER_COMPLETE/EVENT_CONTROL_COMPLETE -// - Directly when transfer submission fails +// THREAD CONTEXT: Called from both USB task and main loop threads +// - USB task: Immediately after transfer callback completes +// - Main loop: When transfer submission fails // // THREAD SAFETY: Lock-free using atomic AND to clear bit -// Single-producer pattern makes this simpler than allocation +// Thread-safe atomic operation allows multi-threaded deallocation void USBClient::release_trq(TransferRequest *trq) { if (trq == nullptr) return; @@ -540,8 +519,8 @@ void USBClient::release_trq(TransferRequest *trq) { // Atomically clear bit i to mark slot as available // fetch_and with inverted bitmask clears the bit atomically - uint16_t bit = 1U << index; - this->trq_in_use_.fetch_and(static_cast(~bit), std::memory_order_release); + trq_bitmask_t bit = static_cast(1) << index; + this->trq_in_use_.fetch_and(static_cast(~bit), std::memory_order_release); } } // namespace usb_host diff --git a/esphome/components/web_server_idf/web_server_idf.cpp b/esphome/components/web_server_idf/web_server_idf.cpp index d90efd18bc..c3ba7ddc2b 100644 --- a/esphome/components/web_server_idf/web_server_idf.cpp +++ b/esphome/components/web_server_idf/web_server_idf.cpp @@ -380,24 +380,25 @@ void AsyncEventSource::handleRequest(AsyncWebServerRequest *request) { if (this->on_connect_) { this->on_connect_(rsp); } - this->sessions_.insert(rsp); + this->sessions_.push_back(rsp); } void AsyncEventSource::loop() { // Clean up dead sessions safely // This follows the ESP-IDF pattern where free_ctx marks resources as dead // and the main loop handles the actual cleanup to avoid race conditions - auto it = this->sessions_.begin(); - while (it != this->sessions_.end()) { - auto *ses = *it; + for (size_t i = 0; i < this->sessions_.size();) { + auto *ses = this->sessions_[i]; // If the session has a dead socket (marked by destroy callback) if (ses->fd_.load() == 0) { ESP_LOGD(TAG, "Removing dead event source session"); - it = this->sessions_.erase(it); delete ses; // NOLINT(cppcoreguidelines-owning-memory) + // Remove by swapping with last element (O(1) removal, order doesn't matter for sessions) + this->sessions_[i] = this->sessions_.back(); + this->sessions_.pop_back(); } else { ses->loop(); - ++it; + ++i; } } } diff --git a/esphome/components/web_server_idf/web_server_idf.h b/esphome/components/web_server_idf/web_server_idf.h index bf93dcbd34..5ec6fec009 100644 --- a/esphome/components/web_server_idf/web_server_idf.h +++ b/esphome/components/web_server_idf/web_server_idf.h @@ -8,7 +8,6 @@ #include #include #include -#include #include #include #include @@ -315,7 +314,10 @@ class AsyncEventSource : public AsyncWebHandler { protected: std::string url_; - std::set sessions_; + // Use vector instead of set: SSE sessions are typically 1-5 connections (browsers, dashboards). + // Linear search is faster than red-black tree overhead for this small dataset. + // Only operations needed: add session, remove session, iterate sessions - no need for sorted order. + std::vector sessions_; connect_handler_t on_connect_{}; esphome::web_server::WebServer *web_server_; }; diff --git a/esphome/components/wifi/__init__.py b/esphome/components/wifi/__init__.py index a784123006..ad5698519b 100644 --- a/esphome/components/wifi/__init__.py +++ b/esphome/components/wifi/__init__.py @@ -447,6 +447,8 @@ async def to_code(config): var.get_disconnect_trigger(), [], on_disconnect_config ) + CORE.add_job(final_step) + @automation.register_condition("wifi.connected", WiFiConnectedCondition, cv.Schema({})) async def wifi_connected_to_code(config, condition_id, template_arg, args): @@ -468,6 +470,28 @@ async def wifi_disable_to_code(config, action_id, template_arg, args): return cg.new_Pvariable(action_id, template_arg) +KEEP_SCAN_RESULTS_KEY = "wifi_keep_scan_results" + + +def request_wifi_scan_results(): + """Request that WiFi scan results be kept in memory after connection. + + Components that need access to scan results after WiFi is connected should + call this function during their code generation. This prevents the WiFi component from + freeing scan result memory after successful connection. + """ + CORE.data[KEEP_SCAN_RESULTS_KEY] = True + + +@coroutine_with_priority(CoroPriority.FINAL) +async def final_step(): + """Final code generation step to configure scan result retention.""" + if CORE.data.get(KEEP_SCAN_RESULTS_KEY, False): + cg.add( + cg.RawExpression("wifi::global_wifi_component->set_keep_scan_results(true)") + ) + + @automation.register_action( "wifi.configure", WiFiConfigureAction, diff --git a/esphome/components/wifi/wifi_component.cpp b/esphome/components/wifi/wifi_component.cpp index 2e083d4c68..5aa2a03a14 100644 --- a/esphome/components/wifi/wifi_component.cpp +++ b/esphome/components/wifi/wifi_component.cpp @@ -265,12 +265,9 @@ network::IPAddress WiFiComponent::get_dns_address(int num) { return this->wifi_dns_ip_(num); return {}; } -std::string WiFiComponent::get_use_address() const { - if (this->use_address_.empty()) { - return App.get_name() + ".local"; - } - return this->use_address_; -} +// set_use_address() is guaranteed to be called during component setup by Python code generation, +// so use_address_ will always be valid when get_use_address() is called - no fallback needed. +const std::string &WiFiComponent::get_use_address() const { return this->use_address_; } void WiFiComponent::set_use_address(const std::string &use_address) { this->use_address_ = use_address; } #ifdef USE_WIFI_AP @@ -552,7 +549,7 @@ void WiFiComponent::start_scanning() { // Using insertion sort instead of std::stable_sort saves flash memory // by avoiding template instantiations (std::rotate, std::stable_sort, lambdas) // IMPORTANT: This sort is stable (preserves relative order of equal elements) -static void insertion_sort_scan_results(std::vector &results) { +template static void insertion_sort_scan_results(VectorType &results) { const size_t size = results.size(); for (size_t i = 1; i < size; i++) { // Make a copy to avoid issues with move semantics during comparison @@ -576,8 +573,9 @@ __attribute__((noinline)) static void log_scan_result(const WiFiScanResult &res) format_mac_addr_upper(bssid.data(), bssid_s); if (res.get_matches()) { - ESP_LOGI(TAG, "- '%s' %s" LOG_SECRET("(%s) ") "%s", res.get_ssid().c_str(), res.get_is_hidden() ? "(HIDDEN) " : "", - bssid_s, LOG_STR_ARG(get_signal_bars(res.get_rssi()))); + ESP_LOGI(TAG, "- '%s' %s" LOG_SECRET("(%s) ") "%s", res.get_ssid().c_str(), + res.get_is_hidden() ? LOG_STR_LITERAL("(HIDDEN) ") : LOG_STR_LITERAL(""), bssid_s, + LOG_STR_ARG(get_signal_bars(res.get_rssi()))); ESP_LOGD(TAG, " Channel: %u\n" " RSSI: %d dB", @@ -715,6 +713,12 @@ void WiFiComponent::check_connecting_finished() { this->state_ = WIFI_COMPONENT_STATE_STA_CONNECTED; this->num_retried_ = 0; + // Free scan results memory unless a component needs them + if (!this->keep_scan_results_) { + this->scan_result_.clear(); + this->scan_result_.shrink_to_fit(); + } + if (this->fast_connect_) { this->save_fast_connect_settings_(); } diff --git a/esphome/components/wifi/wifi_component.h b/esphome/components/wifi/wifi_component.h index ee62ec1a69..9d32071b2b 100644 --- a/esphome/components/wifi/wifi_component.h +++ b/esphome/components/wifi/wifi_component.h @@ -121,6 +121,14 @@ struct EAPAuth { using bssid_t = std::array; +// Use std::vector for RP2040 since scan count is unknown (callback-based) +// Use FixedVector for other platforms where count is queried first +#ifdef USE_RP2040 +template using wifi_scan_vector_t = std::vector; +#else +template using wifi_scan_vector_t = FixedVector; +#endif + class WiFiAP { public: void set_ssid(const std::string &ssid); @@ -275,10 +283,10 @@ class WiFiComponent : public Component { network::IPAddress get_dns_address(int num); network::IPAddresses get_ip_addresses(); - std::string get_use_address() const; + const std::string &get_use_address() const; void set_use_address(const std::string &use_address); - const std::vector &get_scan_result() const { return scan_result_; } + const wifi_scan_vector_t &get_scan_result() const { return scan_result_; } network::IPAddress wifi_soft_ap_ip(); @@ -316,6 +324,7 @@ class WiFiComponent : public Component { int8_t wifi_rssi(); void set_enable_on_boot(bool enable_on_boot) { this->enable_on_boot_ = enable_on_boot; } + void set_keep_scan_results(bool keep_scan_results) { this->keep_scan_results_ = keep_scan_results; } Trigger<> *get_connect_trigger() const { return this->connect_trigger_; }; Trigger<> *get_disconnect_trigger() const { return this->disconnect_trigger_; }; @@ -385,7 +394,7 @@ class WiFiComponent : public Component { std::string use_address_; std::vector sta_; std::vector sta_priorities_; - std::vector scan_result_; + wifi_scan_vector_t scan_result_; WiFiAP selected_ap_; WiFiAP ap_; optional output_power_; @@ -424,6 +433,7 @@ class WiFiComponent : public Component { #endif bool enable_on_boot_; bool got_ipv4_address_{false}; + bool keep_scan_results_{false}; // Pointers at the end (naturally aligned) Trigger<> *connect_trigger_{new Trigger<>()}; diff --git a/esphome/components/wifi/wifi_component_esp8266.cpp b/esphome/components/wifi/wifi_component_esp8266.cpp index 3b3b4b139c..59909b2cb5 100644 --- a/esphome/components/wifi/wifi_component_esp8266.cpp +++ b/esphome/components/wifi/wifi_component_esp8266.cpp @@ -696,7 +696,15 @@ void WiFiComponent::wifi_scan_done_callback_(void *arg, STATUS status) { this->retry_connect(); return; } + + // Count the number of results first auto *head = reinterpret_cast(arg); + size_t count = 0; + for (bss_info *it = head; it != nullptr; it = STAILQ_NEXT(it, next)) { + count++; + } + + this->scan_result_.init(count); for (bss_info *it = head; it != nullptr; it = STAILQ_NEXT(it, next)) { WiFiScanResult res({it->bssid[0], it->bssid[1], it->bssid[2], it->bssid[3], it->bssid[4], it->bssid[5]}, std::string(reinterpret_cast(it->ssid), it->ssid_len), it->channel, it->rssi, diff --git a/esphome/components/wifi/wifi_component_esp_idf.cpp b/esphome/components/wifi/wifi_component_esp_idf.cpp index ccec800205..951f5803a6 100644 --- a/esphome/components/wifi/wifi_component_esp_idf.cpp +++ b/esphome/components/wifi/wifi_component_esp_idf.cpp @@ -784,7 +784,7 @@ void WiFiComponent::wifi_process_event_(IDFWiFiEvent *data) { } records.resize(number); - scan_result_.reserve(number); + scan_result_.init(number); for (int i = 0; i < number; i++) { auto &record = records[i]; bssid_t bssid; diff --git a/esphome/components/wifi/wifi_component_libretiny.cpp b/esphome/components/wifi/wifi_component_libretiny.cpp index b15f710150..cb179d9022 100644 --- a/esphome/components/wifi/wifi_component_libretiny.cpp +++ b/esphome/components/wifi/wifi_component_libretiny.cpp @@ -411,7 +411,7 @@ void WiFiComponent::wifi_scan_done_callback_() { if (num < 0) return; - this->scan_result_.reserve(static_cast(num)); + this->scan_result_.init(static_cast(num)); for (int i = 0; i < num; i++) { String ssid = WiFi.SSID(i); wifi_auth_mode_t authmode = WiFi.encryptionType(i); diff --git a/esphome/components/wifi_info/text_sensor.py b/esphome/components/wifi_info/text_sensor.py index 4ceb73a695..a4da582c55 100644 --- a/esphome/components/wifi_info/text_sensor.py +++ b/esphome/components/wifi_info/text_sensor.py @@ -1,5 +1,5 @@ import esphome.codegen as cg -from esphome.components import text_sensor +from esphome.components import text_sensor, wifi import esphome.config_validation as cv from esphome.const import ( CONF_BSSID, @@ -77,7 +77,9 @@ async def to_code(config): await setup_conf(config, CONF_SSID) await setup_conf(config, CONF_BSSID) await setup_conf(config, CONF_MAC_ADDRESS) - await setup_conf(config, CONF_SCAN_RESULTS) + if CONF_SCAN_RESULTS in config: + await setup_conf(config, CONF_SCAN_RESULTS) + wifi.request_wifi_scan_results() await setup_conf(config, CONF_DNS_ADDRESS) if conf := config.get(CONF_IP_ADDRESS): wifi_info = await text_sensor.new_text_sensor(config[CONF_IP_ADDRESS]) diff --git a/esphome/config_validation.py b/esphome/config_validation.py index 7aaba886e3..ebfedf2017 100644 --- a/esphome/config_validation.py +++ b/esphome/config_validation.py @@ -1195,6 +1195,13 @@ def validate_bytes(value): def hostname(value): + """Validate that the value is a valid hostname. + + Maximum length is 63 characters per RFC 1035. + + Note: If this limit is changed, update MAX_NAME_WITH_SUFFIX_SIZE in + esphome/core/helpers.cpp to accommodate the new maximum length. + """ value = string(value) if re.match(r"^[a-z0-9-]{1,63}$", value, re.IGNORECASE) is not None: return value diff --git a/esphome/const.py b/esphome/const.py index 086b5b4ce3..d62dc617d1 100644 --- a/esphome/const.py +++ b/esphome/const.py @@ -836,6 +836,7 @@ CONF_RMT_CHANNEL = "rmt_channel" CONF_RMT_SYMBOLS = "rmt_symbols" CONF_ROTATION = "rotation" CONF_ROW = "row" +CONF_ROWS = "rows" CONF_RS_PIN = "rs_pin" CONF_RTD_NOMINAL_RESISTANCE = "rtd_nominal_resistance" CONF_RTD_WIRES = "rtd_wires" diff --git a/esphome/core/__init__.py b/esphome/core/__init__.py index 637578730a..49a6e1f90a 100644 --- a/esphome/core/__init__.py +++ b/esphome/core/__init__.py @@ -529,6 +529,8 @@ class EsphomeCore: self.dashboard = False # True if command is run from vscode api self.vscode = False + # True if running in testing mode (disables validation checks for grouped testing) + self.testing_mode = False # The name of the node self.name: str | None = None # The friendly name of the node diff --git a/esphome/core/application.cpp b/esphome/core/application.cpp index 1be193bb7e..c745aa0ae5 100644 --- a/esphome/core/application.cpp +++ b/esphome/core/application.cpp @@ -340,8 +340,8 @@ void Application::calculate_looping_components_() { } } - // Pre-reserve vector to avoid reallocations - this->looping_components_.reserve(total_looping); + // Initialize FixedVector with exact size - no reallocation possible + this->looping_components_.init(total_looping); // Add all components with loop override that aren't already LOOP_DONE // Some components (like logger) may call disable_loop() during initialization diff --git a/esphome/core/application.h b/esphome/core/application.h index 1f22499051..6e7f1b49f2 100644 --- a/esphome/core/application.h +++ b/esphome/core/application.h @@ -102,9 +102,15 @@ class Application { arch_init(); this->name_add_mac_suffix_ = name_add_mac_suffix; if (name_add_mac_suffix) { - const std::string mac_suffix = get_mac_address().substr(6); - this->name_ = name + "-" + mac_suffix; - this->friendly_name_ = friendly_name.empty() ? "" : friendly_name + " " + mac_suffix; + // MAC address suffix length (last 6 characters of 12-char MAC address string) + constexpr size_t mac_address_suffix_len = 6; + const std::string mac_addr = get_mac_address(); + // Use pointer + offset to avoid substr() allocation + const char *mac_suffix_ptr = mac_addr.c_str() + mac_address_suffix_len; + this->name_ = make_name_with_suffix(name, '-', mac_suffix_ptr, mac_address_suffix_len); + if (!friendly_name.empty()) { + this->friendly_name_ = make_name_with_suffix(friendly_name, ' ', mac_suffix_ptr, mac_address_suffix_len); + } } else { this->name_ = name; this->friendly_name_ = friendly_name; @@ -472,7 +478,7 @@ class Application { // - When a component is enabled, it's swapped with the first inactive component // and active_end_ is incremented // - This eliminates branch mispredictions from flag checking in the hot loop - std::vector looping_components_{}; + FixedVector looping_components_{}; #ifdef USE_SOCKET_SELECT_SUPPORT std::vector socket_fds_; // Vector of all monitored socket file descriptors #endif diff --git a/esphome/core/base_automation.h b/esphome/core/base_automation.h index ba942e5e43..f1248e0035 100644 --- a/esphome/core/base_automation.h +++ b/esphome/core/base_automation.h @@ -7,6 +7,7 @@ #include "esphome/core/preferences.h" #include "esphome/core/scheduler.h" #include "esphome/core/application.h" +#include "esphome/core/helpers.h" #include @@ -14,7 +15,7 @@ namespace esphome { template class AndCondition : public Condition { public: - explicit AndCondition(const std::vector *> &conditions) : conditions_(conditions) {} + explicit AndCondition(std::initializer_list *> conditions) : conditions_(conditions) {} bool check(Ts... x) override { for (auto *condition : this->conditions_) { if (!condition->check(x...)) @@ -25,12 +26,12 @@ template class AndCondition : public Condition { } protected: - std::vector *> conditions_; + FixedVector *> conditions_; }; template class OrCondition : public Condition { public: - explicit OrCondition(const std::vector *> &conditions) : conditions_(conditions) {} + explicit OrCondition(std::initializer_list *> conditions) : conditions_(conditions) {} bool check(Ts... x) override { for (auto *condition : this->conditions_) { if (condition->check(x...)) @@ -41,7 +42,7 @@ template class OrCondition : public Condition { } protected: - std::vector *> conditions_; + FixedVector *> conditions_; }; template class NotCondition : public Condition { @@ -55,7 +56,7 @@ template class NotCondition : public Condition { template class XorCondition : public Condition { public: - explicit XorCondition(const std::vector *> &conditions) : conditions_(conditions) {} + explicit XorCondition(std::initializer_list *> conditions) : conditions_(conditions) {} bool check(Ts... x) override { size_t result = 0; for (auto *condition : this->conditions_) { @@ -66,7 +67,7 @@ template class XorCondition : public Condition { } protected: - std::vector *> conditions_; + FixedVector *> conditions_; }; template class LambdaCondition : public Condition { diff --git a/esphome/core/config.py b/esphome/core/config.py index 7bf7f82a8b..8a5876dbcf 100644 --- a/esphome/core/config.py +++ b/esphome/core/config.py @@ -200,7 +200,7 @@ CONFIG_SCHEMA = cv.All( cv.Schema( { cv.Required(CONF_NAME): cv.valid_name, - cv.Optional(CONF_FRIENDLY_NAME, ""): cv.string, + cv.Optional(CONF_FRIENDLY_NAME, ""): cv.All(cv.string, cv.Length(max=120)), cv.Optional(CONF_AREA): validate_area_config, cv.Optional(CONF_COMMENT): cv.string, cv.Required(CONF_BUILD_PATH): cv.string, diff --git a/esphome/core/defines.h b/esphome/core/defines.h index 0f1d1bcf28..1afb296fc0 100644 --- a/esphome/core/defines.h +++ b/esphome/core/defines.h @@ -83,6 +83,7 @@ #define USE_LVGL_TILEVIEW #define USE_LVGL_TOUCHSCREEN #define USE_MDNS +#define USE_MDNS_STORE_SERVICES #define MDNS_SERVICE_COUNT 3 #define MDNS_DYNAMIC_TXT_COUNT 3 #define USE_MEDIA_PLAYER @@ -175,6 +176,13 @@ #define USE_ESP32_BLE_SERVER_DESCRIPTOR_ON_WRITE #define USE_ESP32_BLE_SERVER_ON_CONNECT #define USE_ESP32_BLE_SERVER_ON_DISCONNECT +#define ESPHOME_ESP32_BLE_TRACKER_LISTENER_COUNT 1 +#define ESPHOME_ESP32_BLE_TRACKER_CLIENT_COUNT 1 +#define ESPHOME_ESP32_BLE_GAP_EVENT_HANDLER_COUNT 2 +#define ESPHOME_ESP32_BLE_GAP_SCAN_EVENT_HANDLER_COUNT 1 +#define ESPHOME_ESP32_BLE_GATTC_EVENT_HANDLER_COUNT 1 +#define ESPHOME_ESP32_BLE_GATTS_EVENT_HANDLER_COUNT 1 +#define ESPHOME_ESP32_BLE_BLE_STATUS_EVENT_HANDLER_COUNT 2 #define USE_ESP32_CAMERA_JPEG_ENCODER #define USE_I2C #define USE_IMPROV @@ -191,9 +199,10 @@ #define USE_WEBSERVER_PORT 80 // NOLINT #define USE_WEBSERVER_SORTING #define USE_WIFI_11KV_SUPPORT +#define USB_HOST_MAX_REQUESTS 16 #ifdef USE_ARDUINO -#define USE_ARDUINO_VERSION_CODE VERSION_CODE(3, 2, 1) +#define USE_ARDUINO_VERSION_CODE VERSION_CODE(3, 3, 2) #define USE_ETHERNET #define USE_ETHERNET_KSZ8081 #endif diff --git a/esphome/core/entity_helpers.py b/esphome/core/entity_helpers.py index e1b2a8264b..f0a04b4860 100644 --- a/esphome/core/entity_helpers.py +++ b/esphome/core/entity_helpers.py @@ -246,12 +246,15 @@ def entity_duplicate_validator(platform: str) -> Callable[[ConfigType], ConfigTy "\n to distinguish them" ) - raise cv.Invalid( - f"Duplicate {platform} entity with name '{entity_name}' found{device_prefix}. " - f"{conflict_msg}. " - "Each entity on a device must have a unique name within its platform." - f"{sanitized_msg}" - ) + # Skip duplicate entity name validation when testing_mode is enabled + # This flag is used for grouped component testing + if not CORE.testing_mode: + raise cv.Invalid( + f"Duplicate {platform} entity with name '{entity_name}' found{device_prefix}. " + f"{conflict_msg}. " + "Each entity on a device must have a unique name within its platform." + f"{sanitized_msg}" + ) # Store metadata about this entity entity_metadata: EntityMetadata = { diff --git a/esphome/core/helpers.cpp b/esphome/core/helpers.cpp index a46f944385..aa94528e15 100644 --- a/esphome/core/helpers.cpp +++ b/esphome/core/helpers.cpp @@ -235,6 +235,30 @@ std::string str_sprintf(const char *fmt, ...) { return str; } +// Maximum size for name with suffix: 120 (max friendly name) + 1 (separator) + 6 (MAC suffix) + 1 (null term) +static constexpr size_t MAX_NAME_WITH_SUFFIX_SIZE = 128; + +std::string make_name_with_suffix(const std::string &name, char sep, const char *suffix_ptr, size_t suffix_len) { + char buffer[MAX_NAME_WITH_SUFFIX_SIZE]; + size_t name_len = name.size(); + size_t total_len = name_len + 1 + suffix_len; + + // Silently truncate if needed: prioritize keeping the full suffix + if (total_len >= MAX_NAME_WITH_SUFFIX_SIZE) { + // NOTE: This calculation could underflow if suffix_len >= MAX_NAME_WITH_SUFFIX_SIZE - 2, + // but this is safe because this helper is only called with small suffixes: + // MAC suffixes (6-12 bytes), ".local" (5 bytes), etc. + name_len = MAX_NAME_WITH_SUFFIX_SIZE - suffix_len - 2; // -2 for separator and null terminator + total_len = name_len + 1 + suffix_len; + } + + memcpy(buffer, name.c_str(), name_len); + buffer[name_len] = sep; + memcpy(buffer + name_len + 1, suffix_ptr, suffix_len); + buffer[total_len] = '\0'; + return std::string(buffer, total_len); +} + // Parsing & formatting size_t parse_hex(const char *str, size_t length, uint8_t *data, size_t count) { diff --git a/esphome/core/helpers.h b/esphome/core/helpers.h index b3e2ab79cf..88fb600d95 100644 --- a/esphome/core/helpers.h +++ b/esphome/core/helpers.h @@ -162,6 +162,159 @@ template class StaticVector { const_reverse_iterator rend() const { return const_reverse_iterator(begin()); } }; +/// Fixed-capacity vector - allocates once at runtime, never reallocates +/// This avoids std::vector template overhead (_M_realloc_insert, _M_default_append) +/// when size is known at initialization but not at compile time +template class FixedVector { + private: + T *data_{nullptr}; + size_t size_{0}; + size_t capacity_{0}; + + // Helper to destroy all elements without freeing memory + void destroy_elements_() { + // Only call destructors for non-trivially destructible types + if constexpr (!std::is_trivially_destructible::value) { + for (size_t i = 0; i < size_; i++) { + data_[i].~T(); + } + } + } + + // Helper to destroy elements and free memory + void cleanup_() { + if (data_ != nullptr) { + destroy_elements_(); + // Free raw memory + ::operator delete(data_); + } + } + + // Helper to reset pointers after cleanup + void reset_() { + data_ = nullptr; + capacity_ = 0; + size_ = 0; + } + + public: + FixedVector() = default; + + /// Constructor from initializer list - allocates exact size needed + /// This enables brace initialization: FixedVector v = {1, 2, 3}; + FixedVector(std::initializer_list init_list) { + init(init_list.size()); + size_t idx = 0; + for (const auto &item : init_list) { + new (data_ + idx) T(item); + ++idx; + } + size_ = init_list.size(); + } + + ~FixedVector() { cleanup_(); } + + // Disable copy operations (avoid accidental expensive copies) + FixedVector(const FixedVector &) = delete; + FixedVector &operator=(const FixedVector &) = delete; + + // Enable move semantics (allows use in move-only containers like std::vector) + FixedVector(FixedVector &&other) noexcept : data_(other.data_), size_(other.size_), capacity_(other.capacity_) { + other.reset_(); + } + + FixedVector &operator=(FixedVector &&other) noexcept { + if (this != &other) { + // Delete our current data + cleanup_(); + // Take ownership of other's data + data_ = other.data_; + size_ = other.size_; + capacity_ = other.capacity_; + // Leave other in valid empty state + other.reset_(); + } + return *this; + } + + // Allocate capacity - can be called multiple times to reinit + void init(size_t n) { + cleanup_(); + reset_(); + if (n > 0) { + // Allocate raw memory without calling constructors + // sizeof(T) is correct here for any type T (value types, pointers, etc.) + // NOLINTNEXTLINE(bugprone-sizeof-expression) + data_ = static_cast(::operator new(n * sizeof(T))); + capacity_ = n; + } + } + + // Clear the vector (destroy all elements, reset size to 0, keep capacity) + void clear() { + destroy_elements_(); + size_ = 0; + } + + // Shrink capacity to fit current size (frees all memory) + void shrink_to_fit() { + cleanup_(); + reset_(); + } + + /// Add element without bounds checking + /// Caller must ensure sufficient capacity was allocated via init() + /// Silently ignores pushes beyond capacity (no exception or assertion) + void push_back(const T &value) { + if (size_ < capacity_) { + // Use placement new to construct the object in pre-allocated memory + new (&data_[size_]) T(value); + size_++; + } + } + + /// Add element by move without bounds checking + /// Caller must ensure sufficient capacity was allocated via init() + /// Silently ignores pushes beyond capacity (no exception or assertion) + void push_back(T &&value) { + if (size_ < capacity_) { + // Use placement new to move-construct the object in pre-allocated memory + new (&data_[size_]) T(std::move(value)); + size_++; + } + } + + /// Emplace element without bounds checking - constructs in-place + /// Caller must ensure sufficient capacity was allocated via init() + /// Returns reference to the newly constructed element + /// NOTE: Caller MUST ensure size_ < capacity_ before calling + T &emplace_back() { + // Use placement new to default-construct the object in pre-allocated memory + new (&data_[size_]) T(); + size_++; + return data_[size_ - 1]; + } + + /// Access last element (no bounds checking - matches std::vector behavior) + /// Caller must ensure vector is not empty (size() > 0) + T &back() { return data_[size_ - 1]; } + const T &back() const { return data_[size_ - 1]; } + + size_t size() const { return size_; } + bool empty() const { return size_ == 0; } + + /// Access element without bounds checking (matches std::vector behavior) + /// Caller must ensure index is valid (i < size()) + T &operator[](size_t i) { return data_[i]; } + const T &operator[](size_t i) const { return data_[i]; } + + // Iterator support for range-based for loops + T *begin() { return data_; } + T *end() { return data_ + size_; } + const T *begin() const { return data_; } + const T *end() const { return data_ + size_; } +}; + ///@} /// @name Mathematics @@ -309,6 +462,16 @@ std::string __attribute__((format(printf, 1, 3))) str_snprintf(const char *fmt, /// sprintf-like function returning std::string. std::string __attribute__((format(printf, 1, 2))) str_sprintf(const char *fmt, ...); +/// Concatenate a name with a separator and suffix using an efficient stack-based approach. +/// This avoids multiple heap allocations during string construction. +/// Maximum name length supported is 120 characters for friendly names. +/// @param name The base name string +/// @param sep The separator character (e.g., '-', ' ', or '.') +/// @param suffix_ptr Pointer to the suffix characters +/// @param suffix_len Length of the suffix +/// @return The concatenated string: name + sep + suffix +std::string make_name_with_suffix(const std::string &name, char sep, const char *suffix_ptr, size_t suffix_len); + ///@} /// @name Parsing & formatting diff --git a/esphome/espota2.py b/esphome/espota2.py index 2712d00127..17a1da8235 100644 --- a/esphome/espota2.py +++ b/esphome/espota2.py @@ -410,7 +410,7 @@ def run_ota_impl_( af, socktype, _, _, sa = r _LOGGER.info("Connecting to %s port %s...", sa[0], sa[1]) sock = socket.socket(af, socktype) - sock.settimeout(10.0) + sock.settimeout(20.0) try: sock.connect(sa) except OSError as err: diff --git a/esphome/pins.py b/esphome/pins.py index 4f9b4859a1..601c05880a 100644 --- a/esphome/pins.py +++ b/esphome/pins.py @@ -118,11 +118,11 @@ class PinRegistry(dict): parent_config = fconf.get_config_for_path(parent_path) final_val_fun(pin_config, parent_config) allow_others = pin_config.get(CONF_ALLOW_OTHER_USES, False) - if count != 1 and not allow_others: + if count != 1 and not allow_others and not CORE.testing_mode: raise cv.Invalid( f"Pin {pin_config[CONF_NUMBER]} is used in multiple places" ) - if count == 1 and allow_others: + if count == 1 and allow_others and not CORE.testing_mode: raise cv.Invalid( f"Pin {pin_config[CONF_NUMBER]} incorrectly sets {CONF_ALLOW_OTHER_USES}: true" ) diff --git a/esphome/platformio_api.py b/esphome/platformio_api.py index a5a6411c2b..a4b5b432fd 100644 --- a/esphome/platformio_api.py +++ b/esphome/platformio_api.py @@ -43,6 +43,35 @@ def patch_structhash(): cli.clean_build_dir = patched_clean_build_dir +def patch_file_downloader(): + """Patch PlatformIO's FileDownloader to retry on PackageException errors.""" + from platformio.package.download import FileDownloader + from platformio.package.exception import PackageException + + original_init = FileDownloader.__init__ + + def patched_init(self, *args: Any, **kwargs: Any) -> None: + max_retries = 3 + + for attempt in range(max_retries): + try: + return original_init(self, *args, **kwargs) + except PackageException as e: + if attempt < max_retries - 1: + _LOGGER.warning( + "Package download failed: %s. Retrying... (attempt %d/%d)", + str(e), + attempt + 1, + max_retries, + ) + else: + # Final attempt - re-raise + raise + return None + + FileDownloader.__init__ = patched_init + + IGNORE_LIB_WARNINGS = f"(?:{'|'.join(['Hash', 'Update'])})" FILTER_PLATFORMIO_LINES = [ r"Verbose mode can be enabled via `-v, --verbose` option.*", @@ -100,6 +129,7 @@ def run_platformio_cli(*args, **kwargs) -> str | int: import platformio.__main__ patch_structhash() + patch_file_downloader() return run_external_command(platformio.__main__.main, *cmd, **kwargs) diff --git a/esphome/writer.py b/esphome/writer.py index b5cfd9b667..8eee445cf1 100644 --- a/esphome/writer.py +++ b/esphome/writer.py @@ -15,6 +15,8 @@ from esphome.const import ( from esphome.core import CORE, EsphomeError from esphome.helpers import ( copy_file_if_changed, + get_str_env, + is_ha_addon, read_file, walk_files, write_file_if_changed, @@ -338,16 +340,21 @@ def clean_build(): def clean_all(configuration: list[str]): import shutil - # Clean entire build dir - for dir in configuration: - build_dir = Path(dir) / ".esphome" - if build_dir.is_dir(): - _LOGGER.info("Cleaning %s", build_dir) - # Don't remove storage as it will cause the dashboard to regenerate all configs - for item in build_dir.iterdir(): - if item.is_file(): + data_dirs = [Path(dir) / ".esphome" for dir in configuration] + if is_ha_addon(): + data_dirs.append(Path("/data")) + if "ESPHOME_DATA_DIR" in os.environ: + data_dirs.append(Path(get_str_env("ESPHOME_DATA_DIR", None))) + + # Clean build dir + for dir in data_dirs: + if dir.is_dir(): + _LOGGER.info("Cleaning %s", dir) + # Don't remove storage or .json files which are needed by the dashboard + for item in dir.iterdir(): + if item.is_file() and not item.name.endswith(".json"): item.unlink() - elif item.name != "storage" and item.is_dir(): + elif item.is_dir() and item.name != "storage": shutil.rmtree(item) # Clean PlatformIO project files diff --git a/netlify.toml b/netlify.toml index 7783414a91..5f177e6b3a 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,3 +1,4 @@ [build] command = "script/build-api-docs" publish = "api-docs" + environment = { PYTHON_VERSION = "3.13" } diff --git a/platformio.ini b/platformio.ini index 44b466a2b3..6b2a8657bb 100644 --- a/platformio.ini +++ b/platformio.ini @@ -125,9 +125,9 @@ extra_scripts = post:esphome/components/esp8266/post_build.py.script ; This are common settings for the ESP32 (all variants) using Arduino. [common:esp32-arduino] extends = common:arduino -platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.zip +platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.31-1/platform-espressif32.zip platform_packages = - pioarduino/framework-arduinoespressif32@https://github.com/espressif/arduino-esp32/releases/download/3.2.1/esp32-3.2.1.zip + pioarduino/framework-arduinoespressif32@https://github.com/espressif/arduino-esp32/releases/download/3.3.2/esp32-3.3.2.zip framework = arduino, espidf ; Arduino as an ESP-IDF component lib_deps = @@ -161,9 +161,9 @@ extra_scripts = post:esphome/components/esp32/post_build.py.script ; This are common settings for the ESP32 (all variants) using IDF. [common:esp32-idf] extends = common:idf -platform = https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.zip +platform = https://github.com/pioarduino/platform-espressif32/releases/download/55.03.31-1/platform-espressif32.zip platform_packages = - pioarduino/framework-espidf@https://github.com/pioarduino/esp-idf/releases/download/v5.4.2/esp-idf-v5.4.2.zip + pioarduino/framework-espidf@https://github.com/pioarduino/esp-idf/releases/download/v5.5.1/esp-idf-v5.5.1.zip framework = espidf lib_deps = diff --git a/requirements.txt b/requirements.txt index 8cc2b4ed45..b6e4a189d1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -11,22 +11,18 @@ pyserial==3.5 platformio==6.1.18 # When updating platformio, also update /docker/Dockerfile esptool==5.1.0 click==8.1.7 -esphome-dashboard==20251009.0 -aioesphomeapi==41.13.0 +esphome-dashboard==20251013.0 +aioesphomeapi==41.18.0 zeroconf==0.148.0 puremagic==1.30 ruamel.yaml==0.18.15 # dashboard_import -ruamel.yaml.clib==0.2.12 # dashboard_import +ruamel.yaml.clib==0.2.14 # dashboard_import esphome-glyphsets==0.2.0 -pillow==10.4.0 +pillow==11.3.0 cairosvg==2.8.2 freetype-py==2.5.1 jinja2==3.1.6 -# esp-idf requires this, but doesn't bundle it by default -# https://github.com/espressif/esp-idf/blob/220590d599e134d7a5e7f1e683cc4550349ffbf8/requirements.txt#L24 -kconfiglib==13.7.1 - # esp-idf >= 5.0 requires this pyparsing >= 3.0 diff --git a/requirements_test.txt b/requirements_test.txt index 51b8e6f8ed..56ac775a94 100644 --- a/requirements_test.txt +++ b/requirements_test.txt @@ -1,4 +1,4 @@ -pylint==3.3.9 +pylint==4.0.1 flake8==7.3.0 # also change in .pre-commit-config.yaml when updating ruff==0.14.0 # also change in .pre-commit-config.yaml when updating pyupgrade==3.21.0 # also change in .pre-commit-config.yaml when updating diff --git a/script/analyze_component_buses.py b/script/analyze_component_buses.py new file mode 100755 index 0000000000..24854178a0 --- /dev/null +++ b/script/analyze_component_buses.py @@ -0,0 +1,525 @@ +#!/usr/bin/env python3 +"""Analyze component test files to detect which common bus configs they use. + +This script scans component test files and extracts which common bus configurations +(i2c, spi, uart, etc.) are included via the packages mechanism. This information +is used to group components that can be tested together. + +Components can only be grouped together if they use the EXACT SAME set of common +bus configurations, ensuring that merged configs are compatible. + +Example output: +{ + "component1": { + "esp32-ard": ["i2c", "uart_19200"], + "esp32-idf": ["i2c", "uart_19200"] + }, + "component2": { + "esp32-ard": ["spi"], + "esp32-idf": ["spi"] + } +} +""" + +from __future__ import annotations + +import argparse +from functools import lru_cache +import json +from pathlib import Path +import re +import sys +from typing import Any + +# Add esphome to path +sys.path.insert(0, str(Path(__file__).parent.parent)) + +from esphome import yaml_util +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 +} + +# Bus types that can be defined directly in config files +# Components defining these directly cannot be grouped (they create unique bus IDs) +DIRECT_BUS_TYPES = ("i2c", "spi", "uart", "modbus") + +# Signature for components with no bus requirements +# These components can be merged with any other group +NO_BUSES_SIGNATURE = "no_buses" + +# Base bus components - these ARE the bus implementations and should not +# be flagged as needing migration since they are the platform/base components +BASE_BUS_COMPONENTS = { + "i2c", + "spi", + "uart", + "modbus", + "canbus", +} + +# 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 +ISOLATED_COMPONENTS = { + "animation": "Has display lambda in common.yaml that requires existing display platform - breaks when merged without display", + "esphome": "Defines devices/areas in esphome: section that are referenced in other sections - breaks when merged", + "ethernet": "Defines ethernet: which conflicts with wifi: used by most components", + "ethernet_info": "Related to ethernet component which conflicts with wifi", + "lvgl": "Defines multiple SDL displays on host platform that conflict when merged with other display configs", + "openthread": "Conflicts with wifi: used by most components", + "openthread_info": "Conflicts with wifi: used by most components", + "matrix_keypad": "Needs isolation due to keypad", + "mcp4725": "no YAML config to specify i2c bus id", + "mcp47a1": "no YAML config to specify i2c bus id", + "modbus_controller": "Defines multiple modbus buses for testing client/server functionality - conflicts with package modbus bus", + "neopixelbus": "RMT type conflict with ESP32 Arduino/ESP-IDF headers (enum vs struct rmt_channel_t)", + "packages": "cannot merge packages", +} + + +@lru_cache(maxsize=1) +def get_common_bus_packages() -> frozenset[str]: + """Get the list of common bus package names. + + Reads from tests/test_build_components/common/ directory + and caches the result. All bus types support component grouping + for config validation since --testing-mode bypasses runtime conflicts. + + Returns: + Frozenset of common bus package names (i2c, spi, uart, etc.) + """ + if not COMMON_BUS_PATH.exists(): + return frozenset() + + # List all directories in common/ - these are the bus package names + return frozenset(d.name for d in COMMON_BUS_PATH.iterdir() if d.is_dir()) + + +def uses_local_file_references(component_dir: Path) -> bool: + """Check if a component uses local file references via $component_dir. + + Components that reference local files cannot be grouped because each needs + a unique component_dir path pointing to their specific directory. + + Args: + component_dir: Path to the component's test directory + + Returns: + True if the component uses $component_dir for local file references + """ + common_yaml = component_dir / "common.yaml" + if not common_yaml.exists(): + return False + + try: + content = common_yaml.read_text() + except Exception: # pylint: disable=broad-exception-caught + return False + + # Pattern to match $component_dir or ${component_dir} references + # These indicate local file usage that prevents grouping + return bool(re.search(r"\$\{?component_dir\}?", content)) + + +def is_platform_component(component_dir: Path) -> bool: + """Check if a component is a platform component (abstract base class). + + Platform components have IS_PLATFORM_COMPONENT = True and cannot be + instantiated without a platform-specific implementation. These components + define abstract methods and cause linker errors if compiled standalone. + + Examples: canbus, mcp23x08_base, mcp23x17_base + + Args: + component_dir: Path to the component's test directory + + Returns: + True if this is a platform component + """ + # Check in the actual component source, not tests + # tests/components/X -> tests/components -> tests -> repo root + repo_root = component_dir.parent.parent.parent + comp_init = ( + repo_root / "esphome" / "components" / component_dir.name / "__init__.py" + ) + + if not comp_init.exists(): + return False + + try: + content = comp_init.read_text() + return "IS_PLATFORM_COMPONENT = True" in content + except Exception: # pylint: disable=broad-exception-caught + return False + + +def _contains_extend_or_remove(data: Any) -> bool: + """Recursively check if data contains Extend or Remove objects. + + Args: + data: Parsed YAML data structure + + Returns: + True if any Extend or Remove objects are found + """ + if isinstance(data, (Extend, Remove)): + return True + + if isinstance(data, dict): + for value in data.values(): + if _contains_extend_or_remove(value): + return True + + if isinstance(data, list): + for item in data: + if _contains_extend_or_remove(item): + return True + + return False + + +def analyze_yaml_file(yaml_file: Path) -> dict[str, Any]: + """Load a YAML file once and extract all needed information. + + This loads the YAML file a single time and extracts all information needed + for component analysis, avoiding multiple file reads. + + Args: + yaml_file: Path to the YAML file to analyze + + Returns: + Dictionary with keys: + - buses: set of common bus package names + - has_extend_remove: bool indicating if Extend/Remove objects are present + - has_direct_bus_config: bool indicating if buses are defined directly (not via packages) + - loaded: bool indicating if file was successfully loaded + """ + result = { + "buses": set(), + "has_extend_remove": False, + "has_direct_bus_config": False, + "loaded": False, + } + + if not yaml_file.exists(): + return result + + try: + data = yaml_util.load_yaml(yaml_file) + result["loaded"] = True + except Exception: # pylint: disable=broad-exception-caught + return result + + # Check for Extend/Remove objects + result["has_extend_remove"] = _contains_extend_or_remove(data) + + # Check if buses are defined directly (not via packages) + # Components that define i2c, spi, uart, or modbus directly in test files + # cannot be grouped because they create unique bus IDs + if isinstance(data, dict): + for bus_type in DIRECT_BUS_TYPES: + if bus_type in data: + result["has_direct_bus_config"] = True + break + + # Extract common bus packages + if not isinstance(data, dict) or "packages" not in data: + return result + + packages = data["packages"] + if not isinstance(packages, dict): + return result + + valid_buses = get_common_bus_packages() + for pkg_name in packages: + if pkg_name not in valid_buses: + continue + result["buses"].add(pkg_name) + # Add any package dependencies (e.g., modbus includes uart) + if pkg_name not in PACKAGE_DEPENDENCIES: + continue + for dep in PACKAGE_DEPENDENCIES[pkg_name]: + if dep not in valid_buses: + continue + result["buses"].add(dep) + + return result + + +def analyze_component(component_dir: Path) -> tuple[dict[str, list[str]], bool, bool]: + """Analyze a component directory to find which buses each platform uses. + + Args: + component_dir: Path to the component's test directory + + Returns: + Tuple of: + - Dictionary mapping platform to list of bus configs + Example: {"esp32-ard": ["i2c", "spi"], "esp32-idf": ["i2c"]} + - Boolean indicating if component uses !extend or !remove + - Boolean indicating if component defines buses directly (not via packages) + """ + if not component_dir.is_dir(): + return {}, False, False + + platform_buses = {} + has_extend_remove = False + has_direct_bus_config = False + + # Analyze all YAML files in the component directory + for yaml_file in component_dir.glob("*.yaml"): + analysis = analyze_yaml_file(yaml_file) + + # Track if any file uses extend/remove + if analysis["has_extend_remove"]: + has_extend_remove = True + + # Track if any file defines buses directly + if analysis["has_direct_bus_config"]: + has_direct_bus_config = True + + # For test.*.yaml files, extract platform and buses + if yaml_file.name.startswith("test.") and yaml_file.suffix == ".yaml": + # Extract platform name (e.g., test.esp32-ard.yaml -> esp32-ard) + platform = yaml_file.stem.replace("test.", "") + # Always add platform, even if it has no buses (empty list) + # This allows grouping components that don't use any shared buses + platform_buses[platform] = ( + sorted(analysis["buses"]) if analysis["buses"] else [] + ) + + return platform_buses, has_extend_remove, has_direct_bus_config + + +def analyze_all_components( + tests_dir: Path = None, +) -> tuple[dict[str, dict[str, list[str]]], set[str], set[str]]: + """Analyze all component test directories. + + Args: + tests_dir: Path to tests/components directory (defaults to auto-detect) + + Returns: + Tuple of: + - Dictionary mapping component name to platform->buses mapping + - Set of component names that cannot be grouped + - Set of component names that define buses directly (need migration warning) + """ + if tests_dir is None: + tests_dir = Path("tests/components") + + if not tests_dir.exists(): + print(f"Error: {tests_dir} does not exist", file=sys.stderr) + return {}, set(), set() + + components = {} + non_groupable = set() + direct_bus_components = set() + + for component_dir in sorted(tests_dir.iterdir()): + if not component_dir.is_dir(): + continue + + component_name = component_dir.name + platform_buses, has_extend_remove, has_direct_bus_config = analyze_component( + component_dir + ) + + if platform_buses: + components[component_name] = platform_buses + + # Note: Components using $component_dir are now groupable because the merge + # script rewrites these to absolute paths with component-specific substitutions + + # Check if component is explicitly isolated + # These have known issues that prevent grouping with other components + if component_name in ISOLATED_COMPONENTS: + non_groupable.add(component_name) + + # Check if component is a base bus component + # These ARE the bus platform implementations and define buses directly for testing + # They cannot be grouped with components that use bus packages (causes ID conflicts) + if component_name in BASE_BUS_COMPONENTS: + non_groupable.add(component_name) + + # Check if component uses !extend or !remove directives + # These rely on specific config structure and cannot be merged with other components + # The directives work within a component's own package hierarchy but break when + # merging independent components together + if has_extend_remove: + non_groupable.add(component_name) + + # Check if component defines buses directly in test files + # These create unique bus IDs and cause conflicts when merged + # Exclude base bus components (i2c, spi, uart, etc.) since they ARE the platform + if has_direct_bus_config and component_name not in BASE_BUS_COMPONENTS: + non_groupable.add(component_name) + direct_bus_components.add(component_name) + + return components, non_groupable, direct_bus_components + + +def create_grouping_signature( + platform_buses: dict[str, list[str]], platform: str +) -> str: + """Create a signature string for grouping components. + + Components with the same signature can be grouped together for testing. + All valid bus types can be grouped since --testing-mode bypasses runtime + conflicts during config validation. + + Args: + platform_buses: Mapping of platform to list of buses + platform: The specific platform to create signature for + + Returns: + Signature string (e.g., "i2c" or "uart") or empty if no valid buses + """ + buses = platform_buses.get(platform, []) + if not buses: + return "" + + # Only include valid bus types in signature + common_buses = get_common_bus_packages() + valid_buses = [b for b in buses if b in common_buses] + if not valid_buses: + return "" + + return "+".join(sorted(valid_buses)) + + +def group_components_by_signature( + components: dict[str, dict[str, list[str]]], platform: str +) -> dict[str, list[str]]: + """Group components by their bus signature for a specific platform. + + Args: + components: Component analysis results from analyze_all_components() + platform: Platform to group for (e.g., "esp32-ard") + + Returns: + Dictionary mapping signature to list of component names + Example: {"i2c+uart_19200": ["comp1", "comp2"], "spi": ["comp3"]} + """ + signature_groups: dict[str, list[str]] = {} + + for component_name, platform_buses in components.items(): + if platform not in platform_buses: + continue + + signature = create_grouping_signature(platform_buses, platform) + if not signature: + continue + + if signature not in signature_groups: + signature_groups[signature] = [] + signature_groups[signature].append(component_name) + + return signature_groups + + +def main() -> None: + """Main entry point.""" + parser = argparse.ArgumentParser( + description="Analyze component test files to detect common bus usage" + ) + parser.add_argument( + "--components", + "-c", + nargs="+", + help="Specific components to analyze (default: all)", + ) + parser.add_argument( + "--platform", + "-p", + help="Show grouping for a specific platform", + ) + parser.add_argument( + "--json", + action="store_true", + help="Output as JSON", + ) + parser.add_argument( + "--group", + action="store_true", + help="Show component groupings by bus signature", + ) + + args = parser.parse_args() + + # Analyze components + tests_dir = Path("tests/components") + + if args.components: + # Analyze only specified components + components = {} + non_groupable = set() + direct_bus_components = set() + for comp in args.components: + comp_dir = tests_dir / comp + platform_buses, has_extend_remove, has_direct_bus_config = ( + analyze_component(comp_dir) + ) + if platform_buses: + components[comp] = platform_buses + # Note: Components using $component_dir are now groupable + if comp in ISOLATED_COMPONENTS: + non_groupable.add(comp) + if comp in BASE_BUS_COMPONENTS: + non_groupable.add(comp) + if has_direct_bus_config and comp not in BASE_BUS_COMPONENTS: + non_groupable.add(comp) + direct_bus_components.add(comp) + else: + # Analyze all components + components, non_groupable, direct_bus_components = analyze_all_components( + tests_dir + ) + + # Output results + if args.group and args.platform: + # Show groupings for a specific platform + groups = group_components_by_signature(components, args.platform) + + if args.json: + print(json.dumps(groups, indent=2)) + else: + print(f"Component groupings for {args.platform}:") + print() + for signature, comp_list in sorted(groups.items()): + print(f" {signature}:") + for comp in sorted(comp_list): + print(f" - {comp}") + print() + elif args.json: + # JSON output + print(json.dumps(components, indent=2)) + else: + # Human-readable output + for component, platform_buses in sorted(components.items()): + non_groupable_marker = ( + " [NON-GROUPABLE]" if component in non_groupable else "" + ) + print(f"{component}{non_groupable_marker}:") + for platform, buses in sorted(platform_buses.items()): + bus_str = ", ".join(buses) + print(f" {platform}: {bus_str}") + print() + print(f"Total components analyzed: {len(components)}") + if non_groupable: + print(f"Non-groupable components (use local files): {len(non_groupable)}") + for comp in sorted(non_groupable): + print(f" - {comp}") + + +if __name__ == "__main__": + main() diff --git a/script/api_protobuf/api_protobuf.py b/script/api_protobuf/api_protobuf.py index 487c187372..9a55f1d136 100755 --- a/script/api_protobuf/api_protobuf.py +++ b/script/api_protobuf/api_protobuf.py @@ -1415,6 +1415,8 @@ class RepeatedTypeInfo(TypeInfo): # Check if this is a pointer field by looking for container_pointer option self._container_type = get_field_opt(field, pb.container_pointer, "") self._use_pointer = bool(self._container_type) + # Check if this should use FixedVector instead of std::vector + self._use_fixed_vector = get_field_opt(field, pb.fixed_vector, False) # For repeated fields, we need to get the base type info # but we can't call create_field_type_info as it would cause recursion @@ -1438,6 +1440,8 @@ class RepeatedTypeInfo(TypeInfo): if "<" in self._container_type and ">" in self._container_type: return f"const {self._container_type}*" return f"const {self._container_type}<{self._ti.cpp_type}>*" + if self._use_fixed_vector: + return f"FixedVector<{self._ti.cpp_type}>" return f"std::vector<{self._ti.cpp_type}>" @property diff --git a/script/ci-custom.py b/script/ci-custom.py index bc1ebda93b..6b01623d92 100755 --- a/script/ci-custom.py +++ b/script/ci-custom.py @@ -501,7 +501,7 @@ def lint_constants_usage(): continue errs.append( f"Constant {highlight(constant)} is defined in {len(uses)} files. Please move all definitions of the " - f"constant to const.py (Uses: {', '.join(uses)}) in a separate PR. " + f"constant to const.py (Uses: {', '.join(str(u) for u in uses)}) in a separate PR. " "See https://developers.esphome.io/contributing/code/#python" ) return errs diff --git a/script/determine-jobs.py b/script/determine-jobs.py index e26bc29c2f..b000ecee3b 100755 --- a/script/determine-jobs.py +++ b/script/determine-jobs.py @@ -31,6 +31,7 @@ Options: from __future__ import annotations import argparse +from functools import cache import json import os from pathlib import Path @@ -45,7 +46,6 @@ from helpers import ( changed_files, get_all_dependencies, get_components_from_integration_fixtures, - parse_list_components_output, root_path, ) @@ -212,6 +212,24 @@ def _any_changed_file_endswith(branch: str | None, extensions: tuple[str, ...]) return any(file.endswith(extensions) for file in changed_files(branch)) +@cache +def _component_has_tests(component: str) -> bool: + """Check if a component has test files. + + Cached to avoid repeated filesystem operations for the same component. + + Args: + component: Component name to check + + Returns: + True if the component has test YAML files + """ + tests_dir = Path(root_path) / "tests" / "components" / component + if not tests_dir.exists(): + return False + return any(tests_dir.glob("test.*.yaml")) + + def main() -> None: """Main function that determines which CI jobs to run.""" parser = argparse.ArgumentParser( @@ -228,14 +246,38 @@ def main() -> None: run_clang_format = should_run_clang_format(args.branch) run_python_linters = should_run_python_linters(args.branch) - # Get changed components using list-components.py for exact compatibility + # Get both directly changed and all changed components (with dependencies) in one call script_path = Path(__file__).parent / "list-components.py" - cmd = [sys.executable, str(script_path), "--changed"] + cmd = [sys.executable, str(script_path), "--changed-with-deps"] if args.branch: cmd.extend(["-b", args.branch]) result = subprocess.run(cmd, capture_output=True, text=True, check=True) - changed_components = parse_list_components_output(result.stdout) + component_data = json.loads(result.stdout) + directly_changed_components = component_data["directly_changed"] + changed_components = component_data["all_changed"] + + # Filter to only components that have test files + # Components without tests shouldn't generate CI test jobs + changed_components_with_tests = [ + component for component in changed_components if _component_has_tests(component) + ] + + # Get directly changed components with tests (for isolated testing) + # These will be tested WITHOUT --testing-mode in CI to enable full validation + # (pin conflicts, etc.) since they contain the actual changes being reviewed + directly_changed_with_tests = [ + component + for component in directly_changed_components + if _component_has_tests(component) + ] + + # Get dependency-only components (for grouped testing) + dependency_only_components = [ + component + for component in changed_components_with_tests + if component not in directly_changed_components + ] # Build output output: dict[str, Any] = { @@ -244,7 +286,12 @@ def main() -> None: "clang_format": run_clang_format, "python_linters": run_python_linters, "changed_components": changed_components, - "component_test_count": len(changed_components), + "changed_components_with_tests": changed_components_with_tests, + "directly_changed_components_with_tests": directly_changed_with_tests, + "dependency_only_components_with_tests": dependency_only_components, + "component_test_count": len(changed_components_with_tests), + "directly_changed_count": len(directly_changed_with_tests), + "dependency_only_count": len(dependency_only_components), } # Output as JSON diff --git a/script/list-components.py b/script/list-components.py index 9ab1cdd852..dffff6801a 100755 --- a/script/list-components.py +++ b/script/list-components.py @@ -185,18 +185,32 @@ def main(): "-c", "--changed", action="store_true", - help="List all components required for testing based on changes", + help="List all components required for testing based on changes (includes dependencies)", + ) + parser.add_argument( + "--changed-direct", + action="store_true", + help="List only directly changed components (without dependencies)", + ) + parser.add_argument( + "--changed-with-deps", + action="store_true", + help="Output JSON with both directly changed and all changed components", ) parser.add_argument( "-b", "--branch", help="Branch to compare changed files against" ) args = parser.parse_args() - if args.branch and not args.changed: - parser.error("--branch requires --changed") + if args.branch and not ( + args.changed or args.changed_direct or args.changed_with_deps + ): + parser.error( + "--branch requires --changed, --changed-direct, or --changed-with-deps" + ) - if args.changed: - # When --changed is passed, only get the changed files + if args.changed or args.changed_direct or args.changed_with_deps: + # When --changed* is passed, only get the changed files changed = changed_files(args.branch) # If any base test file(s) changed, there's no need to filter out components @@ -210,8 +224,25 @@ def main(): # Get all component files files = get_all_component_files() - for c in get_components(files, args.changed): - print(c) + if args.changed_with_deps: + # Return JSON with both directly changed and all changed components + import json + + directly_changed = get_components(files, False) + all_changed = get_components(files, True) + output = { + "directly_changed": directly_changed, + "all_changed": all_changed, + } + print(json.dumps(output)) + elif args.changed_direct: + # Return only directly changed components (without dependencies) + for c in get_components(files, False): + print(c) + else: + # Return all changed components (with dependencies) - default behavior + for c in get_components(files, args.changed): + print(c) if __name__ == "__main__": diff --git a/script/merge_component_configs.py b/script/merge_component_configs.py new file mode 100755 index 0000000000..a19b65038c --- /dev/null +++ b/script/merge_component_configs.py @@ -0,0 +1,379 @@ +#!/usr/bin/env python3 +"""Merge multiple component test configurations into a single test file. + +This script combines multiple component test files that use the same common bus +configurations into a single merged test file. This allows testing multiple +compatible components together, reducing CI build time. + +The merger handles: +- Component-specific substitutions (prefixing to avoid conflicts) +- Multiple instances of component configurations +- Shared common bus packages (included only once) +- Platform-specific configurations +- Uses ESPHome's built-in merge_config for proper YAML merging +""" + +from __future__ import annotations + +import argparse +from pathlib import Path +import re +import sys +from typing import Any + +# Add esphome to path so we can import from it +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 PACKAGE_DEPENDENCIES, get_common_bus_packages + + +def load_yaml_file(yaml_file: Path) -> dict: + """Load YAML file using ESPHome's YAML loader. + + Args: + yaml_file: Path to the YAML file + + Returns: + Parsed YAML as dictionary + """ + if not yaml_file.exists(): + raise FileNotFoundError(f"YAML file not found: {yaml_file}") + + return yaml_util.load_yaml(yaml_file) + + +def extract_packages_from_yaml(data: dict) -> dict[str, str]: + """Extract COMMON BUS package includes from parsed YAML. + + Only extracts packages that are from test_build_components/common/, + ignoring component-specific packages. + + Args: + data: Parsed YAML dictionary + + Returns: + Dictionary mapping package name to include path (as string representation) + Only includes common bus packages (i2c, spi, uart, etc.) + """ + if "packages" not in data: + return {} + + packages_value = data["packages"] + if not isinstance(packages_value, dict): + # List format doesn't include common bus packages (those use dict format) + return {} + + # Get common bus package names (cached) + common_bus_packages = get_common_bus_packages() + packages = {} + + # Dictionary format: packages: {name: value} + for name, value in packages_value.items(): + # Only include common bus packages, ignore component-specific ones + if name not in common_bus_packages: + continue + packages[name] = str(value) + # Also track package dependencies (e.g., modbus includes uart) + if name not in PACKAGE_DEPENDENCIES: + continue + for dep in PACKAGE_DEPENDENCIES[name]: + if dep not in common_bus_packages: + continue + # Mark as included via dependency + packages[f"_dep_{dep}"] = f"(included via {name})" + + return packages + + +def prefix_substitutions_in_dict( + data: Any, prefix: str, exclude: set[str] | None = None +) -> Any: + """Recursively prefix all substitution references in a data structure. + + Args: + data: YAML data structure (dict, list, or scalar) + prefix: Prefix to add to substitution names + exclude: Set of substitution names to exclude from prefixing + + Returns: + Data structure with prefixed substitution references + """ + if exclude is None: + exclude = set() + + def replace_sub(text: str) -> str: + """Replace substitution references in a string.""" + + def replace_match(match): + sub_name = match.group(1) + if sub_name in exclude: + return match.group(0) + # Always use braced format in output for consistency + return f"${{{prefix}_{sub_name}}}" + + # Match both ${substitution} and $substitution formats + return re.sub(r"\$\{?(\w+)\}?", replace_match, text) + + if isinstance(data, dict): + result = {} + for key, value in data.items(): + result[key] = prefix_substitutions_in_dict(value, prefix, exclude) + return result + if isinstance(data, list): + return [prefix_substitutions_in_dict(item, prefix, exclude) for item in data] + if isinstance(data, str): + return replace_sub(data) + return data + + +def deduplicate_by_id(data: dict) -> dict: + """Deduplicate list items with the same ID. + + Keeps only the first occurrence of each ID. If items with the same ID + are identical, this silently deduplicates. If they differ, the first + one is kept (ESPHome's validation will catch if this causes issues). + + Args: + data: Parsed config dictionary + + Returns: + Config with deduplicated lists + """ + if not isinstance(data, dict): + return data + + result = {} + for key, value in data.items(): + if isinstance(value, list): + # Check for items with 'id' field + seen_ids = set() + deduped_list = [] + + for item in value: + if isinstance(item, dict) and "id" in item: + item_id = item["id"] + if item_id not in seen_ids: + seen_ids.add(item_id) + deduped_list.append(item) + # else: skip duplicate ID (keep first occurrence) + else: + # No ID, just add it + deduped_list.append(item) + + result[key] = deduped_list + elif isinstance(value, dict): + # Recursively deduplicate nested dicts + result[key] = deduplicate_by_id(value) + else: + result[key] = value + + return result + + +def merge_component_configs( + component_names: list[str], + platform: str, + tests_dir: Path, + output_file: Path, +) -> None: + """Merge multiple component test configs into a single file. + + Args: + component_names: List of component names to merge + platform: Platform to merge for (e.g., "esp32-ard") + tests_dir: Path to tests/components directory + output_file: Path to output merged config file + """ + if not component_names: + raise ValueError("No components specified") + + # Track packages to ensure they're identical + all_packages = None + + # Start with empty config + merged_config_data = {} + + # Process each component + for comp_name in component_names: + comp_dir = tests_dir / comp_name + test_file = comp_dir / f"test.{platform}.yaml" + + if not test_file.exists(): + raise FileNotFoundError(f"Test file not found: {test_file}") + + # Load the component's test file + comp_data = load_yaml_file(test_file) + + # Validate packages are compatible + # Components with no packages (no_buses) can merge with any group + comp_packages = extract_packages_from_yaml(comp_data) + + if all_packages is None: + # First component - set the baseline + all_packages = comp_packages + elif not comp_packages: + # This component has no packages (no_buses) - it can merge with any group + pass + elif not all_packages: + # Previous components had no packages, but this one does - adopt these packages + all_packages = comp_packages + elif comp_packages != all_packages: + # Both have packages but they differ - this is an error + raise ValueError( + f"Component {comp_name} has different packages than previous components. " + f"Expected: {all_packages}, Got: {comp_packages}. " + f"All components must use the same common bus configs to be merged." + ) + + # Handle $component_dir by replacing with absolute path + # This allows components that use local file references to be grouped + comp_abs_dir = str(comp_dir.absolute()) + + # Save top-level substitutions BEFORE expanding packages + # In ESPHome, top-level substitutions override package substitutions + top_level_subs = ( + comp_data["substitutions"].copy() + if "substitutions" in comp_data and comp_data["substitutions"] is not None + else {} + ) + + # Expand packages - but we'll restore substitution priority after + if "packages" in comp_data: + packages_value = comp_data["packages"] + + if isinstance(packages_value, dict): + # Dict format - check each package + common_bus_packages = get_common_bus_packages() + for pkg_name, pkg_value in list(packages_value.items()): + if pkg_name in common_bus_packages: + continue + if not isinstance(pkg_value, dict): + continue + # Component-specific package - expand its content into top level + comp_data = merge_config(comp_data, pkg_value) + elif isinstance(packages_value, list): + # List format - expand all package includes + for pkg_value in packages_value: + if not isinstance(pkg_value, dict): + continue + comp_data = merge_config(comp_data, pkg_value) + + # Remove all packages (common will be re-added at the end) + del comp_data["packages"] + + # Restore top-level substitution priority + # Top-level substitutions override any from packages + if "substitutions" not in comp_data or comp_data["substitutions"] is None: + comp_data["substitutions"] = {} + + # Merge: package subs as base, top-level subs override + comp_data["substitutions"].update(top_level_subs) + + # Now prefix the final merged substitutions + comp_data["substitutions"] = { + f"{comp_name}_{sub_name}": sub_value + for sub_name, sub_value in comp_data["substitutions"].items() + } + + # Add component_dir substitution with absolute path for this component + comp_data["substitutions"][f"{comp_name}_component_dir"] = comp_abs_dir + + # Prefix substitution references throughout the config + comp_data = prefix_substitutions_in_dict(comp_data, comp_name) + + # Use ESPHome's merge_config to merge this component into the result + # merge_config handles list merging with ID-based deduplication automatically + merged_config_data = merge_config(merged_config_data, comp_data) + + # Add packages back (only once, since they're identical) + # IMPORTANT: Only re-add common bus packages (spi, i2c, uart, etc.) + # Do NOT re-add component-specific packages as they contain unprefixed $component_dir refs + if all_packages: + first_comp_data = load_yaml_file( + tests_dir / component_names[0] / f"test.{platform}.yaml" + ) + if "packages" in first_comp_data and isinstance( + first_comp_data["packages"], dict + ): + # Filter to only include common bus packages + # Only dict format can contain common bus packages + common_bus_packages = get_common_bus_packages() + filtered_packages = { + name: value + for name, value in first_comp_data["packages"].items() + if name in common_bus_packages + } + if filtered_packages: + merged_config_data["packages"] = filtered_packages + + # Deduplicate items with same ID (keeps first occurrence) + merged_config_data = deduplicate_by_id(merged_config_data) + + # Remove esphome section since it will be provided by the wrapper file + # The wrapper file includes this merged config via packages and provides + # the proper esphome: section with name, platform, etc. + if "esphome" in merged_config_data: + del merged_config_data["esphome"] + + # Write merged config + output_file.parent.mkdir(parents=True, exist_ok=True) + yaml_content = yaml_util.dump(merged_config_data) + output_file.write_text(yaml_content) + + print(f"Successfully merged {len(component_names)} components into {output_file}") + + +def main() -> None: + """Main entry point.""" + parser = argparse.ArgumentParser( + description="Merge multiple component test configs into a single file" + ) + parser.add_argument( + "--components", + "-c", + required=True, + help="Comma-separated list of component names to merge", + ) + parser.add_argument( + "--platform", + "-p", + required=True, + help="Platform to merge for (e.g., esp32-ard)", + ) + parser.add_argument( + "--output", + "-o", + required=True, + type=Path, + help="Output file path for merged config", + ) + parser.add_argument( + "--tests-dir", + type=Path, + default=Path("tests/components"), + help="Path to tests/components directory", + ) + + args = parser.parse_args() + + component_names = [c.strip() for c in args.components.split(",")] + + try: + merge_component_configs( + component_names=component_names, + platform=args.platform, + tests_dir=args.tests_dir, + output_file=args.output, + ) + except Exception as e: + print(f"Error merging configs: {e}", file=sys.stderr) + import traceback + + traceback.print_exc() + sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/script/split_components_for_ci.py b/script/split_components_for_ci.py new file mode 100755 index 0000000000..9730db4988 --- /dev/null +++ b/script/split_components_for_ci.py @@ -0,0 +1,315 @@ +#!/usr/bin/env python3 +"""Split components into batches with intelligent grouping. + +This script analyzes components to identify which ones share common bus configurations +and intelligently groups them into batches to maximize the efficiency of the +component grouping system in CI. + +Components with the same bus signature are placed in the same batch whenever possible, +allowing the test_build_components.py script to merge them into single builds. +""" + +from __future__ import annotations + +import argparse +from collections import defaultdict +import json +from pathlib import Path +import sys + +# Add esphome to path +sys.path.insert(0, str(Path(__file__).parent.parent)) + +from script.analyze_component_buses import ( + ISOLATED_COMPONENTS, + NO_BUSES_SIGNATURE, + analyze_all_components, + create_grouping_signature, +) + +# Weighting for batch creation +# Isolated components can't be grouped/merged, so they count as 10x +# Groupable components can be merged into single builds, so they count as 1x +ISOLATED_WEIGHT = 10 +GROUPABLE_WEIGHT = 1 + + +def has_test_files(component_name: str, tests_dir: Path) -> bool: + """Check if a component has test files. + + Args: + component_name: Name of the component + tests_dir: Path to tests/components directory + + Returns: + True if the component has test.*.yaml files + """ + component_dir = tests_dir / component_name + if not component_dir.exists() or not component_dir.is_dir(): + return False + + # Check for test.*.yaml files + return any(component_dir.glob("test.*.yaml")) + + +def create_intelligent_batches( + components: list[str], + tests_dir: Path, + batch_size: int = 40, + directly_changed: set[str] | None = None, +) -> list[list[str]]: + """Create batches optimized for component grouping. + + Args: + components: List of component names to batch + tests_dir: Path to tests/components directory + batch_size: Target size for each batch + directly_changed: Set of directly changed components (for logging only) + + Returns: + List of component batches (lists of component names) + """ + # Filter out components without test files + # Platform components like 'climate' and 'climate_ir' don't have test files + components_with_tests = [ + comp for comp in components if has_test_files(comp, tests_dir) + ] + + # Log filtered components to stderr for debugging + if len(components_with_tests) < len(components): + filtered_out = set(components) - set(components_with_tests) + print( + f"Note: Filtered {len(filtered_out)} components without test files: " + f"{', '.join(sorted(filtered_out))}", + file=sys.stderr, + ) + + # Analyze all components to get their bus signatures + component_buses, non_groupable, _direct_bus_components = analyze_all_components( + tests_dir + ) + + # Group components by their bus signature ONLY (ignore platform) + # All platforms will be tested by test_build_components.py for each batch + # Key: signature, Value: list of components + signature_groups: dict[str, list[str]] = defaultdict(list) + + for component in components_with_tests: + # Components that can't be grouped get unique signatures + # This includes: + # - Manually curated ISOLATED_COMPONENTS + # - Automatically detected non_groupable components + # - Directly changed components (passed via --isolate in CI) + # These can share a batch/runner but won't be grouped/merged + is_isolated = ( + component in ISOLATED_COMPONENTS + or component in non_groupable + or (directly_changed and component in directly_changed) + ) + if is_isolated: + signature_groups[f"isolated_{component}"].append(component) + continue + + # Get signature from any platform (they should all have the same buses) + # Components not in component_buses were filtered out by has_test_files check + comp_platforms = component_buses[component] + for platform, buses in comp_platforms.items(): + if buses: + signature = create_grouping_signature({platform: buses}, platform) + # Group by signature only - platform doesn't matter for batching + signature_groups[signature].append(component) + break # Only use first platform for grouping + else: + # No buses found for any platform - can be grouped together + signature_groups[NO_BUSES_SIGNATURE].append(component) + + # Create batches by keeping signature groups together + # Components with the same signature stay in the same batches + batches = [] + + # Sort signature groups to prioritize groupable components + # 1. Put "isolated_*" signatures last (can't be grouped with others) + # 2. Sort groupable signatures by size (largest first) + # 3. "no_buses" components CAN be grouped together + def sort_key(item): + signature, components = item + is_isolated = signature.startswith("isolated_") + # Put "isolated_*" last (1), groupable first (0) + # Within each category, sort by size (largest first) + return (is_isolated, -len(components)) + + sorted_groups = sorted(signature_groups.items(), key=sort_key) + + # Strategy: Create batches using weighted sizes + # - Isolated components count as 10x (since they can't be grouped/merged) + # - Groupable components count as 1x (can be merged into single builds) + # - This distributes isolated components across more runners + # - Ensures each runner has a good mix of groupable vs isolated components + + current_batch = [] + current_weight = 0 + + for signature, group_components in sorted_groups: + is_isolated = signature.startswith("isolated_") + weight_per_component = ISOLATED_WEIGHT if is_isolated else GROUPABLE_WEIGHT + + for component in group_components: + # Check if adding this component would exceed the batch size + if current_weight + weight_per_component > batch_size and current_batch: + # Start a new batch + batches.append(current_batch) + current_batch = [] + current_weight = 0 + + # Add component to current batch + current_batch.append(component) + current_weight += weight_per_component + + # Don't forget the last batch + if current_batch: + batches.append(current_batch) + + return batches + + +def main() -> int: + """Main entry point.""" + parser = argparse.ArgumentParser( + description="Split components into intelligent batches for CI testing" + ) + parser.add_argument( + "--components", + "-c", + required=True, + help="JSON array of component names", + ) + parser.add_argument( + "--batch-size", + "-b", + type=int, + default=40, + help="Target batch size (default: 40, weighted)", + ) + parser.add_argument( + "--tests-dir", + type=Path, + default=Path("tests/components"), + help="Path to tests/components directory", + ) + parser.add_argument( + "--directly-changed", + help="JSON array of directly changed component names (for logging only)", + ) + parser.add_argument( + "--output", + "-o", + choices=["json", "github"], + default="github", + help="Output format (json or github for GitHub Actions)", + ) + + args = parser.parse_args() + + # Parse component list from JSON + try: + components = json.loads(args.components) + except json.JSONDecodeError as e: + print(f"Error parsing components JSON: {e}", file=sys.stderr) + return 1 + + if not isinstance(components, list): + print("Components must be a JSON array", file=sys.stderr) + return 1 + + # Parse directly changed components list from JSON (if provided) + directly_changed = None + if args.directly_changed: + try: + directly_changed = set(json.loads(args.directly_changed)) + except json.JSONDecodeError as e: + print(f"Error parsing directly-changed JSON: {e}", file=sys.stderr) + return 1 + + # Create intelligent batches + batches = create_intelligent_batches( + components=components, + tests_dir=args.tests_dir, + batch_size=args.batch_size, + directly_changed=directly_changed, + ) + + # Convert batches to space-separated strings for CI + batch_strings = [" ".join(batch) for batch in batches] + + if args.output == "json": + # Output as JSON array + print(json.dumps(batch_strings)) + else: + # Output for GitHub Actions (set output) + output_json = json.dumps(batch_strings) + print(f"components={output_json}") + + # Print summary to stderr so it shows in CI logs + # Count actual components being batched + actual_components = sum(len(batch.split()) for batch in batch_strings) + + # Re-analyze to get isolated component counts for summary + _, non_groupable, _ = analyze_all_components(args.tests_dir) + + # Count isolated vs groupable components + all_batched_components = [comp for batch in batches for comp in batch] + isolated_count = sum( + 1 + for comp in all_batched_components + if comp in ISOLATED_COMPONENTS + or comp in non_groupable + or (directly_changed and comp in directly_changed) + ) + groupable_count = actual_components - isolated_count + + print("\n=== Intelligent Batch Summary ===", file=sys.stderr) + print(f"Total components requested: {len(components)}", file=sys.stderr) + print(f"Components with test files: {actual_components}", file=sys.stderr) + + # Show breakdown of directly changed vs dependencies + if directly_changed: + direct_count = sum( + 1 for comp in all_batched_components if comp in directly_changed + ) + dep_count = actual_components - direct_count + direct_comps = [ + comp for comp in all_batched_components if comp in directly_changed + ] + dep_comps = [ + comp for comp in all_batched_components if comp not in directly_changed + ] + print( + f" - Direct changes: {direct_count} ({', '.join(sorted(direct_comps))})", + file=sys.stderr, + ) + print( + f" - Dependencies: {dep_count} ({', '.join(sorted(dep_comps))})", + file=sys.stderr, + ) + + print(f" - Groupable (weight=1): {groupable_count}", file=sys.stderr) + print(f" - Isolated (weight=10): {isolated_count}", file=sys.stderr) + if actual_components < len(components): + print( + f"Components skipped (no test files): {len(components) - actual_components}", + file=sys.stderr, + ) + print(f"Number of batches: {len(batches)}", file=sys.stderr) + print(f"Batch size target (weighted): {args.batch_size}", file=sys.stderr) + if len(batches) > 0: + print( + f"Average components per batch: {actual_components / len(batches):.1f}", + file=sys.stderr, + ) + print(file=sys.stderr) + + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/script/test_build_components b/script/test_build_components deleted file mode 100755 index 3796280176..0000000000 --- a/script/test_build_components +++ /dev/null @@ -1,106 +0,0 @@ -#!/usr/bin/env bash - -set -e - -help() { - echo "Usage: $0 [-e ] [-c ] [-t ]" 1>&2 - echo 1>&2 - echo " - e - Parameter for esphome command. Default compile. Common alternative is config." 1>&2 - echo " - c - Component folder name to test. Default *. E.g. '-c logger'." 1>&2 - echo " - t - Target name to test. Put '-t list' to display all possibilities. E.g. '-t esp32-s2-idf-51'." 1>&2 - exit 1 -} - -# Parse parameter: -# - `e` - Parameter for `esphome` command. Default `compile`. Common alternative is `config`. -# - `c` - Component folder name to test. Default `*`. -esphome_command="compile" -target_component="*" -while getopts e:c:t: flag -do - case $flag in - e) esphome_command=${OPTARG};; - c) target_component=${OPTARG};; - t) requested_target_platform=${OPTARG};; - \?) help;; - esac -done - -cd "$(dirname "$0")/.." - -if ! [ -d "./tests/test_build_components/build" ]; then - mkdir ./tests/test_build_components/build -fi - -start_esphome() { - if [ -n "$requested_target_platform" ] && [ "$requested_target_platform" != "$target_platform_with_version" ]; then - echo "Skipping $target_platform_with_version" - return - fi - # create dynamic yaml file in `build` folder. - # `./tests/test_build_components/build/[target_component].[test_name].[target_platform_with_version].yaml` - component_test_file="./tests/test_build_components/build/$target_component.$test_name.$target_platform_with_version.yaml" - - cp $target_platform_file $component_test_file - if [[ "$OSTYPE" == "darwin"* ]]; then - # macOS sed is...different - sed -i '' "s!\$component_test_file!../../.$f!g" $component_test_file - else - sed -i "s!\$component_test_file!../../.$f!g" $component_test_file - fi - - # Start esphome process - echo "> [$target_component] [$test_name] [$target_platform_with_version]" - set -x - # TODO: Validate escape of Command line substitution value - python3 -m esphome -s component_name $target_component -s component_dir ../../components/$target_component -s test_name $test_name -s target_platform $target_platform $esphome_command $component_test_file - { set +x; } 2>/dev/null -} - -# Find all test yaml files. -# - `./tests/components/[target_component]/[test_name].[target_platform].yaml` -# - `./tests/components/[target_component]/[test_name].all.yaml` -for f in ./tests/components/$target_component/*.*.yaml; do - [ -f "$f" ] || continue - IFS='/' read -r -a folder_name <<< "$f" - target_component="${folder_name[3]}" - - IFS='.' read -r -a file_name <<< "${folder_name[4]}" - test_name="${file_name[0]}" - target_platform="${file_name[1]}" - file_name_parts=${#file_name[@]} - - if [ "$target_platform" = "all" ] || [ $file_name_parts = 2 ]; then - # Test has *not* defined a specific target platform. Need to run tests for all possible target platforms. - - for target_platform_file in ./tests/test_build_components/build_components_base.*.yaml; do - IFS='/' read -r -a folder_name <<< "$target_platform_file" - IFS='.' read -r -a file_name <<< "${folder_name[3]}" - target_platform="${file_name[1]}" - - start_esphome - done - - else - # Test has defined a specific target platform. - - # Validate we have a base test yaml for selected platform. - # The target_platform is sourced from the following location. - # 1. `./tests/test_build_components/build_components_base.[target_platform].yaml` - # 2. `./tests/test_build_components/build_components_base.[target_platform]-ard.yaml` - target_platform_file="./tests/test_build_components/build_components_base.$target_platform.yaml" - if ! [ -f "$target_platform_file" ]; then - echo "No base test file [./tests/test_build_components/build_components_base.$target_platform.yaml] for component test [$f] found." - exit 1 - fi - - for target_platform_file in ./tests/test_build_components/build_components_base.$target_platform*.yaml; do - # trim off "./tests/test_build_components/build_components_base." prefix - target_platform_with_version=${target_platform_file:52} - # ...now remove suffix starting with "." leaving just the test target hardware and software platform (possibly with version) - # For example: "esp32-s3-idf-50" - target_platform_with_version=${target_platform_with_version%.*} - start_esphome - done - fi -done diff --git a/script/test_build_components b/script/test_build_components new file mode 120000 index 0000000000..832a4a72c6 --- /dev/null +++ b/script/test_build_components @@ -0,0 +1 @@ +test_build_components.py \ No newline at end of file diff --git a/script/test_build_components.py b/script/test_build_components.py new file mode 100755 index 0000000000..14fc10977c --- /dev/null +++ b/script/test_build_components.py @@ -0,0 +1,975 @@ +#!/usr/bin/env python3 +"""Test ESPHome component builds with intelligent grouping. + +This script replaces the bash test_build_components script with Python, +adding support for intelligent component grouping based on shared bus +configurations to reduce CI build time. + +Features: +- Analyzes components for shared common bus configs +- Groups compatible components together +- Merges configs for grouped components +- Uses --testing-mode for grouped tests +- Maintains backward compatibility with single component testing +""" + +from __future__ import annotations + +import argparse +from collections import defaultdict +import hashlib +import os +from pathlib import Path +import subprocess +import sys + +# Add esphome to path +sys.path.insert(0, str(Path(__file__).parent.parent)) + +# pylint: disable=wrong-import-position +from script.analyze_component_buses import ( + BASE_BUS_COMPONENTS, + ISOLATED_COMPONENTS, + NO_BUSES_SIGNATURE, + analyze_all_components, + create_grouping_signature, + is_platform_component, + uses_local_file_references, +) +from script.merge_component_configs import merge_component_configs + +# Platform-specific maximum group sizes +# ESP8266 has limited IRAM and can't handle large component groups +PLATFORM_MAX_GROUP_SIZE = { + "esp8266-ard": 10, # ESP8266 Arduino has limited IRAM + "esp8266-idf": 10, # ESP8266 IDF also has limited IRAM + # BK72xx now uses BK7252 board (1.62MB flash vs 1.03MB) - no limit needed + # Other platforms can handle larger groups +} + + +def show_disk_space_if_ci(esphome_command: str) -> None: + """Show disk space usage if running in CI during compile. + + Args: + esphome_command: The esphome command being run (config/compile/clean) + """ + if os.environ.get("GITHUB_ACTIONS") and esphome_command == "compile": + print("\n" + "=" * 80) + print("Disk Space After Build:") + print("=" * 80) + subprocess.run(["df", "-h"], check=False) + print("=" * 80 + "\n") + + +def find_component_tests( + components_dir: Path, component_pattern: str = "*" +) -> dict[str, list[Path]]: + """Find all component test files. + + Args: + components_dir: Path to tests/components directory + component_pattern: Glob pattern for component names + + Returns: + Dictionary mapping component name to list of test files + """ + component_tests = defaultdict(list) + + for comp_dir in components_dir.glob(component_pattern): + if not comp_dir.is_dir(): + continue + + for test_file in comp_dir.glob("test.*.yaml"): + component_tests[comp_dir.name].append(test_file) + + return dict(component_tests) + + +def parse_test_filename(test_file: Path) -> tuple[str, str]: + """Parse test filename to extract test name and platform. + + Args: + test_file: Path to test file + + Returns: + Tuple of (test_name, platform) + """ + parts = test_file.stem.split(".") + if len(parts) == 2: + return parts[0], parts[1] # test, platform + return parts[0], "all" + + +def get_platform_base_files(base_dir: Path) -> dict[str, list[Path]]: + """Get all platform base files. + + Args: + base_dir: Path to test_build_components directory + + Returns: + Dictionary mapping platform to list of base files (for version variants) + """ + platform_files = defaultdict(list) + + for base_file in base_dir.glob("build_components_base.*.yaml"): + # Extract platform from filename + # e.g., build_components_base.esp32-idf.yaml -> esp32-idf + # or build_components_base.esp32-idf-50.yaml -> esp32-idf + filename = base_file.stem + parts = filename.replace("build_components_base.", "").split("-") + + # Platform is everything before version number (if present) + # Check if last part is a number (version) + platform = "-".join(parts[:-1]) if parts[-1].isdigit() else "-".join(parts) + + platform_files[platform].append(base_file) + + return dict(platform_files) + + +def extract_platform_with_version(base_file: Path) -> str: + """Extract platform with version from base filename. + + Args: + base_file: Path to base file + + Returns: + Platform with version (e.g., "esp32-idf-50" or "esp32-idf") + """ + # Remove "build_components_base." prefix and ".yaml" suffix + return base_file.stem.replace("build_components_base.", "") + + +def run_esphome_test( + component: str, + test_file: Path, + platform: str, + platform_with_version: str, + base_file: Path, + build_dir: Path, + esphome_command: str, + continue_on_fail: bool, + use_testing_mode: bool = False, +) -> tuple[bool, str]: + """Run esphome test for a single component. + + Args: + component: Component name + test_file: Path to component test file + platform: Platform name (e.g., "esp32-idf") + platform_with_version: Platform with version (e.g., "esp32-idf-50") + base_file: Path to platform base file + build_dir: Path to build directory + esphome_command: ESPHome command (config/compile) + continue_on_fail: Whether to continue on failure + use_testing_mode: Whether to use --testing-mode flag + + Returns: + Tuple of (success status, command string) + """ + test_name = test_file.stem.split(".")[0] + + # Create dynamic test file in build directory + output_file = build_dir / f"{component}.{test_name}.{platform_with_version}.yaml" + + # Copy base file and substitute component test file reference + base_content = base_file.read_text() + # Get relative path from build dir to test file + repo_root = Path(__file__).parent.parent + component_test_ref = f"../../{test_file.relative_to(repo_root / 'tests')}" + output_content = base_content.replace("$component_test_file", component_test_ref) + output_file.write_text(output_content) + + # Build esphome command + cmd = [ + sys.executable, + "-m", + "esphome", + ] + + # Add --testing-mode if needed (must be before subcommand) + if use_testing_mode: + cmd.append("--testing-mode") + + # Add substitutions + cmd.extend( + [ + "-s", + "component_name", + component, + "-s", + "component_dir", + f"../../components/{component}", + "-s", + "test_name", + test_name, + "-s", + "target_platform", + platform, + ] + ) + + # Add command and config file + cmd.extend([esphome_command, str(output_file)]) + + # Build command string for display/logging + cmd_str = " ".join(cmd) + + # Run command + print(f"> [{component}] [{test_name}] [{platform_with_version}]") + if use_testing_mode: + print(" (using --testing-mode)") + + try: + result = subprocess.run(cmd, check=False) + success = result.returncode == 0 + + # Show disk space after build in CI during compile + show_disk_space_if_ci(esphome_command) + + if not success and not continue_on_fail: + # Print command immediately for failed tests + print(f"\n{'=' * 80}") + print("FAILED - Command to reproduce:") + print(f"{'=' * 80}") + print(cmd_str) + print() + raise subprocess.CalledProcessError(result.returncode, cmd) + return success, cmd_str + except subprocess.CalledProcessError: + # Re-raise if we're not continuing on fail + if not continue_on_fail: + raise + return False, cmd_str + + +def run_grouped_test( + components: list[str], + platform: str, + platform_with_version: str, + base_file: Path, + build_dir: Path, + tests_dir: Path, + esphome_command: str, + continue_on_fail: bool, +) -> tuple[bool, str]: + """Run esphome test for a group of components with shared bus configs. + + Args: + components: List of component names to test together + platform: Platform name (e.g., "esp32-idf") + platform_with_version: Platform with version (e.g., "esp32-idf-50") + base_file: Path to platform base file + build_dir: Path to build directory + tests_dir: Path to tests/components directory + esphome_command: ESPHome command (config/compile) + continue_on_fail: Whether to continue on failure + + Returns: + Tuple of (success status, command string) + """ + # Create merged config + group_name = "_".join(components[:3]) # Use first 3 components for name + if len(components) > 3: + group_name += f"_plus_{len(components) - 3}" + + # Create unique device name by hashing sorted component list + platform + # This prevents conflicts when different component groups are tested + sorted_components = sorted(components) + hash_input = "_".join(sorted_components) + "_" + platform + group_hash = hashlib.md5(hash_input.encode()).hexdigest()[:8] + device_name = f"comptest{platform.replace('-', '')}{group_hash}" + + merged_config_file = build_dir / f"merged_{group_name}.{platform_with_version}.yaml" + + try: + merge_component_configs( + component_names=components, + platform=platform_with_version, + tests_dir=tests_dir, + output_file=merged_config_file, + ) + except Exception as e: # pylint: disable=broad-exception-caught + print(f"Error merging configs for {components}: {e}") + if not continue_on_fail: + raise + # Return empty command string since we failed before building the command + return False, f"# Failed during config merge: {e}" + + # Create test file that includes merged config + output_file = build_dir / f"test_{group_name}.{platform_with_version}.yaml" + base_content = base_file.read_text() + merged_ref = merged_config_file.name + output_content = base_content.replace("$component_test_file", merged_ref) + output_file.write_text(output_content) + + # Build esphome command with --testing-mode + cmd = [ + sys.executable, + "-m", + "esphome", + "--testing-mode", # Required for grouped tests + "-s", + "component_name", + device_name, # Use unique hash-based device name + "-s", + "component_dir", + "../../components", + "-s", + "test_name", + "merged", + "-s", + "target_platform", + platform, + esphome_command, + str(output_file), + ] + + # Build command string for display/logging + cmd_str = " ".join(cmd) + + # Run command + components_str = ", ".join(components) + print(f"> [GROUPED: {components_str}] [{platform_with_version}]") + print(" (using --testing-mode)") + + try: + result = subprocess.run(cmd, check=False) + success = result.returncode == 0 + + # Show disk space after build in CI during compile + show_disk_space_if_ci(esphome_command) + + if not success and not continue_on_fail: + # Print command immediately for failed tests + print(f"\n{'=' * 80}") + print("FAILED - Command to reproduce:") + print(f"{'=' * 80}") + print(cmd_str) + print() + raise subprocess.CalledProcessError(result.returncode, cmd) + return success, cmd_str + except subprocess.CalledProcessError: + # Re-raise if we're not continuing on fail + if not continue_on_fail: + raise + return False, cmd_str + + +def run_grouped_component_tests( + all_tests: dict[str, list[Path]], + platform_filter: str | None, + platform_bases: dict[str, list[Path]], + tests_dir: Path, + build_dir: Path, + esphome_command: str, + continue_on_fail: bool, + additional_isolated: set[str] | None = None, +) -> tuple[set[tuple[str, str]], list[str], list[str], dict[str, str]]: + """Run grouped component tests. + + Args: + all_tests: Dictionary mapping component names to test files + platform_filter: Optional platform to filter by + platform_bases: Platform base files mapping + tests_dir: Path to tests/components directory + build_dir: Path to build directory + esphome_command: ESPHome command (config/compile) + continue_on_fail: Whether to continue on failure + additional_isolated: Additional components to treat as isolated (not grouped) + + Returns: + Tuple of (tested_components, passed_tests, failed_tests, failed_commands) + """ + tested_components = set() + passed_tests = [] + failed_tests = [] + failed_commands = {} # Map test_id to command string + + # Group components by platform and bus signature + grouped_components: dict[tuple[str, str], list[str]] = defaultdict(list) + print("\n" + "=" * 80) + print("Analyzing components for intelligent grouping...") + print("=" * 80) + component_buses, non_groupable, direct_bus_components = analyze_all_components( + tests_dir + ) + + # Track why components can't be grouped (for detailed output) + non_groupable_reasons = {} + + # Merge additional isolated components with predefined ones + # ISOLATED COMPONENTS are tested individually WITHOUT --testing-mode + # This is critical because: + # - Grouped tests use --testing-mode which disables pin conflict checks and other validation + # - These checks are disabled to allow config merging (multiple components in one build) + # - For directly changed components (via --isolate), we need full validation to catch issues + # - Dependencies are safe to group since they weren't modified in the PR + all_isolated = set(ISOLATED_COMPONENTS.keys()) + if additional_isolated: + all_isolated.update(additional_isolated) + + # Group by (platform, bus_signature) + for component, platforms in component_buses.items(): + if component not in all_tests: + continue + + # Skip components that must be tested in isolation + # These are shown separately and should not be in non_groupable_reasons + if component in all_isolated: + continue + + # Skip base bus components (these test the bus platforms themselves) + if component in BASE_BUS_COMPONENTS: + continue + + # Skip components that use local file references or direct bus configs + if component in non_groupable: + # Track the reason (using pre-calculated results to avoid expensive re-analysis) + if component not in non_groupable_reasons: + if component in direct_bus_components: + non_groupable_reasons[component] = ( + "Defines buses directly (not via packages) - NEEDS MIGRATION" + ) + elif uses_local_file_references(tests_dir / component): + non_groupable_reasons[component] = ( + "Uses local file references ($component_dir)" + ) + elif is_platform_component(tests_dir / component): + non_groupable_reasons[component] = ( + "Platform component (abstract base class)" + ) + else: + non_groupable_reasons[component] = ( + "Uses !extend or !remove directives" + ) + continue + + for platform, buses in platforms.items(): + # Skip if platform doesn't match filter + if platform_filter and not platform.startswith(platform_filter): + continue + + # Create signature for this component's bus configuration + # Components with no buses get NO_BUSES_SIGNATURE so they can be grouped together + if buses: + signature = create_grouping_signature({platform: buses}, platform) + else: + signature = NO_BUSES_SIGNATURE + + # Add to grouped components (including those with no buses) + if signature: + grouped_components[(platform, signature)].append(component) + + # Print detailed grouping plan + print("\nGrouping Plan:") + print("-" * 80) + + # Show isolated components (must test individually due to known issues or direct changes) + isolated_in_tests = [c for c in all_isolated if c in all_tests] + if isolated_in_tests: + predefined_isolated = [c for c in isolated_in_tests if c in ISOLATED_COMPONENTS] + additional_in_tests = [ + c for c in isolated_in_tests if c in (additional_isolated or set()) + ] + + if predefined_isolated: + print( + f"\n⚠ {len(predefined_isolated)} components must be tested in isolation (known build issues):" + ) + for comp in sorted(predefined_isolated): + reason = ISOLATED_COMPONENTS[comp] + print(f" - {comp}: {reason}") + + if additional_in_tests: + print( + f"\n✓ {len(additional_in_tests)} components tested in isolation (directly changed in PR):" + ) + for comp in sorted(additional_in_tests): + print(f" - {comp}") + + # Show base bus components (test the bus platform implementations) + base_bus_in_tests = [c for c in BASE_BUS_COMPONENTS if c in all_tests] + if base_bus_in_tests: + print( + f"\n○ {len(base_bus_in_tests)} base bus platform components (tested individually):" + ) + for comp in sorted(base_bus_in_tests): + print(f" - {comp}") + + # Show excluded components with detailed reasons + if non_groupable_reasons: + excluded_in_tests = [c for c in non_groupable_reasons if c in all_tests] + if excluded_in_tests: + print( + f"\n⚠ {len(excluded_in_tests)} components excluded from grouping (each needs individual build):" + ) + # Group by reason to show summary + direct_bus = [ + c + for c in excluded_in_tests + if "NEEDS MIGRATION" in non_groupable_reasons.get(c, "") + ] + if direct_bus: + print( + f"\n ⚠⚠⚠ {len(direct_bus)} DEFINE BUSES DIRECTLY - NEED MIGRATION TO PACKAGES:" + ) + for comp in sorted(direct_bus): + print(f" - {comp}") + + other_reasons = [ + c + for c in excluded_in_tests + if "NEEDS MIGRATION" not in non_groupable_reasons.get(c, "") + ] + if other_reasons and len(other_reasons) <= 10: + print("\n Other non-groupable components:") + for comp in sorted(other_reasons): + reason = non_groupable_reasons[comp] + print(f" - {comp}: {reason}") + elif other_reasons: + print( + f"\n Other non-groupable components: {len(other_reasons)} components" + ) + + # Distribute no_buses components into other groups to maximize efficiency + # Components with no buses can merge with any bus group since they have no conflicting requirements + no_buses_by_platform: dict[str, list[str]] = {} + for (platform, signature), components in list(grouped_components.items()): + if signature == NO_BUSES_SIGNATURE: + no_buses_by_platform[platform] = components + # Remove from grouped_components - we'll distribute them + del grouped_components[(platform, signature)] + + # Distribute no_buses components into existing groups for each platform + for platform, no_buses_comps in no_buses_by_platform.items(): + # Find all non-empty groups for this platform (excluding no_buses) + platform_groups = [ + (sig, comps) + for (plat, sig), comps in grouped_components.items() + if plat == platform and sig != NO_BUSES_SIGNATURE + ] + + if platform_groups: + # Distribute no_buses components round-robin across existing groups + for i, comp in enumerate(no_buses_comps): + sig, _ = platform_groups[i % len(platform_groups)] + grouped_components[(platform, sig)].append(comp) + else: + # No other groups for this platform - keep no_buses components together + grouped_components[(platform, NO_BUSES_SIGNATURE)] = no_buses_comps + + # Split groups that exceed platform-specific maximum sizes + # ESP8266 has limited IRAM and can't handle large component groups + split_groups = {} + for (platform, signature), components in list(grouped_components.items()): + max_size = PLATFORM_MAX_GROUP_SIZE.get(platform) + if max_size and len(components) > max_size: + # Split this group into smaller groups + print( + f"\n ℹ️ Splitting {platform} group (signature: {signature}) " + f"from {len(components)} to max {max_size} components per group" + ) + # Remove original group + del grouped_components[(platform, signature)] + # Create split groups + for i in range(0, len(components), max_size): + split_components = components[i : i + max_size] + # Create unique signature for each split group + split_signature = f"{signature}_split{i // max_size + 1}" + split_groups[(platform, split_signature)] = split_components + # Add split groups back + grouped_components.update(split_groups) + + groups_to_test = [] + individual_tests = set() # Use set to avoid duplicates + + for (platform, signature), components in sorted(grouped_components.items()): + if len(components) > 1: + groups_to_test.append((platform, signature, components)) + # Note: Don't add single-component groups to individual_tests here + # They'll be added below when we check for ungrouped components + + # Add components that weren't grouped on any platform + for component in all_tests: + if component not in [c for _, _, comps in groups_to_test for c in comps]: + individual_tests.add(component) + + if groups_to_test: + print(f"\n✓ {len(groups_to_test)} groups will be tested together:") + for platform, signature, components in groups_to_test: + component_list = ", ".join(sorted(components)) + print(f" [{platform}] [{signature}]: {component_list}") + print( + f" → {len(components)} components in 1 build (saves {len(components) - 1} builds)" + ) + + if individual_tests: + print(f"\n○ {len(individual_tests)} components will be tested individually:") + sorted_individual = sorted(individual_tests) + for comp in sorted_individual[:10]: + print(f" - {comp}") + if len(individual_tests) > 10: + print(f" ... and {len(individual_tests) - 10} more") + + # Calculate actual build counts based on test files, not component counts + # Without grouping: every test file would be built separately + total_test_files = sum(len(test_files) for test_files in all_tests.values()) + + # With grouping: + # - 1 build per group (regardless of how many components) + # - Individual components still need all their platform builds + individual_test_file_count = sum( + len(all_tests[comp]) for comp in individual_tests if comp in all_tests + ) + + total_grouped_components = sum(len(comps) for _, _, comps in groups_to_test) + total_builds_with_grouping = len(groups_to_test) + individual_test_file_count + builds_saved = total_test_files - total_builds_with_grouping + + print(f"\n{'=' * 80}") + print( + f"Summary: {total_builds_with_grouping} builds total (vs {total_test_files} without grouping)" + ) + print( + f" • {len(groups_to_test)} grouped builds ({total_grouped_components} components)" + ) + print( + f" • {individual_test_file_count} individual builds ({len(individual_tests)} components)" + ) + if total_test_files > 0: + reduction_pct = (builds_saved / total_test_files) * 100 + print(f" • Saves {builds_saved} builds ({reduction_pct:.1f}% reduction)") + print("=" * 80 + "\n") + + # Execute grouped tests + for (platform, signature), components in grouped_components.items(): + # Only group if we have multiple components with same signature + if len(components) <= 1: + continue + + # Filter out components not in our test list + components_to_group = [c for c in components if c in all_tests] + if len(components_to_group) <= 1: + continue + + # Get platform base files + if platform not in platform_bases: + continue + + for base_file in platform_bases[platform]: + platform_with_version = extract_platform_with_version(base_file) + + # Skip if platform filter doesn't match + if platform_filter and platform != platform_filter: + continue + if ( + platform_filter + and platform_with_version != platform_filter + and not platform_with_version.startswith(f"{platform_filter}-") + ): + continue + + # Run grouped test + success, cmd_str = run_grouped_test( + components=components_to_group, + platform=platform, + platform_with_version=platform_with_version, + base_file=base_file, + build_dir=build_dir, + tests_dir=tests_dir, + esphome_command=esphome_command, + continue_on_fail=continue_on_fail, + ) + + # Mark all components as tested + for comp in components_to_group: + tested_components.add((comp, platform_with_version)) + + # Record result for each component - show all components in grouped tests + test_id = ( + f"GROUPED[{','.join(components_to_group)}].{platform_with_version}" + ) + if success: + passed_tests.append(test_id) + else: + failed_tests.append(test_id) + failed_commands[test_id] = cmd_str + + return tested_components, passed_tests, failed_tests, failed_commands + + +def run_individual_component_test( + component: str, + test_file: Path, + platform: str, + platform_with_version: str, + base_file: Path, + build_dir: Path, + esphome_command: str, + continue_on_fail: bool, + tested_components: set[tuple[str, str]], + passed_tests: list[str], + failed_tests: list[str], + failed_commands: dict[str, str], +) -> None: + """Run an individual component test if not already tested in a group. + + Args: + component: Component name + test_file: Test file path + platform: Platform name + platform_with_version: Platform with version + base_file: Base file for platform + build_dir: Build directory + esphome_command: ESPHome command + continue_on_fail: Whether to continue on failure + tested_components: Set of already tested components + passed_tests: List to append passed test IDs + failed_tests: List to append failed test IDs + failed_commands: Dict to store failed test commands + """ + # Skip if already tested in a group + if (component, platform_with_version) in tested_components: + return + + test_name = test_file.stem.split(".")[0] + success, cmd_str = run_esphome_test( + component=component, + test_file=test_file, + platform=platform, + platform_with_version=platform_with_version, + base_file=base_file, + build_dir=build_dir, + esphome_command=esphome_command, + continue_on_fail=continue_on_fail, + ) + test_id = f"{component}.{test_name}.{platform_with_version}" + if success: + passed_tests.append(test_id) + else: + failed_tests.append(test_id) + failed_commands[test_id] = cmd_str + + +def test_components( + component_patterns: list[str], + platform_filter: str | None, + esphome_command: str, + continue_on_fail: bool, + enable_grouping: bool = True, + isolated_components: set[str] | None = None, +) -> int: + """Test components with optional intelligent grouping. + + Args: + component_patterns: List of component name patterns + platform_filter: Optional platform to filter by + esphome_command: ESPHome command (config/compile) + continue_on_fail: Whether to continue on failure + enable_grouping: Whether to enable component grouping + isolated_components: Set of component names to test in isolation (not grouped). + These are tested WITHOUT --testing-mode to enable full validation + (pin conflicts, etc). This is used in CI for directly changed components + to catch issues that would be missed with --testing-mode. + + Returns: + Exit code (0 for success, 1 for failure) + """ + # Setup paths + repo_root = Path(__file__).parent.parent + tests_dir = repo_root / "tests" / "components" + build_components_dir = repo_root / "tests" / "test_build_components" + build_dir = build_components_dir / "build" + build_dir.mkdir(parents=True, exist_ok=True) + + # Get platform base files + platform_bases = get_platform_base_files(build_components_dir) + + # Find all component tests + all_tests = {} + for pattern in component_patterns: + all_tests.update(find_component_tests(tests_dir, pattern)) + + if not all_tests: + print(f"No components found matching: {component_patterns}") + return 1 + + print(f"Found {len(all_tests)} components to test") + + # Run tests + failed_tests = [] + passed_tests = [] + tested_components = set() # Track which components were tested in groups + failed_commands = {} # Track commands for failed tests + + # First, run grouped tests if grouping is enabled + if enable_grouping: + ( + tested_components, + passed_tests, + failed_tests, + failed_commands, + ) = run_grouped_component_tests( + all_tests=all_tests, + platform_filter=platform_filter, + platform_bases=platform_bases, + tests_dir=tests_dir, + build_dir=build_dir, + esphome_command=esphome_command, + continue_on_fail=continue_on_fail, + additional_isolated=isolated_components, + ) + + # Then run individual tests for components not in groups + for component, test_files in sorted(all_tests.items()): + for test_file in test_files: + test_name, platform = parse_test_filename(test_file) + + # Handle "all" platform tests + if platform == "all": + # Run for all platforms + for plat, base_files in platform_bases.items(): + if platform_filter and plat != platform_filter: + continue + + for base_file in base_files: + platform_with_version = extract_platform_with_version(base_file) + run_individual_component_test( + component=component, + test_file=test_file, + platform=plat, + platform_with_version=platform_with_version, + base_file=base_file, + build_dir=build_dir, + esphome_command=esphome_command, + continue_on_fail=continue_on_fail, + tested_components=tested_components, + passed_tests=passed_tests, + failed_tests=failed_tests, + failed_commands=failed_commands, + ) + else: + # Platform-specific test + if platform_filter and platform != platform_filter: + continue + + if platform not in platform_bases: + print(f"No base file for platform: {platform}") + continue + + for base_file in platform_bases[platform]: + platform_with_version = extract_platform_with_version(base_file) + + # Skip if requested platform doesn't match + if ( + platform_filter + and platform_with_version != platform_filter + and not platform_with_version.startswith(f"{platform_filter}-") + ): + continue + + run_individual_component_test( + component=component, + test_file=test_file, + platform=platform, + platform_with_version=platform_with_version, + base_file=base_file, + build_dir=build_dir, + esphome_command=esphome_command, + continue_on_fail=continue_on_fail, + tested_components=tested_components, + passed_tests=passed_tests, + failed_tests=failed_tests, + failed_commands=failed_commands, + ) + + # Print summary + print("\n" + "=" * 80) + print(f"Test Summary: {len(passed_tests)} passed, {len(failed_tests)} failed") + print("=" * 80) + + if failed_tests: + print("\nFailed tests:") + for test in failed_tests: + print(f" - {test}") + + # Print failed commands at the end for easy copy-paste from CI logs + print("\n" + "=" * 80) + print("Failed test commands (copy-paste to reproduce locally):") + print("=" * 80) + for test in failed_tests: + if test in failed_commands: + print(f"\n# {test}") + print(failed_commands[test]) + print() + + return 1 + + return 0 + + +def main() -> int: + """Main entry point.""" + parser = argparse.ArgumentParser( + description="Test ESPHome component builds with intelligent grouping" + ) + parser.add_argument( + "-e", + "--esphome-command", + default="compile", + choices=["config", "compile", "clean"], + help="ESPHome command to run (default: compile)", + ) + parser.add_argument( + "-c", + "--components", + default="*", + help="Component pattern(s) to test (default: *). Comma-separated.", + ) + parser.add_argument( + "-t", + "--target", + help="Target platform to test (e.g., esp32-idf)", + ) + parser.add_argument( + "-f", + "--continue-on-fail", + action="store_true", + help="Continue testing even if a test fails", + ) + parser.add_argument( + "--no-grouping", + action="store_true", + help="Disable component grouping (test each component individually)", + ) + parser.add_argument( + "--isolate", + help="Comma-separated list of components to test in isolation (not grouped with others). " + "These are tested WITHOUT --testing-mode to enable full validation. " + "Used in CI for directly changed components to catch pin conflicts and other issues.", + ) + + args = parser.parse_args() + + # Parse component patterns + component_patterns = [p.strip() for p in args.components.split(",")] + + # Parse isolated components + isolated_components = None + if args.isolate: + isolated_components = {c.strip() for c in args.isolate.split(",") if c.strip()} + + return test_components( + component_patterns=component_patterns, + platform_filter=args.target, + esphome_command=args.esphome_command, + continue_on_fail=args.continue_on_fail, + enable_grouping=not args.no_grouping, + isolated_components=isolated_components, + ) + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/script/test_component_grouping.py b/script/test_component_grouping.py new file mode 100755 index 0000000000..a2cee6e888 --- /dev/null +++ b/script/test_component_grouping.py @@ -0,0 +1,227 @@ +#!/usr/bin/env python3 +"""Test component grouping by finding and testing groups of components. + +This script analyzes components, finds groups that can be tested together, +and runs test builds for those groups. +""" + +from __future__ import annotations + +import argparse +from pathlib import Path +import subprocess +import sys + +# Add esphome to path +sys.path.insert(0, str(Path(__file__).parent.parent)) + +from script.analyze_component_buses import ( + analyze_all_components, + group_components_by_signature, +) + + +def test_component_group( + components: list[str], + platform: str, + esphome_command: str = "compile", + dry_run: bool = False, +) -> bool: + """Test a group of components together. + + Args: + components: List of component names to test together + platform: Platform to test on (e.g., "esp32-idf") + esphome_command: ESPHome command to run (config/compile/clean) + dry_run: If True, only print the command without running it + + Returns: + True if test passed, False otherwise + """ + components_str = ",".join(components) + cmd = [ + "./script/test_build_components", + "-c", + components_str, + "-t", + platform, + "-e", + esphome_command, + ] + + print(f"\n{'=' * 80}") + print(f"Testing {len(components)} components on {platform}:") + for comp in components: + print(f" - {comp}") + print(f"{'=' * 80}") + print(f"Command: {' '.join(cmd)}\n") + + if dry_run: + print("[DRY RUN] Skipping actual test") + return True + + try: + result = subprocess.run(cmd, check=False) + return result.returncode == 0 + except Exception as e: + print(f"Error running test: {e}") + return False + + +def main() -> None: + """Main entry point.""" + parser = argparse.ArgumentParser( + description="Test component grouping by finding and testing groups" + ) + parser.add_argument( + "--platform", + "-p", + default="esp32-idf", + help="Platform to test (default: esp32-idf)", + ) + parser.add_argument( + "-e", + "--esphome-command", + default="compile", + choices=["config", "compile", "clean"], + help="ESPHome command to run (default: compile)", + ) + parser.add_argument( + "--all", + action="store_true", + help="Test all components (sets --min-size=1, --max-size=10000, --max-groups=10000)", + ) + parser.add_argument( + "--min-size", + type=int, + default=3, + help="Minimum group size to test (default: 3)", + ) + parser.add_argument( + "--max-size", + type=int, + default=10, + help="Maximum group size to test (default: 10)", + ) + parser.add_argument( + "--max-groups", + type=int, + default=5, + help="Maximum number of groups to test (default: 5)", + ) + parser.add_argument( + "--signature", + "-s", + help="Only test groups with this bus signature (e.g., 'spi', 'i2c', 'uart')", + ) + parser.add_argument( + "--dry-run", + action="store_true", + help="Print commands without running them", + ) + + args = parser.parse_args() + + # If --all is specified, test all components without grouping + if args.all: + # Get all components from tests/components directory + components_dir = Path("tests/components") + all_components = sorted( + [d.name for d in components_dir.iterdir() if d.is_dir()] + ) + + if not all_components: + print(f"\nNo components found in {components_dir}") + return + + print(f"\nTesting all {len(all_components)} components together") + + success = test_component_group( + all_components, args.platform, args.esphome_command, args.dry_run + ) + + # Print summary + print(f"\n{'=' * 80}") + print("TEST SUMMARY") + print(f"{'=' * 80}") + status = "✅ PASS" if success else "❌ FAIL" + print(f"{status} All components: {len(all_components)} components") + + if not args.dry_run and not success: + sys.exit(1) + return + + print("Analyzing all components...") + components, non_groupable, _ = analyze_all_components(Path("tests/components")) + + print(f"Found {len(components)} components, {len(non_groupable)} non-groupable") + + # Group components by signature for the platform + groups = group_components_by_signature(components, args.platform) + + # Filter and sort groups + filtered_groups = [] + for signature, comp_list in groups.items(): + # Filter by signature if specified + if args.signature and signature != args.signature: + continue + + # Remove non-groupable components + comp_list = [c for c in comp_list if c not in non_groupable] + + # Filter by minimum size + if len(comp_list) < args.min_size: + continue + + # If group is larger than max_size, we'll take a subset later + filtered_groups.append((signature, comp_list)) + + # Sort by group size (largest first) + filtered_groups.sort(key=lambda x: len(x[1]), reverse=True) + + # Limit number of groups + filtered_groups = filtered_groups[: args.max_groups] + + if not filtered_groups: + print("\nNo groups found matching criteria:") + print(f" - Platform: {args.platform}") + print(f" - Size: {args.min_size}-{args.max_size}") + if args.signature: + print(f" - Signature: {args.signature}") + return + + print(f"\nFound {len(filtered_groups)} groups to test:") + for signature, comp_list in filtered_groups: + print(f" [{signature}]: {len(comp_list)} components") + + # Test each group + results = [] + for signature, comp_list in filtered_groups: + # Limit to max_size if group is larger + if len(comp_list) > args.max_size: + comp_list = comp_list[: args.max_size] + + success = test_component_group( + comp_list, args.platform, args.esphome_command, args.dry_run + ) + results.append((signature, comp_list, success)) + + if not args.dry_run and not success: + print(f"\n❌ FAILED: {signature} group") + break + + # Print summary + print(f"\n{'=' * 80}") + print("TEST SUMMARY") + print(f"{'=' * 80}") + for signature, comp_list, success in results: + status = "✅ PASS" if success else "❌ FAIL" + print(f"{status} [{signature}]: {len(comp_list)} components") + + # Exit with error if any tests failed + if not args.dry_run and any(not success for _, _, success in results): + sys.exit(1) + + +if __name__ == "__main__": + main() diff --git a/tests/components/a01nyub/common.yaml b/tests/components/a01nyub/common.yaml index 0717acfff7..fc0b2d3bfb 100644 --- a/tests/components/a01nyub/common.yaml +++ b/tests/components/a01nyub/common.yaml @@ -1,11 +1,4 @@ -uart: - - id: uart_a01nyub - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - sensor: - platform: a01nyub id: a01nyub_sensor name: a01nyub Distance - uart_id: uart_a01nyub diff --git a/tests/components/a01nyub/test.esp32-c3-idf.yaml b/tests/components/a01nyub/test.esp32-c3-idf.yaml index b516342f3b..2cda8deaf9 100644 --- a/tests/components/a01nyub/test.esp32-c3-idf.yaml +++ b/tests/components/a01nyub/test.esp32-c3-idf.yaml @@ -1,3 +1,6 @@ +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml + substitutions: tx_pin: GPIO4 rx_pin: GPIO5 diff --git a/tests/components/a01nyub/test.esp32-idf.yaml b/tests/components/a01nyub/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/a01nyub/test.esp32-idf.yaml +++ b/tests/components/a01nyub/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/a01nyub/test.esp8266-ard.yaml b/tests/components/a01nyub/test.esp8266-ard.yaml index b516342f3b..5a05efa259 100644 --- a/tests/components/a01nyub/test.esp8266-ard.yaml +++ b/tests/components/a01nyub/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/a01nyub/test.rp2040-ard.yaml b/tests/components/a01nyub/test.rp2040-ard.yaml index b516342f3b..f1df2daf83 100644 --- a/tests/components/a01nyub/test.rp2040-ard.yaml +++ b/tests/components/a01nyub/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/a02yyuw/common.yaml b/tests/components/a02yyuw/common.yaml index b2e5927ff4..4de8a6eb67 100644 --- a/tests/components/a02yyuw/common.yaml +++ b/tests/components/a02yyuw/common.yaml @@ -1,11 +1,4 @@ -uart: - - id: uart_a02yyuw - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - sensor: - platform: a02yyuw id: a02yyuw_sensor name: a02yyuw Distance - uart_id: uart_a02yyuw diff --git a/tests/components/a02yyuw/test.esp32-c3-idf.yaml b/tests/components/a02yyuw/test.esp32-c3-idf.yaml index b516342f3b..2cda8deaf9 100644 --- a/tests/components/a02yyuw/test.esp32-c3-idf.yaml +++ b/tests/components/a02yyuw/test.esp32-c3-idf.yaml @@ -1,3 +1,6 @@ +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml + substitutions: tx_pin: GPIO4 rx_pin: GPIO5 diff --git a/tests/components/a02yyuw/test.esp32-idf.yaml b/tests/components/a02yyuw/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/a02yyuw/test.esp32-idf.yaml +++ b/tests/components/a02yyuw/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/a02yyuw/test.esp8266-ard.yaml b/tests/components/a02yyuw/test.esp8266-ard.yaml index b516342f3b..5a05efa259 100644 --- a/tests/components/a02yyuw/test.esp8266-ard.yaml +++ b/tests/components/a02yyuw/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/a02yyuw/test.rp2040-ard.yaml b/tests/components/a02yyuw/test.rp2040-ard.yaml index b516342f3b..f1df2daf83 100644 --- a/tests/components/a02yyuw/test.rp2040-ard.yaml +++ b/tests/components/a02yyuw/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/a4988/test.esp32-idf.yaml b/tests/components/a4988/test.esp32-idf.yaml index 1ca8c0c084..7d46b048e1 100644 --- a/tests/components/a4988/test.esp32-idf.yaml +++ b/tests/components/a4988/test.esp32-idf.yaml @@ -1,6 +1,6 @@ substitutions: step_pin: GPIO22 - dir_pin: GPIO23 + dir_pin: GPIO4 sleep_pin: GPIO25 <<: !include common.yaml diff --git a/tests/components/a4988/test.esp8266-ard.yaml b/tests/components/a4988/test.esp8266-ard.yaml index 22b5677d27..5b1b1293be 100644 --- a/tests/components/a4988/test.esp8266-ard.yaml +++ b/tests/components/a4988/test.esp8266-ard.yaml @@ -1,6 +1,6 @@ substitutions: step_pin: GPIO1 dir_pin: GPIO2 - sleep_pin: GPIO5 + sleep_pin: GPIO0 <<: !include common.yaml diff --git a/tests/components/ac_dimmer/test.esp32-ard.yaml b/tests/components/ac_dimmer/test.esp32-ard.yaml index 3ec069f430..eaa4901f03 100644 --- a/tests/components/ac_dimmer/test.esp32-ard.yaml +++ b/tests/components/ac_dimmer/test.esp32-ard.yaml @@ -1,5 +1,5 @@ substitutions: - gate_pin: GPIO18 - zero_cross_pin: GPIO19 + gate_pin: GPIO4 + zero_cross_pin: GPIO5 <<: !include common.yaml diff --git a/tests/components/ac_dimmer/test.esp8266-ard.yaml b/tests/components/ac_dimmer/test.esp8266-ard.yaml index 5d2d42b713..2f50b04956 100644 --- a/tests/components/ac_dimmer/test.esp8266-ard.yaml +++ b/tests/components/ac_dimmer/test.esp8266-ard.yaml @@ -1,5 +1,5 @@ substitutions: - gate_pin: GPIO5 - zero_cross_pin: GPIO4 + gate_pin: GPIO0 + zero_cross_pin: GPIO2 <<: !include common.yaml diff --git a/tests/components/adc/common.yaml b/tests/components/adc/common.yaml deleted file mode 100644 index ebdd1aece5..0000000000 --- a/tests/components/adc/common.yaml +++ /dev/null @@ -1,11 +0,0 @@ -sensor: - - id: my_sensor - platform: adc - name: ADC Test sensor - update_interval: "1:01" - attenuation: 2.5db - unit_of_measurement: "°C" - icon: "mdi:water-percent" - accuracy_decimals: 5 - setup_priority: -100 - force_update: true diff --git a/tests/components/adc/test.bk72xx-ard.yaml b/tests/components/adc/test.bk72xx-ard.yaml index 0a3d5d1fdc..0645333a81 100644 --- a/tests/components/adc/test.bk72xx-ard.yaml +++ b/tests/components/adc/test.bk72xx-ard.yaml @@ -1,7 +1,11 @@ -packages: - base: !include common.yaml - sensor: - - id: !extend my_sensor + - id: my_sensor + platform: adc pin: P23 - attenuation: !remove + name: ADC Test sensor + update_interval: "1:01" + unit_of_measurement: "°C" + icon: "mdi:water-percent" + accuracy_decimals: 5 + setup_priority: -100 + force_update: true diff --git a/tests/components/adc/test.esp32-c3-idf.yaml b/tests/components/adc/test.esp32-c3-idf.yaml index ea3b00a85f..e764f0fe21 100644 --- a/tests/components/adc/test.esp32-c3-idf.yaml +++ b/tests/components/adc/test.esp32-c3-idf.yaml @@ -1,6 +1,12 @@ -packages: - base: !include common.yaml - sensor: - - id: !extend my_sensor - pin: 4 + - id: my_sensor + platform: adc + pin: GPIO1 + name: ADC Test sensor + update_interval: "1:01" + attenuation: 2.5db + unit_of_measurement: "°C" + icon: "mdi:water-percent" + accuracy_decimals: 5 + setup_priority: -100 + force_update: true diff --git a/tests/components/adc/test.esp32-idf.yaml b/tests/components/adc/test.esp32-idf.yaml index e6a1fd3bd9..ff1e3bb919 100644 --- a/tests/components/adc/test.esp32-idf.yaml +++ b/tests/components/adc/test.esp32-idf.yaml @@ -1,6 +1,12 @@ -packages: - base: !include common.yaml - sensor: - - id: !extend my_sensor + - id: my_sensor + platform: adc pin: A0 + name: ADC Test sensor + update_interval: "1:01" + attenuation: 2.5db + unit_of_measurement: "°C" + icon: "mdi:water-percent" + accuracy_decimals: 5 + setup_priority: -100 + force_update: true diff --git a/tests/components/adc/test.esp32-p4-idf.yaml b/tests/components/adc/test.esp32-p4-idf.yaml index 97844cf398..b77dc299c2 100644 --- a/tests/components/adc/test.esp32-p4-idf.yaml +++ b/tests/components/adc/test.esp32-p4-idf.yaml @@ -1,6 +1,12 @@ -packages: - base: !include common.yaml - sensor: - - id: !extend my_sensor - pin: GPIO50 + - id: my_sensor + platform: adc + pin: GPIO16 + name: ADC Test sensor + update_interval: "1:01" + attenuation: 2.5db + unit_of_measurement: "°C" + icon: "mdi:water-percent" + accuracy_decimals: 5 + setup_priority: -100 + force_update: true diff --git a/tests/components/adc/test.esp32-s2-idf.yaml b/tests/components/adc/test.esp32-s2-idf.yaml index bbd91c5e5a..e764f0fe21 100644 --- a/tests/components/adc/test.esp32-s2-idf.yaml +++ b/tests/components/adc/test.esp32-s2-idf.yaml @@ -1,6 +1,12 @@ -packages: - base: !include common.yaml - sensor: - - id: !extend my_sensor - pin: 1 + - id: my_sensor + platform: adc + pin: GPIO1 + name: ADC Test sensor + update_interval: "1:01" + attenuation: 2.5db + unit_of_measurement: "°C" + icon: "mdi:water-percent" + accuracy_decimals: 5 + setup_priority: -100 + force_update: true diff --git a/tests/components/adc/test.esp32-s3-idf.yaml b/tests/components/adc/test.esp32-s3-idf.yaml index bbd91c5e5a..e764f0fe21 100644 --- a/tests/components/adc/test.esp32-s3-idf.yaml +++ b/tests/components/adc/test.esp32-s3-idf.yaml @@ -1,6 +1,12 @@ -packages: - base: !include common.yaml - sensor: - - id: !extend my_sensor - pin: 1 + - id: my_sensor + platform: adc + pin: GPIO1 + name: ADC Test sensor + update_interval: "1:01" + attenuation: 2.5db + unit_of_measurement: "°C" + icon: "mdi:water-percent" + accuracy_decimals: 5 + setup_priority: -100 + force_update: true diff --git a/tests/components/adc/test.esp8266-ard.yaml b/tests/components/adc/test.esp8266-ard.yaml index bcb3620cfc..4cc865bb5d 100644 --- a/tests/components/adc/test.esp8266-ard.yaml +++ b/tests/components/adc/test.esp8266-ard.yaml @@ -1,7 +1,11 @@ -packages: - base: !include common.yaml - sensor: - - id: !extend my_sensor + - id: my_sensor + platform: adc pin: VCC - attenuation: !remove + name: ADC Test sensor + update_interval: "1:01" + unit_of_measurement: "°C" + icon: "mdi:water-percent" + accuracy_decimals: 5 + setup_priority: -100 + force_update: true diff --git a/tests/components/adc/test.ln882x-ard.yaml b/tests/components/adc/test.ln882x-ard.yaml index 0622cd7b27..face38b647 100644 --- a/tests/components/adc/test.ln882x-ard.yaml +++ b/tests/components/adc/test.ln882x-ard.yaml @@ -1,7 +1,11 @@ -packages: - base: !include common.yaml - sensor: - - id: !extend my_sensor - pin: PA0 - attenuation: !remove + - id: my_sensor + platform: adc + pin: A5 + name: ADC Test sensor + update_interval: "1:01" + unit_of_measurement: "°C" + icon: "mdi:water-percent" + accuracy_decimals: 5 + setup_priority: -100 + force_update: true diff --git a/tests/components/adc/test.rp2040-ard.yaml b/tests/components/adc/test.rp2040-ard.yaml index bcb3620cfc..4cc865bb5d 100644 --- a/tests/components/adc/test.rp2040-ard.yaml +++ b/tests/components/adc/test.rp2040-ard.yaml @@ -1,7 +1,11 @@ -packages: - base: !include common.yaml - sensor: - - id: !extend my_sensor + - id: my_sensor + platform: adc pin: VCC - attenuation: !remove + name: ADC Test sensor + update_interval: "1:01" + unit_of_measurement: "°C" + icon: "mdi:water-percent" + accuracy_decimals: 5 + setup_priority: -100 + force_update: true diff --git a/tests/components/adc128s102/common.yaml b/tests/components/adc128s102/common.yaml index 5f1638a7e2..b909310bdf 100644 --- a/tests/components/adc128s102/common.yaml +++ b/tests/components/adc128s102/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_adc128s102 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - adc128s102: cs_pin: ${cs_pin} id: adc128s102_adc diff --git a/tests/components/adc128s102/test.esp32-c3-idf.yaml b/tests/components/adc128s102/test.esp32-c3-idf.yaml index 24da4b5452..a60568a736 100644 --- a/tests/components/adc128s102/test.esp32-c3-idf.yaml +++ b/tests/components/adc128s102/test.esp32-c3-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO2 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/adc128s102/test.esp32-idf.yaml b/tests/components/adc128s102/test.esp32-idf.yaml index aba72f0614..9bb524aa65 100644 --- a/tests/components/adc128s102/test.esp32-idf.yaml +++ b/tests/components/adc128s102/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO12 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/adc128s102/test.esp8266-ard.yaml b/tests/components/adc128s102/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/adc128s102/test.esp8266-ard.yaml +++ b/tests/components/adc128s102/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/adc128s102/test.rp2040-ard.yaml b/tests/components/adc128s102/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/adc128s102/test.rp2040-ard.yaml +++ b/tests/components/adc128s102/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ade7880/common.yaml b/tests/components/ade7880/common.yaml index 0aa388a325..0b0b560282 100644 --- a/tests/components/ade7880/common.yaml +++ b/tests/components/ade7880/common.yaml @@ -1,11 +1,6 @@ -i2c: - - id: i2c_ade7880 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: ade7880 - i2c_id: i2c_ade7880 + i2c_id: i2c_bus irq0_pin: ${irq0_pin} irq1_pin: ${irq1_pin} reset_pin: ${reset_pin} diff --git a/tests/components/ade7880/test.esp32-c3-idf.yaml b/tests/components/ade7880/test.esp32-c3-idf.yaml index 87db3e9427..7d5b41fc5a 100644 --- a/tests/components/ade7880/test.esp32-c3-idf.yaml +++ b/tests/components/ade7880/test.esp32-c3-idf.yaml @@ -1,8 +1,9 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq0_pin: GPIO6 irq1_pin: GPIO7 - reset_pin: GPIO10 + reset_pin: GPIO9 + +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ade7880/test.esp32-idf.yaml b/tests/components/ade7880/test.esp32-idf.yaml index 685b49ff32..9db2e50049 100644 --- a/tests/components/ade7880/test.esp32-idf.yaml +++ b/tests/components/ade7880/test.esp32-idf.yaml @@ -1,8 +1,9 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq0_pin: GPIO13 irq1_pin: GPIO15 - reset_pin: GPIO16 + reset_pin: GPIO12 + +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ade7880/test.esp8266-ard.yaml b/tests/components/ade7880/test.esp8266-ard.yaml index 685b49ff32..81a04d0724 100644 --- a/tests/components/ade7880/test.esp8266-ard.yaml +++ b/tests/components/ade7880/test.esp8266-ard.yaml @@ -1,8 +1,9 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq0_pin: GPIO13 irq1_pin: GPIO15 reset_pin: GPIO16 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ade7880/test.rp2040-ard.yaml b/tests/components/ade7880/test.rp2040-ard.yaml index 685b49ff32..f531f852ae 100644 --- a/tests/components/ade7880/test.rp2040-ard.yaml +++ b/tests/components/ade7880/test.rp2040-ard.yaml @@ -1,8 +1,9 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq0_pin: GPIO13 irq1_pin: GPIO15 reset_pin: GPIO16 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ade7953_i2c/common.yaml b/tests/components/ade7953_i2c/common.yaml index a2d163567d..8b2a9588fe 100644 --- a/tests/components/ade7953_i2c/common.yaml +++ b/tests/components/ade7953_i2c/common.yaml @@ -1,20 +1,13 @@ -i2c: - - id: i2c_ade7953 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: ade7953_i2c + i2c_id: i2c_bus irq_pin: ${irq_pin} voltage: name: ADE7953 Voltage - id: ade7953_voltage current_a: name: ADE7953 Current A - id: ade7953_current_a current_b: name: ADE7953 Current B - id: ade7953_current_b power_factor_a: name: ADE7953 Power Factor A power_factor_b: diff --git a/tests/components/ade7953_i2c/test.esp32-c3-idf.yaml b/tests/components/ade7953_i2c/test.esp32-c3-idf.yaml index 799acabd5a..59296a1e6e 100644 --- a/tests/components/ade7953_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/ade7953_i2c/test.esp32-c3-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ade7953_i2c/test.esp32-idf.yaml b/tests/components/ade7953_i2c/test.esp32-idf.yaml index 2c57d412f6..49629536e7 100644 --- a/tests/components/ade7953_i2c/test.esp32-idf.yaml +++ b/tests/components/ade7953_i2c/test.esp32-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 irq_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ade7953_i2c/test.esp8266-ard.yaml b/tests/components/ade7953_i2c/test.esp8266-ard.yaml index c8e6a43f44..dc7609ab37 100644 --- a/tests/components/ade7953_i2c/test.esp8266-ard.yaml +++ b/tests/components/ade7953_i2c/test.esp8266-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ade7953_i2c/test.rp2040-ard.yaml b/tests/components/ade7953_i2c/test.rp2040-ard.yaml index 799acabd5a..b80562ad22 100644 --- a/tests/components/ade7953_i2c/test.rp2040-ard.yaml +++ b/tests/components/ade7953_i2c/test.rp2040-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ade7953_spi/common.yaml b/tests/components/ade7953_spi/common.yaml index 706f31f22c..30b5258a2a 100644 --- a/tests/components/ade7953_spi/common.yaml +++ b/tests/components/ade7953_spi/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_ade7953 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sensor: - platform: ade7953_spi cs_pin: ${cs_pin} diff --git a/tests/components/ade7953_spi/test.esp32-c3-idf.yaml b/tests/components/ade7953_spi/test.esp32-c3-idf.yaml index fcf35f528e..5e7e2dc82c 100644 --- a/tests/components/ade7953_spi/test.esp32-c3-idf.yaml +++ b/tests/components/ade7953_spi/test.esp32-c3-idf.yaml @@ -1,8 +1,7 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 irq_pin: GPIO9 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ade7953_spi/test.esp32-idf.yaml b/tests/components/ade7953_spi/test.esp32-idf.yaml index e00f522dd4..19791e24b7 100644 --- a/tests/components/ade7953_spi/test.esp32-idf.yaml +++ b/tests/components/ade7953_spi/test.esp32-idf.yaml @@ -1,8 +1,8 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 irq_pin: GPIO13 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ade7953_spi/test.esp8266-ard.yaml b/tests/components/ade7953_spi/test.esp8266-ard.yaml index b90e661ec0..8475dc4c50 100644 --- a/tests/components/ade7953_spi/test.esp8266-ard.yaml +++ b/tests/components/ade7953_spi/test.esp8266-ard.yaml @@ -1,8 +1,11 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 irq_pin: GPIO5 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ade7953_spi/test.rp2040-ard.yaml b/tests/components/ade7953_spi/test.rp2040-ard.yaml index 8f5941e1b2..7c4a74a236 100644 --- a/tests/components/ade7953_spi/test.rp2040-ard.yaml +++ b/tests/components/ade7953_spi/test.rp2040-ard.yaml @@ -5,4 +5,7 @@ substitutions: irq_pin: GPIO5 cs_pin: GPIO6 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ads1115/common.yaml b/tests/components/ads1115/common.yaml index 297877d2d8..4724dc5a14 100644 --- a/tests/components/ads1115/common.yaml +++ b/tests/components/ads1115/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_ads1115 - scl: ${scl_pin} - sda: ${sda_pin} - ads1115: + i2c_id: i2c_bus address: 0x48 sensor: diff --git a/tests/components/ads1115/test.esp32-c3-idf.yaml b/tests/components/ads1115/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ads1115/test.esp32-c3-idf.yaml +++ b/tests/components/ads1115/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ads1115/test.esp32-idf.yaml b/tests/components/ads1115/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ads1115/test.esp32-idf.yaml +++ b/tests/components/ads1115/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ads1115/test.esp8266-ard.yaml b/tests/components/ads1115/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ads1115/test.esp8266-ard.yaml +++ b/tests/components/ads1115/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ads1115/test.rp2040-ard.yaml b/tests/components/ads1115/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ads1115/test.rp2040-ard.yaml +++ b/tests/components/ads1115/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ags10/common.yaml b/tests/components/ags10/common.yaml index 0c4c3513cf..0551871e59 100644 --- a/tests/components/ags10/common.yaml +++ b/tests/components/ags10/common.yaml @@ -1,9 +1,3 @@ -i2c: - - id: i2c_ags10 - scl: ${scl_pin} - sda: ${sda_pin} - frequency: 10kHz - sensor: - platform: ags10 id: ags10_1 diff --git a/tests/components/ags10/test.esp32-c3-idf.yaml b/tests/components/ags10/test.esp32-c3-idf.yaml index ee2c29ca4e..72703301a1 100644 --- a/tests/components/ags10/test.esp32-c3-idf.yaml +++ b/tests/components/ags10/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c_low_freq: !include ../../test_build_components/common/i2c_low_freq/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ags10/test.esp32-idf.yaml b/tests/components/ags10/test.esp32-idf.yaml index 63c3bd6afd..7a5d01898a 100644 --- a/tests/components/ags10/test.esp32-idf.yaml +++ b/tests/components/ags10/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c_low_freq: !include ../../test_build_components/common/i2c_low_freq/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ags10/test.esp8266-ard.yaml b/tests/components/ags10/test.esp8266-ard.yaml index ee2c29ca4e..9e23bb3778 100644 --- a/tests/components/ags10/test.esp8266-ard.yaml +++ b/tests/components/ags10/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c_low_freq: !include ../../test_build_components/common/i2c_low_freq/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/aht10/common.yaml b/tests/components/aht10/common.yaml index 721af09bb4..d7c3f9364f 100644 --- a/tests/components/aht10/common.yaml +++ b/tests/components/aht10/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_aht10 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: aht10 + i2c_id: i2c_bus temperature: name: Temperature humidity: diff --git a/tests/components/aht10/test.esp32-c3-idf.yaml b/tests/components/aht10/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/aht10/test.esp32-c3-idf.yaml +++ b/tests/components/aht10/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/aht10/test.esp32-idf.yaml b/tests/components/aht10/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/aht10/test.esp32-idf.yaml +++ b/tests/components/aht10/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/aht10/test.esp8266-ard.yaml b/tests/components/aht10/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/aht10/test.esp8266-ard.yaml +++ b/tests/components/aht10/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/aht10/test.rp2040-ard.yaml b/tests/components/aht10/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/aht10/test.rp2040-ard.yaml +++ b/tests/components/aht10/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/aic3204/common.yaml b/tests/components/aic3204/common.yaml index 6e939bd260..5f175faee3 100644 --- a/tests/components/aic3204/common.yaml +++ b/tests/components/aic3204/common.yaml @@ -6,10 +6,6 @@ esphome: - audio_dac.set_volume: volume: 50% -i2c: - - id: i2c_aic3204 - scl: ${scl_pin} - sda: ${sda_pin} - audio_dac: - platform: aic3204 + i2c_id: i2c_bus diff --git a/tests/components/aic3204/test.esp32-c3-idf.yaml b/tests/components/aic3204/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/aic3204/test.esp32-c3-idf.yaml +++ b/tests/components/aic3204/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/aic3204/test.esp32-idf.yaml b/tests/components/aic3204/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/aic3204/test.esp32-idf.yaml +++ b/tests/components/aic3204/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/aic3204/test.esp8266-ard.yaml b/tests/components/aic3204/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/aic3204/test.esp8266-ard.yaml +++ b/tests/components/aic3204/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/airthings_wave_mini/test.esp32-c3-idf.yaml b/tests/components/airthings_wave_mini/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/airthings_wave_mini/test.esp32-c3-idf.yaml +++ b/tests/components/airthings_wave_mini/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/airthings_wave_mini/test.esp32-idf.yaml b/tests/components/airthings_wave_mini/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/airthings_wave_mini/test.esp32-idf.yaml +++ b/tests/components/airthings_wave_mini/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/airthings_wave_plus/test.esp32-c3-idf.yaml b/tests/components/airthings_wave_plus/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/airthings_wave_plus/test.esp32-c3-idf.yaml +++ b/tests/components/airthings_wave_plus/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/airthings_wave_plus/test.esp32-idf.yaml b/tests/components/airthings_wave_plus/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/airthings_wave_plus/test.esp32-idf.yaml +++ b/tests/components/airthings_wave_plus/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/alpha3/test.esp32-c3-idf.yaml b/tests/components/alpha3/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/alpha3/test.esp32-c3-idf.yaml +++ b/tests/components/alpha3/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/alpha3/test.esp32-idf.yaml b/tests/components/alpha3/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/alpha3/test.esp32-idf.yaml +++ b/tests/components/alpha3/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/am2315c/common.yaml b/tests/components/am2315c/common.yaml index ab4656c17d..362fe19e4d 100644 --- a/tests/components/am2315c/common.yaml +++ b/tests/components/am2315c/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_am2315c - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: am2315c + i2c_id: i2c_bus temperature: name: Temperature humidity: diff --git a/tests/components/am2315c/test.esp32-c3-idf.yaml b/tests/components/am2315c/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/am2315c/test.esp32-c3-idf.yaml +++ b/tests/components/am2315c/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/am2315c/test.esp32-idf.yaml b/tests/components/am2315c/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/am2315c/test.esp32-idf.yaml +++ b/tests/components/am2315c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/am2315c/test.esp8266-ard.yaml b/tests/components/am2315c/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/am2315c/test.esp8266-ard.yaml +++ b/tests/components/am2315c/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/am2315c/test.rp2040-ard.yaml b/tests/components/am2315c/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/am2315c/test.rp2040-ard.yaml +++ b/tests/components/am2315c/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/am2320/common.yaml b/tests/components/am2320/common.yaml index c0982b8818..d67ca3e564 100644 --- a/tests/components/am2320/common.yaml +++ b/tests/components/am2320/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_am2320 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: am2320 + i2c_id: i2c_bus temperature: name: Temperature humidity: diff --git a/tests/components/am2320/test.esp32-c3-idf.yaml b/tests/components/am2320/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/am2320/test.esp32-c3-idf.yaml +++ b/tests/components/am2320/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/am2320/test.esp32-idf.yaml b/tests/components/am2320/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/am2320/test.esp32-idf.yaml +++ b/tests/components/am2320/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/am2320/test.esp8266-ard.yaml b/tests/components/am2320/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/am2320/test.esp8266-ard.yaml +++ b/tests/components/am2320/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/am2320/test.rp2040-ard.yaml b/tests/components/am2320/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/am2320/test.rp2040-ard.yaml +++ b/tests/components/am2320/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/am43/test.esp32-c3-idf.yaml b/tests/components/am43/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/am43/test.esp32-c3-idf.yaml +++ b/tests/components/am43/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/am43/test.esp32-idf.yaml b/tests/components/am43/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/am43/test.esp32-idf.yaml +++ b/tests/components/am43/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/animation/test.esp32-c3-idf.yaml b/tests/components/animation/test.esp32-c3-idf.yaml index 18aa2a5b06..a08a683333 100644 --- a/tests/components/animation/test.esp32-c3-idf.yaml +++ b/tests/components/animation/test.esp32-c3-idf.yaml @@ -1,17 +1,13 @@ -spi: - - id: spi_main_lcd - clk_pin: 6 - mosi_pin: 7 - miso_pin: 5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml + animation: !include common.yaml display: - platform: ili9xxx id: main_lcd + spi_id: spi_bus model: ili9342 cs_pin: 8 dc_pin: 9 reset_pin: 10 invert_colors: false - -packages: - animation: !include common.yaml diff --git a/tests/components/animation/test.esp32-idf.yaml b/tests/components/animation/test.esp32-idf.yaml index 7d9fe45bff..c28e9584dd 100644 --- a/tests/components/animation/test.esp32-idf.yaml +++ b/tests/components/animation/test.esp32-idf.yaml @@ -1,17 +1,13 @@ -spi: - - id: spi_main_lcd - clk_pin: 16 - mosi_pin: 17 - miso_pin: 15 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + animation: !include common.yaml display: - platform: ili9xxx id: main_lcd + spi_id: spi_bus model: ili9342 cs_pin: 12 dc_pin: 13 reset_pin: 21 invert_colors: false - -packages: - animation: !include common.yaml diff --git a/tests/components/animation/test.esp8266-ard.yaml b/tests/components/animation/test.esp8266-ard.yaml index 9548c7fbeb..11a7117d91 100644 --- a/tests/components/animation/test.esp8266-ard.yaml +++ b/tests/components/animation/test.esp8266-ard.yaml @@ -1,17 +1,13 @@ -spi: - - id: spi_main_lcd - clk_pin: 14 - mosi_pin: 13 - miso_pin: 12 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + animation: !include common.yaml display: - platform: ili9xxx id: main_lcd + spi_id: spi_bus model: ili9342 cs_pin: 5 dc_pin: 15 reset_pin: 16 invert_colors: false - -packages: - animation: !include common.yaml diff --git a/tests/components/animation/test.rp2040-ard.yaml b/tests/components/animation/test.rp2040-ard.yaml index efb3f2907c..32fb4efb04 100644 --- a/tests/components/animation/test.rp2040-ard.yaml +++ b/tests/components/animation/test.rp2040-ard.yaml @@ -1,17 +1,13 @@ -spi: - - id: spi_main_lcd - clk_pin: 2 - mosi_pin: 3 - miso_pin: 4 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + animation: !include common.yaml display: - platform: ili9xxx id: main_lcd + spi_id: spi_bus model: ili9342 cs_pin: 20 dc_pin: 21 reset_pin: 22 invert_colors: false - -packages: - animation: !include common.yaml diff --git a/tests/components/anova/test.esp32-c3-idf.yaml b/tests/components/anova/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/anova/test.esp32-c3-idf.yaml +++ b/tests/components/anova/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/anova/test.esp32-idf.yaml b/tests/components/anova/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/anova/test.esp32-idf.yaml +++ b/tests/components/anova/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/apds9306/common.yaml b/tests/components/apds9306/common.yaml index b3828e62ff..dc34f47645 100644 --- a/tests/components/apds9306/common.yaml +++ b/tests/components/apds9306/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_apds9306 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: apds9306 + i2c_id: i2c_bus name: "APDS9306 Light Level" gain: 3 bit_width: 16 diff --git a/tests/components/apds9306/test.esp32-c3-idf.yaml b/tests/components/apds9306/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/apds9306/test.esp32-c3-idf.yaml +++ b/tests/components/apds9306/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/apds9306/test.esp32-idf.yaml b/tests/components/apds9306/test.esp32-idf.yaml index 3b761d3fc1..b47e39c389 100644 --- a/tests/components/apds9306/test.esp32-idf.yaml +++ b/tests/components/apds9306/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO22 - sda_pin: GPIO21 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/apds9306/test.esp8266-ard.yaml b/tests/components/apds9306/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/apds9306/test.esp8266-ard.yaml +++ b/tests/components/apds9306/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/apds9306/test.rp2040-ard.yaml b/tests/components/apds9306/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/apds9306/test.rp2040-ard.yaml +++ b/tests/components/apds9306/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/apds9960/common.yaml b/tests/components/apds9960/common.yaml index de7706648a..c14212d263 100644 --- a/tests/components/apds9960/common.yaml +++ b/tests/components/apds9960/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_apds9960 - scl: ${scl_pin} - sda: ${sda_pin} - apds9960: + i2c_id: i2c_bus address: 0x20 update_interval: 60s diff --git a/tests/components/apds9960/test.esp32-c3-idf.yaml b/tests/components/apds9960/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/apds9960/test.esp32-c3-idf.yaml +++ b/tests/components/apds9960/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/apds9960/test.esp32-idf.yaml b/tests/components/apds9960/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/apds9960/test.esp32-idf.yaml +++ b/tests/components/apds9960/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/apds9960/test.esp8266-ard.yaml b/tests/components/apds9960/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/apds9960/test.esp8266-ard.yaml +++ b/tests/components/apds9960/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/apds9960/test.rp2040-ard.yaml b/tests/components/apds9960/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/apds9960/test.rp2040-ard.yaml +++ b/tests/components/apds9960/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/api/common-base.yaml b/tests/components/api/common-base.yaml new file mode 100644 index 0000000000..6483d5a997 --- /dev/null +++ b/tests/components/api/common-base.yaml @@ -0,0 +1,89 @@ +esphome: + on_boot: + then: + - homeassistant.event: + event: esphome.button_pressed + data: + message: Button was pressed + - homeassistant.action: + action: notify.html5 + data: + message: Button was pressed + - homeassistant.tag_scanned: pulse + - homeassistant.action: + action: weather.get_forecasts + data: + entity_id: weather.forecast_home + type: hourly + capture_response: true + on_success: + - lambda: |- + JsonObjectConst next_hour = response["response"]["weather.forecast_home"]["forecast"][0]; + float next_temperature = next_hour["temperature"].as(); + ESP_LOGD("main", "Next hour temperature: %f", next_temperature); + on_error: + - lambda: |- + ESP_LOGE("main", "Action failed with error: %s", error.c_str()); + - homeassistant.action: + action: weather.get_forecasts + data: + entity_id: weather.forecast_home + type: hourly + capture_response: true + response_template: "{{ response['weather.forecast_home']['forecast'][0]['temperature'] }}" + on_success: + - lambda: |- + float temperature = response["response"].as(); + ESP_LOGD("main", "Next hour temperature: %f", temperature); + - homeassistant.action: + action: light.toggle + data: + entity_id: light.demo_light + on_success: + - logger.log: "Toggled demo light" + on_error: + - logger.log: "Failed to toggle demo light" + +api: + port: 8000 + reboot_timeout: 0min + actions: + - action: hello_world + variables: + name: string + then: + - logger.log: + format: Hello World %s! + args: + - name.c_str() + - action: empty_action + then: + - logger.log: Action Called + - action: all_types + variables: + bool_: bool + int_: int + float_: float + string_: string + then: + - logger.log: Something happened + - action: array_types + variables: + bool_arr: bool[] + int_arr: int[] + float_arr: float[] + string_arr: string[] + then: + - logger.log: + # yamllint disable rule:line-length + format: "Bool: %s (%u), Int: %ld (%u), Float: %f (%u), String: %s (%u)" + # yamllint enable rule:line-length + args: + - YESNO(bool_arr[0]) + - bool_arr.size() + - (long) int_arr[0] + - int_arr.size() + - float_arr[0] + - float_arr.size() + - string_arr[0].c_str() + - string_arr.size() diff --git a/tests/components/api/common.yaml b/tests/components/api/common.yaml index d87ae56ec2..6115838b6d 100644 --- a/tests/components/api/common.yaml +++ b/tests/components/api/common.yaml @@ -1,91 +1,5 @@ -esphome: - on_boot: - then: - - homeassistant.event: - event: esphome.button_pressed - data: - message: Button was pressed - - homeassistant.action: - action: notify.html5 - data: - message: Button was pressed - - homeassistant.tag_scanned: pulse - - homeassistant.action: - action: weather.get_forecasts - data: - entity_id: weather.forecast_home - type: hourly - capture_response: true - on_success: - - lambda: |- - JsonObjectConst next_hour = response["response"]["weather.forecast_home"]["forecast"][0]; - float next_temperature = next_hour["temperature"].as(); - ESP_LOGD("main", "Next hour temperature: %f", next_temperature); - on_error: - - lambda: |- - ESP_LOGE("main", "Action failed with error: %s", error.c_str()); - - homeassistant.action: - action: weather.get_forecasts - data: - entity_id: weather.forecast_home - type: hourly - capture_response: true - response_template: "{{ response['weather.forecast_home']['forecast'][0]['temperature'] }}" - on_success: - - lambda: |- - float temperature = response["response"].as(); - ESP_LOGD("main", "Next hour temperature: %f", temperature); - - homeassistant.action: - action: light.toggle - data: - entity_id: light.demo_light - on_success: - - logger.log: "Toggled demo light" - on_error: - - logger.log: "Failed to toggle demo light" +<<: !include common-base.yaml api: - port: 8000 - reboot_timeout: 0min encryption: key: bOFFzzvfpg5DB94DuBGLXD/hMnhpDKgP9UQyBulwWVU= - actions: - - action: hello_world - variables: - name: string - then: - - logger.log: - format: Hello World %s! - args: - - name.c_str() - - action: empty_action - then: - - logger.log: Action Called - - action: all_types - variables: - bool_: bool - int_: int - float_: float - string_: string - then: - - logger.log: Something happened - - action: array_types - variables: - bool_arr: bool[] - int_arr: int[] - float_arr: float[] - string_arr: string[] - then: - - logger.log: - # yamllint disable rule:line-length - format: "Bool: %s (%u), Int: %ld (%u), Float: %f (%u), String: %s (%u)" - # yamllint enable rule:line-length - args: - - YESNO(bool_arr[0]) - - bool_arr.size() - - (long) int_arr[0] - - int_arr.size() - - float_arr[0] - - float_arr.size() - - string_arr[0].c_str() - - string_arr.size() diff --git a/tests/components/api/test-dynamic-encryption.esp32-idf.yaml b/tests/components/api/test-dynamic-encryption.esp32-idf.yaml index d8f8c247f4..504871716b 100644 --- a/tests/components/api/test-dynamic-encryption.esp32-idf.yaml +++ b/tests/components/api/test-dynamic-encryption.esp32-idf.yaml @@ -1,10 +1,5 @@ -packages: - common: !include common.yaml +<<: !include common-base.yaml wifi: ssid: MySSID password: password1 - -api: - encryption: - key: !remove diff --git a/tests/components/as3935_i2c/common.yaml b/tests/components/as3935_i2c/common.yaml index d76cc37fc1..a758bb7f56 100644 --- a/tests/components/as3935_i2c/common.yaml +++ b/tests/components/as3935_i2c/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_as3935 - scl: ${scl_pin} - sda: ${sda_pin} - as3935_i2c: + i2c_id: i2c_bus irq_pin: ${irq_pin} binary_sensor: diff --git a/tests/components/as3935_i2c/test.esp32-c3-idf.yaml b/tests/components/as3935_i2c/test.esp32-c3-idf.yaml index 799acabd5a..59296a1e6e 100644 --- a/tests/components/as3935_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/as3935_i2c/test.esp32-c3-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/as3935_i2c/test.esp32-idf.yaml b/tests/components/as3935_i2c/test.esp32-idf.yaml index 2c57d412f6..49629536e7 100644 --- a/tests/components/as3935_i2c/test.esp32-idf.yaml +++ b/tests/components/as3935_i2c/test.esp32-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 irq_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/as3935_i2c/test.esp8266-ard.yaml b/tests/components/as3935_i2c/test.esp8266-ard.yaml index c8e6a43f44..dc7609ab37 100644 --- a/tests/components/as3935_i2c/test.esp8266-ard.yaml +++ b/tests/components/as3935_i2c/test.esp8266-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/as3935_i2c/test.rp2040-ard.yaml b/tests/components/as3935_i2c/test.rp2040-ard.yaml index 799acabd5a..b80562ad22 100644 --- a/tests/components/as3935_i2c/test.rp2040-ard.yaml +++ b/tests/components/as3935_i2c/test.rp2040-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/as3935_spi/common.yaml b/tests/components/as3935_spi/common.yaml index c3fb93dff1..5898d5d365 100644 --- a/tests/components/as3935_spi/common.yaml +++ b/tests/components/as3935_spi/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_as3935 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - as3935_spi: cs_pin: ${cs_pin} irq_pin: ${irq_pin} diff --git a/tests/components/as3935_spi/test.esp32-c3-idf.yaml b/tests/components/as3935_spi/test.esp32-c3-idf.yaml index fcf35f528e..5e7e2dc82c 100644 --- a/tests/components/as3935_spi/test.esp32-c3-idf.yaml +++ b/tests/components/as3935_spi/test.esp32-c3-idf.yaml @@ -1,8 +1,7 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 irq_pin: GPIO9 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/as3935_spi/test.esp32-idf.yaml b/tests/components/as3935_spi/test.esp32-idf.yaml index e00f522dd4..19791e24b7 100644 --- a/tests/components/as3935_spi/test.esp32-idf.yaml +++ b/tests/components/as3935_spi/test.esp32-idf.yaml @@ -1,8 +1,8 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 irq_pin: GPIO13 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/as3935_spi/test.esp8266-ard.yaml b/tests/components/as3935_spi/test.esp8266-ard.yaml index b90e661ec0..8475dc4c50 100644 --- a/tests/components/as3935_spi/test.esp8266-ard.yaml +++ b/tests/components/as3935_spi/test.esp8266-ard.yaml @@ -1,8 +1,11 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 irq_pin: GPIO5 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/as3935_spi/test.rp2040-ard.yaml b/tests/components/as3935_spi/test.rp2040-ard.yaml index 8f5941e1b2..7c4a74a236 100644 --- a/tests/components/as3935_spi/test.rp2040-ard.yaml +++ b/tests/components/as3935_spi/test.rp2040-ard.yaml @@ -5,4 +5,7 @@ substitutions: irq_pin: GPIO5 cs_pin: GPIO6 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/as5600/common.yaml b/tests/components/as5600/common.yaml index 860f5bf803..d867c66a21 100644 --- a/tests/components/as5600/common.yaml +++ b/tests/components/as5600/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_as5600 - scl: ${scl_pin} - sda: ${sda_pin} - as5600: + i2c_id: i2c_bus dir_pin: ${dir_pin} direction: clockwise start_position: 90deg diff --git a/tests/components/as5600/test.esp32-c3-idf.yaml b/tests/components/as5600/test.esp32-c3-idf.yaml index a0623c91e5..03a87ed6c4 100644 --- a/tests/components/as5600/test.esp32-c3-idf.yaml +++ b/tests/components/as5600/test.esp32-c3-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 dir_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/as5600/test.esp32-idf.yaml b/tests/components/as5600/test.esp32-idf.yaml index fa08763501..9d25a7f09a 100644 --- a/tests/components/as5600/test.esp32-idf.yaml +++ b/tests/components/as5600/test.esp32-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 dir_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/as5600/test.esp8266-ard.yaml b/tests/components/as5600/test.esp8266-ard.yaml index 5e27f8c134..8d18740b95 100644 --- a/tests/components/as5600/test.esp8266-ard.yaml +++ b/tests/components/as5600/test.esp8266-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 dir_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/as5600/test.rp2040-ard.yaml b/tests/components/as5600/test.rp2040-ard.yaml index a0623c91e5..4bcbb99c81 100644 --- a/tests/components/as5600/test.rp2040-ard.yaml +++ b/tests/components/as5600/test.rp2040-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 dir_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/as7341/common.yaml b/tests/components/as7341/common.yaml index 0351b344c6..3f94656c74 100644 --- a/tests/components/as7341/common.yaml +++ b/tests/components/as7341/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_as7341 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: as7341 + i2c_id: i2c_bus update_interval: 15s gain: X8 atime: 120 diff --git a/tests/components/as7341/test.esp32-c3-idf.yaml b/tests/components/as7341/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/as7341/test.esp32-c3-idf.yaml +++ b/tests/components/as7341/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/as7341/test.esp32-idf.yaml b/tests/components/as7341/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/as7341/test.esp32-idf.yaml +++ b/tests/components/as7341/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/as7341/test.esp8266-ard.yaml b/tests/components/as7341/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/as7341/test.esp8266-ard.yaml +++ b/tests/components/as7341/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/as7341/test.rp2040-ard.yaml b/tests/components/as7341/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/as7341/test.rp2040-ard.yaml +++ b/tests/components/as7341/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/at581x/common.yaml b/tests/components/at581x/common.yaml index 018a0fded1..425be47c42 100644 --- a/tests/components/at581x/common.yaml +++ b/tests/components/at581x/common.yaml @@ -16,13 +16,9 @@ esphome: id: waveradar at581x: + i2c_id: i2c_bus id: waveradar -i2c: - - id: i2c_at581x - scl: ${scl_pin} - sda: ${sda_pin} - switch: - platform: at581x name: Enable Radar diff --git a/tests/components/at581x/test.esp32-c3-idf.yaml b/tests/components/at581x/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/at581x/test.esp32-c3-idf.yaml +++ b/tests/components/at581x/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/at581x/test.esp32-idf.yaml b/tests/components/at581x/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/at581x/test.esp32-idf.yaml +++ b/tests/components/at581x/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/at581x/test.esp8266-ard.yaml b/tests/components/at581x/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/at581x/test.esp8266-ard.yaml +++ b/tests/components/at581x/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/at581x/test.rp2040-ard.yaml b/tests/components/at581x/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/at581x/test.rp2040-ard.yaml +++ b/tests/components/at581x/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/atc_mithermometer/test.esp32-c3-idf.yaml b/tests/components/atc_mithermometer/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/atc_mithermometer/test.esp32-c3-idf.yaml +++ b/tests/components/atc_mithermometer/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/atc_mithermometer/test.esp32-idf.yaml b/tests/components/atc_mithermometer/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/atc_mithermometer/test.esp32-idf.yaml +++ b/tests/components/atc_mithermometer/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/atm90e26/common.yaml b/tests/components/atm90e26/common.yaml index 49c3a73ec8..478be7b8b3 100644 --- a/tests/components/atm90e26/common.yaml +++ b/tests/components/atm90e26/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_atm90e26 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sensor: - platform: atm90e26 cs_pin: ${cs_pin} diff --git a/tests/components/atm90e26/test.esp32-c3-idf.yaml b/tests/components/atm90e26/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/atm90e26/test.esp32-c3-idf.yaml +++ b/tests/components/atm90e26/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/atm90e26/test.esp32-idf.yaml b/tests/components/atm90e26/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/atm90e26/test.esp32-idf.yaml +++ b/tests/components/atm90e26/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/atm90e26/test.esp8266-ard.yaml b/tests/components/atm90e26/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/atm90e26/test.esp8266-ard.yaml +++ b/tests/components/atm90e26/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/atm90e26/test.rp2040-ard.yaml b/tests/components/atm90e26/test.rp2040-ard.yaml index c8bfab0023..5d0c35c2d2 100644 --- a/tests/components/atm90e26/test.rp2040-ard.yaml +++ b/tests/components/atm90e26/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO6 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/atm90e32/common.yaml b/tests/components/atm90e32/common.yaml index 3eeed8395f..b8b480ab62 100644 --- a/tests/components/atm90e32/common.yaml +++ b/tests/components/atm90e32/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_atm90e32 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sensor: - platform: atm90e32 cs_pin: ${cs_pin} diff --git a/tests/components/atm90e32/test.esp32-c3-idf.yaml b/tests/components/atm90e32/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/atm90e32/test.esp32-c3-idf.yaml +++ b/tests/components/atm90e32/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/atm90e32/test.esp32-idf.yaml b/tests/components/atm90e32/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/atm90e32/test.esp32-idf.yaml +++ b/tests/components/atm90e32/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/atm90e32/test.esp8266-ard.yaml b/tests/components/atm90e32/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/atm90e32/test.esp8266-ard.yaml +++ b/tests/components/atm90e32/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/atm90e32/test.rp2040-ard.yaml b/tests/components/atm90e32/test.rp2040-ard.yaml index c8bfab0023..5d0c35c2d2 100644 --- a/tests/components/atm90e32/test.rp2040-ard.yaml +++ b/tests/components/atm90e32/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO6 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/axs15231/common.yaml b/tests/components/axs15231/common.yaml index 1c0c79975f..3f07af80ea 100644 --- a/tests/components/axs15231/common.yaml +++ b/tests/components/axs15231/common.yaml @@ -1,20 +1,18 @@ -i2c: - - id: i2c_axs15231 - scl: 3 - sda: 21 - display: - platform: ssd1306_i2c + i2c_id: i2c_bus id: ssd1306_display model: SSD1306_128X64 reset_pin: 19 pages: - - id: page1 + - id: axs15231_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); touchscreen: - platform: axs15231 + i2c_id: i2c_bus + id: axs15231_touchscreen display: ssd1306_display interrupt_pin: 20 reset_pin: 18 diff --git a/tests/components/axs15231/test.esp32-c3-idf.yaml b/tests/components/axs15231/test.esp32-c3-idf.yaml index dade44d145..9990d96d29 100644 --- a/tests/components/axs15231/test.esp32-c3-idf.yaml +++ b/tests/components/axs15231/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/axs15231/test.esp32-idf.yaml b/tests/components/axs15231/test.esp32-idf.yaml index dade44d145..b47e39c389 100644 --- a/tests/components/axs15231/test.esp32-idf.yaml +++ b/tests/components/axs15231/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/axs15231/test.esp8266-ard.yaml b/tests/components/axs15231/test.esp8266-ard.yaml index c09d139574..eb599da773 100644 --- a/tests/components/axs15231/test.esp8266-ard.yaml +++ b/tests/components/axs15231/test.esp8266-ard.yaml @@ -1,10 +1,9 @@ -i2c: - - id: i2c_axs15231 - scl: 5 - sda: 4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml display: - platform: ssd1306_i2c + i2c_id: i2c_bus id: ssd1306_display model: SSD1306_128X64 reset_pin: 13 @@ -15,5 +14,6 @@ display: touchscreen: - platform: axs15231 + i2c_id: i2c_bus display: ssd1306_display interrupt_pin: 12 diff --git a/tests/components/axs15231/test.rp2040-ard.yaml b/tests/components/axs15231/test.rp2040-ard.yaml index dade44d145..319a7c71a6 100644 --- a/tests/components/axs15231/test.rp2040-ard.yaml +++ b/tests/components/axs15231/test.rp2040-ard.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/b_parasite/test.esp32-c3-idf.yaml b/tests/components/b_parasite/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/b_parasite/test.esp32-c3-idf.yaml +++ b/tests/components/b_parasite/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/b_parasite/test.esp32-idf.yaml b/tests/components/b_parasite/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/b_parasite/test.esp32-idf.yaml +++ b/tests/components/b_parasite/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/bedjet/test.esp32-c3-idf.yaml b/tests/components/bedjet/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/bedjet/test.esp32-c3-idf.yaml +++ b/tests/components/bedjet/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/bedjet/test.esp32-idf.yaml b/tests/components/bedjet/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/bedjet/test.esp32-idf.yaml +++ b/tests/components/bedjet/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/bh1750/common.yaml b/tests/components/bh1750/common.yaml index c0e0bc1c59..46ea99b7e3 100644 --- a/tests/components/bh1750/common.yaml +++ b/tests/components/bh1750/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_bh1750 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: bh1750 + i2c_id: i2c_bus name: Living Room Brightness address: 0x23 update_interval: 30s diff --git a/tests/components/bh1750/test.esp32-c3-idf.yaml b/tests/components/bh1750/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/bh1750/test.esp32-c3-idf.yaml +++ b/tests/components/bh1750/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bh1750/test.esp32-idf.yaml b/tests/components/bh1750/test.esp32-idf.yaml index 3b761d3fc1..b47e39c389 100644 --- a/tests/components/bh1750/test.esp32-idf.yaml +++ b/tests/components/bh1750/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO22 - sda_pin: GPIO21 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/bh1750/test.esp8266-ard.yaml b/tests/components/bh1750/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/bh1750/test.esp8266-ard.yaml +++ b/tests/components/bh1750/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/bh1750/test.rp2040-ard.yaml b/tests/components/bh1750/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/bh1750/test.rp2040-ard.yaml +++ b/tests/components/bh1750/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/bl0906/common.yaml b/tests/components/bl0906/common.yaml index 29b82a5958..006aa682f1 100644 --- a/tests/components/bl0906/common.yaml +++ b/tests/components/bl0906/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_bl0906 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 19200 - sensor: - platform: bl0906 id: bl diff --git a/tests/components/bl0906/test.esp32-c3-idf.yaml b/tests/components/bl0906/test.esp32-c3-idf.yaml index c79d14c740..147d967dd4 100644 --- a/tests/components/bl0906/test.esp32-c3-idf.yaml +++ b/tests/components/bl0906/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO7 - rx_pin: GPIO8 +packages: + uart_19200: !include ../../test_build_components/common/uart_19200/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bl0906/test.esp32-idf.yaml b/tests/components/bl0906/test.esp32-idf.yaml index 811f6b72a6..76222997a8 100644 --- a/tests/components/bl0906/test.esp32-idf.yaml +++ b/tests/components/bl0906/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO12 - rx_pin: GPIO14 +packages: + uart_19200: !include ../../test_build_components/common/uart_19200/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/bl0906/test.esp8266-ard.yaml b/tests/components/bl0906/test.esp8266-ard.yaml index 3b44f9c9c3..ac781ea834 100644 --- a/tests/components/bl0906/test.esp8266-ard.yaml +++ b/tests/components/bl0906/test.esp8266-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO1 rx_pin: GPIO3 +packages: + uart_19200: !include ../../test_build_components/common/uart_19200/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/bl0906/test.rp2040-ard.yaml b/tests/components/bl0906/test.rp2040-ard.yaml index b516342f3b..f4dada6605 100644 --- a/tests/components/bl0906/test.rp2040-ard.yaml +++ b/tests/components/bl0906/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart_19200: !include ../../test_build_components/common/uart_19200/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/bl0939/common.yaml b/tests/components/bl0939/common.yaml index 7a6b635b70..a47aa05606 100644 --- a/tests/components/bl0939/common.yaml +++ b/tests/components/bl0939/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_bl0939 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - sensor: - platform: bl0939 voltage: diff --git a/tests/components/bl0939/test.esp32-c3-idf.yaml b/tests/components/bl0939/test.esp32-c3-idf.yaml index c79d14c740..4b7c8351a7 100644 --- a/tests/components/bl0939/test.esp32-c3-idf.yaml +++ b/tests/components/bl0939/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO7 - rx_pin: GPIO8 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bl0939/test.esp32-idf.yaml b/tests/components/bl0939/test.esp32-idf.yaml index 811f6b72a6..64baa4ec9d 100644 --- a/tests/components/bl0939/test.esp32-idf.yaml +++ b/tests/components/bl0939/test.esp32-idf.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO12 rx_pin: GPIO14 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/bl0939/test.esp8266-ard.yaml b/tests/components/bl0939/test.esp8266-ard.yaml index 3b44f9c9c3..89ca3ab5ae 100644 --- a/tests/components/bl0939/test.esp8266-ard.yaml +++ b/tests/components/bl0939/test.esp8266-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO1 rx_pin: GPIO3 +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/bl0939/test.rp2040-ard.yaml b/tests/components/bl0939/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/bl0939/test.rp2040-ard.yaml +++ b/tests/components/bl0939/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/bl0940/common.yaml b/tests/components/bl0940/common.yaml index 443f3b0ff0..0b73fd6d55 100644 --- a/tests/components/bl0940/common.yaml +++ b/tests/components/bl0940/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_bl0939 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - button: - platform: bl0940 bl0940_id: test_id diff --git a/tests/components/bl0940/test.esp32-c3-idf.yaml b/tests/components/bl0940/test.esp32-c3-idf.yaml index c79d14c740..4b7c8351a7 100644 --- a/tests/components/bl0940/test.esp32-c3-idf.yaml +++ b/tests/components/bl0940/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO7 - rx_pin: GPIO8 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bl0940/test.esp32-idf.yaml b/tests/components/bl0940/test.esp32-idf.yaml index 811f6b72a6..64baa4ec9d 100644 --- a/tests/components/bl0940/test.esp32-idf.yaml +++ b/tests/components/bl0940/test.esp32-idf.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO12 rx_pin: GPIO14 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/bl0940/test.esp8266-ard.yaml b/tests/components/bl0940/test.esp8266-ard.yaml index 3b44f9c9c3..89ca3ab5ae 100644 --- a/tests/components/bl0940/test.esp8266-ard.yaml +++ b/tests/components/bl0940/test.esp8266-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO1 rx_pin: GPIO3 +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/bl0940/test.rp2040-ard.yaml b/tests/components/bl0940/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/bl0940/test.rp2040-ard.yaml +++ b/tests/components/bl0940/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/bl0942/common.yaml b/tests/components/bl0942/common.yaml index 32da24885f..1aaab8bb86 100644 --- a/tests/components/bl0942/common.yaml +++ b/tests/components/bl0942/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_bl0939 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - sensor: - platform: bl0942 reset: true diff --git a/tests/components/bl0942/test.bk72xx-ard.yaml b/tests/components/bl0942/test.bk72xx-ard.yaml index 96e13c83a9..0caf71ba1f 100644 --- a/tests/components/bl0942/test.bk72xx-ard.yaml +++ b/tests/components/bl0942/test.bk72xx-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: TX1 - rx_pin: RX1 +packages: + uart: !include ../../test_build_components/common/uart/bk72xx-ard.yaml <<: !include common.yaml diff --git a/tests/components/bl0942/test.esp32-c3-idf.yaml b/tests/components/bl0942/test.esp32-c3-idf.yaml index c79d14c740..4b7c8351a7 100644 --- a/tests/components/bl0942/test.esp32-c3-idf.yaml +++ b/tests/components/bl0942/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO7 - rx_pin: GPIO8 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bl0942/test.esp32-idf.yaml b/tests/components/bl0942/test.esp32-idf.yaml index 811f6b72a6..64baa4ec9d 100644 --- a/tests/components/bl0942/test.esp32-idf.yaml +++ b/tests/components/bl0942/test.esp32-idf.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO12 rx_pin: GPIO14 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/bl0942/test.esp8266-ard.yaml b/tests/components/bl0942/test.esp8266-ard.yaml index 3b44f9c9c3..89ca3ab5ae 100644 --- a/tests/components/bl0942/test.esp8266-ard.yaml +++ b/tests/components/bl0942/test.esp8266-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO1 rx_pin: GPIO3 +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/bl0942/test.rp2040-ard.yaml b/tests/components/bl0942/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/bl0942/test.rp2040-ard.yaml +++ b/tests/components/bl0942/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ble_client/test.esp32-c3-idf.yaml b/tests/components/ble_client/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/ble_client/test.esp32-c3-idf.yaml +++ b/tests/components/ble_client/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ble_client/test.esp32-idf.yaml b/tests/components/ble_client/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/ble_client/test.esp32-idf.yaml +++ b/tests/components/ble_client/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ble_presence/test.esp32-c3-idf.yaml b/tests/components/ble_presence/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/ble_presence/test.esp32-c3-idf.yaml +++ b/tests/components/ble_presence/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ble_presence/test.esp32-idf.yaml b/tests/components/ble_presence/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/ble_presence/test.esp32-idf.yaml +++ b/tests/components/ble_presence/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ble_rssi/test.esp32-c3-idf.yaml b/tests/components/ble_rssi/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/ble_rssi/test.esp32-c3-idf.yaml +++ b/tests/components/ble_rssi/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ble_rssi/test.esp32-idf.yaml b/tests/components/ble_rssi/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/ble_rssi/test.esp32-idf.yaml +++ b/tests/components/ble_rssi/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ble_scanner/test.esp32-c3-idf.yaml b/tests/components/ble_scanner/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/ble_scanner/test.esp32-c3-idf.yaml +++ b/tests/components/ble_scanner/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ble_scanner/test.esp32-idf.yaml b/tests/components/ble_scanner/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/ble_scanner/test.esp32-idf.yaml +++ b/tests/components/ble_scanner/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/bluetooth_proxy/test.esp32-p4-idf.yaml b/tests/components/bluetooth_proxy/test.esp32-p4-idf.yaml new file mode 100644 index 0000000000..edb18c1ada --- /dev/null +++ b/tests/components/bluetooth_proxy/test.esp32-p4-idf.yaml @@ -0,0 +1,19 @@ +<<: !include common.yaml + +esp32_ble_tracker: + max_connections: 9 + +bluetooth_proxy: + active: true + connection_slots: 9 + +esp32_hosted: + active_high: true + variant: ESP32C6 + reset_pin: GPIO54 + cmd_pin: GPIO19 + clk_pin: GPIO18 + d0_pin: GPIO14 + d1_pin: GPIO15 + d2_pin: GPIO16 + d3_pin: GPIO17 diff --git a/tests/components/bme280_i2c/common.yaml b/tests/components/bme280_i2c/common.yaml index e74ce9bf6d..e6d41d209c 100644 --- a/tests/components/bme280_i2c/common.yaml +++ b/tests/components/bme280_i2c/common.yaml @@ -1,11 +1,6 @@ -i2c: - - id: i2c_bme280 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: bme280_i2c - i2c_id: i2c_bme280 + i2c_id: i2c_bus address: 0x76 temperature: id: bme280_temperature diff --git a/tests/components/bme280_i2c/test.esp32-c3-idf.yaml b/tests/components/bme280_i2c/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/bme280_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/bme280_i2c/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bme280_i2c/test.esp32-idf.yaml b/tests/components/bme280_i2c/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/bme280_i2c/test.esp32-idf.yaml +++ b/tests/components/bme280_i2c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/bme280_i2c/test.esp8266-ard.yaml b/tests/components/bme280_i2c/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/bme280_i2c/test.esp8266-ard.yaml +++ b/tests/components/bme280_i2c/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/bme280_i2c/test.rp2040-ard.yaml b/tests/components/bme280_i2c/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/bme280_i2c/test.rp2040-ard.yaml +++ b/tests/components/bme280_i2c/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/bme280_spi/common.yaml b/tests/components/bme280_spi/common.yaml index 303ecf9f73..9a50b410fb 100644 --- a/tests/components/bme280_spi/common.yaml +++ b/tests/components/bme280_spi/common.yaml @@ -1,12 +1,5 @@ -spi: - - id: spi_bme280 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sensor: - platform: bme280_spi - spi_id: spi_bme280 cs_pin: ${cs_pin} temperature: id: bme280_temperature diff --git a/tests/components/bme280_spi/test.esp32-c3-idf.yaml b/tests/components/bme280_spi/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/bme280_spi/test.esp32-c3-idf.yaml +++ b/tests/components/bme280_spi/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bme280_spi/test.esp32-idf.yaml b/tests/components/bme280_spi/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/bme280_spi/test.esp32-idf.yaml +++ b/tests/components/bme280_spi/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/bme280_spi/test.esp8266-ard.yaml b/tests/components/bme280_spi/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/bme280_spi/test.esp8266-ard.yaml +++ b/tests/components/bme280_spi/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/bme280_spi/test.rp2040-ard.yaml b/tests/components/bme280_spi/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/bme280_spi/test.rp2040-ard.yaml +++ b/tests/components/bme280_spi/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/bme680/common.yaml b/tests/components/bme680/common.yaml index 13a42488f2..d5a7267060 100644 --- a/tests/components/bme680/common.yaml +++ b/tests/components/bme680/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_bme680 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: bme680 + i2c_id: i2c_bus temperature: name: BME680 Temperature oversampling: 16x diff --git a/tests/components/bme680/test.esp32-c3-idf.yaml b/tests/components/bme680/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/bme680/test.esp32-c3-idf.yaml +++ b/tests/components/bme680/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bme680/test.esp32-idf.yaml b/tests/components/bme680/test.esp32-idf.yaml index 3b761d3fc1..b47e39c389 100644 --- a/tests/components/bme680/test.esp32-idf.yaml +++ b/tests/components/bme680/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO22 - sda_pin: GPIO21 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/bme680/test.esp8266-ard.yaml b/tests/components/bme680/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/bme680/test.esp8266-ard.yaml +++ b/tests/components/bme680/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/bme680/test.rp2040-ard.yaml b/tests/components/bme680/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/bme680/test.rp2040-ard.yaml +++ b/tests/components/bme680/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/bme680_bsec/common.yaml b/tests/components/bme680_bsec/common.yaml index 7d2e9e210b..1a78ab2ae0 100644 --- a/tests/components/bme680_bsec/common.yaml +++ b/tests/components/bme680_bsec/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_bme680 - scl: ${scl_pin} - sda: ${sda_pin} - bme680_bsec: + i2c_id: i2c_bus address: 0x77 sensor: diff --git a/tests/components/bme680_bsec/test.esp32-ard.yaml b/tests/components/bme680_bsec/test.esp32-ard.yaml index 3b761d3fc1..7c503b0ccb 100644 --- a/tests/components/bme680_bsec/test.esp32-ard.yaml +++ b/tests/components/bme680_bsec/test.esp32-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO22 - sda_pin: GPIO21 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-ard.yaml <<: !include common.yaml diff --git a/tests/components/bme680_bsec/test.esp8266-ard.yaml b/tests/components/bme680_bsec/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/bme680_bsec/test.esp8266-ard.yaml +++ b/tests/components/bme680_bsec/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/bme68x_bsec2_i2c/common.yaml b/tests/components/bme68x_bsec2_i2c/common.yaml index b8a16ee7bb..bee964f433 100644 --- a/tests/components/bme68x_bsec2_i2c/common.yaml +++ b/tests/components/bme68x_bsec2_i2c/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_bme68x - scl: ${scl_pin} - sda: ${sda_pin} - bme68x_bsec2_i2c: + i2c_id: i2c_bus address: 0x76 model: bme688 algorithm_output: classification diff --git a/tests/components/bme68x_bsec2_i2c/test.esp32-c3-idf.yaml b/tests/components/bme68x_bsec2_i2c/test.esp32-c3-idf.yaml index 84a9dd4bb4..9990d96d29 100644 --- a/tests/components/bme68x_bsec2_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/bme68x_bsec2_i2c/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO6 - sda_pin: GPIO7 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bme68x_bsec2_i2c/test.esp32-idf.yaml b/tests/components/bme68x_bsec2_i2c/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/bme68x_bsec2_i2c/test.esp32-idf.yaml +++ b/tests/components/bme68x_bsec2_i2c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/bme68x_bsec2_i2c/test.esp32-s2-idf.yaml b/tests/components/bme68x_bsec2_i2c/test.esp32-s2-idf.yaml index 63c3bd6afd..54f59a59fc 100644 --- a/tests/components/bme68x_bsec2_i2c/test.esp32-s2-idf.yaml +++ b/tests/components/bme68x_bsec2_i2c/test.esp32-s2-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-s2-idf.yaml <<: !include common.yaml diff --git a/tests/components/bme68x_bsec2_i2c/test.esp32-s3-idf.yaml b/tests/components/bme68x_bsec2_i2c/test.esp32-s3-idf.yaml index 63c3bd6afd..0fd8684a2c 100644 --- a/tests/components/bme68x_bsec2_i2c/test.esp32-s3-idf.yaml +++ b/tests/components/bme68x_bsec2_i2c/test.esp32-s3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-s3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bme68x_bsec2_i2c/test.esp8266-ard.yaml b/tests/components/bme68x_bsec2_i2c/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/bme68x_bsec2_i2c/test.esp8266-ard.yaml +++ b/tests/components/bme68x_bsec2_i2c/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/bme68x_bsec2_i2c/test.rp2040-ard.yaml b/tests/components/bme68x_bsec2_i2c/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/bme68x_bsec2_i2c/test.rp2040-ard.yaml +++ b/tests/components/bme68x_bsec2_i2c/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/bmi160/common.yaml b/tests/components/bmi160/common.yaml index 6aa9aa6ed0..7375732db2 100644 --- a/tests/components/bmi160/common.yaml +++ b/tests/components/bmi160/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_bmi160 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: bmi160 + i2c_id: i2c_bus address: 0x68 acceleration_x: name: BMI160 Accel X diff --git a/tests/components/bmi160/test.esp32-c3-idf.yaml b/tests/components/bmi160/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/bmi160/test.esp32-c3-idf.yaml +++ b/tests/components/bmi160/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bmi160/test.esp32-idf.yaml b/tests/components/bmi160/test.esp32-idf.yaml index 3b761d3fc1..b47e39c389 100644 --- a/tests/components/bmi160/test.esp32-idf.yaml +++ b/tests/components/bmi160/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO22 - sda_pin: GPIO21 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/bmi160/test.esp8266-ard.yaml b/tests/components/bmi160/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/bmi160/test.esp8266-ard.yaml +++ b/tests/components/bmi160/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/bmi160/test.rp2040-ard.yaml b/tests/components/bmi160/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/bmi160/test.rp2040-ard.yaml +++ b/tests/components/bmi160/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/bmp085/common.yaml b/tests/components/bmp085/common.yaml index 219bc51fbb..ad358f4409 100644 --- a/tests/components/bmp085/common.yaml +++ b/tests/components/bmp085/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_bmp085 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: bmp085 + i2c_id: i2c_bus temperature: name: Outside Temperature pressure: diff --git a/tests/components/bmp085/test.esp32-c3-idf.yaml b/tests/components/bmp085/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/bmp085/test.esp32-c3-idf.yaml +++ b/tests/components/bmp085/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bmp085/test.esp32-idf.yaml b/tests/components/bmp085/test.esp32-idf.yaml index 3b761d3fc1..b47e39c389 100644 --- a/tests/components/bmp085/test.esp32-idf.yaml +++ b/tests/components/bmp085/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO22 - sda_pin: GPIO21 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/bmp085/test.esp8266-ard.yaml b/tests/components/bmp085/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/bmp085/test.esp8266-ard.yaml +++ b/tests/components/bmp085/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/bmp085/test.rp2040-ard.yaml b/tests/components/bmp085/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/bmp085/test.rp2040-ard.yaml +++ b/tests/components/bmp085/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/bmp280_i2c/common.yaml b/tests/components/bmp280_i2c/common.yaml index edf52b2cd4..785343de7d 100644 --- a/tests/components/bmp280_i2c/common.yaml +++ b/tests/components/bmp280_i2c/common.yaml @@ -1,11 +1,6 @@ -i2c: - - id: i2c_bmp280 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: bmp280_i2c - i2c_id: i2c_bmp280 + i2c_id: i2c_bus address: 0x77 temperature: id: bmp280_temperature diff --git a/tests/components/bmp280_i2c/test.esp32-c3-idf.yaml b/tests/components/bmp280_i2c/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/bmp280_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/bmp280_i2c/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bmp280_i2c/test.esp32-idf.yaml b/tests/components/bmp280_i2c/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/bmp280_i2c/test.esp32-idf.yaml +++ b/tests/components/bmp280_i2c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/bmp280_i2c/test.esp8266-ard.yaml b/tests/components/bmp280_i2c/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/bmp280_i2c/test.esp8266-ard.yaml +++ b/tests/components/bmp280_i2c/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/bmp280_i2c/test.rp2040-ard.yaml b/tests/components/bmp280_i2c/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/bmp280_i2c/test.rp2040-ard.yaml +++ b/tests/components/bmp280_i2c/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/bmp280_spi/common.yaml b/tests/components/bmp280_spi/common.yaml index 798804de5b..fa88967ca4 100644 --- a/tests/components/bmp280_spi/common.yaml +++ b/tests/components/bmp280_spi/common.yaml @@ -1,12 +1,5 @@ -spi: - - id: spi_bmp280 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sensor: - platform: bmp280_spi - spi_id: spi_bmp280 cs_pin: ${cs_pin} temperature: id: bmp280_temperature diff --git a/tests/components/bmp280_spi/test.esp32-c3-idf.yaml b/tests/components/bmp280_spi/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/bmp280_spi/test.esp32-c3-idf.yaml +++ b/tests/components/bmp280_spi/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bmp280_spi/test.esp32-idf.yaml b/tests/components/bmp280_spi/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/bmp280_spi/test.esp32-idf.yaml +++ b/tests/components/bmp280_spi/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/bmp280_spi/test.esp8266-ard.yaml b/tests/components/bmp280_spi/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/bmp280_spi/test.esp8266-ard.yaml +++ b/tests/components/bmp280_spi/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/bmp280_spi/test.rp2040-ard.yaml b/tests/components/bmp280_spi/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/bmp280_spi/test.rp2040-ard.yaml +++ b/tests/components/bmp280_spi/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/bmp3xx_i2c/common.yaml b/tests/components/bmp3xx_i2c/common.yaml index 6641b7a1b8..ebc4921b84 100644 --- a/tests/components/bmp3xx_i2c/common.yaml +++ b/tests/components/bmp3xx_i2c/common.yaml @@ -1,11 +1,6 @@ -i2c: - - id: i2c_bmp3xx - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: bmp3xx_i2c - i2c_id: i2c_bmp3xx + i2c_id: i2c_bus address: 0x77 temperature: name: BMP Temperature diff --git a/tests/components/bmp3xx_i2c/test.esp32-c3-idf.yaml b/tests/components/bmp3xx_i2c/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/bmp3xx_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/bmp3xx_i2c/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bmp3xx_i2c/test.esp32-idf.yaml b/tests/components/bmp3xx_i2c/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/bmp3xx_i2c/test.esp32-idf.yaml +++ b/tests/components/bmp3xx_i2c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/bmp3xx_i2c/test.esp8266-ard.yaml b/tests/components/bmp3xx_i2c/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/bmp3xx_i2c/test.esp8266-ard.yaml +++ b/tests/components/bmp3xx_i2c/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/bmp3xx_i2c/test.rp2040-ard.yaml b/tests/components/bmp3xx_i2c/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/bmp3xx_i2c/test.rp2040-ard.yaml +++ b/tests/components/bmp3xx_i2c/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/bmp3xx_spi/common.yaml b/tests/components/bmp3xx_spi/common.yaml index 8d5f897661..d6acef1833 100644 --- a/tests/components/bmp3xx_spi/common.yaml +++ b/tests/components/bmp3xx_spi/common.yaml @@ -1,12 +1,5 @@ -spi: - - id: spi_bmp3xx - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sensor: - platform: bmp3xx_spi - spi_id: spi_bmp3xx cs_pin: ${cs_pin} temperature: name: BMP Temperature diff --git a/tests/components/bmp3xx_spi/test.esp32-c3-idf.yaml b/tests/components/bmp3xx_spi/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/bmp3xx_spi/test.esp32-c3-idf.yaml +++ b/tests/components/bmp3xx_spi/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bmp3xx_spi/test.esp32-idf.yaml b/tests/components/bmp3xx_spi/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/bmp3xx_spi/test.esp32-idf.yaml +++ b/tests/components/bmp3xx_spi/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/bmp3xx_spi/test.esp8266-ard.yaml b/tests/components/bmp3xx_spi/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/bmp3xx_spi/test.esp8266-ard.yaml +++ b/tests/components/bmp3xx_spi/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/bmp3xx_spi/test.rp2040-ard.yaml b/tests/components/bmp3xx_spi/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/bmp3xx_spi/test.rp2040-ard.yaml +++ b/tests/components/bmp3xx_spi/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/bmp581/common.yaml b/tests/components/bmp581/common.yaml index 71ad4bfb1a..250b1f5857 100644 --- a/tests/components/bmp581/common.yaml +++ b/tests/components/bmp581/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_bmp581 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: bmp581 + i2c_id: i2c_bus temperature: name: BMP581 Temperature iir_filter: 2x diff --git a/tests/components/bmp581/test.esp32-c3-idf.yaml b/tests/components/bmp581/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/bmp581/test.esp32-c3-idf.yaml +++ b/tests/components/bmp581/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/bmp581/test.esp32-idf.yaml b/tests/components/bmp581/test.esp32-idf.yaml index 3b761d3fc1..b47e39c389 100644 --- a/tests/components/bmp581/test.esp32-idf.yaml +++ b/tests/components/bmp581/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO22 - sda_pin: GPIO21 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/bmp581/test.esp8266-ard.yaml b/tests/components/bmp581/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/bmp581/test.esp8266-ard.yaml +++ b/tests/components/bmp581/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/bmp581/test.rp2040-ard.yaml b/tests/components/bmp581/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/bmp581/test.rp2040-ard.yaml +++ b/tests/components/bmp581/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/bp1658cj/test.esp32-idf.yaml b/tests/components/bp1658cj/test.esp32-idf.yaml index d295973e3f..a4ecdb6c49 100644 --- a/tests/components/bp1658cj/test.esp32-idf.yaml +++ b/tests/components/bp1658cj/test.esp32-idf.yaml @@ -1,5 +1,5 @@ substitutions: - clock_pin: GPIO16 - data_pin: GPIO17 + clock_pin: GPIO4 + data_pin: GPIO5 <<: !include common.yaml diff --git a/tests/components/bp1658cj/test.esp8266-ard.yaml b/tests/components/bp1658cj/test.esp8266-ard.yaml index 7808481215..7c7f1e1a11 100644 --- a/tests/components/bp1658cj/test.esp8266-ard.yaml +++ b/tests/components/bp1658cj/test.esp8266-ard.yaml @@ -1,5 +1,5 @@ substitutions: - clock_pin: GPIO5 - data_pin: GPIO4 + clock_pin: GPIO0 + data_pin: GPIO2 <<: !include common.yaml diff --git a/tests/components/bp5758d/test.esp32-idf.yaml b/tests/components/bp5758d/test.esp32-idf.yaml index d295973e3f..a4ecdb6c49 100644 --- a/tests/components/bp5758d/test.esp32-idf.yaml +++ b/tests/components/bp5758d/test.esp32-idf.yaml @@ -1,5 +1,5 @@ substitutions: - clock_pin: GPIO16 - data_pin: GPIO17 + clock_pin: GPIO4 + data_pin: GPIO5 <<: !include common.yaml diff --git a/tests/components/bp5758d/test.esp8266-ard.yaml b/tests/components/bp5758d/test.esp8266-ard.yaml index 7808481215..7c7f1e1a11 100644 --- a/tests/components/bp5758d/test.esp8266-ard.yaml +++ b/tests/components/bp5758d/test.esp8266-ard.yaml @@ -1,5 +1,5 @@ substitutions: - clock_pin: GPIO5 - data_pin: GPIO4 + clock_pin: GPIO0 + data_pin: GPIO2 <<: !include common.yaml diff --git a/tests/components/camera/common.yaml b/tests/components/camera/common.yaml index 3daf1e8565..76cca4cf94 100644 --- a/tests/components/camera/common.yaml +++ b/tests/components/camera/common.yaml @@ -1,18 +1,2 @@ -esphome: - includes: - - ../../../esphome/components/camera/ - -script: - - id: interface_compile_check - then: - - lambda: |- - using namespace esphome::camera; - class MockCamera : public Camera { - public: - void add_image_callback(std::function)> &&callback) override {} - CameraImageReader *create_image_reader() override { return 0; } - void request_image(CameraRequester requester) override {} - void start_stream(CameraRequester requester) override {} - void stop_stream(CameraRequester requester) override {} - }; - MockCamera* camera = new MockCamera(); +# Camera is a base component auto-loaded by esp32_camera +# The hardware configuration comes from the camera package diff --git a/tests/components/camera/test.esp32-idf.yaml b/tests/components/camera/test.esp32-idf.yaml index dade44d145..3d93dd6418 100644 --- a/tests/components/camera/test.esp32-idf.yaml +++ b/tests/components/camera/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + camera: !include ../../test_build_components/common/camera/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/camera_encoder/test.esp32-idf.yaml b/tests/components/camera_encoder/test.esp32-idf.yaml index dade44d145..3d93dd6418 100644 --- a/tests/components/camera_encoder/test.esp32-idf.yaml +++ b/tests/components/camera_encoder/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + camera: !include ../../test_build_components/common/camera/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/canbus/test.esp32-idf.yaml b/tests/components/canbus/test.esp32-idf.yaml index dade44d145..2d29656c94 100644 --- a/tests/components/canbus/test.esp32-idf.yaml +++ b/tests/components/canbus/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/cap1188/common.yaml b/tests/components/cap1188/common.yaml index e83bf5d5d2..3e4ed972ff 100644 --- a/tests/components/cap1188/common.yaml +++ b/tests/components/cap1188/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_cap1188 - scl: ${scl_pin} - sda: ${sda_pin} - cap1188: id: cap1188_component + i2c_id: i2c_bus address: 0x29 reset_pin: ${reset_pin} touch_threshold: 0x20 diff --git a/tests/components/cap1188/test.esp32-c3-idf.yaml b/tests/components/cap1188/test.esp32-c3-idf.yaml index 1e6670c196..c97f30d52c 100644 --- a/tests/components/cap1188/test.esp32-c3-idf.yaml +++ b/tests/components/cap1188/test.esp32-c3-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/cap1188/test.esp32-idf.yaml b/tests/components/cap1188/test.esp32-idf.yaml index 1ca773e06c..4ff2241ec9 100644 --- a/tests/components/cap1188/test.esp32-idf.yaml +++ b/tests/components/cap1188/test.esp32-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 reset_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/cap1188/test.esp8266-ard.yaml b/tests/components/cap1188/test.esp8266-ard.yaml index dfdc12a3d1..b8bb94edde 100644 --- a/tests/components/cap1188/test.esp8266-ard.yaml +++ b/tests/components/cap1188/test.esp8266-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/cap1188/test.rp2040-ard.yaml b/tests/components/cap1188/test.rp2040-ard.yaml index 1e6670c196..1bf10642c5 100644 --- a/tests/components/cap1188/test.rp2040-ard.yaml +++ b/tests/components/cap1188/test.rp2040-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ccs811/common.yaml b/tests/components/ccs811/common.yaml index a781996c66..0d912fd3ac 100644 --- a/tests/components/ccs811/common.yaml +++ b/tests/components/ccs811/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_ccs811 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: ccs811 + i2c_id: i2c_bus eco2: name: CCS811 eCO2 tvoc: diff --git a/tests/components/ccs811/test.esp32-c3-idf.yaml b/tests/components/ccs811/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ccs811/test.esp32-c3-idf.yaml +++ b/tests/components/ccs811/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ccs811/test.esp32-idf.yaml b/tests/components/ccs811/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ccs811/test.esp32-idf.yaml +++ b/tests/components/ccs811/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ccs811/test.esp8266-ard.yaml b/tests/components/ccs811/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ccs811/test.esp8266-ard.yaml +++ b/tests/components/ccs811/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ccs811/test.rp2040-ard.yaml b/tests/components/ccs811/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ccs811/test.rp2040-ard.yaml +++ b/tests/components/ccs811/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ch422g/common.yaml b/tests/components/ch422g/common.yaml index d65956ecac..ad3707eee0 100644 --- a/tests/components/ch422g/common.yaml +++ b/tests/components/ch422g/common.yaml @@ -1,5 +1,6 @@ ch422g: - id: ch422g_hub + i2c_id: i2c_bus binary_sensor: - platform: gpio diff --git a/tests/components/ch422g/test.esp32-c3-idf.yaml b/tests/components/ch422g/test.esp32-c3-idf.yaml index cd822cb308..9990d96d29 100644 --- a/tests/components/ch422g/test.esp32-c3-idf.yaml +++ b/tests/components/ch422g/test.esp32-c3-idf.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_ch422g - scl: 5 - sda: 4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ch422g/test.esp32-idf.yaml b/tests/components/ch422g/test.esp32-idf.yaml index cd3f1bbeef..b47e39c389 100644 --- a/tests/components/ch422g/test.esp32-idf.yaml +++ b/tests/components/ch422g/test.esp32-idf.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_ch422g - scl: 16 - sda: 17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ch422g/test.esp8266-ard.yaml b/tests/components/ch422g/test.esp8266-ard.yaml index cd822cb308..4a98b9388a 100644 --- a/tests/components/ch422g/test.esp8266-ard.yaml +++ b/tests/components/ch422g/test.esp8266-ard.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_ch422g - scl: 5 - sda: 4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ch422g/test.rp2040-ard.yaml b/tests/components/ch422g/test.rp2040-ard.yaml index cd822cb308..319a7c71a6 100644 --- a/tests/components/ch422g/test.rp2040-ard.yaml +++ b/tests/components/ch422g/test.rp2040-ard.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_ch422g - scl: 5 - sda: 4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/chsc6x/test.esp32-c3-idf.yaml b/tests/components/chsc6x/test.esp32-c3-idf.yaml index b0f55eb2e6..f32f147a44 100644 --- a/tests/components/chsc6x/test.esp32-c3-idf.yaml +++ b/tests/components/chsc6x/test.esp32-c3-idf.yaml @@ -1,19 +1,14 @@ -i2c: - - id: i2c_chsc6x - scl: 3 - sda: 9 - -spi: - clk_pin: 5 - mosi_pin: 4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml display: - platform: ili9xxx id: ili9xxx_display model: GC9A01A invert_colors: True - cs_pin: 18 - dc_pin: 19 + cs_pin: 10 + dc_pin: 6 pages: - id: page1 lambda: |- diff --git a/tests/components/chsc6x/test.esp32-idf.yaml b/tests/components/chsc6x/test.esp32-idf.yaml index 9bc58b66f6..ea3686d8bd 100644 --- a/tests/components/chsc6x/test.esp32-idf.yaml +++ b/tests/components/chsc6x/test.esp32-idf.yaml @@ -1,19 +1,14 @@ -i2c: - - id: i2c_chsc6x - scl: 3 - sda: 21 - -spi: - clk_pin: 16 - mosi_pin: 17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml display: - platform: ili9xxx id: ili9xxx_display model: GC9A01A invert_colors: True - cs_pin: 18 - dc_pin: 19 + cs_pin: 22 + dc_pin: 21 pages: - id: page1 lambda: |- diff --git a/tests/components/chsc6x/test.rp2040-ard.yaml b/tests/components/chsc6x/test.rp2040-ard.yaml index dbd0d59fc4..89cc1b7477 100644 --- a/tests/components/chsc6x/test.rp2040-ard.yaml +++ b/tests/components/chsc6x/test.rp2040-ard.yaml @@ -1,19 +1,14 @@ -i2c: - - id: i2c_chsc6x - scl: 1 - sda: 0 - -spi: - clk_pin: 2 - mosi_pin: 3 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml display: - platform: ili9xxx id: ili9xxx_display model: GC9A01A invert_colors: True - cs_pin: 18 - dc_pin: 19 + cs_pin: 20 + dc_pin: 21 pages: - id: page1 lambda: |- @@ -22,4 +17,4 @@ display: touchscreen: - platform: chsc6x display: ili9xxx_display - interrupt_pin: 20 + interrupt_pin: 22 diff --git a/tests/components/cm1106/common.yaml b/tests/components/cm1106/common.yaml index a01e78024e..ed2fd67007 100644 --- a/tests/components/cm1106/common.yaml +++ b/tests/components/cm1106/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_cm1106 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - sensor: - platform: cm1106 co2: diff --git a/tests/components/cm1106/test.esp32-c3-idf.yaml b/tests/components/cm1106/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/cm1106/test.esp32-c3-idf.yaml +++ b/tests/components/cm1106/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/cm1106/test.esp32-idf.yaml b/tests/components/cm1106/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/cm1106/test.esp32-idf.yaml +++ b/tests/components/cm1106/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/cm1106/test.esp8266-ard.yaml b/tests/components/cm1106/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/cm1106/test.esp8266-ard.yaml +++ b/tests/components/cm1106/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/cm1106/test.rp2040-ard.yaml b/tests/components/cm1106/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/cm1106/test.rp2040-ard.yaml +++ b/tests/components/cm1106/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/const/common.yaml b/tests/components/const/common.yaml index f4b15f2b90..109db65b63 100644 --- a/tests/components/const/common.yaml +++ b/tests/components/const/common.yaml @@ -1,9 +1,3 @@ -spi: - id: quad_spi - clk_pin: 15 - type: quad - data_pins: [14, 10, 16, 12] - display: - platform: qspi_dbi model: RM690B0 diff --git a/tests/components/const/test.esp32-s3-idf.yaml b/tests/components/const/test.esp32-s3-idf.yaml index dade44d145..c335dee1f3 100644 --- a/tests/components/const/test.esp32-s3-idf.yaml +++ b/tests/components/const/test.esp32-s3-idf.yaml @@ -1 +1,4 @@ +packages: + qspi: !include ../../test_build_components/common/qspi/esp32-s3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/cs5460a/common.yaml b/tests/components/cs5460a/common.yaml index d97b01716b..9ecd934eda 100644 --- a/tests/components/cs5460a/common.yaml +++ b/tests/components/cs5460a/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_cs5460a - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sensor: - platform: cs5460a id: cs5460a1 diff --git a/tests/components/cs5460a/test.esp32-c3-idf.yaml b/tests/components/cs5460a/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/cs5460a/test.esp32-c3-idf.yaml +++ b/tests/components/cs5460a/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/cs5460a/test.esp32-idf.yaml b/tests/components/cs5460a/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/cs5460a/test.esp32-idf.yaml +++ b/tests/components/cs5460a/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/cs5460a/test.esp8266-ard.yaml b/tests/components/cs5460a/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/cs5460a/test.esp8266-ard.yaml +++ b/tests/components/cs5460a/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/cs5460a/test.rp2040-ard.yaml b/tests/components/cs5460a/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/cs5460a/test.rp2040-ard.yaml +++ b/tests/components/cs5460a/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/cse7761/common.yaml b/tests/components/cse7761/common.yaml index 60cce3864a..77b19957b4 100644 --- a/tests/components/cse7761/common.yaml +++ b/tests/components/cse7761/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_cse7761 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 38400 - sensor: - platform: cse7761 voltage: diff --git a/tests/components/cse7761/test.esp32-c3-idf.yaml b/tests/components/cse7761/test.esp32-c3-idf.yaml index c79d14c740..4e11c6e7cb 100644 --- a/tests/components/cse7761/test.esp32-c3-idf.yaml +++ b/tests/components/cse7761/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO7 - rx_pin: GPIO8 +packages: + uart_38400: !include ../../test_build_components/common/uart_38400/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/cse7761/test.esp32-idf.yaml b/tests/components/cse7761/test.esp32-idf.yaml index 811f6b72a6..a6a8fee7e9 100644 --- a/tests/components/cse7761/test.esp32-idf.yaml +++ b/tests/components/cse7761/test.esp32-idf.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO12 rx_pin: GPIO14 +packages: + uart_38400: !include ../../test_build_components/common/uart_38400/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/cse7761/test.esp8266-ard.yaml b/tests/components/cse7761/test.esp8266-ard.yaml index 3b44f9c9c3..134274ffb8 100644 --- a/tests/components/cse7761/test.esp8266-ard.yaml +++ b/tests/components/cse7761/test.esp8266-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO1 rx_pin: GPIO3 +packages: + uart_38400: !include ../../test_build_components/common/uart_38400/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/cse7761/test.rp2040-ard.yaml b/tests/components/cse7761/test.rp2040-ard.yaml index b516342f3b..b813e0f7f1 100644 --- a/tests/components/cse7761/test.rp2040-ard.yaml +++ b/tests/components/cse7761/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart_38400: !include ../../test_build_components/common/uart_38400/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/cse7766/common.yaml b/tests/components/cse7766/common.yaml index f12b135a77..6db19691f1 100644 --- a/tests/components/cse7766/common.yaml +++ b/tests/components/cse7766/common.yaml @@ -1,10 +1,3 @@ -uart: - - id: uart_cse7766 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 4800 - parity: EVEN - sensor: - platform: cse7766 voltage: diff --git a/tests/components/cse7766/test.esp32-c3-idf.yaml b/tests/components/cse7766/test.esp32-c3-idf.yaml index c79d14c740..dc95c985c7 100644 --- a/tests/components/cse7766/test.esp32-c3-idf.yaml +++ b/tests/components/cse7766/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO7 - rx_pin: GPIO8 +packages: + uart_4800_even: !include ../../test_build_components/common/uart_4800_even/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/cse7766/test.esp32-idf.yaml b/tests/components/cse7766/test.esp32-idf.yaml index 811f6b72a6..911b867708 100644 --- a/tests/components/cse7766/test.esp32-idf.yaml +++ b/tests/components/cse7766/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO12 - rx_pin: GPIO14 +packages: + uart_4800_even: !include ../../test_build_components/common/uart_4800_even/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/cse7766/test.esp8266-ard.yaml b/tests/components/cse7766/test.esp8266-ard.yaml index 3b44f9c9c3..77e529ca48 100644 --- a/tests/components/cse7766/test.esp8266-ard.yaml +++ b/tests/components/cse7766/test.esp8266-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO1 rx_pin: GPIO3 +packages: + uart_4800_even: !include ../../test_build_components/common/uart_4800_even/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/cse7766/test.rp2040-ard.yaml b/tests/components/cse7766/test.rp2040-ard.yaml index b516342f3b..b7056670ef 100644 --- a/tests/components/cse7766/test.rp2040-ard.yaml +++ b/tests/components/cse7766/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart_4800_even: !include ../../test_build_components/common/uart_4800_even/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/cst226/common.yaml b/tests/components/cst226/common.yaml index d0b8ea3a86..79d7e7fd53 100644 --- a/tests/components/cst226/common.yaml +++ b/tests/components/cst226/common.yaml @@ -1,15 +1,5 @@ -i2c: - - id: i2c_cst226 - scl: ${scl_pin} - sda: ${sda_pin} - -spi: - - id: spi_ili9xxx - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - display: - - id: my_display + - id: cst226_display platform: ili9xxx model: ili9342 cs_pin: ${cs_pin} @@ -19,7 +9,9 @@ display: touchscreen: - id: ts_cst226 + i2c_id: i2c_bus platform: cst226 + display: cst226_display interrupt_pin: ${interrupt_pin} reset_pin: ${reset_pin} diff --git a/tests/components/cst226/test.esp32-c3-idf.yaml b/tests/components/cst226/test.esp32-c3-idf.yaml index 2f9bd72882..ffc12867d0 100644 --- a/tests/components/cst226/test.esp32-c3-idf.yaml +++ b/tests/components/cst226/test.esp32-c3-idf.yaml @@ -1,12 +1,11 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - cs_pin: GPIO8 + cs_pin: GPIO7 dc_pin: GPIO9 - disp_reset_pin: GPIO10 - scl_pin: GPIO0 - sda_pin: GPIO1 + disp_reset_pin: GPIO18 interrupt_pin: GPIO2 reset_pin: GPIO3 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/cst226/test.esp32-idf.yaml b/tests/components/cst226/test.esp32-idf.yaml index 11e2c4fd43..984f08db47 100644 --- a/tests/components/cst226/test.esp32-idf.yaml +++ b/tests/components/cst226/test.esp32-idf.yaml @@ -1,12 +1,12 @@ substitutions: - clk_pin: GPIO0 - mosi_pin: GPIO2 cs_pin: GPIO4 dc_pin: GPIO5 disp_reset_pin: GPIO12 - scl_pin: GPIO13 - sda_pin: GPIO14 interrupt_pin: GPIO15 - reset_pin: GPIO16 + reset_pin: GPIO25 + +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/cst816/common.yaml b/tests/components/cst816/common.yaml index 9400e4eef0..889a477dd2 100644 --- a/tests/components/cst816/common.yaml +++ b/tests/components/cst816/common.yaml @@ -1,15 +1,5 @@ -i2c: - - id: i2c_cst816 - scl: ${scl_pin} - sda: ${sda_pin} - -spi: - - id: spi_ili9xxx - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - display: - - id: my_display + - id: cst816_display platform: ili9xxx dimensions: 480x320 model: ST7796 @@ -25,7 +15,9 @@ display: touchscreen: - id: ts_cst816 + i2c_id: i2c_bus platform: cst816 + display: cst816_display interrupt_pin: ${interrupt_pin} reset_pin: ${reset_pin} skip_probe: false @@ -36,6 +28,7 @@ touchscreen: binary_sensor: - platform: touchscreen + touchscreen_id: ts_cst816 name: Home Button use_raw: true x_min: 0 diff --git a/tests/components/cst816/test.esp32-c3-idf.yaml b/tests/components/cst816/test.esp32-c3-idf.yaml index 2f9bd72882..ffc12867d0 100644 --- a/tests/components/cst816/test.esp32-c3-idf.yaml +++ b/tests/components/cst816/test.esp32-c3-idf.yaml @@ -1,12 +1,11 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - cs_pin: GPIO8 + cs_pin: GPIO7 dc_pin: GPIO9 - disp_reset_pin: GPIO10 - scl_pin: GPIO0 - sda_pin: GPIO1 + disp_reset_pin: GPIO18 interrupt_pin: GPIO2 reset_pin: GPIO3 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/cst816/test.esp32-idf.yaml b/tests/components/cst816/test.esp32-idf.yaml index 11e2c4fd43..984f08db47 100644 --- a/tests/components/cst816/test.esp32-idf.yaml +++ b/tests/components/cst816/test.esp32-idf.yaml @@ -1,12 +1,12 @@ substitutions: - clk_pin: GPIO0 - mosi_pin: GPIO2 cs_pin: GPIO4 dc_pin: GPIO5 disp_reset_pin: GPIO12 - scl_pin: GPIO13 - sda_pin: GPIO14 interrupt_pin: GPIO15 - reset_pin: GPIO16 + reset_pin: GPIO25 + +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/current_based/common.yaml b/tests/components/current_based/common.yaml index 25dc9671b7..503c4596e9 100644 --- a/tests/components/current_based/common.yaml +++ b/tests/components/current_based/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_ade7953 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: ade7953_i2c + i2c_id: i2c_bus irq_pin: ${irq_pin} voltage: name: ADE7953 Voltage diff --git a/tests/components/current_based/test.esp32-c3-idf.yaml b/tests/components/current_based/test.esp32-c3-idf.yaml index 799acabd5a..59296a1e6e 100644 --- a/tests/components/current_based/test.esp32-c3-idf.yaml +++ b/tests/components/current_based/test.esp32-c3-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/current_based/test.esp32-idf.yaml b/tests/components/current_based/test.esp32-idf.yaml index 2c57d412f6..49629536e7 100644 --- a/tests/components/current_based/test.esp32-idf.yaml +++ b/tests/components/current_based/test.esp32-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 irq_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/current_based/test.esp8266-ard.yaml b/tests/components/current_based/test.esp8266-ard.yaml index c8e6a43f44..dc7609ab37 100644 --- a/tests/components/current_based/test.esp8266-ard.yaml +++ b/tests/components/current_based/test.esp8266-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/current_based/test.rp2040-ard.yaml b/tests/components/current_based/test.rp2040-ard.yaml index 799acabd5a..b80562ad22 100644 --- a/tests/components/current_based/test.rp2040-ard.yaml +++ b/tests/components/current_based/test.rp2040-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/cwww/common.yaml b/tests/components/cwww/common.yaml index 0ad5beeaae..7fa5ab668c 100644 --- a/tests/components/cwww/common.yaml +++ b/tests/components/cwww/common.yaml @@ -1,11 +1,3 @@ -output: - - platform: ${light_platform} - id: light_output_1 - pin: ${pin_o1} - - platform: ${light_platform} - id: light_output_2 - pin: ${pin_o2} - light: - platform: cwww name: CWWW Light diff --git a/tests/components/cwww/test.esp32-c3-idf.yaml b/tests/components/cwww/test.esp32-c3-idf.yaml index 982394ded6..51571b34cf 100644 --- a/tests/components/cwww/test.esp32-c3-idf.yaml +++ b/tests/components/cwww/test.esp32-c3-idf.yaml @@ -3,12 +3,15 @@ substitutions: pin_o1: GPIO6 pin_o2: GPIO7 -packages: - device_base: !include common.yaml - output: - - id: !extend light_output_1 + - platform: ${light_platform} + id: light_output_1 + pin: ${pin_o1} channel: 0 - - id: !extend light_output_2 + - platform: ${light_platform} + id: light_output_2 + pin: ${pin_o2} channel: 1 phase_angle: 180° + +<<: !include common.yaml diff --git a/tests/components/cwww/test.esp32-idf.yaml b/tests/components/cwww/test.esp32-idf.yaml index d2a998e6b3..01edf0b0b5 100644 --- a/tests/components/cwww/test.esp32-idf.yaml +++ b/tests/components/cwww/test.esp32-idf.yaml @@ -3,12 +3,15 @@ substitutions: pin_o1: GPIO16 pin_o2: GPIO17 -packages: - device_base: !include common.yaml - output: - - id: !extend light_output_1 + - platform: ${light_platform} + id: light_output_1 + pin: ${pin_o1} channel: 0 - - id: !extend light_output_2 + - platform: ${light_platform} + id: light_output_2 + pin: ${pin_o2} channel: 1 phase_angle: 180° + +<<: !include common.yaml diff --git a/tests/components/cwww/test.esp8266-ard.yaml b/tests/components/cwww/test.esp8266-ard.yaml index 75a5b9d64d..49d73b7d3d 100644 --- a/tests/components/cwww/test.esp8266-ard.yaml +++ b/tests/components/cwww/test.esp8266-ard.yaml @@ -3,4 +3,12 @@ substitutions: pin_o1: GPIO12 pin_o2: GPIO13 +output: + - platform: ${light_platform} + id: light_output_1 + pin: ${pin_o1} + - platform: ${light_platform} + id: light_output_2 + pin: ${pin_o2} + <<: !include common.yaml diff --git a/tests/components/cwww/test.rp2040-ard.yaml b/tests/components/cwww/test.rp2040-ard.yaml index 537177aca1..ba8e0ad071 100644 --- a/tests/components/cwww/test.rp2040-ard.yaml +++ b/tests/components/cwww/test.rp2040-ard.yaml @@ -3,4 +3,12 @@ substitutions: pin_o1: GPIO12 pin_o2: GPIO13 +output: + - platform: ${light_platform} + id: light_output_1 + pin: ${pin_o1} + - platform: ${light_platform} + id: light_output_2 + pin: ${pin_o2} + <<: !include common.yaml diff --git a/tests/components/dac7678/common.yaml b/tests/components/dac7678/common.yaml index efad81a5ff..6c9c032686 100644 --- a/tests/components/dac7678/common.yaml +++ b/tests/components/dac7678/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_dac7678 - scl: ${scl_pin} - sda: ${sda_pin} - dac7678: + i2c_id: i2c_bus address: 0x4A id: dac7678_hub internal_reference: true diff --git a/tests/components/dac7678/test.esp32-c3-idf.yaml b/tests/components/dac7678/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/dac7678/test.esp32-c3-idf.yaml +++ b/tests/components/dac7678/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/dac7678/test.esp32-idf.yaml b/tests/components/dac7678/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/dac7678/test.esp32-idf.yaml +++ b/tests/components/dac7678/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/dac7678/test.esp8266-ard.yaml b/tests/components/dac7678/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/dac7678/test.esp8266-ard.yaml +++ b/tests/components/dac7678/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/dac7678/test.rp2040-ard.yaml b/tests/components/dac7678/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/dac7678/test.rp2040-ard.yaml +++ b/tests/components/dac7678/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/daikin_arc/test.esp8266-ard.yaml b/tests/components/daikin_arc/test.esp8266-ard.yaml index 8e08490d0c..5698a7ef5f 100644 --- a/tests/components/daikin_arc/test.esp8266-ard.yaml +++ b/tests/components/daikin_arc/test.esp8266-ard.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO5 - rx_pin: GPIO4 + tx_pin: GPIO0 + rx_pin: GPIO2 <<: !include common.yaml diff --git a/tests/components/dallas_temp/common.yaml b/tests/components/dallas_temp/common.yaml index fb51f4818e..6d865d8e93 100644 --- a/tests/components/dallas_temp/common.yaml +++ b/tests/components/dallas_temp/common.yaml @@ -1,6 +1,6 @@ one_wire: - platform: gpio - pin: 4 + pin: ${one_wire_pin} sensor: - platform: dallas_temp diff --git a/tests/components/dallas_temp/test.esp32-c3-idf.yaml b/tests/components/dallas_temp/test.esp32-c3-idf.yaml index dade44d145..49bf988eb4 100644 --- a/tests/components/dallas_temp/test.esp32-c3-idf.yaml +++ b/tests/components/dallas_temp/test.esp32-c3-idf.yaml @@ -1 +1,7 @@ +substitutions: + one_wire_pin: "4" + +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/dallas_temp/test.esp32-idf.yaml b/tests/components/dallas_temp/test.esp32-idf.yaml index dade44d145..7f9a7d4c2c 100644 --- a/tests/components/dallas_temp/test.esp32-idf.yaml +++ b/tests/components/dallas_temp/test.esp32-idf.yaml @@ -1 +1,7 @@ +substitutions: + one_wire_pin: "4" + +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/dallas_temp/test.esp8266-ard.yaml b/tests/components/dallas_temp/test.esp8266-ard.yaml index dade44d145..f58b3e0ff3 100644 --- a/tests/components/dallas_temp/test.esp8266-ard.yaml +++ b/tests/components/dallas_temp/test.esp8266-ard.yaml @@ -1 +1,7 @@ +substitutions: + one_wire_pin: "13" + +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/dallas_temp/test.rp2040-ard.yaml b/tests/components/dallas_temp/test.rp2040-ard.yaml index dade44d145..d86645aa64 100644 --- a/tests/components/dallas_temp/test.rp2040-ard.yaml +++ b/tests/components/dallas_temp/test.rp2040-ard.yaml @@ -1 +1,7 @@ +substitutions: + one_wire_pin: "10" + +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/daly_bms/common.yaml b/tests/components/daly_bms/common.yaml index a4cb849f9f..222999e25e 100644 --- a/tests/components/daly_bms/common.yaml +++ b/tests/components/daly_bms/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_daly_bms - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 4800 - daly_bms: update_interval: 20s diff --git a/tests/components/daly_bms/test.esp32-c3-idf.yaml b/tests/components/daly_bms/test.esp32-c3-idf.yaml index c79d14c740..4b7c8351a7 100644 --- a/tests/components/daly_bms/test.esp32-c3-idf.yaml +++ b/tests/components/daly_bms/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO7 - rx_pin: GPIO8 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/daly_bms/test.esp32-idf.yaml b/tests/components/daly_bms/test.esp32-idf.yaml index 811f6b72a6..64baa4ec9d 100644 --- a/tests/components/daly_bms/test.esp32-idf.yaml +++ b/tests/components/daly_bms/test.esp32-idf.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO12 rx_pin: GPIO14 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/daly_bms/test.esp8266-ard.yaml b/tests/components/daly_bms/test.esp8266-ard.yaml index 3b44f9c9c3..89ca3ab5ae 100644 --- a/tests/components/daly_bms/test.esp8266-ard.yaml +++ b/tests/components/daly_bms/test.esp8266-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO1 rx_pin: GPIO3 +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/daly_bms/test.rp2040-ard.yaml b/tests/components/daly_bms/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/daly_bms/test.rp2040-ard.yaml +++ b/tests/components/daly_bms/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/dfplayer/common.yaml b/tests/components/dfplayer/common.yaml index d7446141c3..5d2540c275 100644 --- a/tests/components/dfplayer/common.yaml +++ b/tests/components/dfplayer/common.yaml @@ -26,12 +26,6 @@ esphome: - dfplayer.volume_down - dfplayer.sleep -uart: - - id: uart_dfplayer - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - dfplayer: on_finished_playback: then: diff --git a/tests/components/dfplayer/test.esp32-c3-idf.yaml b/tests/components/dfplayer/test.esp32-c3-idf.yaml index c79d14c740..4b7c8351a7 100644 --- a/tests/components/dfplayer/test.esp32-c3-idf.yaml +++ b/tests/components/dfplayer/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO7 - rx_pin: GPIO8 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/dfplayer/test.esp32-idf.yaml b/tests/components/dfplayer/test.esp32-idf.yaml index 811f6b72a6..64baa4ec9d 100644 --- a/tests/components/dfplayer/test.esp32-idf.yaml +++ b/tests/components/dfplayer/test.esp32-idf.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO12 rx_pin: GPIO14 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/dfplayer/test.esp8266-ard.yaml b/tests/components/dfplayer/test.esp8266-ard.yaml index 3b44f9c9c3..89ca3ab5ae 100644 --- a/tests/components/dfplayer/test.esp8266-ard.yaml +++ b/tests/components/dfplayer/test.esp8266-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO1 rx_pin: GPIO3 +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/dfplayer/test.rp2040-ard.yaml b/tests/components/dfplayer/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/dfplayer/test.rp2040-ard.yaml +++ b/tests/components/dfplayer/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/dfrobot_sen0395/common.yaml b/tests/components/dfrobot_sen0395/common.yaml index 8c349911d3..7f980574ed 100644 --- a/tests/components/dfrobot_sen0395/common.yaml +++ b/tests/components/dfrobot_sen0395/common.yaml @@ -14,12 +14,6 @@ esphome: sensitivity: 6 - dfrobot_sen0395.reset -uart: - - id: uart_dfrobot_sen0395 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - dfrobot_sen0395: - id: mmwave diff --git a/tests/components/dfrobot_sen0395/test.esp32-c3-idf.yaml b/tests/components/dfrobot_sen0395/test.esp32-c3-idf.yaml index c79d14c740..4b7c8351a7 100644 --- a/tests/components/dfrobot_sen0395/test.esp32-c3-idf.yaml +++ b/tests/components/dfrobot_sen0395/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO7 - rx_pin: GPIO8 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/dfrobot_sen0395/test.esp32-idf.yaml b/tests/components/dfrobot_sen0395/test.esp32-idf.yaml index 811f6b72a6..64baa4ec9d 100644 --- a/tests/components/dfrobot_sen0395/test.esp32-idf.yaml +++ b/tests/components/dfrobot_sen0395/test.esp32-idf.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO12 rx_pin: GPIO14 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/dfrobot_sen0395/test.esp8266-ard.yaml b/tests/components/dfrobot_sen0395/test.esp8266-ard.yaml index 3b44f9c9c3..89ca3ab5ae 100644 --- a/tests/components/dfrobot_sen0395/test.esp8266-ard.yaml +++ b/tests/components/dfrobot_sen0395/test.esp8266-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO1 rx_pin: GPIO3 +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/dfrobot_sen0395/test.rp2040-ard.yaml b/tests/components/dfrobot_sen0395/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/dfrobot_sen0395/test.rp2040-ard.yaml +++ b/tests/components/dfrobot_sen0395/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/dht12/common.yaml b/tests/components/dht12/common.yaml index 91346e0e27..2602ae13cf 100644 --- a/tests/components/dht12/common.yaml +++ b/tests/components/dht12/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_dht12 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: dht12 + i2c_id: i2c_bus temperature: name: DHT12 Temperature humidity: diff --git a/tests/components/dht12/test.esp32-c3-idf.yaml b/tests/components/dht12/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/dht12/test.esp32-c3-idf.yaml +++ b/tests/components/dht12/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/dht12/test.esp32-idf.yaml b/tests/components/dht12/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/dht12/test.esp32-idf.yaml +++ b/tests/components/dht12/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/dht12/test.esp8266-ard.yaml b/tests/components/dht12/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/dht12/test.esp8266-ard.yaml +++ b/tests/components/dht12/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/dht12/test.rp2040-ard.yaml b/tests/components/dht12/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/dht12/test.rp2040-ard.yaml +++ b/tests/components/dht12/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/display/common.yaml b/tests/components/display/common.yaml index 4fc4fafa25..27abb23e03 100644 --- a/tests/components/display/common.yaml +++ b/tests/components/display/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_main_lcd - clk_pin: 16 - mosi_pin: 17 - miso_pin: 15 - display: - platform: ili9xxx id: main_lcd diff --git a/tests/components/dps310/common.yaml b/tests/components/dps310/common.yaml index e6c0c9fab8..847a79f2e6 100644 --- a/tests/components/dps310/common.yaml +++ b/tests/components/dps310/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_dps310 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: dps310 + i2c_id: i2c_bus temperature: name: DPS310 Temperature pressure: diff --git a/tests/components/dps310/test.esp32-c3-idf.yaml b/tests/components/dps310/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/dps310/test.esp32-c3-idf.yaml +++ b/tests/components/dps310/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/dps310/test.esp32-idf.yaml b/tests/components/dps310/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/dps310/test.esp32-idf.yaml +++ b/tests/components/dps310/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/dps310/test.esp8266-ard.yaml b/tests/components/dps310/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/dps310/test.esp8266-ard.yaml +++ b/tests/components/dps310/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/dps310/test.rp2040-ard.yaml b/tests/components/dps310/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/dps310/test.rp2040-ard.yaml +++ b/tests/components/dps310/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ds1307/common.yaml b/tests/components/ds1307/common.yaml index 3466a9eec8..cdd2b9cf56 100644 --- a/tests/components/ds1307/common.yaml +++ b/tests/components/ds1307/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_ds1307 - scl: ${scl_pin} - sda: ${sda_pin} - time: - platform: ds1307 + i2c_id: i2c_bus id: ds1307_time update_interval: never diff --git a/tests/components/ds1307/test.esp32-c3-idf.yaml b/tests/components/ds1307/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ds1307/test.esp32-c3-idf.yaml +++ b/tests/components/ds1307/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ds1307/test.esp32-idf.yaml b/tests/components/ds1307/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ds1307/test.esp32-idf.yaml +++ b/tests/components/ds1307/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ds1307/test.esp8266-ard.yaml b/tests/components/ds1307/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ds1307/test.esp8266-ard.yaml +++ b/tests/components/ds1307/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ds1307/test.rp2040-ard.yaml b/tests/components/ds1307/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ds1307/test.rp2040-ard.yaml +++ b/tests/components/ds1307/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ds2484/common.yaml b/tests/components/ds2484/common.yaml index 9d2882a3c0..1e5dcd7dba 100644 --- a/tests/components/ds2484/common.yaml +++ b/tests/components/ds2484/common.yaml @@ -1,11 +1,6 @@ -i2c: - - id: i2c_ds2484 - scl: ${scl_pin} - sda: ${sda_pin} - one_wire: platform: ds2484 - i2c_id: i2c_ds2484 + i2c_id: i2c_bus address: 0x18 active_pullup: true strong_pullup: false diff --git a/tests/components/ds2484/test.esp32-c3-idf.yaml b/tests/components/ds2484/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ds2484/test.esp32-c3-idf.yaml +++ b/tests/components/ds2484/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ds2484/test.esp32-idf.yaml b/tests/components/ds2484/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ds2484/test.esp32-idf.yaml +++ b/tests/components/ds2484/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ds2484/test.esp8266-ard.yaml b/tests/components/ds2484/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ds2484/test.esp8266-ard.yaml +++ b/tests/components/ds2484/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ds2484/test.rp2040-ard.yaml b/tests/components/ds2484/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ds2484/test.rp2040-ard.yaml +++ b/tests/components/ds2484/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/dsmr/common.yaml b/tests/components/dsmr/common.yaml index 2901b811fe..038bf2806b 100644 --- a/tests/components/dsmr/common.yaml +++ b/tests/components/dsmr/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_dsmr - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - dsmr: decryption_key: 00112233445566778899aabbccddeeff max_telegram_length: 1000 diff --git a/tests/components/dsmr/test.esp32-ard.yaml b/tests/components/dsmr/test.esp32-ard.yaml index 7a65a48ec0..f218b297aa 100644 --- a/tests/components/dsmr/test.esp32-ard.yaml +++ b/tests/components/dsmr/test.esp32-ard.yaml @@ -1,6 +1,7 @@ substitutions: - tx_pin: GPIO12 - rx_pin: GPIO14 request_pin: GPIO15 +packages: + uart: !include ../../test_build_components/common/uart/esp32-ard.yaml + <<: !include common.yaml diff --git a/tests/components/dsmr/test.esp8266-ard.yaml b/tests/components/dsmr/test.esp8266-ard.yaml index a47bd58806..08bcf16fc9 100644 --- a/tests/components/dsmr/test.esp8266-ard.yaml +++ b/tests/components/dsmr/test.esp8266-ard.yaml @@ -1,6 +1,7 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 request_pin: GPIO15 +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/dsmr/test.rp2040-ard.yaml b/tests/components/dsmr/test.rp2040-ard.yaml index 72998506ac..8684cb76aa 100644 --- a/tests/components/dsmr/test.rp2040-ard.yaml +++ b/tests/components/dsmr/test.rp2040-ard.yaml @@ -1,6 +1,7 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 request_pin: GPIO6 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ee895/common.yaml b/tests/components/ee895/common.yaml index 63d77abcaf..f1b17ca9d9 100644 --- a/tests/components/ee895/common.yaml +++ b/tests/components/ee895/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_ee895 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: ee895 + i2c_id: i2c_bus address: 0x5F co2: name: EE895 CO2 diff --git a/tests/components/ee895/test.esp32-c3-idf.yaml b/tests/components/ee895/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ee895/test.esp32-c3-idf.yaml +++ b/tests/components/ee895/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ee895/test.esp32-idf.yaml b/tests/components/ee895/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ee895/test.esp32-idf.yaml +++ b/tests/components/ee895/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ee895/test.esp8266-ard.yaml b/tests/components/ee895/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ee895/test.esp8266-ard.yaml +++ b/tests/components/ee895/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ee895/test.rp2040-ard.yaml b/tests/components/ee895/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ee895/test.rp2040-ard.yaml +++ b/tests/components/ee895/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ektf2232/common.yaml b/tests/components/ektf2232/common.yaml index 91f09b4710..8ab57be46f 100644 --- a/tests/components/ektf2232/common.yaml +++ b/tests/components/ektf2232/common.yaml @@ -1,20 +1,18 @@ -i2c: - - id: i2c_ektf2232 - scl: ${scl_pin} - sda: ${sda_pin} - display: - platform: ssd1306_i2c + i2c_id: i2c_bus id: ssd1306_display model: SSD1306_128X64 reset_pin: ${display_reset_pin} pages: - - id: page1 + - id: ektf2232_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); touchscreen: - platform: ektf2232 + i2c_id: i2c_bus + id: ektf2232_touchscreen interrupt_pin: ${interrupt_pin} reset_pin: ${touch_reset_pin} display: ssd1306_display diff --git a/tests/components/ektf2232/test.esp32-c3-idf.yaml b/tests/components/ektf2232/test.esp32-c3-idf.yaml index 4d793a3242..708d352a59 100644 --- a/tests/components/ektf2232/test.esp32-c3-idf.yaml +++ b/tests/components/ektf2232/test.esp32-c3-idf.yaml @@ -1,8 +1,9 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 display_reset_pin: GPIO3 interrupt_pin: GPIO6 touch_reset_pin: GPIO7 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ektf2232/test.esp32-idf.yaml b/tests/components/ektf2232/test.esp32-idf.yaml index 7d3f2ca7a2..3fab081bed 100644 --- a/tests/components/ektf2232/test.esp32-idf.yaml +++ b/tests/components/ektf2232/test.esp32-idf.yaml @@ -1,8 +1,9 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 display_reset_pin: GPIO13 interrupt_pin: GPIO14 touch_reset_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ektf2232/test.esp8266-ard.yaml b/tests/components/ektf2232/test.esp8266-ard.yaml index a87e9dfd45..38a3894deb 100644 --- a/tests/components/ektf2232/test.esp8266-ard.yaml +++ b/tests/components/ektf2232/test.esp8266-ard.yaml @@ -1,8 +1,9 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 display_reset_pin: GPIO3 - interrupt_pin: GPIO12 - touch_reset_pin: GPIO13 + interrupt_pin: GPIO15 + touch_reset_pin: GPIO16 + +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ektf2232/test.rp2040-ard.yaml b/tests/components/ektf2232/test.rp2040-ard.yaml index 4d793a3242..cda1b67715 100644 --- a/tests/components/ektf2232/test.rp2040-ard.yaml +++ b/tests/components/ektf2232/test.rp2040-ard.yaml @@ -1,8 +1,9 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 display_reset_pin: GPIO3 interrupt_pin: GPIO6 touch_reset_pin: GPIO7 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/emc2101/common.yaml b/tests/components/emc2101/common.yaml index 795b02c6d3..d9e6fe2b96 100644 --- a/tests/components/emc2101/common.yaml +++ b/tests/components/emc2101/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_emc2101 - scl: ${scl_pin} - sda: ${sda_pin} - emc2101: + i2c_id: i2c_bus pwm: resolution: 8 diff --git a/tests/components/emc2101/test.esp32-c3-idf.yaml b/tests/components/emc2101/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/emc2101/test.esp32-c3-idf.yaml +++ b/tests/components/emc2101/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/emc2101/test.esp32-idf.yaml b/tests/components/emc2101/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/emc2101/test.esp32-idf.yaml +++ b/tests/components/emc2101/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/emc2101/test.esp8266-ard.yaml b/tests/components/emc2101/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/emc2101/test.esp8266-ard.yaml +++ b/tests/components/emc2101/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/emc2101/test.rp2040-ard.yaml b/tests/components/emc2101/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/emc2101/test.rp2040-ard.yaml +++ b/tests/components/emc2101/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/emmeti/test.esp8266-ard.yaml b/tests/components/emmeti/test.esp8266-ard.yaml index 2fb00aea61..1c9baa4ea3 100644 --- a/tests/components/emmeti/test.esp8266-ard.yaml +++ b/tests/components/emmeti/test.esp8266-ard.yaml @@ -1,5 +1,5 @@ substitutions: - remote_transmitter_pin: GPIO4 - remote_receiver_pin: GPIO5 + remote_transmitter_pin: GPIO0 + remote_receiver_pin: GPIO2 <<: !include common.yaml diff --git a/tests/components/ens160_i2c/common.yaml b/tests/components/ens160_i2c/common.yaml index 39a5b35067..685c8d3fee 100644 --- a/tests/components/ens160_i2c/common.yaml +++ b/tests/components/ens160_i2c/common.yaml @@ -1,11 +1,6 @@ -i2c: - - id: i2c_ens160 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: ens160_i2c - i2c_id: i2c_ens160 + i2c_id: i2c_bus address: 0x53 eco2: name: "ENS160 eCO2" diff --git a/tests/components/ens160_i2c/test.esp32-c3-idf.yaml b/tests/components/ens160_i2c/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ens160_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/ens160_i2c/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ens160_i2c/test.esp32-idf.yaml b/tests/components/ens160_i2c/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ens160_i2c/test.esp32-idf.yaml +++ b/tests/components/ens160_i2c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ens160_i2c/test.esp8266-ard.yaml b/tests/components/ens160_i2c/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ens160_i2c/test.esp8266-ard.yaml +++ b/tests/components/ens160_i2c/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ens160_i2c/test.rp2040-ard.yaml b/tests/components/ens160_i2c/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ens160_i2c/test.rp2040-ard.yaml +++ b/tests/components/ens160_i2c/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ens160_spi/common.yaml b/tests/components/ens160_spi/common.yaml index c8b663272f..53000a5e96 100644 --- a/tests/components/ens160_spi/common.yaml +++ b/tests/components/ens160_spi/common.yaml @@ -1,12 +1,5 @@ -spi: - - id: spi_ens160 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sensor: - platform: ens160_spi - spi_id: spi_ens160 cs_pin: ${cs_pin} eco2: name: "ENS160 eCO2" diff --git a/tests/components/ens160_spi/test.esp32-c3-idf.yaml b/tests/components/ens160_spi/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/ens160_spi/test.esp32-c3-idf.yaml +++ b/tests/components/ens160_spi/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ens160_spi/test.esp32-idf.yaml b/tests/components/ens160_spi/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/ens160_spi/test.esp32-idf.yaml +++ b/tests/components/ens160_spi/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ens160_spi/test.esp8266-ard.yaml b/tests/components/ens160_spi/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/ens160_spi/test.esp8266-ard.yaml +++ b/tests/components/ens160_spi/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ens160_spi/test.rp2040-ard.yaml b/tests/components/ens160_spi/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/ens160_spi/test.rp2040-ard.yaml +++ b/tests/components/ens160_spi/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ens210/common.yaml b/tests/components/ens210/common.yaml index b276154449..6bc8f824cc 100644 --- a/tests/components/ens210/common.yaml +++ b/tests/components/ens210/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_ens210 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: ens210 + i2c_id: i2c_bus temperature: name: ENS210 Temperature humidity: diff --git a/tests/components/ens210/test.esp32-c3-idf.yaml b/tests/components/ens210/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ens210/test.esp32-c3-idf.yaml +++ b/tests/components/ens210/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ens210/test.esp32-idf.yaml b/tests/components/ens210/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ens210/test.esp32-idf.yaml +++ b/tests/components/ens210/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ens210/test.esp8266-ard.yaml b/tests/components/ens210/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ens210/test.esp8266-ard.yaml +++ b/tests/components/ens210/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ens210/test.rp2040-ard.yaml b/tests/components/ens210/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ens210/test.rp2040-ard.yaml +++ b/tests/components/ens210/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/epaper_spi/test.esp32-s3-idf.yaml b/tests/components/epaper_spi/test.esp32-s3-idf.yaml index 3d8d62a7ca..34aefb82b4 100644 --- a/tests/components/epaper_spi/test.esp32-s3-idf.yaml +++ b/tests/components/epaper_spi/test.esp32-s3-idf.yaml @@ -1,9 +1,9 @@ -spi: - clk_pin: GPIO7 - mosi_pin: GPIO9 +packages: + spi: !include ../../test_build_components/common/spi/esp32-s3-idf.yaml display: - platform: epaper_spi + spi_id: spi_bus model: 7.3in-spectra-e6 cs_pin: GPIO5 dc_pin: GPIO17 diff --git a/tests/components/es7210/common.yaml b/tests/components/es7210/common.yaml index 3fab177cb3..b9f0b0c3e9 100644 --- a/tests/components/es7210/common.yaml +++ b/tests/components/es7210/common.yaml @@ -4,13 +4,9 @@ esphome: - audio_adc.set_mic_gain: 0db - audio_adc.set_mic_gain: !lambda 'return 4;' -i2c: - - id: i2c_aic3204 - scl: ${scl_pin} - sda: ${sda_pin} - audio_adc: - platform: es7210 + i2c_id: i2c_bus id: es7210_adc bits_per_sample: 16bit sample_rate: 16000 diff --git a/tests/components/es7210/test.esp32-c3-idf.yaml b/tests/components/es7210/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/es7210/test.esp32-c3-idf.yaml +++ b/tests/components/es7210/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/es7210/test.esp32-idf.yaml b/tests/components/es7210/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/es7210/test.esp32-idf.yaml +++ b/tests/components/es7210/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/es7243e/common.yaml b/tests/components/es7243e/common.yaml index 3de76909e9..0fcfb97273 100644 --- a/tests/components/es7243e/common.yaml +++ b/tests/components/es7243e/common.yaml @@ -4,11 +4,7 @@ esphome: - audio_adc.set_mic_gain: 0db - audio_adc.set_mic_gain: !lambda 'return 4;' -i2c: - - id: i2c_es7243e - scl: ${scl_pin} - sda: ${sda_pin} - audio_adc: - platform: es7243e + i2c_id: i2c_bus id: es7243e_adc diff --git a/tests/components/es7243e/test.esp32-c3-idf.yaml b/tests/components/es7243e/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/es7243e/test.esp32-c3-idf.yaml +++ b/tests/components/es7243e/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/es7243e/test.esp32-idf.yaml b/tests/components/es7243e/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/es7243e/test.esp32-idf.yaml +++ b/tests/components/es7243e/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/es8156/common.yaml b/tests/components/es8156/common.yaml index addaa0b70a..c41a332bd7 100644 --- a/tests/components/es8156/common.yaml +++ b/tests/components/es8156/common.yaml @@ -6,10 +6,6 @@ esphome: - audio_dac.set_volume: volume: 50% -i2c: - - id: i2c_es8156 - scl: ${scl_pin} - sda: ${sda_pin} - audio_dac: - platform: es8156 + i2c_id: i2c_bus diff --git a/tests/components/es8156/test.esp32-c3-idf.yaml b/tests/components/es8156/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/es8156/test.esp32-c3-idf.yaml +++ b/tests/components/es8156/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/es8156/test.esp32-idf.yaml b/tests/components/es8156/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/es8156/test.esp32-idf.yaml +++ b/tests/components/es8156/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/es8156/test.esp8266-ard.yaml b/tests/components/es8156/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/es8156/test.esp8266-ard.yaml +++ b/tests/components/es8156/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/es8311/common.yaml b/tests/components/es8311/common.yaml index d833d1c043..e855761ef4 100644 --- a/tests/components/es8311/common.yaml +++ b/tests/components/es8311/common.yaml @@ -6,10 +6,6 @@ esphome: - audio_dac.set_volume: volume: 50% -i2c: - - id: i2c_aic3204 - scl: ${scl_pin} - sda: ${sda_pin} - audio_dac: - platform: es8311 + i2c_id: i2c_bus diff --git a/tests/components/es8311/test.esp32-c3-idf.yaml b/tests/components/es8311/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/es8311/test.esp32-c3-idf.yaml +++ b/tests/components/es8311/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/es8311/test.esp32-idf.yaml b/tests/components/es8311/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/es8311/test.esp32-idf.yaml +++ b/tests/components/es8311/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/es8311/test.esp8266-ard.yaml b/tests/components/es8311/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/es8311/test.esp8266-ard.yaml +++ b/tests/components/es8311/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/es8388/common.yaml b/tests/components/es8388/common.yaml index 6a63de5aa1..cc7465ab93 100644 --- a/tests/components/es8388/common.yaml +++ b/tests/components/es8388/common.yaml @@ -7,13 +7,9 @@ esphome: - audio_dac.set_volume: volume: 50% -i2c: - - id: i2c_es8388 - scl: ${scl_pin} - sda: ${sda_pin} - audio_dac: - platform: es8388 + i2c_id: i2c_bus id: es8388_parent select: diff --git a/tests/components/es8388/test.esp32-c3-idf.yaml b/tests/components/es8388/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/es8388/test.esp32-c3-idf.yaml +++ b/tests/components/es8388/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/es8388/test.esp32-idf.yaml b/tests/components/es8388/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/es8388/test.esp32-idf.yaml +++ b/tests/components/es8388/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/es8388/test.esp8266-ard.yaml b/tests/components/es8388/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/es8388/test.esp8266-ard.yaml +++ b/tests/components/es8388/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/esp32/test.esp32-idf.yaml b/tests/components/esp32/test.esp32-idf.yaml index ccf0b7cbd5..6338fe98dd 100644 --- a/tests/components/esp32/test.esp32-idf.yaml +++ b/tests/components/esp32/test.esp32-idf.yaml @@ -5,6 +5,7 @@ esp32: advanced: enable_lwip_mdns_queries: true enable_lwip_bridge_interface: true + disable_libc_locks_in_iram: false # Test explicit opt-out of RAM optimization wifi: ssid: MySSID diff --git a/tests/components/esp32/test.esp32-s3-idf.yaml b/tests/components/esp32/test.esp32-s3-idf.yaml index 1d5a5e52a4..4ae5e6b999 100644 --- a/tests/components/esp32/test.esp32-s3-idf.yaml +++ b/tests/components/esp32/test.esp32-s3-idf.yaml @@ -4,6 +4,7 @@ esp32: type: esp-idf advanced: execute_from_psram: true + disable_libc_locks_in_iram: true # Test default RAM optimization enabled psram: mode: octal diff --git a/tests/components/esp32_ble_client/test.esp32-c3-idf.yaml b/tests/components/esp32_ble_client/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/esp32_ble_client/test.esp32-c3-idf.yaml +++ b/tests/components/esp32_ble_client/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/esp32_ble_client/test.esp32-idf.yaml b/tests/components/esp32_ble_client/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/esp32_ble_client/test.esp32-idf.yaml +++ b/tests/components/esp32_ble_client/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/esp32_ble_tracker/test.esp32-c3-idf.yaml b/tests/components/esp32_ble_tracker/test.esp32-c3-idf.yaml index b71896bad5..ea6f0d4022 100644 --- a/tests/components/esp32_ble_tracker/test.esp32-c3-idf.yaml +++ b/tests/components/esp32_ble_tracker/test.esp32-c3-idf.yaml @@ -1,3 +1,6 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml esp32_ble_tracker: diff --git a/tests/components/esp32_ble_tracker/test.esp32-idf.yaml b/tests/components/esp32_ble_tracker/test.esp32-idf.yaml index 1ffcfb9988..8f6e3c5731 100644 --- a/tests/components/esp32_ble_tracker/test.esp32-idf.yaml +++ b/tests/components/esp32_ble_tracker/test.esp32-idf.yaml @@ -1,3 +1,6 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml esp32_ble_tracker: diff --git a/tests/components/esp32_camera/common.yaml b/tests/components/esp32_camera/common.yaml index 64f75c699a..eac5109bc8 100644 --- a/tests/components/esp32_camera/common.yaml +++ b/tests/components/esp32_camera/common.yaml @@ -1,29 +1 @@ -esp32_camera: - name: ESP32 Camera - data_pins: - - number: 17 - - number: 35 - - number: 34 - - number: 5 - - number: 39 - - number: 18 - - number: 36 - - number: 19 - vsync_pin: 22 - href_pin: 26 - pixel_clock_pin: 21 - external_clock: - pin: 27 - frequency: 20MHz - i2c_pins: - sda: 25 - scl: 23 - reset_pin: 15 - power_down_pin: 1 - resolution: 640x480 - jpeg_quality: 10 - frame_buffer_location: PSRAM - on_image: - then: - - lambda: |- - ESP_LOGD("main", "image len=%d, data=%c", image.length, image.data[0]); +# ESP32 camera hardware configuration comes from the camera package diff --git a/tests/components/esp32_camera/test.esp32-idf.yaml b/tests/components/esp32_camera/test.esp32-idf.yaml index dade44d145..3d93dd6418 100644 --- a/tests/components/esp32_camera/test.esp32-idf.yaml +++ b/tests/components/esp32_camera/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + camera: !include ../../test_build_components/common/camera/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/esp32_camera_web_server/common.yaml b/tests/components/esp32_camera_web_server/common.yaml index fe2a6a2739..2a1858f681 100644 --- a/tests/components/esp32_camera_web_server/common.yaml +++ b/tests/components/esp32_camera_web_server/common.yaml @@ -1,32 +1,3 @@ -esp32_camera: - name: ESP32 Camera - data_pins: - - number: 17 - - number: 35 - - number: 34 - - number: 5 - - number: 39 - - number: 18 - - number: 36 - - number: 19 - vsync_pin: 22 - href_pin: 26 - pixel_clock_pin: 21 - external_clock: - pin: 27 - frequency: 20MHz - i2c_pins: - sda: 25 - scl: 23 - reset_pin: 15 - power_down_pin: 1 - resolution: 640x480 - jpeg_quality: 10 - on_image: - then: - - lambda: |- - ESP_LOGD("main", "image len=%d, data=%c", image.length, image.data[0]); - esp32_camera_web_server: - port: 8080 mode: stream diff --git a/tests/components/esp32_camera_web_server/test.esp32-idf.yaml b/tests/components/esp32_camera_web_server/test.esp32-idf.yaml index dade44d145..3d93dd6418 100644 --- a/tests/components/esp32_camera_web_server/test.esp32-idf.yaml +++ b/tests/components/esp32_camera_web_server/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + camera: !include ../../test_build_components/common/camera/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/esp32_can/test.esp32-c3-idf.yaml b/tests/components/esp32_can/test.esp32-c3-idf.yaml index c79d14c740..22effb1bd0 100644 --- a/tests/components/esp32_can/test.esp32-c3-idf.yaml +++ b/tests/components/esp32_can/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: tx_pin: GPIO7 - rx_pin: GPIO8 + rx_pin: GPIO9 <<: !include common.yaml diff --git a/tests/components/esp32_rmt_led_strip/test.esp32-s3-idf.yaml b/tests/components/esp32_rmt_led_strip/test.esp32-s3-idf.yaml index ad273903b2..6bf0639a52 100644 --- a/tests/components/esp32_rmt_led_strip/test.esp32-s3-idf.yaml +++ b/tests/components/esp32_rmt_led_strip/test.esp32-s3-idf.yaml @@ -2,11 +2,22 @@ substitutions: pin1: GPIO3 pin2: GPIO4 -packages: - common: !include common.yaml - +# WARNING: Using !extend or !remove prevents automatic component grouping in CI, making builds slower. light: - - id: !extend led_strip1 + - platform: esp32_rmt_led_strip + id: led_strip1 + pin: ${pin1} + num_leds: 60 + rgb_order: GRB + chipset: ws2812 use_dma: "true" - - id: !extend led_strip2 + - platform: esp32_rmt_led_strip + id: led_strip2 + pin: ${pin2} + num_leds: 60 + rgb_order: RGB + bit0_high: 100us + bit0_low: 100us + bit1_high: 100us + bit1_low: 100us use_dma: "false" diff --git a/tests/components/espnow/test.esp32-idf.yaml b/tests/components/espnow/test.esp32-idf.yaml index dade44d145..b47e39c389 100644 --- a/tests/components/espnow/test.esp32-idf.yaml +++ b/tests/components/espnow/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ethernet_info/test.esp32-idf.yaml b/tests/components/ethernet_info/test.esp32-idf.yaml index dade44d145..b47e39c389 100644 --- a/tests/components/ethernet_info/test.esp32-idf.yaml +++ b/tests/components/ethernet_info/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/exposure_notifications/test.esp32-c3-idf.yaml b/tests/components/exposure_notifications/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/exposure_notifications/test.esp32-c3-idf.yaml +++ b/tests/components/exposure_notifications/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/exposure_notifications/test.esp32-idf.yaml b/tests/components/exposure_notifications/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/exposure_notifications/test.esp32-idf.yaml +++ b/tests/components/exposure_notifications/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ezo/common.yaml b/tests/components/ezo/common.yaml index edeebd1a12..79afbb8aa6 100644 --- a/tests/components/ezo/common.yaml +++ b/tests/components/ezo/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_ezo - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: ezo + i2c_id: i2c_bus id: ph_ezo address: 99 unit_of_measurement: pH diff --git a/tests/components/ezo/test.esp32-c3-idf.yaml b/tests/components/ezo/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ezo/test.esp32-c3-idf.yaml +++ b/tests/components/ezo/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ezo/test.esp32-idf.yaml b/tests/components/ezo/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ezo/test.esp32-idf.yaml +++ b/tests/components/ezo/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ezo/test.esp8266-ard.yaml b/tests/components/ezo/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ezo/test.esp8266-ard.yaml +++ b/tests/components/ezo/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ezo/test.rp2040-ard.yaml b/tests/components/ezo/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ezo/test.rp2040-ard.yaml +++ b/tests/components/ezo/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ezo_pmp/common.yaml b/tests/components/ezo_pmp/common.yaml index 00919797be..bd2fd9193c 100644 --- a/tests/components/ezo_pmp/common.yaml +++ b/tests/components/ezo_pmp/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_ezo_pmp - scl: ${scl_pin} - sda: ${sda_pin} - ezo_pmp: + i2c_id: i2c_bus id: hcl_pump update_interval: 1s diff --git a/tests/components/ezo_pmp/test.esp32-c3-idf.yaml b/tests/components/ezo_pmp/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ezo_pmp/test.esp32-c3-idf.yaml +++ b/tests/components/ezo_pmp/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ezo_pmp/test.esp32-idf.yaml b/tests/components/ezo_pmp/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ezo_pmp/test.esp32-idf.yaml +++ b/tests/components/ezo_pmp/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ezo_pmp/test.esp8266-ard.yaml b/tests/components/ezo_pmp/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ezo_pmp/test.esp8266-ard.yaml +++ b/tests/components/ezo_pmp/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ezo_pmp/test.rp2040-ard.yaml b/tests/components/ezo_pmp/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ezo_pmp/test.rp2040-ard.yaml +++ b/tests/components/ezo_pmp/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/fingerprint_grow/common.yaml b/tests/components/fingerprint_grow/common.yaml index e759ea5a02..2d2fc61437 100644 --- a/tests/components/fingerprint_grow/common.yaml +++ b/tests/components/fingerprint_grow/common.yaml @@ -9,12 +9,6 @@ esphome: finger_id: 2 - fingerprint_grow.delete_all: -uart: - - id: uart_fingerprint_grow - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 57600 - fingerprint_grow: sensing_pin: ${sensing_pin} password: 0x12FE37DC diff --git a/tests/components/fingerprint_grow/test.esp32-c3-idf.yaml b/tests/components/fingerprint_grow/test.esp32-c3-idf.yaml index faab50e152..dff4f7fd92 100644 --- a/tests/components/fingerprint_grow/test.esp32-c3-idf.yaml +++ b/tests/components/fingerprint_grow/test.esp32-c3-idf.yaml @@ -1,6 +1,6 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 sensing_pin: GPIO6 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/fingerprint_grow/test.esp32-idf.yaml b/tests/components/fingerprint_grow/test.esp32-idf.yaml index 4aef3d8be6..7149f07d16 100644 --- a/tests/components/fingerprint_grow/test.esp32-idf.yaml +++ b/tests/components/fingerprint_grow/test.esp32-idf.yaml @@ -3,4 +3,7 @@ substitutions: rx_pin: GPIO14 sensing_pin: GPIO15 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/fingerprint_grow/test.esp8266-ard.yaml b/tests/components/fingerprint_grow/test.esp8266-ard.yaml index f2a864596a..204fdf0302 100644 --- a/tests/components/fingerprint_grow/test.esp8266-ard.yaml +++ b/tests/components/fingerprint_grow/test.esp8266-ard.yaml @@ -1,6 +1,9 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 sensing_pin: GPIO15 +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/fingerprint_grow/test.rp2040-ard.yaml b/tests/components/fingerprint_grow/test.rp2040-ard.yaml index faab50e152..80ea1d22ca 100644 --- a/tests/components/fingerprint_grow/test.rp2040-ard.yaml +++ b/tests/components/fingerprint_grow/test.rp2040-ard.yaml @@ -3,4 +3,7 @@ substitutions: rx_pin: GPIO5 sensing_pin: GPIO6 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/font/common.yaml b/tests/components/font/common.yaml index fb50fc3336..2d2e970536 100644 --- a/tests/components/font/common.yaml +++ b/tests/components/font/common.yaml @@ -47,10 +47,6 @@ font: id: bdf_font size: 7 -i2c: - scl: ${i2c_scl} - sda: ${i2c_sda} - display: - platform: ssd1306_i2c id: ssd1306_display diff --git a/tests/components/font/test.esp32-c3-idf.yaml b/tests/components/font/test.esp32-c3-idf.yaml index ad14a2e9a6..2090db7e6d 100644 --- a/tests/components/font/test.esp32-c3-idf.yaml +++ b/tests/components/font/test.esp32-c3-idf.yaml @@ -1,7 +1,7 @@ substitutions: - i2c_scl: GPIO5 - i2c_sda: GPIO4 display_reset_pin: GPIO3 packages: - common: !include common.yaml + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + +<<: !include common.yaml diff --git a/tests/components/font/test.esp32-idf.yaml b/tests/components/font/test.esp32-idf.yaml index d98600a51b..a6a94a39da 100644 --- a/tests/components/font/test.esp32-idf.yaml +++ b/tests/components/font/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - i2c_scl: GPIO16 - i2c_sda: GPIO17 display_reset_pin: GPIO13 packages: - common: !include common.yaml + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + +<<: !include common.yaml diff --git a/tests/components/font/test.esp8266-ard.yaml b/tests/components/font/test.esp8266-ard.yaml index ad14a2e9a6..173f7dfaa5 100644 --- a/tests/components/font/test.esp8266-ard.yaml +++ b/tests/components/font/test.esp8266-ard.yaml @@ -1,7 +1,7 @@ substitutions: - i2c_scl: GPIO5 - i2c_sda: GPIO4 display_reset_pin: GPIO3 packages: - common: !include common.yaml + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + +<<: !include common.yaml diff --git a/tests/components/font/test.rp2040-ard.yaml b/tests/components/font/test.rp2040-ard.yaml index ad14a2e9a6..aeecf352b4 100644 --- a/tests/components/font/test.rp2040-ard.yaml +++ b/tests/components/font/test.rp2040-ard.yaml @@ -1,7 +1,7 @@ substitutions: - i2c_scl: GPIO5 - i2c_sda: GPIO4 display_reset_pin: GPIO3 packages: - common: !include common.yaml + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + +<<: !include common.yaml diff --git a/tests/components/fs3000/common.yaml b/tests/components/fs3000/common.yaml index e87ac28aa9..e8ec4d0773 100644 --- a/tests/components/fs3000/common.yaml +++ b/tests/components/fs3000/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_fs3000 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: fs3000 + i2c_id: i2c_bus name: Air Velocity model: 1005 update_interval: 60s diff --git a/tests/components/fs3000/test.esp32-c3-idf.yaml b/tests/components/fs3000/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/fs3000/test.esp32-c3-idf.yaml +++ b/tests/components/fs3000/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/fs3000/test.esp32-idf.yaml b/tests/components/fs3000/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/fs3000/test.esp32-idf.yaml +++ b/tests/components/fs3000/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/fs3000/test.esp8266-ard.yaml b/tests/components/fs3000/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/fs3000/test.esp8266-ard.yaml +++ b/tests/components/fs3000/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/fs3000/test.rp2040-ard.yaml b/tests/components/fs3000/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/fs3000/test.rp2040-ard.yaml +++ b/tests/components/fs3000/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ft5x06/common.yaml b/tests/components/ft5x06/common.yaml index 322ee88b6d..b1f7ca4cc9 100644 --- a/tests/components/ft5x06/common.yaml +++ b/tests/components/ft5x06/common.yaml @@ -1,20 +1,19 @@ -i2c: - - id: i2c_ft5x06 - scl: ${scl_pin} - sda: ${sda_pin} - display: - platform: ssd1306_i2c - id: ssd1306_display + i2c_id: i2c_bus + id: ft5x06_display model: SSD1306_128X64 reset_pin: ${reset_pin} pages: - - id: page1 + - id: ft5x06_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); touchscreen: - platform: ft5x06 + i2c_id: i2c_bus + display: ft5x06_display + id: ft5x06_touchscreen on_touch: - logger.log: format: Touch at (%d, %d) diff --git a/tests/components/ft5x06/test.esp32-c3-idf.yaml b/tests/components/ft5x06/test.esp32-c3-idf.yaml index 1e6670c196..c97f30d52c 100644 --- a/tests/components/ft5x06/test.esp32-c3-idf.yaml +++ b/tests/components/ft5x06/test.esp32-c3-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ft5x06/test.esp32-idf.yaml b/tests/components/ft5x06/test.esp32-idf.yaml index 1ca773e06c..4ff2241ec9 100644 --- a/tests/components/ft5x06/test.esp32-idf.yaml +++ b/tests/components/ft5x06/test.esp32-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 reset_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ft5x06/test.esp8266-ard.yaml b/tests/components/ft5x06/test.esp8266-ard.yaml index dfdc12a3d1..b8bb94edde 100644 --- a/tests/components/ft5x06/test.esp8266-ard.yaml +++ b/tests/components/ft5x06/test.esp8266-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ft5x06/test.rp2040-ard.yaml b/tests/components/ft5x06/test.rp2040-ard.yaml index 1e6670c196..1bf10642c5 100644 --- a/tests/components/ft5x06/test.rp2040-ard.yaml +++ b/tests/components/ft5x06/test.rp2040-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ft63x6/common.yaml b/tests/components/ft63x6/common.yaml index 1fae6da5f4..ea5a60a2f6 100644 --- a/tests/components/ft63x6/common.yaml +++ b/tests/components/ft63x6/common.yaml @@ -1,25 +1,19 @@ -spi: - - id: spi_ft63x6 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - -i2c: - - id: i2c_ft63x6 - scl: ${scl_pin} - sda: ${sda_pin} - display: - platform: ssd1306_i2c - id: ssd1306_display + i2c_id: i2c_bus + id: ft63x6_display model: SSD1306_128X64 reset_pin: ${reset_pin} pages: - - id: page1 + - id: ft63x6_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); touchscreen: - platform: ft63x6 + i2c_id: i2c_bus + display: ft63x6_display + id: ft63x6_touchscreen interrupt_pin: ${interrupt_pin} transform: swap_xy: true @@ -42,6 +36,7 @@ touchscreen: binary_sensor: - platform: touchscreen + touchscreen_id: ft63x6_touchscreen name: Bottom Left Touch use_raw: true x_min: 0 diff --git a/tests/components/ft63x6/test.esp32-c3-idf.yaml b/tests/components/ft63x6/test.esp32-c3-idf.yaml index 397ac1e464..febf38d8e1 100644 --- a/tests/components/ft63x6/test.esp32-c3-idf.yaml +++ b/tests/components/ft63x6/test.esp32-c3-idf.yaml @@ -1,9 +1,8 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - scl_pin: GPIO0 - sda_pin: GPIO1 interrupt_pin: GPIO2 reset_pin: GPIO3 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ft63x6/test.esp32-idf.yaml b/tests/components/ft63x6/test.esp32-idf.yaml index 47b5796e8b..590f6a919c 100644 --- a/tests/components/ft63x6/test.esp32-idf.yaml +++ b/tests/components/ft63x6/test.esp32-idf.yaml @@ -1,9 +1,8 @@ substitutions: - clk_pin: GPIO0 - mosi_pin: GPIO2 - scl_pin: GPIO13 - sda_pin: GPIO14 interrupt_pin: GPIO15 - reset_pin: GPIO16 + reset_pin: GPIO4 + +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ft63x6/test.esp8266-ard.yaml b/tests/components/ft63x6/test.esp8266-ard.yaml index a4223733af..d6b6903029 100644 --- a/tests/components/ft63x6/test.esp8266-ard.yaml +++ b/tests/components/ft63x6/test.esp8266-ard.yaml @@ -1,9 +1,8 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - scl_pin: GPIO5 - sda_pin: GPIO4 interrupt_pin: GPIO12 reset_pin: GPIO16 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ft63x6/test.rp2040-ard.yaml b/tests/components/ft63x6/test.rp2040-ard.yaml index 397ac1e464..2dd70ff33a 100644 --- a/tests/components/ft63x6/test.rp2040-ard.yaml +++ b/tests/components/ft63x6/test.rp2040-ard.yaml @@ -1,9 +1,8 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - scl_pin: GPIO0 - sda_pin: GPIO1 interrupt_pin: GPIO2 reset_pin: GPIO3 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/gcja5/common.yaml b/tests/components/gcja5/common.yaml index 8f6250045d..64374c0e50 100644 --- a/tests/components/gcja5/common.yaml +++ b/tests/components/gcja5/common.yaml @@ -1,12 +1,6 @@ -uart: - - id: uart_gcja5 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - parity: EVEN - sensor: - platform: gcja5 + uart_id: uart_bus pm_1_0: name: "Particulate Matter <1.0µm Concentration" pm_2_5: diff --git a/tests/components/gcja5/test.esp32-c3-idf.yaml b/tests/components/gcja5/test.esp32-c3-idf.yaml index b516342f3b..236529042f 100644 --- a/tests/components/gcja5/test.esp32-c3-idf.yaml +++ b/tests/components/gcja5/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart_9600_even: !include ../../test_build_components/common/uart_9600_even/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/gcja5/test.esp32-idf.yaml b/tests/components/gcja5/test.esp32-idf.yaml index 811f6b72a6..5ce1861902 100644 --- a/tests/components/gcja5/test.esp32-idf.yaml +++ b/tests/components/gcja5/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO12 - rx_pin: GPIO14 +packages: + uart_9600_even: !include ../../test_build_components/common/uart_9600_even/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/gcja5/test.esp8266-ard.yaml b/tests/components/gcja5/test.esp8266-ard.yaml index b516342f3b..a3f8cf43d4 100644 --- a/tests/components/gcja5/test.esp8266-ard.yaml +++ b/tests/components/gcja5/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart_9600_even: !include ../../test_build_components/common/uart_9600_even/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/gcja5/test.rp2040-ard.yaml b/tests/components/gcja5/test.rp2040-ard.yaml index b516342f3b..7c1f4f41e2 100644 --- a/tests/components/gcja5/test.rp2040-ard.yaml +++ b/tests/components/gcja5/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart_9600_even: !include ../../test_build_components/common/uart_9600_even/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/gdk101/common.yaml b/tests/components/gdk101/common.yaml index 7805ad43f0..4eb5586ade 100644 --- a/tests/components/gdk101/common.yaml +++ b/tests/components/gdk101/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_gdk101 - scl: ${scl_pin} - sda: ${sda_pin} - gdk101: + i2c_id: i2c_bus id: my_gdk101 sensor: diff --git a/tests/components/gdk101/test.esp32-idf.yaml b/tests/components/gdk101/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/gdk101/test.esp32-idf.yaml +++ b/tests/components/gdk101/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/gdk101/test.esp8266-ard.yaml b/tests/components/gdk101/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/gdk101/test.esp8266-ard.yaml +++ b/tests/components/gdk101/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/gdk101/test.rp2040-ard.yaml b/tests/components/gdk101/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/gdk101/test.rp2040-ard.yaml +++ b/tests/components/gdk101/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/gl_r01_i2c/common.yaml b/tests/components/gl_r01_i2c/common.yaml index fe0705bdc6..272a94d349 100644 --- a/tests/components/gl_r01_i2c/common.yaml +++ b/tests/components/gl_r01_i2c/common.yaml @@ -1,12 +1,7 @@ -i2c: - - id: i2c_gl_r01_i2c - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: gl_r01_i2c + i2c_id: i2c_bus id: tof name: "ToF sensor" - i2c_id: i2c_gl_r01_i2c address: 0x74 update_interval: 15s diff --git a/tests/components/gl_r01_i2c/test.esp32-c3-idf.yaml b/tests/components/gl_r01_i2c/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/gl_r01_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/gl_r01_i2c/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/gl_r01_i2c/test.esp32-idf.yaml b/tests/components/gl_r01_i2c/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/gl_r01_i2c/test.esp32-idf.yaml +++ b/tests/components/gl_r01_i2c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/gl_r01_i2c/test.esp8266-ard.yaml b/tests/components/gl_r01_i2c/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/gl_r01_i2c/test.esp8266-ard.yaml +++ b/tests/components/gl_r01_i2c/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/gl_r01_i2c/test.rp2040-ard.yaml b/tests/components/gl_r01_i2c/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/gl_r01_i2c/test.rp2040-ard.yaml +++ b/tests/components/gl_r01_i2c/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/gp2y1010au0f/test.esp8266-ard.yaml b/tests/components/gp2y1010au0f/test.esp8266-ard.yaml index a61053426a..c6a7c7bf13 100644 --- a/tests/components/gp2y1010au0f/test.esp8266-ard.yaml +++ b/tests/components/gp2y1010au0f/test.esp8266-ard.yaml @@ -1,5 +1,5 @@ substitutions: adc_pin: A0 - output_pin: GPIO5 + output_pin: GPIO0 <<: !include common.yaml diff --git a/tests/components/gp8403/common.yaml b/tests/components/gp8403/common.yaml index 7074185273..b04fbc4fbc 100644 --- a/tests/components/gp8403/common.yaml +++ b/tests/components/gp8403/common.yaml @@ -1,12 +1,9 @@ -i2c: - - id: i2c_gp8403 - scl: ${scl_pin} - sda: ${sda_pin} - gp8403: - id: gp8403_5v + i2c_id: i2c_bus voltage: 5V - id: gp8403_10v + i2c_id: i2c_bus voltage: 10V output: diff --git a/tests/components/gp8403/test.esp32-c3-idf.yaml b/tests/components/gp8403/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/gp8403/test.esp32-c3-idf.yaml +++ b/tests/components/gp8403/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/gp8403/test.esp32-idf.yaml b/tests/components/gp8403/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/gp8403/test.esp32-idf.yaml +++ b/tests/components/gp8403/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/gp8403/test.esp8266-ard.yaml b/tests/components/gp8403/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/gp8403/test.esp8266-ard.yaml +++ b/tests/components/gp8403/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/gp8403/test.rp2040-ard.yaml b/tests/components/gp8403/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/gp8403/test.rp2040-ard.yaml +++ b/tests/components/gp8403/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/gpio/test.esp8266-ard.yaml b/tests/components/gpio/test.esp8266-ard.yaml index 09f41abb79..e1660ec47c 100644 --- a/tests/components/gpio/test.esp8266-ard.yaml +++ b/tests/components/gpio/test.esp8266-ard.yaml @@ -1,6 +1,6 @@ substitutions: - binary_sensor_pin: GPIO12 - output_pin: GPIO13 - switch_pin: GPIO14 + binary_sensor_pin: GPIO0 + output_pin: GPIO2 + switch_pin: GPIO15 <<: !include common.yaml diff --git a/tests/components/gps/common.yaml b/tests/components/gps/common.yaml index 53dc67e457..a99e3ef7e0 100644 --- a/tests/components/gps/common.yaml +++ b/tests/components/gps/common.yaml @@ -1,10 +1,3 @@ -uart: - - id: uart_gps - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - parity: EVEN - gps: latitude: name: "Latitude" diff --git a/tests/components/gps/test.esp32-c3-idf.yaml b/tests/components/gps/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/gps/test.esp32-c3-idf.yaml +++ b/tests/components/gps/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/gps/test.esp32-idf.yaml b/tests/components/gps/test.esp32-idf.yaml index 811f6b72a6..64baa4ec9d 100644 --- a/tests/components/gps/test.esp32-idf.yaml +++ b/tests/components/gps/test.esp32-idf.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO12 rx_pin: GPIO14 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/gps/test.esp8266-ard.yaml b/tests/components/gps/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/gps/test.esp8266-ard.yaml +++ b/tests/components/gps/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/gps/test.rp2040-ard.yaml b/tests/components/gps/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/gps/test.rp2040-ard.yaml +++ b/tests/components/gps/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/graph/common.yaml b/tests/components/graph/common.yaml index d2a6a9422d..578de5a60c 100644 --- a/tests/components/graph/common.yaml +++ b/tests/components/graph/common.yaml @@ -1,8 +1,3 @@ -i2c: - - id: i2c_graph - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: template id: some_sensor @@ -20,6 +15,6 @@ display: model: SSD1306_128X64 reset_pin: ${reset_pin} pages: - - id: page1 + - id: graph_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); diff --git a/tests/components/graph/test.esp32-c3-idf.yaml b/tests/components/graph/test.esp32-c3-idf.yaml index 1e6670c196..c97f30d52c 100644 --- a/tests/components/graph/test.esp32-c3-idf.yaml +++ b/tests/components/graph/test.esp32-c3-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/graph/test.esp32-idf.yaml b/tests/components/graph/test.esp32-idf.yaml index 1ca773e06c..4ff2241ec9 100644 --- a/tests/components/graph/test.esp32-idf.yaml +++ b/tests/components/graph/test.esp32-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 reset_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/graph/test.esp8266-ard.yaml b/tests/components/graph/test.esp8266-ard.yaml index dfdc12a3d1..b8bb94edde 100644 --- a/tests/components/graph/test.esp8266-ard.yaml +++ b/tests/components/graph/test.esp8266-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/graph/test.rp2040-ard.yaml b/tests/components/graph/test.rp2040-ard.yaml index 1e6670c196..1bf10642c5 100644 --- a/tests/components/graph/test.rp2040-ard.yaml +++ b/tests/components/graph/test.rp2040-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/graphical_display_menu/common.yaml b/tests/components/graphical_display_menu/common.yaml index d979a6a30e..0b8f20d64b 100644 --- a/tests/components/graphical_display_menu/common.yaml +++ b/tests/components/graphical_display_menu/common.yaml @@ -1,15 +1,10 @@ -i2c: - - id: i2c_graphical_display_menu - scl: ${scl_pin} - sda: ${sda_pin} - display: - platform: ssd1306_i2c id: ssd1306_display model: SSD1306_128X64 reset_pin: ${reset_pin} pages: - - id: page1 + - id: graphical_display_menu_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); diff --git a/tests/components/graphical_display_menu/test.esp32-c3-idf.yaml b/tests/components/graphical_display_menu/test.esp32-c3-idf.yaml index 1e6670c196..c97f30d52c 100644 --- a/tests/components/graphical_display_menu/test.esp32-c3-idf.yaml +++ b/tests/components/graphical_display_menu/test.esp32-c3-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/graphical_display_menu/test.esp32-idf.yaml b/tests/components/graphical_display_menu/test.esp32-idf.yaml index 1ca773e06c..4ff2241ec9 100644 --- a/tests/components/graphical_display_menu/test.esp32-idf.yaml +++ b/tests/components/graphical_display_menu/test.esp32-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 reset_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/graphical_display_menu/test.esp8266-ard.yaml b/tests/components/graphical_display_menu/test.esp8266-ard.yaml index dfdc12a3d1..b8bb94edde 100644 --- a/tests/components/graphical_display_menu/test.esp8266-ard.yaml +++ b/tests/components/graphical_display_menu/test.esp8266-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/graphical_display_menu/test.rp2040-ard.yaml b/tests/components/graphical_display_menu/test.rp2040-ard.yaml index 1e6670c196..1bf10642c5 100644 --- a/tests/components/graphical_display_menu/test.rp2040-ard.yaml +++ b/tests/components/graphical_display_menu/test.rp2040-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/grove_gas_mc_v2/common.yaml b/tests/components/grove_gas_mc_v2/common.yaml index dbdb950033..0729e6b9c7 100644 --- a/tests/components/grove_gas_mc_v2/common.yaml +++ b/tests/components/grove_gas_mc_v2/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_grove_gas_mc_v2 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: grove_gas_mc_v2 + i2c_id: i2c_bus nitrogen_dioxide: name: "Nitrogen Dioxide" ethanol: diff --git a/tests/components/grove_gas_mc_v2/test.esp32-c3-idf.yaml b/tests/components/grove_gas_mc_v2/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/grove_gas_mc_v2/test.esp32-c3-idf.yaml +++ b/tests/components/grove_gas_mc_v2/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/grove_gas_mc_v2/test.esp32-idf.yaml b/tests/components/grove_gas_mc_v2/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/grove_gas_mc_v2/test.esp32-idf.yaml +++ b/tests/components/grove_gas_mc_v2/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/grove_gas_mc_v2/test.esp8266-ard.yaml b/tests/components/grove_gas_mc_v2/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/grove_gas_mc_v2/test.esp8266-ard.yaml +++ b/tests/components/grove_gas_mc_v2/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/grove_gas_mc_v2/test.rp2040-ard.yaml b/tests/components/grove_gas_mc_v2/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/grove_gas_mc_v2/test.rp2040-ard.yaml +++ b/tests/components/grove_gas_mc_v2/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/grove_tb6612fng/common.yaml b/tests/components/grove_tb6612fng/common.yaml index 0db6c00bf7..52d5ead96e 100644 --- a/tests/components/grove_tb6612fng/common.yaml +++ b/tests/components/grove_tb6612fng/common.yaml @@ -13,11 +13,7 @@ esphome: channel: 1 id: test_motor -i2c: - - id: i2c_grove_tb6612fng - scl: ${scl_pin} - sda: ${sda_pin} - grove_tb6612fng: id: test_motor + i2c_id: i2c_bus address: 0x14 diff --git a/tests/components/grove_tb6612fng/test.esp32-c3-idf.yaml b/tests/components/grove_tb6612fng/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/grove_tb6612fng/test.esp32-c3-idf.yaml +++ b/tests/components/grove_tb6612fng/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/grove_tb6612fng/test.esp32-idf.yaml b/tests/components/grove_tb6612fng/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/grove_tb6612fng/test.esp32-idf.yaml +++ b/tests/components/grove_tb6612fng/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/grove_tb6612fng/test.esp8266-ard.yaml b/tests/components/grove_tb6612fng/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/grove_tb6612fng/test.esp8266-ard.yaml +++ b/tests/components/grove_tb6612fng/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/grove_tb6612fng/test.rp2040-ard.yaml b/tests/components/grove_tb6612fng/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/grove_tb6612fng/test.rp2040-ard.yaml +++ b/tests/components/grove_tb6612fng/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/growatt_solar/common.yaml b/tests/components/growatt_solar/common.yaml index 7cc6b2a139..f304e84fcf 100644 --- a/tests/components/growatt_solar/common.yaml +++ b/tests/components/growatt_solar/common.yaml @@ -1,14 +1,6 @@ -uart: - - id: uart_growatt_solar - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - -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 452031a5aa..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: - tx_pin: GPIO4 - rx_pin: GPIO5 flow_control_pin: GPIO3 +packages: + 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 bd767a8ece..a755bfa66a 100644 --- a/tests/components/growatt_solar/test.esp32-idf.yaml +++ b/tests/components/growatt_solar/test.esp32-idf.yaml @@ -3,4 +3,7 @@ substitutions: rx_pin: GPIO14 flow_control_pin: GPIO13 +packages: + 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 29c98d0957..6daa08c22b 100644 --- a/tests/components/growatt_solar/test.esp8266-ard.yaml +++ b/tests/components/growatt_solar/test.esp8266-ard.yaml @@ -1,6 +1,9 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 - flow_control_pin: GPIO13 + tx_pin: GPIO0 + rx_pin: GPIO2 + flow_control_pin: GPIO15 + +packages: + 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 452031a5aa..a00283a9e0 100644 --- a/tests/components/growatt_solar/test.rp2040-ard.yaml +++ b/tests/components/growatt_solar/test.rp2040-ard.yaml @@ -3,4 +3,7 @@ substitutions: rx_pin: GPIO5 flow_control_pin: GPIO3 +packages: + modbus: !include ../../test_build_components/common/modbus/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/gt911/common.yaml b/tests/components/gt911/common.yaml index 7bb88108da..5f9748afb6 100644 --- a/tests/components/gt911/common.yaml +++ b/tests/components/gt911/common.yaml @@ -1,23 +1,21 @@ -i2c: - - id: i2c_gt911 - scl: 5 - sda: 4 - display: - platform: ssd1306_i2c + i2c_id: i2c_bus id: ssd1306_display model: SSD1306_128X64 - reset_pin: 10 + reset_pin: ${display_reset_pin} pages: - - id: page1 + - id: gt911_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); touchscreen: - platform: gt911 + i2c_id: i2c_bus + id: gt911_touchscreen display: ssd1306_display - interrupt_pin: 20 - reset_pin: 21 + interrupt_pin: ${interrupt_pin} + reset_pin: ${reset_pin} binary_sensor: - platform: gt911 diff --git a/tests/components/gt911/test.esp32-c3-idf.yaml b/tests/components/gt911/test.esp32-c3-idf.yaml index dade44d145..5e15963b7e 100644 --- a/tests/components/gt911/test.esp32-c3-idf.yaml +++ b/tests/components/gt911/test.esp32-c3-idf.yaml @@ -1 +1,9 @@ +substitutions: + display_reset_pin: "18" + interrupt_pin: "20" + reset_pin: "21" + +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/gt911/test.esp32-idf.yaml b/tests/components/gt911/test.esp32-idf.yaml index dade44d145..3bce86d9a3 100644 --- a/tests/components/gt911/test.esp32-idf.yaml +++ b/tests/components/gt911/test.esp32-idf.yaml @@ -1 +1,9 @@ +substitutions: + display_reset_pin: "10" + interrupt_pin: "20" + reset_pin: "21" + +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/gt911/test.esp8266-ard.yaml b/tests/components/gt911/test.esp8266-ard.yaml index 8b76eff29e..c3bc159b5b 100644 --- a/tests/components/gt911/test.esp8266-ard.yaml +++ b/tests/components/gt911/test.esp8266-ard.yaml @@ -1,24 +1,9 @@ -i2c: - - id: i2c_gt911 - scl: 5 - sda: 4 +substitutions: + display_reset_pin: "10" + interrupt_pin: "12" + reset_pin: "13" -display: - - platform: ssd1306_i2c - id: ssd1306_display - model: SSD1306_128X64 - reset_pin: 13 - pages: - - id: page1 - lambda: |- - it.rectangle(0, 0, it.get_width(), it.get_height()); +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml -touchscreen: - - platform: gt911 - display: ssd1306_display - interrupt_pin: 12 - -binary_sensor: - - platform: gt911 - id: touch_key_911 - index: 0 +<<: !include common.yaml diff --git a/tests/components/gt911/test.rp2040-ard.yaml b/tests/components/gt911/test.rp2040-ard.yaml index dade44d145..0c7f0bc504 100644 --- a/tests/components/gt911/test.rp2040-ard.yaml +++ b/tests/components/gt911/test.rp2040-ard.yaml @@ -1 +1,9 @@ +substitutions: + display_reset_pin: "10" + interrupt_pin: "20" + reset_pin: "21" + +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/haier/common.yaml b/tests/components/haier/common.yaml index 368b88b69c..926a1d1b7a 100644 --- a/tests/components/haier/common.yaml +++ b/tests/components/haier/common.yaml @@ -2,16 +2,9 @@ wifi: ssid: MySSID password: password1 -uart: - - id: uart_haier - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - climate: - platform: haier id: haier_ac - uart_id: uart_haier protocol: hOn name: Haier AC wifi_signal: true diff --git a/tests/components/haier/test.esp32-c3-idf.yaml b/tests/components/haier/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/haier/test.esp32-c3-idf.yaml +++ b/tests/components/haier/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/haier/test.esp32-idf.yaml b/tests/components/haier/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/haier/test.esp32-idf.yaml +++ b/tests/components/haier/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/haier/test.esp8266-ard.yaml b/tests/components/haier/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/haier/test.esp8266-ard.yaml +++ b/tests/components/haier/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/haier/test.rp2040-ard.yaml b/tests/components/haier/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/haier/test.rp2040-ard.yaml +++ b/tests/components/haier/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/havells_solar/common.yaml b/tests/components/havells_solar/common.yaml index 370b0d357d..2f00f61f14 100644 --- a/tests/components/havells_solar/common.yaml +++ b/tests/components/havells_solar/common.yaml @@ -1,14 +1,6 @@ -uart: - - id: uart_havells_solar - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - -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 452031a5aa..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: - tx_pin: GPIO4 - rx_pin: GPIO5 flow_control_pin: GPIO3 +packages: + 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 bd767a8ece..a755bfa66a 100644 --- a/tests/components/havells_solar/test.esp32-idf.yaml +++ b/tests/components/havells_solar/test.esp32-idf.yaml @@ -3,4 +3,7 @@ substitutions: rx_pin: GPIO14 flow_control_pin: GPIO13 +packages: + 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 29c98d0957..6daa08c22b 100644 --- a/tests/components/havells_solar/test.esp8266-ard.yaml +++ b/tests/components/havells_solar/test.esp8266-ard.yaml @@ -1,6 +1,9 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 - flow_control_pin: GPIO13 + tx_pin: GPIO0 + rx_pin: GPIO2 + flow_control_pin: GPIO15 + +packages: + 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 452031a5aa..a00283a9e0 100644 --- a/tests/components/havells_solar/test.rp2040-ard.yaml +++ b/tests/components/havells_solar/test.rp2040-ard.yaml @@ -3,4 +3,7 @@ substitutions: rx_pin: GPIO5 flow_control_pin: GPIO3 +packages: + modbus: !include ../../test_build_components/common/modbus/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/hbridge/common.yaml b/tests/components/hbridge/common.yaml index 0504cdea03..ca619d6851 100644 --- a/tests/components/hbridge/common.yaml +++ b/tests/components/hbridge/common.yaml @@ -31,9 +31,3 @@ fan: on_preset_set: then: - logger.log: Preset mode was changed! - -switch: - - platform: hbridge - id: switch_hbridge - on_pin: ${hbridge_on_pin} - off_pin: ${hbridge_off_pin} diff --git a/tests/components/hbridge/test.esp32-c3-idf.yaml b/tests/components/hbridge/test.esp32-c3-idf.yaml index c73f08b6de..93a6cb5818 100644 --- a/tests/components/hbridge/test.esp32-c3-idf.yaml +++ b/tests/components/hbridge/test.esp32-c3-idf.yaml @@ -7,9 +7,11 @@ substitutions: hbridge_on_pin: "2" hbridge_off_pin: "3" -packages: - common: !include common.yaml +<<: !include common.yaml switch: - - id: !extend switch_hbridge + - platform: hbridge + id: switch_hbridge + on_pin: ${hbridge_on_pin} + off_pin: ${hbridge_off_pin} pulse_length: 60ms diff --git a/tests/components/hbridge/test.esp32-idf.yaml b/tests/components/hbridge/test.esp32-idf.yaml index dbbfa738c7..7f3d9b928a 100644 --- a/tests/components/hbridge/test.esp32-idf.yaml +++ b/tests/components/hbridge/test.esp32-idf.yaml @@ -7,10 +7,12 @@ substitutions: hbridge_on_pin: "4" hbridge_off_pin: "5" -packages: - common: !include common.yaml +<<: !include common.yaml switch: - - id: !extend switch_hbridge + - platform: hbridge + id: switch_hbridge + on_pin: ${hbridge_on_pin} + off_pin: ${hbridge_off_pin} pulse_length: 60ms wait_time: 10ms diff --git a/tests/components/hbridge/test.esp8266-ard.yaml b/tests/components/hbridge/test.esp8266-ard.yaml index f560da5d38..0346c8801d 100644 --- a/tests/components/hbridge/test.esp8266-ard.yaml +++ b/tests/components/hbridge/test.esp8266-ard.yaml @@ -7,10 +7,12 @@ substitutions: hbridge_on_pin: "14" hbridge_off_pin: "15" -packages: - common: !include common.yaml +<<: !include common.yaml switch: - - id: !extend switch_hbridge + - platform: hbridge + id: switch_hbridge + on_pin: ${hbridge_on_pin} + off_pin: ${hbridge_off_pin} pulse_length: 60ms wait_time: 10ms diff --git a/tests/components/hbridge/test.rp2040-ard.yaml b/tests/components/hbridge/test.rp2040-ard.yaml index aa6e290cab..f9cb2b5618 100644 --- a/tests/components/hbridge/test.rp2040-ard.yaml +++ b/tests/components/hbridge/test.rp2040-ard.yaml @@ -7,10 +7,12 @@ substitutions: hbridge_on_pin: "2" hbridge_off_pin: "3" -packages: - common: !include common.yaml +<<: !include common.yaml switch: - - id: !extend switch_hbridge + - platform: hbridge + id: switch_hbridge + on_pin: ${hbridge_on_pin} + off_pin: ${hbridge_off_pin} wait_time: 10ms optimistic: true diff --git a/tests/components/hdc1080/common.yaml b/tests/components/hdc1080/common.yaml index d260d4737c..a559392cb1 100644 --- a/tests/components/hdc1080/common.yaml +++ b/tests/components/hdc1080/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_hdc1080 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: hdc1080 + i2c_id: i2c_bus temperature: name: Temperature humidity: diff --git a/tests/components/hdc1080/test.esp32-c3-idf.yaml b/tests/components/hdc1080/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/hdc1080/test.esp32-c3-idf.yaml +++ b/tests/components/hdc1080/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/hdc1080/test.esp32-idf.yaml b/tests/components/hdc1080/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/hdc1080/test.esp32-idf.yaml +++ b/tests/components/hdc1080/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/hdc1080/test.esp8266-ard.yaml b/tests/components/hdc1080/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/hdc1080/test.esp8266-ard.yaml +++ b/tests/components/hdc1080/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/hdc1080/test.rp2040-ard.yaml b/tests/components/hdc1080/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/hdc1080/test.rp2040-ard.yaml +++ b/tests/components/hdc1080/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/he60r/common.yaml b/tests/components/he60r/common.yaml index e10e745f57..ab5ec67f0e 100644 --- a/tests/components/he60r/common.yaml +++ b/tests/components/he60r/common.yaml @@ -1,10 +1,3 @@ -uart: - - id: uart_he60r - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 1200 - parity: EVEN - cover: - platform: he60r id: garage_door diff --git a/tests/components/he60r/test.esp32-c3-idf.yaml b/tests/components/he60r/test.esp32-c3-idf.yaml index b516342f3b..b0c8c5de3d 100644 --- a/tests/components/he60r/test.esp32-c3-idf.yaml +++ b/tests/components/he60r/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart_1200_even: !include ../../test_build_components/common/uart_1200_even/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/he60r/test.esp32-idf.yaml b/tests/components/he60r/test.esp32-idf.yaml index f486544afa..f52c2a75f8 100644 --- a/tests/components/he60r/test.esp32-idf.yaml +++ b/tests/components/he60r/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 +packages: + uart_1200_even: !include ../../test_build_components/common/uart_1200_even/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/he60r/test.esp8266-ard.yaml b/tests/components/he60r/test.esp8266-ard.yaml index b516342f3b..e28024fa4d 100644 --- a/tests/components/he60r/test.esp8266-ard.yaml +++ b/tests/components/he60r/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart_1200_even: !include ../../test_build_components/common/uart_1200_even/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/he60r/test.rp2040-ard.yaml b/tests/components/he60r/test.rp2040-ard.yaml index b516342f3b..a576b03d63 100644 --- a/tests/components/he60r/test.rp2040-ard.yaml +++ b/tests/components/he60r/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart_1200_even: !include ../../test_build_components/common/uart_1200_even/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/hlw8012/test.esp8266-ard.yaml b/tests/components/hlw8012/test.esp8266-ard.yaml index 8b42b21b54..ec9c0e43dc 100644 --- a/tests/components/hlw8012/test.esp8266-ard.yaml +++ b/tests/components/hlw8012/test.esp8266-ard.yaml @@ -1,6 +1,6 @@ substitutions: - sel_pin: GPIO12 - cf_pin: GPIO13 - cf1_pin: GPIO14 + sel_pin: GPIO0 + cf_pin: GPIO2 + cf1_pin: GPIO15 <<: !include common.yaml diff --git a/tests/components/hm3301/common.yaml b/tests/components/hm3301/common.yaml index b533130569..a56ac7bc65 100644 --- a/tests/components/hm3301/common.yaml +++ b/tests/components/hm3301/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_hm3301 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: hm3301 + i2c_id: i2c_bus pm_1_0: name: PM1.0 pm_2_5: diff --git a/tests/components/hm3301/test.esp32-c3-idf.yaml b/tests/components/hm3301/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/hm3301/test.esp32-c3-idf.yaml +++ b/tests/components/hm3301/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/hm3301/test.esp32-idf.yaml b/tests/components/hm3301/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/hm3301/test.esp32-idf.yaml +++ b/tests/components/hm3301/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/hm3301/test.esp8266-ard.yaml b/tests/components/hm3301/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/hm3301/test.esp8266-ard.yaml +++ b/tests/components/hm3301/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/hm3301/test.rp2040-ard.yaml b/tests/components/hm3301/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/hm3301/test.rp2040-ard.yaml +++ b/tests/components/hm3301/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/hmc5883l/common.yaml b/tests/components/hmc5883l/common.yaml index 1c90f5f1c6..19e4ba4c45 100644 --- a/tests/components/hmc5883l/common.yaml +++ b/tests/components/hmc5883l/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_hmc5883l - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: hmc5883l + i2c_id: i2c_bus address: 0x68 field_strength_x: name: HMC5883L Field Strength X diff --git a/tests/components/hmc5883l/test.esp32-c3-idf.yaml b/tests/components/hmc5883l/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/hmc5883l/test.esp32-c3-idf.yaml +++ b/tests/components/hmc5883l/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/hmc5883l/test.esp32-idf.yaml b/tests/components/hmc5883l/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/hmc5883l/test.esp32-idf.yaml +++ b/tests/components/hmc5883l/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/hmc5883l/test.esp8266-ard.yaml b/tests/components/hmc5883l/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/hmc5883l/test.esp8266-ard.yaml +++ b/tests/components/hmc5883l/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/hmc5883l/test.rp2040-ard.yaml b/tests/components/hmc5883l/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/hmc5883l/test.rp2040-ard.yaml +++ b/tests/components/hmc5883l/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/honeywell_hih_i2c/common.yaml b/tests/components/honeywell_hih_i2c/common.yaml index a5f3eef187..de588a30bd 100644 --- a/tests/components/honeywell_hih_i2c/common.yaml +++ b/tests/components/honeywell_hih_i2c/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_honeywell_hih - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: honeywell_hih_i2c + i2c_id: i2c_bus temperature: name: Temperature humidity: diff --git a/tests/components/honeywell_hih_i2c/test.esp32-c3-idf.yaml b/tests/components/honeywell_hih_i2c/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/honeywell_hih_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/honeywell_hih_i2c/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/honeywell_hih_i2c/test.esp32-idf.yaml b/tests/components/honeywell_hih_i2c/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/honeywell_hih_i2c/test.esp32-idf.yaml +++ b/tests/components/honeywell_hih_i2c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/honeywell_hih_i2c/test.esp8266-ard.yaml b/tests/components/honeywell_hih_i2c/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/honeywell_hih_i2c/test.esp8266-ard.yaml +++ b/tests/components/honeywell_hih_i2c/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/honeywell_hih_i2c/test.rp2040-ard.yaml b/tests/components/honeywell_hih_i2c/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/honeywell_hih_i2c/test.rp2040-ard.yaml +++ b/tests/components/honeywell_hih_i2c/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/honeywellabp/common.yaml b/tests/components/honeywellabp/common.yaml index 21a3ef6ee3..f82d289ace 100644 --- a/tests/components/honeywellabp/common.yaml +++ b/tests/components/honeywellabp/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_bme280 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sensor: - platform: honeywellabp cs_pin: ${cs_pin} diff --git a/tests/components/honeywellabp/test.esp32-c3-idf.yaml b/tests/components/honeywellabp/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/honeywellabp/test.esp32-c3-idf.yaml +++ b/tests/components/honeywellabp/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/honeywellabp/test.esp32-idf.yaml b/tests/components/honeywellabp/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/honeywellabp/test.esp32-idf.yaml +++ b/tests/components/honeywellabp/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/honeywellabp/test.esp8266-ard.yaml b/tests/components/honeywellabp/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/honeywellabp/test.esp8266-ard.yaml +++ b/tests/components/honeywellabp/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/honeywellabp/test.rp2040-ard.yaml b/tests/components/honeywellabp/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/honeywellabp/test.rp2040-ard.yaml +++ b/tests/components/honeywellabp/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/honeywellabp2_i2c/common.yaml b/tests/components/honeywellabp2_i2c/common.yaml index 6752a69866..e1b060edcf 100644 --- a/tests/components/honeywellabp2_i2c/common.yaml +++ b/tests/components/honeywellabp2_i2c/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_honeywellabp2 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: honeywellabp2_i2c + i2c_id: i2c_bus address: 0x28 pressure: name: Honeywell2 pressure diff --git a/tests/components/honeywellabp2_i2c/test.esp32-c3-idf.yaml b/tests/components/honeywellabp2_i2c/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/honeywellabp2_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/honeywellabp2_i2c/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/honeywellabp2_i2c/test.esp32-idf.yaml b/tests/components/honeywellabp2_i2c/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/honeywellabp2_i2c/test.esp32-idf.yaml +++ b/tests/components/honeywellabp2_i2c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/honeywellabp2_i2c/test.esp8266-ard.yaml b/tests/components/honeywellabp2_i2c/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/honeywellabp2_i2c/test.esp8266-ard.yaml +++ b/tests/components/honeywellabp2_i2c/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/honeywellabp2_i2c/test.rp2040-ard.yaml b/tests/components/honeywellabp2_i2c/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/honeywellabp2_i2c/test.rp2040-ard.yaml +++ b/tests/components/honeywellabp2_i2c/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/hrxl_maxsonar_wr/common.yaml b/tests/components/hrxl_maxsonar_wr/common.yaml index d74ada716d..84376aa5ba 100644 --- a/tests/components/hrxl_maxsonar_wr/common.yaml +++ b/tests/components/hrxl_maxsonar_wr/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_hrxl_maxsonar_wr - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 115200 - sensor: - platform: hrxl_maxsonar_wr id: hrxl_maxsonar_wr_sensor diff --git a/tests/components/hrxl_maxsonar_wr/test.esp32-c3-idf.yaml b/tests/components/hrxl_maxsonar_wr/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/hrxl_maxsonar_wr/test.esp32-c3-idf.yaml +++ b/tests/components/hrxl_maxsonar_wr/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/hrxl_maxsonar_wr/test.esp32-idf.yaml b/tests/components/hrxl_maxsonar_wr/test.esp32-idf.yaml index 811f6b72a6..64baa4ec9d 100644 --- a/tests/components/hrxl_maxsonar_wr/test.esp32-idf.yaml +++ b/tests/components/hrxl_maxsonar_wr/test.esp32-idf.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO12 rx_pin: GPIO14 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/hrxl_maxsonar_wr/test.esp8266-ard.yaml b/tests/components/hrxl_maxsonar_wr/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/hrxl_maxsonar_wr/test.esp8266-ard.yaml +++ b/tests/components/hrxl_maxsonar_wr/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/hrxl_maxsonar_wr/test.rp2040-ard.yaml b/tests/components/hrxl_maxsonar_wr/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/hrxl_maxsonar_wr/test.rp2040-ard.yaml +++ b/tests/components/hrxl_maxsonar_wr/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/hte501/common.yaml b/tests/components/hte501/common.yaml index 7c57b5bc6a..e0641de193 100644 --- a/tests/components/hte501/common.yaml +++ b/tests/components/hte501/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_hte501 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: hte501 + i2c_id: i2c_bus address: 0x40 temperature: name: Temperature diff --git a/tests/components/hte501/test.esp32-c3-idf.yaml b/tests/components/hte501/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/hte501/test.esp32-c3-idf.yaml +++ b/tests/components/hte501/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/hte501/test.esp32-idf.yaml b/tests/components/hte501/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/hte501/test.esp32-idf.yaml +++ b/tests/components/hte501/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/hte501/test.esp8266-ard.yaml b/tests/components/hte501/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/hte501/test.esp8266-ard.yaml +++ b/tests/components/hte501/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/hte501/test.rp2040-ard.yaml b/tests/components/hte501/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/hte501/test.rp2040-ard.yaml +++ b/tests/components/hte501/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/http_request/common.yaml b/tests/components/http_request/common.yaml index 97961007e2..9ff9f9fb67 100644 --- a/tests/components/http_request/common.yaml +++ b/tests/components/http_request/common.yaml @@ -51,6 +51,7 @@ script: ota: - platform: http_request + id: http_request_ota on_begin: then: - logger.log: "OTA start" @@ -77,10 +78,12 @@ button: on_press: then: - ota.http_request.flash: + id: http_request_ota md5_url: http://my.ha.net:8123/local/esphome/firmware.md5 url: http://my.ha.net:8123/local/esphome/firmware.bin - ota.http_request.flash: + id: http_request_ota md5: 0123456789abcdef0123456789abcdef url: http://my.ha.net:8123/local/esphome/firmware.bin @@ -90,6 +93,7 @@ update: - platform: http_request name: OTA Update id: ota_update + ota_id: http_request_ota source: http://my.ha.net:8123/local/esphome/manifest.json on_update_available: - logger.log: "A new update is available" diff --git a/tests/components/htu21d/common.yaml b/tests/components/htu21d/common.yaml index f12c1ca46e..ad4b23d460 100644 --- a/tests/components/htu21d/common.yaml +++ b/tests/components/htu21d/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_htu21d - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: htu21d + i2c_id: i2c_bus model: htu21d temperature: name: Temperature diff --git a/tests/components/htu21d/test.esp32-c3-idf.yaml b/tests/components/htu21d/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/htu21d/test.esp32-c3-idf.yaml +++ b/tests/components/htu21d/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/htu21d/test.esp32-idf.yaml b/tests/components/htu21d/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/htu21d/test.esp32-idf.yaml +++ b/tests/components/htu21d/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/htu21d/test.esp8266-ard.yaml b/tests/components/htu21d/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/htu21d/test.esp8266-ard.yaml +++ b/tests/components/htu21d/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/htu21d/test.rp2040-ard.yaml b/tests/components/htu21d/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/htu21d/test.rp2040-ard.yaml +++ b/tests/components/htu21d/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/htu31d/common.yaml b/tests/components/htu31d/common.yaml index 735cdc7cbf..41d718ea69 100644 --- a/tests/components/htu31d/common.yaml +++ b/tests/components/htu31d/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_htu31d - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: htu31d + i2c_id: i2c_bus temperature: name: Living Room Temperature humidity: diff --git a/tests/components/htu31d/test.esp32-c3-idf.yaml b/tests/components/htu31d/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/htu31d/test.esp32-c3-idf.yaml +++ b/tests/components/htu31d/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/htu31d/test.esp32-idf.yaml b/tests/components/htu31d/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/htu31d/test.esp32-idf.yaml +++ b/tests/components/htu31d/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/htu31d/test.esp8266-ard.yaml b/tests/components/htu31d/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/htu31d/test.esp8266-ard.yaml +++ b/tests/components/htu31d/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/htu31d/test.rp2040-ard.yaml b/tests/components/htu31d/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/htu31d/test.rp2040-ard.yaml +++ b/tests/components/htu31d/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/hx711/test.esp32-c3-idf.yaml b/tests/components/hx711/test.esp32-c3-idf.yaml index 08a6e705c0..defef165e3 100644 --- a/tests/components/hx711/test.esp32-c3-idf.yaml +++ b/tests/components/hx711/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - clk_pin: GPIO5 - dout_pin: GPIO4 + clk_pin: GPIO4 + dout_pin: GPIO5 <<: !include common.yaml diff --git a/tests/components/hx711/test.esp32-idf.yaml b/tests/components/hx711/test.esp32-idf.yaml index 6423867395..defef165e3 100644 --- a/tests/components/hx711/test.esp32-idf.yaml +++ b/tests/components/hx711/test.esp32-idf.yaml @@ -1,5 +1,5 @@ substitutions: - clk_pin: GPIO16 - dout_pin: GPIO17 + clk_pin: GPIO4 + dout_pin: GPIO5 <<: !include common.yaml diff --git a/tests/components/hx711/test.esp8266-ard.yaml b/tests/components/hx711/test.esp8266-ard.yaml index 08a6e705c0..defef165e3 100644 --- a/tests/components/hx711/test.esp8266-ard.yaml +++ b/tests/components/hx711/test.esp8266-ard.yaml @@ -1,5 +1,5 @@ substitutions: - clk_pin: GPIO5 - dout_pin: GPIO4 + clk_pin: GPIO4 + dout_pin: GPIO5 <<: !include common.yaml diff --git a/tests/components/hx711/test.rp2040-ard.yaml b/tests/components/hx711/test.rp2040-ard.yaml index 08a6e705c0..defef165e3 100644 --- a/tests/components/hx711/test.rp2040-ard.yaml +++ b/tests/components/hx711/test.rp2040-ard.yaml @@ -1,5 +1,5 @@ substitutions: - clk_pin: GPIO5 - dout_pin: GPIO4 + clk_pin: GPIO4 + dout_pin: GPIO5 <<: !include common.yaml diff --git a/tests/components/hydreon_rgxx/common.yaml b/tests/components/hydreon_rgxx/common.yaml index e11c6c91c9..e96879fdec 100644 --- a/tests/components/hydreon_rgxx/common.yaml +++ b/tests/components/hydreon_rgxx/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_hydreon_rgxx - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 115200 - binary_sensor: - platform: hydreon_rgxx hydreon_rgxx_id: hydreon_rg9 diff --git a/tests/components/hydreon_rgxx/test.esp32-c3-idf.yaml b/tests/components/hydreon_rgxx/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/hydreon_rgxx/test.esp32-c3-idf.yaml +++ b/tests/components/hydreon_rgxx/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/hydreon_rgxx/test.esp32-idf.yaml b/tests/components/hydreon_rgxx/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/hydreon_rgxx/test.esp32-idf.yaml +++ b/tests/components/hydreon_rgxx/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/hydreon_rgxx/test.esp8266-ard.yaml b/tests/components/hydreon_rgxx/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/hydreon_rgxx/test.esp8266-ard.yaml +++ b/tests/components/hydreon_rgxx/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/hydreon_rgxx/test.rp2040-ard.yaml b/tests/components/hydreon_rgxx/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/hydreon_rgxx/test.rp2040-ard.yaml +++ b/tests/components/hydreon_rgxx/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/hyt271/common.yaml b/tests/components/hyt271/common.yaml index 7a4371173f..5771d882da 100644 --- a/tests/components/hyt271/common.yaml +++ b/tests/components/hyt271/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_hyt271 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: hyt271 + i2c_id: i2c_bus temperature: name: Temperature humidity: diff --git a/tests/components/hyt271/test.esp32-c3-idf.yaml b/tests/components/hyt271/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/hyt271/test.esp32-c3-idf.yaml +++ b/tests/components/hyt271/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/hyt271/test.esp32-idf.yaml b/tests/components/hyt271/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/hyt271/test.esp32-idf.yaml +++ b/tests/components/hyt271/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/hyt271/test.esp8266-ard.yaml b/tests/components/hyt271/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/hyt271/test.esp8266-ard.yaml +++ b/tests/components/hyt271/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/hyt271/test.rp2040-ard.yaml b/tests/components/hyt271/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/hyt271/test.rp2040-ard.yaml +++ b/tests/components/hyt271/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/i2c/common.yaml b/tests/components/i2c/common.yaml index d70cd595ad..e69de29bb2 100644 --- a/tests/components/i2c/common.yaml +++ b/tests/components/i2c/common.yaml @@ -1,4 +0,0 @@ -i2c: - - id: i2c_i2c - scl: ${scl_pin} - sda: ${sda_pin} diff --git a/tests/components/i2c/test.esp32-ard.yaml b/tests/components/i2c/test.esp32-ard.yaml index 63c3bd6afd..7c503b0ccb 100644 --- a/tests/components/i2c/test.esp32-ard.yaml +++ b/tests/components/i2c/test.esp32-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-ard.yaml <<: !include common.yaml diff --git a/tests/components/i2c/test.esp32-c3-idf.yaml b/tests/components/i2c/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/i2c/test.esp32-c3-idf.yaml +++ b/tests/components/i2c/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/i2c/test.esp32-idf.yaml b/tests/components/i2c/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/i2c/test.esp32-idf.yaml +++ b/tests/components/i2c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/i2c/test.esp8266-ard.yaml b/tests/components/i2c/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/i2c/test.esp8266-ard.yaml +++ b/tests/components/i2c/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/i2c/test.rp2040-ard.yaml b/tests/components/i2c/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/i2c/test.rp2040-ard.yaml +++ b/tests/components/i2c/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/i2c_device/common.yaml b/tests/components/i2c_device/common.yaml index 35a6f8f7f0..fed399eb8c 100644 --- a/tests/components/i2c_device/common.yaml +++ b/tests/components/i2c_device/common.yaml @@ -1,8 +1,4 @@ -i2c: - - id: i2c_i2c_device - scl: ${scl_pin} - sda: ${sda_pin} - i2c_device: id: i2cdev + i2c_id: i2c_bus address: 0x2C diff --git a/tests/components/i2c_device/test.esp32-c3-idf.yaml b/tests/components/i2c_device/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/i2c_device/test.esp32-c3-idf.yaml +++ b/tests/components/i2c_device/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/i2c_device/test.esp32-idf.yaml b/tests/components/i2c_device/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/i2c_device/test.esp32-idf.yaml +++ b/tests/components/i2c_device/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/i2c_device/test.esp8266-ard.yaml b/tests/components/i2c_device/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/i2c_device/test.esp8266-ard.yaml +++ b/tests/components/i2c_device/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/i2c_device/test.rp2040-ard.yaml b/tests/components/i2c_device/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/i2c_device/test.rp2040-ard.yaml +++ b/tests/components/i2c_device/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/i2s_audio/test.esp32-idf.yaml b/tests/components/i2s_audio/test.esp32-idf.yaml index ce751d7d4a..ead1eaa1e9 100644 --- a/tests/components/i2s_audio/test.esp32-idf.yaml +++ b/tests/components/i2s_audio/test.esp32-idf.yaml @@ -1,6 +1,9 @@ substitutions: i2s_bclk_pin: GPIO15 - i2s_lrclk_pin: GPIO16 - i2s_mclk_pin: GPIO17 + i2s_lrclk_pin: GPIO4 + i2s_mclk_pin: GPIO5 + +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/iaqcore/common.yaml b/tests/components/iaqcore/common.yaml index 927b836c52..e0f9d09a00 100644 --- a/tests/components/iaqcore/common.yaml +++ b/tests/components/iaqcore/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_iaqcore - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: iaqcore + i2c_id: i2c_bus co2: name: iAQ Core CO2 Sensor tvoc: diff --git a/tests/components/iaqcore/test.esp32-c3-idf.yaml b/tests/components/iaqcore/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/iaqcore/test.esp32-c3-idf.yaml +++ b/tests/components/iaqcore/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/iaqcore/test.esp32-idf.yaml b/tests/components/iaqcore/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/iaqcore/test.esp32-idf.yaml +++ b/tests/components/iaqcore/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/iaqcore/test.esp8266-ard.yaml b/tests/components/iaqcore/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/iaqcore/test.esp8266-ard.yaml +++ b/tests/components/iaqcore/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/iaqcore/test.rp2040-ard.yaml b/tests/components/iaqcore/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/iaqcore/test.rp2040-ard.yaml +++ b/tests/components/iaqcore/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ili9xxx/common.yaml b/tests/components/ili9xxx/common.yaml index b182d110cd..47384b1398 100644 --- a/tests/components/ili9xxx/common.yaml +++ b/tests/components/ili9xxx/common.yaml @@ -1,8 +1,3 @@ -spi: - - id: spi_main_lcd - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - display: - platform: ili9xxx invert_colors: true diff --git a/tests/components/ili9xxx/test.esp32-c3-idf.yaml b/tests/components/ili9xxx/test.esp32-c3-idf.yaml index 3037785e81..1eea1e85f7 100644 --- a/tests/components/ili9xxx/test.esp32-c3-idf.yaml +++ b/tests/components/ili9xxx/test.esp32-c3-idf.yaml @@ -1,12 +1,11 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin1: GPIO8 dc_pin1: GPIO9 reset_pin1: GPIO10 cs_pin2: GPIO2 dc_pin2: GPIO3 - reset_pin2: GPIO4 + reset_pin2: GPIO7 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ili9xxx/test.esp32-idf.yaml b/tests/components/ili9xxx/test.esp32-idf.yaml index 2e006d2521..866e57573b 100644 --- a/tests/components/ili9xxx/test.esp32-idf.yaml +++ b/tests/components/ili9xxx/test.esp32-idf.yaml @@ -1,6 +1,4 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 cs_pin1: GPIO12 dc_pin1: GPIO13 reset_pin1: GPIO14 @@ -8,4 +6,7 @@ substitutions: dc_pin2: GPIO26 reset_pin2: GPIO27 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ili9xxx/test.esp8266-ard.yaml b/tests/components/ili9xxx/test.esp8266-ard.yaml index 5dee055fd4..feb7773794 100644 --- a/tests/components/ili9xxx/test.esp8266-ard.yaml +++ b/tests/components/ili9xxx/test.esp8266-ard.yaml @@ -9,4 +9,7 @@ substitutions: dc_pin2: GPIO4 reset_pin2: GPIO0 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ili9xxx/test.rp2040-ard.yaml b/tests/components/ili9xxx/test.rp2040-ard.yaml index 74c9b906e9..2acde3e629 100644 --- a/tests/components/ili9xxx/test.rp2040-ard.yaml +++ b/tests/components/ili9xxx/test.rp2040-ard.yaml @@ -9,4 +9,7 @@ substitutions: dc_pin2: GPIO21 reset_pin2: GPIO22 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/image/test.esp32-idf.yaml b/tests/components/image/test.esp32-idf.yaml index 814f16c36c..aea2b4bbb0 100644 --- a/tests/components/image/test.esp32-idf.yaml +++ b/tests/components/image/test.esp32-idf.yaml @@ -1,14 +1,12 @@ -spi: - - id: spi_main_lcd - clk_pin: 16 - mosi_pin: 17 - miso_pin: 18 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml display: - platform: ili9xxx id: main_lcd + spi_id: spi_bus model: ili9342 - cs_pin: 19 + cs_pin: 15 dc_pin: 13 reset_pin: 21 invert_colors: true diff --git a/tests/components/image/test.esp8266-ard.yaml b/tests/components/image/test.esp8266-ard.yaml index 626076d44e..2e7bfc5ae5 100644 --- a/tests/components/image/test.esp8266-ard.yaml +++ b/tests/components/image/test.esp8266-ard.yaml @@ -1,12 +1,10 @@ -spi: - - id: spi_main_lcd - clk_pin: 14 - mosi_pin: 13 - miso_pin: 12 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml display: - platform: ili9xxx id: main_lcd + spi_id: spi_bus model: ili9342 cs_pin: 5 dc_pin: 15 diff --git a/tests/components/image/test.rp2040-ard.yaml b/tests/components/image/test.rp2040-ard.yaml index 5167c99a7d..40f17d57fe 100644 --- a/tests/components/image/test.rp2040-ard.yaml +++ b/tests/components/image/test.rp2040-ard.yaml @@ -1,12 +1,10 @@ -spi: - - id: spi_main_lcd - clk_pin: 2 - mosi_pin: 3 - miso_pin: 4 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml display: - platform: ili9xxx id: main_lcd + spi_id: spi_bus model: ili9342 cs_pin: 20 dc_pin: 21 diff --git a/tests/components/ina219/common.yaml b/tests/components/ina219/common.yaml index 4ca4c9ed8f..71291a082d 100644 --- a/tests/components/ina219/common.yaml +++ b/tests/components/ina219/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_ina219 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: ina219 + i2c_id: i2c_bus address: 0x40 shunt_resistance: 0.1 ohm current: diff --git a/tests/components/ina219/test.esp32-c3-idf.yaml b/tests/components/ina219/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ina219/test.esp32-c3-idf.yaml +++ b/tests/components/ina219/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ina219/test.esp32-idf.yaml b/tests/components/ina219/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ina219/test.esp32-idf.yaml +++ b/tests/components/ina219/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ina219/test.esp8266-ard.yaml b/tests/components/ina219/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ina219/test.esp8266-ard.yaml +++ b/tests/components/ina219/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ina219/test.rp2040-ard.yaml b/tests/components/ina219/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ina219/test.rp2040-ard.yaml +++ b/tests/components/ina219/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ina226/common.yaml b/tests/components/ina226/common.yaml index 8bcd038e50..7cbaf8cb2f 100644 --- a/tests/components/ina226/common.yaml +++ b/tests/components/ina226/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_ina226 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: ina226 + i2c_id: i2c_bus address: 0x40 shunt_resistance: 0.1 ohm current: diff --git a/tests/components/ina226/test.esp32-c3-idf.yaml b/tests/components/ina226/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ina226/test.esp32-c3-idf.yaml +++ b/tests/components/ina226/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ina226/test.esp32-idf.yaml b/tests/components/ina226/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ina226/test.esp32-idf.yaml +++ b/tests/components/ina226/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ina226/test.esp8266-ard.yaml b/tests/components/ina226/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ina226/test.esp8266-ard.yaml +++ b/tests/components/ina226/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ina226/test.rp2040-ard.yaml b/tests/components/ina226/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ina226/test.rp2040-ard.yaml +++ b/tests/components/ina226/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ina260/common.yaml b/tests/components/ina260/common.yaml index ab94b2e509..f630d0bb47 100644 --- a/tests/components/ina260/common.yaml +++ b/tests/components/ina260/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_ina260 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: ina260 + i2c_id: i2c_bus address: 0x40 current: name: INA260 Current diff --git a/tests/components/ina260/test.esp32-c3-idf.yaml b/tests/components/ina260/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ina260/test.esp32-c3-idf.yaml +++ b/tests/components/ina260/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ina260/test.esp32-idf.yaml b/tests/components/ina260/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ina260/test.esp32-idf.yaml +++ b/tests/components/ina260/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ina260/test.esp8266-ard.yaml b/tests/components/ina260/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ina260/test.esp8266-ard.yaml +++ b/tests/components/ina260/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ina260/test.rp2040-ard.yaml b/tests/components/ina260/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ina260/test.rp2040-ard.yaml +++ b/tests/components/ina260/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ina2xx_i2c/common.yaml b/tests/components/ina2xx_i2c/common.yaml index 320b680b6b..7d586f136e 100644 --- a/tests/components/ina2xx_i2c/common.yaml +++ b/tests/components/ina2xx_i2c/common.yaml @@ -1,11 +1,6 @@ -i2c: - - id: i2c_ina2xx - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: ina2xx_i2c - i2c_id: i2c_ina2xx + i2c_id: i2c_bus address: 0x40 model: INA228 shunt_resistance: 0.001130 ohm diff --git a/tests/components/ina2xx_i2c/test.esp32-c3-idf.yaml b/tests/components/ina2xx_i2c/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ina2xx_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/ina2xx_i2c/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ina2xx_i2c/test.esp32-idf.yaml b/tests/components/ina2xx_i2c/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ina2xx_i2c/test.esp32-idf.yaml +++ b/tests/components/ina2xx_i2c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ina2xx_i2c/test.esp8266-ard.yaml b/tests/components/ina2xx_i2c/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ina2xx_i2c/test.esp8266-ard.yaml +++ b/tests/components/ina2xx_i2c/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ina2xx_i2c/test.rp2040-ard.yaml b/tests/components/ina2xx_i2c/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ina2xx_i2c/test.rp2040-ard.yaml +++ b/tests/components/ina2xx_i2c/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ina2xx_spi/common.yaml b/tests/components/ina2xx_spi/common.yaml index 3eab7e6f0a..d9b2300e26 100644 --- a/tests/components/ina2xx_spi/common.yaml +++ b/tests/components/ina2xx_spi/common.yaml @@ -1,12 +1,5 @@ -spi: - - id: spi_ina2xx - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sensor: - platform: ina2xx_spi - spi_id: spi_ina2xx cs_pin: ${cs_pin} model: INA229 shunt_resistance: 0.001130 ohm diff --git a/tests/components/ina2xx_spi/test.esp32-c3-idf.yaml b/tests/components/ina2xx_spi/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/ina2xx_spi/test.esp32-c3-idf.yaml +++ b/tests/components/ina2xx_spi/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ina2xx_spi/test.esp32-idf.yaml b/tests/components/ina2xx_spi/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/ina2xx_spi/test.esp32-idf.yaml +++ b/tests/components/ina2xx_spi/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ina2xx_spi/test.esp8266-ard.yaml b/tests/components/ina2xx_spi/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/ina2xx_spi/test.esp8266-ard.yaml +++ b/tests/components/ina2xx_spi/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ina2xx_spi/test.rp2040-ard.yaml b/tests/components/ina2xx_spi/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/ina2xx_spi/test.rp2040-ard.yaml +++ b/tests/components/ina2xx_spi/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ina3221/common.yaml b/tests/components/ina3221/common.yaml index ba1abdfe3a..570d1b0a12 100644 --- a/tests/components/ina3221/common.yaml +++ b/tests/components/ina3221/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_ina3221 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: ina3221 + i2c_id: i2c_bus address: 0x40 channel_1: shunt_resistance: 0.1 ohm diff --git a/tests/components/ina3221/test.esp32-c3-idf.yaml b/tests/components/ina3221/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ina3221/test.esp32-c3-idf.yaml +++ b/tests/components/ina3221/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ina3221/test.esp32-idf.yaml b/tests/components/ina3221/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ina3221/test.esp32-idf.yaml +++ b/tests/components/ina3221/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ina3221/test.esp8266-ard.yaml b/tests/components/ina3221/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ina3221/test.esp8266-ard.yaml +++ b/tests/components/ina3221/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ina3221/test.rp2040-ard.yaml b/tests/components/ina3221/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ina3221/test.rp2040-ard.yaml +++ b/tests/components/ina3221/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/inkbird_ibsth1_mini/test.esp32-c3-idf.yaml b/tests/components/inkbird_ibsth1_mini/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/inkbird_ibsth1_mini/test.esp32-c3-idf.yaml +++ b/tests/components/inkbird_ibsth1_mini/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/inkbird_ibsth1_mini/test.esp32-idf.yaml b/tests/components/inkbird_ibsth1_mini/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/inkbird_ibsth1_mini/test.esp32-idf.yaml +++ b/tests/components/inkbird_ibsth1_mini/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/inkplate/common.yaml b/tests/components/inkplate/common.yaml index 7050b1739f..bb18ff4f7e 100644 --- a/tests/components/inkplate/common.yaml +++ b/tests/components/inkplate/common.yaml @@ -1,13 +1,9 @@ -i2c: - - id: i2c_inkplate - scl: 16 - sda: 17 - esp32: cpu_frequency: 240MHz display: - platform: inkplate + i2c_id: i2c_bus id: inkplate_display greyscale: false partial_updating: false diff --git a/tests/components/inkplate/test.esp32-idf.yaml b/tests/components/inkplate/test.esp32-idf.yaml index dade44d145..b47e39c389 100644 --- a/tests/components/inkplate/test.esp32-idf.yaml +++ b/tests/components/inkplate/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/jsn_sr04t/common.yaml b/tests/components/jsn_sr04t/common.yaml index d6871d5e91..bc2c301c2e 100644 --- a/tests/components/jsn_sr04t/common.yaml +++ b/tests/components/jsn_sr04t/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_jsn_sr04t - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - sensor: - platform: jsn_sr04t id: jsn_sr04t_sensor diff --git a/tests/components/jsn_sr04t/test.esp32-c3-idf.yaml b/tests/components/jsn_sr04t/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/jsn_sr04t/test.esp32-c3-idf.yaml +++ b/tests/components/jsn_sr04t/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/jsn_sr04t/test.esp32-idf.yaml b/tests/components/jsn_sr04t/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/jsn_sr04t/test.esp32-idf.yaml +++ b/tests/components/jsn_sr04t/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/jsn_sr04t/test.esp8266-ard.yaml b/tests/components/jsn_sr04t/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/jsn_sr04t/test.esp8266-ard.yaml +++ b/tests/components/jsn_sr04t/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/jsn_sr04t/test.rp2040-ard.yaml b/tests/components/jsn_sr04t/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/jsn_sr04t/test.rp2040-ard.yaml +++ b/tests/components/jsn_sr04t/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/kamstrup_kmp/common.yaml b/tests/components/kamstrup_kmp/common.yaml index b348d03c72..b3ebea523c 100644 --- a/tests/components/kamstrup_kmp/common.yaml +++ b/tests/components/kamstrup_kmp/common.yaml @@ -1,9 +1,3 @@ -uart: - tx_pin: ${uart_tx_pin} - rx_pin: ${uart_rx_pin} - baud_rate: 1200 - stop_bits: 2 - sensor: - platform: kamstrup_kmp heat_energy: diff --git a/tests/components/kamstrup_kmp/test.esp32-idf.yaml b/tests/components/kamstrup_kmp/test.esp32-idf.yaml index adc2c4d24a..1016905720 100644 --- a/tests/components/kamstrup_kmp/test.esp32-idf.yaml +++ b/tests/components/kamstrup_kmp/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - uart_tx_pin: GPIO1 - uart_rx_pin: GPIO3 +packages: + uart_1200: !include ../../test_build_components/common/uart_1200/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/kamstrup_kmp/test.esp8266-ard.yaml b/tests/components/kamstrup_kmp/test.esp8266-ard.yaml index adc2c4d24a..f55c18eb76 100644 --- a/tests/components/kamstrup_kmp/test.esp8266-ard.yaml +++ b/tests/components/kamstrup_kmp/test.esp8266-ard.yaml @@ -2,4 +2,7 @@ substitutions: uart_tx_pin: GPIO1 uart_rx_pin: GPIO3 +packages: + uart_1200: !include ../../test_build_components/common/uart_1200/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/kmeteriso/common.yaml b/tests/components/kmeteriso/common.yaml index 6b68175904..8542bb6a06 100644 --- a/tests/components/kmeteriso/common.yaml +++ b/tests/components/kmeteriso/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_kmeteriso - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: kmeteriso + i2c_id: i2c_bus temperature: name: Outside Temperature internal_temperature: diff --git a/tests/components/kmeteriso/test.esp32-c3-idf.yaml b/tests/components/kmeteriso/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/kmeteriso/test.esp32-c3-idf.yaml +++ b/tests/components/kmeteriso/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/kmeteriso/test.esp32-idf.yaml b/tests/components/kmeteriso/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/kmeteriso/test.esp32-idf.yaml +++ b/tests/components/kmeteriso/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/kmeteriso/test.esp8266-ard.yaml b/tests/components/kmeteriso/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/kmeteriso/test.esp8266-ard.yaml +++ b/tests/components/kmeteriso/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/kmeteriso/test.rp2040-ard.yaml b/tests/components/kmeteriso/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/kmeteriso/test.rp2040-ard.yaml +++ b/tests/components/kmeteriso/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/kuntze/common.yaml b/tests/components/kuntze/common.yaml index 4daecea242..32c6fa3809 100644 --- a/tests/components/kuntze/common.yaml +++ b/tests/components/kuntze/common.yaml @@ -1,14 +1,6 @@ -uart: - - id: uart_kuntze - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - -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 452031a5aa..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: - tx_pin: GPIO4 - rx_pin: GPIO5 flow_control_pin: GPIO3 +packages: + 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 bd767a8ece..a755bfa66a 100644 --- a/tests/components/kuntze/test.esp32-idf.yaml +++ b/tests/components/kuntze/test.esp32-idf.yaml @@ -3,4 +3,7 @@ substitutions: rx_pin: GPIO14 flow_control_pin: GPIO13 +packages: + 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 29c98d0957..6daa08c22b 100644 --- a/tests/components/kuntze/test.esp8266-ard.yaml +++ b/tests/components/kuntze/test.esp8266-ard.yaml @@ -1,6 +1,9 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 - flow_control_pin: GPIO13 + tx_pin: GPIO0 + rx_pin: GPIO2 + flow_control_pin: GPIO15 + +packages: + 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 452031a5aa..a00283a9e0 100644 --- a/tests/components/kuntze/test.rp2040-ard.yaml +++ b/tests/components/kuntze/test.rp2040-ard.yaml @@ -3,4 +3,7 @@ substitutions: rx_pin: GPIO5 flow_control_pin: GPIO3 +packages: + modbus: !include ../../test_build_components/common/modbus/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/lc709203f/common.yaml b/tests/components/lc709203f/common.yaml index 53177c0d4a..3711e5372c 100644 --- a/tests/components/lc709203f/common.yaml +++ b/tests/components/lc709203f/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_lc709203f - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: lc709203f + i2c_id: i2c_bus size: 2000 voltage: 3.7 battery_voltage: diff --git a/tests/components/lc709203f/test.esp32-c3-idf.yaml b/tests/components/lc709203f/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/lc709203f/test.esp32-c3-idf.yaml +++ b/tests/components/lc709203f/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/lc709203f/test.esp32-idf.yaml b/tests/components/lc709203f/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/lc709203f/test.esp32-idf.yaml +++ b/tests/components/lc709203f/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/lc709203f/test.esp8266-ard.yaml b/tests/components/lc709203f/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/lc709203f/test.esp8266-ard.yaml +++ b/tests/components/lc709203f/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/lc709203f/test.rp2040-ard.yaml b/tests/components/lc709203f/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/lc709203f/test.rp2040-ard.yaml +++ b/tests/components/lc709203f/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/lcd_gpio/test.esp32-idf.yaml b/tests/components/lcd_gpio/test.esp32-idf.yaml index 9c2af456b5..93abad5e38 100644 --- a/tests/components/lcd_gpio/test.esp32-idf.yaml +++ b/tests/components/lcd_gpio/test.esp32-idf.yaml @@ -3,7 +3,7 @@ substitutions: d1_pin: GPIO13 d2_pin: GPIO14 d3_pin: GPIO15 - enable_pin: GPIO16 + enable_pin: GPIO4 rs_pin: GPIO5 <<: !include common.yaml diff --git a/tests/components/lcd_gpio/test.esp8266-ard.yaml b/tests/components/lcd_gpio/test.esp8266-ard.yaml index 9c2af456b5..50471a16f4 100644 --- a/tests/components/lcd_gpio/test.esp8266-ard.yaml +++ b/tests/components/lcd_gpio/test.esp8266-ard.yaml @@ -1,6 +1,6 @@ substitutions: - d0_pin: GPIO12 - d1_pin: GPIO13 + d0_pin: GPIO0 + d1_pin: GPIO2 d2_pin: GPIO14 d3_pin: GPIO15 enable_pin: GPIO16 diff --git a/tests/components/lcd_menu/test.esp32-idf.yaml b/tests/components/lcd_menu/test.esp32-idf.yaml index 9c2af456b5..93abad5e38 100644 --- a/tests/components/lcd_menu/test.esp32-idf.yaml +++ b/tests/components/lcd_menu/test.esp32-idf.yaml @@ -3,7 +3,7 @@ substitutions: d1_pin: GPIO13 d2_pin: GPIO14 d3_pin: GPIO15 - enable_pin: GPIO16 + enable_pin: GPIO4 rs_pin: GPIO5 <<: !include common.yaml diff --git a/tests/components/lcd_menu/test.esp8266-ard.yaml b/tests/components/lcd_menu/test.esp8266-ard.yaml index 9c2af456b5..50471a16f4 100644 --- a/tests/components/lcd_menu/test.esp8266-ard.yaml +++ b/tests/components/lcd_menu/test.esp8266-ard.yaml @@ -1,6 +1,6 @@ substitutions: - d0_pin: GPIO12 - d1_pin: GPIO13 + d0_pin: GPIO0 + d1_pin: GPIO2 d2_pin: GPIO14 d3_pin: GPIO15 enable_pin: GPIO16 diff --git a/tests/components/lcd_pcf8574/common.yaml b/tests/components/lcd_pcf8574/common.yaml index 8b03cf5497..1ec4400332 100644 --- a/tests/components/lcd_pcf8574/common.yaml +++ b/tests/components/lcd_pcf8574/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_lcd_pcf8574 - scl: ${scl_pin} - sda: ${sda_pin} - display: - platform: lcd_pcf8574 + i2c_id: i2c_bus dimensions: 18x4 address: 0x3F user_characters: diff --git a/tests/components/lcd_pcf8574/test.esp32-c3-idf.yaml b/tests/components/lcd_pcf8574/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/lcd_pcf8574/test.esp32-c3-idf.yaml +++ b/tests/components/lcd_pcf8574/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/lcd_pcf8574/test.esp32-idf.yaml b/tests/components/lcd_pcf8574/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/lcd_pcf8574/test.esp32-idf.yaml +++ b/tests/components/lcd_pcf8574/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/lcd_pcf8574/test.esp8266-ard.yaml b/tests/components/lcd_pcf8574/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/lcd_pcf8574/test.esp8266-ard.yaml +++ b/tests/components/lcd_pcf8574/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/lcd_pcf8574/test.rp2040-ard.yaml b/tests/components/lcd_pcf8574/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/lcd_pcf8574/test.rp2040-ard.yaml +++ b/tests/components/lcd_pcf8574/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ld2410/common.yaml b/tests/components/ld2410/common.yaml index e975fcf757..7d168bf7ec 100644 --- a/tests/components/ld2410/common.yaml +++ b/tests/components/ld2410/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_ld2410 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - ld2410: id: my_ld2410 diff --git a/tests/components/ld2410/test.esp32-c3-idf.yaml b/tests/components/ld2410/test.esp32-c3-idf.yaml index b516342f3b..7a8f790ed8 100644 --- a/tests/components/ld2410/test.esp32-c3-idf.yaml +++ b/tests/components/ld2410/test.esp32-c3-idf.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ld2410/test.esp32-idf.yaml b/tests/components/ld2410/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/ld2410/test.esp32-idf.yaml +++ b/tests/components/ld2410/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ld2410/test.esp8266-ard.yaml b/tests/components/ld2410/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/ld2410/test.esp8266-ard.yaml +++ b/tests/components/ld2410/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ld2410/test.rp2040-ard.yaml b/tests/components/ld2410/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/ld2410/test.rp2040-ard.yaml +++ b/tests/components/ld2410/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ld2412/common.yaml b/tests/components/ld2412/common.yaml index 9176c61fd5..18c4612ffe 100644 --- a/tests/components/ld2412/common.yaml +++ b/tests/components/ld2412/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_ld2412 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - ld2412: id: my_ld2412 @@ -123,13 +117,13 @@ select: on_value: - delay: 3s - lambda: |- - id(uart_ld2412).flush(); + id(uart_bus).flush(); uint32_t new_baud_rate = stoi(x); - ESP_LOGD("change_baud_rate", "Changing baud rate from %i to %i",id(uart_ld2412).get_baud_rate(), new_baud_rate); - if (id(uart_ld2412).get_baud_rate() != new_baud_rate) { - id(uart_ld2412).set_baud_rate(new_baud_rate); + ESP_LOGD("change_baud_rate", "Changing baud rate from %i to %i",id(uart_bus).get_baud_rate(), new_baud_rate); + if (id(uart_bus).get_baud_rate() != new_baud_rate) { + id(uart_bus).set_baud_rate(new_baud_rate); #if defined(USE_ESP8266) || defined(USE_ESP32) - id(uart_ld2412).load_settings(); + id(uart_bus).load_settings(); #endif } diff --git a/tests/components/ld2412/test.esp32-c3-idf.yaml b/tests/components/ld2412/test.esp32-c3-idf.yaml index b516342f3b..7a8f790ed8 100644 --- a/tests/components/ld2412/test.esp32-c3-idf.yaml +++ b/tests/components/ld2412/test.esp32-c3-idf.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ld2412/test.esp32-idf.yaml b/tests/components/ld2412/test.esp32-idf.yaml index f486544afa..2d29656c94 100644 --- a/tests/components/ld2412/test.esp32-idf.yaml +++ b/tests/components/ld2412/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ld2412/test.esp8266-ard.yaml b/tests/components/ld2412/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/ld2412/test.esp8266-ard.yaml +++ b/tests/components/ld2412/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ld2412/test.rp2040-ard.yaml b/tests/components/ld2412/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/ld2412/test.rp2040-ard.yaml +++ b/tests/components/ld2412/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ld2420/common.yaml b/tests/components/ld2420/common.yaml index 76748aa8f0..1539df4d1b 100644 --- a/tests/components/ld2420/common.yaml +++ b/tests/components/ld2420/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_ld2420 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - ld2420: id: my_ld2420 diff --git a/tests/components/ld2420/test.esp32-c3-idf.yaml b/tests/components/ld2420/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/ld2420/test.esp32-c3-idf.yaml +++ b/tests/components/ld2420/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ld2420/test.esp32-idf.yaml b/tests/components/ld2420/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/ld2420/test.esp32-idf.yaml +++ b/tests/components/ld2420/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ld2420/test.esp8266-ard.yaml b/tests/components/ld2420/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/ld2420/test.esp8266-ard.yaml +++ b/tests/components/ld2420/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ld2420/test.rp2040-ard.yaml b/tests/components/ld2420/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/ld2420/test.rp2040-ard.yaml +++ b/tests/components/ld2420/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ld2450/common.yaml b/tests/components/ld2450/common.yaml index c18bed46b0..9dcefffd09 100644 --- a/tests/components/ld2450/common.yaml +++ b/tests/components/ld2450/common.yaml @@ -1,14 +1,5 @@ -uart: - - id: ld2450_uart - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 256000 - parity: NONE - stop_bits: 1 - ld2450: - id: ld2450_radar - uart_id: ld2450_uart button: - platform: ld2450 diff --git a/tests/components/ld2450/test.esp32-c3-idf.yaml b/tests/components/ld2450/test.esp32-c3-idf.yaml index b516342f3b..7a8f790ed8 100644 --- a/tests/components/ld2450/test.esp32-c3-idf.yaml +++ b/tests/components/ld2450/test.esp32-c3-idf.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ld2450/test.esp32-idf.yaml b/tests/components/ld2450/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/ld2450/test.esp32-idf.yaml +++ b/tests/components/ld2450/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ld2450/test.esp8266-ard.yaml b/tests/components/ld2450/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/ld2450/test.esp8266-ard.yaml +++ b/tests/components/ld2450/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ld2450/test.rp2040-ard.yaml b/tests/components/ld2450/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/ld2450/test.rp2040-ard.yaml +++ b/tests/components/ld2450/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/lilygo_t5_47/common.yaml b/tests/components/lilygo_t5_47/common.yaml index f539c58d74..7079139ec7 100644 --- a/tests/components/lilygo_t5_47/common.yaml +++ b/tests/components/lilygo_t5_47/common.yaml @@ -1,20 +1,17 @@ -i2c: - - id: i2c_lilygo_t5_47 - scl: ${scl_pin} - sda: ${sda_pin} - display: - platform: ssd1306_i2c + i2c_id: i2c_bus id: ssd1306_display model: SSD1306_128X64 reset_pin: ${reset_pin} pages: - - id: page1 + - id: lilygo_t5_47_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); touchscreen: - platform: lilygo_t5_47 + i2c_id: i2c_bus id: lilygo_touchscreen interrupt_pin: ${interrupt_pin} display: ssd1306_display diff --git a/tests/components/lilygo_t5_47/test.esp32-c3-idf.yaml b/tests/components/lilygo_t5_47/test.esp32-c3-idf.yaml index 061a98ce24..febf38d8e1 100644 --- a/tests/components/lilygo_t5_47/test.esp32-c3-idf.yaml +++ b/tests/components/lilygo_t5_47/test.esp32-c3-idf.yaml @@ -1,7 +1,8 @@ substitutions: - scl_pin: GPIO0 - sda_pin: GPIO1 interrupt_pin: GPIO2 reset_pin: GPIO3 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/lilygo_t5_47/test.esp32-idf.yaml b/tests/components/lilygo_t5_47/test.esp32-idf.yaml index 342f0b6d8b..590f6a919c 100644 --- a/tests/components/lilygo_t5_47/test.esp32-idf.yaml +++ b/tests/components/lilygo_t5_47/test.esp32-idf.yaml @@ -1,7 +1,8 @@ substitutions: - scl_pin: GPIO13 - sda_pin: GPIO14 interrupt_pin: GPIO15 - reset_pin: GPIO16 + reset_pin: GPIO4 + +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/lilygo_t5_47/test.esp8266-ard.yaml b/tests/components/lilygo_t5_47/test.esp8266-ard.yaml index b446a75f13..3684d5e77b 100644 --- a/tests/components/lilygo_t5_47/test.esp8266-ard.yaml +++ b/tests/components/lilygo_t5_47/test.esp8266-ard.yaml @@ -1,7 +1,8 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 - interrupt_pin: GPIO12 + interrupt_pin: GPIO15 reset_pin: GPIO16 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/lilygo_t5_47/test.rp2040-ard.yaml b/tests/components/lilygo_t5_47/test.rp2040-ard.yaml index 061a98ce24..2dd70ff33a 100644 --- a/tests/components/lilygo_t5_47/test.rp2040-ard.yaml +++ b/tests/components/lilygo_t5_47/test.rp2040-ard.yaml @@ -1,7 +1,8 @@ substitutions: - scl_pin: GPIO0 - sda_pin: GPIO1 interrupt_pin: GPIO2 reset_pin: GPIO3 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/lm75b/common.yaml b/tests/components/lm75b/common.yaml index e451c2f679..39c39ed8dc 100644 --- a/tests/components/lm75b/common.yaml +++ b/tests/components/lm75b/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_lm75b - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: lm75b + i2c_id: i2c_bus name: LM75B Temperature update_interval: 30s diff --git a/tests/components/lm75b/test.esp32-c3-idf.yaml b/tests/components/lm75b/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/lm75b/test.esp32-c3-idf.yaml +++ b/tests/components/lm75b/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/lm75b/test.esp32-idf.yaml b/tests/components/lm75b/test.esp32-idf.yaml index 43264df633..b47e39c389 100644 --- a/tests/components/lm75b/test.esp32-idf.yaml +++ b/tests/components/lm75b/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO15 - sda_pin: GPIO13 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/lm75b/test.esp8266-ard.yaml b/tests/components/lm75b/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/lm75b/test.esp8266-ard.yaml +++ b/tests/components/lm75b/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/lm75b/test.rp2040-ard.yaml b/tests/components/lm75b/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/lm75b/test.rp2040-ard.yaml +++ b/tests/components/lm75b/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/lock/common.yaml b/tests/components/lock/common.yaml index 67da46653c..1ee88a239a 100644 --- a/tests/components/lock/common.yaml +++ b/tests/components/lock/common.yaml @@ -27,7 +27,9 @@ lock: id: test_lock1 state: !lambda "return LOCK_STATE_UNLOCKED;" on_lock: - - lock.template.publish: LOCKED + - lock.template.publish: + id: test_lock1 + state: LOCKED - platform: output name: Generic Output Lock id: test_lock2 diff --git a/tests/components/lps22/common.yaml b/tests/components/lps22/common.yaml index e6de4752ba..026b3620cd 100644 --- a/tests/components/lps22/common.yaml +++ b/tests/components/lps22/common.yaml @@ -1,5 +1,6 @@ sensor: - platform: lps22 + i2c_id: i2c_bus address: 0x5d update_interval: 10s temperature: diff --git a/tests/components/lps22/test.esp32-c3-idf.yaml b/tests/components/lps22/test.esp32-c3-idf.yaml index 6091393d31..9990d96d29 100644 --- a/tests/components/lps22/test.esp32-c3-idf.yaml +++ b/tests/components/lps22/test.esp32-c3-idf.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_lps22 - scl: 5 - sda: 4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/lps22/test.esp32-idf.yaml b/tests/components/lps22/test.esp32-idf.yaml index 0da6a9577e..b47e39c389 100644 --- a/tests/components/lps22/test.esp32-idf.yaml +++ b/tests/components/lps22/test.esp32-idf.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_lps22 - scl: 16 - sda: 17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/lps22/test.esp8266-ard.yaml b/tests/components/lps22/test.esp8266-ard.yaml index 6091393d31..4a98b9388a 100644 --- a/tests/components/lps22/test.esp8266-ard.yaml +++ b/tests/components/lps22/test.esp8266-ard.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_lps22 - scl: 5 - sda: 4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/lps22/test.rp2040-ard.yaml b/tests/components/lps22/test.rp2040-ard.yaml index 6091393d31..319a7c71a6 100644 --- a/tests/components/lps22/test.rp2040-ard.yaml +++ b/tests/components/lps22/test.rp2040-ard.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_lps22 - scl: 5 - sda: 4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ltr390/common.yaml b/tests/components/ltr390/common.yaml index e5e331e7ba..c168da557b 100644 --- a/tests/components/ltr390/common.yaml +++ b/tests/components/ltr390/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_ltr390 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: ltr390 + i2c_id: i2c_bus uv: name: LTR390 UV 1 uv_index: @@ -19,6 +15,7 @@ sensor: address: 0x53 update_interval: 60s - platform: ltr390 + i2c_id: i2c_bus uv: name: LTR390 UV 2 uv_index: diff --git a/tests/components/ltr390/test.esp32-c3-idf.yaml b/tests/components/ltr390/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ltr390/test.esp32-c3-idf.yaml +++ b/tests/components/ltr390/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ltr390/test.esp32-idf.yaml b/tests/components/ltr390/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ltr390/test.esp32-idf.yaml +++ b/tests/components/ltr390/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ltr390/test.esp8266-ard.yaml b/tests/components/ltr390/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ltr390/test.esp8266-ard.yaml +++ b/tests/components/ltr390/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ltr390/test.rp2040-ard.yaml b/tests/components/ltr390/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ltr390/test.rp2040-ard.yaml +++ b/tests/components/ltr390/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ltr501/common.yaml b/tests/components/ltr501/common.yaml index b7074f52f2..77c6f13739 100644 --- a/tests/components/ltr501/common.yaml +++ b/tests/components/ltr501/common.yaml @@ -1,7 +1,6 @@ sensor: - platform: ltr501 address: 0x23 - i2c_id: i2c_ltr501 type: ALS_PS gain: 1X integration_time: 100ms diff --git a/tests/components/ltr501/test.esp32-c3-idf.yaml b/tests/components/ltr501/test.esp32-c3-idf.yaml index 9e7de2768d..72703301a1 100644 --- a/tests/components/ltr501/test.esp32-c3-idf.yaml +++ b/tests/components/ltr501/test.esp32-c3-idf.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_ltr501 - scl: 5 - sda: 4 +packages: + i2c_low_freq: !include ../../test_build_components/common/i2c_low_freq/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ltr501/test.esp32-idf.yaml b/tests/components/ltr501/test.esp32-idf.yaml index 4c710c74fe..7a5d01898a 100644 --- a/tests/components/ltr501/test.esp32-idf.yaml +++ b/tests/components/ltr501/test.esp32-idf.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_ltr501 - scl: 16 - sda: 17 +packages: + i2c_low_freq: !include ../../test_build_components/common/i2c_low_freq/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ltr501/test.esp8266-ard.yaml b/tests/components/ltr501/test.esp8266-ard.yaml index 9e7de2768d..9e23bb3778 100644 --- a/tests/components/ltr501/test.esp8266-ard.yaml +++ b/tests/components/ltr501/test.esp8266-ard.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_ltr501 - scl: 5 - sda: 4 +packages: + i2c_low_freq: !include ../../test_build_components/common/i2c_low_freq/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ltr501/test.rp2040-ard.yaml b/tests/components/ltr501/test.rp2040-ard.yaml index 9e7de2768d..a7eb30036f 100644 --- a/tests/components/ltr501/test.rp2040-ard.yaml +++ b/tests/components/ltr501/test.rp2040-ard.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_ltr501 - scl: 5 - sda: 4 +packages: + i2c_low_freq: !include ../../test_build_components/common/i2c_low_freq/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ltr_als_ps/common.yaml b/tests/components/ltr_als_ps/common.yaml index aa5c8abed7..edad4b2e4f 100644 --- a/tests/components/ltr_als_ps/common.yaml +++ b/tests/components/ltr_als_ps/common.yaml @@ -1,7 +1,6 @@ sensor: - platform: ltr_als_ps address: 0x23 - i2c_id: i2c_als_ps gain: 1x integration_time: 100ms ps_cooldown: 5 s diff --git a/tests/components/ltr_als_ps/test.esp32-c3-idf.yaml b/tests/components/ltr_als_ps/test.esp32-c3-idf.yaml index d64d70f018..72703301a1 100644 --- a/tests/components/ltr_als_ps/test.esp32-c3-idf.yaml +++ b/tests/components/ltr_als_ps/test.esp32-c3-idf.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_als_ps - scl: 5 - sda: 4 +packages: + i2c_low_freq: !include ../../test_build_components/common/i2c_low_freq/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ltr_als_ps/test.esp32-idf.yaml b/tests/components/ltr_als_ps/test.esp32-idf.yaml index 2349292a64..7a5d01898a 100644 --- a/tests/components/ltr_als_ps/test.esp32-idf.yaml +++ b/tests/components/ltr_als_ps/test.esp32-idf.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_als_ps - scl: 16 - sda: 17 +packages: + i2c_low_freq: !include ../../test_build_components/common/i2c_low_freq/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ltr_als_ps/test.esp8266-ard.yaml b/tests/components/ltr_als_ps/test.esp8266-ard.yaml index d64d70f018..9e23bb3778 100644 --- a/tests/components/ltr_als_ps/test.esp8266-ard.yaml +++ b/tests/components/ltr_als_ps/test.esp8266-ard.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_als_ps - scl: 5 - sda: 4 +packages: + i2c_low_freq: !include ../../test_build_components/common/i2c_low_freq/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ltr_als_ps/test.rp2040-ard.yaml b/tests/components/ltr_als_ps/test.rp2040-ard.yaml index d64d70f018..a7eb30036f 100644 --- a/tests/components/ltr_als_ps/test.rp2040-ard.yaml +++ b/tests/components/ltr_als_ps/test.rp2040-ard.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_als_ps - scl: 5 - sda: 4 +packages: + i2c_low_freq: !include ../../test_build_components/common/i2c_low_freq/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/lvgl/common.yaml b/tests/components/lvgl/common.yaml index a035900386..d9b7013a1e 100644 --- a/tests/components/lvgl/common.yaml +++ b/tests/components/lvgl/common.yaml @@ -1,5 +1,6 @@ touchscreen: - platform: ft63x6 + i2c_id: i2c_bus id: tft_touch display: tft_display update_interval: 50ms diff --git a/tests/components/lvgl/test.esp32-idf.yaml b/tests/components/lvgl/test.esp32-idf.yaml index eacace1d4b..6170b0f4fb 100644 --- a/tests/components/lvgl/test.esp32-idf.yaml +++ b/tests/components/lvgl/test.esp32-idf.yaml @@ -1,10 +1,7 @@ -spi: - clk_pin: 14 - mosi_pin: 13 - -i2c: - sda: GPIO18 - scl: GPIO19 +packages: + lvgl: !include lvgl-package.yaml + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml sensor: - platform: rotary_encoder @@ -25,6 +22,7 @@ binary_sensor: display: - platform: ili9xxx + spi_id: spi_bus model: st7789v id: second_display dimensions: @@ -44,6 +42,7 @@ display: update_interval: never - platform: ili9xxx + spi_id: spi_bus model: st7789v id: tft_display dimensions: @@ -60,9 +59,6 @@ display: invert_colors: false update_interval: never -packages: - lvgl: !include lvgl-package.yaml - lvgl: displays: - tft_display diff --git a/tests/components/m5stack_8angle/common.yaml b/tests/components/m5stack_8angle/common.yaml index d7f988ed3a..d0af24116c 100644 --- a/tests/components/m5stack_8angle/common.yaml +++ b/tests/components/m5stack_8angle/common.yaml @@ -1,10 +1,5 @@ -i2c: - sda: 0 - scl: 1 - id: bus_external - m5stack_8angle: - i2c_id: bus_external + i2c_id: i2c_bus id: m5stack_8angle_base light: diff --git a/tests/components/m5stack_8angle/test.esp32-c3-idf.yaml b/tests/components/m5stack_8angle/test.esp32-c3-idf.yaml index dade44d145..9990d96d29 100644 --- a/tests/components/m5stack_8angle/test.esp32-c3-idf.yaml +++ b/tests/components/m5stack_8angle/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/m5stack_8angle/test.esp32-idf.yaml b/tests/components/m5stack_8angle/test.esp32-idf.yaml index dade44d145..b47e39c389 100644 --- a/tests/components/m5stack_8angle/test.esp32-idf.yaml +++ b/tests/components/m5stack_8angle/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/m5stack_8angle/test.esp8266-ard.yaml b/tests/components/m5stack_8angle/test.esp8266-ard.yaml index dade44d145..4a98b9388a 100644 --- a/tests/components/m5stack_8angle/test.esp8266-ard.yaml +++ b/tests/components/m5stack_8angle/test.esp8266-ard.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/m5stack_8angle/test.rp2040-ard.yaml b/tests/components/m5stack_8angle/test.rp2040-ard.yaml index dade44d145..319a7c71a6 100644 --- a/tests/components/m5stack_8angle/test.rp2040-ard.yaml +++ b/tests/components/m5stack_8angle/test.rp2040-ard.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/mapping/test.esp32-c3-idf.yaml b/tests/components/mapping/test.esp32-c3-idf.yaml index f95dd4f30d..7911eb7edc 100644 --- a/tests/components/mapping/test.esp32-c3-idf.yaml +++ b/tests/components/mapping/test.esp32-c3-idf.yaml @@ -1,10 +1,9 @@ -spi: - - id: spi_main_lcd - clk_pin: 6 - mosi_pin: 7 - miso_pin: 5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml + map: !include common.yaml display: + spi_id: spi_bus platform: ili9xxx id: main_lcd model: ili9342 @@ -12,6 +11,3 @@ display: dc_pin: 9 reset_pin: 10 invert_colors: false - -packages: - map: !include common.yaml diff --git a/tests/components/mapping/test.esp32-idf.yaml b/tests/components/mapping/test.esp32-idf.yaml index 231fdae797..a35b6940c7 100644 --- a/tests/components/mapping/test.esp32-idf.yaml +++ b/tests/components/mapping/test.esp32-idf.yaml @@ -1,10 +1,9 @@ -spi: - - id: spi_main_lcd - clk_pin: 16 - mosi_pin: 17 - miso_pin: 15 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + map: !include common.yaml display: + spi_id: spi_bus platform: ili9xxx id: main_lcd model: ili9342 @@ -12,6 +11,3 @@ display: dc_pin: 13 reset_pin: 21 invert_colors: false - -packages: - map: !include common.yaml diff --git a/tests/components/mapping/test.esp8266-ard.yaml b/tests/components/mapping/test.esp8266-ard.yaml index a5b45d391a..c59821a211 100644 --- a/tests/components/mapping/test.esp8266-ard.yaml +++ b/tests/components/mapping/test.esp8266-ard.yaml @@ -1,10 +1,9 @@ -spi: - - id: spi_main_lcd - clk_pin: 14 - mosi_pin: 13 - miso_pin: 12 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + map: !include common.yaml display: + spi_id: spi_bus platform: ili9xxx id: main_lcd model: ili9342 @@ -12,6 +11,3 @@ display: dc_pin: 15 reset_pin: 16 invert_colors: false - -packages: - map: !include common.yaml diff --git a/tests/components/mapping/test.rp2040-ard.yaml b/tests/components/mapping/test.rp2040-ard.yaml index f092686553..acc305a701 100644 --- a/tests/components/mapping/test.rp2040-ard.yaml +++ b/tests/components/mapping/test.rp2040-ard.yaml @@ -1,10 +1,9 @@ -spi: - - id: spi_main_lcd - clk_pin: 2 - mosi_pin: 3 - miso_pin: 4 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + map: !include common.yaml display: + spi_id: spi_bus platform: ili9xxx id: main_lcd model: ili9342 @@ -12,6 +11,3 @@ display: dc_pin: 21 reset_pin: 22 invert_colors: false - -packages: - map: !include common.yaml diff --git a/tests/components/max17043/common.yaml b/tests/components/max17043/common.yaml index c2f324212e..f58006c460 100644 --- a/tests/components/max17043/common.yaml +++ b/tests/components/max17043/common.yaml @@ -3,15 +3,10 @@ esphome: then: - max17043.sleep_mode: max17043_id -i2c: - - id: i2c_id - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: max17043 + i2c_id: i2c_bus id: max17043_id - i2c_id: i2c_id battery_voltage: name: "Battery Voltage" battery_level: diff --git a/tests/components/max17043/test.esp32-c3-idf.yaml b/tests/components/max17043/test.esp32-c3-idf.yaml index 9a1477d4b9..9990d96d29 100644 --- a/tests/components/max17043/test.esp32-c3-idf.yaml +++ b/tests/components/max17043/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - sda_pin: GPIO8 - scl_pin: GPIO10 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/max17043/test.esp32-idf.yaml b/tests/components/max17043/test.esp32-idf.yaml index c6615f51cd..b47e39c389 100644 --- a/tests/components/max17043/test.esp32-idf.yaml +++ b/tests/components/max17043/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - sda_pin: GPIO21 - scl_pin: GPIO22 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/max17043/test.esp8266-ard.yaml b/tests/components/max17043/test.esp8266-ard.yaml index a87353b78b..4a98b9388a 100644 --- a/tests/components/max17043/test.esp8266-ard.yaml +++ b/tests/components/max17043/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - sda_pin: GPIO4 - scl_pin: GPIO5 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/max17043/test.rp2040-ard.yaml b/tests/components/max17043/test.rp2040-ard.yaml index c6615f51cd..319a7c71a6 100644 --- a/tests/components/max17043/test.rp2040-ard.yaml +++ b/tests/components/max17043/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - sda_pin: GPIO21 - scl_pin: GPIO22 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/max31855/common.yaml b/tests/components/max31855/common.yaml index 7136c597d5..905b111d71 100644 --- a/tests/components/max31855/common.yaml +++ b/tests/components/max31855/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_max31855 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sensor: - platform: max31855 name: MAX31855 Temperature diff --git a/tests/components/max31855/test.esp32-c3-idf.yaml b/tests/components/max31855/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/max31855/test.esp32-c3-idf.yaml +++ b/tests/components/max31855/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/max31855/test.esp32-idf.yaml b/tests/components/max31855/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/max31855/test.esp32-idf.yaml +++ b/tests/components/max31855/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/max31855/test.esp8266-ard.yaml b/tests/components/max31855/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/max31855/test.esp8266-ard.yaml +++ b/tests/components/max31855/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/max31855/test.rp2040-ard.yaml b/tests/components/max31855/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/max31855/test.rp2040-ard.yaml +++ b/tests/components/max31855/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/max31856/common.yaml b/tests/components/max31856/common.yaml index 4f7c3ad408..9d420662d7 100644 --- a/tests/components/max31856/common.yaml +++ b/tests/components/max31856/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_max31856 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sensor: - platform: max31856 name: MAX31856 Temperature diff --git a/tests/components/max31856/test.esp32-c3-idf.yaml b/tests/components/max31856/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/max31856/test.esp32-c3-idf.yaml +++ b/tests/components/max31856/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/max31856/test.esp32-idf.yaml b/tests/components/max31856/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/max31856/test.esp32-idf.yaml +++ b/tests/components/max31856/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/max31856/test.esp8266-ard.yaml b/tests/components/max31856/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/max31856/test.esp8266-ard.yaml +++ b/tests/components/max31856/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/max31856/test.rp2040-ard.yaml b/tests/components/max31856/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/max31856/test.rp2040-ard.yaml +++ b/tests/components/max31856/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/max31865/common.yaml b/tests/components/max31865/common.yaml index 5bb7bda5aa..6e71f17efc 100644 --- a/tests/components/max31865/common.yaml +++ b/tests/components/max31865/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_max31865 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sensor: - platform: max31865 name: MAX31865 Temperature diff --git a/tests/components/max31865/test.esp32-c3-idf.yaml b/tests/components/max31865/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/max31865/test.esp32-c3-idf.yaml +++ b/tests/components/max31865/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/max31865/test.esp32-idf.yaml b/tests/components/max31865/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/max31865/test.esp32-idf.yaml +++ b/tests/components/max31865/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/max31865/test.esp8266-ard.yaml b/tests/components/max31865/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/max31865/test.esp8266-ard.yaml +++ b/tests/components/max31865/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/max31865/test.rp2040-ard.yaml b/tests/components/max31865/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/max31865/test.rp2040-ard.yaml +++ b/tests/components/max31865/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/max44009/common.yaml b/tests/components/max44009/common.yaml index ef51740895..523387e1cc 100644 --- a/tests/components/max44009/common.yaml +++ b/tests/components/max44009/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_max44009 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: max44009 + i2c_id: i2c_bus name: MAX44009 Brightness internal: true mode: low_power diff --git a/tests/components/max44009/test.esp32-c3-idf.yaml b/tests/components/max44009/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/max44009/test.esp32-c3-idf.yaml +++ b/tests/components/max44009/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/max44009/test.esp32-idf.yaml b/tests/components/max44009/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/max44009/test.esp32-idf.yaml +++ b/tests/components/max44009/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/max44009/test.esp8266-ard.yaml b/tests/components/max44009/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/max44009/test.esp8266-ard.yaml +++ b/tests/components/max44009/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/max44009/test.rp2040-ard.yaml b/tests/components/max44009/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/max44009/test.rp2040-ard.yaml +++ b/tests/components/max44009/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/max6675/common.yaml b/tests/components/max6675/common.yaml index 5b4e04b317..31a4e7035a 100644 --- a/tests/components/max6675/common.yaml +++ b/tests/components/max6675/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_max6675 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sensor: - platform: max6675 name: Temperature diff --git a/tests/components/max6675/test.esp32-c3-idf.yaml b/tests/components/max6675/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/max6675/test.esp32-c3-idf.yaml +++ b/tests/components/max6675/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/max6675/test.esp32-idf.yaml b/tests/components/max6675/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/max6675/test.esp32-idf.yaml +++ b/tests/components/max6675/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/max6675/test.esp8266-ard.yaml b/tests/components/max6675/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/max6675/test.esp8266-ard.yaml +++ b/tests/components/max6675/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/max6675/test.rp2040-ard.yaml b/tests/components/max6675/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/max6675/test.rp2040-ard.yaml +++ b/tests/components/max6675/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/max6956/common.yaml b/tests/components/max6956/common.yaml index e44e3464f8..665a606027 100644 --- a/tests/components/max6956/common.yaml +++ b/tests/components/max6956/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_max6956 - scl: ${scl_pin} - sda: ${sda_pin} - max6956: - id: max6956_1 + i2c_id: i2c_bus address: 0x40 binary_sensor: diff --git a/tests/components/max6956/test.esp32-c3-idf.yaml b/tests/components/max6956/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/max6956/test.esp32-c3-idf.yaml +++ b/tests/components/max6956/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/max6956/test.esp32-idf.yaml b/tests/components/max6956/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/max6956/test.esp32-idf.yaml +++ b/tests/components/max6956/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/max6956/test.esp8266-ard.yaml b/tests/components/max6956/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/max6956/test.esp8266-ard.yaml +++ b/tests/components/max6956/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/max6956/test.rp2040-ard.yaml b/tests/components/max6956/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/max6956/test.rp2040-ard.yaml +++ b/tests/components/max6956/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/max7219/common.yaml b/tests/components/max7219/common.yaml index 0060db191e..5d7f54af17 100644 --- a/tests/components/max7219/common.yaml +++ b/tests/components/max7219/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_max6675 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - display: - platform: max7219 cs_pin: ${cs_pin} diff --git a/tests/components/max7219/test.esp32-c3-idf.yaml b/tests/components/max7219/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/max7219/test.esp32-c3-idf.yaml +++ b/tests/components/max7219/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/max7219/test.esp32-idf.yaml b/tests/components/max7219/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/max7219/test.esp32-idf.yaml +++ b/tests/components/max7219/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/max7219/test.esp8266-ard.yaml b/tests/components/max7219/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/max7219/test.esp8266-ard.yaml +++ b/tests/components/max7219/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/max7219/test.rp2040-ard.yaml b/tests/components/max7219/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/max7219/test.rp2040-ard.yaml +++ b/tests/components/max7219/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/max7219digit/common.yaml b/tests/components/max7219digit/common.yaml index 84edc7eb3d..525b7b8d3e 100644 --- a/tests/components/max7219digit/common.yaml +++ b/tests/components/max7219digit/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_max7219digit - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - display: - platform: max7219digit cs_pin: ${cs_pin} diff --git a/tests/components/max7219digit/test.esp32-c3-idf.yaml b/tests/components/max7219digit/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/max7219digit/test.esp32-c3-idf.yaml +++ b/tests/components/max7219digit/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/max7219digit/test.esp32-idf.yaml b/tests/components/max7219digit/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/max7219digit/test.esp32-idf.yaml +++ b/tests/components/max7219digit/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/max7219digit/test.esp8266-ard.yaml b/tests/components/max7219digit/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/max7219digit/test.esp8266-ard.yaml +++ b/tests/components/max7219digit/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/max7219digit/test.rp2040-ard.yaml b/tests/components/max7219digit/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/max7219digit/test.rp2040-ard.yaml +++ b/tests/components/max7219digit/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/max9611/common.yaml b/tests/components/max9611/common.yaml index c3c00fdf85..ca9ee59038 100644 --- a/tests/components/max9611/common.yaml +++ b/tests/components/max9611/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_max9611 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: max9611 + i2c_id: i2c_bus shunt_resistance: 0.2 ohm gain: 1X voltage: diff --git a/tests/components/max9611/test.esp32-c3-idf.yaml b/tests/components/max9611/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/max9611/test.esp32-c3-idf.yaml +++ b/tests/components/max9611/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/max9611/test.esp32-idf.yaml b/tests/components/max9611/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/max9611/test.esp32-idf.yaml +++ b/tests/components/max9611/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/max9611/test.esp8266-ard.yaml b/tests/components/max9611/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/max9611/test.esp8266-ard.yaml +++ b/tests/components/max9611/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/max9611/test.rp2040-ard.yaml b/tests/components/max9611/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/max9611/test.rp2040-ard.yaml +++ b/tests/components/max9611/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp23008/common.yaml b/tests/components/mcp23008/common.yaml index 1954766d25..4a407adfd8 100644 --- a/tests/components/mcp23008/common.yaml +++ b/tests/components/mcp23008/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_mcp23008 - scl: ${scl_pin} - sda: ${sda_pin} - mcp23008: + i2c_id: i2c_bus id: mcp23008_hub binary_sensor: diff --git a/tests/components/mcp23008/test.esp32-c3-idf.yaml b/tests/components/mcp23008/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/mcp23008/test.esp32-c3-idf.yaml +++ b/tests/components/mcp23008/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp23008/test.esp32-idf.yaml b/tests/components/mcp23008/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/mcp23008/test.esp32-idf.yaml +++ b/tests/components/mcp23008/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp23008/test.esp8266-ard.yaml b/tests/components/mcp23008/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/mcp23008/test.esp8266-ard.yaml +++ b/tests/components/mcp23008/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp23008/test.rp2040-ard.yaml b/tests/components/mcp23008/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/mcp23008/test.rp2040-ard.yaml +++ b/tests/components/mcp23008/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp23016/common.yaml b/tests/components/mcp23016/common.yaml index 109cb34b21..e8e3ad9d08 100644 --- a/tests/components/mcp23016/common.yaml +++ b/tests/components/mcp23016/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_mcp23016 - scl: ${scl_pin} - sda: ${sda_pin} - mcp23016: + i2c_id: i2c_bus id: mcp23016_hub binary_sensor: diff --git a/tests/components/mcp23016/test.esp32-c3-idf.yaml b/tests/components/mcp23016/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/mcp23016/test.esp32-c3-idf.yaml +++ b/tests/components/mcp23016/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp23016/test.esp32-idf.yaml b/tests/components/mcp23016/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/mcp23016/test.esp32-idf.yaml +++ b/tests/components/mcp23016/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp23016/test.esp8266-ard.yaml b/tests/components/mcp23016/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/mcp23016/test.esp8266-ard.yaml +++ b/tests/components/mcp23016/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp23016/test.rp2040-ard.yaml b/tests/components/mcp23016/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/mcp23016/test.rp2040-ard.yaml +++ b/tests/components/mcp23016/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp23017/common.yaml b/tests/components/mcp23017/common.yaml index 74949bba76..54a97e911f 100644 --- a/tests/components/mcp23017/common.yaml +++ b/tests/components/mcp23017/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_mcp23017 - scl: ${scl_pin} - sda: ${sda_pin} - mcp23017: + i2c_id: i2c_bus id: mcp23017_hub binary_sensor: diff --git a/tests/components/mcp23017/test.esp32-c3-idf.yaml b/tests/components/mcp23017/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/mcp23017/test.esp32-c3-idf.yaml +++ b/tests/components/mcp23017/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp23017/test.esp32-idf.yaml b/tests/components/mcp23017/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/mcp23017/test.esp32-idf.yaml +++ b/tests/components/mcp23017/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp23017/test.esp8266-ard.yaml b/tests/components/mcp23017/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/mcp23017/test.esp8266-ard.yaml +++ b/tests/components/mcp23017/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp23017/test.rp2040-ard.yaml b/tests/components/mcp23017/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/mcp23017/test.rp2040-ard.yaml +++ b/tests/components/mcp23017/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp23s08/common.yaml b/tests/components/mcp23s08/common.yaml index b89088fe15..2170ae0459 100644 --- a/tests/components/mcp23s08/common.yaml +++ b/tests/components/mcp23s08/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_mcp23s08 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - mcp23s08: - id: mcp23s08_hub cs_pin: ${cs_pin} diff --git a/tests/components/mcp23s08/test.esp32-c3-idf.yaml b/tests/components/mcp23s08/test.esp32-c3-idf.yaml index 2415ba5dc6..b11ec9cdc6 100644 --- a/tests/components/mcp23s08/test.esp32-c3-idf.yaml +++ b/tests/components/mcp23s08/test.esp32-c3-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mcp23s08/test.esp32-idf.yaml b/tests/components/mcp23s08/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/mcp23s08/test.esp32-idf.yaml +++ b/tests/components/mcp23s08/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mcp23s08/test.esp8266-ard.yaml b/tests/components/mcp23s08/test.esp8266-ard.yaml index dbd158d030..595f31046a 100644 --- a/tests/components/mcp23s08/test.esp8266-ard.yaml +++ b/tests/components/mcp23s08/test.esp8266-ard.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/mcp23s08/test.rp2040-ard.yaml b/tests/components/mcp23s08/test.rp2040-ard.yaml index f6c3f1eeca..79ea6ce90b 100644 --- a/tests/components/mcp23s08/test.rp2040-ard.yaml +++ b/tests/components/mcp23s08/test.rp2040-ard.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO2 - mosi_pin: GPIO3 - miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/mcp23s17/common.yaml b/tests/components/mcp23s17/common.yaml index 3fb27ef625..a89beeb16b 100644 --- a/tests/components/mcp23s17/common.yaml +++ b/tests/components/mcp23s17/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_mcp23s17 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - mcp23s17: - id: mcp23s17_hub cs_pin: ${cs_pin} diff --git a/tests/components/mcp23s17/test.esp32-c3-idf.yaml b/tests/components/mcp23s17/test.esp32-c3-idf.yaml index 2415ba5dc6..b11ec9cdc6 100644 --- a/tests/components/mcp23s17/test.esp32-c3-idf.yaml +++ b/tests/components/mcp23s17/test.esp32-c3-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mcp23s17/test.esp32-idf.yaml b/tests/components/mcp23s17/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/mcp23s17/test.esp32-idf.yaml +++ b/tests/components/mcp23s17/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mcp23s17/test.esp8266-ard.yaml b/tests/components/mcp23s17/test.esp8266-ard.yaml index dbd158d030..595f31046a 100644 --- a/tests/components/mcp23s17/test.esp8266-ard.yaml +++ b/tests/components/mcp23s17/test.esp8266-ard.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/mcp23s17/test.rp2040-ard.yaml b/tests/components/mcp23s17/test.rp2040-ard.yaml index f6c3f1eeca..79ea6ce90b 100644 --- a/tests/components/mcp23s17/test.rp2040-ard.yaml +++ b/tests/components/mcp23s17/test.rp2040-ard.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO2 - mosi_pin: GPIO3 - miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/mcp2515/common.yaml b/tests/components/mcp2515/common.yaml index 96a72a3ec3..15639df5fe 100644 --- a/tests/components/mcp2515/common.yaml +++ b/tests/components/mcp2515/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_mcp2515 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - canbus: - platform: mcp2515 id: mcp2515_can diff --git a/tests/components/mcp2515/test.esp32-c3-idf.yaml b/tests/components/mcp2515/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/mcp2515/test.esp32-c3-idf.yaml +++ b/tests/components/mcp2515/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp2515/test.esp32-idf.yaml b/tests/components/mcp2515/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/mcp2515/test.esp32-idf.yaml +++ b/tests/components/mcp2515/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mcp2515/test.esp8266-ard.yaml b/tests/components/mcp2515/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/mcp2515/test.esp8266-ard.yaml +++ b/tests/components/mcp2515/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/mcp2515/test.rp2040-ard.yaml b/tests/components/mcp2515/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/mcp2515/test.rp2040-ard.yaml +++ b/tests/components/mcp2515/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/mcp3008/common.yaml b/tests/components/mcp3008/common.yaml index 646d3a20e9..57d0155f73 100644 --- a/tests/components/mcp3008/common.yaml +++ b/tests/components/mcp3008/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_mcp3008 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - mcp3008: - id: mcp3008_hub cs_pin: ${cs_pin} diff --git a/tests/components/mcp3008/test.esp32-c3-idf.yaml b/tests/components/mcp3008/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/mcp3008/test.esp32-c3-idf.yaml +++ b/tests/components/mcp3008/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp3008/test.esp32-idf.yaml b/tests/components/mcp3008/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/mcp3008/test.esp32-idf.yaml +++ b/tests/components/mcp3008/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mcp3008/test.esp8266-ard.yaml b/tests/components/mcp3008/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/mcp3008/test.esp8266-ard.yaml +++ b/tests/components/mcp3008/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/mcp3008/test.rp2040-ard.yaml b/tests/components/mcp3008/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/mcp3008/test.rp2040-ard.yaml +++ b/tests/components/mcp3008/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/mcp3204/common.yaml b/tests/components/mcp3204/common.yaml index f102500c81..eca6ec44f4 100644 --- a/tests/components/mcp3204/common.yaml +++ b/tests/components/mcp3204/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_mcp3204 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - mcp3204: - id: mcp3204_hub cs_pin: ${cs_pin} diff --git a/tests/components/mcp3204/test.esp32-c3-idf.yaml b/tests/components/mcp3204/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/mcp3204/test.esp32-c3-idf.yaml +++ b/tests/components/mcp3204/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp3204/test.esp32-idf.yaml b/tests/components/mcp3204/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/mcp3204/test.esp32-idf.yaml +++ b/tests/components/mcp3204/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mcp3204/test.esp8266-ard.yaml b/tests/components/mcp3204/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/mcp3204/test.esp8266-ard.yaml +++ b/tests/components/mcp3204/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/mcp3204/test.rp2040-ard.yaml b/tests/components/mcp3204/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/mcp3204/test.rp2040-ard.yaml +++ b/tests/components/mcp3204/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/mcp4461/common.yaml b/tests/components/mcp4461/common.yaml index ce1866fdb8..92fd789dcb 100644 --- a/tests/components/mcp4461/common.yaml +++ b/tests/components/mcp4461/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_mcp4461 - sda: ${sda_pin} - scl: ${scl_pin} - mcp4461: - id: mcp4461_digipot_01 + i2c_id: i2c_bus output: - platform: mcp4461 diff --git a/tests/components/mcp4461/test.esp32-c3-idf.yaml b/tests/components/mcp4461/test.esp32-c3-idf.yaml index a87353b78b..9990d96d29 100644 --- a/tests/components/mcp4461/test.esp32-c3-idf.yaml +++ b/tests/components/mcp4461/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - sda_pin: GPIO4 - scl_pin: GPIO5 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp4461/test.esp32-idf.yaml b/tests/components/mcp4461/test.esp32-idf.yaml index c5deb7ca0a..b47e39c389 100644 --- a/tests/components/mcp4461/test.esp32-idf.yaml +++ b/tests/components/mcp4461/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - sda_pin: GPIO16 - scl_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp4461/test.esp8266-ard.yaml b/tests/components/mcp4461/test.esp8266-ard.yaml index a87353b78b..4a98b9388a 100644 --- a/tests/components/mcp4461/test.esp8266-ard.yaml +++ b/tests/components/mcp4461/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - sda_pin: GPIO4 - scl_pin: GPIO5 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp4725/common.yaml b/tests/components/mcp4725/common.yaml index 0ccc649f2e..871c2805a3 100644 --- a/tests/components/mcp4725/common.yaml +++ b/tests/components/mcp4725/common.yaml @@ -1,8 +1,3 @@ -i2c: - - id: i2c_mcp4725 - scl: ${scl_pin} - sda: ${sda_pin} - output: - platform: mcp4725 id: mcp4725_dac_output diff --git a/tests/components/mcp4725/test.esp32-c3-idf.yaml b/tests/components/mcp4725/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/mcp4725/test.esp32-c3-idf.yaml +++ b/tests/components/mcp4725/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp4725/test.esp32-idf.yaml b/tests/components/mcp4725/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/mcp4725/test.esp32-idf.yaml +++ b/tests/components/mcp4725/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp4725/test.esp8266-ard.yaml b/tests/components/mcp4725/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/mcp4725/test.esp8266-ard.yaml +++ b/tests/components/mcp4725/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp4725/test.rp2040-ard.yaml b/tests/components/mcp4725/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/mcp4725/test.rp2040-ard.yaml +++ b/tests/components/mcp4725/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp4728/common.yaml b/tests/components/mcp4728/common.yaml index b42818e4e6..e60f4795e1 100644 --- a/tests/components/mcp4728/common.yaml +++ b/tests/components/mcp4728/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_mcp4728 - scl: ${scl_pin} - sda: ${sda_pin} - mcp4728: - id: mcp4728_dac + i2c_id: i2c_bus output: - platform: mcp4728 diff --git a/tests/components/mcp4728/test.esp32-c3-idf.yaml b/tests/components/mcp4728/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/mcp4728/test.esp32-c3-idf.yaml +++ b/tests/components/mcp4728/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp4728/test.esp32-idf.yaml b/tests/components/mcp4728/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/mcp4728/test.esp32-idf.yaml +++ b/tests/components/mcp4728/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp4728/test.esp8266-ard.yaml b/tests/components/mcp4728/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/mcp4728/test.esp8266-ard.yaml +++ b/tests/components/mcp4728/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp4728/test.rp2040-ard.yaml b/tests/components/mcp4728/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/mcp4728/test.rp2040-ard.yaml +++ b/tests/components/mcp4728/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp47a1/common.yaml b/tests/components/mcp47a1/common.yaml index 59e28d37b3..3448fcfb31 100644 --- a/tests/components/mcp47a1/common.yaml +++ b/tests/components/mcp47a1/common.yaml @@ -1,8 +1,3 @@ -i2c: - - id: i2c_mcp47a1 - scl: ${scl_pin} - sda: ${sda_pin} - output: - platform: mcp47a1 id: output_mcp47a1 diff --git a/tests/components/mcp47a1/test.esp32-c3-idf.yaml b/tests/components/mcp47a1/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/mcp47a1/test.esp32-c3-idf.yaml +++ b/tests/components/mcp47a1/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp47a1/test.esp32-idf.yaml b/tests/components/mcp47a1/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/mcp47a1/test.esp32-idf.yaml +++ b/tests/components/mcp47a1/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp47a1/test.esp8266-ard.yaml b/tests/components/mcp47a1/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/mcp47a1/test.esp8266-ard.yaml +++ b/tests/components/mcp47a1/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp47a1/test.rp2040-ard.yaml b/tests/components/mcp47a1/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/mcp47a1/test.rp2040-ard.yaml +++ b/tests/components/mcp47a1/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp9600/common.yaml b/tests/components/mcp9600/common.yaml index e3c9df79e4..33e33d183e 100644 --- a/tests/components/mcp9600/common.yaml +++ b/tests/components/mcp9600/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_mcp9600 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: mcp9600 + i2c_id: i2c_bus thermocouple_type: K hot_junction: name: Thermocouple Temperature diff --git a/tests/components/mcp9600/test.esp32-c3-idf.yaml b/tests/components/mcp9600/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/mcp9600/test.esp32-c3-idf.yaml +++ b/tests/components/mcp9600/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp9600/test.esp32-idf.yaml b/tests/components/mcp9600/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/mcp9600/test.esp32-idf.yaml +++ b/tests/components/mcp9600/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp9600/test.esp8266-ard.yaml b/tests/components/mcp9600/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/mcp9600/test.esp8266-ard.yaml +++ b/tests/components/mcp9600/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp9600/test.rp2040-ard.yaml b/tests/components/mcp9600/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/mcp9600/test.rp2040-ard.yaml +++ b/tests/components/mcp9600/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp9808/common.yaml b/tests/components/mcp9808/common.yaml index ccfd5d13ce..86d0661552 100644 --- a/tests/components/mcp9808/common.yaml +++ b/tests/components/mcp9808/common.yaml @@ -1,8 +1,4 @@ -i2c: - - id: i2c_mcp9808 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: mcp9808 + i2c_id: i2c_bus name: MCP9808 Temperature diff --git a/tests/components/mcp9808/test.esp32-c3-idf.yaml b/tests/components/mcp9808/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/mcp9808/test.esp32-c3-idf.yaml +++ b/tests/components/mcp9808/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp9808/test.esp32-idf.yaml b/tests/components/mcp9808/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/mcp9808/test.esp32-idf.yaml +++ b/tests/components/mcp9808/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mcp9808/test.esp8266-ard.yaml b/tests/components/mcp9808/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/mcp9808/test.esp8266-ard.yaml +++ b/tests/components/mcp9808/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mcp9808/test.rp2040-ard.yaml b/tests/components/mcp9808/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/mcp9808/test.rp2040-ard.yaml +++ b/tests/components/mcp9808/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/mhz19/common.yaml b/tests/components/mhz19/common.yaml index 8b7e732068..94989fecbe 100644 --- a/tests/components/mhz19/common.yaml +++ b/tests/components/mhz19/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_mhz19 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - sensor: - platform: mhz19 co2: diff --git a/tests/components/mhz19/test.esp32-c3-idf.yaml b/tests/components/mhz19/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/mhz19/test.esp32-c3-idf.yaml +++ b/tests/components/mhz19/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mhz19/test.esp32-idf.yaml b/tests/components/mhz19/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/mhz19/test.esp32-idf.yaml +++ b/tests/components/mhz19/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mhz19/test.esp8266-ard.yaml b/tests/components/mhz19/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/mhz19/test.esp8266-ard.yaml +++ b/tests/components/mhz19/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mhz19/test.rp2040-ard.yaml b/tests/components/mhz19/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/mhz19/test.rp2040-ard.yaml +++ b/tests/components/mhz19/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/micronova/common.yaml b/tests/components/micronova/common.yaml index 661c9330c6..3cf8e36fb6 100644 --- a/tests/components/micronova/common.yaml +++ b/tests/components/micronova/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_micronova - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - micronova: enable_rx_pin: ${enable_rx_pin} diff --git a/tests/components/micronova/test.esp32-c3-idf.yaml b/tests/components/micronova/test.esp32-c3-idf.yaml index 993071999f..eed876ae74 100644 --- a/tests/components/micronova/test.esp32-c3-idf.yaml +++ b/tests/components/micronova/test.esp32-c3-idf.yaml @@ -1,6 +1,7 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 enable_rx_pin: GPIO3 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/micronova/test.esp32-idf.yaml b/tests/components/micronova/test.esp32-idf.yaml index 35d041e047..5cc3a234ca 100644 --- a/tests/components/micronova/test.esp32-idf.yaml +++ b/tests/components/micronova/test.esp32-idf.yaml @@ -1,6 +1,7 @@ substitutions: - tx_pin: GPIO12 - rx_pin: GPIO14 enable_rx_pin: GPIO13 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/micronova/test.esp8266-ard.yaml b/tests/components/micronova/test.esp8266-ard.yaml index 048fb82d72..ffe1e0a063 100644 --- a/tests/components/micronova/test.esp8266-ard.yaml +++ b/tests/components/micronova/test.esp8266-ard.yaml @@ -1,6 +1,7 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 - enable_rx_pin: GPIO13 + enable_rx_pin: GPIO15 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/micronova/test.rp2040-ard.yaml b/tests/components/micronova/test.rp2040-ard.yaml index 993071999f..6dc030e6b6 100644 --- a/tests/components/micronova/test.rp2040-ard.yaml +++ b/tests/components/micronova/test.rp2040-ard.yaml @@ -1,6 +1,7 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 enable_rx_pin: GPIO3 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/microphone/test.esp32-idf.yaml b/tests/components/microphone/test.esp32-idf.yaml index fe9feb9888..830f0156d7 100644 --- a/tests/components/microphone/test.esp32-idf.yaml +++ b/tests/components/microphone/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: i2s_bclk_pin: GPIO15 - i2s_lrclk_pin: GPIO16 - i2s_mclk_pin: GPIO17 + i2s_lrclk_pin: GPIO4 + i2s_mclk_pin: GPIO5 i2s_din_pin: GPIO33 i2s_audio: diff --git a/tests/components/mics_4514/common.yaml b/tests/components/mics_4514/common.yaml index 0bc3f3e654..3c1d264680 100644 --- a/tests/components/mics_4514/common.yaml +++ b/tests/components/mics_4514/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_mics_4514 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: mics_4514 + i2c_id: i2c_bus update_interval: 60s nitrogen_dioxide: name: MICS-4514 NO2 diff --git a/tests/components/mics_4514/test.esp32-c3-idf.yaml b/tests/components/mics_4514/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/mics_4514/test.esp32-c3-idf.yaml +++ b/tests/components/mics_4514/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mics_4514/test.esp32-idf.yaml b/tests/components/mics_4514/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/mics_4514/test.esp32-idf.yaml +++ b/tests/components/mics_4514/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mics_4514/test.esp8266-ard.yaml b/tests/components/mics_4514/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/mics_4514/test.esp8266-ard.yaml +++ b/tests/components/mics_4514/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mics_4514/test.rp2040-ard.yaml b/tests/components/mics_4514/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/mics_4514/test.rp2040-ard.yaml +++ b/tests/components/mics_4514/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/midea/common.yaml b/tests/components/midea/common.yaml index 07385e29a1..a0909401ff 100644 --- a/tests/components/midea/common.yaml +++ b/tests/components/midea/common.yaml @@ -6,12 +6,6 @@ remote_transmitter: pin: ${pin} carrier_duty_percent: 50% -uart: - - id: uart_midea - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - climate: - platform: midea id: midea_unit diff --git a/tests/components/midea/test.esp32-ard.yaml b/tests/components/midea/test.esp32-ard.yaml index 7f55d6a52d..b78163199a 100644 --- a/tests/components/midea/test.esp32-ard.yaml +++ b/tests/components/midea/test.esp32-ard.yaml @@ -1,6 +1,7 @@ substitutions: - tx_pin: GPIO12 - rx_pin: GPIO14 pin: GPIO2 +packages: + uart: !include ../../test_build_components/common/uart/esp32-ard.yaml + <<: !include common.yaml diff --git a/tests/components/midea/test.esp8266-ard.yaml b/tests/components/midea/test.esp8266-ard.yaml index 4f50bd7e5e..dc276e274c 100644 --- a/tests/components/midea/test.esp8266-ard.yaml +++ b/tests/components/midea/test.esp8266-ard.yaml @@ -1,6 +1,7 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 pin: GPIO15 +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/mipi_dsi/test.esp32-p4-idf.yaml b/tests/components/mipi_dsi/test.esp32-p4-idf.yaml index 9c4eb07d9b..770b11d089 100644 --- a/tests/components/mipi_dsi/test.esp32-p4-idf.yaml +++ b/tests/components/mipi_dsi/test.esp32-p4-idf.yaml @@ -1,3 +1,6 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-p4-idf.yaml + esp_ldo: - id: ldo_id channel: 3 @@ -13,9 +16,3 @@ display: #id: backlight_id psram: - -i2c: - sda: GPIO7 - scl: GPIO8 - scan: true - frequency: 400kHz diff --git a/tests/components/mipi_rgb/test.esp32-s3-idf.yaml b/tests/components/mipi_rgb/test.esp32-s3-idf.yaml index 8d0e20d6f5..642292f7c4 100644 --- a/tests/components/mipi_rgb/test.esp32-s3-idf.yaml +++ b/tests/components/mipi_rgb/test.esp32-s3-idf.yaml @@ -1,16 +1,12 @@ +packages: + spi: !include ../../test_build_components/common/spi/esp32-s3-idf.yaml + psram: mode: octal -spi: - - clk_pin: - number: 47 - allow_other_uses: true - mosi_pin: - number: 41 - allow_other_uses: true - display: - platform: mipi_rgb + spi_id: spi_bus model: ZX2D10GE01R-V4848 update_interval: 1s color_order: BGR @@ -44,9 +40,7 @@ display: - number: 17 blue: - number: 47 - allow_other_uses: true - - number: 41 - allow_other_uses: true + - number: 1 - number: 0 ignore_strapping_warning: true - number: 42 @@ -57,7 +51,7 @@ display: number: 45 ignore_strapping_warning: true hsync_pin: - number: 40 + number: 38 vsync_pin: number: 48 data_rate: 1000000.0 diff --git a/tests/components/mipi_spi/common.yaml b/tests/components/mipi_spi/common.yaml index 2c84489ec7..03f807f53c 100644 --- a/tests/components/mipi_spi/common.yaml +++ b/tests/components/mipi_spi/common.yaml @@ -1,11 +1,3 @@ -spi: - - id: spi_single - clk_pin: - number: ${clk_pin} - allow_other_uses: true - mosi_pin: - number: ${mosi_pin} - display: - platform: mipi_spi spi_16: true @@ -30,8 +22,5 @@ display: dimensions: width: 100 height: 200 - enable_pin: - - number: ${clk_pin} - allow_other_uses: true - - number: ${enable_pin} + enable_pin: ${enable_pin} bus_mode: single diff --git a/tests/components/mipi_spi/test-lvgl.esp32-s3-idf.yaml b/tests/components/mipi_spi/test-lvgl.esp32-s3-idf.yaml index e0f65a3a6a..48f34f3449 100644 --- a/tests/components/mipi_spi/test-lvgl.esp32-s3-idf.yaml +++ b/tests/components/mipi_spi/test-lvgl.esp32-s3-idf.yaml @@ -1,16 +1,9 @@ -substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - -spi: - - id: spi_single - clk_pin: - number: ${clk_pin} - mosi_pin: - number: ${mosi_pin} +packages: + spi: !include ../../test_build_components/common/spi/esp32-s3-idf.yaml display: - platform: mipi_spi + spi_id: spi_bus model: t-display-s3-pro lvgl: diff --git a/tests/components/mipi_spi/test.esp32-c3-idf.yaml b/tests/components/mipi_spi/test.esp32-c3-idf.yaml index c17748c569..55e25d8318 100644 --- a/tests/components/mipi_spi/test.esp32-c3-idf.yaml +++ b/tests/components/mipi_spi/test.esp32-c3-idf.yaml @@ -1,10 +1,10 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 - dc_pin: GPIO21 - cs_pin: GPIO18 - enable_pin: GPIO19 + dc_pin: GPIO7 + cs_pin: GPIO8 + enable_pin: GPIO9 reset_pin: GPIO20 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mipi_spi/test.esp32-idf.yaml b/tests/components/mipi_spi/test.esp32-idf.yaml index 653ccb4910..b173b8de87 100644 --- a/tests/components/mipi_spi/test.esp32-idf.yaml +++ b/tests/components/mipi_spi/test.esp32-idf.yaml @@ -1,15 +1,10 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 - dc_pin: GPIO21 - cs_pin: GPIO18 - enable_pin: GPIO19 + dc_pin: GPIO14 + cs_pin: GPIO13 + enable_pin: GPIO4 reset_pin: GPIO20 packages: - display: !include common.yaml + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml -display: - - platform: mipi_spi - model: m5core +<<: !include common.yaml diff --git a/tests/components/mipi_spi/test.rp2040-ard.yaml b/tests/components/mipi_spi/test.rp2040-ard.yaml index 5d7333853b..380cebcde3 100644 --- a/tests/components/mipi_spi/test.rp2040-ard.yaml +++ b/tests/components/mipi_spi/test.rp2040-ard.yaml @@ -1,10 +1,10 @@ substitutions: - clk_pin: GPIO2 - mosi_pin: GPIO3 - miso_pin: GPIO4 dc_pin: GPIO14 cs_pin: GPIO13 - enable_pin: GPIO19 + enable_pin: GPIO16 reset_pin: GPIO20 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/mixer/test.esp32-idf.yaml b/tests/components/mixer/test.esp32-idf.yaml index 96d2d37458..6712f1e468 100644 --- a/tests/components/mixer/test.esp32-idf.yaml +++ b/tests/components/mixer/test.esp32-idf.yaml @@ -1,7 +1,10 @@ substitutions: - lrclk_pin: GPIO16 - bclk_pin: GPIO17 + lrclk_pin: GPIO4 + bclk_pin: GPIO5 mclk_pin: GPIO15 dout_pin: GPIO14 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mlx90393/common.yaml b/tests/components/mlx90393/common.yaml index 58f3b6ecf5..9e85e06c89 100644 --- a/tests/components/mlx90393/common.yaml +++ b/tests/components/mlx90393/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_mlx90393 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: mlx90393 + i2c_id: i2c_bus oversampling: 3 gain: 1X temperature_compensation: true diff --git a/tests/components/mlx90393/test.esp32-c3-idf.yaml b/tests/components/mlx90393/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/mlx90393/test.esp32-c3-idf.yaml +++ b/tests/components/mlx90393/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mlx90393/test.esp32-idf.yaml b/tests/components/mlx90393/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/mlx90393/test.esp32-idf.yaml +++ b/tests/components/mlx90393/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mlx90393/test.esp32-s3-idf.yaml b/tests/components/mlx90393/test.esp32-s3-idf.yaml index ee2c29ca4e..0fd8684a2c 100644 --- a/tests/components/mlx90393/test.esp32-s3-idf.yaml +++ b/tests/components/mlx90393/test.esp32-s3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-s3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mlx90393/test.esp8266-ard.yaml b/tests/components/mlx90393/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/mlx90393/test.esp8266-ard.yaml +++ b/tests/components/mlx90393/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mlx90393/test.rp2040-ard.yaml b/tests/components/mlx90393/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/mlx90393/test.rp2040-ard.yaml +++ b/tests/components/mlx90393/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/mlx90614/common.yaml b/tests/components/mlx90614/common.yaml index 03279e6e14..8d408fb016 100644 --- a/tests/components/mlx90614/common.yaml +++ b/tests/components/mlx90614/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_mlx90614 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: mlx90614 + i2c_id: i2c_bus ambient: name: Ambient object: diff --git a/tests/components/mlx90614/test.esp32-c3-idf.yaml b/tests/components/mlx90614/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/mlx90614/test.esp32-c3-idf.yaml +++ b/tests/components/mlx90614/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mlx90614/test.esp32-idf.yaml b/tests/components/mlx90614/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/mlx90614/test.esp32-idf.yaml +++ b/tests/components/mlx90614/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mlx90614/test.esp8266-ard.yaml b/tests/components/mlx90614/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/mlx90614/test.esp8266-ard.yaml +++ b/tests/components/mlx90614/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mlx90614/test.rp2040-ard.yaml b/tests/components/mlx90614/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/mlx90614/test.rp2040-ard.yaml +++ b/tests/components/mlx90614/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/mmc5603/common.yaml b/tests/components/mmc5603/common.yaml index 83235f596e..6f6e35e9af 100644 --- a/tests/components/mmc5603/common.yaml +++ b/tests/components/mmc5603/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_mmc5603 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: mmc5603 + i2c_id: i2c_bus address: 0x30 field_strength_x: name: HMC5883L Field Strength X diff --git a/tests/components/mmc5603/test.esp32-c3-idf.yaml b/tests/components/mmc5603/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/mmc5603/test.esp32-c3-idf.yaml +++ b/tests/components/mmc5603/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mmc5603/test.esp32-idf.yaml b/tests/components/mmc5603/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/mmc5603/test.esp32-idf.yaml +++ b/tests/components/mmc5603/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mmc5603/test.esp8266-ard.yaml b/tests/components/mmc5603/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/mmc5603/test.esp8266-ard.yaml +++ b/tests/components/mmc5603/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mmc5603/test.rp2040-ard.yaml b/tests/components/mmc5603/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/mmc5603/test.rp2040-ard.yaml +++ b/tests/components/mmc5603/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/mmc5983/common.yaml b/tests/components/mmc5983/common.yaml index 949ff527e7..963a2527c1 100644 --- a/tests/components/mmc5983/common.yaml +++ b/tests/components/mmc5983/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_mmc5983 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: mmc5983 + i2c_id: i2c_bus field_strength_x: name: "Magnet X" id: magnet_x diff --git a/tests/components/mmc5983/test.esp32-c3-idf.yaml b/tests/components/mmc5983/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/mmc5983/test.esp32-c3-idf.yaml +++ b/tests/components/mmc5983/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mmc5983/test.esp32-idf.yaml b/tests/components/mmc5983/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/mmc5983/test.esp32-idf.yaml +++ b/tests/components/mmc5983/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mmc5983/test.esp8266-ard.yaml b/tests/components/mmc5983/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/mmc5983/test.esp8266-ard.yaml +++ b/tests/components/mmc5983/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mmc5983/test.rp2040-ard.yaml b/tests/components/mmc5983/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/mmc5983/test.rp2040-ard.yaml +++ b/tests/components/mmc5983/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/modbus/common.yaml b/tests/components/modbus/common.yaml index 3ec9518585..d636143ec9 100644 --- a/tests/components/modbus/common.yaml +++ b/tests/components/modbus/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_modbus - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - modbus: id: mod_bus1 flow_control_pin: ${flow_control_pin} diff --git a/tests/components/modbus/test.esp32-c3-idf.yaml b/tests/components/modbus/test.esp32-c3-idf.yaml index 452031a5aa..430c6818cb 100644 --- a/tests/components/modbus/test.esp32-c3-idf.yaml +++ b/tests/components/modbus/test.esp32-c3-idf.yaml @@ -1,6 +1,6 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 flow_control_pin: GPIO3 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/modbus/test.esp32-idf.yaml b/tests/components/modbus/test.esp32-idf.yaml index bd767a8ece..8a08f8a821 100644 --- a/tests/components/modbus/test.esp32-idf.yaml +++ b/tests/components/modbus/test.esp32-idf.yaml @@ -3,4 +3,7 @@ substitutions: rx_pin: GPIO14 flow_control_pin: GPIO13 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/modbus/test.esp8266-ard.yaml b/tests/components/modbus/test.esp8266-ard.yaml index 29c98d0957..dfea36d957 100644 --- a/tests/components/modbus/test.esp8266-ard.yaml +++ b/tests/components/modbus/test.esp8266-ard.yaml @@ -1,6 +1,9 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 - flow_control_pin: GPIO13 + tx_pin: GPIO0 + rx_pin: GPIO2 + flow_control_pin: GPIO15 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/modbus/test.rp2040-ard.yaml b/tests/components/modbus/test.rp2040-ard.yaml index 452031a5aa..43f12ea28d 100644 --- a/tests/components/modbus/test.rp2040-ard.yaml +++ b/tests/components/modbus/test.rp2040-ard.yaml @@ -3,4 +3,7 @@ substitutions: rx_pin: GPIO5 flow_control_pin: GPIO3 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/modbus_controller/common.yaml b/tests/components/modbus_controller/common.yaml index c2b5ab737f..ae5520e57d 100644 --- a/tests/components/modbus_controller/common.yaml +++ b/tests/components/modbus_controller/common.yaml @@ -1,25 +1,12 @@ -uart: - - id: uart_modbus_client - tx_pin: ${client_tx_pin} - rx_pin: ${client_rx_pin} - baud_rate: 9600 - - id: uart_modbus_server - tx_pin: ${server_tx_pin} - rx_pin: ${server_rx_pin} - baud_rate: 9600 - modbus: - - id: mod_bus1 - uart_id: uart_modbus_client - flow_control_pin: ${flow_control_pin} - id: mod_bus2 - uart_id: uart_modbus_server + uart_id: uart_bus role: server modbus_controller: - id: modbus_controller1 address: 0x2 - modbus_id: mod_bus1 + modbus_id: modbus_bus allow_duplicate_commands: false on_online: then: diff --git a/tests/components/modbus_controller/test.esp32-c3-idf.yaml b/tests/components/modbus_controller/test.esp32-c3-idf.yaml index f5b770ff58..db826676ee 100644 --- a/tests/components/modbus_controller/test.esp32-c3-idf.yaml +++ b/tests/components/modbus_controller/test.esp32-c3-idf.yaml @@ -1,8 +1,4 @@ -substitutions: - client_tx_pin: GPIO4 - client_rx_pin: GPIO5 - server_tx_pin: GPIO6 - server_rx_pin: GPIO7 - flow_control_pin: GPIO3 +packages: + modbus: !include ../../test_build_components/common/modbus/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/modbus_controller/test.esp32-idf.yaml b/tests/components/modbus_controller/test.esp32-idf.yaml index 548b8c0666..ace2d95a0b 100644 --- a/tests/components/modbus_controller/test.esp32-idf.yaml +++ b/tests/components/modbus_controller/test.esp32-idf.yaml @@ -1,8 +1,4 @@ -substitutions: - client_tx_pin: GPIO12 - client_rx_pin: GPIO14 - server_tx_pin: GPIO16 - server_rx_pin: GPIO17 - flow_control_pin: GPIO13 +packages: + modbus: !include ../../test_build_components/common/modbus/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/modbus_controller/test.esp8266-ard.yaml b/tests/components/modbus_controller/test.esp8266-ard.yaml index c68a57cbde..560629b0cd 100644 --- a/tests/components/modbus_controller/test.esp8266-ard.yaml +++ b/tests/components/modbus_controller/test.esp8266-ard.yaml @@ -1,8 +1,4 @@ -substitutions: - client_tx_pin: GPIO1 - client_rx_pin: GPIO3 - server_tx_pin: GPIO4 - server_rx_pin: GPIO5 - flow_control_pin: GPIO13 +packages: + modbus: !include ../../test_build_components/common/modbus/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/modbus_controller/test.rp2040-ard.yaml b/tests/components/modbus_controller/test.rp2040-ard.yaml index 80528bc12b..eeebbd2a8a 100644 --- a/tests/components/modbus_controller/test.rp2040-ard.yaml +++ b/tests/components/modbus_controller/test.rp2040-ard.yaml @@ -1,8 +1,4 @@ -substitutions: - client_tx_pin: GPIO2 - client_rx_pin: GPIO3 - server_tx_pin: GPIO4 - server_rx_pin: GPIO5 - flow_control_pin: GPIO6 +packages: + modbus: !include ../../test_build_components/common/modbus/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/mopeka_ble/test.esp32-c3-idf.yaml b/tests/components/mopeka_ble/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/mopeka_ble/test.esp32-c3-idf.yaml +++ b/tests/components/mopeka_ble/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mopeka_ble/test.esp32-idf.yaml b/tests/components/mopeka_ble/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/mopeka_ble/test.esp32-idf.yaml +++ b/tests/components/mopeka_ble/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mopeka_pro_check/test.esp32-c3-idf.yaml b/tests/components/mopeka_pro_check/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/mopeka_pro_check/test.esp32-c3-idf.yaml +++ b/tests/components/mopeka_pro_check/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mopeka_pro_check/test.esp32-idf.yaml b/tests/components/mopeka_pro_check/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/mopeka_pro_check/test.esp32-idf.yaml +++ b/tests/components/mopeka_pro_check/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mopeka_std_check/test.esp32-c3-idf.yaml b/tests/components/mopeka_std_check/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/mopeka_std_check/test.esp32-c3-idf.yaml +++ b/tests/components/mopeka_std_check/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mopeka_std_check/test.esp32-idf.yaml b/tests/components/mopeka_std_check/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/mopeka_std_check/test.esp32-idf.yaml +++ b/tests/components/mopeka_std_check/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mpl3115a2/common.yaml b/tests/components/mpl3115a2/common.yaml index f2f65885b3..aa6c2b77fc 100644 --- a/tests/components/mpl3115a2/common.yaml +++ b/tests/components/mpl3115a2/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_mpl3115a2 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: mpl3115a2 + i2c_id: i2c_bus temperature: name: MPL3115A2 Temperature pressure: diff --git a/tests/components/mpl3115a2/test.esp32-c3-idf.yaml b/tests/components/mpl3115a2/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/mpl3115a2/test.esp32-c3-idf.yaml +++ b/tests/components/mpl3115a2/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mpl3115a2/test.esp32-idf.yaml b/tests/components/mpl3115a2/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/mpl3115a2/test.esp32-idf.yaml +++ b/tests/components/mpl3115a2/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mpl3115a2/test.esp8266-ard.yaml b/tests/components/mpl3115a2/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/mpl3115a2/test.esp8266-ard.yaml +++ b/tests/components/mpl3115a2/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mpl3115a2/test.rp2040-ard.yaml b/tests/components/mpl3115a2/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/mpl3115a2/test.rp2040-ard.yaml +++ b/tests/components/mpl3115a2/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/mpr121/common.yaml b/tests/components/mpr121/common.yaml index fcf61b57f3..67a06cf9c1 100644 --- a/tests/components/mpr121/common.yaml +++ b/tests/components/mpr121/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_mpr121 - scl: ${i2c_scl} - sda: ${i2c_sda} - mpr121: + i2c_id: i2c_bus id: mpr121_first address: 0x5A diff --git a/tests/components/mpr121/test.esp32-c3-idf.yaml b/tests/components/mpr121/test.esp32-c3-idf.yaml index d7ae0d5161..d1abb03369 100644 --- a/tests/components/mpr121/test.esp32-c3-idf.yaml +++ b/tests/components/mpr121/test.esp32-c3-idf.yaml @@ -2,4 +2,7 @@ substitutions: i2c_scl: GPIO5 i2c_sda: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mpr121/test.esp32-idf.yaml b/tests/components/mpr121/test.esp32-idf.yaml index 1037d5d35b..4598505c3a 100644 --- a/tests/components/mpr121/test.esp32-idf.yaml +++ b/tests/components/mpr121/test.esp32-idf.yaml @@ -2,4 +2,7 @@ substitutions: i2c_scl: GPIO16 i2c_sda: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/mpr121/test.esp8266-ard.yaml b/tests/components/mpr121/test.esp8266-ard.yaml index d7ae0d5161..5565bb8c35 100644 --- a/tests/components/mpr121/test.esp8266-ard.yaml +++ b/tests/components/mpr121/test.esp8266-ard.yaml @@ -2,4 +2,7 @@ substitutions: i2c_scl: GPIO5 i2c_sda: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/mpr121/test.rp2040-ard.yaml b/tests/components/mpr121/test.rp2040-ard.yaml index d7ae0d5161..888762a742 100644 --- a/tests/components/mpr121/test.rp2040-ard.yaml +++ b/tests/components/mpr121/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: i2c_scl: GPIO5 i2c_sda: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/mpu6050/common.yaml b/tests/components/mpu6050/common.yaml index e9d4995534..7ac123f8c7 100644 --- a/tests/components/mpu6050/common.yaml +++ b/tests/components/mpu6050/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_mpu6050 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: mpu6050 + i2c_id: i2c_bus address: 0x68 accel_x: name: MPU6050 Accel X diff --git a/tests/components/mpu6050/test.esp32-c3-idf.yaml b/tests/components/mpu6050/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/mpu6050/test.esp32-c3-idf.yaml +++ b/tests/components/mpu6050/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mpu6050/test.esp32-idf.yaml b/tests/components/mpu6050/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/mpu6050/test.esp32-idf.yaml +++ b/tests/components/mpu6050/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mpu6050/test.esp8266-ard.yaml b/tests/components/mpu6050/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/mpu6050/test.esp8266-ard.yaml +++ b/tests/components/mpu6050/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mpu6050/test.rp2040-ard.yaml b/tests/components/mpu6050/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/mpu6050/test.rp2040-ard.yaml +++ b/tests/components/mpu6050/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/mpu6886/common.yaml b/tests/components/mpu6886/common.yaml index 9c3e283cc3..9f7324f384 100644 --- a/tests/components/mpu6886/common.yaml +++ b/tests/components/mpu6886/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_mpu6886 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: mpu6886 + i2c_id: i2c_bus address: 0x68 accel_x: name: MPU6886 Accel X diff --git a/tests/components/mpu6886/test.esp32-c3-idf.yaml b/tests/components/mpu6886/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/mpu6886/test.esp32-c3-idf.yaml +++ b/tests/components/mpu6886/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/mpu6886/test.esp32-idf.yaml b/tests/components/mpu6886/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/mpu6886/test.esp32-idf.yaml +++ b/tests/components/mpu6886/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/mpu6886/test.esp8266-ard.yaml b/tests/components/mpu6886/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/mpu6886/test.esp8266-ard.yaml +++ b/tests/components/mpu6886/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/mpu6886/test.rp2040-ard.yaml b/tests/components/mpu6886/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/mpu6886/test.rp2040-ard.yaml +++ b/tests/components/mpu6886/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/mqtt/common-update.yaml b/tests/components/mqtt/common-update.yaml index 25f57cfef2..2e21e9687a 100644 --- a/tests/components/mqtt/common-update.yaml +++ b/tests/components/mqtt/common-update.yaml @@ -6,8 +6,10 @@ http_request: ota: - platform: http_request + id: mqtt_http_request_ota update: - platform: http_request name: "OTA Update" + ota_id: mqtt_http_request_ota source: https://example.com/ota.json diff --git a/tests/components/ms5611/common.yaml b/tests/components/ms5611/common.yaml index d0417faa86..12644fa330 100644 --- a/tests/components/ms5611/common.yaml +++ b/tests/components/ms5611/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_ms5611 - scl: ${i2c_scl} - sda: ${i2c_sda} - sensor: - platform: ms5611 + i2c_id: i2c_bus temperature: name: Outside Temperature pressure: diff --git a/tests/components/ms5611/test.esp32-c3-idf.yaml b/tests/components/ms5611/test.esp32-c3-idf.yaml index d7ae0d5161..d1abb03369 100644 --- a/tests/components/ms5611/test.esp32-c3-idf.yaml +++ b/tests/components/ms5611/test.esp32-c3-idf.yaml @@ -2,4 +2,7 @@ substitutions: i2c_scl: GPIO5 i2c_sda: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ms5611/test.esp32-idf.yaml b/tests/components/ms5611/test.esp32-idf.yaml index 1037d5d35b..4598505c3a 100644 --- a/tests/components/ms5611/test.esp32-idf.yaml +++ b/tests/components/ms5611/test.esp32-idf.yaml @@ -2,4 +2,7 @@ substitutions: i2c_scl: GPIO16 i2c_sda: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ms5611/test.esp8266-ard.yaml b/tests/components/ms5611/test.esp8266-ard.yaml index d7ae0d5161..5565bb8c35 100644 --- a/tests/components/ms5611/test.esp8266-ard.yaml +++ b/tests/components/ms5611/test.esp8266-ard.yaml @@ -2,4 +2,7 @@ substitutions: i2c_scl: GPIO5 i2c_sda: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ms5611/test.rp2040-ard.yaml b/tests/components/ms5611/test.rp2040-ard.yaml index d7ae0d5161..888762a742 100644 --- a/tests/components/ms5611/test.rp2040-ard.yaml +++ b/tests/components/ms5611/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: i2c_scl: GPIO5 i2c_sda: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/msa3xx/common.yaml b/tests/components/msa3xx/common.yaml index 8de6a8a89a..297ed8a741 100644 --- a/tests/components/msa3xx/common.yaml +++ b/tests/components/msa3xx/common.yaml @@ -1,5 +1,5 @@ msa3xx: - i2c_id: i2c_msa3xx + i2c_id: i2c_bus type: msa301 range: 4G resolution: 14 diff --git a/tests/components/msa3xx/test.esp32-c3-idf.yaml b/tests/components/msa3xx/test.esp32-c3-idf.yaml index b972ce8cdb..9990d96d29 100644 --- a/tests/components/msa3xx/test.esp32-c3-idf.yaml +++ b/tests/components/msa3xx/test.esp32-c3-idf.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_msa3xx - scl: GPIO5 - sda: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/msa3xx/test.esp32-idf.yaml b/tests/components/msa3xx/test.esp32-idf.yaml index 7202e7b9bf..b47e39c389 100644 --- a/tests/components/msa3xx/test.esp32-idf.yaml +++ b/tests/components/msa3xx/test.esp32-idf.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_msa3xx - scl: GPIO16 - sda: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/msa3xx/test.esp8266-ard.yaml b/tests/components/msa3xx/test.esp8266-ard.yaml index b972ce8cdb..4a98b9388a 100644 --- a/tests/components/msa3xx/test.esp8266-ard.yaml +++ b/tests/components/msa3xx/test.esp8266-ard.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_msa3xx - scl: GPIO5 - sda: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/msa3xx/test.rp2040-ard.yaml b/tests/components/msa3xx/test.rp2040-ard.yaml index b972ce8cdb..319a7c71a6 100644 --- a/tests/components/msa3xx/test.rp2040-ard.yaml +++ b/tests/components/msa3xx/test.rp2040-ard.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_msa3xx - scl: GPIO5 - sda: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/nau7802/common.yaml b/tests/components/nau7802/common.yaml index 2501911a3f..5c52c33dad 100644 --- a/tests/components/nau7802/common.yaml +++ b/tests/components/nau7802/common.yaml @@ -1,8 +1,8 @@ sensor: - platform: nau7802 + i2c_id: i2c_bus id: test_id name: weight - i2c_id: i2c_nau7802 gain: 32 ldo_voltage: "3.0v" samples_per_second: 10 diff --git a/tests/components/nau7802/test.esp32-c3-idf.yaml b/tests/components/nau7802/test.esp32-c3-idf.yaml index 769468f9ec..9990d96d29 100644 --- a/tests/components/nau7802/test.esp32-c3-idf.yaml +++ b/tests/components/nau7802/test.esp32-c3-idf.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_nau7802 - scl: 5 - sda: 4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/nau7802/test.esp32-idf.yaml b/tests/components/nau7802/test.esp32-idf.yaml index 73a4aa4251..b47e39c389 100644 --- a/tests/components/nau7802/test.esp32-idf.yaml +++ b/tests/components/nau7802/test.esp32-idf.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_nau7802 - scl: 16 - sda: 17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/nau7802/test.esp8266-ard.yaml b/tests/components/nau7802/test.esp8266-ard.yaml index 769468f9ec..4a98b9388a 100644 --- a/tests/components/nau7802/test.esp8266-ard.yaml +++ b/tests/components/nau7802/test.esp8266-ard.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_nau7802 - scl: 5 - sda: 4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/nau7802/test.rp2040-ard.yaml b/tests/components/nau7802/test.rp2040-ard.yaml index 769468f9ec..319a7c71a6 100644 --- a/tests/components/nau7802/test.rp2040-ard.yaml +++ b/tests/components/nau7802/test.rp2040-ard.yaml @@ -1,6 +1,4 @@ -i2c: - - id: i2c_nau7802 - scl: 5 - sda: 4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/nextion/common.yaml b/tests/components/nextion/common.yaml index 767c868d0b..f5ee12a51c 100644 --- a/tests/components/nextion/common.yaml +++ b/tests/components/nextion/common.yaml @@ -236,12 +236,6 @@ wifi: ssid: MySSID password: password1 -uart: - - id: uart_nextion - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 115200 - binary_sensor: - platform: nextion page_id: 0 diff --git a/tests/components/nextion/test.esp32-ard.yaml b/tests/components/nextion/test.esp32-ard.yaml index d5e02b8b85..7e94a9b4a5 100644 --- a/tests/components/nextion/test.esp32-ard.yaml +++ b/tests/components/nextion/test.esp32-ard.yaml @@ -1,8 +1,5 @@ -substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 - packages: + uart: !include ../../test_build_components/common/uart/esp32-ard.yaml base: !include common.yaml display: diff --git a/tests/components/nextion/test.esp32-c3-idf.yaml b/tests/components/nextion/test.esp32-c3-idf.yaml index 5135c7e4f4..888693f909 100644 --- a/tests/components/nextion/test.esp32-c3-idf.yaml +++ b/tests/components/nextion/test.esp32-c3-idf.yaml @@ -1,8 +1,5 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 - packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml base: !include common.yaml display: diff --git a/tests/components/nextion/test.esp32-idf.yaml b/tests/components/nextion/test.esp32-idf.yaml index d5e02b8b85..99820f0f8d 100644 --- a/tests/components/nextion/test.esp32-idf.yaml +++ b/tests/components/nextion/test.esp32-idf.yaml @@ -1,8 +1,5 @@ -substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 - packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml base: !include common.yaml display: diff --git a/tests/components/nextion/test.esp8266-ard.yaml b/tests/components/nextion/test.esp8266-ard.yaml index 5135c7e4f4..49f79b2f4c 100644 --- a/tests/components/nextion/test.esp8266-ard.yaml +++ b/tests/components/nextion/test.esp8266-ard.yaml @@ -1,8 +1,5 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 - packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml base: !include common.yaml display: diff --git a/tests/components/nextion/test.rp2040-ard.yaml b/tests/components/nextion/test.rp2040-ard.yaml index 44534b97a8..23cc71ee7c 100644 --- a/tests/components/nextion/test.rp2040-ard.yaml +++ b/tests/components/nextion/test.rp2040-ard.yaml @@ -1,6 +1,3 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 - packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml base: !include common.yaml diff --git a/tests/components/npi19/common.yaml b/tests/components/npi19/common.yaml index 012e05695e..03550c269f 100644 --- a/tests/components/npi19/common.yaml +++ b/tests/components/npi19/common.yaml @@ -1,13 +1,7 @@ -i2c: - id: i2c_bus - scl: ${scl_pin} - sda: ${sda_pin} - frequency: 200kHz - sensor: - platform: npi19 - update_interval: 1s i2c_id: i2c_bus + update_interval: 1s temperature: name: water temperature diff --git a/tests/components/npi19/test.esp32-idf.yaml b/tests/components/npi19/test.esp32-idf.yaml index 3b761d3fc1..b47e39c389 100644 --- a/tests/components/npi19/test.esp32-idf.yaml +++ b/tests/components/npi19/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO22 - sda_pin: GPIO21 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/npi19/test.esp32-s3-idf.yaml b/tests/components/npi19/test.esp32-s3-idf.yaml index 4942e3c2b3..0fd8684a2c 100644 --- a/tests/components/npi19/test.esp32-s3-idf.yaml +++ b/tests/components/npi19/test.esp32-s3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO40 - sda_pin: GPIO41 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-s3-idf.yaml <<: !include common.yaml diff --git a/tests/components/npi19/test.esp8266-ard.yaml b/tests/components/npi19/test.esp8266-ard.yaml index 3be5e53dcb..4a98b9388a 100644 --- a/tests/components/npi19/test.esp8266-ard.yaml +++ b/tests/components/npi19/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO05 - sda_pin: GPIO04 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/online_image/common-esp32.yaml b/tests/components/online_image/common-esp32.yaml index 787a1ad368..32c909d351 100644 --- a/tests/components/online_image/common-esp32.yaml +++ b/tests/components/online_image/common-esp32.yaml @@ -1,13 +1,11 @@ -<<: !include common.yaml +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml -spi: - - id: spi_main_lcd - clk_pin: 16 - mosi_pin: 17 - miso_pin: 18 +<<: !include common.yaml display: - platform: ili9xxx + spi_id: spi_bus id: main_lcd model: ili9342 cs_pin: 20 diff --git a/tests/components/online_image/common-esp8266.yaml b/tests/components/online_image/common-esp8266.yaml index ba15b5025c..d7722d171a 100644 --- a/tests/components/online_image/common-esp8266.yaml +++ b/tests/components/online_image/common-esp8266.yaml @@ -1,13 +1,11 @@ -<<: !include common.yaml +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml -spi: - - id: spi_main_lcd - clk_pin: 14 - mosi_pin: 13 - miso_pin: 12 +<<: !include common.yaml display: - platform: ili9xxx + spi_id: spi_bus id: main_lcd model: ili9342 cs_pin: 15 diff --git a/tests/components/online_image/common-rp2040.yaml b/tests/components/online_image/common-rp2040.yaml index 16bb2b2c44..25891b94bc 100644 --- a/tests/components/online_image/common-rp2040.yaml +++ b/tests/components/online_image/common-rp2040.yaml @@ -1,13 +1,11 @@ -<<: !include common.yaml +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml -spi: - - id: spi_main_lcd - clk_pin: 18 - mosi_pin: 19 - miso_pin: 16 +<<: !include common.yaml display: - platform: ili9xxx + spi_id: spi_bus id: main_lcd model: ili9342 cs_pin: 20 diff --git a/tests/components/opt3001/common.yaml b/tests/components/opt3001/common.yaml index dab4f824f8..7b2cb339af 100644 --- a/tests/components/opt3001/common.yaml +++ b/tests/components/opt3001/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_opt3001 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: opt3001 + i2c_id: i2c_bus name: Living Room Brightness address: 0x44 update_interval: 30s diff --git a/tests/components/opt3001/test.esp32-c3-idf.yaml b/tests/components/opt3001/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/opt3001/test.esp32-c3-idf.yaml +++ b/tests/components/opt3001/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/opt3001/test.esp32-idf.yaml b/tests/components/opt3001/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/opt3001/test.esp32-idf.yaml +++ b/tests/components/opt3001/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/opt3001/test.esp8266-ard.yaml b/tests/components/opt3001/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/opt3001/test.esp8266-ard.yaml +++ b/tests/components/opt3001/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/opt3001/test.rp2040-ard.yaml b/tests/components/opt3001/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/opt3001/test.rp2040-ard.yaml +++ b/tests/components/opt3001/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/packet_transport/test.esp32-c3-idf.yaml b/tests/components/packet_transport/test.esp32-c3-idf.yaml index dade44d145..9990d96d29 100644 --- a/tests/components/packet_transport/test.esp32-c3-idf.yaml +++ b/tests/components/packet_transport/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/packet_transport/test.esp32-idf.yaml b/tests/components/packet_transport/test.esp32-idf.yaml index dade44d145..b47e39c389 100644 --- a/tests/components/packet_transport/test.esp32-idf.yaml +++ b/tests/components/packet_transport/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/packet_transport/test.esp8266-ard.yaml b/tests/components/packet_transport/test.esp8266-ard.yaml index dade44d145..4a98b9388a 100644 --- a/tests/components/packet_transport/test.esp8266-ard.yaml +++ b/tests/components/packet_transport/test.esp8266-ard.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/packet_transport/test.host.yaml b/tests/components/packet_transport/test.host.yaml index e735c37e4d..49fdbbc9b2 100644 --- a/tests/components/packet_transport/test.host.yaml +++ b/tests/components/packet_transport/test.host.yaml @@ -1,4 +1,40 @@ -packages: - common: !include common.yaml +udp: + listen_address: 239.0.60.53 + addresses: ["239.0.60.53"] -wifi: !remove +packet_transport: + platform: udp + update_interval: 5s + encryption: "our key goes here" + rolling_code_enable: true + ping_pong_enable: true + binary_sensors: + - binary_sensor_id1 + - id: binary_sensor_id1 + broadcast_id: other_id + sensors: + - sensor_id1 + - id: sensor_id1 + broadcast_id: other_id + providers: + - name: some-device-name + encryption: "their key goes here" + +sensor: + - platform: template + id: sensor_id1 + - platform: packet_transport + provider: some-device-name + id: our_id + remote_id: some_sensor_id + +binary_sensor: + - platform: packet_transport + provider: unencrypted-device + id: other_binary_sensor_id + - platform: packet_transport + provider: some-device-name + type: status + name: Some-Device Status + - platform: template + id: binary_sensor_id1 diff --git a/tests/components/packet_transport/test.rp2040-ard.yaml b/tests/components/packet_transport/test.rp2040-ard.yaml index dade44d145..319a7c71a6 100644 --- a/tests/components/packet_transport/test.rp2040-ard.yaml +++ b/tests/components/packet_transport/test.rp2040-ard.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/pca6416a/common.yaml b/tests/components/pca6416a/common.yaml index ea538387e4..9ad6e2fb15 100644 --- a/tests/components/pca6416a/common.yaml +++ b/tests/components/pca6416a/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_pca6416a - scl: ${scl_pin} - sda: ${sda_pin} - pca6416a: - id: pca6416a_hub + i2c_id: i2c_bus address: 0x21 binary_sensor: diff --git a/tests/components/pca6416a/test.esp32-c3-idf.yaml b/tests/components/pca6416a/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/pca6416a/test.esp32-c3-idf.yaml +++ b/tests/components/pca6416a/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pca6416a/test.esp32-idf.yaml b/tests/components/pca6416a/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/pca6416a/test.esp32-idf.yaml +++ b/tests/components/pca6416a/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pca6416a/test.esp8266-ard.yaml b/tests/components/pca6416a/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/pca6416a/test.esp8266-ard.yaml +++ b/tests/components/pca6416a/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pca6416a/test.rp2040-ard.yaml b/tests/components/pca6416a/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/pca6416a/test.rp2040-ard.yaml +++ b/tests/components/pca6416a/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/pca9554/common.yaml b/tests/components/pca9554/common.yaml index db2ec2b826..9e5e7f3342 100644 --- a/tests/components/pca9554/common.yaml +++ b/tests/components/pca9554/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_pca9554 - scl: ${scl_pin} - sda: ${sda_pin} - pca9554: - id: pca9554_hub + i2c_id: i2c_bus pin_count: 8 address: 0x3F diff --git a/tests/components/pca9554/test.esp32-c3-idf.yaml b/tests/components/pca9554/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/pca9554/test.esp32-c3-idf.yaml +++ b/tests/components/pca9554/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pca9554/test.esp32-idf.yaml b/tests/components/pca9554/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/pca9554/test.esp32-idf.yaml +++ b/tests/components/pca9554/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pca9554/test.esp8266-ard.yaml b/tests/components/pca9554/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/pca9554/test.esp8266-ard.yaml +++ b/tests/components/pca9554/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pca9554/test.rp2040-ard.yaml b/tests/components/pca9554/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/pca9554/test.rp2040-ard.yaml +++ b/tests/components/pca9554/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/pca9685/common.yaml b/tests/components/pca9685/common.yaml index 57cdc5de9b..2e238b481c 100644 --- a/tests/components/pca9685/common.yaml +++ b/tests/components/pca9685/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_pca9685 - scl: ${scl_pin} - sda: ${sda_pin} - pca9685: + i2c_id: i2c_bus frequency: 500 address: 0x0 diff --git a/tests/components/pca9685/test.esp32-c3-idf.yaml b/tests/components/pca9685/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/pca9685/test.esp32-c3-idf.yaml +++ b/tests/components/pca9685/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pca9685/test.esp32-idf.yaml b/tests/components/pca9685/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/pca9685/test.esp32-idf.yaml +++ b/tests/components/pca9685/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pca9685/test.esp8266-ard.yaml b/tests/components/pca9685/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/pca9685/test.esp8266-ard.yaml +++ b/tests/components/pca9685/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pca9685/test.rp2040-ard.yaml b/tests/components/pca9685/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/pca9685/test.rp2040-ard.yaml +++ b/tests/components/pca9685/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/pcd8544/common.yaml b/tests/components/pcd8544/common.yaml index 0fb969eeb8..418cd97253 100644 --- a/tests/components/pcd8544/common.yaml +++ b/tests/components/pcd8544/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_pcd8544 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - display: - platform: pcd8544 cs_pin: ${cs_pin} diff --git a/tests/components/pcd8544/test.esp32-c3-idf.yaml b/tests/components/pcd8544/test.esp32-c3-idf.yaml index c5c932c92c..b112cf4c31 100644 --- a/tests/components/pcd8544/test.esp32-c3-idf.yaml +++ b/tests/components/pcd8544/test.esp32-c3-idf.yaml @@ -1,9 +1,8 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 dc_pin: GPIO9 reset_pin: GPIO10 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pcd8544/test.esp32-idf.yaml b/tests/components/pcd8544/test.esp32-idf.yaml index 09e9db5a38..ff174a4656 100644 --- a/tests/components/pcd8544/test.esp32-idf.yaml +++ b/tests/components/pcd8544/test.esp32-idf.yaml @@ -1,9 +1,9 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO18 cs_pin: GPIO12 dc_pin: GPIO13 reset_pin: GPIO14 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/pcd8544/test.esp8266-ard.yaml b/tests/components/pcd8544/test.esp8266-ard.yaml index 3f023a60eb..56cb29f29e 100644 --- a/tests/components/pcd8544/test.esp8266-ard.yaml +++ b/tests/components/pcd8544/test.esp8266-ard.yaml @@ -1,9 +1,12 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 + clk_pin: GPIO0 + mosi_pin: GPIO2 miso_pin: GPIO12 cs_pin: GPIO5 dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/pcd8544/test.rp2040-ard.yaml b/tests/components/pcd8544/test.rp2040-ard.yaml index d7fd6ee294..66caa956f7 100644 --- a/tests/components/pcd8544/test.rp2040-ard.yaml +++ b/tests/components/pcd8544/test.rp2040-ard.yaml @@ -6,4 +6,7 @@ substitutions: dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/pcf85063/common.yaml b/tests/components/pcf85063/common.yaml index f3b68412c5..170029ad85 100644 --- a/tests/components/pcf85063/common.yaml +++ b/tests/components/pcf85063/common.yaml @@ -3,10 +3,6 @@ esphome: - pcf85063.read_time - pcf85063.write_time -i2c: - - id: i2c_pcf85063 - scl: ${scl_pin} - sda: ${sda_pin} - time: - platform: pcf85063 + i2c_id: i2c_bus diff --git a/tests/components/pcf85063/test.esp32-c3-idf.yaml b/tests/components/pcf85063/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/pcf85063/test.esp32-c3-idf.yaml +++ b/tests/components/pcf85063/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pcf85063/test.esp32-idf.yaml b/tests/components/pcf85063/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/pcf85063/test.esp32-idf.yaml +++ b/tests/components/pcf85063/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pcf85063/test.esp8266-ard.yaml b/tests/components/pcf85063/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/pcf85063/test.esp8266-ard.yaml +++ b/tests/components/pcf85063/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pcf85063/test.rp2040-ard.yaml b/tests/components/pcf85063/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/pcf85063/test.rp2040-ard.yaml +++ b/tests/components/pcf85063/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/pcf8563/common.yaml b/tests/components/pcf8563/common.yaml index 30be6b893c..ac5f3afed1 100644 --- a/tests/components/pcf8563/common.yaml +++ b/tests/components/pcf8563/common.yaml @@ -3,10 +3,6 @@ esphome: - pcf8563.read_time - pcf8563.write_time -i2c: - - id: i2c_pcf8563 - scl: ${scl_pin} - sda: ${sda_pin} - time: - platform: pcf8563 + i2c_id: i2c_bus diff --git a/tests/components/pcf8563/test.esp32-c3-idf.yaml b/tests/components/pcf8563/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/pcf8563/test.esp32-c3-idf.yaml +++ b/tests/components/pcf8563/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pcf8563/test.esp32-idf.yaml b/tests/components/pcf8563/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/pcf8563/test.esp32-idf.yaml +++ b/tests/components/pcf8563/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pcf8563/test.esp8266-ard.yaml b/tests/components/pcf8563/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/pcf8563/test.esp8266-ard.yaml +++ b/tests/components/pcf8563/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pcf8563/test.rp2040-ard.yaml b/tests/components/pcf8563/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/pcf8563/test.rp2040-ard.yaml +++ b/tests/components/pcf8563/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/pcf8574/common.yaml b/tests/components/pcf8574/common.yaml index f5fcfad64a..09fa33164e 100644 --- a/tests/components/pcf8574/common.yaml +++ b/tests/components/pcf8574/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_pcf8574 - scl: ${scl_pin} - sda: ${sda_pin} - pcf8574: - id: pcf8574_hub + i2c_id: i2c_bus address: 0x21 pcf8575: false diff --git a/tests/components/pcf8574/test.esp32-c3-idf.yaml b/tests/components/pcf8574/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/pcf8574/test.esp32-c3-idf.yaml +++ b/tests/components/pcf8574/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pcf8574/test.esp32-idf.yaml b/tests/components/pcf8574/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/pcf8574/test.esp32-idf.yaml +++ b/tests/components/pcf8574/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pcf8574/test.esp8266-ard.yaml b/tests/components/pcf8574/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/pcf8574/test.esp8266-ard.yaml +++ b/tests/components/pcf8574/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pcf8574/test.rp2040-ard.yaml b/tests/components/pcf8574/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/pcf8574/test.rp2040-ard.yaml +++ b/tests/components/pcf8574/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/pi4ioe5v6408/common.yaml b/tests/components/pi4ioe5v6408/common.yaml index 4130dc2652..2344622081 100644 --- a/tests/components/pi4ioe5v6408/common.yaml +++ b/tests/components/pi4ioe5v6408/common.yaml @@ -1,9 +1,5 @@ -i2c: - id: i2c_pi4ioe5v6408 - sda: ${i2c_sda} - scl: ${i2c_scl} - pi4ioe5v6408: + i2c_id: i2c_bus id: pi4ioe1 address: 0x44 diff --git a/tests/components/pi4ioe5v6408/test.esp32-idf.yaml b/tests/components/pi4ioe5v6408/test.esp32-idf.yaml index 55e6edfbf3..9a4779d822 100644 --- a/tests/components/pi4ioe5v6408/test.esp32-idf.yaml +++ b/tests/components/pi4ioe5v6408/test.esp32-idf.yaml @@ -2,4 +2,7 @@ substitutions: i2c_sda: GPIO21 i2c_scl: GPIO22 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/pi4ioe5v6408/test.rp2040-ard.yaml b/tests/components/pi4ioe5v6408/test.rp2040-ard.yaml index b7b6b13bfe..3429a2952a 100644 --- a/tests/components/pi4ioe5v6408/test.rp2040-ard.yaml +++ b/tests/components/pi4ioe5v6408/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: i2c_sda: GPIO4 i2c_scl: GPIO5 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/pipsolar/common.yaml b/tests/components/pipsolar/common.yaml index 64e2c0476d..819764a7ea 100644 --- a/tests/components/pipsolar/common.yaml +++ b/tests/components/pipsolar/common.yaml @@ -5,12 +5,6 @@ esphome: id: inverter0_battery_recharge_voltage_out value: 48.0 -uart: - - id: uart_pipsolar - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 115200 - pipsolar: id: inverter0 diff --git a/tests/components/pipsolar/test.esp32-c3-idf.yaml b/tests/components/pipsolar/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/pipsolar/test.esp32-c3-idf.yaml +++ b/tests/components/pipsolar/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pipsolar/test.esp32-idf.yaml b/tests/components/pipsolar/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/pipsolar/test.esp32-idf.yaml +++ b/tests/components/pipsolar/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pipsolar/test.esp32-s2-idf.yaml b/tests/components/pipsolar/test.esp32-s2-idf.yaml index b516342f3b..2d29656c94 100644 --- a/tests/components/pipsolar/test.esp32-s2-idf.yaml +++ b/tests/components/pipsolar/test.esp32-s2-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pipsolar/test.esp8266-ard.yaml b/tests/components/pipsolar/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/pipsolar/test.esp8266-ard.yaml +++ b/tests/components/pipsolar/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pipsolar/test.rp2040-ard.yaml b/tests/components/pipsolar/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/pipsolar/test.rp2040-ard.yaml +++ b/tests/components/pipsolar/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/pm1006/common.yaml b/tests/components/pm1006/common.yaml index 4e3e880f4e..43955bb099 100644 --- a/tests/components/pm1006/common.yaml +++ b/tests/components/pm1006/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_pm1006 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - sensor: - platform: pm1006 pm_2_5: diff --git a/tests/components/pm1006/test.esp32-c3-idf.yaml b/tests/components/pm1006/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/pm1006/test.esp32-c3-idf.yaml +++ b/tests/components/pm1006/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pm1006/test.esp32-idf.yaml b/tests/components/pm1006/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/pm1006/test.esp32-idf.yaml +++ b/tests/components/pm1006/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pm1006/test.esp8266-ard.yaml b/tests/components/pm1006/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/pm1006/test.esp8266-ard.yaml +++ b/tests/components/pm1006/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pm1006/test.rp2040-ard.yaml b/tests/components/pm1006/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/pm1006/test.rp2040-ard.yaml +++ b/tests/components/pm1006/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/pm2005/common.yaml b/tests/components/pm2005/common.yaml index b8f6683b22..034752d0b9 100644 --- a/tests/components/pm2005/common.yaml +++ b/tests/components/pm2005/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_pm2005 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: pm2005 + i2c_id: i2c_bus pm_1_0: name: PM1.0 pm_2_5: diff --git a/tests/components/pm2005/test.esp32-c3-idf.yaml b/tests/components/pm2005/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/pm2005/test.esp32-c3-idf.yaml +++ b/tests/components/pm2005/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pm2005/test.esp32-idf.yaml b/tests/components/pm2005/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/pm2005/test.esp32-idf.yaml +++ b/tests/components/pm2005/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pm2005/test.esp8266-ard.yaml b/tests/components/pm2005/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/pm2005/test.esp8266-ard.yaml +++ b/tests/components/pm2005/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pm2005/test.rp2040-ard.yaml b/tests/components/pm2005/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/pm2005/test.rp2040-ard.yaml +++ b/tests/components/pm2005/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/pmsa003i/common.yaml b/tests/components/pmsa003i/common.yaml index 95e62da694..7267bd58f3 100644 --- a/tests/components/pmsa003i/common.yaml +++ b/tests/components/pmsa003i/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_pmsa003i - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: pmsa003i + i2c_id: i2c_bus pm_1_0: name: PMSA003i PM1.0 pm_2_5: diff --git a/tests/components/pmsa003i/test.esp32-c3-idf.yaml b/tests/components/pmsa003i/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/pmsa003i/test.esp32-c3-idf.yaml +++ b/tests/components/pmsa003i/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pmsa003i/test.esp32-idf.yaml b/tests/components/pmsa003i/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/pmsa003i/test.esp32-idf.yaml +++ b/tests/components/pmsa003i/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pmsa003i/test.esp8266-ard.yaml b/tests/components/pmsa003i/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/pmsa003i/test.esp8266-ard.yaml +++ b/tests/components/pmsa003i/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pmsa003i/test.rp2040-ard.yaml b/tests/components/pmsa003i/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/pmsa003i/test.rp2040-ard.yaml +++ b/tests/components/pmsa003i/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/pmsx003/common.yaml b/tests/components/pmsx003/common.yaml index 7b9ca5b091..3c60995804 100644 --- a/tests/components/pmsx003/common.yaml +++ b/tests/components/pmsx003/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_pmsx003 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - sensor: - platform: pmsx003 type: PMSX003 diff --git a/tests/components/pmsx003/test.esp32-c3-idf.yaml b/tests/components/pmsx003/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/pmsx003/test.esp32-c3-idf.yaml +++ b/tests/components/pmsx003/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pmsx003/test.esp32-idf.yaml b/tests/components/pmsx003/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/pmsx003/test.esp32-idf.yaml +++ b/tests/components/pmsx003/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pmsx003/test.esp8266-ard.yaml b/tests/components/pmsx003/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/pmsx003/test.esp8266-ard.yaml +++ b/tests/components/pmsx003/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pmsx003/test.rp2040-ard.yaml b/tests/components/pmsx003/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/pmsx003/test.rp2040-ard.yaml +++ b/tests/components/pmsx003/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/pmwcs3/common.yaml b/tests/components/pmwcs3/common.yaml index dcf59d0b6e..e06400d4d4 100644 --- a/tests/components/pmwcs3/common.yaml +++ b/tests/components/pmwcs3/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_pmwcs3 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: pmwcs3 + i2c_id: i2c_bus e25: name: pmwcs3_e25 ec: diff --git a/tests/components/pmwcs3/test.esp32-c3-idf.yaml b/tests/components/pmwcs3/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/pmwcs3/test.esp32-c3-idf.yaml +++ b/tests/components/pmwcs3/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pmwcs3/test.esp32-idf.yaml b/tests/components/pmwcs3/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/pmwcs3/test.esp32-idf.yaml +++ b/tests/components/pmwcs3/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pmwcs3/test.esp8266-ard.yaml b/tests/components/pmwcs3/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/pmwcs3/test.esp8266-ard.yaml +++ b/tests/components/pmwcs3/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pmwcs3/test.rp2040-ard.yaml b/tests/components/pmwcs3/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/pmwcs3/test.rp2040-ard.yaml +++ b/tests/components/pmwcs3/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/pn532_i2c/common.yaml b/tests/components/pn532_i2c/common.yaml index db9abd4b13..f328cd40ee 100644 --- a/tests/components/pn532_i2c/common.yaml +++ b/tests/components/pn532_i2c/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_pn532 - scl: ${scl_pin} - sda: ${sda_pin} - pn532_i2c: + i2c_id: i2c_bus id: pn532_nfcc binary_sensor: diff --git a/tests/components/pn532_i2c/test.esp32-c3-idf.yaml b/tests/components/pn532_i2c/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/pn532_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/pn532_i2c/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pn532_i2c/test.esp32-idf.yaml b/tests/components/pn532_i2c/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/pn532_i2c/test.esp32-idf.yaml +++ b/tests/components/pn532_i2c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pn532_i2c/test.esp8266-ard.yaml b/tests/components/pn532_i2c/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/pn532_i2c/test.esp8266-ard.yaml +++ b/tests/components/pn532_i2c/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pn532_i2c/test.rp2040-ard.yaml b/tests/components/pn532_i2c/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/pn532_i2c/test.rp2040-ard.yaml +++ b/tests/components/pn532_i2c/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/pn532_spi/common.yaml b/tests/components/pn532_spi/common.yaml index d5b8bc405e..e749a9896a 100644 --- a/tests/components/pn532_spi/common.yaml +++ b/tests/components/pn532_spi/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_pn532 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - pn532_spi: id: pn532_nfcc cs_pin: ${cs_pin} diff --git a/tests/components/pn532_spi/test.esp32-c3-idf.yaml b/tests/components/pn532_spi/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/pn532_spi/test.esp32-c3-idf.yaml +++ b/tests/components/pn532_spi/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pn532_spi/test.esp32-idf.yaml b/tests/components/pn532_spi/test.esp32-idf.yaml index bce56f398a..9bb524aa65 100644 --- a/tests/components/pn532_spi/test.esp32-idf.yaml +++ b/tests/components/pn532_spi/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO18 cs_pin: GPIO12 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/pn532_spi/test.esp8266-ard.yaml b/tests/components/pn532_spi/test.esp8266-ard.yaml index bd5c203e35..1aac800592 100644 --- a/tests/components/pn532_spi/test.esp8266-ard.yaml +++ b/tests/components/pn532_spi/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 - cs_pin: GPIO5 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO15 + cs_pin: GPIO16 + +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pn532_spi/test.rp2040-ard.yaml b/tests/components/pn532_spi/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/pn532_spi/test.rp2040-ard.yaml +++ b/tests/components/pn532_spi/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/pn7150_i2c/common.yaml b/tests/components/pn7150_i2c/common.yaml index ef852b7a78..a317b72b9c 100644 --- a/tests/components/pn7150_i2c/common.yaml +++ b/tests/components/pn7150_i2c/common.yaml @@ -16,13 +16,9 @@ esphome: - tag.polling_off: nfcc_pn7150 - tag.polling_on: nfcc_pn7150 -i2c: - - id: i2c_pn7150 - scl: ${scl_pin} - sda: ${sda_pin} - pn7150_i2c: id: nfcc_pn7150 + i2c_id: i2c_bus irq_pin: ${irq_pin} ven_pin: ${ven_pin} emulation_message: https://www.home-assistant.io/tag/pulse_ce diff --git a/tests/components/pn7150_i2c/test.esp32-c3-idf.yaml b/tests/components/pn7150_i2c/test.esp32-c3-idf.yaml index 2067143411..cdf8445263 100644 --- a/tests/components/pn7150_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/pn7150_i2c/test.esp32-c3-idf.yaml @@ -1,7 +1,8 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq_pin: GPIO6 ven_pin: GPIO7 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/pn7150_i2c/test.esp32-idf.yaml b/tests/components/pn7150_i2c/test.esp32-idf.yaml index 1643bec317..9a4cc6669e 100644 --- a/tests/components/pn7150_i2c/test.esp32-idf.yaml +++ b/tests/components/pn7150_i2c/test.esp32-idf.yaml @@ -1,7 +1,8 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 irq_pin: GPIO14 ven_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/pn7150_i2c/test.esp8266-ard.yaml b/tests/components/pn7150_i2c/test.esp8266-ard.yaml index 7111fc9e00..b907e56f80 100644 --- a/tests/components/pn7150_i2c/test.esp8266-ard.yaml +++ b/tests/components/pn7150_i2c/test.esp8266-ard.yaml @@ -1,7 +1,8 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 - irq_pin: GPIO12 - ven_pin: GPIO13 + irq_pin: GPIO15 + ven_pin: GPIO16 + +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pn7150_i2c/test.rp2040-ard.yaml b/tests/components/pn7150_i2c/test.rp2040-ard.yaml index 2067143411..b320b947e3 100644 --- a/tests/components/pn7150_i2c/test.rp2040-ard.yaml +++ b/tests/components/pn7150_i2c/test.rp2040-ard.yaml @@ -1,7 +1,8 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq_pin: GPIO6 ven_pin: GPIO7 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/pn7160_i2c/common.yaml b/tests/components/pn7160_i2c/common.yaml index 0a7c9bd6bb..9807bff0f0 100644 --- a/tests/components/pn7160_i2c/common.yaml +++ b/tests/components/pn7160_i2c/common.yaml @@ -16,13 +16,9 @@ esphome: - tag.polling_off: nfcc_pn7160 - tag.polling_on: nfcc_pn7160 -i2c: - - id: i2c_pn7160 - scl: ${scl_pin} - sda: ${sda_pin} - pn7150_i2c: id: nfcc_pn7160 + i2c_id: i2c_bus irq_pin: ${irq_pin} ven_pin: ${ven_pin} emulation_message: https://www.home-assistant.io/tag/pulse_ce diff --git a/tests/components/pn7160_i2c/test.esp32-c3-idf.yaml b/tests/components/pn7160_i2c/test.esp32-c3-idf.yaml index 2067143411..cdf8445263 100644 --- a/tests/components/pn7160_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/pn7160_i2c/test.esp32-c3-idf.yaml @@ -1,7 +1,8 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq_pin: GPIO6 ven_pin: GPIO7 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/pn7160_i2c/test.esp32-idf.yaml b/tests/components/pn7160_i2c/test.esp32-idf.yaml index 1643bec317..9a4cc6669e 100644 --- a/tests/components/pn7160_i2c/test.esp32-idf.yaml +++ b/tests/components/pn7160_i2c/test.esp32-idf.yaml @@ -1,7 +1,8 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 irq_pin: GPIO14 ven_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/pn7160_i2c/test.esp8266-ard.yaml b/tests/components/pn7160_i2c/test.esp8266-ard.yaml index 7111fc9e00..b907e56f80 100644 --- a/tests/components/pn7160_i2c/test.esp8266-ard.yaml +++ b/tests/components/pn7160_i2c/test.esp8266-ard.yaml @@ -1,7 +1,8 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 - irq_pin: GPIO12 - ven_pin: GPIO13 + irq_pin: GPIO15 + ven_pin: GPIO16 + +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pn7160_i2c/test.rp2040-ard.yaml b/tests/components/pn7160_i2c/test.rp2040-ard.yaml index 2067143411..b320b947e3 100644 --- a/tests/components/pn7160_i2c/test.rp2040-ard.yaml +++ b/tests/components/pn7160_i2c/test.rp2040-ard.yaml @@ -1,7 +1,8 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 irq_pin: GPIO6 ven_pin: GPIO7 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/pn7160_spi/common.yaml b/tests/components/pn7160_spi/common.yaml index 9e8d22f835..d467eb093f 100644 --- a/tests/components/pn7160_spi/common.yaml +++ b/tests/components/pn7160_spi/common.yaml @@ -16,12 +16,6 @@ esphome: - tag.polling_off: nfcc_pn7160 - tag.polling_on: nfcc_pn7160 -spi: - - id: spi_pn7160 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - pn7160_spi: id: nfcc_pn7160 cs_pin: ${cs_pin} diff --git a/tests/components/pn7160_spi/test.esp32-c3-idf.yaml b/tests/components/pn7160_spi/test.esp32-c3-idf.yaml index f8a07fad2f..ac18bfff5c 100644 --- a/tests/components/pn7160_spi/test.esp32-c3-idf.yaml +++ b/tests/components/pn7160_spi/test.esp32-c3-idf.yaml @@ -1,9 +1,8 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 irq_pin: GPIO9 ven_pin: GPIO10 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pn7160_spi/test.esp32-idf.yaml b/tests/components/pn7160_spi/test.esp32-idf.yaml index f6073d0416..f903e4b7be 100644 --- a/tests/components/pn7160_spi/test.esp32-idf.yaml +++ b/tests/components/pn7160_spi/test.esp32-idf.yaml @@ -1,9 +1,9 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO18 cs_pin: GPIO12 irq_pin: GPIO13 ven_pin: GPIO14 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/pn7160_spi/test.esp8266-ard.yaml b/tests/components/pn7160_spi/test.esp8266-ard.yaml index cbe27533a7..7ec89dc012 100644 --- a/tests/components/pn7160_spi/test.esp8266-ard.yaml +++ b/tests/components/pn7160_spi/test.esp8266-ard.yaml @@ -1,9 +1,12 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 + clk_pin: GPIO0 + mosi_pin: GPIO2 miso_pin: GPIO12 cs_pin: GPIO5 irq_pin: GPIO15 ven_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/pn7160_spi/test.rp2040-ard.yaml b/tests/components/pn7160_spi/test.rp2040-ard.yaml index 70cd2425fa..b4a4b436cd 100644 --- a/tests/components/pn7160_spi/test.rp2040-ard.yaml +++ b/tests/components/pn7160_spi/test.rp2040-ard.yaml @@ -6,4 +6,7 @@ substitutions: irq_pin: GPIO15 ven_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/prometheus/common.yaml b/tests/components/prometheus/common.yaml index 131d135f8b..9a16088ba0 100644 --- a/tests/components/prometheus/common.yaml +++ b/tests/components/prometheus/common.yaml @@ -21,10 +21,12 @@ http_request: ota: - platform: http_request + id: prometheus_http_request_ota update: - platform: http_request name: Firmware Update + ota_id: prometheus_http_request_ota source: http://example.com/manifest.json sensor: diff --git a/tests/components/prometheus/test.esp32-idf.yaml b/tests/components/prometheus/test.esp32-idf.yaml index f00bca5947..d60caadb05 100644 --- a/tests/components/prometheus/test.esp32-idf.yaml +++ b/tests/components/prometheus/test.esp32-idf.yaml @@ -2,4 +2,7 @@ substitutions: verify_ssl: "false" pin: GPIO2 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/pvvx_mithermometer/test.esp32-c3-idf.yaml b/tests/components/pvvx_mithermometer/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/pvvx_mithermometer/test.esp32-c3-idf.yaml +++ b/tests/components/pvvx_mithermometer/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/pvvx_mithermometer/test.esp32-idf.yaml b/tests/components/pvvx_mithermometer/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/pvvx_mithermometer/test.esp32-idf.yaml +++ b/tests/components/pvvx_mithermometer/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/pylontech/common.yaml b/tests/components/pylontech/common.yaml index 6852685be7..537450a3b6 100644 --- a/tests/components/pylontech/common.yaml +++ b/tests/components/pylontech/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_pylontech0 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 115200 - pylontech: - id: pylontech0 - id: pylontech1 diff --git a/tests/components/pylontech/test.esp32-c3-idf.yaml b/tests/components/pylontech/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/pylontech/test.esp32-c3-idf.yaml +++ b/tests/components/pylontech/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pylontech/test.esp32-idf.yaml b/tests/components/pylontech/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/pylontech/test.esp32-idf.yaml +++ b/tests/components/pylontech/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pylontech/test.esp8266-ard.yaml b/tests/components/pylontech/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/pylontech/test.esp8266-ard.yaml +++ b/tests/components/pylontech/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pylontech/test.rp2040-ard.yaml b/tests/components/pylontech/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/pylontech/test.rp2040-ard.yaml +++ b/tests/components/pylontech/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/pzem004t/common.yaml b/tests/components/pzem004t/common.yaml index 75f7f30fc9..4584f9c273 100644 --- a/tests/components/pzem004t/common.yaml +++ b/tests/components/pzem004t/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_pzem004t - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 115200 - sensor: - platform: pzem004t voltage: diff --git a/tests/components/pzem004t/test.esp32-c3-idf.yaml b/tests/components/pzem004t/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/pzem004t/test.esp32-c3-idf.yaml +++ b/tests/components/pzem004t/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/pzem004t/test.esp32-idf.yaml b/tests/components/pzem004t/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/pzem004t/test.esp32-idf.yaml +++ b/tests/components/pzem004t/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/pzem004t/test.esp8266-ard.yaml b/tests/components/pzem004t/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/pzem004t/test.esp8266-ard.yaml +++ b/tests/components/pzem004t/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/pzem004t/test.rp2040-ard.yaml b/tests/components/pzem004t/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/pzem004t/test.rp2040-ard.yaml +++ b/tests/components/pzem004t/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/pzemac/common.yaml b/tests/components/pzemac/common.yaml index e50f4ad2f2..2566051baa 100644 --- a/tests/components/pzemac/common.yaml +++ b/tests/components/pzemac/common.yaml @@ -3,16 +3,9 @@ esphome: then: - pzemac.reset_energy: pzemac1 -uart: - - id: uart_pzemac - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - -modbus: - sensor: - platform: pzemac + 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 b516342f3b..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: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + 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 f486544afa..b631e16677 100644 --- a/tests/components/pzemac/test.esp32-idf.yaml +++ b/tests/components/pzemac/test.esp32-idf.yaml @@ -1,5 +1,9 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + flow_control_pin: GPIO13 + +packages: + 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 b516342f3b..421389ae97 100644 --- a/tests/components/pzemac/test.esp8266-ard.yaml +++ b/tests/components/pzemac/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + 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 b516342f3b..d78d84c983 100644 --- a/tests/components/pzemac/test.rp2040-ard.yaml +++ b/tests/components/pzemac/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + 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 db1868d682..78a0ab0d07 100644 --- a/tests/components/pzemdc/common.yaml +++ b/tests/components/pzemdc/common.yaml @@ -3,15 +3,9 @@ esphome: then: - pzemdc.reset_energy: pzemdc1 -uart: - - id: uart_pzemdc - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - stop_bits: 2 - sensor: - platform: pzemdc + 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 b516342f3b..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: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + 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 f486544afa..b631e16677 100644 --- a/tests/components/pzemdc/test.esp32-idf.yaml +++ b/tests/components/pzemdc/test.esp32-idf.yaml @@ -1,5 +1,9 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + flow_control_pin: GPIO13 + +packages: + 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 b516342f3b..421389ae97 100644 --- a/tests/components/pzemdc/test.esp8266-ard.yaml +++ b/tests/components/pzemdc/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + 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 b516342f3b..d78d84c983 100644 --- a/tests/components/pzemdc/test.rp2040-ard.yaml +++ b/tests/components/pzemdc/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + modbus: !include ../../test_build_components/common/modbus/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/qmc5883l/common.yaml b/tests/components/qmc5883l/common.yaml index c8ad4ba006..98d0350a60 100644 --- a/tests/components/qmc5883l/common.yaml +++ b/tests/components/qmc5883l/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_qmc5883l - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: qmc5883l + i2c_id: i2c_bus address: 0x0D field_strength_x: name: QMC5883L Field Strength X diff --git a/tests/components/qmc5883l/test.esp32-c3-idf.yaml b/tests/components/qmc5883l/test.esp32-c3-idf.yaml index 677501d15a..854ddc25e7 100644 --- a/tests/components/qmc5883l/test.esp32-c3-idf.yaml +++ b/tests/components/qmc5883l/test.esp32-c3-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 drdy_pin: GPIO6 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/qmc5883l/test.esp32-idf.yaml b/tests/components/qmc5883l/test.esp32-idf.yaml index 2cf2041501..07bf2b14e2 100644 --- a/tests/components/qmc5883l/test.esp32-idf.yaml +++ b/tests/components/qmc5883l/test.esp32-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 - drdy_pin: GPIO18 + drdy_pin: GPIO12 + +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/qmc5883l/test.esp8266-ard.yaml b/tests/components/qmc5883l/test.esp8266-ard.yaml index 65b0fd75d9..0c02b3b96a 100644 --- a/tests/components/qmc5883l/test.esp8266-ard.yaml +++ b/tests/components/qmc5883l/test.esp8266-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 drdy_pin: GPIO2 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/qmc5883l/test.rp2040-ard.yaml b/tests/components/qmc5883l/test.rp2040-ard.yaml index 65b0fd75d9..3b10540b1f 100644 --- a/tests/components/qmc5883l/test.rp2040-ard.yaml +++ b/tests/components/qmc5883l/test.rp2040-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 drdy_pin: GPIO2 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/qmp6988/common.yaml b/tests/components/qmp6988/common.yaml index cb4b221df0..2aea228a0d 100644 --- a/tests/components/qmp6988/common.yaml +++ b/tests/components/qmp6988/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_qmp6988 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: qmp6988 + i2c_id: i2c_bus temperature: name: QMP6988 Temperature oversampling: 32x diff --git a/tests/components/qmp6988/test.esp32-c3-idf.yaml b/tests/components/qmp6988/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/qmp6988/test.esp32-c3-idf.yaml +++ b/tests/components/qmp6988/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/qmp6988/test.esp32-idf.yaml b/tests/components/qmp6988/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/qmp6988/test.esp32-idf.yaml +++ b/tests/components/qmp6988/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/qmp6988/test.esp8266-ard.yaml b/tests/components/qmp6988/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/qmp6988/test.esp8266-ard.yaml +++ b/tests/components/qmp6988/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/qmp6988/test.rp2040-ard.yaml b/tests/components/qmp6988/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/qmp6988/test.rp2040-ard.yaml +++ b/tests/components/qmp6988/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/qr_code/common.yaml b/tests/components/qr_code/common.yaml index 85c2ee076b..5fec26c1cc 100644 --- a/tests/components/qr_code/common.yaml +++ b/tests/components/qr_code/common.yaml @@ -1,11 +1,6 @@ -spi: - - id: spi_main_lcd - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - display: - platform: ili9xxx - id: main_lcd + id: qr_code_main_lcd model: ili9342 cs_pin: ${cs_pin} dc_pin: ${dc_pin} @@ -14,11 +9,11 @@ display: lambda: |- // Draw a QR code in the center of the screen auto scale = 2; - auto size = id(homepage_qr).get_size() * scale; + auto size = id(qr_code_homepage_qr).get_size() * scale; auto x = (it.get_width() / 2) - (size / 2); auto y = (it.get_height() / 2) - (size / 2); - it.qr_code(x, y, id(homepage_qr), Color(255,255,255), scale); + it.qr_code(x, y, id(qr_code_homepage_qr), Color(255,255,255), scale); qr_code: - - id: homepage_qr + - id: qr_code_homepage_qr value: https://esphome.io/index.html diff --git a/tests/components/qr_code/test.esp32-c3-idf.yaml b/tests/components/qr_code/test.esp32-c3-idf.yaml index c5c932c92c..b112cf4c31 100644 --- a/tests/components/qr_code/test.esp32-c3-idf.yaml +++ b/tests/components/qr_code/test.esp32-c3-idf.yaml @@ -1,9 +1,8 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 dc_pin: GPIO9 reset_pin: GPIO10 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/qr_code/test.esp32-idf.yaml b/tests/components/qr_code/test.esp32-idf.yaml index bad5241f79..ff174a4656 100644 --- a/tests/components/qr_code/test.esp32-idf.yaml +++ b/tests/components/qr_code/test.esp32-idf.yaml @@ -1,8 +1,9 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 cs_pin: GPIO12 dc_pin: GPIO13 reset_pin: GPIO14 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/qr_code/test.esp8266-ard.yaml b/tests/components/qr_code/test.esp8266-ard.yaml index 3f023a60eb..56cb29f29e 100644 --- a/tests/components/qr_code/test.esp8266-ard.yaml +++ b/tests/components/qr_code/test.esp8266-ard.yaml @@ -1,9 +1,12 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 + clk_pin: GPIO0 + mosi_pin: GPIO2 miso_pin: GPIO12 cs_pin: GPIO5 dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/qr_code/test.rp2040-ard.yaml b/tests/components/qr_code/test.rp2040-ard.yaml index d7fd6ee294..66caa956f7 100644 --- a/tests/components/qr_code/test.rp2040-ard.yaml +++ b/tests/components/qr_code/test.rp2040-ard.yaml @@ -6,4 +6,7 @@ substitutions: dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/qspi_dbi/common.yaml b/tests/components/qspi_dbi/common.yaml index f4b15f2b90..109db65b63 100644 --- a/tests/components/qspi_dbi/common.yaml +++ b/tests/components/qspi_dbi/common.yaml @@ -1,9 +1,3 @@ -spi: - id: quad_spi - clk_pin: 15 - type: quad - data_pins: [14, 10, 16, 12] - display: - platform: qspi_dbi model: RM690B0 diff --git a/tests/components/qspi_dbi/test.esp32-s3-idf.yaml b/tests/components/qspi_dbi/test.esp32-s3-idf.yaml index dade44d145..c335dee1f3 100644 --- a/tests/components/qspi_dbi/test.esp32-s3-idf.yaml +++ b/tests/components/qspi_dbi/test.esp32-s3-idf.yaml @@ -1 +1,4 @@ +packages: + qspi: !include ../../test_build_components/common/qspi/esp32-s3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/qwiic_pir/common.yaml b/tests/components/qwiic_pir/common.yaml index d4b733405d..30418ff6b9 100644 --- a/tests/components/qwiic_pir/common.yaml +++ b/tests/components/qwiic_pir/common.yaml @@ -1,8 +1,4 @@ -i2c: - - id: i2c_qwiic_pir - scl: ${scl_pin} - sda: ${sda_pin} - binary_sensor: - platform: qwiic_pir + i2c_id: i2c_bus name: Qwiic PIR Motion Sensor diff --git a/tests/components/qwiic_pir/test.esp32-c3-idf.yaml b/tests/components/qwiic_pir/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/qwiic_pir/test.esp32-c3-idf.yaml +++ b/tests/components/qwiic_pir/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/qwiic_pir/test.esp32-idf.yaml b/tests/components/qwiic_pir/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/qwiic_pir/test.esp32-idf.yaml +++ b/tests/components/qwiic_pir/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/qwiic_pir/test.esp8266-ard.yaml b/tests/components/qwiic_pir/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/qwiic_pir/test.esp8266-ard.yaml +++ b/tests/components/qwiic_pir/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/qwiic_pir/test.rp2040-ard.yaml b/tests/components/qwiic_pir/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/qwiic_pir/test.rp2040-ard.yaml +++ b/tests/components/qwiic_pir/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/radon_eye_ble/test.esp32-c3-idf.yaml b/tests/components/radon_eye_ble/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/radon_eye_ble/test.esp32-c3-idf.yaml +++ b/tests/components/radon_eye_ble/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/radon_eye_ble/test.esp32-idf.yaml b/tests/components/radon_eye_ble/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/radon_eye_ble/test.esp32-idf.yaml +++ b/tests/components/radon_eye_ble/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/radon_eye_rd200/test.esp32-c3-idf.yaml b/tests/components/radon_eye_rd200/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/radon_eye_rd200/test.esp32-c3-idf.yaml +++ b/tests/components/radon_eye_rd200/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/radon_eye_rd200/test.esp32-idf.yaml b/tests/components/radon_eye_rd200/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/radon_eye_rd200/test.esp32-idf.yaml +++ b/tests/components/radon_eye_rd200/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/rc522_i2c/common.yaml b/tests/components/rc522_i2c/common.yaml index b8b7a41bc7..65b92a3e78 100644 --- a/tests/components/rc522_i2c/common.yaml +++ b/tests/components/rc522_i2c/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_rc522 - scl: ${scl_pin} - sda: ${sda_pin} - rc522_i2c: - id: rc522_nfcc + i2c_id: i2c_bus update_interval: 1s on_tag: - lambda: |- diff --git a/tests/components/rc522_i2c/test.esp32-c3-idf.yaml b/tests/components/rc522_i2c/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/rc522_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/rc522_i2c/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/rc522_i2c/test.esp32-idf.yaml b/tests/components/rc522_i2c/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/rc522_i2c/test.esp32-idf.yaml +++ b/tests/components/rc522_i2c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/rc522_i2c/test.esp8266-ard.yaml b/tests/components/rc522_i2c/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/rc522_i2c/test.esp8266-ard.yaml +++ b/tests/components/rc522_i2c/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/rc522_i2c/test.rp2040-ard.yaml b/tests/components/rc522_i2c/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/rc522_i2c/test.rp2040-ard.yaml +++ b/tests/components/rc522_i2c/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/rc522_spi/common.yaml b/tests/components/rc522_spi/common.yaml index 5c42858993..4ce1d6584b 100644 --- a/tests/components/rc522_spi/common.yaml +++ b/tests/components/rc522_spi/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_rc522 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - rc522_spi: id: rc522_nfcc cs_pin: ${cs_pin} diff --git a/tests/components/rc522_spi/test.esp32-c3-idf.yaml b/tests/components/rc522_spi/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/rc522_spi/test.esp32-c3-idf.yaml +++ b/tests/components/rc522_spi/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/rc522_spi/test.esp32-idf.yaml b/tests/components/rc522_spi/test.esp32-idf.yaml index 54e027a614..a3352cf880 100644 --- a/tests/components/rc522_spi/test.esp32-idf.yaml +++ b/tests/components/rc522_spi/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/rc522_spi/test.esp8266-ard.yaml b/tests/components/rc522_spi/test.esp8266-ard.yaml index dbd158d030..b4673ba8b7 100644 --- a/tests/components/rc522_spi/test.esp8266-ard.yaml +++ b/tests/components/rc522_spi/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO16 cs_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/rc522_spi/test.rp2040-ard.yaml b/tests/components/rc522_spi/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/rc522_spi/test.rp2040-ard.yaml +++ b/tests/components/rc522_spi/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/rdm6300/common.yaml b/tests/components/rdm6300/common.yaml index 118a295471..f1a5305013 100644 --- a/tests/components/rdm6300/common.yaml +++ b/tests/components/rdm6300/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_rdm6300 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 115200 - rdm6300: binary_sensor: diff --git a/tests/components/rdm6300/test.esp32-c3-idf.yaml b/tests/components/rdm6300/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/rdm6300/test.esp32-c3-idf.yaml +++ b/tests/components/rdm6300/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/rdm6300/test.esp32-idf.yaml b/tests/components/rdm6300/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/rdm6300/test.esp32-idf.yaml +++ b/tests/components/rdm6300/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/rdm6300/test.esp8266-ard.yaml b/tests/components/rdm6300/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/rdm6300/test.esp8266-ard.yaml +++ b/tests/components/rdm6300/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/rdm6300/test.rp2040-ard.yaml b/tests/components/rdm6300/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/rdm6300/test.rp2040-ard.yaml +++ b/tests/components/rdm6300/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/remote_receiver/test.esp32-s3-idf.yaml b/tests/components/remote_receiver/test.esp32-s3-idf.yaml index cdae8b1e4e..0d7a20e0c0 100644 --- a/tests/components/remote_receiver/test.esp32-s3-idf.yaml +++ b/tests/components/remote_receiver/test.esp32-s3-idf.yaml @@ -5,9 +5,22 @@ substitutions: receive_symbols: "4" rmt_symbols: "64" -packages: - common: !include esp32-common.yaml - +# WARNING: Using !extend or !remove prevents automatic component grouping in CI, making builds slower. remote_receiver: - - id: !extend rcvr + - id: rcvr + pin: ${pin} + dump: all + tolerance: 25% + clock_resolution: ${clock_resolution} + filter_symbols: ${filter_symbols} + receive_symbols: ${receive_symbols} + rmt_symbols: ${rmt_symbols} use_dma: "true" + <<: !include common-actions.yaml + +binary_sensor: + - platform: remote_receiver + name: Panasonic Remote Input + panasonic: + address: 0x4004 + command: 0x100BCBD diff --git a/tests/components/remote_transmitter/test.esp32-s3-idf.yaml b/tests/components/remote_transmitter/test.esp32-s3-idf.yaml index fe4c46d9e7..8a038beb4a 100644 --- a/tests/components/remote_transmitter/test.esp32-s3-idf.yaml +++ b/tests/components/remote_transmitter/test.esp32-s3-idf.yaml @@ -3,9 +3,14 @@ substitutions: clock_resolution: "2000000" rmt_symbols: "64" -packages: - common: !include esp32-common.yaml - +# WARNING: Using !extend or !remove prevents automatic component grouping in CI, making builds slower. remote_transmitter: - - id: !extend xmitr + - id: xmitr + pin: ${pin} + carrier_duty_percent: 50% + clock_resolution: ${clock_resolution} + rmt_symbols: ${rmt_symbols} use_dma: "true" + +packages: + buttons: !include common-buttons.yaml diff --git a/tests/components/resampler/test.esp32-idf.yaml b/tests/components/resampler/test.esp32-idf.yaml index 96d2d37458..6712f1e468 100644 --- a/tests/components/resampler/test.esp32-idf.yaml +++ b/tests/components/resampler/test.esp32-idf.yaml @@ -1,7 +1,10 @@ substitutions: - lrclk_pin: GPIO16 - bclk_pin: GPIO17 + lrclk_pin: GPIO4 + bclk_pin: GPIO5 mclk_pin: GPIO15 dout_pin: GPIO14 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/rf_bridge/common.yaml b/tests/components/rf_bridge/common.yaml index eaadc4bb9c..427c3d783d 100644 --- a/tests/components/rf_bridge/common.yaml +++ b/tests/components/rf_bridge/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_rf_bridge - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 115200 - rf_bridge: on_code_received: - lambda: |- diff --git a/tests/components/rf_bridge/test.esp32-c3-idf.yaml b/tests/components/rf_bridge/test.esp32-c3-idf.yaml index b516342f3b..a19013bf54 100644 --- a/tests/components/rf_bridge/test.esp32-c3-idf.yaml +++ b/tests/components/rf_bridge/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/rf_bridge/test.esp32-idf.yaml b/tests/components/rf_bridge/test.esp32-idf.yaml index f486544afa..2d29656c94 100644 --- a/tests/components/rf_bridge/test.esp32-idf.yaml +++ b/tests/components/rf_bridge/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/rf_bridge/test.esp8266-ard.yaml b/tests/components/rf_bridge/test.esp8266-ard.yaml index b516342f3b..5a05efa259 100644 --- a/tests/components/rf_bridge/test.esp8266-ard.yaml +++ b/tests/components/rf_bridge/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/rf_bridge/test.rp2040-ard.yaml b/tests/components/rf_bridge/test.rp2040-ard.yaml index b516342f3b..f1df2daf83 100644 --- a/tests/components/rf_bridge/test.rp2040-ard.yaml +++ b/tests/components/rf_bridge/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ruuvi_ble/test.esp32-c3-idf.yaml b/tests/components/ruuvi_ble/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/ruuvi_ble/test.esp32-c3-idf.yaml +++ b/tests/components/ruuvi_ble/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ruuvi_ble/test.esp32-idf.yaml b/tests/components/ruuvi_ble/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/ruuvi_ble/test.esp32-idf.yaml +++ b/tests/components/ruuvi_ble/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ruuvitag/test.esp32-c3-idf.yaml b/tests/components/ruuvitag/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/ruuvitag/test.esp32-c3-idf.yaml +++ b/tests/components/ruuvitag/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ruuvitag/test.esp32-idf.yaml b/tests/components/ruuvitag/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/ruuvitag/test.esp32-idf.yaml +++ b/tests/components/ruuvitag/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/scd30/common.yaml b/tests/components/scd30/common.yaml index 1c45c67af0..f21d8944dc 100644 --- a/tests/components/scd30/common.yaml +++ b/tests/components/scd30/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_scd30 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: scd30 + i2c_id: i2c_bus co2: name: SCD30 CO2 temperature: diff --git a/tests/components/scd30/test.esp32-c3-idf.yaml b/tests/components/scd30/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/scd30/test.esp32-c3-idf.yaml +++ b/tests/components/scd30/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/scd30/test.esp32-idf.yaml b/tests/components/scd30/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/scd30/test.esp32-idf.yaml +++ b/tests/components/scd30/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/scd30/test.esp8266-ard.yaml b/tests/components/scd30/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/scd30/test.esp8266-ard.yaml +++ b/tests/components/scd30/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/scd30/test.rp2040-ard.yaml b/tests/components/scd30/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/scd30/test.rp2040-ard.yaml +++ b/tests/components/scd30/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/scd4x/common.yaml b/tests/components/scd4x/common.yaml index dfd35e57de..cedb88977e 100644 --- a/tests/components/scd4x/common.yaml +++ b/tests/components/scd4x/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_scd4x - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: scd4x + i2c_id: i2c_bus id: scd40 co2: name: SCD4X CO2 diff --git a/tests/components/scd4x/test.esp32-c3-idf.yaml b/tests/components/scd4x/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/scd4x/test.esp32-c3-idf.yaml +++ b/tests/components/scd4x/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/scd4x/test.esp32-idf.yaml b/tests/components/scd4x/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/scd4x/test.esp32-idf.yaml +++ b/tests/components/scd4x/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/scd4x/test.esp8266-ard.yaml b/tests/components/scd4x/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/scd4x/test.esp8266-ard.yaml +++ b/tests/components/scd4x/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/scd4x/test.rp2040-ard.yaml b/tests/components/scd4x/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/scd4x/test.rp2040-ard.yaml +++ b/tests/components/scd4x/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/sdm_meter/common.yaml b/tests/components/sdm_meter/common.yaml index 60c71a796b..760f134451 100644 --- a/tests/components/sdm_meter/common.yaml +++ b/tests/components/sdm_meter/common.yaml @@ -1,11 +1,6 @@ -uart: - - id: uart_sdm_meter - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - 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 b516342f3b..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: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + 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 f486544afa..b631e16677 100644 --- a/tests/components/sdm_meter/test.esp32-idf.yaml +++ b/tests/components/sdm_meter/test.esp32-idf.yaml @@ -1,5 +1,9 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + flow_control_pin: GPIO13 + +packages: + 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 b516342f3b..421389ae97 100644 --- a/tests/components/sdm_meter/test.esp8266-ard.yaml +++ b/tests/components/sdm_meter/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + 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 b516342f3b..d78d84c983 100644 --- a/tests/components/sdm_meter/test.rp2040-ard.yaml +++ b/tests/components/sdm_meter/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + modbus: !include ../../test_build_components/common/modbus/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/sdp3x/common.yaml b/tests/components/sdp3x/common.yaml index d3c5491ca5..5d06f8eddb 100644 --- a/tests/components/sdp3x/common.yaml +++ b/tests/components/sdp3x/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_sdp3x - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: sdp3x + i2c_id: i2c_bus id: filter_pressure name: HVAC Filter Pressure drop accuracy_decimals: 3 diff --git a/tests/components/sdp3x/test.esp32-c3-idf.yaml b/tests/components/sdp3x/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/sdp3x/test.esp32-c3-idf.yaml +++ b/tests/components/sdp3x/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sdp3x/test.esp32-idf.yaml b/tests/components/sdp3x/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/sdp3x/test.esp32-idf.yaml +++ b/tests/components/sdp3x/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sdp3x/test.esp8266-ard.yaml b/tests/components/sdp3x/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/sdp3x/test.esp8266-ard.yaml +++ b/tests/components/sdp3x/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sdp3x/test.rp2040-ard.yaml b/tests/components/sdp3x/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/sdp3x/test.rp2040-ard.yaml +++ b/tests/components/sdp3x/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/sds011/common.yaml b/tests/components/sds011/common.yaml index c7574e1d7d..abae0f9bd8 100644 --- a/tests/components/sds011/common.yaml +++ b/tests/components/sds011/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_sdm_sds011 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 115200 - sensor: - platform: sds011 pm_2_5: diff --git a/tests/components/sds011/test.esp32-c3-idf.yaml b/tests/components/sds011/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/sds011/test.esp32-c3-idf.yaml +++ b/tests/components/sds011/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sds011/test.esp32-idf.yaml b/tests/components/sds011/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/sds011/test.esp32-idf.yaml +++ b/tests/components/sds011/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sds011/test.esp8266-ard.yaml b/tests/components/sds011/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/sds011/test.esp8266-ard.yaml +++ b/tests/components/sds011/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sds011/test.rp2040-ard.yaml b/tests/components/sds011/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/sds011/test.rp2040-ard.yaml +++ b/tests/components/sds011/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/seeed_mr24hpc1/common.yaml b/tests/components/seeed_mr24hpc1/common.yaml index 38692b3e5e..3a52888c5c 100644 --- a/tests/components/seeed_mr24hpc1/common.yaml +++ b/tests/components/seeed_mr24hpc1/common.yaml @@ -1,14 +1,5 @@ -uart: - - id: seeed_mr24hpc1_uart - tx_pin: ${uart_tx_pin} - rx_pin: ${uart_rx_pin} - baud_rate: 115200 - parity: NONE - stop_bits: 1 - seeed_mr24hpc1: id: my_seeed_mr24hpc1 - uart_id: seeed_mr24hpc1_uart sensor: - platform: seeed_mr24hpc1 diff --git a/tests/components/seeed_mr24hpc1/test.esp32-c3-idf.yaml b/tests/components/seeed_mr24hpc1/test.esp32-c3-idf.yaml index 4fb884abf4..a19013bf54 100644 --- a/tests/components/seeed_mr24hpc1/test.esp32-c3-idf.yaml +++ b/tests/components/seeed_mr24hpc1/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - uart_tx_pin: GPIO5 - uart_rx_pin: GPIO4 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/seeed_mr60bha2/common.yaml b/tests/components/seeed_mr60bha2/common.yaml index 9eb0c8d527..7d1a02b3ea 100644 --- a/tests/components/seeed_mr60bha2/common.yaml +++ b/tests/components/seeed_mr60bha2/common.yaml @@ -1,11 +1,3 @@ -uart: - - id: seeed_mr60fda2_uart - tx_pin: ${uart_tx_pin} - rx_pin: ${uart_rx_pin} - baud_rate: 115200 - parity: NONE - stop_bits: 1 - seeed_mr60bha2: id: my_seeed_mr60bha2 diff --git a/tests/components/seeed_mr60bha2/test.esp32-c3-idf.yaml b/tests/components/seeed_mr60bha2/test.esp32-c3-idf.yaml index 4fb884abf4..fea89f5768 100644 --- a/tests/components/seeed_mr60bha2/test.esp32-c3-idf.yaml +++ b/tests/components/seeed_mr60bha2/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - uart_tx_pin: GPIO5 - uart_rx_pin: GPIO4 +packages: + uart_115200: !include ../../test_build_components/common/uart_115200/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/seeed_mr60fda2/common.yaml b/tests/components/seeed_mr60fda2/common.yaml index 55a7cc1ab3..e0e4614481 100644 --- a/tests/components/seeed_mr60fda2/common.yaml +++ b/tests/components/seeed_mr60fda2/common.yaml @@ -1,14 +1,5 @@ -uart: - - id: seeed_mr60fda2_uart - tx_pin: ${uart_tx_pin} - rx_pin: ${uart_rx_pin} - baud_rate: 115200 - parity: NONE - stop_bits: 1 - seeed_mr60fda2: id: my_seeed_mr60fda2 - uart_id: seeed_mr60fda2_uart binary_sensor: - platform: seeed_mr60fda2 diff --git a/tests/components/seeed_mr60fda2/test.esp32-c3-idf.yaml b/tests/components/seeed_mr60fda2/test.esp32-c3-idf.yaml index 4fb884abf4..fea89f5768 100644 --- a/tests/components/seeed_mr60fda2/test.esp32-c3-idf.yaml +++ b/tests/components/seeed_mr60fda2/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - uart_tx_pin: GPIO5 - uart_rx_pin: GPIO4 +packages: + uart_115200: !include ../../test_build_components/common/uart_115200/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/selec_meter/common.yaml b/tests/components/selec_meter/common.yaml index f2714ce828..2febbee540 100644 --- a/tests/components/selec_meter/common.yaml +++ b/tests/components/selec_meter/common.yaml @@ -1,11 +1,6 @@ -uart: - - id: uart_selec_meter - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - sensor: - platform: selec_meter + modbus_id: modbus_bus total_active_energy: name: SelecEM2M Total Active Energy import_active_energy: diff --git a/tests/components/selec_meter/test.esp32-c3-idf.yaml b/tests/components/selec_meter/test.esp32-c3-idf.yaml index b516342f3b..beb90e1471 100644 --- a/tests/components/selec_meter/test.esp32-c3-idf.yaml +++ b/tests/components/selec_meter/test.esp32-c3-idf.yaml @@ -1,5 +1,7 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + flow_control_pin: GPIO10 + +packages: + modbus: !include ../../test_build_components/common/modbus/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/selec_meter/test.esp32-idf.yaml b/tests/components/selec_meter/test.esp32-idf.yaml index f486544afa..4df9f5863e 100644 --- a/tests/components/selec_meter/test.esp32-idf.yaml +++ b/tests/components/selec_meter/test.esp32-idf.yaml @@ -1,5 +1,9 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + flow_control_pin: GPIO26 + +packages: + modbus: !include ../../test_build_components/common/modbus/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/selec_meter/test.esp8266-ard.yaml b/tests/components/selec_meter/test.esp8266-ard.yaml index b516342f3b..48a7307795 100644 --- a/tests/components/selec_meter/test.esp8266-ard.yaml +++ b/tests/components/selec_meter/test.esp8266-ard.yaml @@ -1,5 +1,9 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + flow_control_pin: GPIO4 + +packages: + modbus: !include ../../test_build_components/common/modbus/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/selec_meter/test.rp2040-ard.yaml b/tests/components/selec_meter/test.rp2040-ard.yaml index b516342f3b..a65500ccc3 100644 --- a/tests/components/selec_meter/test.rp2040-ard.yaml +++ b/tests/components/selec_meter/test.rp2040-ard.yaml @@ -1,5 +1,9 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 + flow_control_pin: GPIO6 + +packages: + modbus: !include ../../test_build_components/common/modbus/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/sen0321/common.yaml b/tests/components/sen0321/common.yaml index 8b9fdff4a1..9228c7b820 100644 --- a/tests/components/sen0321/common.yaml +++ b/tests/components/sen0321/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_sen0321 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: sen0321 + i2c_id: i2c_bus name: Workshop Ozone Sensor id: sen0321_ozone update_interval: 10s diff --git a/tests/components/sen0321/test.esp32-c3-idf.yaml b/tests/components/sen0321/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/sen0321/test.esp32-c3-idf.yaml +++ b/tests/components/sen0321/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sen0321/test.esp32-idf.yaml b/tests/components/sen0321/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/sen0321/test.esp32-idf.yaml +++ b/tests/components/sen0321/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sen0321/test.esp8266-ard.yaml b/tests/components/sen0321/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/sen0321/test.esp8266-ard.yaml +++ b/tests/components/sen0321/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sen0321/test.rp2040-ard.yaml b/tests/components/sen0321/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/sen0321/test.rp2040-ard.yaml +++ b/tests/components/sen0321/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/sen21231/common.yaml b/tests/components/sen21231/common.yaml index 6fa1d04aa2..bfe0f9d7f8 100644 --- a/tests/components/sen21231/common.yaml +++ b/tests/components/sen21231/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_sen21231 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: sen21231 + i2c_id: i2c_bus id: sen21231_sensor1 name: Person Sensor diff --git a/tests/components/sen21231/test.esp32-c3-idf.yaml b/tests/components/sen21231/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/sen21231/test.esp32-c3-idf.yaml +++ b/tests/components/sen21231/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sen21231/test.esp32-idf.yaml b/tests/components/sen21231/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/sen21231/test.esp32-idf.yaml +++ b/tests/components/sen21231/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sen21231/test.esp8266-ard.yaml b/tests/components/sen21231/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/sen21231/test.esp8266-ard.yaml +++ b/tests/components/sen21231/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sen21231/test.rp2040-ard.yaml b/tests/components/sen21231/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/sen21231/test.rp2040-ard.yaml +++ b/tests/components/sen21231/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/sen5x/common.yaml b/tests/components/sen5x/common.yaml index 9adf268048..a4462a16ea 100644 --- a/tests/components/sen5x/common.yaml +++ b/tests/components/sen5x/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_sen5x - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: sen5x + i2c_id: i2c_bus id: sen54 temperature: name: Temperature diff --git a/tests/components/sen5x/test.esp32-c3-idf.yaml b/tests/components/sen5x/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/sen5x/test.esp32-c3-idf.yaml +++ b/tests/components/sen5x/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sen5x/test.esp32-idf.yaml b/tests/components/sen5x/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/sen5x/test.esp32-idf.yaml +++ b/tests/components/sen5x/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sen5x/test.esp8266-ard.yaml b/tests/components/sen5x/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/sen5x/test.esp8266-ard.yaml +++ b/tests/components/sen5x/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sen5x/test.rp2040-ard.yaml b/tests/components/sen5x/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/sen5x/test.rp2040-ard.yaml +++ b/tests/components/sen5x/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/senseair/common.yaml b/tests/components/senseair/common.yaml index 23a933affe..c8066896d0 100644 --- a/tests/components/senseair/common.yaml +++ b/tests/components/senseair/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_senseair - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - sensor: - platform: senseair id: senseair0 diff --git a/tests/components/senseair/test.esp32-c3-idf.yaml b/tests/components/senseair/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/senseair/test.esp32-c3-idf.yaml +++ b/tests/components/senseair/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/senseair/test.esp32-idf.yaml b/tests/components/senseair/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/senseair/test.esp32-idf.yaml +++ b/tests/components/senseair/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/senseair/test.esp8266-ard.yaml b/tests/components/senseair/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/senseair/test.esp8266-ard.yaml +++ b/tests/components/senseair/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/senseair/test.rp2040-ard.yaml b/tests/components/senseair/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/senseair/test.rp2040-ard.yaml +++ b/tests/components/senseair/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/sfa30/common.yaml b/tests/components/sfa30/common.yaml index e3b38aa7fb..3cd2483abc 100644 --- a/tests/components/sfa30/common.yaml +++ b/tests/components/sfa30/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_sfa30 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: sfa30 + i2c_id: i2c_bus formaldehyde: name: SFA30 formaldehyde temperature: diff --git a/tests/components/sfa30/test.esp32-c3-idf.yaml b/tests/components/sfa30/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/sfa30/test.esp32-c3-idf.yaml +++ b/tests/components/sfa30/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sfa30/test.esp32-idf.yaml b/tests/components/sfa30/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/sfa30/test.esp32-idf.yaml +++ b/tests/components/sfa30/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sfa30/test.esp8266-ard.yaml b/tests/components/sfa30/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/sfa30/test.esp8266-ard.yaml +++ b/tests/components/sfa30/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sfa30/test.rp2040-ard.yaml b/tests/components/sfa30/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/sfa30/test.rp2040-ard.yaml +++ b/tests/components/sfa30/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/sgp30/common.yaml b/tests/components/sgp30/common.yaml index 1db5bc67d1..9d4ed46615 100644 --- a/tests/components/sgp30/common.yaml +++ b/tests/components/sgp30/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_sgp30 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: sgp30 + i2c_id: i2c_bus eco2: name: Workshop eCO2 accuracy_decimals: 1 diff --git a/tests/components/sgp30/test.esp32-c3-idf.yaml b/tests/components/sgp30/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/sgp30/test.esp32-c3-idf.yaml +++ b/tests/components/sgp30/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sgp30/test.esp32-idf.yaml b/tests/components/sgp30/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/sgp30/test.esp32-idf.yaml +++ b/tests/components/sgp30/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sgp30/test.esp8266-ard.yaml b/tests/components/sgp30/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/sgp30/test.esp8266-ard.yaml +++ b/tests/components/sgp30/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sgp30/test.rp2040-ard.yaml b/tests/components/sgp30/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/sgp30/test.rp2040-ard.yaml +++ b/tests/components/sgp30/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/sgp4x/common.yaml b/tests/components/sgp4x/common.yaml index adb678d542..4edda8fd1b 100644 --- a/tests/components/sgp4x/common.yaml +++ b/tests/components/sgp4x/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_sgp4x - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: sgp4x + i2c_id: i2c_bus voc: name: VOC Index id: sgp40_voc_index diff --git a/tests/components/sgp4x/test.esp32-c3-idf.yaml b/tests/components/sgp4x/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/sgp4x/test.esp32-c3-idf.yaml +++ b/tests/components/sgp4x/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sgp4x/test.esp32-idf.yaml b/tests/components/sgp4x/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/sgp4x/test.esp32-idf.yaml +++ b/tests/components/sgp4x/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sgp4x/test.esp8266-ard.yaml b/tests/components/sgp4x/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/sgp4x/test.esp8266-ard.yaml +++ b/tests/components/sgp4x/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sgp4x/test.rp2040-ard.yaml b/tests/components/sgp4x/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/sgp4x/test.rp2040-ard.yaml +++ b/tests/components/sgp4x/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/shelly_dimmer/common.yaml b/tests/components/shelly_dimmer/common.yaml index 3acd0260d5..ba36fa995d 100644 --- a/tests/components/shelly_dimmer/common.yaml +++ b/tests/components/shelly_dimmer/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_shelly_dimmer - tx_pin: 4 - rx_pin: 5 - baud_rate: 9600 - light: - platform: shelly_dimmer name: Shelly Dimmer Light diff --git a/tests/components/shelly_dimmer/test.esp8266-ard.yaml b/tests/components/shelly_dimmer/test.esp8266-ard.yaml index dade44d145..80a2cb2fc0 100644 --- a/tests/components/shelly_dimmer/test.esp8266-ard.yaml +++ b/tests/components/shelly_dimmer/test.esp8266-ard.yaml @@ -1 +1,4 @@ +packages: + uart_115200: !include ../../test_build_components/common/uart_115200/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/sht3xd/common.yaml b/tests/components/sht3xd/common.yaml index 2426ebfbb9..02ce521747 100644 --- a/tests/components/sht3xd/common.yaml +++ b/tests/components/sht3xd/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_sht3xd - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: sht3xd + i2c_id: i2c_bus temperature: name: SHT3XD Temperature humidity: diff --git a/tests/components/sht3xd/test.esp32-c3-idf.yaml b/tests/components/sht3xd/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/sht3xd/test.esp32-c3-idf.yaml +++ b/tests/components/sht3xd/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sht3xd/test.esp32-idf.yaml b/tests/components/sht3xd/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/sht3xd/test.esp32-idf.yaml +++ b/tests/components/sht3xd/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sht3xd/test.esp8266-ard.yaml b/tests/components/sht3xd/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/sht3xd/test.esp8266-ard.yaml +++ b/tests/components/sht3xd/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sht3xd/test.rp2040-ard.yaml b/tests/components/sht3xd/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/sht3xd/test.rp2040-ard.yaml +++ b/tests/components/sht3xd/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/sht4x/common.yaml b/tests/components/sht4x/common.yaml index 703a8fa32b..50d5ad8ca4 100644 --- a/tests/components/sht4x/common.yaml +++ b/tests/components/sht4x/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_sht4x - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: sht4x + i2c_id: i2c_bus temperature: name: SHT4X Temperature humidity: diff --git a/tests/components/sht4x/test.esp32-c3-idf.yaml b/tests/components/sht4x/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/sht4x/test.esp32-c3-idf.yaml +++ b/tests/components/sht4x/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sht4x/test.esp32-idf.yaml b/tests/components/sht4x/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/sht4x/test.esp32-idf.yaml +++ b/tests/components/sht4x/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sht4x/test.esp8266-ard.yaml b/tests/components/sht4x/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/sht4x/test.esp8266-ard.yaml +++ b/tests/components/sht4x/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sht4x/test.rp2040-ard.yaml b/tests/components/sht4x/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/sht4x/test.rp2040-ard.yaml +++ b/tests/components/sht4x/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/shtcx/common.yaml b/tests/components/shtcx/common.yaml index 0211319124..a326a1b4d6 100644 --- a/tests/components/shtcx/common.yaml +++ b/tests/components/shtcx/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_shtcx - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: shtcx + i2c_id: i2c_bus temperature: name: SHTCX Temperature humidity: diff --git a/tests/components/shtcx/test.esp32-c3-idf.yaml b/tests/components/shtcx/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/shtcx/test.esp32-c3-idf.yaml +++ b/tests/components/shtcx/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/shtcx/test.esp32-idf.yaml b/tests/components/shtcx/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/shtcx/test.esp32-idf.yaml +++ b/tests/components/shtcx/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/shtcx/test.esp8266-ard.yaml b/tests/components/shtcx/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/shtcx/test.esp8266-ard.yaml +++ b/tests/components/shtcx/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/shtcx/test.rp2040-ard.yaml b/tests/components/shtcx/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/shtcx/test.rp2040-ard.yaml +++ b/tests/components/shtcx/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/sim800l/common.yaml b/tests/components/sim800l/common.yaml index 1b4e2e1af6..503637b35f 100644 --- a/tests/components/sim800l/common.yaml +++ b/tests/components/sim800l/common.yaml @@ -11,12 +11,6 @@ esphome: - sim800l.send_ussd: ussd: test_ussd -uart: - - id: uart_sim800l - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - sim800l: on_sms_received: - lambda: |- diff --git a/tests/components/sim800l/test.esp32-c3-idf.yaml b/tests/components/sim800l/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/sim800l/test.esp32-c3-idf.yaml +++ b/tests/components/sim800l/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sim800l/test.esp32-idf.yaml b/tests/components/sim800l/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/sim800l/test.esp32-idf.yaml +++ b/tests/components/sim800l/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sim800l/test.esp8266-ard.yaml b/tests/components/sim800l/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/sim800l/test.esp8266-ard.yaml +++ b/tests/components/sim800l/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sim800l/test.rp2040-ard.yaml b/tests/components/sim800l/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/sim800l/test.rp2040-ard.yaml +++ b/tests/components/sim800l/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/sm16716/test.esp32-idf.yaml b/tests/components/sm16716/test.esp32-idf.yaml index d295973e3f..a4ecdb6c49 100644 --- a/tests/components/sm16716/test.esp32-idf.yaml +++ b/tests/components/sm16716/test.esp32-idf.yaml @@ -1,5 +1,5 @@ substitutions: - clock_pin: GPIO16 - data_pin: GPIO17 + clock_pin: GPIO4 + data_pin: GPIO5 <<: !include common.yaml diff --git a/tests/components/sm16716/test.esp8266-ard.yaml b/tests/components/sm16716/test.esp8266-ard.yaml index 7808481215..7c7f1e1a11 100644 --- a/tests/components/sm16716/test.esp8266-ard.yaml +++ b/tests/components/sm16716/test.esp8266-ard.yaml @@ -1,5 +1,5 @@ substitutions: - clock_pin: GPIO5 - data_pin: GPIO4 + clock_pin: GPIO0 + data_pin: GPIO2 <<: !include common.yaml diff --git a/tests/components/sm2135/test.esp32-idf.yaml b/tests/components/sm2135/test.esp32-idf.yaml index d295973e3f..a4ecdb6c49 100644 --- a/tests/components/sm2135/test.esp32-idf.yaml +++ b/tests/components/sm2135/test.esp32-idf.yaml @@ -1,5 +1,5 @@ substitutions: - clock_pin: GPIO16 - data_pin: GPIO17 + clock_pin: GPIO4 + data_pin: GPIO5 <<: !include common.yaml diff --git a/tests/components/sm2135/test.esp8266-ard.yaml b/tests/components/sm2135/test.esp8266-ard.yaml index 7808481215..7c7f1e1a11 100644 --- a/tests/components/sm2135/test.esp8266-ard.yaml +++ b/tests/components/sm2135/test.esp8266-ard.yaml @@ -1,5 +1,5 @@ substitutions: - clock_pin: GPIO5 - data_pin: GPIO4 + clock_pin: GPIO0 + data_pin: GPIO2 <<: !include common.yaml diff --git a/tests/components/sm2235/test.esp32-idf.yaml b/tests/components/sm2235/test.esp32-idf.yaml index d295973e3f..a4ecdb6c49 100644 --- a/tests/components/sm2235/test.esp32-idf.yaml +++ b/tests/components/sm2235/test.esp32-idf.yaml @@ -1,5 +1,5 @@ substitutions: - clock_pin: GPIO16 - data_pin: GPIO17 + clock_pin: GPIO4 + data_pin: GPIO5 <<: !include common.yaml diff --git a/tests/components/sm2235/test.esp8266-ard.yaml b/tests/components/sm2235/test.esp8266-ard.yaml index 7808481215..7c7f1e1a11 100644 --- a/tests/components/sm2235/test.esp8266-ard.yaml +++ b/tests/components/sm2235/test.esp8266-ard.yaml @@ -1,5 +1,5 @@ substitutions: - clock_pin: GPIO5 - data_pin: GPIO4 + clock_pin: GPIO0 + data_pin: GPIO2 <<: !include common.yaml diff --git a/tests/components/sm2335/test.esp32-idf.yaml b/tests/components/sm2335/test.esp32-idf.yaml index d295973e3f..a4ecdb6c49 100644 --- a/tests/components/sm2335/test.esp32-idf.yaml +++ b/tests/components/sm2335/test.esp32-idf.yaml @@ -1,5 +1,5 @@ substitutions: - clock_pin: GPIO16 - data_pin: GPIO17 + clock_pin: GPIO4 + data_pin: GPIO5 <<: !include common.yaml diff --git a/tests/components/sm2335/test.esp8266-ard.yaml b/tests/components/sm2335/test.esp8266-ard.yaml index 7808481215..7c7f1e1a11 100644 --- a/tests/components/sm2335/test.esp8266-ard.yaml +++ b/tests/components/sm2335/test.esp8266-ard.yaml @@ -1,5 +1,5 @@ substitutions: - clock_pin: GPIO5 - data_pin: GPIO4 + clock_pin: GPIO0 + data_pin: GPIO2 <<: !include common.yaml diff --git a/tests/components/sm300d2/common.yaml b/tests/components/sm300d2/common.yaml index a231b63816..729f243a65 100644 --- a/tests/components/sm300d2/common.yaml +++ b/tests/components/sm300d2/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_sm300d2 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - sensor: - platform: sm300d2 co2: diff --git a/tests/components/sm300d2/test.esp32-c3-idf.yaml b/tests/components/sm300d2/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/sm300d2/test.esp32-c3-idf.yaml +++ b/tests/components/sm300d2/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sm300d2/test.esp32-idf.yaml b/tests/components/sm300d2/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/sm300d2/test.esp32-idf.yaml +++ b/tests/components/sm300d2/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sm300d2/test.esp8266-ard.yaml b/tests/components/sm300d2/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/sm300d2/test.esp8266-ard.yaml +++ b/tests/components/sm300d2/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sm300d2/test.rp2040-ard.yaml b/tests/components/sm300d2/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/sm300d2/test.rp2040-ard.yaml +++ b/tests/components/sm300d2/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/sml/common.yaml b/tests/components/sml/common.yaml index a50d25eeee..b1bd5949b6 100644 --- a/tests/components/sml/common.yaml +++ b/tests/components/sml/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_sml - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - sml: id: mysml on_data: diff --git a/tests/components/sml/test.esp32-c3-idf.yaml b/tests/components/sml/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/sml/test.esp32-c3-idf.yaml +++ b/tests/components/sml/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sml/test.esp32-idf.yaml b/tests/components/sml/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/sml/test.esp32-idf.yaml +++ b/tests/components/sml/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sml/test.esp8266-ard.yaml b/tests/components/sml/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/sml/test.esp8266-ard.yaml +++ b/tests/components/sml/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sml/test.rp2040-ard.yaml b/tests/components/sml/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/sml/test.rp2040-ard.yaml +++ b/tests/components/sml/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/smt100/common.yaml b/tests/components/smt100/common.yaml index b12d7198fd..86c5636b94 100644 --- a/tests/components/smt100/common.yaml +++ b/tests/components/smt100/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_smt100 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - sensor: - platform: smt100 counts: diff --git a/tests/components/smt100/test.esp32-c3-idf.yaml b/tests/components/smt100/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/smt100/test.esp32-c3-idf.yaml +++ b/tests/components/smt100/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/smt100/test.esp32-idf.yaml b/tests/components/smt100/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/smt100/test.esp32-idf.yaml +++ b/tests/components/smt100/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/smt100/test.esp8266-ard.yaml b/tests/components/smt100/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/smt100/test.esp8266-ard.yaml +++ b/tests/components/smt100/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/smt100/test.rp2040-ard.yaml b/tests/components/smt100/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/smt100/test.rp2040-ard.yaml +++ b/tests/components/smt100/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/sn74hc165/test.esp32-idf.yaml b/tests/components/sn74hc165/test.esp32-idf.yaml index 27f963312f..8a997e16e1 100644 --- a/tests/components/sn74hc165/test.esp32-idf.yaml +++ b/tests/components/sn74hc165/test.esp32-idf.yaml @@ -2,6 +2,6 @@ substitutions: clock_pin: GPIO13 data_pin: GPIO14 load_pin: GPIO15 - clock_inhibit_pin: GPIO16 + clock_inhibit_pin: GPIO4 <<: !include common.yaml diff --git a/tests/components/sn74hc165/test.esp8266-ard.yaml b/tests/components/sn74hc165/test.esp8266-ard.yaml index 27f963312f..00ffc10a9e 100644 --- a/tests/components/sn74hc165/test.esp8266-ard.yaml +++ b/tests/components/sn74hc165/test.esp8266-ard.yaml @@ -1,6 +1,6 @@ substitutions: - clock_pin: GPIO13 - data_pin: GPIO14 + clock_pin: GPIO0 + data_pin: GPIO2 load_pin: GPIO15 clock_inhibit_pin: GPIO16 diff --git a/tests/components/sn74hc595/common.yaml b/tests/components/sn74hc595/common.yaml index fc297909f5..3892c0564b 100644 --- a/tests/components/sn74hc595/common.yaml +++ b/tests/components/sn74hc595/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_sn74hc595 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sn74hc595: - id: sn74hc595_hub clock_pin: ${clock_pin} diff --git a/tests/components/sn74hc595/test.esp32-c3-idf.yaml b/tests/components/sn74hc595/test.esp32-c3-idf.yaml index 14c928be88..74b5e855fa 100644 --- a/tests/components/sn74hc595/test.esp32-c3-idf.yaml +++ b/tests/components/sn74hc595/test.esp32-c3-idf.yaml @@ -1,9 +1,9 @@ +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml + substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO8 - clock_pin: GPIO5 - data_pin: GPIO4 + clock_pin: GPIO7 + data_pin: GPIO10 latch_pin1: GPIO1 oe_pin1: GPIO2 latch_pin2: GPIO3 diff --git a/tests/components/sn74hc595/test.esp32-idf.yaml b/tests/components/sn74hc595/test.esp32-idf.yaml index a4bab64862..4b47d2aeaa 100644 --- a/tests/components/sn74hc595/test.esp32-idf.yaml +++ b/tests/components/sn74hc595/test.esp32-idf.yaml @@ -1,12 +1,12 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO18 clock_pin: GPIO15 data_pin: GPIO14 latch_pin1: GPIO21 oe_pin1: GPIO22 - latch_pin2: GPIO23 - oe_pin2: GPIO25 + latch_pin2: GPIO25 + oe_pin2: GPIO26 + +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sn74hc595/test.esp8266-ard.yaml b/tests/components/sn74hc595/test.esp8266-ard.yaml index cad11feca8..cc011e01d4 100644 --- a/tests/components/sn74hc595/test.esp8266-ard.yaml +++ b/tests/components/sn74hc595/test.esp8266-ard.yaml @@ -1,7 +1,7 @@ +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 clock_pin: GPIO5 data_pin: GPIO4 latch_pin1: GPIO2 diff --git a/tests/components/sn74hc595/test.rp2040-ard.yaml b/tests/components/sn74hc595/test.rp2040-ard.yaml index 14c928be88..93cf5efb0c 100644 --- a/tests/components/sn74hc595/test.rp2040-ard.yaml +++ b/tests/components/sn74hc595/test.rp2040-ard.yaml @@ -1,12 +1,12 @@ +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO8 clock_pin: GPIO5 - data_pin: GPIO4 + data_pin: GPIO0 latch_pin1: GPIO1 - oe_pin1: GPIO2 - latch_pin2: GPIO3 + oe_pin1: GPIO6 + latch_pin2: GPIO7 oe_pin2: GPIO9 <<: !include common.yaml diff --git a/tests/components/sonoff_d1/common.yaml b/tests/components/sonoff_d1/common.yaml index d2d4043b95..dc08380683 100644 --- a/tests/components/sonoff_d1/common.yaml +++ b/tests/components/sonoff_d1/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_sonoff_d1 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - light: - platform: sonoff_d1 id: d1_light diff --git a/tests/components/sonoff_d1/test.esp32-c3-idf.yaml b/tests/components/sonoff_d1/test.esp32-c3-idf.yaml index b516342f3b..a19013bf54 100644 --- a/tests/components/sonoff_d1/test.esp32-c3-idf.yaml +++ b/tests/components/sonoff_d1/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sonoff_d1/test.esp32-idf.yaml b/tests/components/sonoff_d1/test.esp32-idf.yaml index f486544afa..2d29656c94 100644 --- a/tests/components/sonoff_d1/test.esp32-idf.yaml +++ b/tests/components/sonoff_d1/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sonoff_d1/test.esp8266-ard.yaml b/tests/components/sonoff_d1/test.esp8266-ard.yaml index b516342f3b..5a05efa259 100644 --- a/tests/components/sonoff_d1/test.esp8266-ard.yaml +++ b/tests/components/sonoff_d1/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sonoff_d1/test.rp2040-ard.yaml b/tests/components/sonoff_d1/test.rp2040-ard.yaml index b516342f3b..f1df2daf83 100644 --- a/tests/components/sonoff_d1/test.rp2040-ard.yaml +++ b/tests/components/sonoff_d1/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/sound_level/test.esp32-idf.yaml b/tests/components/sound_level/test.esp32-idf.yaml index c6d1bfa330..20e38e8df8 100644 --- a/tests/components/sound_level/test.esp32-idf.yaml +++ b/tests/components/sound_level/test.esp32-idf.yaml @@ -3,4 +3,7 @@ substitutions: i2s_lrclk_pin: GPIO26 i2s_dout_pin: GPIO27 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/speaker/audio_dac.esp32-ard.yaml b/tests/components/speaker/audio_dac.esp32-ard.yaml index 75d9ddf92b..3f5d1bba7c 100644 --- a/tests/components/speaker/audio_dac.esp32-ard.yaml +++ b/tests/components/speaker/audio_dac.esp32-ard.yaml @@ -1,9 +1,10 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 i2s_bclk_pin: GPIO27 i2s_lrclk_pin: GPIO26 i2s_mclk_pin: GPIO25 i2s_dout_pin: GPIO23 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-ard.yaml + <<: !include common-audio_dac.yaml diff --git a/tests/components/speaker/audio_dac.esp32-c3-idf.yaml b/tests/components/speaker/audio_dac.esp32-c3-idf.yaml index 1004d2143e..30900f1920 100644 --- a/tests/components/speaker/audio_dac.esp32-c3-idf.yaml +++ b/tests/components/speaker/audio_dac.esp32-c3-idf.yaml @@ -1,9 +1,10 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 i2s_bclk_pin: GPIO7 i2s_lrclk_pin: GPIO6 i2s_mclk_pin: GPIO9 i2s_dout_pin: GPIO8 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common-audio_dac.yaml diff --git a/tests/components/speaker/audio_dac.esp32-idf.yaml b/tests/components/speaker/audio_dac.esp32-idf.yaml index 75d9ddf92b..71c8b06e24 100644 --- a/tests/components/speaker/audio_dac.esp32-idf.yaml +++ b/tests/components/speaker/audio_dac.esp32-idf.yaml @@ -1,9 +1,10 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 i2s_bclk_pin: GPIO27 i2s_lrclk_pin: GPIO26 i2s_mclk_pin: GPIO25 i2s_dout_pin: GPIO23 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common-audio_dac.yaml diff --git a/tests/components/speaker/common-audio_dac.yaml b/tests/components/speaker/common-audio_dac.yaml index 41b994d4d4..67bd6c28ef 100644 --- a/tests/components/speaker/common-audio_dac.yaml +++ b/tests/components/speaker/common-audio_dac.yaml @@ -14,11 +14,6 @@ esphome: - speaker.finish: - speaker.stop: -i2c: - - id: i2c_audio_dac - scl: ${scl_pin} - sda: ${sda_pin} - i2s_audio: i2s_lrclk_pin: ${i2s_bclk_pin} i2s_bclk_pin: ${i2s_lrclk_pin} @@ -26,6 +21,7 @@ i2s_audio: audio_dac: - platform: aic3204 + i2c_id: i2c_bus id: internal_dac speaker: diff --git a/tests/components/speaker/test.esp32-ard.yaml b/tests/components/speaker/test.esp32-ard.yaml index e2439ebdf2..13350cd097 100644 --- a/tests/components/speaker/test.esp32-ard.yaml +++ b/tests/components/speaker/test.esp32-ard.yaml @@ -1,9 +1,10 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 i2s_bclk_pin: GPIO27 i2s_lrclk_pin: GPIO26 i2s_mclk_pin: GPIO25 - i2s_dout_pin: GPIO23 + i2s_dout_pin: GPIO4 + +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-ard.yaml <<: !include common.yaml diff --git a/tests/components/speaker/test.esp32-c3-idf.yaml b/tests/components/speaker/test.esp32-c3-idf.yaml index ddcf051fab..9d1a1cca3b 100644 --- a/tests/components/speaker/test.esp32-c3-idf.yaml +++ b/tests/components/speaker/test.esp32-c3-idf.yaml @@ -6,4 +6,7 @@ substitutions: i2s_mclk_pin: GPIO9 i2s_dout_pin: GPIO8 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/speaker/test.esp32-idf.yaml b/tests/components/speaker/test.esp32-idf.yaml index e2439ebdf2..27b8604656 100644 --- a/tests/components/speaker/test.esp32-idf.yaml +++ b/tests/components/speaker/test.esp32-idf.yaml @@ -1,9 +1,10 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 i2s_bclk_pin: GPIO27 i2s_lrclk_pin: GPIO26 i2s_mclk_pin: GPIO25 - i2s_dout_pin: GPIO23 + i2s_dout_pin: GPIO12 + +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/spi/common.yaml b/tests/components/spi/common.yaml index 04b4779957..e69de29bb2 100644 --- a/tests/components/spi/common.yaml +++ b/tests/components/spi/common.yaml @@ -1,5 +0,0 @@ -spi: - - id: spi_spi - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} diff --git a/tests/components/spi/test.esp32-c3-idf.yaml b/tests/components/spi/test.esp32-c3-idf.yaml index bfa12b1755..54463271a9 100644 --- a/tests/components/spi/test.esp32-c3-idf.yaml +++ b/tests/components/spi/test.esp32-c3-idf.yaml @@ -1,6 +1,5 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/spi/test.esp32-idf.yaml b/tests/components/spi/test.esp32-idf.yaml index 448e54fea6..a8e18ca503 100644 --- a/tests/components/spi/test.esp32-idf.yaml +++ b/tests/components/spi/test.esp32-idf.yaml @@ -1,6 +1,4 @@ -substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/spi/test.esp8266-ard.yaml b/tests/components/spi/test.esp8266-ard.yaml index b9545d4f6a..4f9c816740 100644 --- a/tests/components/spi/test.esp8266-ard.yaml +++ b/tests/components/spi/test.esp8266-ard.yaml @@ -1,6 +1,6 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO15 <<: !include common.yaml diff --git a/tests/components/spi_device/common.yaml b/tests/components/spi_device/common.yaml index 0f6a5038fb..8511603bc2 100644 --- a/tests/components/spi_device/common.yaml +++ b/tests/components/spi_device/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_device1 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - spi_device: - id: spi_device_test data_rate: 2MHz diff --git a/tests/components/spi_device/test.esp32-c3-idf.yaml b/tests/components/spi_device/test.esp32-c3-idf.yaml index bfa12b1755..6d64c2b23b 100644 --- a/tests/components/spi_device/test.esp32-c3-idf.yaml +++ b/tests/components/spi_device/test.esp32-c3-idf.yaml @@ -1,6 +1,4 @@ -substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/spi_device/test.esp32-idf.yaml b/tests/components/spi_device/test.esp32-idf.yaml index c4989cccbf..aace9192b1 100644 --- a/tests/components/spi_device/test.esp32-idf.yaml +++ b/tests/components/spi_device/test.esp32-idf.yaml @@ -1,7 +1,5 @@ -substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 - miso_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml <<: !include common.yaml spi_device: diff --git a/tests/components/spi_device/test.esp8266-ard.yaml b/tests/components/spi_device/test.esp8266-ard.yaml index b9545d4f6a..433a931284 100644 --- a/tests/components/spi_device/test.esp8266-ard.yaml +++ b/tests/components/spi_device/test.esp8266-ard.yaml @@ -1,6 +1,4 @@ -substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/spi_device/test.rp2040-ard.yaml b/tests/components/spi_device/test.rp2040-ard.yaml index 81a8acafd8..149d530753 100644 --- a/tests/components/spi_device/test.rp2040-ard.yaml +++ b/tests/components/spi_device/test.rp2040-ard.yaml @@ -1,6 +1,4 @@ -substitutions: - clk_pin: GPIO2 - mosi_pin: GPIO3 - miso_pin: GPIO4 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/spi_led_strip/common.yaml b/tests/components/spi_led_strip/common.yaml index 80b98a63a4..30e2ef22f7 100644 --- a/tests/components/spi_led_strip/common.yaml +++ b/tests/components/spi_led_strip/common.yaml @@ -1,8 +1,3 @@ -spi: - - id: spi_spi_led_strip - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - light: - platform: spi_led_strip num_leds: 4 diff --git a/tests/components/spi_led_strip/test.esp32-c3-idf.yaml b/tests/components/spi_led_strip/test.esp32-c3-idf.yaml index a85b587070..6d64c2b23b 100644 --- a/tests/components/spi_led_strip/test.esp32-c3-idf.yaml +++ b/tests/components/spi_led_strip/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/spi_led_strip/test.esp32-idf.yaml b/tests/components/spi_led_strip/test.esp32-idf.yaml index 8906602ef4..a8e18ca503 100644 --- a/tests/components/spi_led_strip/test.esp32-idf.yaml +++ b/tests/components/spi_led_strip/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/spi_led_strip/test.esp8266-ard.yaml b/tests/components/spi_led_strip/test.esp8266-ard.yaml index 7baaa62ed5..433a931284 100644 --- a/tests/components/spi_led_strip/test.esp8266-ard.yaml +++ b/tests/components/spi_led_strip/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/spi_led_strip/test.rp2040-ard.yaml b/tests/components/spi_led_strip/test.rp2040-ard.yaml index 411cfbe00e..149d530753 100644 --- a/tests/components/spi_led_strip/test.rp2040-ard.yaml +++ b/tests/components/spi_led_strip/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - clk_pin: GPIO2 - mosi_pin: GPIO3 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/sps30/common.yaml b/tests/components/sps30/common.yaml index 2fbe2c747a..d40cd16b6d 100644 --- a/tests/components/sps30/common.yaml +++ b/tests/components/sps30/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_sps30 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: sps30 + i2c_id: i2c_bus pm_1_0: name: Workshop PM <1µm Weight concentration id: workshop_PM_1_0 diff --git a/tests/components/sps30/test.esp32-c3-idf.yaml b/tests/components/sps30/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/sps30/test.esp32-c3-idf.yaml +++ b/tests/components/sps30/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sps30/test.esp32-idf.yaml b/tests/components/sps30/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/sps30/test.esp32-idf.yaml +++ b/tests/components/sps30/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sps30/test.esp8266-ard.yaml b/tests/components/sps30/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/sps30/test.esp8266-ard.yaml +++ b/tests/components/sps30/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sps30/test.rp2040-ard.yaml b/tests/components/sps30/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/sps30/test.rp2040-ard.yaml +++ b/tests/components/sps30/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ssd1306_i2c/common.yaml b/tests/components/ssd1306_i2c/common.yaml index d17f83f03a..e876fcb36a 100644 --- a/tests/components/ssd1306_i2c/common.yaml +++ b/tests/components/ssd1306_i2c/common.yaml @@ -1,25 +1,21 @@ -i2c: - - id: i2c_ssd1306_i2c - scl: ${scl_pin} - sda: ${sda_pin} - display: - platform: ssd1306_i2c + i2c_id: i2c_bus model: SSD1306_128X64 reset_pin: ${reset_pin} address: 0x3C id: display1 contrast: 60% pages: - - id: page1 + - id: ssd1306_i2c_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - - id: page2 + - id: ssd1306_i2c_page2 lambda: |- it.rectangle(0, 0, 10, 10); on_page_change: - from: page1 - to: page2 + from: ssd1306_i2c_page1 + to: ssd1306_i2c_page2 then: lambda: |- ESP_LOGD("display", "1 -> 2"); diff --git a/tests/components/ssd1306_i2c/test.esp32-c3-idf.yaml b/tests/components/ssd1306_i2c/test.esp32-c3-idf.yaml index 4eaff7fa4a..f8bfab2319 100644 --- a/tests/components/ssd1306_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/ssd1306_i2c/test.esp32-c3-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO3 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1306_i2c/test.esp32-idf.yaml b/tests/components/ssd1306_i2c/test.esp32-idf.yaml index 1ca773e06c..4ff2241ec9 100644 --- a/tests/components/ssd1306_i2c/test.esp32-idf.yaml +++ b/tests/components/ssd1306_i2c/test.esp32-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 reset_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1306_i2c/test.esp8266-ard.yaml b/tests/components/ssd1306_i2c/test.esp8266-ard.yaml index af91c21a0d..352cc8cda8 100644 --- a/tests/components/ssd1306_i2c/test.esp8266-ard.yaml +++ b/tests/components/ssd1306_i2c/test.esp8266-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO2 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1306_i2c/test.rp2040-ard.yaml b/tests/components/ssd1306_i2c/test.rp2040-ard.yaml index 4eaff7fa4a..2972fde8a5 100644 --- a/tests/components/ssd1306_i2c/test.rp2040-ard.yaml +++ b/tests/components/ssd1306_i2c/test.rp2040-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO3 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1306_spi/common.yaml b/tests/components/ssd1306_spi/common.yaml index 71705f32d2..2a2adb4146 100644 --- a/tests/components/ssd1306_spi/common.yaml +++ b/tests/components/ssd1306_spi/common.yaml @@ -1,8 +1,3 @@ -spi: - - id: spi_ssd1306_spi - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - display: - platform: ssd1306_spi model: SSD1306 128x64 @@ -10,15 +5,15 @@ display: dc_pin: ${dc_pin} reset_pin: ${reset_pin} pages: - - id: page1 + - id: ssd1306_spi_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - - id: page2 + - id: ssd1306_spi_page2 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); on_page_change: - from: page1 - to: page2 + from: ssd1306_spi_page1 + to: ssd1306_spi_page2 then: lambda: |- ESP_LOGD("display", "1 -> 2"); diff --git a/tests/components/ssd1306_spi/test.esp32-c3-idf.yaml b/tests/components/ssd1306_spi/test.esp32-c3-idf.yaml index c5c932c92c..b112cf4c31 100644 --- a/tests/components/ssd1306_spi/test.esp32-c3-idf.yaml +++ b/tests/components/ssd1306_spi/test.esp32-c3-idf.yaml @@ -1,9 +1,8 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 dc_pin: GPIO9 reset_pin: GPIO10 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ssd1306_spi/test.esp32-idf.yaml b/tests/components/ssd1306_spi/test.esp32-idf.yaml index bad5241f79..ff174a4656 100644 --- a/tests/components/ssd1306_spi/test.esp32-idf.yaml +++ b/tests/components/ssd1306_spi/test.esp32-idf.yaml @@ -1,8 +1,9 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 cs_pin: GPIO12 dc_pin: GPIO13 reset_pin: GPIO14 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1306_spi/test.esp8266-ard.yaml b/tests/components/ssd1306_spi/test.esp8266-ard.yaml index 3f023a60eb..56cb29f29e 100644 --- a/tests/components/ssd1306_spi/test.esp8266-ard.yaml +++ b/tests/components/ssd1306_spi/test.esp8266-ard.yaml @@ -1,9 +1,12 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 + clk_pin: GPIO0 + mosi_pin: GPIO2 miso_pin: GPIO12 cs_pin: GPIO5 dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1306_spi/test.rp2040-ard.yaml b/tests/components/ssd1306_spi/test.rp2040-ard.yaml index d7fd6ee294..66caa956f7 100644 --- a/tests/components/ssd1306_spi/test.rp2040-ard.yaml +++ b/tests/components/ssd1306_spi/test.rp2040-ard.yaml @@ -6,4 +6,7 @@ substitutions: dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1322_spi/common.yaml b/tests/components/ssd1322_spi/common.yaml index b67392794c..c0e16b6f09 100644 --- a/tests/components/ssd1322_spi/common.yaml +++ b/tests/components/ssd1322_spi/common.yaml @@ -1,8 +1,3 @@ -spi: - - id: spi_ssd1322_spi - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - display: - platform: ssd1322_spi model: SSD1322 256x64 @@ -10,15 +5,15 @@ display: dc_pin: ${dc_pin} reset_pin: ${reset_pin} pages: - - id: page1 + - id: ssd1322_spi_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - - id: page2 + - id: ssd1322_spi_page2 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); on_page_change: - from: page1 - to: page2 + from: ssd1322_spi_page1 + to: ssd1322_spi_page2 then: lambda: |- ESP_LOGD("display", "1 -> 2"); diff --git a/tests/components/ssd1322_spi/test.esp32-c3-idf.yaml b/tests/components/ssd1322_spi/test.esp32-c3-idf.yaml index c5c932c92c..b112cf4c31 100644 --- a/tests/components/ssd1322_spi/test.esp32-c3-idf.yaml +++ b/tests/components/ssd1322_spi/test.esp32-c3-idf.yaml @@ -1,9 +1,8 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 dc_pin: GPIO9 reset_pin: GPIO10 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ssd1322_spi/test.esp32-idf.yaml b/tests/components/ssd1322_spi/test.esp32-idf.yaml index bad5241f79..ff174a4656 100644 --- a/tests/components/ssd1322_spi/test.esp32-idf.yaml +++ b/tests/components/ssd1322_spi/test.esp32-idf.yaml @@ -1,8 +1,9 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 cs_pin: GPIO12 dc_pin: GPIO13 reset_pin: GPIO14 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1322_spi/test.esp8266-ard.yaml b/tests/components/ssd1322_spi/test.esp8266-ard.yaml index 3f023a60eb..56cb29f29e 100644 --- a/tests/components/ssd1322_spi/test.esp8266-ard.yaml +++ b/tests/components/ssd1322_spi/test.esp8266-ard.yaml @@ -1,9 +1,12 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 + clk_pin: GPIO0 + mosi_pin: GPIO2 miso_pin: GPIO12 cs_pin: GPIO5 dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1322_spi/test.rp2040-ard.yaml b/tests/components/ssd1322_spi/test.rp2040-ard.yaml index d7fd6ee294..66caa956f7 100644 --- a/tests/components/ssd1322_spi/test.rp2040-ard.yaml +++ b/tests/components/ssd1322_spi/test.rp2040-ard.yaml @@ -6,4 +6,7 @@ substitutions: dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1325_spi/common.yaml b/tests/components/ssd1325_spi/common.yaml index eaa8b619ca..dea8502538 100644 --- a/tests/components/ssd1325_spi/common.yaml +++ b/tests/components/ssd1325_spi/common.yaml @@ -1,8 +1,3 @@ -spi: - - id: spi_ssd1325_spi - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - display: - platform: ssd1325_spi model: SSD1325 128x64 @@ -10,15 +5,15 @@ display: dc_pin: ${dc_pin} reset_pin: ${reset_pin} pages: - - id: page1 + - id: ssd1325_spi_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - - id: page2 + - id: ssd1325_spi_page2 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); on_page_change: - from: page1 - to: page2 + from: ssd1325_spi_page1 + to: ssd1325_spi_page2 then: lambda: |- ESP_LOGD("display", "1 -> 2"); diff --git a/tests/components/ssd1325_spi/test.esp32-c3-idf.yaml b/tests/components/ssd1325_spi/test.esp32-c3-idf.yaml index c5c932c92c..b112cf4c31 100644 --- a/tests/components/ssd1325_spi/test.esp32-c3-idf.yaml +++ b/tests/components/ssd1325_spi/test.esp32-c3-idf.yaml @@ -1,9 +1,8 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 dc_pin: GPIO9 reset_pin: GPIO10 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ssd1325_spi/test.esp32-idf.yaml b/tests/components/ssd1325_spi/test.esp32-idf.yaml index bad5241f79..ff174a4656 100644 --- a/tests/components/ssd1325_spi/test.esp32-idf.yaml +++ b/tests/components/ssd1325_spi/test.esp32-idf.yaml @@ -1,8 +1,9 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 cs_pin: GPIO12 dc_pin: GPIO13 reset_pin: GPIO14 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1325_spi/test.esp8266-ard.yaml b/tests/components/ssd1325_spi/test.esp8266-ard.yaml index 3f023a60eb..56cb29f29e 100644 --- a/tests/components/ssd1325_spi/test.esp8266-ard.yaml +++ b/tests/components/ssd1325_spi/test.esp8266-ard.yaml @@ -1,9 +1,12 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 + clk_pin: GPIO0 + mosi_pin: GPIO2 miso_pin: GPIO12 cs_pin: GPIO5 dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1325_spi/test.rp2040-ard.yaml b/tests/components/ssd1325_spi/test.rp2040-ard.yaml index d7fd6ee294..66caa956f7 100644 --- a/tests/components/ssd1325_spi/test.rp2040-ard.yaml +++ b/tests/components/ssd1325_spi/test.rp2040-ard.yaml @@ -6,4 +6,7 @@ substitutions: dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1327_i2c/common.yaml b/tests/components/ssd1327_i2c/common.yaml index 72a122c3d7..c90e9678dd 100644 --- a/tests/components/ssd1327_i2c/common.yaml +++ b/tests/components/ssd1327_i2c/common.yaml @@ -1,24 +1,20 @@ -i2c: - - id: i2c_ssd1327_i2c - scl: ${scl_pin} - sda: ${sda_pin} - display: - platform: ssd1327_i2c + i2c_id: i2c_bus model: SSD1327_128x128 reset_pin: ${reset_pin} address: 0x3C id: display1 pages: - - id: page1 + - id: ssd1327_i2c_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - - id: page2 + - id: ssd1327_i2c_page2 lambda: |- it.rectangle(0, 0, 10, 10); on_page_change: - from: page1 - to: page2 + from: ssd1327_i2c_page1 + to: ssd1327_i2c_page2 then: lambda: |- ESP_LOGD("display", "1 -> 2"); diff --git a/tests/components/ssd1327_i2c/test.esp32-c3-idf.yaml b/tests/components/ssd1327_i2c/test.esp32-c3-idf.yaml index 4eaff7fa4a..f8bfab2319 100644 --- a/tests/components/ssd1327_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/ssd1327_i2c/test.esp32-c3-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO3 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1327_i2c/test.esp32-idf.yaml b/tests/components/ssd1327_i2c/test.esp32-idf.yaml index 1ca773e06c..4ff2241ec9 100644 --- a/tests/components/ssd1327_i2c/test.esp32-idf.yaml +++ b/tests/components/ssd1327_i2c/test.esp32-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 reset_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1327_i2c/test.esp8266-ard.yaml b/tests/components/ssd1327_i2c/test.esp8266-ard.yaml index af91c21a0d..352cc8cda8 100644 --- a/tests/components/ssd1327_i2c/test.esp8266-ard.yaml +++ b/tests/components/ssd1327_i2c/test.esp8266-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO2 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1327_i2c/test.rp2040-ard.yaml b/tests/components/ssd1327_i2c/test.rp2040-ard.yaml index 4eaff7fa4a..2972fde8a5 100644 --- a/tests/components/ssd1327_i2c/test.rp2040-ard.yaml +++ b/tests/components/ssd1327_i2c/test.rp2040-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO3 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1327_spi/common.yaml b/tests/components/ssd1327_spi/common.yaml index 85f4d4736b..1aa4fb5a1c 100644 --- a/tests/components/ssd1327_spi/common.yaml +++ b/tests/components/ssd1327_spi/common.yaml @@ -1,8 +1,3 @@ -spi: - - id: spi_ssd1327_spi - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - display: - platform: ssd1327_spi model: SSD1327 128x128 @@ -10,15 +5,15 @@ display: dc_pin: ${dc_pin} reset_pin: ${reset_pin} pages: - - id: page1 + - id: ssd1327_spi_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - - id: page2 + - id: ssd1327_spi_page2 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); on_page_change: - from: page1 - to: page2 + from: ssd1327_spi_page1 + to: ssd1327_spi_page2 then: lambda: |- ESP_LOGD("display", "1 -> 2"); diff --git a/tests/components/ssd1327_spi/test.esp32-c3-idf.yaml b/tests/components/ssd1327_spi/test.esp32-c3-idf.yaml index c5c932c92c..b112cf4c31 100644 --- a/tests/components/ssd1327_spi/test.esp32-c3-idf.yaml +++ b/tests/components/ssd1327_spi/test.esp32-c3-idf.yaml @@ -1,9 +1,8 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 dc_pin: GPIO9 reset_pin: GPIO10 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ssd1327_spi/test.esp32-idf.yaml b/tests/components/ssd1327_spi/test.esp32-idf.yaml index bad5241f79..ff174a4656 100644 --- a/tests/components/ssd1327_spi/test.esp32-idf.yaml +++ b/tests/components/ssd1327_spi/test.esp32-idf.yaml @@ -1,8 +1,9 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 cs_pin: GPIO12 dc_pin: GPIO13 reset_pin: GPIO14 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1327_spi/test.esp8266-ard.yaml b/tests/components/ssd1327_spi/test.esp8266-ard.yaml index 3f023a60eb..56cb29f29e 100644 --- a/tests/components/ssd1327_spi/test.esp8266-ard.yaml +++ b/tests/components/ssd1327_spi/test.esp8266-ard.yaml @@ -1,9 +1,12 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 + clk_pin: GPIO0 + mosi_pin: GPIO2 miso_pin: GPIO12 cs_pin: GPIO5 dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1327_spi/test.rp2040-ard.yaml b/tests/components/ssd1327_spi/test.rp2040-ard.yaml index d7fd6ee294..66caa956f7 100644 --- a/tests/components/ssd1327_spi/test.rp2040-ard.yaml +++ b/tests/components/ssd1327_spi/test.rp2040-ard.yaml @@ -6,4 +6,7 @@ substitutions: dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1331_spi/common.yaml b/tests/components/ssd1331_spi/common.yaml index 40726101e8..2b708e9bd9 100644 --- a/tests/components/ssd1331_spi/common.yaml +++ b/tests/components/ssd1331_spi/common.yaml @@ -1,23 +1,18 @@ -spi: - - id: spi_ssd1331_spi - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - display: - platform: ssd1331_spi cs_pin: ${cs_pin} dc_pin: ${dc_pin} reset_pin: ${reset_pin} pages: - - id: page1 + - id: ssd1331_spi_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - - id: page2 + - id: ssd1331_spi_page2 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); on_page_change: - from: page1 - to: page2 + from: ssd1331_spi_page1 + to: ssd1331_spi_page2 then: lambda: |- ESP_LOGD("display", "1 -> 2"); diff --git a/tests/components/ssd1331_spi/test.esp32-c3-idf.yaml b/tests/components/ssd1331_spi/test.esp32-c3-idf.yaml index c5c932c92c..b112cf4c31 100644 --- a/tests/components/ssd1331_spi/test.esp32-c3-idf.yaml +++ b/tests/components/ssd1331_spi/test.esp32-c3-idf.yaml @@ -1,9 +1,8 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 dc_pin: GPIO9 reset_pin: GPIO10 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ssd1331_spi/test.esp32-idf.yaml b/tests/components/ssd1331_spi/test.esp32-idf.yaml index bad5241f79..ff174a4656 100644 --- a/tests/components/ssd1331_spi/test.esp32-idf.yaml +++ b/tests/components/ssd1331_spi/test.esp32-idf.yaml @@ -1,8 +1,9 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 cs_pin: GPIO12 dc_pin: GPIO13 reset_pin: GPIO14 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1331_spi/test.esp8266-ard.yaml b/tests/components/ssd1331_spi/test.esp8266-ard.yaml index 3f023a60eb..56cb29f29e 100644 --- a/tests/components/ssd1331_spi/test.esp8266-ard.yaml +++ b/tests/components/ssd1331_spi/test.esp8266-ard.yaml @@ -1,9 +1,12 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 + clk_pin: GPIO0 + mosi_pin: GPIO2 miso_pin: GPIO12 cs_pin: GPIO5 dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1331_spi/test.rp2040-ard.yaml b/tests/components/ssd1331_spi/test.rp2040-ard.yaml index d7fd6ee294..66caa956f7 100644 --- a/tests/components/ssd1331_spi/test.rp2040-ard.yaml +++ b/tests/components/ssd1331_spi/test.rp2040-ard.yaml @@ -6,4 +6,7 @@ substitutions: dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1351_spi/common.yaml b/tests/components/ssd1351_spi/common.yaml index fa495ff0c3..e4d3d55f3f 100644 --- a/tests/components/ssd1351_spi/common.yaml +++ b/tests/components/ssd1351_spi/common.yaml @@ -1,8 +1,3 @@ -spi: - - id: spi_ssd1351_spi - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - display: - platform: ssd1351_spi model: "SSD1351 128x128" @@ -10,15 +5,15 @@ display: dc_pin: ${dc_pin} reset_pin: ${reset_pin} pages: - - id: page1 + - id: ssd1351_spi_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - - id: page2 + - id: ssd1351_spi_page2 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); on_page_change: - from: page1 - to: page2 + from: ssd1351_spi_page1 + to: ssd1351_spi_page2 then: lambda: |- ESP_LOGD("display", "1 -> 2"); diff --git a/tests/components/ssd1351_spi/test.esp32-c3-idf.yaml b/tests/components/ssd1351_spi/test.esp32-c3-idf.yaml index c5c932c92c..b112cf4c31 100644 --- a/tests/components/ssd1351_spi/test.esp32-c3-idf.yaml +++ b/tests/components/ssd1351_spi/test.esp32-c3-idf.yaml @@ -1,9 +1,8 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 dc_pin: GPIO9 reset_pin: GPIO10 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ssd1351_spi/test.esp32-idf.yaml b/tests/components/ssd1351_spi/test.esp32-idf.yaml index bad5241f79..ff174a4656 100644 --- a/tests/components/ssd1351_spi/test.esp32-idf.yaml +++ b/tests/components/ssd1351_spi/test.esp32-idf.yaml @@ -1,8 +1,9 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 cs_pin: GPIO12 dc_pin: GPIO13 reset_pin: GPIO14 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1351_spi/test.esp8266-ard.yaml b/tests/components/ssd1351_spi/test.esp8266-ard.yaml index 3f023a60eb..56cb29f29e 100644 --- a/tests/components/ssd1351_spi/test.esp8266-ard.yaml +++ b/tests/components/ssd1351_spi/test.esp8266-ard.yaml @@ -1,9 +1,12 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 + clk_pin: GPIO0 + mosi_pin: GPIO2 miso_pin: GPIO12 cs_pin: GPIO5 dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ssd1351_spi/test.rp2040-ard.yaml b/tests/components/ssd1351_spi/test.rp2040-ard.yaml index d7fd6ee294..66caa956f7 100644 --- a/tests/components/ssd1351_spi/test.rp2040-ard.yaml +++ b/tests/components/ssd1351_spi/test.rp2040-ard.yaml @@ -6,4 +6,7 @@ substitutions: dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/st7567_i2c/common.yaml b/tests/components/st7567_i2c/common.yaml index 41c65e5110..9a4cd79faa 100644 --- a/tests/components/st7567_i2c/common.yaml +++ b/tests/components/st7567_i2c/common.yaml @@ -1,23 +1,19 @@ -i2c: - - id: i2c_st7567_i2c - scl: ${scl_pin} - sda: ${sda_pin} - display: - platform: st7567_i2c + i2c_id: i2c_bus reset_pin: ${reset_pin} address: 0x3C id: display1 pages: - - id: page1 + - id: st7567_i2c_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - - id: page2 + - id: st7567_i2c_page2 lambda: |- it.rectangle(0, 0, 10, 10); on_page_change: - from: page1 - to: page2 + from: st7567_i2c_page1 + to: st7567_i2c_page2 then: lambda: |- ESP_LOGD("display", "1 -> 2"); diff --git a/tests/components/st7567_i2c/test.esp32-c3-idf.yaml b/tests/components/st7567_i2c/test.esp32-c3-idf.yaml index 4eaff7fa4a..f8bfab2319 100644 --- a/tests/components/st7567_i2c/test.esp32-c3-idf.yaml +++ b/tests/components/st7567_i2c/test.esp32-c3-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO3 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/st7567_i2c/test.esp32-idf.yaml b/tests/components/st7567_i2c/test.esp32-idf.yaml index 1ca773e06c..4ff2241ec9 100644 --- a/tests/components/st7567_i2c/test.esp32-idf.yaml +++ b/tests/components/st7567_i2c/test.esp32-idf.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 reset_pin: GPIO15 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/st7567_i2c/test.esp8266-ard.yaml b/tests/components/st7567_i2c/test.esp8266-ard.yaml index af91c21a0d..352cc8cda8 100644 --- a/tests/components/st7567_i2c/test.esp8266-ard.yaml +++ b/tests/components/st7567_i2c/test.esp8266-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO2 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/st7567_i2c/test.rp2040-ard.yaml b/tests/components/st7567_i2c/test.rp2040-ard.yaml index 4eaff7fa4a..2972fde8a5 100644 --- a/tests/components/st7567_i2c/test.rp2040-ard.yaml +++ b/tests/components/st7567_i2c/test.rp2040-ard.yaml @@ -1,6 +1,7 @@ substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 reset_pin: GPIO3 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/st7567_spi/common.yaml b/tests/components/st7567_spi/common.yaml index 037a700239..b5a4074e13 100644 --- a/tests/components/st7567_spi/common.yaml +++ b/tests/components/st7567_spi/common.yaml @@ -1,23 +1,18 @@ -spi: - - id: spi_st7567_spi - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - display: - platform: st7567_spi cs_pin: ${cs_pin} dc_pin: ${dc_pin} reset_pin: ${reset_pin} pages: - - id: page1 + - id: st7567_spi_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - - id: page2 + - id: st7567_spi_page2 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); on_page_change: - from: page1 - to: page2 + from: st7567_spi_page1 + to: st7567_spi_page2 then: lambda: |- ESP_LOGD("display", "1 -> 2"); diff --git a/tests/components/st7567_spi/test.esp32-c3-idf.yaml b/tests/components/st7567_spi/test.esp32-c3-idf.yaml index c5c932c92c..b112cf4c31 100644 --- a/tests/components/st7567_spi/test.esp32-c3-idf.yaml +++ b/tests/components/st7567_spi/test.esp32-c3-idf.yaml @@ -1,9 +1,8 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 dc_pin: GPIO9 reset_pin: GPIO10 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/st7567_spi/test.esp32-idf.yaml b/tests/components/st7567_spi/test.esp32-idf.yaml index bad5241f79..ff174a4656 100644 --- a/tests/components/st7567_spi/test.esp32-idf.yaml +++ b/tests/components/st7567_spi/test.esp32-idf.yaml @@ -1,8 +1,9 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 cs_pin: GPIO12 dc_pin: GPIO13 reset_pin: GPIO14 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/st7567_spi/test.esp8266-ard.yaml b/tests/components/st7567_spi/test.esp8266-ard.yaml index 3f023a60eb..56cb29f29e 100644 --- a/tests/components/st7567_spi/test.esp8266-ard.yaml +++ b/tests/components/st7567_spi/test.esp8266-ard.yaml @@ -1,9 +1,12 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 + clk_pin: GPIO0 + mosi_pin: GPIO2 miso_pin: GPIO12 cs_pin: GPIO5 dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/st7567_spi/test.rp2040-ard.yaml b/tests/components/st7567_spi/test.rp2040-ard.yaml index d7fd6ee294..66caa956f7 100644 --- a/tests/components/st7567_spi/test.rp2040-ard.yaml +++ b/tests/components/st7567_spi/test.rp2040-ard.yaml @@ -6,4 +6,7 @@ substitutions: dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/st7701s/common.yaml b/tests/components/st7701s/common.yaml index b94fadfe52..751862dea5 100644 --- a/tests/components/st7701s/common.yaml +++ b/tests/components/st7701s/common.yaml @@ -1,8 +1,3 @@ -spi: - - id: spi_st7701s - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - display: - platform: st7701s spi_mode: MODE3 diff --git a/tests/components/st7701s/test.esp32-s3-idf.yaml b/tests/components/st7701s/test.esp32-s3-idf.yaml index cd09b31f6e..87e5248888 100644 --- a/tests/components/st7701s/test.esp32-s3-idf.yaml +++ b/tests/components/st7701s/test.esp32-s3-idf.yaml @@ -1,5 +1,7 @@ +packages: + spi: !include ../../test_build_components/common/spi/esp32-s3-idf.yaml + substitutions: - clk_pin: GPIO41 mosi_pin: GPIO48 cs_pin: GPIO44 de_pin: GPIO18 diff --git a/tests/components/st7735/common.yaml b/tests/components/st7735/common.yaml index c140652eda..242c4bccd6 100644 --- a/tests/components/st7735/common.yaml +++ b/tests/components/st7735/common.yaml @@ -1,8 +1,3 @@ -spi: - - id: spi_st7735 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - display: - platform: st7735 model: INITR_18BLACKTAB @@ -14,15 +9,15 @@ display: col_start: 0 row_start: 0 pages: - - id: page1 + - id: st7735_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - - id: page2 + - id: st7735_page2 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); on_page_change: - from: page1 - to: page2 + from: st7735_page1 + to: st7735_page2 then: lambda: |- ESP_LOGD("display", "1 -> 2"); diff --git a/tests/components/st7735/test.esp32-c3-idf.yaml b/tests/components/st7735/test.esp32-c3-idf.yaml index c5c932c92c..b112cf4c31 100644 --- a/tests/components/st7735/test.esp32-c3-idf.yaml +++ b/tests/components/st7735/test.esp32-c3-idf.yaml @@ -1,9 +1,8 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 dc_pin: GPIO9 reset_pin: GPIO10 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/st7735/test.esp32-idf.yaml b/tests/components/st7735/test.esp32-idf.yaml index bad5241f79..ff174a4656 100644 --- a/tests/components/st7735/test.esp32-idf.yaml +++ b/tests/components/st7735/test.esp32-idf.yaml @@ -1,8 +1,9 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 cs_pin: GPIO12 dc_pin: GPIO13 reset_pin: GPIO14 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/st7735/test.esp8266-ard.yaml b/tests/components/st7735/test.esp8266-ard.yaml index 3f023a60eb..56cb29f29e 100644 --- a/tests/components/st7735/test.esp8266-ard.yaml +++ b/tests/components/st7735/test.esp8266-ard.yaml @@ -1,9 +1,12 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 + clk_pin: GPIO0 + mosi_pin: GPIO2 miso_pin: GPIO12 cs_pin: GPIO5 dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/st7735/test.rp2040-ard.yaml b/tests/components/st7735/test.rp2040-ard.yaml index d7fd6ee294..66caa956f7 100644 --- a/tests/components/st7735/test.rp2040-ard.yaml +++ b/tests/components/st7735/test.rp2040-ard.yaml @@ -6,4 +6,7 @@ substitutions: dc_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/st7789v/common.yaml b/tests/components/st7789v/common.yaml index d5f74809e0..19cef5656a 100644 --- a/tests/components/st7789v/common.yaml +++ b/tests/components/st7789v/common.yaml @@ -1,24 +1,20 @@ -spi: - - id: spi_st7789v - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - display: - platform: st7789v model: TTGO TDisplay 135x240 cs_pin: ${cs_pin} dc_pin: ${dc_pin} reset_pin: ${reset_pin} + backlight_pin: ${backlight_pin} pages: - - id: page1 + - id: st7789v_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - - id: page2 + - id: st7789v_page2 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); on_page_change: - from: page1 - to: page2 + from: st7789v_page1 + to: st7789v_page2 then: lambda: |- ESP_LOGD("display", "1 -> 2"); diff --git a/tests/components/st7789v/test.esp32-c3-idf.yaml b/tests/components/st7789v/test.esp32-c3-idf.yaml index c5c932c92c..b4d70edb31 100644 --- a/tests/components/st7789v/test.esp32-c3-idf.yaml +++ b/tests/components/st7789v/test.esp32-c3-idf.yaml @@ -1,9 +1,10 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 dc_pin: GPIO9 reset_pin: GPIO10 + backlight_pin: GPIO7 + +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/st7789v/test.esp32-idf.yaml b/tests/components/st7789v/test.esp32-idf.yaml index bad5241f79..3b6d584e5c 100644 --- a/tests/components/st7789v/test.esp32-idf.yaml +++ b/tests/components/st7789v/test.esp32-idf.yaml @@ -1,8 +1,10 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 cs_pin: GPIO12 dc_pin: GPIO13 reset_pin: GPIO14 + backlight_pin: GPIO15 + +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/st7789v/test.esp8266-ard.yaml b/tests/components/st7789v/test.esp8266-ard.yaml index 3f023a60eb..0ddca66ef4 100644 --- a/tests/components/st7789v/test.esp8266-ard.yaml +++ b/tests/components/st7789v/test.esp8266-ard.yaml @@ -1,9 +1,13 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 + clk_pin: GPIO0 + mosi_pin: GPIO2 miso_pin: GPIO12 cs_pin: GPIO5 dc_pin: GPIO15 reset_pin: GPIO16 + backlight_pin: GPIO4 + +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/st7789v/test.rp2040-ard.yaml b/tests/components/st7789v/test.rp2040-ard.yaml index d7fd6ee294..464e720549 100644 --- a/tests/components/st7789v/test.rp2040-ard.yaml +++ b/tests/components/st7789v/test.rp2040-ard.yaml @@ -5,5 +5,9 @@ substitutions: cs_pin: GPIO5 dc_pin: GPIO15 reset_pin: GPIO16 + backlight_pin: GPIO6 + +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/st7920/common.yaml b/tests/components/st7920/common.yaml index 9ede271f01..477ac14bd4 100644 --- a/tests/components/st7920/common.yaml +++ b/tests/components/st7920/common.yaml @@ -1,23 +1,18 @@ -spi: - - id: spi_st7920 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - display: - platform: st7920 cs_pin: ${cs_pin} height: 128 width: 64 pages: - - id: page1 + - id: st7920_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); - - id: page2 + - id: st7920_page2 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); on_page_change: - from: page1 - to: page2 + from: st7920_page1 + to: st7920_page2 then: lambda: |- ESP_LOGD("display", "1 -> 2"); diff --git a/tests/components/st7920/test.esp32-c3-idf.yaml b/tests/components/st7920/test.esp32-c3-idf.yaml index 2415ba5dc6..15d986e157 100644 --- a/tests/components/st7920/test.esp32-c3-idf.yaml +++ b/tests/components/st7920/test.esp32-c3-idf.yaml @@ -1,7 +1,6 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - miso_pin: GPIO5 cs_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/st7920/test.esp32-idf.yaml b/tests/components/st7920/test.esp32-idf.yaml index 04d2633d2b..9bb524aa65 100644 --- a/tests/components/st7920/test.esp32-idf.yaml +++ b/tests/components/st7920/test.esp32-idf.yaml @@ -1,6 +1,7 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 cs_pin: GPIO12 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/st7920/test.esp8266-ard.yaml b/tests/components/st7920/test.esp8266-ard.yaml index bd5c203e35..1aac800592 100644 --- a/tests/components/st7920/test.esp8266-ard.yaml +++ b/tests/components/st7920/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 - miso_pin: GPIO12 - cs_pin: GPIO5 + clk_pin: GPIO0 + mosi_pin: GPIO2 + miso_pin: GPIO15 + cs_pin: GPIO16 + +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/st7920/test.rp2040-ard.yaml b/tests/components/st7920/test.rp2040-ard.yaml index f6c3f1eeca..1ded24de1c 100644 --- a/tests/components/st7920/test.rp2040-ard.yaml +++ b/tests/components/st7920/test.rp2040-ard.yaml @@ -4,4 +4,7 @@ substitutions: miso_pin: GPIO4 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/sts3x/common.yaml b/tests/components/sts3x/common.yaml index 1feac4bc3f..1a61fa9212 100644 --- a/tests/components/sts3x/common.yaml +++ b/tests/components/sts3x/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_sts3x - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: sts3x + i2c_id: i2c_bus id: sts3x_sensor name: STS3X Temperature address: 0x4A diff --git a/tests/components/sts3x/test.esp32-c3-idf.yaml b/tests/components/sts3x/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/sts3x/test.esp32-c3-idf.yaml +++ b/tests/components/sts3x/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sts3x/test.esp32-idf.yaml b/tests/components/sts3x/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/sts3x/test.esp32-idf.yaml +++ b/tests/components/sts3x/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sts3x/test.esp8266-ard.yaml b/tests/components/sts3x/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/sts3x/test.esp8266-ard.yaml +++ b/tests/components/sts3x/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sts3x/test.rp2040-ard.yaml b/tests/components/sts3x/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/sts3x/test.rp2040-ard.yaml +++ b/tests/components/sts3x/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/sun_gtil2/common.yaml b/tests/components/sun_gtil2/common.yaml index 15cc892d90..37fd4b056f 100644 --- a/tests/components/sun_gtil2/common.yaml +++ b/tests/components/sun_gtil2/common.yaml @@ -1,8 +1,3 @@ -uart: - - id: uart_sun_gtil2 - rx_pin: ${rx_pin} - baud_rate: 9600 - sun_gtil2: sensor: diff --git a/tests/components/sun_gtil2/test.esp32-c3-idf.yaml b/tests/components/sun_gtil2/test.esp32-c3-idf.yaml index b8a6b85616..4b7c8351a7 100644 --- a/tests/components/sun_gtil2/test.esp32-c3-idf.yaml +++ b/tests/components/sun_gtil2/test.esp32-c3-idf.yaml @@ -1,4 +1,5 @@ substitutions: - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sun_gtil2/test.esp32-idf.yaml b/tests/components/sun_gtil2/test.esp32-idf.yaml index ad420099ff..29c7835b4e 100644 --- a/tests/components/sun_gtil2/test.esp32-idf.yaml +++ b/tests/components/sun_gtil2/test.esp32-idf.yaml @@ -1,4 +1,7 @@ substitutions: - rx_pin: GPIO16 + rx_pin: GPIO4 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sun_gtil2/test.esp8266-ard.yaml b/tests/components/sun_gtil2/test.esp8266-ard.yaml index b8a6b85616..a591df42cb 100644 --- a/tests/components/sun_gtil2/test.esp8266-ard.yaml +++ b/tests/components/sun_gtil2/test.esp8266-ard.yaml @@ -1,4 +1,7 @@ substitutions: - rx_pin: GPIO5 + rx_pin: GPIO0 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sun_gtil2/test.rp2040-ard.yaml b/tests/components/sun_gtil2/test.rp2040-ard.yaml index b8a6b85616..281ea9480e 100644 --- a/tests/components/sun_gtil2/test.rp2040-ard.yaml +++ b/tests/components/sun_gtil2/test.rp2040-ard.yaml @@ -1,4 +1,7 @@ substitutions: rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/sx126x/common.yaml b/tests/components/sx126x/common.yaml index 05db2ef812..3f540a4bae 100644 --- a/tests/components/sx126x/common.yaml +++ b/tests/components/sx126x/common.yaml @@ -1,8 +1,3 @@ -spi: - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sx126x: dio1_pin: ${dio1_pin} cs_pin: ${cs_pin} diff --git a/tests/components/sx126x/test.esp32-c3-idf.yaml b/tests/components/sx126x/test.esp32-c3-idf.yaml index 91450e24ce..e27f11032e 100644 --- a/tests/components/sx126x/test.esp32-c3-idf.yaml +++ b/tests/components/sx126x/test.esp32-c3-idf.yaml @@ -1,10 +1,10 @@ substitutions: - clk_pin: GPIO5 - mosi_pin: GPIO18 - miso_pin: GPIO19 cs_pin: GPIO1 rst_pin: GPIO2 - busy_pin: GPIO4 + busy_pin: GPIO7 dio1_pin: GPIO3 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/sx126x/test.esp32-idf.yaml b/tests/components/sx126x/test.esp32-idf.yaml index 9770f52229..854638ea9c 100644 --- a/tests/components/sx126x/test.esp32-idf.yaml +++ b/tests/components/sx126x/test.esp32-idf.yaml @@ -1,10 +1,10 @@ substitutions: - clk_pin: GPIO5 - mosi_pin: GPIO27 - miso_pin: GPIO19 - cs_pin: GPIO18 - rst_pin: GPIO23 + cs_pin: GPIO12 + rst_pin: GPIO13 busy_pin: GPIO25 dio1_pin: GPIO26 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/sx126x/test.esp8266-ard.yaml b/tests/components/sx126x/test.esp8266-ard.yaml index d2c07c5bb7..98a3fbbd67 100644 --- a/tests/components/sx126x/test.esp8266-ard.yaml +++ b/tests/components/sx126x/test.esp8266-ard.yaml @@ -1,10 +1,13 @@ substitutions: - clk_pin: GPIO5 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO15 + miso_pin: GPIO16 cs_pin: GPIO1 rst_pin: GPIO2 busy_pin: GPIO4 dio1_pin: GPIO3 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/sx126x/test.rp2040-ard.yaml b/tests/components/sx126x/test.rp2040-ard.yaml index 8881e96971..9bc12a370d 100644 --- a/tests/components/sx126x/test.rp2040-ard.yaml +++ b/tests/components/sx126x/test.rp2040-ard.yaml @@ -7,4 +7,7 @@ substitutions: busy_pin: GPIO8 dio1_pin: GPIO7 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/sx127x/common.yaml b/tests/components/sx127x/common.yaml index 63adc2e91c..540381fc08 100644 --- a/tests/components/sx127x/common.yaml +++ b/tests/components/sx127x/common.yaml @@ -1,8 +1,3 @@ -spi: - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - sx127x: cs_pin: ${cs_pin} rst_pin: ${rst_pin} diff --git a/tests/components/sx127x/test.esp32-c3-idf.yaml b/tests/components/sx127x/test.esp32-c3-idf.yaml index 36535a950d..dfee192545 100644 --- a/tests/components/sx127x/test.esp32-c3-idf.yaml +++ b/tests/components/sx127x/test.esp32-c3-idf.yaml @@ -1,9 +1,8 @@ substitutions: - clk_pin: GPIO5 - mosi_pin: GPIO18 - miso_pin: GPIO19 cs_pin: GPIO1 rst_pin: GPIO2 dio0_pin: GPIO3 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sx127x/test.esp32-idf.yaml b/tests/components/sx127x/test.esp32-idf.yaml index 71270462a2..c9d58bb27e 100644 --- a/tests/components/sx127x/test.esp32-idf.yaml +++ b/tests/components/sx127x/test.esp32-idf.yaml @@ -1,9 +1,9 @@ substitutions: - clk_pin: GPIO5 - mosi_pin: GPIO27 - miso_pin: GPIO19 - cs_pin: GPIO18 - rst_pin: GPIO23 + cs_pin: GPIO12 + rst_pin: GPIO13 dio0_pin: GPIO26 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/sx127x/test.esp8266-ard.yaml b/tests/components/sx127x/test.esp8266-ard.yaml index 64c01edd44..d58166137c 100644 --- a/tests/components/sx127x/test.esp8266-ard.yaml +++ b/tests/components/sx127x/test.esp8266-ard.yaml @@ -1,9 +1,12 @@ substitutions: - clk_pin: GPIO5 - mosi_pin: GPIO13 - miso_pin: GPIO12 + clk_pin: GPIO0 + mosi_pin: GPIO15 + miso_pin: GPIO16 cs_pin: GPIO1 rst_pin: GPIO2 dio0_pin: GPIO3 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/sx127x/test.rp2040-ard.yaml b/tests/components/sx127x/test.rp2040-ard.yaml index 0af7b29790..09a9b3203b 100644 --- a/tests/components/sx127x/test.rp2040-ard.yaml +++ b/tests/components/sx127x/test.rp2040-ard.yaml @@ -6,4 +6,7 @@ substitutions: rst_pin: GPIO6 dio0_pin: GPIO7 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/sx1509/common.yaml b/tests/components/sx1509/common.yaml index a83217e579..cf7e234f09 100644 --- a/tests/components/sx1509/common.yaml +++ b/tests/components/sx1509/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_sx1509 - scl: ${scl_pin} - sda: ${sda_pin} - sx1509: - id: sx1509_hub + i2c_id: i2c_bus address: 0x3E keypad: key_rows: 2 diff --git a/tests/components/sx1509/test.esp32-c3-idf.yaml b/tests/components/sx1509/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/sx1509/test.esp32-c3-idf.yaml +++ b/tests/components/sx1509/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/sx1509/test.esp32-idf.yaml b/tests/components/sx1509/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/sx1509/test.esp32-idf.yaml +++ b/tests/components/sx1509/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/sx1509/test.esp8266-ard.yaml b/tests/components/sx1509/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/sx1509/test.esp8266-ard.yaml +++ b/tests/components/sx1509/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/sx1509/test.rp2040-ard.yaml b/tests/components/sx1509/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/sx1509/test.rp2040-ard.yaml +++ b/tests/components/sx1509/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/syslog/test.host.yaml b/tests/components/syslog/test.host.yaml index e735c37e4d..31122437d5 100644 --- a/tests/components/syslog/test.host.yaml +++ b/tests/components/syslog/test.host.yaml @@ -1,4 +1,11 @@ -packages: - common: !include common.yaml +udp: + addresses: ["239.0.60.53"] -wifi: !remove +time: + platform: host + +syslog: + port: 514 + strip: true + level: info + facility: 16 diff --git a/tests/components/t6615/common.yaml b/tests/components/t6615/common.yaml index 3ad715ae2b..4317130461 100644 --- a/tests/components/t6615/common.yaml +++ b/tests/components/t6615/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_t6615 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 19200 - sensor: - platform: t6615 co2: diff --git a/tests/components/t6615/test.esp32-c3-idf.yaml b/tests/components/t6615/test.esp32-c3-idf.yaml index b516342f3b..147d967dd4 100644 --- a/tests/components/t6615/test.esp32-c3-idf.yaml +++ b/tests/components/t6615/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart_19200: !include ../../test_build_components/common/uart_19200/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/t6615/test.esp32-idf.yaml b/tests/components/t6615/test.esp32-idf.yaml index f486544afa..4bb9e7fff6 100644 --- a/tests/components/t6615/test.esp32-idf.yaml +++ b/tests/components/t6615/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart_19200: !include ../../test_build_components/common/uart_19200/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/t6615/test.esp8266-ard.yaml b/tests/components/t6615/test.esp8266-ard.yaml index b516342f3b..1dd8409590 100644 --- a/tests/components/t6615/test.esp8266-ard.yaml +++ b/tests/components/t6615/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart_19200: !include ../../test_build_components/common/uart_19200/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/t6615/test.rp2040-ard.yaml b/tests/components/t6615/test.rp2040-ard.yaml index b516342f3b..f4dada6605 100644 --- a/tests/components/t6615/test.rp2040-ard.yaml +++ b/tests/components/t6615/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart_19200: !include ../../test_build_components/common/uart_19200/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/tc74/common.yaml b/tests/components/tc74/common.yaml index 88f5c91e12..c2430ee2d4 100644 --- a/tests/components/tc74/common.yaml +++ b/tests/components/tc74/common.yaml @@ -1,8 +1,4 @@ -i2c: - - id: i2c_tc74 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: tc74 + i2c_id: i2c_bus name: TC74 Temperature diff --git a/tests/components/tc74/test.esp32-c3-idf.yaml b/tests/components/tc74/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/tc74/test.esp32-c3-idf.yaml +++ b/tests/components/tc74/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/tc74/test.esp32-idf.yaml b/tests/components/tc74/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/tc74/test.esp32-idf.yaml +++ b/tests/components/tc74/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/tc74/test.esp8266-ard.yaml b/tests/components/tc74/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/tc74/test.esp8266-ard.yaml +++ b/tests/components/tc74/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/tc74/test.rp2040-ard.yaml b/tests/components/tc74/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/tc74/test.rp2040-ard.yaml +++ b/tests/components/tc74/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/tca9548a/common.yaml b/tests/components/tca9548a/common.yaml index 67e812e08b..bfaf1e26fb 100644 --- a/tests/components/tca9548a/common.yaml +++ b/tests/components/tca9548a/common.yaml @@ -1,15 +1,10 @@ -i2c: - - id: i2c_tca9548a - scl: ${scl_pin} - sda: ${sda_pin} - tca9548a: - id: multiplex0 + i2c_id: i2c_bus address: 0x70 channels: - bus_id: multiplex0_chan0 channel: 0 - i2c_id: i2c_tca9548a - id: multiplex1 + i2c_id: i2c_bus address: 0x71 - i2c_id: multiplex0_chan0 diff --git a/tests/components/tca9548a/test.esp32-c3-idf.yaml b/tests/components/tca9548a/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/tca9548a/test.esp32-c3-idf.yaml +++ b/tests/components/tca9548a/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/tca9548a/test.esp32-idf.yaml b/tests/components/tca9548a/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/tca9548a/test.esp32-idf.yaml +++ b/tests/components/tca9548a/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/tca9548a/test.esp8266-ard.yaml b/tests/components/tca9548a/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/tca9548a/test.esp8266-ard.yaml +++ b/tests/components/tca9548a/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/tca9548a/test.rp2040-ard.yaml b/tests/components/tca9548a/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/tca9548a/test.rp2040-ard.yaml +++ b/tests/components/tca9548a/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/tca9555/common.yaml b/tests/components/tca9555/common.yaml index 0fc3086786..82b4c959d8 100644 --- a/tests/components/tca9555/common.yaml +++ b/tests/components/tca9555/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_tca9555 - scl: ${scl_pin} - sda: ${sda_pin} - tca9555: - id: tca9555_hub + i2c_id: i2c_bus address: 0x21 binary_sensor: diff --git a/tests/components/tca9555/test.esp32-c3-idf.yaml b/tests/components/tca9555/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/tca9555/test.esp32-c3-idf.yaml +++ b/tests/components/tca9555/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/tca9555/test.esp32-idf.yaml b/tests/components/tca9555/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/tca9555/test.esp32-idf.yaml +++ b/tests/components/tca9555/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/tca9555/test.esp8266-ard.yaml b/tests/components/tca9555/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/tca9555/test.esp8266-ard.yaml +++ b/tests/components/tca9555/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/tca9555/test.rp2040-ard.yaml b/tests/components/tca9555/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/tca9555/test.rp2040-ard.yaml +++ b/tests/components/tca9555/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/tcs34725/common.yaml b/tests/components/tcs34725/common.yaml index 5296988fa5..e16862035e 100644 --- a/tests/components/tcs34725/common.yaml +++ b/tests/components/tcs34725/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_tcs34725 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: tcs34725 + i2c_id: i2c_bus red_channel: name: Red Channel green_channel: diff --git a/tests/components/tcs34725/test.esp32-c3-idf.yaml b/tests/components/tcs34725/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/tcs34725/test.esp32-c3-idf.yaml +++ b/tests/components/tcs34725/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/tcs34725/test.esp32-idf.yaml b/tests/components/tcs34725/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/tcs34725/test.esp32-idf.yaml +++ b/tests/components/tcs34725/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/tcs34725/test.esp8266-ard.yaml b/tests/components/tcs34725/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/tcs34725/test.esp8266-ard.yaml +++ b/tests/components/tcs34725/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/tcs34725/test.rp2040-ard.yaml b/tests/components/tcs34725/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/tcs34725/test.rp2040-ard.yaml +++ b/tests/components/tcs34725/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/tee501/common.yaml b/tests/components/tee501/common.yaml index c01ab7e37a..82091faccf 100644 --- a/tests/components/tee501/common.yaml +++ b/tests/components/tee501/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_tee501 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: tee501 + i2c_id: i2c_bus name: TEE501 Temperature address: 0x48 diff --git a/tests/components/tee501/test.esp32-c3-idf.yaml b/tests/components/tee501/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/tee501/test.esp32-c3-idf.yaml +++ b/tests/components/tee501/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/tee501/test.esp32-idf.yaml b/tests/components/tee501/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/tee501/test.esp32-idf.yaml +++ b/tests/components/tee501/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/tee501/test.esp8266-ard.yaml b/tests/components/tee501/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/tee501/test.esp8266-ard.yaml +++ b/tests/components/tee501/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/tee501/test.rp2040-ard.yaml b/tests/components/tee501/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/tee501/test.rp2040-ard.yaml +++ b/tests/components/tee501/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/teleinfo/common.yaml b/tests/components/teleinfo/common.yaml index 90b684e977..dcb2cb14bd 100644 --- a/tests/components/teleinfo/common.yaml +++ b/tests/components/teleinfo/common.yaml @@ -1,10 +1,3 @@ -uart: - - id: uart_teleinfo - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 1200 - parity: EVEN - button: - platform: template name: Poller component suspend test diff --git a/tests/components/teleinfo/test.esp32-c3-idf.yaml b/tests/components/teleinfo/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/teleinfo/test.esp32-c3-idf.yaml +++ b/tests/components/teleinfo/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/teleinfo/test.esp32-idf.yaml b/tests/components/teleinfo/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/teleinfo/test.esp32-idf.yaml +++ b/tests/components/teleinfo/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/teleinfo/test.esp8266-ard.yaml b/tests/components/teleinfo/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/teleinfo/test.esp8266-ard.yaml +++ b/tests/components/teleinfo/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/teleinfo/test.rp2040-ard.yaml b/tests/components/teleinfo/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/teleinfo/test.rp2040-ard.yaml +++ b/tests/components/teleinfo/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/tem3200/common.yaml b/tests/components/tem3200/common.yaml index 392c853bf4..cef7317450 100644 --- a/tests/components/tem3200/common.yaml +++ b/tests/components/tem3200/common.yaml @@ -1,13 +1,7 @@ -i2c: - id: i2c_bus - scl: ${scl_pin} - sda: ${sda_pin} - frequency: 200kHz - sensor: - platform: tem3200 - update_interval: 1s i2c_id: i2c_bus + update_interval: 1s temperature: name: water temperature diff --git a/tests/components/tem3200/test.esp32-idf.yaml b/tests/components/tem3200/test.esp32-idf.yaml index 3b761d3fc1..b47e39c389 100644 --- a/tests/components/tem3200/test.esp32-idf.yaml +++ b/tests/components/tem3200/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO22 - sda_pin: GPIO21 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/tem3200/test.esp32-s3-idf.yaml b/tests/components/tem3200/test.esp32-s3-idf.yaml index 4942e3c2b3..e9d826aa7c 100644 --- a/tests/components/tem3200/test.esp32-s3-idf.yaml +++ b/tests/components/tem3200/test.esp32-s3-idf.yaml @@ -2,4 +2,7 @@ substitutions: scl_pin: GPIO40 sda_pin: GPIO41 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-s3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/tem3200/test.esp8266-ard.yaml b/tests/components/tem3200/test.esp8266-ard.yaml index 3be5e53dcb..4a98b9388a 100644 --- a/tests/components/tem3200/test.esp8266-ard.yaml +++ b/tests/components/tem3200/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO05 - sda_pin: GPIO04 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/template/common-base.yaml b/tests/components/template/common-base.yaml new file mode 100644 index 0000000000..48537d21bc --- /dev/null +++ b/tests/components/template/common-base.yaml @@ -0,0 +1,342 @@ +esphome: + on_boot: + - sensor.template.publish: + id: template_sens + state: 42.0 + + # Templated + - sensor.template.publish: + id: template_sens + state: !lambda "return 42.0;" + + - datetime.date.set: + id: test_date + date: + year: 2021 + month: 1 + day: 1 + - datetime.date.set: + id: test_date + date: !lambda "return {.day_of_month = 1, .month = 1, .year = 2021};" + - datetime.date.set: + id: test_date + date: "2021-01-01" + +binary_sensor: + - platform: template + id: some_binary_sensor + name: "Garage Door Open" + lambda: |- + if (id(template_sens).state > 30) { + // Garage Door is open. + return true; + } else { + // Garage Door is closed. + return false; + } + - platform: template + id: other_binary_sensor + name: "Garage Door Closed" + condition: + sensor.in_range: + id: template_sens + below: 30.0 + filters: + - invert: + - delayed_on: 100ms + - delayed_off: 100ms + - delayed_on_off: !lambda "if (id(test_switch).state) return 1000; else return 0;" + - delayed_on_off: + time_on: 10s + time_off: !lambda "if (id(test_switch).state) return 1000; else return 0;" + - autorepeat: + - delay: 1s + time_off: 100ms + time_on: 900ms + - delay: 5s + time_off: 100ms + time_on: 400ms + - lambda: |- + if (id(other_binary_sensor).state) { + return x; + } else { + return {}; + } + - settle: 500ms + - timeout: 5s + +sensor: + - platform: template + name: "Template Sensor" + id: template_sens + lambda: |- + if (id(some_binary_sensor).state) { + return 42.0; + } else { + return 0.0; + } + update_interval: 60s + filters: + - calibrate_linear: + - 0.0 -> 0.0 + - 40.0 -> 45.0 + - 100.0 -> 102.5 + - calibrate_polynomial: + degree: 2 + datapoints: + # Map 0.0 (from sensor) to 0.0 (true value) + - 0.0 -> 0.0 + - 10.0 -> 12.1 + - 13.0 -> 14.0 + - clamp: + max_value: 10.0 + min_value: -10.0 + - debounce: 0.1s + - delta: 5.0 + - exponential_moving_average: + alpha: 0.1 + send_every: 15 + - filter_out: + - 10 + - 20 + - !lambda return 10; + - filter_out: 10 + - filter_out: !lambda return NAN; + - heartbeat: 5s + - lambda: return x * (9.0/5.0) + 32.0; + - max: + window_size: 10 + send_every: 2 + send_first_at: 1 + - median: + window_size: 7 + send_every: 4 + send_first_at: 3 + - min: + window_size: 10 + send_every: 2 + send_first_at: 1 + - multiply: 1 + - multiply: !lambda return 2; + - offset: 10 + - offset: !lambda return 10; + - or: + - quantile: + window_size: 7 + send_every: 4 + send_first_at: 3 + quantile: .9 + - round: 1 + - round_to_multiple_of: 0.25 + - skip_initial: 3 + - sliding_window_moving_average: + window_size: 15 + send_every: 15 + - throttle: 1s + - throttle_average: 2s + - throttle_with_priority: 5s + - throttle_with_priority: + timeout: 3s + value: 42.0 + - throttle_with_priority: + timeout: 3s + value: !lambda return 1.0f / 2.0f; + - throttle_with_priority: + timeout: 3s + value: + - 42.0 + - !lambda return 2.0f / 2.0f; + - nan + - timeout: + timeout: 10s + value: !lambda return 10; + - timeout: + timeout: 1h + value: 20.0 + - timeout: + timeout: 1min + value: last + - timeout: + timeout: 1d + - to_ntc_resistance: + calibration: + - 10.0kOhm -> 25°C + - 27.219kOhm -> 0°C + - 14.674kOhm -> 15°C + - to_ntc_temperature: + calibration: + - 10.0kOhm -> 25°C + - 27.219kOhm -> 0°C + - 14.674kOhm -> 15°C + +output: + - platform: template + id: outputsplit + type: float + write_action: + - logger.log: "write_action" + +switch: + - platform: template + id: test_switch + name: "Template Switch" + lambda: |- + if (id(some_binary_sensor).state) { + return true; + } else { + return false; + } + turn_on_action: + - logger.log: "turn_on_action" + turn_off_action: + - logger.log: "turn_off_action" + +button: + - platform: template + name: "Template Button" + on_press: + - logger.log: Button Pressed + +cover: + - platform: template + name: "Template Cover" + lambda: |- + if (id(some_binary_sensor).state) { + return COVER_OPEN; + } else { + return COVER_CLOSED; + } + open_action: + - logger.log: open_action + close_action: + - logger.log: close_action + stop_action: + - logger.log: stop_action + optimistic: true + +number: + - platform: template + name: "Template number" + optimistic: true + min_value: 0 + max_value: 100 + step: 1 + +select: + - platform: template + name: "Template select" + optimistic: true + options: + - one + - two + - three + initial_option: two + +lock: + - platform: template + name: "Template Lock" + lambda: |- + if (id(some_binary_sensor).state) { + return LOCK_STATE_LOCKED; + } else { + return LOCK_STATE_UNLOCKED; + } + lock_action: + - logger.log: lock_action + unlock_action: + - logger.log: unlock_action + open_action: + - logger.log: open_action + +valve: + - platform: template + id: template_valve + name: "Template Valve" + lambda: |- + if (id(some_binary_sensor).state) { + return VALVE_OPEN; + } else { + return VALVE_CLOSED; + } + open_action: + - logger.log: open_action + close_action: + - logger.log: close_action + - valve.template.publish: + id: template_valve + state: CLOSED + stop_action: + - logger.log: stop_action + optimistic: true + +text: + - platform: template + name: "Template text" + optimistic: true + min_length: 0 + max_length: 100 + mode: text + - platform: template + name: "Template text lambda" + mode: text + update_interval: 1s + lambda: | + return std::string{"Hello!"}; + set_action: + then: + - logger.log: + format: Template Text set to %s + args: ["x.c_str()"] + +alarm_control_panel: + - platform: template + name: Alarm Panel + codes: + - "1234" + +datetime: + - platform: template + name: Date + id: test_date + type: date + initial_value: "2000-1-2" + set_action: + - logger.log: "set_value" + on_value: + - logger.log: + format: "Date: %04d-%02d-%02d" + args: + - x.year + - x.month + - x.day_of_month + - platform: template + name: Time + id: test_time + type: time + initial_value: "12:34:56am" + set_action: + - logger.log: "set_value" + on_value: + - logger.log: + format: "Time: %02d:%02d:%02d" + args: + - x.hour + - x.minute + - x.second + - platform: template + name: DateTime + id: test_datetime + type: datetime + initial_value: "2000-1-2 12:34:56" + set_action: + - logger.log: "set_value" + on_value: + - logger.log: + format: "DateTime: %04d-%02d-%02d %02d:%02d:%02d" + args: + - x.year + - x.month + - x.day_of_month + - x.hour + - x.minute + - x.second diff --git a/tests/components/template/common.yaml b/tests/components/template/common.yaml index efbb83ee06..d06f3ce131 100644 --- a/tests/components/template/common.yaml +++ b/tests/components/template/common.yaml @@ -1,343 +1,4 @@ -esphome: - on_boot: - - sensor.template.publish: - id: template_sens - state: 42.0 - - # Templated - - sensor.template.publish: - id: template_sens - state: !lambda "return 42.0;" - - - datetime.date.set: - id: test_date - date: - year: 2021 - month: 1 - day: 1 - - datetime.date.set: - id: test_date - date: !lambda "return {.day_of_month = 1, .month = 1, .year = 2021};" - - datetime.date.set: - id: test_date - date: "2021-01-01" - -binary_sensor: - - platform: template - id: some_binary_sensor - name: "Garage Door Open" - lambda: |- - if (id(template_sens).state > 30) { - // Garage Door is open. - return true; - } else { - // Garage Door is closed. - return false; - } - - platform: template - id: other_binary_sensor - name: "Garage Door Closed" - condition: - sensor.in_range: - id: template_sens - below: 30.0 - filters: - - invert: - - delayed_on: 100ms - - delayed_off: 100ms - - delayed_on_off: !lambda "if (id(test_switch).state) return 1000; else return 0;" - - delayed_on_off: - time_on: 10s - time_off: !lambda "if (id(test_switch).state) return 1000; else return 0;" - - autorepeat: - - delay: 1s - time_off: 100ms - time_on: 900ms - - delay: 5s - time_off: 100ms - time_on: 400ms - - lambda: |- - if (id(other_binary_sensor).state) { - return x; - } else { - return {}; - } - - settle: 500ms - - timeout: 5s - -sensor: - - platform: template - name: "Template Sensor" - id: template_sens - lambda: |- - if (id(some_binary_sensor).state) { - return 42.0; - } else { - return 0.0; - } - update_interval: 60s - filters: - - calibrate_linear: - - 0.0 -> 0.0 - - 40.0 -> 45.0 - - 100.0 -> 102.5 - - calibrate_polynomial: - degree: 2 - datapoints: - # Map 0.0 (from sensor) to 0.0 (true value) - - 0.0 -> 0.0 - - 10.0 -> 12.1 - - 13.0 -> 14.0 - - clamp: - max_value: 10.0 - min_value: -10.0 - - debounce: 0.1s - - delta: 5.0 - - exponential_moving_average: - alpha: 0.1 - send_every: 15 - - filter_out: - - 10 - - 20 - - !lambda return 10; - - filter_out: 10 - - filter_out: !lambda return NAN; - - heartbeat: 5s - - lambda: return x * (9.0/5.0) + 32.0; - - max: - window_size: 10 - send_every: 2 - send_first_at: 1 - - median: - window_size: 7 - send_every: 4 - send_first_at: 3 - - min: - window_size: 10 - send_every: 2 - send_first_at: 1 - - multiply: 1 - - multiply: !lambda return 2; - - offset: 10 - - offset: !lambda return 10; - - or: - - quantile: - window_size: 7 - send_every: 4 - send_first_at: 3 - quantile: .9 - - round: 1 - - round_to_multiple_of: 0.25 - - skip_initial: 3 - - sliding_window_moving_average: - window_size: 15 - send_every: 15 - - throttle: 1s - - throttle_average: 2s - - throttle_with_priority: 5s - - throttle_with_priority: - timeout: 3s - value: 42.0 - - throttle_with_priority: - timeout: 3s - value: !lambda return 1.0f / 2.0f; - - throttle_with_priority: - timeout: 3s - value: - - 42.0 - - !lambda return 2.0f / 2.0f; - - nan - - timeout: - timeout: 10s - value: !lambda return 10; - - timeout: - timeout: 1h - value: 20.0 - - timeout: - timeout: 1min - value: last - - timeout: - timeout: 1d - - to_ntc_resistance: - calibration: - - 10.0kOhm -> 25°C - - 27.219kOhm -> 0°C - - 14.674kOhm -> 15°C - - to_ntc_temperature: - calibration: - - 10.0kOhm -> 25°C - - 27.219kOhm -> 0°C - - 14.674kOhm -> 15°C - -output: - - platform: template - id: outputsplit - type: float - write_action: - - logger.log: "write_action" - -switch: - - platform: template - id: test_switch - name: "Template Switch" - lambda: |- - if (id(some_binary_sensor).state) { - return true; - } else { - return false; - } - turn_on_action: - - logger.log: "turn_on_action" - turn_off_action: - - logger.log: "turn_off_action" - -button: - - platform: template - name: "Template Button" - on_press: - - logger.log: Button Pressed - -cover: - - platform: template - name: "Template Cover" - lambda: |- - if (id(some_binary_sensor).state) { - return COVER_OPEN; - } else { - return COVER_CLOSED; - } - open_action: - - logger.log: open_action - close_action: - - logger.log: close_action - stop_action: - - logger.log: stop_action - optimistic: true - -number: - - platform: template - name: "Template number" - optimistic: true - min_value: 0 - max_value: 100 - step: 1 - -select: - - platform: template - name: "Template select" - optimistic: true - options: - - one - - two - - three - initial_option: two - -lock: - - platform: template - name: "Template Lock" - lambda: |- - if (id(some_binary_sensor).state) { - return LOCK_STATE_LOCKED; - } else { - return LOCK_STATE_UNLOCKED; - } - lock_action: - - logger.log: lock_action - unlock_action: - - logger.log: unlock_action - open_action: - - logger.log: open_action - -valve: - - platform: template - name: "Template Valve" - lambda: |- - if (id(some_binary_sensor).state) { - return VALVE_OPEN; - } else { - return VALVE_CLOSED; - } - open_action: - - logger.log: open_action - close_action: - - logger.log: close_action - - valve.template.publish: - state: CLOSED - stop_action: - - logger.log: stop_action - optimistic: true - -text: - - platform: template - name: "Template text" - optimistic: true - min_length: 0 - max_length: 100 - mode: text - - platform: template - name: "Template text lambda" - mode: text - update_interval: 1s - lambda: | - return std::string{"Hello!"}; - set_action: - then: - - logger.log: - format: Template Text set to %s - args: ["x.c_str()"] - -alarm_control_panel: - - platform: template - name: Alarm Panel - codes: - - "1234" - -datetime: - - platform: template - name: Date - id: test_date - type: date - initial_value: "2000-1-2" - set_action: - - logger.log: "set_value" - on_value: - - logger.log: - format: "Date: %04d-%02d-%02d" - args: - - x.year - - x.month - - x.day_of_month - - platform: template - name: Time - id: test_time - type: time - initial_value: "12:34:56am" - set_action: - - logger.log: "set_value" - on_value: - - logger.log: - format: "Time: %02d:%02d:%02d" - args: - - x.hour - - x.minute - - x.second - - platform: template - name: DateTime - id: test_datetime - type: datetime - initial_value: "2000-1-2 12:34:56" - set_action: - - logger.log: "set_value" - on_value: - - logger.log: - format: "DateTime: %04d-%02d-%02d %02d:%02d:%02d" - args: - - x.year - - x.month - - x.day_of_month - - x.hour - - x.minute - - x.second +<<: !include common-base.yaml time: - platform: sntp # Required for datetime diff --git a/tests/components/template/test.nrf52-adafruit.yaml b/tests/components/template/test.nrf52-adafruit.yaml index 6a8c01560a..45751c6398 100644 --- a/tests/components/template/test.nrf52-adafruit.yaml +++ b/tests/components/template/test.nrf52-adafruit.yaml @@ -1,6 +1 @@ -packages: !include common.yaml - -time: - - id: !remove sntp_time - -wifi: !remove +<<: !include common-base.yaml diff --git a/tests/components/template/test.nrf52-mcumgr.yaml b/tests/components/template/test.nrf52-mcumgr.yaml index 6a8c01560a..45751c6398 100644 --- a/tests/components/template/test.nrf52-mcumgr.yaml +++ b/tests/components/template/test.nrf52-mcumgr.yaml @@ -1,6 +1 @@ -packages: !include common.yaml - -time: - - id: !remove sntp_time - -wifi: !remove +<<: !include common-base.yaml diff --git a/tests/components/tlc59208f/common.yaml b/tests/components/tlc59208f/common.yaml index 49460dcefc..1943063347 100644 --- a/tests/components/tlc59208f/common.yaml +++ b/tests/components/tlc59208f/common.yaml @@ -1,15 +1,13 @@ -i2c: - - id: i2c_tlc59208f - scl: ${scl_pin} - sda: ${sda_pin} - tlc59208f: - address: 0x20 id: tlc59208f_1 + i2c_id: i2c_bus - address: 0x22 id: tlc59208f_2 + i2c_id: i2c_bus - address: 0x24 id: tlc59208f_3 + i2c_id: i2c_bus output: - platform: tlc59208f diff --git a/tests/components/tlc59208f/test.esp32-c3-idf.yaml b/tests/components/tlc59208f/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/tlc59208f/test.esp32-c3-idf.yaml +++ b/tests/components/tlc59208f/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/tlc59208f/test.esp32-idf.yaml b/tests/components/tlc59208f/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/tlc59208f/test.esp32-idf.yaml +++ b/tests/components/tlc59208f/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/tlc59208f/test.esp8266-ard.yaml b/tests/components/tlc59208f/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/tlc59208f/test.esp8266-ard.yaml +++ b/tests/components/tlc59208f/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/tlc59208f/test.rp2040-ard.yaml b/tests/components/tlc59208f/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/tlc59208f/test.rp2040-ard.yaml +++ b/tests/components/tlc59208f/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/tlc5947/test.esp8266-ard.yaml b/tests/components/tlc5947/test.esp8266-ard.yaml index 44da5a07b3..1eb9bcfae2 100644 --- a/tests/components/tlc5947/test.esp8266-ard.yaml +++ b/tests/components/tlc5947/test.esp8266-ard.yaml @@ -1,7 +1,7 @@ substitutions: - clock_pin: GPIO5 - data_pin: GPIO4 - lat_pin: GPIO13 + clock_pin: GPIO0 + data_pin: GPIO2 + lat_pin: GPIO15 packages: common: !include common.yaml diff --git a/tests/components/tlc5971/test.esp8266-ard.yaml b/tests/components/tlc5971/test.esp8266-ard.yaml index 52411bc1e9..7923874f96 100644 --- a/tests/components/tlc5971/test.esp8266-ard.yaml +++ b/tests/components/tlc5971/test.esp8266-ard.yaml @@ -1,7 +1,7 @@ substitutions: clock_pin: GPIO15 - data_pin: GPIO14 - lat_pin: GPIO13 + data_pin: GPIO0 + lat_pin: GPIO2 packages: common: !include common.yaml diff --git a/tests/components/tm1621/test.esp32-idf.yaml b/tests/components/tm1621/test.esp32-idf.yaml index 0441e4bffe..21402f3216 100644 --- a/tests/components/tm1621/test.esp32-idf.yaml +++ b/tests/components/tm1621/test.esp32-idf.yaml @@ -1,7 +1,10 @@ substitutions: - cs_pin: GPIO16 - data_pin: GPIO17 + cs_pin: GPIO4 + data_pin: GPIO5 read_pin: GPIO12 write_pin: GPIO13 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/tm1621/test.esp8266-ard.yaml b/tests/components/tm1621/test.esp8266-ard.yaml index ee7b62ce35..304ca71eb2 100644 --- a/tests/components/tm1621/test.esp8266-ard.yaml +++ b/tests/components/tm1621/test.esp8266-ard.yaml @@ -1,7 +1,10 @@ substitutions: cs_pin: GPIO15 - data_pin: GPIO14 - read_pin: GPIO12 - write_pin: GPIO13 + data_pin: GPIO0 + read_pin: GPIO2 + write_pin: GPIO16 + +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/tm1621/test.rp2040-ard.yaml b/tests/components/tm1621/test.rp2040-ard.yaml index 562ced7485..9a880da876 100644 --- a/tests/components/tm1621/test.rp2040-ard.yaml +++ b/tests/components/tm1621/test.rp2040-ard.yaml @@ -1,7 +1,10 @@ substitutions: cs_pin: GPIO6 data_pin: GPIO7 - read_pin: GPIO2 - write_pin: GPIO3 + read_pin: GPIO8 + write_pin: GPIO9 + +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/tm1637/test.esp32-c3-idf.yaml b/tests/components/tm1637/test.esp32-c3-idf.yaml index 96f6708a3b..0c4d4a9a7a 100644 --- a/tests/components/tm1637/test.esp32-c3-idf.yaml +++ b/tests/components/tm1637/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - clk_pin: GPIO4 + clk_pin: GPIO7 dio_pin: GPIO3 <<: !include common.yaml diff --git a/tests/components/tm1637/test.esp8266-ard.yaml b/tests/components/tm1637/test.esp8266-ard.yaml index 2c5786c47c..0a4221cbc0 100644 --- a/tests/components/tm1637/test.esp8266-ard.yaml +++ b/tests/components/tm1637/test.esp8266-ard.yaml @@ -1,5 +1,5 @@ substitutions: - clk_pin: GPIO14 - dio_pin: GPIO13 + clk_pin: GPIO0 + dio_pin: GPIO2 <<: !include common.yaml diff --git a/tests/components/tmp102/common.yaml b/tests/components/tmp102/common.yaml index afc4a27fad..049a8067da 100644 --- a/tests/components/tmp102/common.yaml +++ b/tests/components/tmp102/common.yaml @@ -1,8 +1,4 @@ -i2c: - - id: i2c_tmp102 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: tmp102 + i2c_id: i2c_bus name: TMP102 Temperature diff --git a/tests/components/tmp102/test.esp32-c3-idf.yaml b/tests/components/tmp102/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/tmp102/test.esp32-c3-idf.yaml +++ b/tests/components/tmp102/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/tmp102/test.esp32-idf.yaml b/tests/components/tmp102/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/tmp102/test.esp32-idf.yaml +++ b/tests/components/tmp102/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/tmp102/test.esp8266-ard.yaml b/tests/components/tmp102/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/tmp102/test.esp8266-ard.yaml +++ b/tests/components/tmp102/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/tmp102/test.rp2040-ard.yaml b/tests/components/tmp102/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/tmp102/test.rp2040-ard.yaml +++ b/tests/components/tmp102/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/tmp1075/common.yaml b/tests/components/tmp1075/common.yaml index 4c4c6c6f35..90025f231e 100644 --- a/tests/components/tmp1075/common.yaml +++ b/tests/components/tmp1075/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_tmp1075 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: tmp1075 + i2c_id: i2c_bus name: Temperature TMP1075 conversion_rate: 27.5ms alert: diff --git a/tests/components/tmp1075/test.esp32-c3-idf.yaml b/tests/components/tmp1075/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/tmp1075/test.esp32-c3-idf.yaml +++ b/tests/components/tmp1075/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/tmp1075/test.esp32-idf.yaml b/tests/components/tmp1075/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/tmp1075/test.esp32-idf.yaml +++ b/tests/components/tmp1075/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/tmp1075/test.esp8266-ard.yaml b/tests/components/tmp1075/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/tmp1075/test.esp8266-ard.yaml +++ b/tests/components/tmp1075/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/tmp1075/test.rp2040-ard.yaml b/tests/components/tmp1075/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/tmp1075/test.rp2040-ard.yaml +++ b/tests/components/tmp1075/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/tmp117/common.yaml b/tests/components/tmp117/common.yaml index f4a5688933..58419c2134 100644 --- a/tests/components/tmp117/common.yaml +++ b/tests/components/tmp117/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_tmp117 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: tmp117 + i2c_id: i2c_bus name: TMP117 Temperature update_interval: 5s diff --git a/tests/components/tmp117/test.esp32-c3-idf.yaml b/tests/components/tmp117/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/tmp117/test.esp32-c3-idf.yaml +++ b/tests/components/tmp117/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/tmp117/test.esp32-idf.yaml b/tests/components/tmp117/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/tmp117/test.esp32-idf.yaml +++ b/tests/components/tmp117/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/tmp117/test.esp8266-ard.yaml b/tests/components/tmp117/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/tmp117/test.esp8266-ard.yaml +++ b/tests/components/tmp117/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/tmp117/test.rp2040-ard.yaml b/tests/components/tmp117/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/tmp117/test.rp2040-ard.yaml +++ b/tests/components/tmp117/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/tof10120/common.yaml b/tests/components/tof10120/common.yaml index 67643323d9..b360a27248 100644 --- a/tests/components/tof10120/common.yaml +++ b/tests/components/tof10120/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_tof10120 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: tof10120 + i2c_id: i2c_bus name: Distance sensor update_interval: 5s diff --git a/tests/components/tof10120/test.esp32-c3-idf.yaml b/tests/components/tof10120/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/tof10120/test.esp32-c3-idf.yaml +++ b/tests/components/tof10120/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/tof10120/test.esp32-idf.yaml b/tests/components/tof10120/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/tof10120/test.esp32-idf.yaml +++ b/tests/components/tof10120/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/tof10120/test.esp8266-ard.yaml b/tests/components/tof10120/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/tof10120/test.esp8266-ard.yaml +++ b/tests/components/tof10120/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/tof10120/test.rp2040-ard.yaml b/tests/components/tof10120/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/tof10120/test.rp2040-ard.yaml +++ b/tests/components/tof10120/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/tormatic/common.yaml b/tests/components/tormatic/common.yaml index 0f1b33ac12..712bf7569b 100644 --- a/tests/components/tormatic/common.yaml +++ b/tests/components/tormatic/common.yaml @@ -1,12 +1,5 @@ -uart: - - id: uart_tormatic - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - cover: - platform: tormatic - uart_id: uart_tormatic id: tormatic_garage_door name: Tormatic Garage Door open_duration: 15s diff --git a/tests/components/tormatic/test.esp32-c3-idf.yaml b/tests/components/tormatic/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/tormatic/test.esp32-c3-idf.yaml +++ b/tests/components/tormatic/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/tormatic/test.esp32-idf.yaml b/tests/components/tormatic/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/tormatic/test.esp32-idf.yaml +++ b/tests/components/tormatic/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/tormatic/test.esp8266-ard.yaml b/tests/components/tormatic/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/tormatic/test.esp8266-ard.yaml +++ b/tests/components/tormatic/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/tormatic/test.rp2040-ard.yaml b/tests/components/tormatic/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/tormatic/test.rp2040-ard.yaml +++ b/tests/components/tormatic/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/total_daily_energy/test.esp8266-ard.yaml b/tests/components/total_daily_energy/test.esp8266-ard.yaml index 8b42b21b54..ec9c0e43dc 100644 --- a/tests/components/total_daily_energy/test.esp8266-ard.yaml +++ b/tests/components/total_daily_energy/test.esp8266-ard.yaml @@ -1,6 +1,6 @@ substitutions: - sel_pin: GPIO12 - cf_pin: GPIO13 - cf1_pin: GPIO14 + sel_pin: GPIO0 + cf_pin: GPIO2 + cf1_pin: GPIO15 <<: !include common.yaml diff --git a/tests/components/tsl2561/common.yaml b/tests/components/tsl2561/common.yaml index d2b4f75df3..132bdb890e 100644 --- a/tests/components/tsl2561/common.yaml +++ b/tests/components/tsl2561/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_tsl2561 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: tsl2561 + i2c_id: i2c_bus name: TSL2561 Ambient Light address: 0x39 is_cs_package: true diff --git a/tests/components/tsl2561/test.esp32-c3-idf.yaml b/tests/components/tsl2561/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/tsl2561/test.esp32-c3-idf.yaml +++ b/tests/components/tsl2561/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/tsl2561/test.esp32-idf.yaml b/tests/components/tsl2561/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/tsl2561/test.esp32-idf.yaml +++ b/tests/components/tsl2561/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/tsl2561/test.esp8266-ard.yaml b/tests/components/tsl2561/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/tsl2561/test.esp8266-ard.yaml +++ b/tests/components/tsl2561/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/tsl2561/test.rp2040-ard.yaml b/tests/components/tsl2561/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/tsl2561/test.rp2040-ard.yaml +++ b/tests/components/tsl2561/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/tsl2591/common.yaml b/tests/components/tsl2591/common.yaml index d58c46fb48..93433cf968 100644 --- a/tests/components/tsl2591/common.yaml +++ b/tests/components/tsl2591/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_tsl2591 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: tsl2591 + i2c_id: i2c_bus id: test_tsl2591 address: 0x29 integration_time: 600ms diff --git a/tests/components/tsl2591/test.esp32-c3-idf.yaml b/tests/components/tsl2591/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/tsl2591/test.esp32-c3-idf.yaml +++ b/tests/components/tsl2591/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/tsl2591/test.esp32-idf.yaml b/tests/components/tsl2591/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/tsl2591/test.esp32-idf.yaml +++ b/tests/components/tsl2591/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/tsl2591/test.esp8266-ard.yaml b/tests/components/tsl2591/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/tsl2591/test.esp8266-ard.yaml +++ b/tests/components/tsl2591/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/tsl2591/test.rp2040-ard.yaml b/tests/components/tsl2591/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/tsl2591/test.rp2040-ard.yaml +++ b/tests/components/tsl2591/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/tt21100/common.yaml b/tests/components/tt21100/common.yaml index a5d7970429..bd1830ea8b 100644 --- a/tests/components/tt21100/common.yaml +++ b/tests/components/tt21100/common.yaml @@ -1,25 +1,24 @@ -i2c: - - id: i2c_tt21100 - scl: ${scl_pin} - sda: ${sda_pin} - display: - platform: ssd1306_i2c + i2c_id: i2c_bus id: ssd1306_display model: SSD1306_128X64 reset_pin: ${disp_reset_pin} pages: - - id: page1 + - id: tt21100_page1 lambda: |- it.rectangle(0, 0, it.get_width(), it.get_height()); touchscreen: - platform: tt21100 + i2c_id: i2c_bus + id: tt21100_touchscreen display: ssd1306_display interrupt_pin: ${interrupt_pin} reset_pin: ${reset_pin} binary_sensor: - platform: tt21100 + id: tt21100_button name: Home Button index: 1 diff --git a/tests/components/tt21100/test.esp32-c3-idf.yaml b/tests/components/tt21100/test.esp32-c3-idf.yaml index 36a8ce2778..a7265e10b2 100644 --- a/tests/components/tt21100/test.esp32-c3-idf.yaml +++ b/tests/components/tt21100/test.esp32-c3-idf.yaml @@ -1,8 +1,9 @@ substitutions: - disp_reset_pin: GPIO10 - scl_pin: GPIO0 - sda_pin: GPIO1 + disp_reset_pin: GPIO7 interrupt_pin: GPIO2 reset_pin: GPIO3 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/tt21100/test.esp32-idf.yaml b/tests/components/tt21100/test.esp32-idf.yaml index 05598719f9..033aafb73c 100644 --- a/tests/components/tt21100/test.esp32-idf.yaml +++ b/tests/components/tt21100/test.esp32-idf.yaml @@ -1,8 +1,9 @@ substitutions: disp_reset_pin: GPIO12 - scl_pin: GPIO13 - sda_pin: GPIO14 interrupt_pin: GPIO15 - reset_pin: GPIO16 + reset_pin: GPIO4 + +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/tt21100/test.esp8266-ard.yaml b/tests/components/tt21100/test.esp8266-ard.yaml index 05598719f9..25d1ff82e3 100644 --- a/tests/components/tt21100/test.esp8266-ard.yaml +++ b/tests/components/tt21100/test.esp8266-ard.yaml @@ -1,8 +1,9 @@ substitutions: - disp_reset_pin: GPIO12 - scl_pin: GPIO13 - sda_pin: GPIO14 + disp_reset_pin: GPIO0 interrupt_pin: GPIO15 reset_pin: GPIO16 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/tt21100/test.rp2040-ard.yaml b/tests/components/tt21100/test.rp2040-ard.yaml index 36a8ce2778..0d13628294 100644 --- a/tests/components/tt21100/test.rp2040-ard.yaml +++ b/tests/components/tt21100/test.rp2040-ard.yaml @@ -1,8 +1,9 @@ substitutions: disp_reset_pin: GPIO10 - scl_pin: GPIO0 - sda_pin: GPIO1 interrupt_pin: GPIO2 reset_pin: GPIO3 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ttp229_bsf/common.yaml b/tests/components/ttp229_bsf/common.yaml index 42c26a5d51..91134f5098 100644 --- a/tests/components/ttp229_bsf/common.yaml +++ b/tests/components/ttp229_bsf/common.yaml @@ -1,6 +1,6 @@ ttp229_bsf: - scl_pin: ${scl_pin} - sdo_pin: ${sdo_pin} + scl_pin: ${ttp229_scl_pin} + sdo_pin: ${ttp229_sdo_pin} binary_sensor: - platform: ttp229_bsf diff --git a/tests/components/ttp229_bsf/test.esp32-c3-idf.yaml b/tests/components/ttp229_bsf/test.esp32-c3-idf.yaml index 135b213edc..ad1c58b40e 100644 --- a/tests/components/ttp229_bsf/test.esp32-c3-idf.yaml +++ b/tests/components/ttp229_bsf/test.esp32-c3-idf.yaml @@ -1,5 +1,8 @@ substitutions: - scl_pin: GPIO5 - sdo_pin: GPIO4 + ttp229_scl_pin: GPIO7 + ttp229_sdo_pin: GPIO4 + +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ttp229_bsf/test.esp32-idf.yaml b/tests/components/ttp229_bsf/test.esp32-idf.yaml index 80ed75293f..8b7f6fe6ea 100644 --- a/tests/components/ttp229_bsf/test.esp32-idf.yaml +++ b/tests/components/ttp229_bsf/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - scl_pin: GPIO16 - sdo_pin: GPIO17 + ttp229_scl_pin: GPIO14 + ttp229_sdo_pin: GPIO5 + +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ttp229_bsf/test.esp8266-ard.yaml b/tests/components/ttp229_bsf/test.esp8266-ard.yaml index 135b213edc..1832fde07f 100644 --- a/tests/components/ttp229_bsf/test.esp8266-ard.yaml +++ b/tests/components/ttp229_bsf/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - scl_pin: GPIO5 - sdo_pin: GPIO4 + ttp229_scl_pin: GPIO0 + ttp229_sdo_pin: GPIO2 + +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ttp229_bsf/test.rp2040-ard.yaml b/tests/components/ttp229_bsf/test.rp2040-ard.yaml index 135b213edc..1448c82347 100644 --- a/tests/components/ttp229_bsf/test.rp2040-ard.yaml +++ b/tests/components/ttp229_bsf/test.rp2040-ard.yaml @@ -1,5 +1,8 @@ substitutions: - scl_pin: GPIO5 - sdo_pin: GPIO4 + ttp229_scl_pin: GPIO2 + ttp229_sdo_pin: GPIO6 + +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ttp229_lsf/common.yaml b/tests/components/ttp229_lsf/common.yaml index 5c0dbf9517..41402f5aac 100644 --- a/tests/components/ttp229_lsf/common.yaml +++ b/tests/components/ttp229_lsf/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_ttp229_lsf - scl: ${scl_pin} - sda: ${sda_pin} - ttp229_lsf: + i2c_id: i2c_bus binary_sensor: - platform: ttp229_lsf diff --git a/tests/components/ttp229_lsf/test.esp32-c3-idf.yaml b/tests/components/ttp229_lsf/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ttp229_lsf/test.esp32-c3-idf.yaml +++ b/tests/components/ttp229_lsf/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ttp229_lsf/test.esp32-idf.yaml b/tests/components/ttp229_lsf/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ttp229_lsf/test.esp32-idf.yaml +++ b/tests/components/ttp229_lsf/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ttp229_lsf/test.esp8266-ard.yaml b/tests/components/ttp229_lsf/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ttp229_lsf/test.esp8266-ard.yaml +++ b/tests/components/ttp229_lsf/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ttp229_lsf/test.rp2040-ard.yaml b/tests/components/ttp229_lsf/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ttp229_lsf/test.rp2040-ard.yaml +++ b/tests/components/ttp229_lsf/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/tuya/common.yaml b/tests/components/tuya/common.yaml index 2c40628139..e177b7d056 100644 --- a/tests/components/tuya/common.yaml +++ b/tests/components/tuya/common.yaml @@ -2,12 +2,6 @@ wifi: ssid: MySSID password: password1 -uart: - - id: uart_tuya - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - tuya: status_pin: number: ${status_pin} diff --git a/tests/components/tuya/test.esp32-c3-idf.yaml b/tests/components/tuya/test.esp32-c3-idf.yaml index c62a0b10f6..43c28ba7b3 100644 --- a/tests/components/tuya/test.esp32-c3-idf.yaml +++ b/tests/components/tuya/test.esp32-c3-idf.yaml @@ -1,6 +1,6 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 status_pin: GPIO2 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/tuya/test.esp32-idf.yaml b/tests/components/tuya/test.esp32-idf.yaml index 926a46cf73..0baa48a6c5 100644 --- a/tests/components/tuya/test.esp32-idf.yaml +++ b/tests/components/tuya/test.esp32-idf.yaml @@ -1,6 +1,9 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 status_pin: GPIO12 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/tuya/test.esp8266-ard.yaml b/tests/components/tuya/test.esp8266-ard.yaml index 11d46ed50e..1565495cf8 100644 --- a/tests/components/tuya/test.esp8266-ard.yaml +++ b/tests/components/tuya/test.esp8266-ard.yaml @@ -1,6 +1,9 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 - status_pin: GPIO12 + tx_pin: GPIO0 + rx_pin: GPIO2 + status_pin: GPIO15 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/tuya/test.rp2040-ard.yaml b/tests/components/tuya/test.rp2040-ard.yaml index 11d46ed50e..0c3db54644 100644 --- a/tests/components/tuya/test.rp2040-ard.yaml +++ b/tests/components/tuya/test.rp2040-ard.yaml @@ -3,4 +3,7 @@ substitutions: rx_pin: GPIO5 status_pin: GPIO12 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/udp/test.esp32-c3-idf.yaml b/tests/components/udp/test.esp32-c3-idf.yaml index dade44d145..9990d96d29 100644 --- a/tests/components/udp/test.esp32-c3-idf.yaml +++ b/tests/components/udp/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/udp/test.esp32-idf.yaml b/tests/components/udp/test.esp32-idf.yaml index dade44d145..b47e39c389 100644 --- a/tests/components/udp/test.esp32-idf.yaml +++ b/tests/components/udp/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/udp/test.esp8266-ard.yaml b/tests/components/udp/test.esp8266-ard.yaml index dade44d145..4a98b9388a 100644 --- a/tests/components/udp/test.esp8266-ard.yaml +++ b/tests/components/udp/test.esp8266-ard.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/udp/test.host.yaml b/tests/components/udp/test.host.yaml index e735c37e4d..84e78894e5 100644 --- a/tests/components/udp/test.host.yaml +++ b/tests/components/udp/test.host.yaml @@ -1,4 +1,15 @@ -packages: - common: !include common.yaml - -wifi: !remove +udp: + id: my_udp + listen_address: 239.0.60.53 + addresses: ["239.0.60.53"] + on_receive: + - logger.log: + format: "Received %d bytes" + args: [data.size()] + - udp.write: + id: my_udp + data: "hello world" + - udp.write: + id: my_udp + data: !lambda |- + return std::vector{1,3,4,5,6}; diff --git a/tests/components/udp/test.rp2040-ard.yaml b/tests/components/udp/test.rp2040-ard.yaml index dade44d145..319a7c71a6 100644 --- a/tests/components/udp/test.rp2040-ard.yaml +++ b/tests/components/udp/test.rp2040-ard.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/ufire_ec/common.yaml b/tests/components/ufire_ec/common.yaml index dcc957aaee..4260f0ab4c 100644 --- a/tests/components/ufire_ec/common.yaml +++ b/tests/components/ufire_ec/common.yaml @@ -7,16 +7,12 @@ esphome: temperature: !lambda "return id(test_sensor).state;" - ufire_ec.reset: -i2c: - - id: i2c_ufire_ec - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: template id: test_sensor lambda: "return 21;" - platform: ufire_ec + i2c_id: i2c_bus id: ufire_ec_board ec: name: Ufire EC diff --git a/tests/components/ufire_ec/test.esp32-c3-idf.yaml b/tests/components/ufire_ec/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ufire_ec/test.esp32-c3-idf.yaml +++ b/tests/components/ufire_ec/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ufire_ec/test.esp32-idf.yaml b/tests/components/ufire_ec/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ufire_ec/test.esp32-idf.yaml +++ b/tests/components/ufire_ec/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ufire_ec/test.esp8266-ard.yaml b/tests/components/ufire_ec/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ufire_ec/test.esp8266-ard.yaml +++ b/tests/components/ufire_ec/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ufire_ec/test.rp2040-ard.yaml b/tests/components/ufire_ec/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ufire_ec/test.rp2040-ard.yaml +++ b/tests/components/ufire_ec/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/ufire_ise/common.yaml b/tests/components/ufire_ise/common.yaml index d6ead8c479..f7865ea87b 100644 --- a/tests/components/ufire_ise/common.yaml +++ b/tests/components/ufire_ise/common.yaml @@ -9,16 +9,12 @@ esphome: solution: 4.0 - ufire_ise.reset: -i2c: - - id: i2c_ufire_ise - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: template id: test_sensor lambda: "return 21;" - platform: ufire_ise + i2c_id: i2c_bus id: ufire_ise_sensor temperature_sensor: test_sensor ph: diff --git a/tests/components/ufire_ise/test.esp32-c3-idf.yaml b/tests/components/ufire_ise/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/ufire_ise/test.esp32-c3-idf.yaml +++ b/tests/components/ufire_ise/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/ufire_ise/test.esp32-idf.yaml b/tests/components/ufire_ise/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/ufire_ise/test.esp32-idf.yaml +++ b/tests/components/ufire_ise/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/ufire_ise/test.esp8266-ard.yaml b/tests/components/ufire_ise/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/ufire_ise/test.esp8266-ard.yaml +++ b/tests/components/ufire_ise/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/ufire_ise/test.rp2040-ard.yaml b/tests/components/ufire_ise/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/ufire_ise/test.rp2040-ard.yaml +++ b/tests/components/ufire_ise/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/update/common.yaml b/tests/components/update/common.yaml index 45ed110352..521a0a6a5c 100644 --- a/tests/components/update/common.yaml +++ b/tests/components/update/common.yaml @@ -21,10 +21,12 @@ http_request: ota: - platform: http_request + id: update_http_request_ota update: - platform: http_request name: Firmware Update + ota_id: update_http_request_ota source: http://example.com/manifest.json on_update_available: - logger.log: "A new update is available" diff --git a/tests/components/uponor_smatrix/common.yaml b/tests/components/uponor_smatrix/common.yaml index 8ee92bdfc5..786a604aec 100644 --- a/tests/components/uponor_smatrix/common.yaml +++ b/tests/components/uponor_smatrix/common.yaml @@ -2,12 +2,6 @@ wifi: ssid: MySSID password: password1 -uart: - - id: uponor_uart - baud_rate: 19200 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - time: - platform: sntp id: sntp_time @@ -17,7 +11,6 @@ time: - 192.168.178.1 uponor_smatrix: - uart_id: uponor_uart address: 0x110B time_id: sntp_time time_device_address: 0xDE13 diff --git a/tests/components/uponor_smatrix/test.esp32-c3-idf.yaml b/tests/components/uponor_smatrix/test.esp32-c3-idf.yaml index b516342f3b..cd26c783c2 100644 --- a/tests/components/uponor_smatrix/test.esp32-c3-idf.yaml +++ b/tests/components/uponor_smatrix/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart_19200: !include ../../test_build_components/common/uart_19200/esp32-c3-idf.yaml + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/uponor_smatrix/test.esp32-idf.yaml b/tests/components/uponor_smatrix/test.esp32-idf.yaml index f486544afa..76222997a8 100644 --- a/tests/components/uponor_smatrix/test.esp32-idf.yaml +++ b/tests/components/uponor_smatrix/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 +packages: + uart_19200: !include ../../test_build_components/common/uart_19200/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/uponor_smatrix/test.esp8266-ard.yaml b/tests/components/uponor_smatrix/test.esp8266-ard.yaml index b516342f3b..1f4483954b 100644 --- a/tests/components/uponor_smatrix/test.esp8266-ard.yaml +++ b/tests/components/uponor_smatrix/test.esp8266-ard.yaml @@ -1,5 +1,5 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart_19200: !include ../../test_build_components/common/uart_19200/esp8266-ard.yaml + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/uponor_smatrix/test.rp2040-ard.yaml b/tests/components/uponor_smatrix/test.rp2040-ard.yaml index b516342f3b..65ba185aef 100644 --- a/tests/components/uponor_smatrix/test.rp2040-ard.yaml +++ b/tests/components/uponor_smatrix/test.rp2040-ard.yaml @@ -1,5 +1,5 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart_19200: !include ../../test_build_components/common/uart_19200/rp2040-ard.yaml + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/usb_host/test.esp32-s3-idf.yaml b/tests/components/usb_host/test.esp32-s3-idf.yaml index a2892872e5..5360d1f6ff 100644 --- a/tests/components/usb_host/test.esp32-s3-idf.yaml +++ b/tests/components/usb_host/test.esp32-s3-idf.yaml @@ -1,4 +1,5 @@ usb_host: + max_transfer_requests: 32 # Test uint32_t bitmask path (17-32 requests) devices: - id: device_1 vid: 0x1234 diff --git a/tests/components/vbus/common.yaml b/tests/components/vbus/common.yaml index a1f94cd839..33d9e2935d 100644 --- a/tests/components/vbus/common.yaml +++ b/tests/components/vbus/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_vbus - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - vbus: binary_sensor: diff --git a/tests/components/vbus/test.esp32-c3-idf.yaml b/tests/components/vbus/test.esp32-c3-idf.yaml index b516342f3b..a19013bf54 100644 --- a/tests/components/vbus/test.esp32-c3-idf.yaml +++ b/tests/components/vbus/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/vbus/test.esp32-idf.yaml b/tests/components/vbus/test.esp32-idf.yaml index f486544afa..2d29656c94 100644 --- a/tests/components/vbus/test.esp32-idf.yaml +++ b/tests/components/vbus/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/vbus/test.esp8266-ard.yaml b/tests/components/vbus/test.esp8266-ard.yaml index b516342f3b..5a05efa259 100644 --- a/tests/components/vbus/test.esp8266-ard.yaml +++ b/tests/components/vbus/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/vbus/test.rp2040-ard.yaml b/tests/components/vbus/test.rp2040-ard.yaml index b516342f3b..f1df2daf83 100644 --- a/tests/components/vbus/test.rp2040-ard.yaml +++ b/tests/components/vbus/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/veml3235/common.yaml b/tests/components/veml3235/common.yaml index b89a9e12c7..98ffb0729c 100644 --- a/tests/components/veml3235/common.yaml +++ b/tests/components/veml3235/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_veml3235 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: veml3235 + i2c_id: i2c_bus id: veml3235_sensor name: VEML3235 Light Sensor auto_gain: true diff --git a/tests/components/veml3235/test.esp32-c3-idf.yaml b/tests/components/veml3235/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/veml3235/test.esp32-c3-idf.yaml +++ b/tests/components/veml3235/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/veml3235/test.esp32-idf.yaml b/tests/components/veml3235/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/veml3235/test.esp32-idf.yaml +++ b/tests/components/veml3235/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/veml3235/test.esp8266-ard.yaml b/tests/components/veml3235/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/veml3235/test.esp8266-ard.yaml +++ b/tests/components/veml3235/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/veml3235/test.rp2040-ard.yaml b/tests/components/veml3235/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/veml3235/test.rp2040-ard.yaml +++ b/tests/components/veml3235/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/veml7700/common.yaml b/tests/components/veml7700/common.yaml index af4ebee6e7..06c1d304c3 100644 --- a/tests/components/veml7700/common.yaml +++ b/tests/components/veml7700/common.yaml @@ -1,12 +1,7 @@ -i2c: - - id: i2c_veml7700 - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: veml7700 + i2c_id: i2c_bus address: 0x10 - i2c_id: i2c_veml7700 ambient_light: Ambient light ambient_light_counts: Ambient light counts full_spectrum: Full spectrum diff --git a/tests/components/veml7700/test.esp32-c3-idf.yaml b/tests/components/veml7700/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/veml7700/test.esp32-c3-idf.yaml +++ b/tests/components/veml7700/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/veml7700/test.esp32-idf.yaml b/tests/components/veml7700/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/veml7700/test.esp32-idf.yaml +++ b/tests/components/veml7700/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/veml7700/test.esp8266-ard.yaml b/tests/components/veml7700/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/veml7700/test.esp8266-ard.yaml +++ b/tests/components/veml7700/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/veml7700/test.rp2040-ard.yaml b/tests/components/veml7700/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/veml7700/test.rp2040-ard.yaml +++ b/tests/components/veml7700/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/vl53l0x/common.yaml b/tests/components/vl53l0x/common.yaml index 8346eae854..98277639cf 100644 --- a/tests/components/vl53l0x/common.yaml +++ b/tests/components/vl53l0x/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_vl53l0x - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: vl53l0x + i2c_id: i2c_bus name: VL53L0x Distance address: 0x29 enable_pin: 3 diff --git a/tests/components/vl53l0x/test.esp32-c3-idf.yaml b/tests/components/vl53l0x/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/vl53l0x/test.esp32-c3-idf.yaml +++ b/tests/components/vl53l0x/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/vl53l0x/test.esp32-idf.yaml b/tests/components/vl53l0x/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/vl53l0x/test.esp32-idf.yaml +++ b/tests/components/vl53l0x/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/vl53l0x/test.esp8266-ard.yaml b/tests/components/vl53l0x/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/vl53l0x/test.esp8266-ard.yaml +++ b/tests/components/vl53l0x/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/vl53l0x/test.rp2040-ard.yaml b/tests/components/vl53l0x/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/vl53l0x/test.rp2040-ard.yaml +++ b/tests/components/vl53l0x/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/voice_assistant/common-idf.yaml b/tests/components/voice_assistant/common-idf.yaml index b1d249d5b4..ab8cbf2434 100644 --- a/tests/components/voice_assistant/common-idf.yaml +++ b/tests/components/voice_assistant/common-idf.yaml @@ -18,6 +18,7 @@ i2s_audio: micro_wake_word: id: mww_id + microphone: mic_id_external on_wake_word_detected: - voice_assistant.start: wake_word: !lambda return wake_word; diff --git a/tests/components/voice_assistant/test.esp32-idf.yaml b/tests/components/voice_assistant/test.esp32-idf.yaml index 0fe5d347be..1c5c9ddf99 100644 --- a/tests/components/voice_assistant/test.esp32-idf.yaml +++ b/tests/components/voice_assistant/test.esp32-idf.yaml @@ -1,6 +1,6 @@ substitutions: - i2s_lrclk_pin: GPIO16 - i2s_bclk_pin: GPIO17 + i2s_lrclk_pin: GPIO4 + i2s_bclk_pin: GPIO5 i2s_mclk_pin: GPIO15 i2s_din_pin: GPIO13 i2s_dout_pin: GPIO12 diff --git a/tests/components/wake_on_lan/test.esp32-c3-idf.yaml b/tests/components/wake_on_lan/test.esp32-c3-idf.yaml index dade44d145..9990d96d29 100644 --- a/tests/components/wake_on_lan/test.esp32-c3-idf.yaml +++ b/tests/components/wake_on_lan/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wake_on_lan/test.esp32-idf.yaml b/tests/components/wake_on_lan/test.esp32-idf.yaml index dade44d145..b47e39c389 100644 --- a/tests/components/wake_on_lan/test.esp32-idf.yaml +++ b/tests/components/wake_on_lan/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wake_on_lan/test.esp8266-ard.yaml b/tests/components/wake_on_lan/test.esp8266-ard.yaml index dade44d145..4a98b9388a 100644 --- a/tests/components/wake_on_lan/test.esp8266-ard.yaml +++ b/tests/components/wake_on_lan/test.esp8266-ard.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/wake_on_lan/test.rp2040-ard.yaml b/tests/components/wake_on_lan/test.rp2040-ard.yaml index dade44d145..319a7c71a6 100644 --- a/tests/components/wake_on_lan/test.rp2040-ard.yaml +++ b/tests/components/wake_on_lan/test.rp2040-ard.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/waveshare_epaper/common.yaml b/tests/components/waveshare_epaper/common.yaml index a2aa3134b5..b80a352c1f 100644 --- a/tests/components/waveshare_epaper/common.yaml +++ b/tests/components/waveshare_epaper/common.yaml @@ -1,14 +1,8 @@ -spi: - - id: spi_waveshare_epaper - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - display: # 1.54 inch displays - platform: waveshare_epaper id: epd_1_54 model: 1.54in - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -28,7 +22,6 @@ display: - platform: waveshare_epaper id: epd_1_54v2 model: 1.54inv2 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -48,7 +41,6 @@ display: - platform: waveshare_epaper id: epd_1_54v2b model: 1.54inv2-b - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -67,7 +59,6 @@ display: - platform: waveshare_epaper id: epd_1_54m09 model: 1.54in-m5coreink-m09 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -87,7 +78,6 @@ display: - platform: waveshare_epaper id: epd_2_13 model: 2.13in - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -107,7 +97,6 @@ display: - platform: waveshare_epaper id: epd_2_13v2 model: 2.13inv2 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -127,7 +116,6 @@ display: - platform: waveshare_epaper id: epd_2_13ttgo model: 2.13in-ttgo - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -147,7 +135,6 @@ display: - platform: waveshare_epaper id: epd_2_13ttgo_b1 model: 2.13in-ttgo-b1 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -167,7 +154,6 @@ display: - platform: waveshare_epaper id: epd_2_13ttgo_b73 model: 2.13in-ttgo-b73 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -187,7 +173,6 @@ display: - platform: waveshare_epaper id: epd_2_13ttgo_b74 model: 2.13in-ttgo-b74 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -207,7 +192,6 @@ display: - platform: waveshare_epaper id: epd_2_13dke model: 2.13in-ttgo-dke - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -227,7 +211,6 @@ display: - platform: waveshare_epaper id: epd_2_13v3 model: 2.13inv3 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -248,7 +231,6 @@ display: - platform: waveshare_epaper id: epd_2_70 model: 2.70in - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -267,7 +249,6 @@ display: - platform: waveshare_epaper id: epd_2_70b model: 2.70in-b - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -286,7 +267,6 @@ display: - platform: waveshare_epaper id: epd_2_70bv2 model: 2.70in-bv2 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -305,7 +285,6 @@ display: - platform: waveshare_epaper id: epd_2_70v2 model: 2.70inv2 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -325,7 +304,6 @@ display: - platform: waveshare_epaper id: epd_2_90 model: 2.90in - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -346,7 +324,6 @@ display: - platform: waveshare_epaper id: epd_2_90v2 model: 2.90inv2 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -367,7 +344,6 @@ display: - platform: waveshare_epaper id: epd_2_90b model: 2.90in-b - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -386,7 +362,6 @@ display: - platform: waveshare_epaper id: epd_2_90bv3 model: 2.90in-bv3 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -405,7 +380,6 @@ display: - platform: waveshare_epaper id: epd_2_90v2r2 model: 2.90inv2-r2 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -425,7 +399,6 @@ display: - platform: waveshare_epaper id: epd_2_90dke model: 2.90in-dke - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -446,7 +419,6 @@ display: - platform: waveshare_epaper id: epd_gdew029t5 model: gdew029t5 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -466,7 +438,6 @@ display: - platform: waveshare_epaper id: epd_gdew042t81 model: gdey042t81 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -487,7 +458,6 @@ display: - platform: waveshare_epaper id: epd_4_20 model: 4.20in - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -506,7 +476,6 @@ display: - platform: waveshare_epaper id: epd_4_20bv2 model: 4.20in-bv2 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -525,7 +494,6 @@ display: - platform: waveshare_epaper id: epd_4_20in_bv2_bwr model: 4.20in-bv2-bwr - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -545,7 +513,6 @@ display: - platform: waveshare_epaper id: epd_5_65 model: 5.65in-f - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -565,7 +532,6 @@ display: - platform: waveshare_epaper id: epd_5_83 model: 5.83in - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -584,7 +550,6 @@ display: - platform: waveshare_epaper id: epd_5_83v2 model: 5.83inv2 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -604,7 +569,6 @@ display: - platform: waveshare_epaper id: epd_7_50 model: 7.50in - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -623,7 +587,6 @@ display: - platform: waveshare_epaper id: epd_7_50bv2 model: 7.50in-bv2 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -642,7 +605,6 @@ display: - platform: waveshare_epaper id: epd_7_50bv3 model: 7.50in-bv3 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -661,7 +623,6 @@ display: - platform: waveshare_epaper id: epd_7_50bv3_bwr model: 7.50in-bv3-bwr - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -680,7 +641,6 @@ display: - platform: waveshare_epaper id: epd_7_50bc model: 7.50in-bc - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -699,7 +659,6 @@ display: - platform: waveshare_epaper id: epd_7_50v2 model: 7.50inv2 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -718,7 +677,6 @@ display: - platform: waveshare_epaper id: epd_7_50v2alt model: 7.50inv2alt - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -737,7 +695,6 @@ display: - platform: waveshare_epaper id: epd_7_50inv2p model: 7.50inv2p - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -757,7 +714,6 @@ display: - platform: waveshare_epaper id: epd_7_50hdb model: 7.50in-hd-b - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -777,7 +733,6 @@ display: - platform: waveshare_epaper id: epd_13_3k model: 13.3in-k - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -795,7 +750,6 @@ display: - platform: waveshare_epaper model: 2.90in-d - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -814,7 +768,6 @@ display: - platform: waveshare_epaper model: 2.90in - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -834,7 +787,6 @@ display: - platform: waveshare_epaper model: 2.90inv2 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -853,7 +805,6 @@ display: - platform: waveshare_epaper model: 2.70in-b - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} @@ -871,7 +822,6 @@ display: - platform: waveshare_epaper model: 2.70in-bv2 - spi_id: spi_waveshare_epaper cs_pin: allow_other_uses: true number: ${cs_pin} diff --git a/tests/components/waveshare_epaper/test.esp32-c3-idf.yaml b/tests/components/waveshare_epaper/test.esp32-c3-idf.yaml index 4cb230f6f2..bdd7e1d350 100644 --- a/tests/components/waveshare_epaper/test.esp32-c3-idf.yaml +++ b/tests/components/waveshare_epaper/test.esp32-c3-idf.yaml @@ -1,9 +1,9 @@ substitutions: - clk_pin: GPIO6 - mosi_pin: GPIO7 - cs_pin: GPIO4 + cs_pin: GPIO7 dc_pin: GPIO1 busy_pin: GPIO2 reset_pin: GPIO3 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/waveshare_epaper/test.esp32-idf.yaml b/tests/components/waveshare_epaper/test.esp32-idf.yaml index 9e8b2fdec8..b7b12c8c66 100644 --- a/tests/components/waveshare_epaper/test.esp32-idf.yaml +++ b/tests/components/waveshare_epaper/test.esp32-idf.yaml @@ -1,9 +1,10 @@ substitutions: - clk_pin: GPIO16 - mosi_pin: GPIO17 cs_pin: GPIO4 dc_pin: GPIO5 - busy_pin: GPIO18 - reset_pin: GPIO19 + busy_pin: GPIO14 + reset_pin: GPIO15 + +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/waveshare_epaper/test.esp8266-ard.yaml b/tests/components/waveshare_epaper/test.esp8266-ard.yaml index ee8199bcc0..92452c840a 100644 --- a/tests/components/waveshare_epaper/test.esp8266-ard.yaml +++ b/tests/components/waveshare_epaper/test.esp8266-ard.yaml @@ -1,9 +1,12 @@ substitutions: - clk_pin: GPIO14 - mosi_pin: GPIO13 + clk_pin: GPIO0 + mosi_pin: GPIO2 cs_pin: GPIO4 dc_pin: GPIO5 busy_pin: GPIO15 reset_pin: GPIO16 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/waveshare_epaper/test.rp2040-ard.yaml b/tests/components/waveshare_epaper/test.rp2040-ard.yaml index e92f6d421d..e9e001cdd4 100644 --- a/tests/components/waveshare_epaper/test.rp2040-ard.yaml +++ b/tests/components/waveshare_epaper/test.rp2040-ard.yaml @@ -6,4 +6,7 @@ substitutions: busy_pin: GPIO7 reset_pin: GPIO8 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/web_server/test_ota.esp32-idf.yaml b/tests/components/web_server/test_ota.esp32-idf.yaml index 99873aa27b..98b080386b 100644 --- a/tests/components/web_server/test_ota.esp32-idf.yaml +++ b/tests/components/web_server/test_ota.esp32-idf.yaml @@ -12,8 +12,10 @@ packages: # Enable OTA for multipart upload testing ota: - platform: esphome + id: web_server_esphome_ota password: "test_ota_password" - platform: web_server + id: web_server_web_server_ota # Web server configuration web_server: diff --git a/tests/components/wifi_info/test.esp32-c3-idf.yaml b/tests/components/wifi_info/test.esp32-c3-idf.yaml index dade44d145..9990d96d29 100644 --- a/tests/components/wifi_info/test.esp32-c3-idf.yaml +++ b/tests/components/wifi_info/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wifi_info/test.esp32-idf.yaml b/tests/components/wifi_info/test.esp32-idf.yaml index dade44d145..b47e39c389 100644 --- a/tests/components/wifi_info/test.esp32-idf.yaml +++ b/tests/components/wifi_info/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wifi_info/test.esp8266-ard.yaml b/tests/components/wifi_info/test.esp8266-ard.yaml index dade44d145..4a98b9388a 100644 --- a/tests/components/wifi_info/test.esp8266-ard.yaml +++ b/tests/components/wifi_info/test.esp8266-ard.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/wifi_info/test.rp2040-ard.yaml b/tests/components/wifi_info/test.rp2040-ard.yaml index dade44d145..319a7c71a6 100644 --- a/tests/components/wifi_info/test.rp2040-ard.yaml +++ b/tests/components/wifi_info/test.rp2040-ard.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/wireguard/test.esp32-c3-idf.yaml b/tests/components/wireguard/test.esp32-c3-idf.yaml index dade44d145..9990d96d29 100644 --- a/tests/components/wireguard/test.esp32-c3-idf.yaml +++ b/tests/components/wireguard/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wireguard/test.esp32-idf.yaml b/tests/components/wireguard/test.esp32-idf.yaml index 2798f8e566..90dbc1cf7d 100644 --- a/tests/components/wireguard/test.esp32-idf.yaml +++ b/tests/components/wireguard/test.esp32-idf.yaml @@ -1,3 +1,6 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + <<: !include common.yaml network: diff --git a/tests/components/wireguard/test.esp8266-ard.yaml b/tests/components/wireguard/test.esp8266-ard.yaml index 2798f8e566..ae6a3d6ce0 100644 --- a/tests/components/wireguard/test.esp8266-ard.yaml +++ b/tests/components/wireguard/test.esp8266-ard.yaml @@ -1,3 +1,6 @@ +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml + <<: !include common.yaml network: diff --git a/tests/components/wk2132_i2c/common.yaml b/tests/components/wk2132_i2c/common.yaml index 942e01aafc..39013baeb2 100644 --- a/tests/components/wk2132_i2c/common.yaml +++ b/tests/components/wk2132_i2c/common.yaml @@ -1,14 +1,7 @@ -i2c: - id: i2c_bus - scl: ${scl_pin} - sda: ${sda_pin} - scan: true - frequency: 600kHz - wk2132_i2c: - id: wk2132_i2c_id - address: 0x70 i2c_id: i2c_bus + address: 0x70 uart: - id: wk2132_id_0 channel: 0 diff --git a/tests/components/wk2132_i2c/test.esp32-idf.yaml b/tests/components/wk2132_i2c/test.esp32-idf.yaml index 3b761d3fc1..b47e39c389 100644 --- a/tests/components/wk2132_i2c/test.esp32-idf.yaml +++ b/tests/components/wk2132_i2c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO22 - sda_pin: GPIO21 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/wk2132_i2c/test.esp32-s3-idf.yaml b/tests/components/wk2132_i2c/test.esp32-s3-idf.yaml index 4942e3c2b3..e9d826aa7c 100644 --- a/tests/components/wk2132_i2c/test.esp32-s3-idf.yaml +++ b/tests/components/wk2132_i2c/test.esp32-s3-idf.yaml @@ -2,4 +2,7 @@ substitutions: scl_pin: GPIO40 sda_pin: GPIO41 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-s3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wk2132_spi/common.yaml b/tests/components/wk2132_spi/common.yaml index a077b36998..a762c10c92 100644 --- a/tests/components/wk2132_spi/common.yaml +++ b/tests/components/wk2132_spi/common.yaml @@ -1,13 +1,6 @@ -spi: - id: spi_bus - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - wk2132_spi: - id: wk2132_spi_id cs_pin: ${cs_pin} - spi_id: spi_bus crystal: 11059200 data_rate: 1MHz uart: diff --git a/tests/components/wk2132_spi/test.esp32-idf.yaml b/tests/components/wk2132_spi/test.esp32-idf.yaml index 76e7138ab0..a3352cf880 100644 --- a/tests/components/wk2132_spi/test.esp32-idf.yaml +++ b/tests/components/wk2132_spi/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO18 - miso_pin: GPIO19 - mosi_pin: GPIO23 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wk2132_spi/test.esp32-s3-idf.yaml b/tests/components/wk2132_spi/test.esp32-s3-idf.yaml index b0aadf620a..6a60c90fb2 100644 --- a/tests/components/wk2132_spi/test.esp32-s3-idf.yaml +++ b/tests/components/wk2132_spi/test.esp32-s3-idf.yaml @@ -4,4 +4,7 @@ substitutions: mosi_pin: GPIO6 cs_pin: GPIO19 +packages: + spi: !include ../../test_build_components/common/spi/esp32-s3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wk2168_i2c/common.yaml b/tests/components/wk2168_i2c/common.yaml index 10463e8abf..49f0d1ec6b 100644 --- a/tests/components/wk2168_i2c/common.yaml +++ b/tests/components/wk2168_i2c/common.yaml @@ -1,35 +1,28 @@ -i2c: - id: i2c_bus - scl: ${scl_pin} - sda: ${sda_pin} - scan: true - frequency: 600kHz - # component declaration wk2168_i2c: - - id: bridge_i2c + - id: wk2168_i2c_bridge i2c_id: i2c_bus address: 0x70 uart: - - id: id0 + - id: wk2168_i2c_uart0 channel: 0 baud_rate: 115200 stop_bits: 1 parity: none - - id: id1 + - id: wk2168_i2c_uart1 channel: 1 baud_rate: 115200 - - id: id2 + - id: wk2168_i2c_uart2 channel: 2 baud_rate: 115200 - - id: id3 + - id: wk2168_i2c_uart3 channel: 3 baud_rate: 9600 # Ensures a sensor doesn't break validation sensor: - platform: a02yyuw - uart_id: id3 + uart_id: wk2168_i2c_uart3 id: distance_sensor # individual binary_sensor inputs @@ -37,14 +30,14 @@ binary_sensor: - platform: gpio name: "pin_0" pin: - wk2168_i2c: bridge_i2c + wk2168_i2c: wk2168_i2c_bridge number: 0 mode: input: true - platform: gpio name: "pin_1" pin: - wk2168_i2c: bridge_i2c + wk2168_i2c: wk2168_i2c_bridge number: 1 mode: input: true @@ -55,14 +48,14 @@ switch: - platform: gpio name: "pin_2" pin: - wk2168_i2c: bridge_i2c + wk2168_i2c: wk2168_i2c_bridge number: 2 mode: output: true - platform: gpio name: "pin_3" pin: - wk2168_i2c: bridge_i2c + wk2168_i2c: wk2168_i2c_bridge number: 3 mode: output: true diff --git a/tests/components/wk2168_i2c/test.esp32-idf.yaml b/tests/components/wk2168_i2c/test.esp32-idf.yaml index 3b761d3fc1..b47e39c389 100644 --- a/tests/components/wk2168_i2c/test.esp32-idf.yaml +++ b/tests/components/wk2168_i2c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO22 - sda_pin: GPIO21 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/wk2168_i2c/test.esp32-s3-idf.yaml b/tests/components/wk2168_i2c/test.esp32-s3-idf.yaml index 4942e3c2b3..e9d826aa7c 100644 --- a/tests/components/wk2168_i2c/test.esp32-s3-idf.yaml +++ b/tests/components/wk2168_i2c/test.esp32-s3-idf.yaml @@ -2,4 +2,7 @@ substitutions: scl_pin: GPIO40 sda_pin: GPIO41 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-s3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wk2168_spi/common.yaml b/tests/components/wk2168_spi/common.yaml index fb126193fc..b402077aa3 100644 --- a/tests/components/wk2168_spi/common.yaml +++ b/tests/components/wk2168_spi/common.yaml @@ -1,35 +1,28 @@ -spi: - id: spi_bus - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - wk2168_spi: - - id: bridge_spi + - id: wk2168_spi_bridge cs_pin: ${cs_pin} - spi_id: spi_bus crystal: 11059200 data_rate: 1MHz uart: - - id: id0 + - id: wk2168_spi_uart0 channel: 0 baud_rate: 115200 stop_bits: 1 parity: none - - id: id1 + - id: wk2168_spi_uart1 channel: 1 baud_rate: 115200 - - id: id2 + - id: wk2168_spi_uart2 channel: 2 baud_rate: 115200 - - id: id3 + - id: wk2168_spi_uart3 channel: 3 baud_rate: 9600 # Ensures a sensor doesn't break validation sensor: - platform: a02yyuw - uart_id: id3 + uart_id: wk2168_spi_uart3 id: distance_sensor # individual binary_sensor inputs @@ -37,14 +30,14 @@ binary_sensor: - platform: gpio name: "pin_0" pin: - wk2168_spi: bridge_spi + wk2168_spi: wk2168_spi_bridge number: 0 mode: input: true - platform: gpio name: "pin_1" pin: - wk2168_spi: bridge_spi + wk2168_spi: wk2168_spi_bridge number: 1 mode: input: true @@ -55,14 +48,14 @@ switch: - platform: gpio name: "pin_2" pin: - wk2168_spi: bridge_spi + wk2168_spi: wk2168_spi_bridge number: 2 mode: output: true - platform: gpio name: "pin_3" pin: - wk2168_spi: bridge_spi + wk2168_spi: wk2168_spi_bridge number: 3 mode: output: true diff --git a/tests/components/wk2168_spi/test.esp32-idf.yaml b/tests/components/wk2168_spi/test.esp32-idf.yaml index 76e7138ab0..a3352cf880 100644 --- a/tests/components/wk2168_spi/test.esp32-idf.yaml +++ b/tests/components/wk2168_spi/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO18 - miso_pin: GPIO19 - mosi_pin: GPIO23 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wk2168_spi/test.esp32-s3-idf.yaml b/tests/components/wk2168_spi/test.esp32-s3-idf.yaml index b0aadf620a..6a60c90fb2 100644 --- a/tests/components/wk2168_spi/test.esp32-s3-idf.yaml +++ b/tests/components/wk2168_spi/test.esp32-s3-idf.yaml @@ -4,4 +4,7 @@ substitutions: mosi_pin: GPIO6 cs_pin: GPIO19 +packages: + spi: !include ../../test_build_components/common/spi/esp32-s3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wk2204_i2c/common.yaml b/tests/components/wk2204_i2c/common.yaml index 70c0f4babf..863633937b 100644 --- a/tests/components/wk2204_i2c/common.yaml +++ b/tests/components/wk2204_i2c/common.yaml @@ -1,10 +1,3 @@ -i2c: - id: i2c_bus - scl: ${scl_pin} - sda: ${sda_pin} - scan: true - frequency: 600kHz - wk2204_i2c: - id: wk2204_i2c_id i2c_id: i2c_bus diff --git a/tests/components/wk2204_i2c/test.esp32-idf.yaml b/tests/components/wk2204_i2c/test.esp32-idf.yaml index 3b761d3fc1..b47e39c389 100644 --- a/tests/components/wk2204_i2c/test.esp32-idf.yaml +++ b/tests/components/wk2204_i2c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO22 - sda_pin: GPIO21 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/wk2204_i2c/test.esp32-s3-idf.yaml b/tests/components/wk2204_i2c/test.esp32-s3-idf.yaml index 4942e3c2b3..e9d826aa7c 100644 --- a/tests/components/wk2204_i2c/test.esp32-s3-idf.yaml +++ b/tests/components/wk2204_i2c/test.esp32-s3-idf.yaml @@ -2,4 +2,7 @@ substitutions: scl_pin: GPIO40 sda_pin: GPIO41 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-s3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wk2204_spi/common.yaml b/tests/components/wk2204_spi/common.yaml index a08cdb906f..939c54cc40 100644 --- a/tests/components/wk2204_spi/common.yaml +++ b/tests/components/wk2204_spi/common.yaml @@ -1,13 +1,6 @@ -spi: - id: spi_bus - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - wk2204_spi: - id: wk2204_spi_id cs_pin: ${cs_pin} - spi_id: spi_bus crystal: 11059200 data_rate: 1MHz uart: diff --git a/tests/components/wk2204_spi/test.esp32-idf.yaml b/tests/components/wk2204_spi/test.esp32-idf.yaml index 76e7138ab0..a3352cf880 100644 --- a/tests/components/wk2204_spi/test.esp32-idf.yaml +++ b/tests/components/wk2204_spi/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO18 - miso_pin: GPIO19 - mosi_pin: GPIO23 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wk2204_spi/test.esp32-s3-idf.yaml b/tests/components/wk2204_spi/test.esp32-s3-idf.yaml index b0aadf620a..6a60c90fb2 100644 --- a/tests/components/wk2204_spi/test.esp32-s3-idf.yaml +++ b/tests/components/wk2204_spi/test.esp32-s3-idf.yaml @@ -4,4 +4,7 @@ substitutions: mosi_pin: GPIO6 cs_pin: GPIO19 +packages: + spi: !include ../../test_build_components/common/spi/esp32-s3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wk2212_i2c/common.yaml b/tests/components/wk2212_i2c/common.yaml index 0759ef8688..a754bec5c7 100644 --- a/tests/components/wk2212_i2c/common.yaml +++ b/tests/components/wk2212_i2c/common.yaml @@ -1,13 +1,6 @@ -i2c: - id: i2c_bus - scl: ${scl_pin} - sda: ${sda_pin} - scan: true - frequency: 600kHz - # component declaration wk2212_i2c: - - id: bridge_i2c + - id: wk2212_i2c_bridge i2c_id: i2c_bus address: 0x70 uart: @@ -33,14 +26,14 @@ binary_sensor: - platform: gpio name: "pin_0" pin: - wk2212_i2c: bridge_i2c + wk2212_i2c: wk2212_i2c_bridge number: 0 mode: input: true - platform: gpio name: "pin_1" pin: - wk2212_i2c: bridge_i2c + wk2212_i2c: wk2212_i2c_bridge number: 1 mode: input: true @@ -51,14 +44,14 @@ switch: - platform: gpio name: "pin_2" pin: - wk2212_i2c: bridge_i2c + wk2212_i2c: wk2212_i2c_bridge number: 2 mode: output: true - platform: gpio name: "pin_3" pin: - wk2212_i2c: bridge_i2c + wk2212_i2c: wk2212_i2c_bridge number: 3 mode: output: true diff --git a/tests/components/wk2212_i2c/test.esp32-idf.yaml b/tests/components/wk2212_i2c/test.esp32-idf.yaml index 3b761d3fc1..b47e39c389 100644 --- a/tests/components/wk2212_i2c/test.esp32-idf.yaml +++ b/tests/components/wk2212_i2c/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO22 - sda_pin: GPIO21 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/wk2212_i2c/test.esp32-s3-idf.yaml b/tests/components/wk2212_i2c/test.esp32-s3-idf.yaml index 4942e3c2b3..e9d826aa7c 100644 --- a/tests/components/wk2212_i2c/test.esp32-s3-idf.yaml +++ b/tests/components/wk2212_i2c/test.esp32-s3-idf.yaml @@ -2,4 +2,7 @@ substitutions: scl_pin: GPIO40 sda_pin: GPIO41 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-s3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wk2212_spi/common.yaml b/tests/components/wk2212_spi/common.yaml index 693d2a9ab2..969f16bb12 100644 --- a/tests/components/wk2212_spi/common.yaml +++ b/tests/components/wk2212_spi/common.yaml @@ -1,29 +1,22 @@ -spi: - id: spi_bus - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - wk2212_spi: - - id: bridge_spi + - id: wk2212_spi_bridge cs_pin: ${cs_pin} - spi_id: spi_bus crystal: 11059200 data_rate: 1MHz uart: - - id: id0 + - id: wk2212_spi_uart0 channel: 0 baud_rate: 115200 stop_bits: 1 parity: none - - id: id1 + - id: wk2212_spi_uart1 channel: 1 baud_rate: 9600 # Ensures a sensor doesn't break validation sensor: - platform: a02yyuw - uart_id: id1 + uart_id: wk2212_spi_uart1 id: distance_sensor # individual binary_sensor inputs @@ -31,14 +24,14 @@ binary_sensor: - platform: gpio name: "pin_0" pin: - wk2212_spi: bridge_spi + wk2212_spi: wk2212_spi_bridge number: 0 mode: input: true - platform: gpio name: "pin_1" pin: - wk2212_spi: bridge_spi + wk2212_spi: wk2212_spi_bridge number: 1 mode: input: true @@ -49,14 +42,14 @@ switch: - platform: gpio name: "pin_2" pin: - wk2212_spi: bridge_spi + wk2212_spi: wk2212_spi_bridge number: 2 mode: output: true - platform: gpio name: "pin_3" pin: - wk2212_spi: bridge_spi + wk2212_spi: wk2212_spi_bridge number: 3 mode: output: true diff --git a/tests/components/wk2212_spi/test.esp32-idf.yaml b/tests/components/wk2212_spi/test.esp32-idf.yaml index 76e7138ab0..a3352cf880 100644 --- a/tests/components/wk2212_spi/test.esp32-idf.yaml +++ b/tests/components/wk2212_spi/test.esp32-idf.yaml @@ -1,7 +1,7 @@ substitutions: - clk_pin: GPIO18 - miso_pin: GPIO19 - mosi_pin: GPIO23 cs_pin: GPIO5 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wk2212_spi/test.esp32-s3-idf.yaml b/tests/components/wk2212_spi/test.esp32-s3-idf.yaml index b0aadf620a..6a60c90fb2 100644 --- a/tests/components/wk2212_spi/test.esp32-s3-idf.yaml +++ b/tests/components/wk2212_spi/test.esp32-s3-idf.yaml @@ -4,4 +4,7 @@ substitutions: mosi_pin: GPIO6 cs_pin: GPIO19 +packages: + spi: !include ../../test_build_components/common/spi/esp32-s3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/wl_134/common.yaml b/tests/components/wl_134/common.yaml index 71c50be79b..e79331cb52 100644 --- a/tests/components/wl_134/common.yaml +++ b/tests/components/wl_134/common.yaml @@ -1,9 +1,3 @@ -uart: - - id: uart_wl_134 - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 9600 - text_sensor: - platform: wl_134 name: Transponder Code diff --git a/tests/components/wl_134/test.esp32-c3-idf.yaml b/tests/components/wl_134/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/wl_134/test.esp32-c3-idf.yaml +++ b/tests/components/wl_134/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/wl_134/test.esp32-idf.yaml b/tests/components/wl_134/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/wl_134/test.esp32-idf.yaml +++ b/tests/components/wl_134/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/wl_134/test.esp8266-ard.yaml b/tests/components/wl_134/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/wl_134/test.esp8266-ard.yaml +++ b/tests/components/wl_134/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/wl_134/test.rp2040-ard.yaml b/tests/components/wl_134/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/wl_134/test.rp2040-ard.yaml +++ b/tests/components/wl_134/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/wts01/common.yaml b/tests/components/wts01/common.yaml index c26cc3e475..966588c82a 100644 --- a/tests/components/wts01/common.yaml +++ b/tests/components/wts01/common.yaml @@ -1,7 +1,3 @@ -uart: - rx_pin: ${rx_pin} - baud_rate: 9600 - sensor: - platform: wts01 id: wts01_sensor diff --git a/tests/components/wts01/test.esp32-c3-idf.yaml b/tests/components/wts01/test.esp32-c3-idf.yaml index 00cec5b3b8..4b7c8351a7 100644 --- a/tests/components/wts01/test.esp32-c3-idf.yaml +++ b/tests/components/wts01/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO6 - rx_pin: GPIO7 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/wts01/test.esp32-idf.yaml b/tests/components/wts01/test.esp32-idf.yaml index 4904e1f54f..b415125e84 100644 --- a/tests/components/wts01/test.esp32-idf.yaml +++ b/tests/components/wts01/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO16 - rx_pin: GPIO17 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/wts01/test.esp8266-ard.yaml b/tests/components/wts01/test.esp8266-ard.yaml index 3b44f9c9c3..89ca3ab5ae 100644 --- a/tests/components/wts01/test.esp8266-ard.yaml +++ b/tests/components/wts01/test.esp8266-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO1 rx_pin: GPIO3 +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/wts01/test.rp2040-ard.yaml b/tests/components/wts01/test.rp2040-ard.yaml index 16b2a4b006..9246c39f08 100644 --- a/tests/components/wts01/test.rp2040-ard.yaml +++ b/tests/components/wts01/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO0 rx_pin: GPIO1 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/x9c/test.esp32-idf.yaml b/tests/components/x9c/test.esp32-idf.yaml index 6dfe3a67eb..7beb6e67cb 100644 --- a/tests/components/x9c/test.esp32-idf.yaml +++ b/tests/components/x9c/test.esp32-idf.yaml @@ -3,4 +3,7 @@ substitutions: inc_pin: GPIO14 ud_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/x9c/test.esp8266-ard.yaml b/tests/components/x9c/test.esp8266-ard.yaml index 6dfe3a67eb..ae6b775ff7 100644 --- a/tests/components/x9c/test.esp8266-ard.yaml +++ b/tests/components/x9c/test.esp8266-ard.yaml @@ -1,6 +1,9 @@ substitutions: - cs_pin: GPIO13 - inc_pin: GPIO14 + cs_pin: GPIO0 + inc_pin: GPIO2 ud_pin: GPIO15 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/x9c/test.rp2040-ard.yaml b/tests/components/x9c/test.rp2040-ard.yaml index b06e15a98c..f17627baf3 100644 --- a/tests/components/x9c/test.rp2040-ard.yaml +++ b/tests/components/x9c/test.rp2040-ard.yaml @@ -1,6 +1,9 @@ substitutions: - cs_pin: GPIO3 - inc_pin: GPIO4 - ud_pin: GPIO5 + cs_pin: GPIO6 + inc_pin: GPIO7 + ud_pin: GPIO8 + +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/xgzp68xx/common.yaml b/tests/components/xgzp68xx/common.yaml index 224dd9ed14..f76b1de508 100644 --- a/tests/components/xgzp68xx/common.yaml +++ b/tests/components/xgzp68xx/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_xgzp68xx - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: xgzp68xx + i2c_id: i2c_bus k_value: 4096 temperature: name: Pressure Temperature diff --git a/tests/components/xgzp68xx/test.esp32-c3-idf.yaml b/tests/components/xgzp68xx/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/xgzp68xx/test.esp32-c3-idf.yaml +++ b/tests/components/xgzp68xx/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/xgzp68xx/test.esp32-idf.yaml b/tests/components/xgzp68xx/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/xgzp68xx/test.esp32-idf.yaml +++ b/tests/components/xgzp68xx/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/xgzp68xx/test.esp8266-ard.yaml b/tests/components/xgzp68xx/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/xgzp68xx/test.esp8266-ard.yaml +++ b/tests/components/xgzp68xx/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/xgzp68xx/test.rp2040-ard.yaml b/tests/components/xgzp68xx/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/xgzp68xx/test.rp2040-ard.yaml +++ b/tests/components/xgzp68xx/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/xiaomi_ble/test.esp32-c3-idf.yaml b/tests/components/xiaomi_ble/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_ble/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_ble/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_ble/test.esp32-idf.yaml b/tests/components/xiaomi_ble/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_ble/test.esp32-idf.yaml +++ b/tests/components/xiaomi_ble/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_cgd1/test.esp32-c3-idf.yaml b/tests/components/xiaomi_cgd1/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_cgd1/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_cgd1/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_cgd1/test.esp32-idf.yaml b/tests/components/xiaomi_cgd1/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_cgd1/test.esp32-idf.yaml +++ b/tests/components/xiaomi_cgd1/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_cgdk2/test.esp32-c3-idf.yaml b/tests/components/xiaomi_cgdk2/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_cgdk2/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_cgdk2/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_cgdk2/test.esp32-idf.yaml b/tests/components/xiaomi_cgdk2/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_cgdk2/test.esp32-idf.yaml +++ b/tests/components/xiaomi_cgdk2/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_cgg1/test.esp32-c3-idf.yaml b/tests/components/xiaomi_cgg1/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_cgg1/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_cgg1/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_cgg1/test.esp32-idf.yaml b/tests/components/xiaomi_cgg1/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_cgg1/test.esp32-idf.yaml +++ b/tests/components/xiaomi_cgg1/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_cgpr1/test.esp32-c3-idf.yaml b/tests/components/xiaomi_cgpr1/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_cgpr1/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_cgpr1/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_cgpr1/test.esp32-idf.yaml b/tests/components/xiaomi_cgpr1/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_cgpr1/test.esp32-idf.yaml +++ b/tests/components/xiaomi_cgpr1/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_gcls002/test.esp32-c3-idf.yaml b/tests/components/xiaomi_gcls002/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_gcls002/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_gcls002/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_gcls002/test.esp32-idf.yaml b/tests/components/xiaomi_gcls002/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_gcls002/test.esp32-idf.yaml +++ b/tests/components/xiaomi_gcls002/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_hhccjcy01/test.esp32-c3-idf.yaml b/tests/components/xiaomi_hhccjcy01/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_hhccjcy01/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_hhccjcy01/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_hhccjcy01/test.esp32-idf.yaml b/tests/components/xiaomi_hhccjcy01/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_hhccjcy01/test.esp32-idf.yaml +++ b/tests/components/xiaomi_hhccjcy01/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_hhccpot002/test.esp32-c3-idf.yaml b/tests/components/xiaomi_hhccpot002/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_hhccpot002/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_hhccpot002/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_hhccpot002/test.esp32-idf.yaml b/tests/components/xiaomi_hhccpot002/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_hhccpot002/test.esp32-idf.yaml +++ b/tests/components/xiaomi_hhccpot002/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_jqjcy01ym/test.esp32-c3-idf.yaml b/tests/components/xiaomi_jqjcy01ym/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_jqjcy01ym/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_jqjcy01ym/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_jqjcy01ym/test.esp32-idf.yaml b/tests/components/xiaomi_jqjcy01ym/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_jqjcy01ym/test.esp32-idf.yaml +++ b/tests/components/xiaomi_jqjcy01ym/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_lywsd02/test.esp32-c3-idf.yaml b/tests/components/xiaomi_lywsd02/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_lywsd02/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_lywsd02/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_lywsd02/test.esp32-idf.yaml b/tests/components/xiaomi_lywsd02/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_lywsd02/test.esp32-idf.yaml +++ b/tests/components/xiaomi_lywsd02/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_lywsd02mmc/test.esp32-c3-idf.yaml b/tests/components/xiaomi_lywsd02mmc/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_lywsd02mmc/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_lywsd02mmc/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_lywsd02mmc/test.esp32-idf.yaml b/tests/components/xiaomi_lywsd02mmc/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_lywsd02mmc/test.esp32-idf.yaml +++ b/tests/components/xiaomi_lywsd02mmc/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_lywsd03mmc/test.esp32-c3-idf.yaml b/tests/components/xiaomi_lywsd03mmc/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_lywsd03mmc/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_lywsd03mmc/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_lywsd03mmc/test.esp32-idf.yaml b/tests/components/xiaomi_lywsd03mmc/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_lywsd03mmc/test.esp32-idf.yaml +++ b/tests/components/xiaomi_lywsd03mmc/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_lywsdcgq/test.esp32-c3-idf.yaml b/tests/components/xiaomi_lywsdcgq/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_lywsdcgq/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_lywsdcgq/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_lywsdcgq/test.esp32-idf.yaml b/tests/components/xiaomi_lywsdcgq/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_lywsdcgq/test.esp32-idf.yaml +++ b/tests/components/xiaomi_lywsdcgq/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_mhoc303/test.esp32-c3-idf.yaml b/tests/components/xiaomi_mhoc303/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_mhoc303/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_mhoc303/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_mhoc303/test.esp32-idf.yaml b/tests/components/xiaomi_mhoc303/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_mhoc303/test.esp32-idf.yaml +++ b/tests/components/xiaomi_mhoc303/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_mhoc401/test.esp32-c3-idf.yaml b/tests/components/xiaomi_mhoc401/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_mhoc401/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_mhoc401/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_mhoc401/test.esp32-idf.yaml b/tests/components/xiaomi_mhoc401/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_mhoc401/test.esp32-idf.yaml +++ b/tests/components/xiaomi_mhoc401/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_miscale copy/common.yaml b/tests/components/xiaomi_miscale copy/common.yaml deleted file mode 100644 index 89f32ad199..0000000000 --- a/tests/components/xiaomi_miscale copy/common.yaml +++ /dev/null @@ -1,9 +0,0 @@ -esp32_ble_tracker: - -sensor: - - platform: xiaomi_miscale - mac_address: '5C:CA:D3:70:D4:A2' - weight: - name: "Xiaomi Mi Scale Weight" - impedance: - name: "Xiaomi Mi Scale Impedance" diff --git a/tests/components/xiaomi_miscale copy/test.esp32-ard.yaml b/tests/components/xiaomi_miscale copy/test.esp32-ard.yaml deleted file mode 100644 index dade44d145..0000000000 --- a/tests/components/xiaomi_miscale copy/test.esp32-ard.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include common.yaml diff --git a/tests/components/xiaomi_miscale copy/test.esp32-c3-ard.yaml b/tests/components/xiaomi_miscale copy/test.esp32-c3-ard.yaml deleted file mode 100644 index dade44d145..0000000000 --- a/tests/components/xiaomi_miscale copy/test.esp32-c3-ard.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include common.yaml diff --git a/tests/components/xiaomi_miscale copy/test.esp32-c3-idf.yaml b/tests/components/xiaomi_miscale copy/test.esp32-c3-idf.yaml deleted file mode 100644 index dade44d145..0000000000 --- a/tests/components/xiaomi_miscale copy/test.esp32-c3-idf.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include common.yaml diff --git a/tests/components/xiaomi_miscale copy/test.esp32-idf.yaml b/tests/components/xiaomi_miscale copy/test.esp32-idf.yaml deleted file mode 100644 index dade44d145..0000000000 --- a/tests/components/xiaomi_miscale copy/test.esp32-idf.yaml +++ /dev/null @@ -1 +0,0 @@ -<<: !include common.yaml diff --git a/tests/components/xiaomi_miscale/test.esp32-c3-idf.yaml b/tests/components/xiaomi_miscale/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_miscale/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_miscale/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_miscale/test.esp32-idf.yaml b/tests/components/xiaomi_miscale/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_miscale/test.esp32-idf.yaml +++ b/tests/components/xiaomi_miscale/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_mjyd02yla/test.esp32-c3-idf.yaml b/tests/components/xiaomi_mjyd02yla/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_mjyd02yla/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_mjyd02yla/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_mjyd02yla/test.esp32-idf.yaml b/tests/components/xiaomi_mjyd02yla/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_mjyd02yla/test.esp32-idf.yaml +++ b/tests/components/xiaomi_mjyd02yla/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_mue4094rt/test.esp32-c3-idf.yaml b/tests/components/xiaomi_mue4094rt/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_mue4094rt/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_mue4094rt/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_mue4094rt/test.esp32-idf.yaml b/tests/components/xiaomi_mue4094rt/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_mue4094rt/test.esp32-idf.yaml +++ b/tests/components/xiaomi_mue4094rt/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_rtcgq02lm/test.esp32-c3-idf.yaml b/tests/components/xiaomi_rtcgq02lm/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_rtcgq02lm/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_rtcgq02lm/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_rtcgq02lm/test.esp32-idf.yaml b/tests/components/xiaomi_rtcgq02lm/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_rtcgq02lm/test.esp32-idf.yaml +++ b/tests/components/xiaomi_rtcgq02lm/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_wx08zm/test.esp32-c3-idf.yaml b/tests/components/xiaomi_wx08zm/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_wx08zm/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_wx08zm/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_wx08zm/test.esp32-idf.yaml b/tests/components/xiaomi_wx08zm/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_wx08zm/test.esp32-idf.yaml +++ b/tests/components/xiaomi_wx08zm/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_xmwsdj04mmc/test.esp32-c3-idf.yaml b/tests/components/xiaomi_xmwsdj04mmc/test.esp32-c3-idf.yaml index dade44d145..9f2634f967 100644 --- a/tests/components/xiaomi_xmwsdj04mmc/test.esp32-c3-idf.yaml +++ b/tests/components/xiaomi_xmwsdj04mmc/test.esp32-c3-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-c3-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xiaomi_xmwsdj04mmc/test.esp32-idf.yaml b/tests/components/xiaomi_xmwsdj04mmc/test.esp32-idf.yaml index dade44d145..7a6541ae76 100644 --- a/tests/components/xiaomi_xmwsdj04mmc/test.esp32-idf.yaml +++ b/tests/components/xiaomi_xmwsdj04mmc/test.esp32-idf.yaml @@ -1 +1,4 @@ +packages: + ble: !include ../../test_build_components/common/ble/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xl9535/common.yaml b/tests/components/xl9535/common.yaml index e01163cf12..81e96131ab 100644 --- a/tests/components/xl9535/common.yaml +++ b/tests/components/xl9535/common.yaml @@ -1,10 +1,6 @@ -i2c: - - id: i2c_xl9535 - scl: ${scl_pin} - sda: ${sda_pin} - xl9535: - id: xl9535_hub + i2c_id: i2c_bus address: 0x20 binary_sensor: diff --git a/tests/components/xl9535/test.esp32-c3-idf.yaml b/tests/components/xl9535/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/xl9535/test.esp32-c3-idf.yaml +++ b/tests/components/xl9535/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/xl9535/test.esp32-idf.yaml b/tests/components/xl9535/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/xl9535/test.esp32-idf.yaml +++ b/tests/components/xl9535/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/xl9535/test.esp8266-ard.yaml b/tests/components/xl9535/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/xl9535/test.esp8266-ard.yaml +++ b/tests/components/xl9535/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/xl9535/test.rp2040-ard.yaml b/tests/components/xl9535/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/xl9535/test.rp2040-ard.yaml +++ b/tests/components/xl9535/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/xpt2046/common.yaml b/tests/components/xpt2046/common.yaml index 9ef680cff4..3a8e3286a6 100644 --- a/tests/components/xpt2046/common.yaml +++ b/tests/components/xpt2046/common.yaml @@ -1,9 +1,3 @@ -spi: - - id: spi_xpt2046 - clk_pin: ${clk_pin} - mosi_pin: ${mosi_pin} - miso_pin: ${miso_pin} - display: - platform: ili9xxx id: xpt_display diff --git a/tests/components/xpt2046/test.esp32-c3-idf.yaml b/tests/components/xpt2046/test.esp32-c3-idf.yaml index 79b84902ac..ff7a32c26c 100644 --- a/tests/components/xpt2046/test.esp32-c3-idf.yaml +++ b/tests/components/xpt2046/test.esp32-c3-idf.yaml @@ -1,11 +1,10 @@ substitutions: - clk_pin: GPIO4 - mosi_pin: GPIO5 - miso_pin: GPIO6 dc_pin: GPIO7 cs_pin: GPIO0 disp_cs_pin: GPIO1 interrupt_pin: GPIO3 reset_pin: GPIO10 +packages: + spi: !include ../../test_build_components/common/spi/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/xpt2046/test.esp32-idf.yaml b/tests/components/xpt2046/test.esp32-idf.yaml index b39174947b..608e135d74 100644 --- a/tests/components/xpt2046/test.esp32-idf.yaml +++ b/tests/components/xpt2046/test.esp32-idf.yaml @@ -1,11 +1,11 @@ substitutions: - clk_pin: GPIO17 - mosi_pin: GPIO18 - miso_pin: GPIO19 dc_pin: GPIO13 cs_pin: GPIO14 disp_cs_pin: GPIO4 interrupt_pin: GPIO21 reset_pin: GPIO22 +packages: + spi: !include ../../test_build_components/common/spi/esp32-idf.yaml + <<: !include common.yaml diff --git a/tests/components/xpt2046/test.esp8266-ard.yaml b/tests/components/xpt2046/test.esp8266-ard.yaml index 246c5c8953..e2779a03b9 100644 --- a/tests/components/xpt2046/test.esp8266-ard.yaml +++ b/tests/components/xpt2046/test.esp8266-ard.yaml @@ -1,5 +1,5 @@ substitutions: - clk_pin: GPIO14 + clk_pin: GPIO0 mosi_pin: GPIO13 miso_pin: GPIO12 dc_pin: GPIO15 @@ -8,4 +8,7 @@ substitutions: interrupt_pin: GPIO5 reset_pin: GPIO2 +packages: + spi: !include ../../test_build_components/common/spi/esp8266-ard.yaml + <<: !include common.yaml diff --git a/tests/components/xpt2046/test.rp2040-ard.yaml b/tests/components/xpt2046/test.rp2040-ard.yaml index e693b363d9..c547bdc0c9 100644 --- a/tests/components/xpt2046/test.rp2040-ard.yaml +++ b/tests/components/xpt2046/test.rp2040-ard.yaml @@ -8,4 +8,7 @@ substitutions: interrupt_pin: GPIO2 reset_pin: GPIO3 +packages: + spi: !include ../../test_build_components/common/spi/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/zio_ultrasonic/common.yaml b/tests/components/zio_ultrasonic/common.yaml index e13853d8f1..34a3144db9 100644 --- a/tests/components/zio_ultrasonic/common.yaml +++ b/tests/components/zio_ultrasonic/common.yaml @@ -1,9 +1,5 @@ -i2c: - - id: i2c_zio_ultrasonic - scl: ${scl_pin} - sda: ${sda_pin} - sensor: - platform: zio_ultrasonic + i2c_id: i2c_bus name: "Distance" update_interval: 60s diff --git a/tests/components/zio_ultrasonic/test.esp32-c3-idf.yaml b/tests/components/zio_ultrasonic/test.esp32-c3-idf.yaml index ee2c29ca4e..9990d96d29 100644 --- a/tests/components/zio_ultrasonic/test.esp32-c3-idf.yaml +++ b/tests/components/zio_ultrasonic/test.esp32-c3-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/zio_ultrasonic/test.esp32-idf.yaml b/tests/components/zio_ultrasonic/test.esp32-idf.yaml index 63c3bd6afd..b47e39c389 100644 --- a/tests/components/zio_ultrasonic/test.esp32-idf.yaml +++ b/tests/components/zio_ultrasonic/test.esp32-idf.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO16 - sda_pin: GPIO17 +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/zio_ultrasonic/test.esp8266-ard.yaml b/tests/components/zio_ultrasonic/test.esp8266-ard.yaml index ee2c29ca4e..4a98b9388a 100644 --- a/tests/components/zio_ultrasonic/test.esp8266-ard.yaml +++ b/tests/components/zio_ultrasonic/test.esp8266-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/zio_ultrasonic/test.rp2040-ard.yaml b/tests/components/zio_ultrasonic/test.rp2040-ard.yaml index ee2c29ca4e..319a7c71a6 100644 --- a/tests/components/zio_ultrasonic/test.rp2040-ard.yaml +++ b/tests/components/zio_ultrasonic/test.rp2040-ard.yaml @@ -1,5 +1,4 @@ -substitutions: - scl_pin: GPIO5 - sda_pin: GPIO4 +packages: + i2c: !include ../../test_build_components/common/i2c/rp2040-ard.yaml <<: !include common.yaml diff --git a/tests/components/zwave_proxy/common.yaml b/tests/components/zwave_proxy/common.yaml index 08092ebe55..097e4b43a5 100644 --- a/tests/components/zwave_proxy/common.yaml +++ b/tests/components/zwave_proxy/common.yaml @@ -3,12 +3,6 @@ wifi: password: password1 power_save_mode: none -uart: - - id: uart_zwave_proxy - tx_pin: ${tx_pin} - rx_pin: ${rx_pin} - baud_rate: 115200 - api: zwave_proxy: diff --git a/tests/components/zwave_proxy/test.esp32-c3-idf.yaml b/tests/components/zwave_proxy/test.esp32-c3-idf.yaml index b516342f3b..4b7c8351a7 100644 --- a/tests/components/zwave_proxy/test.esp32-c3-idf.yaml +++ b/tests/components/zwave_proxy/test.esp32-c3-idf.yaml @@ -1,5 +1,5 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/esp32-c3-idf.yaml <<: !include common.yaml diff --git a/tests/components/zwave_proxy/test.esp32-idf.yaml b/tests/components/zwave_proxy/test.esp32-idf.yaml index f486544afa..b415125e84 100644 --- a/tests/components/zwave_proxy/test.esp32-idf.yaml +++ b/tests/components/zwave_proxy/test.esp32-idf.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO17 - rx_pin: GPIO16 + tx_pin: GPIO4 + rx_pin: GPIO5 + +packages: + uart: !include ../../test_build_components/common/uart/esp32-idf.yaml <<: !include common.yaml diff --git a/tests/components/zwave_proxy/test.esp8266-ard.yaml b/tests/components/zwave_proxy/test.esp8266-ard.yaml index b516342f3b..96ab4ef6ac 100644 --- a/tests/components/zwave_proxy/test.esp8266-ard.yaml +++ b/tests/components/zwave_proxy/test.esp8266-ard.yaml @@ -1,5 +1,8 @@ substitutions: - tx_pin: GPIO4 - rx_pin: GPIO5 + tx_pin: GPIO0 + rx_pin: GPIO2 + +packages: + uart: !include ../../test_build_components/common/uart/esp8266-ard.yaml <<: !include common.yaml diff --git a/tests/components/zwave_proxy/test.rp2040-ard.yaml b/tests/components/zwave_proxy/test.rp2040-ard.yaml index b516342f3b..b28f2b5e05 100644 --- a/tests/components/zwave_proxy/test.rp2040-ard.yaml +++ b/tests/components/zwave_proxy/test.rp2040-ard.yaml @@ -2,4 +2,7 @@ substitutions: tx_pin: GPIO4 rx_pin: GPIO5 +packages: + uart: !include ../../test_build_components/common/uart/rp2040-ard.yaml + <<: !include common.yaml diff --git a/tests/components/zyaura/test.esp32-idf.yaml b/tests/components/zyaura/test.esp32-idf.yaml index d295973e3f..a4ecdb6c49 100644 --- a/tests/components/zyaura/test.esp32-idf.yaml +++ b/tests/components/zyaura/test.esp32-idf.yaml @@ -1,5 +1,5 @@ substitutions: - clock_pin: GPIO16 - data_pin: GPIO17 + clock_pin: GPIO4 + data_pin: GPIO5 <<: !include common.yaml diff --git a/tests/components/zyaura/test.esp8266-ard.yaml b/tests/components/zyaura/test.esp8266-ard.yaml index 7808481215..7c7f1e1a11 100644 --- a/tests/components/zyaura/test.esp8266-ard.yaml +++ b/tests/components/zyaura/test.esp8266-ard.yaml @@ -1,5 +1,5 @@ substitutions: - clock_pin: GPIO5 - data_pin: GPIO4 + clock_pin: GPIO0 + data_pin: GPIO2 <<: !include common.yaml diff --git a/tests/script/test_determine_jobs.py b/tests/script/test_determine_jobs.py index 7200afc2ee..0559d116be 100644 --- a/tests/script/test_determine_jobs.py +++ b/tests/script/test_determine_jobs.py @@ -4,6 +4,7 @@ from collections.abc import Generator import importlib.util import json import os +from pathlib import Path import subprocess import sys from unittest.mock import Mock, call, patch @@ -72,9 +73,11 @@ def test_main_all_tests_should_run( mock_should_run_clang_format.return_value = True mock_should_run_python_linters.return_value = True - # Mock list-components.py output + # Mock list-components.py output (now returns JSON with --changed-with-deps) mock_result = Mock() - mock_result.stdout = "wifi\napi\nsensor\n" + mock_result.stdout = json.dumps( + {"directly_changed": ["wifi", "api"], "all_changed": ["wifi", "api", "sensor"]} + ) mock_subprocess_run.return_value = mock_result # Run main function with mocked argv @@ -90,7 +93,13 @@ def test_main_all_tests_should_run( assert output["clang_format"] is True assert output["python_linters"] is True assert output["changed_components"] == ["wifi", "api", "sensor"] - assert output["component_test_count"] == 3 + # changed_components_with_tests will only include components that actually have test files + assert "changed_components_with_tests" in output + assert isinstance(output["changed_components_with_tests"], list) + # component_test_count matches number of components with tests + assert output["component_test_count"] == len( + output["changed_components_with_tests"] + ) def test_main_no_tests_should_run( @@ -109,7 +118,7 @@ def test_main_no_tests_should_run( # Mock empty list-components.py output mock_result = Mock() - mock_result.stdout = "" + mock_result.stdout = json.dumps({"directly_changed": [], "all_changed": []}) mock_subprocess_run.return_value = mock_result # Run main function with mocked argv @@ -125,6 +134,7 @@ def test_main_no_tests_should_run( assert output["clang_format"] is False assert output["python_linters"] is False assert output["changed_components"] == [] + assert output["changed_components_with_tests"] == [] assert output["component_test_count"] == 0 @@ -169,7 +179,9 @@ def test_main_with_branch_argument( # Mock list-components.py output mock_result = Mock() - mock_result.stdout = "mqtt\n" + mock_result.stdout = json.dumps( + {"directly_changed": ["mqtt"], "all_changed": ["mqtt"]} + ) mock_subprocess_run.return_value = mock_result with patch("sys.argv", ["script.py", "-b", "main"]): @@ -184,7 +196,7 @@ def test_main_with_branch_argument( # Check that list-components.py was called with branch mock_subprocess_run.assert_called_once() call_args = mock_subprocess_run.call_args[0][0] - assert "--changed" in call_args + assert "--changed-with-deps" in call_args assert "-b" in call_args assert "main" in call_args @@ -197,7 +209,13 @@ def test_main_with_branch_argument( assert output["clang_format"] is False assert output["python_linters"] is True assert output["changed_components"] == ["mqtt"] - assert output["component_test_count"] == 1 + # changed_components_with_tests will only include components that actually have test files + assert "changed_components_with_tests" in output + assert isinstance(output["changed_components_with_tests"], list) + # component_test_count matches number of components with tests + assert output["component_test_count"] == len( + output["changed_components_with_tests"] + ) def test_should_run_integration_tests( @@ -377,3 +395,67 @@ def test_should_run_clang_format_with_branch() -> None: mock_changed.return_value = [] determine_jobs.should_run_clang_format("release") mock_changed.assert_called_once_with("release") + + +def test_main_filters_components_without_tests( + mock_should_run_integration_tests: Mock, + mock_should_run_clang_tidy: Mock, + mock_should_run_clang_format: Mock, + mock_should_run_python_linters: Mock, + mock_subprocess_run: Mock, + capsys: pytest.CaptureFixture[str], + tmp_path: Path, +) -> None: + """Test that components without test files are filtered out.""" + mock_should_run_integration_tests.return_value = False + mock_should_run_clang_tidy.return_value = False + mock_should_run_clang_format.return_value = False + mock_should_run_python_linters.return_value = False + + # Mock list-components.py output with 3 components + # wifi: has tests, sensor: has tests, airthings_ble: no tests + mock_result = Mock() + mock_result.stdout = json.dumps( + { + "directly_changed": ["wifi", "sensor"], + "all_changed": ["wifi", "sensor", "airthings_ble"], + } + ) + mock_subprocess_run.return_value = mock_result + + # Create test directory structure + tests_dir = tmp_path / "tests" / "components" + + # wifi has tests + wifi_dir = tests_dir / "wifi" + wifi_dir.mkdir(parents=True) + (wifi_dir / "test.esp32.yaml").write_text("test: config") + + # sensor has tests + sensor_dir = tests_dir / "sensor" + sensor_dir.mkdir(parents=True) + (sensor_dir / "test.esp8266.yaml").write_text("test: config") + + # airthings_ble exists but has no test files + airthings_dir = tests_dir / "airthings_ble" + airthings_dir.mkdir(parents=True) + + # Mock root_path to use tmp_path + with ( + patch.object(determine_jobs, "root_path", str(tmp_path)), + patch("sys.argv", ["determine-jobs.py"]), + ): + # Clear the cache since we're mocking root_path + determine_jobs._component_has_tests.cache_clear() + determine_jobs.main() + + # Check output + captured = capsys.readouterr() + output = json.loads(captured.out) + + # changed_components should have all components + assert set(output["changed_components"]) == {"wifi", "sensor", "airthings_ble"} + # changed_components_with_tests should only have components with test files + assert set(output["changed_components_with_tests"]) == {"wifi", "sensor"} + # component_test_count should be based on components with tests + assert output["component_test_count"] == 2 diff --git a/tests/test_build_components/build_components_base.bk72xx-ard.yaml b/tests/test_build_components/build_components_base.bk72xx-ard.yaml index 9a4e15d5cf..817acc3c39 100644 --- a/tests/test_build_components/build_components_base.bk72xx-ard.yaml +++ b/tests/test_build_components/build_components_base.bk72xx-ard.yaml @@ -3,7 +3,7 @@ esphome: friendly_name: $component_name bk72xx: - board: generic-bk7231n-qfn32-tuya + board: generic-bk7252 logger: level: VERY_VERBOSE diff --git a/tests/test_build_components/common/README.md b/tests/test_build_components/common/README.md new file mode 100644 index 0000000000..76f14b8664 --- /dev/null +++ b/tests/test_build_components/common/README.md @@ -0,0 +1,248 @@ +# Common Bus Configurations for Component Tests + +This directory contains standardized bus configurations (I2C, SPI, UART, Modbus, BLE) that component tests use, enabling multiple components to be tested together with intelligent grouping. + +## Purpose + +These common configs allow multiple components to **share a single bus**, dramatically reducing CI time by compiling multiple compatible components together. Components with identical bus configurations are automatically grouped and tested together. + +## Structure + +``` +common/ +├── i2c/ # Standard I2C (50kHz) +│ ├── esp32-idf.yaml +│ ├── esp32-ard.yaml +│ ├── esp32-c3-idf.yaml +│ ├── esp32-c3-ard.yaml +│ ├── esp32-s2-idf.yaml +│ ├── esp32-s2-ard.yaml +│ ├── esp32-s3-idf.yaml +│ ├── esp32-s3-ard.yaml +│ ├── esp8266-ard.yaml +│ ├── rp2040-ard.yaml +│ └── bk72xx-ard.yaml +├── i2c_low_freq/ # Low frequency I2C (10kHz) +│ └── (same platform variants) +├── spi/ +│ └── (same platform variants) +├── uart/ +│ ├── esp32-idf.yaml +│ ├── esp32-c3-idf.yaml +│ ├── esp8266-ard.yaml +│ └── rp2040-ard.yaml +├── modbus/ # Modbus (includes uart via packages) +│ ├── esp32-idf.yaml +│ ├── esp32-c3-idf.yaml +│ ├── esp8266-ard.yaml +│ └── rp2040-ard.yaml +└── ble/ + ├── esp32-idf.yaml + ├── esp32-ard.yaml + └── esp32-c3-idf.yaml +``` + +## How It Works + +### Component Test Structure +Each component test includes the common bus config: + +```yaml +# tests/components/bh1750/test.esp32-idf.yaml +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + +<<: !include common.yaml +``` + +The common config provides: +- Standardized pin assignments +- A shared bus instance (`i2c_bus`, `spi_bus`, `uart_bus`, `modbus_bus`, etc.) + +The component's `common.yaml` references the shared bus: +```yaml +# tests/components/bh1750/common.yaml +sensor: + - platform: bh1750 + i2c_id: i2c_bus + name: Living Room Brightness + address: 0x23 +``` + +### Intelligent Grouping (Implemented) +Components with identical bus configurations are automatically grouped and tested together: + +```yaml +# Auto-generated merged config (created by test_build_components.py) +packages: + i2c: !include ../../test_build_components/common/i2c/esp32-idf.yaml + +sensor: + - platform: bme280_i2c + i2c_id: i2c_bus + temperature: + name: BME280 Temperature + - platform: bh1750 + i2c_id: i2c_bus + name: BH1750 Illuminance + - platform: sht3xd + i2c_id: i2c_bus + temperature: + name: SHT3xD Temperature +``` + +**Result**: 3 components compile in one test instead of 3 separate tests! + +### Package Dependencies +Some packages include other packages to avoid duplication: + +```yaml +# tests/test_build_components/common/modbus/esp32-idf.yaml +packages: + uart: !include ../uart/esp32-idf.yaml # Modbus requires UART + +substitutions: + flow_control_pin: GPIO4 + +modbus: + - id: modbus_bus + uart_id: uart_bus + flow_control_pin: ${flow_control_pin} +``` + +Components using `modbus` packages automatically get `uart` as well. + +## Pin Allocations + +### I2C (Standard - 50kHz) +- **ESP32 IDF**: SCL=GPIO16, SDA=GPIO17 +- **ESP32 Arduino**: SCL=GPIO22, SDA=GPIO21 +- **ESP32-C3**: SCL=GPIO5, SDA=GPIO4 +- **ESP32-S2/S3**: SCL=GPIO9, SDA=GPIO8 +- **ESP8266**: SCL=GPIO5, SDA=GPIO4 +- **RP2040**: SCL=GPIO5, SDA=GPIO4 +- **BK72xx**: SCL=P20, SDA=P21 + +### I2C Low Frequency (10kHz) +Same pin allocations as standard I2C, but with 10kHz frequency for components requiring slower speeds. + +### SPI +- **ESP32**: CLK=GPIO18, MOSI=GPIO23, MISO=GPIO19 +- **ESP32-C3**: CLK=GPIO6, MOSI=GPIO7, MISO=GPIO5 +- **ESP32-S2**: CLK=GPIO36, MOSI=GPIO35, MISO=GPIO37 +- **ESP32-S3**: CLK=GPIO40, MOSI=GPIO6, MISO=GPIO41 +- **ESP8266**: CLK=GPIO14, MOSI=GPIO13, MISO=GPIO12 +- **RP2040**: CLK=GPIO18, MOSI=GPIO19, MISO=GPIO16 +- CS pins are component-specific (each SPI device needs unique CS) + +### UART +- **ESP32 IDF**: TX=GPIO17, RX=GPIO16 (baud: 19200) +- **ESP32-C3 IDF**: TX=GPIO7, RX=GPIO6 (baud: 19200) +- **ESP8266**: TX=GPIO1, RX=GPIO3 (baud: 19200) +- **RP2040**: TX=GPIO0, RX=GPIO1 (baud: 19200) + +### Modbus (includes UART) +Same UART pins as above, plus: +- **flow_control_pin**: GPIO4 (all platforms) + +### BLE +- **ESP32**: Shared `esp32_ble_tracker` infrastructure +- Each component defines unique `ble_client` with different MAC addresses + +## Benefits + +1. **Shared bus = less duplication** + - 200+ I2C components use common bus configs + - 60+ SPI components use common bus configs + - 80+ UART components use common bus configs + - 6 Modbus components use common modbus configs (which include UART) + +2. **Intelligent grouping reduces CI time** + - Components with identical bus configs are automatically grouped + - Typical reduction: 80-90% fewer builds + - Example: 3 I2C components → 1 merged build (saves 2 builds) + - CI runs 5 component batches in parallel (configurable via `max-parallel` in `.github/workflows/ci.yml`) + +3. **Easier maintenance** + - Change bus pins for a platform once, affects all component tests + - Consistent pin assignments across all components + - Centralized bus configuration + +## Component Compatibility + +### Groupable Components +Components are automatically grouped when they have: +- Identical bus package references (e.g., all use `i2c/esp32-idf.yaml`) +- No local file references (`$component_dir`) +- No `!extend` or `!remove` directives +- Proper bus ID references (`i2c_id: i2c_bus`, `spi_id: spi_bus`, etc.) + +### Non-Groupable Components +Components tested individually when they: +- Use different bus frequencies (e.g., `i2c` vs `i2c_low_freq`) +- Reference local files with `$component_dir` +- Are platform components (abstract base classes with `IS_PLATFORM_COMPONENT = True`) +- Define buses directly (not migrated to packages yet) +- Are in `ISOLATED_COMPONENTS` list (known build conflicts) + +### Bus Variants +- **i2c** (50kHz): Standard I2C frequency for most sensors +- **i2c_low_freq** (10kHz): For sensors requiring slower I2C speeds +- **modbus**: Includes UART via package dependencies + +### Making Components Groupable + +**WARNING**: Using `!extend` or `!remove` directives in component test files prevents automatic component grouping in CI, making builds slower. + +When platform-specific parameters are needed, inline the full configuration rather than using `!extend` or `!remove`. This allows the component to be grouped with other compatible components, reducing CI build time. + +**Note**: Some components legitimately require `!extend` or `!remove` for platform-specific features (e.g., `adc` removing ESP32-only `attenuation` parameter on ESP8266). These are correctly identified as non-groupable. + +## Testing Components + +### Testing Individual Components +Test specific components using `test_build_components`: +```bash +# Test a single component +./script/test_build_components -c bme280_i2c -t esp32-idf -e config + +# Test multiple components +./script/test_build_components -c bme280_i2c,bh1750,sht3xd -t esp32-idf -e compile +``` + +### Testing All Components Together +To verify that all components can be tested together without ID conflicts or configuration issues: +```bash +./script/test_component_grouping.py -e config --all +``` + +This tests all components in a single build to catch conflicts that might not appear when testing components individually. This is useful for: +- Detecting ID conflicts between components +- Validating that components can coexist in the same configuration +- Ensuring proper `i2c_id`, `spi_id`, `uart_id` specifications + +Use `-e config` for fast configuration validation, or `-e compile` for full compilation testing. + +### Testing Component Groups +Test specific groups of components by bus signature: +```bash +# Test all I2C components together +./script/test_component_grouping.py -s i2c -e config + +# Test with custom group sizes +./script/test_component_grouping.py --min-size 5 --max-size 20 --max-groups 3 +``` + +## Implementation Details + +### Scripts +- `script/analyze_component_buses.py`: Analyzes components to detect bus usage and grouping compatibility +- `script/merge_component_configs.py`: Merges multiple component configs into a single test file +- `script/test_build_components.py`: Main test runner with intelligent grouping +- `script/test_component_grouping.py`: Test component groups or all components together +- `script/split_components_for_ci.py`: Splits components into batches for parallel CI execution + +### Configuration +- `.github/workflows/ci.yml`: CI workflow with `max-parallel: 5` for component testing +- Package dependencies defined in `PACKAGE_DEPENDENCIES` (e.g., modbus → uart) +- Base bus components excluded from migration warnings: `i2c`, `spi`, `uart`, `modbus`, `canbus` diff --git a/tests/test_build_components/common/ble/esp32-ard.yaml b/tests/test_build_components/common/ble/esp32-ard.yaml new file mode 100644 index 0000000000..e1b5aec694 --- /dev/null +++ b/tests/test_build_components/common/ble/esp32-ard.yaml @@ -0,0 +1,9 @@ +# Common BLE tracker configuration for ESP32 Arduino tests +# BLE client components share this tracker infrastructure +# Each component defines its own ble_client with unique MAC address + +esp32_ble_tracker: + scan_parameters: + interval: 1100ms + window: 1100ms + active: true diff --git a/tests/test_build_components/common/ble/esp32-c3-idf.yaml b/tests/test_build_components/common/ble/esp32-c3-idf.yaml new file mode 100644 index 0000000000..6671722f21 --- /dev/null +++ b/tests/test_build_components/common/ble/esp32-c3-idf.yaml @@ -0,0 +1,9 @@ +# Common BLE tracker configuration for ESP32-C3 IDF tests +# BLE client components share this tracker infrastructure +# Each component defines its own ble_client with unique MAC address + +esp32_ble_tracker: + scan_parameters: + interval: 1100ms + window: 1100ms + active: true diff --git a/tests/test_build_components/common/ble/esp32-idf.yaml b/tests/test_build_components/common/ble/esp32-idf.yaml new file mode 100644 index 0000000000..7cdcea71f0 --- /dev/null +++ b/tests/test_build_components/common/ble/esp32-idf.yaml @@ -0,0 +1,9 @@ +# Common BLE tracker configuration for ESP32 IDF tests +# BLE client components share this tracker infrastructure +# Each component defines its own ble_client with unique MAC address + +esp32_ble_tracker: + scan_parameters: + interval: 1100ms + window: 1100ms + active: true diff --git a/tests/test_build_components/common/camera/esp32-idf.yaml b/tests/test_build_components/common/camera/esp32-idf.yaml new file mode 100644 index 0000000000..64f75c699a --- /dev/null +++ b/tests/test_build_components/common/camera/esp32-idf.yaml @@ -0,0 +1,29 @@ +esp32_camera: + name: ESP32 Camera + data_pins: + - number: 17 + - number: 35 + - number: 34 + - number: 5 + - number: 39 + - number: 18 + - number: 36 + - number: 19 + vsync_pin: 22 + href_pin: 26 + pixel_clock_pin: 21 + external_clock: + pin: 27 + frequency: 20MHz + i2c_pins: + sda: 25 + scl: 23 + reset_pin: 15 + power_down_pin: 1 + resolution: 640x480 + jpeg_quality: 10 + frame_buffer_location: PSRAM + on_image: + then: + - lambda: |- + ESP_LOGD("main", "image len=%d, data=%c", image.length, image.data[0]); diff --git a/tests/test_build_components/common/i2c/bk72xx-ard.yaml b/tests/test_build_components/common/i2c/bk72xx-ard.yaml new file mode 100644 index 0000000000..7d00546721 --- /dev/null +++ b/tests/test_build_components/common/i2c/bk72xx-ard.yaml @@ -0,0 +1,11 @@ +# Common I2C configuration for BK72XX Arduino tests + +substitutions: + scl_pin: P26 + sda_pin: P24 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + scan: true diff --git a/tests/test_build_components/common/i2c/esp32-ard.yaml b/tests/test_build_components/common/i2c/esp32-ard.yaml new file mode 100644 index 0000000000..fff09ab85c --- /dev/null +++ b/tests/test_build_components/common/i2c/esp32-ard.yaml @@ -0,0 +1,11 @@ +# Common I2C configuration for ESP32 Arduino tests + +substitutions: + scl_pin: GPIO22 + sda_pin: GPIO21 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + scan: true diff --git a/tests/test_build_components/common/i2c/esp32-c3-ard.yaml b/tests/test_build_components/common/i2c/esp32-c3-ard.yaml new file mode 100644 index 0000000000..0216dccbfa --- /dev/null +++ b/tests/test_build_components/common/i2c/esp32-c3-ard.yaml @@ -0,0 +1,11 @@ +# Common I2C configuration for ESP32-C3 Arduino tests + +substitutions: + scl_pin: GPIO8 + sda_pin: GPIO10 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + scan: true diff --git a/tests/test_build_components/common/i2c/esp32-c3-idf.yaml b/tests/test_build_components/common/i2c/esp32-c3-idf.yaml new file mode 100644 index 0000000000..fd873b6db8 --- /dev/null +++ b/tests/test_build_components/common/i2c/esp32-c3-idf.yaml @@ -0,0 +1,11 @@ +# Common I2C configuration for ESP32-C3 IDF tests + +substitutions: + scl_pin: GPIO8 + sda_pin: GPIO10 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + scan: true diff --git a/tests/test_build_components/common/i2c/esp32-idf.yaml b/tests/test_build_components/common/i2c/esp32-idf.yaml new file mode 100644 index 0000000000..bb2376e7d6 --- /dev/null +++ b/tests/test_build_components/common/i2c/esp32-idf.yaml @@ -0,0 +1,13 @@ +# Common I2C configuration for ESP32 IDF tests +# Provides a shared I2C bus that all components can use +# Components will auto-use this bus if they don't specify i2c_id + +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + scan: true diff --git a/tests/test_build_components/common/i2c/esp32-p4-idf.yaml b/tests/test_build_components/common/i2c/esp32-p4-idf.yaml new file mode 100644 index 0000000000..0c7d7e3414 --- /dev/null +++ b/tests/test_build_components/common/i2c/esp32-p4-idf.yaml @@ -0,0 +1,13 @@ +# Common I2C configuration for ESP32-P4 IDF tests +# Provides a shared I2C bus that all components can use +# Components will auto-use this bus if they don't specify i2c_id + +substitutions: + scl_pin: GPIO8 + sda_pin: GPIO7 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + scan: true diff --git a/tests/test_build_components/common/i2c/esp32-s2-ard.yaml b/tests/test_build_components/common/i2c/esp32-s2-ard.yaml new file mode 100644 index 0000000000..d8201db042 --- /dev/null +++ b/tests/test_build_components/common/i2c/esp32-s2-ard.yaml @@ -0,0 +1,11 @@ +# Common I2C configuration for ESP32-S2 Arduino tests + +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + scan: true diff --git a/tests/test_build_components/common/i2c/esp32-s2-idf.yaml b/tests/test_build_components/common/i2c/esp32-s2-idf.yaml new file mode 100644 index 0000000000..f23f7e35cc --- /dev/null +++ b/tests/test_build_components/common/i2c/esp32-s2-idf.yaml @@ -0,0 +1,11 @@ +# Common I2C configuration for ESP32-S2 IDF tests + +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + scan: true diff --git a/tests/test_build_components/common/i2c/esp32-s3-ard.yaml b/tests/test_build_components/common/i2c/esp32-s3-ard.yaml new file mode 100644 index 0000000000..3499770cb7 --- /dev/null +++ b/tests/test_build_components/common/i2c/esp32-s3-ard.yaml @@ -0,0 +1,11 @@ +# Common I2C configuration for ESP32-S3 Arduino tests + +substitutions: + scl_pin: GPIO9 + sda_pin: GPIO8 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + scan: true diff --git a/tests/test_build_components/common/i2c/esp32-s3-idf.yaml b/tests/test_build_components/common/i2c/esp32-s3-idf.yaml new file mode 100644 index 0000000000..9f5b002eb3 --- /dev/null +++ b/tests/test_build_components/common/i2c/esp32-s3-idf.yaml @@ -0,0 +1,11 @@ +# Common I2C configuration for ESP32-S3 IDF tests + +substitutions: + scl_pin: GPIO9 + sda_pin: GPIO8 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + scan: true diff --git a/tests/test_build_components/common/i2c/esp8266-ard.yaml b/tests/test_build_components/common/i2c/esp8266-ard.yaml new file mode 100644 index 0000000000..6aa28524b2 --- /dev/null +++ b/tests/test_build_components/common/i2c/esp8266-ard.yaml @@ -0,0 +1,11 @@ +# Common I2C configuration for ESP8266 Arduino tests + +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + scan: true diff --git a/tests/test_build_components/common/i2c/rp2040-ard.yaml b/tests/test_build_components/common/i2c/rp2040-ard.yaml new file mode 100644 index 0000000000..cb241aef76 --- /dev/null +++ b/tests/test_build_components/common/i2c/rp2040-ard.yaml @@ -0,0 +1,11 @@ +# Common I2C configuration for RP2040 Arduino tests + +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + scan: true diff --git a/tests/test_build_components/common/i2c_low_freq/esp32-ard.yaml b/tests/test_build_components/common/i2c_low_freq/esp32-ard.yaml new file mode 100644 index 0000000000..53d051f174 --- /dev/null +++ b/tests/test_build_components/common/i2c_low_freq/esp32-ard.yaml @@ -0,0 +1,12 @@ +# Common I2C configuration for ESP32 Arduino tests - Low Frequency (10kHz) + +substitutions: + scl_pin: GPIO22 + sda_pin: GPIO21 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + frequency: 10kHz + scan: true diff --git a/tests/test_build_components/common/i2c_low_freq/esp32-c3-ard.yaml b/tests/test_build_components/common/i2c_low_freq/esp32-c3-ard.yaml new file mode 100644 index 0000000000..c9856c6b29 --- /dev/null +++ b/tests/test_build_components/common/i2c_low_freq/esp32-c3-ard.yaml @@ -0,0 +1,12 @@ +# Common I2C configuration for ESP32-C3 Arduino tests - Low Frequency (10kHz) + +substitutions: + scl_pin: GPIO6 + sda_pin: GPIO5 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + frequency: 10kHz + scan: true diff --git a/tests/test_build_components/common/i2c_low_freq/esp32-c3-idf.yaml b/tests/test_build_components/common/i2c_low_freq/esp32-c3-idf.yaml new file mode 100644 index 0000000000..e9d44b585e --- /dev/null +++ b/tests/test_build_components/common/i2c_low_freq/esp32-c3-idf.yaml @@ -0,0 +1,12 @@ +# Common I2C configuration for ESP32-C3 IDF tests - Low Frequency (10kHz) + +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + frequency: 10kHz + scan: true diff --git a/tests/test_build_components/common/i2c_low_freq/esp32-idf.yaml b/tests/test_build_components/common/i2c_low_freq/esp32-idf.yaml new file mode 100644 index 0000000000..4afe220315 --- /dev/null +++ b/tests/test_build_components/common/i2c_low_freq/esp32-idf.yaml @@ -0,0 +1,13 @@ +# Common I2C configuration for ESP32 IDF tests - Low Frequency (10kHz) +# For components that require I2C frequency <= 15kHz (ags10, ltr501, ltr_als_ps) + +substitutions: + scl_pin: GPIO16 + sda_pin: GPIO17 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + frequency: 10kHz + scan: true diff --git a/tests/test_build_components/common/i2c_low_freq/esp8266-ard.yaml b/tests/test_build_components/common/i2c_low_freq/esp8266-ard.yaml new file mode 100644 index 0000000000..281177ebbd --- /dev/null +++ b/tests/test_build_components/common/i2c_low_freq/esp8266-ard.yaml @@ -0,0 +1,12 @@ +# Common I2C configuration for ESP8266 Arduino tests - Low Frequency (10kHz) + +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + frequency: 10kHz + scan: true diff --git a/tests/test_build_components/common/i2c_low_freq/rp2040-ard.yaml b/tests/test_build_components/common/i2c_low_freq/rp2040-ard.yaml new file mode 100644 index 0000000000..67d893e733 --- /dev/null +++ b/tests/test_build_components/common/i2c_low_freq/rp2040-ard.yaml @@ -0,0 +1,12 @@ +# Common I2C configuration for RP2040 Arduino tests - Low Frequency (10kHz) + +substitutions: + scl_pin: GPIO5 + sda_pin: GPIO4 + +i2c: + - id: i2c_bus + scl: ${scl_pin} + sda: ${sda_pin} + frequency: 10kHz + scan: true 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} diff --git a/tests/test_build_components/common/qspi/esp32-s3-idf.yaml b/tests/test_build_components/common/qspi/esp32-s3-idf.yaml new file mode 100644 index 0000000000..22c98ef664 --- /dev/null +++ b/tests/test_build_components/common/qspi/esp32-s3-idf.yaml @@ -0,0 +1,13 @@ +# Common QSPI configuration for ESP32-S3 IDF tests +# For components that need QuadSPI (qspi_dbi displays) + +spi: + - id: quad_spi + type: quad + interface: spi3 + clk_pin: 47 + data_pins: + - 40 + - 41 + - 42 + - 43 diff --git a/tests/test_build_components/common/spi/bk72xx-ard.yaml b/tests/test_build_components/common/spi/bk72xx-ard.yaml new file mode 100644 index 0000000000..471b147bfa --- /dev/null +++ b/tests/test_build_components/common/spi/bk72xx-ard.yaml @@ -0,0 +1,12 @@ +# Common SPI configuration for BK72XX Arduino tests + +substitutions: + clk_pin: P10 + mosi_pin: P11 + miso_pin: P6 + +spi: + - id: spi_bus + clk_pin: ${clk_pin} + mosi_pin: ${mosi_pin} + miso_pin: ${miso_pin} diff --git a/tests/test_build_components/common/spi/esp32-ard.yaml b/tests/test_build_components/common/spi/esp32-ard.yaml new file mode 100644 index 0000000000..816609688c --- /dev/null +++ b/tests/test_build_components/common/spi/esp32-ard.yaml @@ -0,0 +1,12 @@ +# Common SPI configuration for ESP32 Arduino tests + +substitutions: + clk_pin: GPIO18 + mosi_pin: GPIO23 + miso_pin: GPIO19 + +spi: + - id: spi_bus + clk_pin: ${clk_pin} + mosi_pin: ${mosi_pin} + miso_pin: ${miso_pin} diff --git a/tests/test_build_components/common/spi/esp32-c3-ard.yaml b/tests/test_build_components/common/spi/esp32-c3-ard.yaml new file mode 100644 index 0000000000..da3182f259 --- /dev/null +++ b/tests/test_build_components/common/spi/esp32-c3-ard.yaml @@ -0,0 +1,12 @@ +# Common SPI configuration for ESP32-C3 Arduino tests + +substitutions: + clk_pin: GPIO4 + mosi_pin: GPIO6 + miso_pin: GPIO5 + +spi: + - id: spi_bus + clk_pin: ${clk_pin} + mosi_pin: ${mosi_pin} + miso_pin: ${miso_pin} diff --git a/tests/test_build_components/common/spi/esp32-c3-idf.yaml b/tests/test_build_components/common/spi/esp32-c3-idf.yaml new file mode 100644 index 0000000000..6a8f76c38c --- /dev/null +++ b/tests/test_build_components/common/spi/esp32-c3-idf.yaml @@ -0,0 +1,15 @@ +# Common SPI configuration for ESP32-C3 IDF tests +# Provides a shared SPI bus that all components can use +# Components will auto-use this bus if they don't specify spi_id +# CS pins are component-specific + +substitutions: + clk_pin: GPIO4 + mosi_pin: GPIO6 + miso_pin: GPIO5 + +spi: + - id: spi_bus + clk_pin: ${clk_pin} + mosi_pin: ${mosi_pin} + miso_pin: ${miso_pin} diff --git a/tests/test_build_components/common/spi/esp32-idf.yaml b/tests/test_build_components/common/spi/esp32-idf.yaml new file mode 100644 index 0000000000..c2c39a2bc0 --- /dev/null +++ b/tests/test_build_components/common/spi/esp32-idf.yaml @@ -0,0 +1,15 @@ +# Common SPI configuration for ESP32 IDF tests +# Provides a shared SPI bus that all components can use +# Components will auto-use this bus if they don't specify spi_id +# CS pins are component-specific + +substitutions: + clk_pin: GPIO18 + mosi_pin: GPIO23 + miso_pin: GPIO19 + +spi: + - id: spi_bus + clk_pin: ${clk_pin} + mosi_pin: ${mosi_pin} + miso_pin: ${miso_pin} diff --git a/tests/test_build_components/common/spi/esp32-s2-ard.yaml b/tests/test_build_components/common/spi/esp32-s2-ard.yaml new file mode 100644 index 0000000000..7c8997ae7f --- /dev/null +++ b/tests/test_build_components/common/spi/esp32-s2-ard.yaml @@ -0,0 +1,12 @@ +# Common SPI configuration for ESP32-S2 Arduino tests + +substitutions: + clk_pin: GPIO36 + mosi_pin: GPIO35 + miso_pin: GPIO37 + +spi: + - id: spi_bus + clk_pin: ${clk_pin} + mosi_pin: ${mosi_pin} + miso_pin: ${miso_pin} diff --git a/tests/test_build_components/common/spi/esp32-s2-idf.yaml b/tests/test_build_components/common/spi/esp32-s2-idf.yaml new file mode 100644 index 0000000000..afcd83e94e --- /dev/null +++ b/tests/test_build_components/common/spi/esp32-s2-idf.yaml @@ -0,0 +1,12 @@ +# Common SPI configuration for ESP32-S2 IDF tests + +substitutions: + clk_pin: GPIO36 + mosi_pin: GPIO35 + miso_pin: GPIO37 + +spi: + - id: spi_bus + clk_pin: ${clk_pin} + mosi_pin: ${mosi_pin} + miso_pin: ${miso_pin} diff --git a/tests/test_build_components/common/spi/esp32-s3-ard.yaml b/tests/test_build_components/common/spi/esp32-s3-ard.yaml new file mode 100644 index 0000000000..06d5f65771 --- /dev/null +++ b/tests/test_build_components/common/spi/esp32-s3-ard.yaml @@ -0,0 +1,12 @@ +# Common SPI configuration for ESP32-S3 Arduino tests + +substitutions: + clk_pin: GPIO40 + mosi_pin: GPIO6 + miso_pin: GPIO41 + +spi: + - id: spi_bus + clk_pin: ${clk_pin} + mosi_pin: ${mosi_pin} + miso_pin: ${miso_pin} diff --git a/tests/test_build_components/common/spi/esp32-s3-idf.yaml b/tests/test_build_components/common/spi/esp32-s3-idf.yaml new file mode 100644 index 0000000000..ee47396ec7 --- /dev/null +++ b/tests/test_build_components/common/spi/esp32-s3-idf.yaml @@ -0,0 +1,12 @@ +# Common SPI configuration for ESP32-S3 IDF tests + +substitutions: + clk_pin: GPIO40 + mosi_pin: GPIO6 + miso_pin: GPIO41 + +spi: + - id: spi_bus + clk_pin: ${clk_pin} + mosi_pin: ${mosi_pin} + miso_pin: ${miso_pin} diff --git a/tests/test_build_components/common/spi/esp8266-ard.yaml b/tests/test_build_components/common/spi/esp8266-ard.yaml new file mode 100644 index 0000000000..4320afebb9 --- /dev/null +++ b/tests/test_build_components/common/spi/esp8266-ard.yaml @@ -0,0 +1,12 @@ +# Common SPI configuration for ESP8266 Arduino tests + +substitutions: + clk_pin: GPIO14 + mosi_pin: GPIO13 + miso_pin: GPIO12 + +spi: + - id: spi_bus + clk_pin: ${clk_pin} + mosi_pin: ${mosi_pin} + miso_pin: ${miso_pin} diff --git a/tests/test_build_components/common/spi/rp2040-ard.yaml b/tests/test_build_components/common/spi/rp2040-ard.yaml new file mode 100644 index 0000000000..916a636318 --- /dev/null +++ b/tests/test_build_components/common/spi/rp2040-ard.yaml @@ -0,0 +1,12 @@ +# Common SPI configuration for RP2040 Arduino tests + +substitutions: + clk_pin: GPIO18 + mosi_pin: GPIO19 + miso_pin: GPIO16 + +spi: + - id: spi_bus + clk_pin: ${clk_pin} + mosi_pin: ${mosi_pin} + miso_pin: ${miso_pin} diff --git a/tests/test_build_components/common/uart/bk72xx-ard.yaml b/tests/test_build_components/common/uart/bk72xx-ard.yaml new file mode 100644 index 0000000000..8d1abca70b --- /dev/null +++ b/tests/test_build_components/common/uart/bk72xx-ard.yaml @@ -0,0 +1,13 @@ +# Common UART configuration for BK72XX Arduino tests +# Provides a shared UART bus that components can use +# Components will auto-use this bus if they don't specify uart_id + +substitutions: + tx_pin: TX1 + rx_pin: RX1 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 9600 diff --git a/tests/test_build_components/common/uart/esp32-ard.yaml b/tests/test_build_components/common/uart/esp32-ard.yaml new file mode 100644 index 0000000000..805695def6 --- /dev/null +++ b/tests/test_build_components/common/uart/esp32-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32 Arduino tests + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 9600 diff --git a/tests/test_build_components/common/uart/esp32-c3-ard.yaml b/tests/test_build_components/common/uart/esp32-c3-ard.yaml new file mode 100644 index 0000000000..565b109f9a --- /dev/null +++ b/tests/test_build_components/common/uart/esp32-c3-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32-C3 Arduino tests + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 9600 diff --git a/tests/test_build_components/common/uart/esp32-c3-idf.yaml b/tests/test_build_components/common/uart/esp32-c3-idf.yaml new file mode 100644 index 0000000000..944aa013dd --- /dev/null +++ b/tests/test_build_components/common/uart/esp32-c3-idf.yaml @@ -0,0 +1,13 @@ +# Common UART configuration for ESP32-C3 IDF tests +# Provides a shared UART bus that components can use +# Components will auto-use this bus if they don't specify uart_id + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 9600 diff --git a/tests/test_build_components/common/uart/esp32-idf.yaml b/tests/test_build_components/common/uart/esp32-idf.yaml new file mode 100644 index 0000000000..95e5db9fb1 --- /dev/null +++ b/tests/test_build_components/common/uart/esp32-idf.yaml @@ -0,0 +1,13 @@ +# Common UART configuration for ESP32 IDF tests +# Provides a shared UART bus that components can use +# Components will auto-use this bus if they don't specify uart_id + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 9600 diff --git a/tests/test_build_components/common/uart/esp8266-ard.yaml b/tests/test_build_components/common/uart/esp8266-ard.yaml new file mode 100644 index 0000000000..e326f4fc0d --- /dev/null +++ b/tests/test_build_components/common/uart/esp8266-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP8266 Arduino tests + +substitutions: + tx_pin: GPIO1 + rx_pin: GPIO3 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 9600 diff --git a/tests/test_build_components/common/uart/rp2040-ard.yaml b/tests/test_build_components/common/uart/rp2040-ard.yaml new file mode 100644 index 0000000000..cd1e54a13b --- /dev/null +++ b/tests/test_build_components/common/uart/rp2040-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for RP2040 Arduino tests + +substitutions: + tx_pin: GPIO0 + rx_pin: GPIO1 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 9600 diff --git a/tests/test_build_components/common/uart_115200/esp32-ard.yaml b/tests/test_build_components/common/uart_115200/esp32-ard.yaml new file mode 100644 index 0000000000..9102910f31 --- /dev/null +++ b/tests/test_build_components/common/uart_115200/esp32-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32 Arduino tests - 115200 baud + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 115200 diff --git a/tests/test_build_components/common/uart_115200/esp32-c3-ard.yaml b/tests/test_build_components/common/uart_115200/esp32-c3-ard.yaml new file mode 100644 index 0000000000..87a969c6a3 --- /dev/null +++ b/tests/test_build_components/common/uart_115200/esp32-c3-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32-C3 Arduino tests - 115200 baud + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 115200 diff --git a/tests/test_build_components/common/uart_115200/esp32-c3-idf.yaml b/tests/test_build_components/common/uart_115200/esp32-c3-idf.yaml new file mode 100644 index 0000000000..f3768592e5 --- /dev/null +++ b/tests/test_build_components/common/uart_115200/esp32-c3-idf.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP32-C3 IDF tests - 115200 baud +# For components that require UART baud rate 115200 (bl0906) + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 115200 diff --git a/tests/test_build_components/common/uart_115200/esp32-idf.yaml b/tests/test_build_components/common/uart_115200/esp32-idf.yaml new file mode 100644 index 0000000000..e405f74fe7 --- /dev/null +++ b/tests/test_build_components/common/uart_115200/esp32-idf.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP32 IDF tests - 115200 baud +# For components that require UART baud rate 115200 (bl0906) + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 115200 diff --git a/tests/test_build_components/common/uart_115200/esp8266-ard.yaml b/tests/test_build_components/common/uart_115200/esp8266-ard.yaml new file mode 100644 index 0000000000..2dcf1c4a5d --- /dev/null +++ b/tests/test_build_components/common/uart_115200/esp8266-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP8266 Arduino tests - 115200 baud + +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 115200 diff --git a/tests/test_build_components/common/uart_115200/rp2040-ard.yaml b/tests/test_build_components/common/uart_115200/rp2040-ard.yaml new file mode 100644 index 0000000000..62a7b5aed2 --- /dev/null +++ b/tests/test_build_components/common/uart_115200/rp2040-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for RP2040 Arduino tests - 115200 baud + +substitutions: + tx_pin: GPIO0 + rx_pin: GPIO1 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 115200 diff --git a/tests/test_build_components/common/uart_1200/esp32-ard.yaml b/tests/test_build_components/common/uart_1200/esp32-ard.yaml new file mode 100644 index 0000000000..0ff5663d1f --- /dev/null +++ b/tests/test_build_components/common/uart_1200/esp32-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32 Arduino tests - 1200 baud + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 1200 diff --git a/tests/test_build_components/common/uart_1200/esp32-c3-ard.yaml b/tests/test_build_components/common/uart_1200/esp32-c3-ard.yaml new file mode 100644 index 0000000000..81cad70d3c --- /dev/null +++ b/tests/test_build_components/common/uart_1200/esp32-c3-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32-C3 Arduino tests - 1200 baud + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 1200 diff --git a/tests/test_build_components/common/uart_1200/esp32-c3-idf.yaml b/tests/test_build_components/common/uart_1200/esp32-c3-idf.yaml new file mode 100644 index 0000000000..8f1dace337 --- /dev/null +++ b/tests/test_build_components/common/uart_1200/esp32-c3-idf.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32-C3 IDF tests - 1200 baud + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 1200 diff --git a/tests/test_build_components/common/uart_1200/esp32-idf.yaml b/tests/test_build_components/common/uart_1200/esp32-idf.yaml new file mode 100644 index 0000000000..38ad1b1459 --- /dev/null +++ b/tests/test_build_components/common/uart_1200/esp32-idf.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32 IDF tests - 1200 baud + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 1200 diff --git a/tests/test_build_components/common/uart_1200/esp8266-ard.yaml b/tests/test_build_components/common/uart_1200/esp8266-ard.yaml new file mode 100644 index 0000000000..84907a3a42 --- /dev/null +++ b/tests/test_build_components/common/uart_1200/esp8266-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP8266 Arduino tests - 1200 baud + +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 1200 diff --git a/tests/test_build_components/common/uart_1200/rp2040-ard.yaml b/tests/test_build_components/common/uart_1200/rp2040-ard.yaml new file mode 100644 index 0000000000..3a3b322ea8 --- /dev/null +++ b/tests/test_build_components/common/uart_1200/rp2040-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for RP2040 Arduino tests - 1200 baud + +substitutions: + tx_pin: GPIO0 + rx_pin: GPIO1 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 1200 diff --git a/tests/test_build_components/common/uart_1200_even/esp32-ard.yaml b/tests/test_build_components/common/uart_1200_even/esp32-ard.yaml new file mode 100644 index 0000000000..f5f7f0669f --- /dev/null +++ b/tests/test_build_components/common/uart_1200_even/esp32-ard.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP32 Arduino tests - 1200 baud even parity + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 1200 + parity: EVEN diff --git a/tests/test_build_components/common/uart_1200_even/esp32-c3-ard.yaml b/tests/test_build_components/common/uart_1200_even/esp32-c3-ard.yaml new file mode 100644 index 0000000000..0b1e3ba61b --- /dev/null +++ b/tests/test_build_components/common/uart_1200_even/esp32-c3-ard.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP32-C3 Arduino tests - 1200 baud even parity + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 1200 + parity: EVEN diff --git a/tests/test_build_components/common/uart_1200_even/esp32-c3-idf.yaml b/tests/test_build_components/common/uart_1200_even/esp32-c3-idf.yaml new file mode 100644 index 0000000000..1781babefb --- /dev/null +++ b/tests/test_build_components/common/uart_1200_even/esp32-c3-idf.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP32-C3 IDF tests - 1200 baud, EVEN parity + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 1200 + parity: EVEN diff --git a/tests/test_build_components/common/uart_1200_even/esp32-idf.yaml b/tests/test_build_components/common/uart_1200_even/esp32-idf.yaml new file mode 100644 index 0000000000..3b4b17f892 --- /dev/null +++ b/tests/test_build_components/common/uart_1200_even/esp32-idf.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP32 IDF tests - 1200 baud, EVEN parity + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 1200 + parity: EVEN diff --git a/tests/test_build_components/common/uart_1200_even/esp8266-ard.yaml b/tests/test_build_components/common/uart_1200_even/esp8266-ard.yaml new file mode 100644 index 0000000000..54f7de1757 --- /dev/null +++ b/tests/test_build_components/common/uart_1200_even/esp8266-ard.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP8266 Arduino tests - 1200 baud even parity + +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 1200 + parity: EVEN diff --git a/tests/test_build_components/common/uart_1200_even/rp2040-ard.yaml b/tests/test_build_components/common/uart_1200_even/rp2040-ard.yaml new file mode 100644 index 0000000000..0e8bdeae1f --- /dev/null +++ b/tests/test_build_components/common/uart_1200_even/rp2040-ard.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for RP2040 Arduino tests - 1200 baud even parity + +substitutions: + tx_pin: GPIO0 + rx_pin: GPIO1 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 1200 + parity: EVEN diff --git a/tests/test_build_components/common/uart_19200/esp32-ard.yaml b/tests/test_build_components/common/uart_19200/esp32-ard.yaml new file mode 100644 index 0000000000..f4f04669da --- /dev/null +++ b/tests/test_build_components/common/uart_19200/esp32-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32 Arduino tests - 19200 baud + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 19200 diff --git a/tests/test_build_components/common/uart_19200/esp32-c3-ard.yaml b/tests/test_build_components/common/uart_19200/esp32-c3-ard.yaml new file mode 100644 index 0000000000..925acdc34c --- /dev/null +++ b/tests/test_build_components/common/uart_19200/esp32-c3-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32-C3 Arduino tests - 19200 baud + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 19200 diff --git a/tests/test_build_components/common/uart_19200/esp32-c3-idf.yaml b/tests/test_build_components/common/uart_19200/esp32-c3-idf.yaml new file mode 100644 index 0000000000..0d765a88a4 --- /dev/null +++ b/tests/test_build_components/common/uart_19200/esp32-c3-idf.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP32-C3 IDF tests - 19200 baud +# For components that require UART baud rate 19200 (bl0906) + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 19200 diff --git a/tests/test_build_components/common/uart_19200/esp32-idf.yaml b/tests/test_build_components/common/uart_19200/esp32-idf.yaml new file mode 100644 index 0000000000..e7849508c7 --- /dev/null +++ b/tests/test_build_components/common/uart_19200/esp32-idf.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP32 IDF tests - 19200 baud +# For components that require UART baud rate 19200 (bl0906) + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 19200 diff --git a/tests/test_build_components/common/uart_19200/esp8266-ard.yaml b/tests/test_build_components/common/uart_19200/esp8266-ard.yaml new file mode 100644 index 0000000000..f01bc4590c --- /dev/null +++ b/tests/test_build_components/common/uart_19200/esp8266-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP8266 Arduino tests - 19200 baud + +substitutions: + tx_pin: GPIO1 + rx_pin: GPIO3 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 19200 diff --git a/tests/test_build_components/common/uart_19200/rp2040-ard.yaml b/tests/test_build_components/common/uart_19200/rp2040-ard.yaml new file mode 100644 index 0000000000..6ebd02d451 --- /dev/null +++ b/tests/test_build_components/common/uart_19200/rp2040-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for RP2040 Arduino tests - 19200 baud + +substitutions: + tx_pin: GPIO0 + rx_pin: GPIO1 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 19200 diff --git a/tests/test_build_components/common/uart_38400/esp32-ard.yaml b/tests/test_build_components/common/uart_38400/esp32-ard.yaml new file mode 100644 index 0000000000..15da771ccc --- /dev/null +++ b/tests/test_build_components/common/uart_38400/esp32-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32 Arduino tests - 38400 baud + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 38400 diff --git a/tests/test_build_components/common/uart_38400/esp32-c3-ard.yaml b/tests/test_build_components/common/uart_38400/esp32-c3-ard.yaml new file mode 100644 index 0000000000..8838f029dc --- /dev/null +++ b/tests/test_build_components/common/uart_38400/esp32-c3-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32-C3 Arduino tests - 38400 baud + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 38400 diff --git a/tests/test_build_components/common/uart_38400/esp32-c3-idf.yaml b/tests/test_build_components/common/uart_38400/esp32-c3-idf.yaml new file mode 100644 index 0000000000..d7d902af3d --- /dev/null +++ b/tests/test_build_components/common/uart_38400/esp32-c3-idf.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32-C3 IDF tests - 38400 baud + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 38400 diff --git a/tests/test_build_components/common/uart_38400/esp32-idf.yaml b/tests/test_build_components/common/uart_38400/esp32-idf.yaml new file mode 100644 index 0000000000..f1c9587e27 --- /dev/null +++ b/tests/test_build_components/common/uart_38400/esp32-idf.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32 IDF tests - 38400 baud + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 38400 diff --git a/tests/test_build_components/common/uart_38400/esp8266-ard.yaml b/tests/test_build_components/common/uart_38400/esp8266-ard.yaml new file mode 100644 index 0000000000..b1a046ea5e --- /dev/null +++ b/tests/test_build_components/common/uart_38400/esp8266-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP8266 Arduino tests - 38400 baud + +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 38400 diff --git a/tests/test_build_components/common/uart_38400/rp2040-ard.yaml b/tests/test_build_components/common/uart_38400/rp2040-ard.yaml new file mode 100644 index 0000000000..01b5e58ed7 --- /dev/null +++ b/tests/test_build_components/common/uart_38400/rp2040-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for RP2040 Arduino tests - 38400 baud + +substitutions: + tx_pin: GPIO0 + rx_pin: GPIO1 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 38400 diff --git a/tests/test_build_components/common/uart_4800/esp32-ard.yaml b/tests/test_build_components/common/uart_4800/esp32-ard.yaml new file mode 100644 index 0000000000..7f7096e31d --- /dev/null +++ b/tests/test_build_components/common/uart_4800/esp32-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32 Arduino tests - 4800 baud + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 4800 diff --git a/tests/test_build_components/common/uart_4800/esp32-c3-ard.yaml b/tests/test_build_components/common/uart_4800/esp32-c3-ard.yaml new file mode 100644 index 0000000000..3c814b76e4 --- /dev/null +++ b/tests/test_build_components/common/uart_4800/esp32-c3-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32-C3 Arduino tests - 4800 baud + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 4800 diff --git a/tests/test_build_components/common/uart_4800/esp32-c3-idf.yaml b/tests/test_build_components/common/uart_4800/esp32-c3-idf.yaml new file mode 100644 index 0000000000..7b18789b19 --- /dev/null +++ b/tests/test_build_components/common/uart_4800/esp32-c3-idf.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32-C3 IDF tests - 4800 baud + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 4800 diff --git a/tests/test_build_components/common/uart_4800/esp32-idf.yaml b/tests/test_build_components/common/uart_4800/esp32-idf.yaml new file mode 100644 index 0000000000..c2bd5b3edd --- /dev/null +++ b/tests/test_build_components/common/uart_4800/esp32-idf.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP32 IDF tests - 4800 baud + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 4800 diff --git a/tests/test_build_components/common/uart_4800/esp8266-ard.yaml b/tests/test_build_components/common/uart_4800/esp8266-ard.yaml new file mode 100644 index 0000000000..afdbf4a599 --- /dev/null +++ b/tests/test_build_components/common/uart_4800/esp8266-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for ESP8266 Arduino tests - 4800 baud + +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 4800 diff --git a/tests/test_build_components/common/uart_4800/rp2040-ard.yaml b/tests/test_build_components/common/uart_4800/rp2040-ard.yaml new file mode 100644 index 0000000000..3bf0d6ba47 --- /dev/null +++ b/tests/test_build_components/common/uart_4800/rp2040-ard.yaml @@ -0,0 +1,11 @@ +# Common UART configuration for RP2040 Arduino tests - 4800 baud + +substitutions: + tx_pin: GPIO0 + rx_pin: GPIO1 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 4800 diff --git a/tests/test_build_components/common/uart_4800_even/esp32-ard.yaml b/tests/test_build_components/common/uart_4800_even/esp32-ard.yaml new file mode 100644 index 0000000000..053848615b --- /dev/null +++ b/tests/test_build_components/common/uart_4800_even/esp32-ard.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP32 Arduino tests - 4800 baud even parity + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 4800 + parity: EVEN diff --git a/tests/test_build_components/common/uart_4800_even/esp32-c3-ard.yaml b/tests/test_build_components/common/uart_4800_even/esp32-c3-ard.yaml new file mode 100644 index 0000000000..b1370bc1cb --- /dev/null +++ b/tests/test_build_components/common/uart_4800_even/esp32-c3-ard.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP32-C3 Arduino tests - 4800 baud even parity + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 4800 + parity: EVEN diff --git a/tests/test_build_components/common/uart_4800_even/esp32-c3-idf.yaml b/tests/test_build_components/common/uart_4800_even/esp32-c3-idf.yaml new file mode 100644 index 0000000000..173c768937 --- /dev/null +++ b/tests/test_build_components/common/uart_4800_even/esp32-c3-idf.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP32-C3 IDF tests - 4800 baud, EVEN parity + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 4800 + parity: EVEN diff --git a/tests/test_build_components/common/uart_4800_even/esp32-idf.yaml b/tests/test_build_components/common/uart_4800_even/esp32-idf.yaml new file mode 100644 index 0000000000..eb850ec2dd --- /dev/null +++ b/tests/test_build_components/common/uart_4800_even/esp32-idf.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP32 IDF tests - 4800 baud, EVEN parity + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 4800 + parity: EVEN diff --git a/tests/test_build_components/common/uart_4800_even/esp8266-ard.yaml b/tests/test_build_components/common/uart_4800_even/esp8266-ard.yaml new file mode 100644 index 0000000000..0b6bd9eac1 --- /dev/null +++ b/tests/test_build_components/common/uart_4800_even/esp8266-ard.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP8266 Arduino tests - 4800 baud even parity + +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 4800 + parity: EVEN diff --git a/tests/test_build_components/common/uart_4800_even/rp2040-ard.yaml b/tests/test_build_components/common/uart_4800_even/rp2040-ard.yaml new file mode 100644 index 0000000000..c99421b791 --- /dev/null +++ b/tests/test_build_components/common/uart_4800_even/rp2040-ard.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for RP2040 Arduino tests - 4800 baud even parity + +substitutions: + tx_pin: GPIO0 + rx_pin: GPIO1 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 4800 + parity: EVEN diff --git a/tests/test_build_components/common/uart_9600_even/esp32-ard.yaml b/tests/test_build_components/common/uart_9600_even/esp32-ard.yaml new file mode 100644 index 0000000000..0a04f10705 --- /dev/null +++ b/tests/test_build_components/common/uart_9600_even/esp32-ard.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP32 Arduino tests - 9600 baud even parity + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 9600 + parity: EVEN diff --git a/tests/test_build_components/common/uart_9600_even/esp32-c3-ard.yaml b/tests/test_build_components/common/uart_9600_even/esp32-c3-ard.yaml new file mode 100644 index 0000000000..1341a91b4e --- /dev/null +++ b/tests/test_build_components/common/uart_9600_even/esp32-c3-ard.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP32-C3 Arduino tests - 9600 baud even parity + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 9600 + parity: EVEN diff --git a/tests/test_build_components/common/uart_9600_even/esp32-c3-idf.yaml b/tests/test_build_components/common/uart_9600_even/esp32-c3-idf.yaml new file mode 100644 index 0000000000..5a7bce2198 --- /dev/null +++ b/tests/test_build_components/common/uart_9600_even/esp32-c3-idf.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP32-C3 IDF tests - 9600 baud, EVEN parity + +substitutions: + tx_pin: GPIO20 + rx_pin: GPIO21 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 9600 + parity: EVEN diff --git a/tests/test_build_components/common/uart_9600_even/esp32-idf.yaml b/tests/test_build_components/common/uart_9600_even/esp32-idf.yaml new file mode 100644 index 0000000000..b60cf71b17 --- /dev/null +++ b/tests/test_build_components/common/uart_9600_even/esp32-idf.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP32 IDF tests - 9600 baud, EVEN parity + +substitutions: + tx_pin: GPIO17 + rx_pin: GPIO16 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 9600 + parity: EVEN diff --git a/tests/test_build_components/common/uart_9600_even/esp8266-ard.yaml b/tests/test_build_components/common/uart_9600_even/esp8266-ard.yaml new file mode 100644 index 0000000000..300ec842df --- /dev/null +++ b/tests/test_build_components/common/uart_9600_even/esp8266-ard.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for ESP8266 Arduino tests - 9600 baud even parity + +substitutions: + tx_pin: GPIO4 + rx_pin: GPIO5 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 9600 + parity: EVEN diff --git a/tests/test_build_components/common/uart_9600_even/rp2040-ard.yaml b/tests/test_build_components/common/uart_9600_even/rp2040-ard.yaml new file mode 100644 index 0000000000..c281ae84b5 --- /dev/null +++ b/tests/test_build_components/common/uart_9600_even/rp2040-ard.yaml @@ -0,0 +1,12 @@ +# Common UART configuration for RP2040 Arduino tests - 9600 baud even parity + +substitutions: + tx_pin: GPIO0 + rx_pin: GPIO1 + +uart: + - id: uart_bus + tx_pin: ${tx_pin} + rx_pin: ${rx_pin} + baud_rate: 9600 + parity: EVEN diff --git a/tests/unit_tests/test_espota2.py b/tests/unit_tests/test_espota2.py index bd1a6bde81..52c72291d6 100644 --- a/tests/unit_tests/test_espota2.py +++ b/tests/unit_tests/test_espota2.py @@ -493,7 +493,7 @@ def test_run_ota_impl_successful( assert result_host == "192.168.1.100" # Verify socket was configured correctly - mock_socket.settimeout.assert_called_with(10.0) + mock_socket.settimeout.assert_called_with(20.0) mock_socket.connect.assert_called_once_with(("192.168.1.100", 3232)) mock_socket.close.assert_called_once() diff --git a/tests/unit_tests/test_main.py b/tests/unit_tests/test_main.py index e35378145a..becf911fa3 100644 --- a/tests/unit_tests/test_main.py +++ b/tests/unit_tests/test_main.py @@ -1203,6 +1203,31 @@ def test_show_logs_api( ) +@patch("esphome.components.api.client.run_logs") +def test_show_logs_api_with_fqdn_mdns_disabled( + mock_run_logs: Mock, +) -> None: + """Test show_logs with API using FQDN when mDNS is disabled.""" + setup_core( + config={ + "logger": {}, + CONF_API: {}, + CONF_MDNS: {CONF_DISABLED: True}, + }, + platform=PLATFORM_ESP32, + ) + mock_run_logs.return_value = 0 + + args = MockArgs() + devices = ["device.example.com"] + + result = show_logs(CORE.config, args, devices) + + assert result == 0 + # Should use the FQDN directly, not try MQTT lookup + mock_run_logs.assert_called_once_with(CORE.config, ["device.example.com"]) + + @patch("esphome.components.api.client.run_logs") def test_show_logs_api_with_mqtt_fallback( mock_run_logs: Mock, @@ -1222,7 +1247,7 @@ def test_show_logs_api_with_mqtt_fallback( mock_mqtt_get_ip.return_value = ["192.168.1.200"] args = MockArgs(username="user", password="pass", client_id="client") - devices = ["device.local"] + devices = ["MQTTIP"] result = show_logs(CORE.config, args, devices) @@ -1487,27 +1512,31 @@ def test_mqtt_get_ip() -> None: def test_has_resolvable_address() -> None: """Test has_resolvable_address function.""" - # Test with mDNS enabled and hostname address + # Test with mDNS enabled and .local hostname address setup_core(config={}, address="esphome-device.local") assert has_resolvable_address() is True - # Test with mDNS disabled and hostname address + # Test with mDNS disabled and .local hostname address (still resolvable via DNS) setup_core( config={CONF_MDNS: {CONF_DISABLED: True}}, address="esphome-device.local" ) - assert has_resolvable_address() is False + assert has_resolvable_address() is True - # Test with IP address (mDNS doesn't matter) + # Test with mDNS disabled and regular DNS hostname (resolvable) + setup_core(config={CONF_MDNS: {CONF_DISABLED: True}}, address="device.example.com") + assert has_resolvable_address() is True + + # Test with IP address (always resolvable, mDNS doesn't matter) setup_core(config={}, address="192.168.1.100") assert has_resolvable_address() is True - # Test with IP address and mDNS disabled + # Test with IP address and mDNS disabled (still resolvable) setup_core(config={CONF_MDNS: {CONF_DISABLED: True}}, address="192.168.1.100") assert has_resolvable_address() is True - # Test with no address but mDNS enabled (can still resolve mDNS names) + # Test with no address setup_core(config={}, address=None) - assert has_resolvable_address() is True + assert has_resolvable_address() is False # Test with no address and mDNS disabled setup_core(config={CONF_MDNS: {CONF_DISABLED: True}}, address=None) diff --git a/tests/unit_tests/test_writer.py b/tests/unit_tests/test_writer.py index bcb069db83..05feb8b21e 100644 --- a/tests/unit_tests/test_writer.py +++ b/tests/unit_tests/test_writer.py @@ -986,3 +986,49 @@ def test_clean_all_removes_non_storage_directories( # Verify logging mentions cleaning assert "Cleaning" in caplog.text assert str(build_dir) in caplog.text + + +@patch("esphome.writer.CORE") +def test_clean_all_preserves_json_files( + mock_core: MagicMock, + tmp_path: Path, + caplog: pytest.LogCaptureFixture, +) -> None: + """Test clean_all preserves .json files.""" + # Create build directory with various files + config_dir = tmp_path / "config" + config_dir.mkdir() + + build_dir = config_dir / ".esphome" + build_dir.mkdir() + + # Create .json files (should be preserved) + (build_dir / "config.json").write_text('{"config": "data"}') + (build_dir / "metadata.json").write_text('{"metadata": "info"}') + + # Create non-.json files (should be removed) + (build_dir / "dummy.txt").write_text("x") + (build_dir / "other.log").write_text("log content") + + # Call clean_all + from esphome.writer import clean_all + + with caplog.at_level("INFO"): + clean_all([str(config_dir)]) + + # Verify .esphome directory still exists + assert build_dir.exists() + + # Verify .json files are preserved + assert (build_dir / "config.json").exists() + assert (build_dir / "config.json").read_text() == '{"config": "data"}' + assert (build_dir / "metadata.json").exists() + assert (build_dir / "metadata.json").read_text() == '{"metadata": "info"}' + + # Verify non-.json files were removed + assert not (build_dir / "dummy.txt").exists() + assert not (build_dir / "other.log").exists() + + # Verify logging mentions cleaning + assert "Cleaning" in caplog.text + assert str(build_dir) in caplog.text