Skip to content

Fix is_closed state and position for DynamicPergola covers in Overkiz#170983

Merged
zweckj merged 8 commits into
home-assistant:devfrom
iMicknl:overkiz/fix-dynamic-pergola-state
May 18, 2026
Merged

Fix is_closed state and position for DynamicPergola covers in Overkiz#170983
zweckj merged 8 commits into
home-assistant:devfrom
iMicknl:overkiz/fix-dynamic-pergola-state

Conversation

@iMicknl
Copy link
Copy Markdown
Member

@iMicknl iMicknl commented May 17, 2026

Proposed change

The DynamicPergola widget uses core:OpenClosedState and core:ClosureState, unlike bioclimatic pergolas that use core:SlatsOpenClosedState. Without a widget-level override, the UIClass.PERGOLA fallback looked for slats state that doesn't exist on this device, causing the cover to report unknown state.

Fixes #170812

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies a diff between library versions and ideally a link to the changelog/release notes is added to the PR description.

To help with the load of incoming pull requests:

iMicknl added 4 commits May 17, 2026 13:35
The DynamicPergola widget uses core:OpenClosedState and core:ClosureState,
unlike bioclimatic pergolas that use core:SlatsOpenClosedState. Without a
widget-level override, the UIClass.PERGOLA fallback looked for slats state
that doesn't exist on this device, causing the cover to report unknown state.

Fixes home-assistant#170812
The slats-based behavior (core:SlatsOpenClosedState, tilt orientation) is
specific to BioclimaticPergola devices. Make the UIClass.PERGOLA default use
the simpler core:OpenClosedState and core:ClosureState which works for
DynamicPergola and other standard pergola widgets.
Ensures the deployment-based pergola awning widget has snapshot coverage
to prevent regressions when changing the UIClass.PERGOLA default.
Ensures the deployment-based pergola awning widget has snapshot coverage
to prevent regressions when changing the UIClass.PERGOLA default.
@iMicknl iMicknl added this to the 2026.5.3 milestone May 17, 2026
Copilot AI review requested due to automatic review settings May 17, 2026 14:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes Overkiz pergola cover state/position handling by updating the Pergola UIClass defaults to use core:OpenClosedState + core:ClosureState, while adding a widget-specific override to preserve the existing bioclimatic pergola (slats/tilt) behavior.

Changes:

  • Update UIClass.PERGOLA mapping to use core:OpenClosedState for is_closed and core:ClosureState for position.
  • Add a UIWidget.BIOCLIMATIC_PERGOLA override to keep slats open/closed + orientation (tilt-only) support.
  • Extend Overkiz test fixtures and service/snapshot coverage for DynamicPergola and PergolaHorizontalAwning.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.

File Description
homeassistant/components/overkiz/cover.py Adjusts pergola description defaults and adds a bioclimatic-pergola widget override to avoid “unknown” cover state.
tests/components/overkiz/test_cover.py Adds new fixture devices and service-action assertions for dynamic pergola + pergola horizontal awning.
tests/components/overkiz/fixtures/setup/cloud_somfy_tahoma_v2_europe.json Adds device definitions/states for the new pergola devices used by tests.
tests/components/overkiz/snapshots/test_cover.ambr Updates snapshots to reflect the new devices and revised pergola state/position behavior.

Comment thread tests/components/overkiz/test_cover.py
DYNAMIC_PERGOLA and PERGOLA_HORIZONTAL_AWNING use the same fixture file
as SHUTTER, so adding them to SNAPSHOT_FIXTURES caused redundant snapshot
runs with unstable json0/json1/json2 IDs.
@iMicknl iMicknl marked this pull request as ready for review May 17, 2026 14:42
Copilot AI review requested due to automatic review settings May 17, 2026 14:42
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

The PergolaHorizontalAwning and PergolaHorizontalAwningUno widget
descriptions were missing stop_command, causing the stop button to
not appear in the UI despite the device supporting the stop command.

Fixes home-assistant#171014
Copilot AI review requested due to automatic review settings May 18, 2026 10:16
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 4 out of 4 changed files in this pull request and generated no new comments.

@zweckj zweckj merged commit 4582c56 into home-assistant:dev May 18, 2026
33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stop button missing for PergolaHorizontalAwning covers in Overkiz is_closed state is unknown for DynamicPergola covers in Overkiz

3 participants