From 53454adc40a4dea9536d390a137fbeb08297eac4 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 27 Apr 2026 06:19:39 -0500 Subject: [PATCH 1/3] [cover] Add cover.control / cover.template.publish coverage to template tests --- tests/components/template/common-base.yaml | 50 ++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/tests/components/template/common-base.yaml b/tests/components/template/common-base.yaml index ecc65de66c..5f9c7f8ecc 100644 --- a/tests/components/template/common-base.yaml +++ b/tests/components/template/common-base.yaml @@ -293,6 +293,56 @@ cover: cover.is_closed: template_cover_with_triggers then: logger.log: Cover is closed + # Exercise cover.control / cover.template.publish action variants so the + # ControlAction / CoverPublishAction templates are instantiated for the + # bitmask combinations seen in real configs. + - platform: template + name: "Template Cover Bitmask" + id: template_cover_bitmask + has_position: true + optimistic: true + open_action: + - cover.template.publish: + id: template_cover_bitmask + position: 1.0 + - cover.template.publish: + id: template_cover_bitmask + current_operation: IDLE + close_action: + - cover.template.publish: + id: template_cover_bitmask + position: 0.0 + tilt: 0.0 + stop_action: + - cover.template.publish: + id: template_cover_bitmask + current_operation: IDLE + tilt_action: + - lambda: |- + id(template_cover_bitmask).tilt = tilt; + id(template_cover_bitmask).publish_state(); + on_idle: + # mask = position only + - cover.control: + id: template_cover_bitmask + position: 50% + # mask = tilt only + - cover.control: + id: template_cover_bitmask + tilt: 75% + # mask = position + tilt + - cover.control: + id: template_cover_bitmask + position: 25% + tilt: 30% + # mask = stop + - cover.control: + id: template_cover_bitmask + stop: true + # CONF_STATE alias for position bit + - cover.control: + id: template_cover_bitmask + state: OPEN number: - platform: template From 50b0474d60ab5e2ab72e162c70d73b1000740fb8 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 27 Apr 2026 06:20:43 -0500 Subject: [PATCH 2/3] [cover] Reword: generic coverage, not bitmask-specific --- tests/components/template/common-base.yaml | 42 +++++++++++----------- 1 file changed, 21 insertions(+), 21 deletions(-) diff --git a/tests/components/template/common-base.yaml b/tests/components/template/common-base.yaml index 5f9c7f8ecc..9d4e5f5d6e 100644 --- a/tests/components/template/common-base.yaml +++ b/tests/components/template/common-base.yaml @@ -293,55 +293,55 @@ cover: cover.is_closed: template_cover_with_triggers then: logger.log: Cover is closed - # Exercise cover.control / cover.template.publish action variants so the - # ControlAction / CoverPublishAction templates are instantiated for the - # bitmask combinations seen in real configs. + # Exercise cover.control / cover.template.publish action variants so they + # get build coverage in CI (and so memory-impact analysis on PRs that + # touch ControlAction / CoverPublishAction sees real instances). - platform: template - name: "Template Cover Bitmask" - id: template_cover_bitmask + name: "Template Cover Actions" + id: template_cover_actions has_position: true optimistic: true open_action: - cover.template.publish: - id: template_cover_bitmask + id: template_cover_actions position: 1.0 - cover.template.publish: - id: template_cover_bitmask + id: template_cover_actions current_operation: IDLE close_action: - cover.template.publish: - id: template_cover_bitmask + id: template_cover_actions position: 0.0 tilt: 0.0 stop_action: - cover.template.publish: - id: template_cover_bitmask + id: template_cover_actions current_operation: IDLE tilt_action: - lambda: |- - id(template_cover_bitmask).tilt = tilt; - id(template_cover_bitmask).publish_state(); + id(template_cover_actions).tilt = tilt; + id(template_cover_actions).publish_state(); on_idle: - # mask = position only + # position only - cover.control: - id: template_cover_bitmask + id: template_cover_actions position: 50% - # mask = tilt only + # tilt only - cover.control: - id: template_cover_bitmask + id: template_cover_actions tilt: 75% - # mask = position + tilt + # position + tilt - cover.control: - id: template_cover_bitmask + id: template_cover_actions position: 25% tilt: 30% - # mask = stop + # stop - cover.control: - id: template_cover_bitmask + id: template_cover_actions stop: true - # CONF_STATE alias for position bit + # CONF_STATE alias for position - cover.control: - id: template_cover_bitmask + id: template_cover_actions state: OPEN number: From a46d7e0a6a7ebc396ca0f6a4e40f66fa63925e84 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Mon, 27 Apr 2026 06:42:15 -0500 Subject: [PATCH 3/3] [cover] Also exercise cover.template.publish with state: alias --- tests/components/template/common-base.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/components/template/common-base.yaml b/tests/components/template/common-base.yaml index 9d4e5f5d6e..daa6f53d42 100644 --- a/tests/components/template/common-base.yaml +++ b/tests/components/template/common-base.yaml @@ -302,6 +302,10 @@ cover: has_position: true optimistic: true open_action: + # CONF_STATE alias for the position bit + - cover.template.publish: + id: template_cover_actions + state: OPEN - cover.template.publish: id: template_cover_actions position: 1.0