Skip to content

Conversation

@starkillerOG
Copy link
Contributor

@starkillerOG starkillerOG commented Nov 9, 2025

Breaking change

Proposed change

In HA 2025.11.0 the angle for HomeAssistant tilt devices was reverted 0>100, 100>0.
But in one specific function this inversion was forgotten leading to misbehaviour.
(you set it to 25, but it goes to 75 and then shows position 75)

see #149777

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

  • This PR fixes or closes issue: fixes #
  • This PR is related to issue:
  • Link to documentation pull request:
  • Link to developer documentation pull request:
  • Link to frontend pull request:

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 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:

Copilot AI review requested due to automatic review settings November 9, 2025 12:44
@starkillerOG starkillerOG added this to the 2025.11.2 milestone Nov 9, 2025
Copy link
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 the tilt angle calculation in the async_set_absolute_position method for Motion Blinds. The change inverts the angle value to align with the coordinate system used by the Motion Blinds API, making it consistent with other tilt position methods in the integration.

Key Changes

  • Added angle inversion (angle = 180 - angle) after converting from 0-100 range to 0-180 degrees
  • This aligns with the existing pattern used in async_set_cover_tilt_position and other tilt-related methods
Comments suppressed due to low confidence (1)

homeassistant/components/motion_blinds/cover.py:249

  • The async_set_absolute_position method with tilt angle parameter lacks test coverage. Since other similar methods like async_set_cover_tilt_position have test coverage in the integration (and similar tilt transformations exist in lines 304-306 and 383-406), this new angle inversion logic should be tested to verify the correct transformation from Home Assistant's 0-100 range to the Motion Blinds API's 0-180 range.
        angle = kwargs.get(ATTR_TILT_POSITION)
        if angle is not None:
            angle = angle * 180 / 100
            angle = 180 - angle
        async with self._api_lock:
            await self.hass.async_add_executor_job(
                self._blind.Set_position,
                100 - position,
                angle,
                self._restore_tilt,
            )

Copy link
Member

@zweckj zweckj left a comment

Choose a reason for hiding this comment

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

Should we add a test to guard against future regression?

@starkillerOG
Copy link
Contributor Author

@zweckj I don't have test coverage for the motion_blinds integration besides the required config flow.
So I don't see a point in added a specific test for this.

I should at some point add tests in general, but there are many things I should be doing...

@zweckj zweckj merged commit b4d6a44 into home-assistant:dev Nov 9, 2025
40 of 42 checks passed
@starkillerOG starkillerOG deleted the motion_tilt branch November 9, 2025 14:03
@github-actions github-actions bot locked and limited conversation to collaborators Nov 10, 2025
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.

3 participants