Skip to content

Fix visualization by inverting open/closed state of patio awnings #128079

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Oct 29, 2024

Conversation

mback2k
Copy link
Contributor

@mback2k mback2k commented Oct 10, 2024

Breaking change

The open/closed state of awnings will be inverted, so that the UI visualization and positioning matches reality. This means open (100%) now refers to the awning being completely retracted and closed (0%) now means the awning is fully expanded. This is not in line with industry terminology, but HA does not yet natively support awnings of type patio.

Proposed change

Until the referenced architectural discussion is solved and support for new types of covers has been implemented natively, invert the reported state of patio awnings to match the expections of the UI visualizations based on the cover platform and solve representation of virtical awnings until those can be handled more differentiated.

Details including screenshots without this change: home-assistant/architecture#979 (reply in thread)

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

  • 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.

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 link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

Until the referenced architectural discussion is solved and support
for new types of covers has been implemented natively, invert the
reported state of patio awnings to match the expections of the UI
visualizations based on the cover platform and solve representation
of virtical awnings until those can be handled more differentiated.

Ref: home-assistant/architecture#979

async def async_set_cover_position(self, **kwargs: Any) -> None:
"""Move the cover to a specific position."""
action = self._dest.action(WMS_WebControl_pro_API_actionDescription.AwningDrive)
await action(percentage=kwargs[ATTR_POSITION])
await action(percentage=100 - kwargs[ATTR_POSITION])

@property
def is_closed(self) -> bool | None:
Copy link
Contributor Author

@mback2k mback2k Oct 10, 2024

Choose a reason for hiding this comment

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

As a middle-ground-solution, we could make this property function is_closed return the awning is closed (now meaning expanded) as soon as the current position in HA methodology is less than 100% (now meaning fully retracted) and therefore the awning being expanded even only a little bit. So, open would just mean fully retracted then to check it is really fully protected during storm/rain.

Any opinions about this?

@mback2k mback2k marked this pull request as ready for review October 10, 2024 09:20
@joostlek joostlek merged commit 2c9ad95 into home-assistant:dev Oct 29, 2024
31 checks passed
@mback2k
Copy link
Contributor Author

mback2k commented Oct 29, 2024

Thanks @joostlek 🙏🏻

@github-actions github-actions bot locked and limited conversation to collaborators Oct 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants