Skip to content

Add support for opening and closing states to Homekit GarageDoor#31290

Closed
rickvdl wants to merge 2 commits into
home-assistant:devfrom
rickvdl:feature/homekit-garage-door-opening-closing-states
Closed

Add support for opening and closing states to Homekit GarageDoor#31290
rickvdl wants to merge 2 commits into
home-assistant:devfrom
rickvdl:feature/homekit-garage-door-opening-closing-states

Conversation

@rickvdl
Copy link
Copy Markdown
Contributor

@rickvdl rickvdl commented Jan 29, 2020

Proposed change

Home assistant has support for the opening and closing states for cover's with the garage device class. Currently the opening and closing states are implicitly handled by Homekit, if the cover is open and you press close, it is considered that the cover is closing. However currently it's not possible to set the opening or closing state manually, for situations where the operation was not triggered by Homekit (e.g. a Home assistant automation or perhaps an analog input using a physical button on the garage door).

I've also added these states to the MQTT component in #31259. Together this will allow you to proactively report whether a GarageDoor is moving without having triggered the action from Homekit itself. However I think both PR's also make sense apart from each other.

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

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
  • The code has been formatted using Black (black --fast 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.
  • Untested files have been added to .coveragerc.

The integration reached or maintains the following Integration Quality Scale:

  • No score or internal
  • 🥈 Silver
  • 🥇 Gold
  • 🏆 Platinum

@rickvdl rickvdl force-pushed the feature/homekit-garage-door-opening-closing-states branch from 550bdcc to 3fd2a15 Compare January 29, 2020 22:19
@rickvdl rickvdl requested a review from cdce8p January 30, 2020 07:35
Comment thread homeassistant/components/homekit/type_covers.py Outdated
Comment thread homeassistant/components/homekit/type_covers.py Outdated
@rickvdl
Copy link
Copy Markdown
Contributor Author

rickvdl commented Feb 2, 2020

@springstan Processed the requested changes, thanks!

@cdce8p cdce8p removed their request for review February 2, 2020 09:48
STATE_CLOSED: 1,
STATE_OPENING: 2,
STATE_CLOSING: 3,
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Just compared this to other files of homekit/type_xxx.py and now I would recommend to move this dict outside of the class GarageDoorOpener. See the next example for reference:
https://github.com/home-assistant/home-assistant/blob/48402d49dcc54cdba26e44cdfb45e95e6e3edd15/homeassistant/components/homekit/type_locks.py#L15-L20

@springstan
Copy link
Copy Markdown
Member

Furthermore, you will need to add more tests to pass the codecoverage for this patch :)
Thanks 👍

@stale
Copy link
Copy Markdown

stale Bot commented Mar 21, 2020

There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days.
Thank you for your contributions.

@stale stale Bot added the stale label Mar 21, 2020
@stale stale Bot closed this Mar 28, 2020
@lock lock Bot locked and limited conversation to collaborators Apr 2, 2020
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