Skip to content
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

✨ Feature: Added support for button based cover controls #17

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

wouterdebruijn
Copy link

@wouterdebruijn wouterdebruijn commented Sep 21, 2024

Summary

This PR introduces the is_button variable to the cover configuration. When set to true, this simulates a momentary button press, where the associated switch is temporarily set to a high state, as opposed to flipping a persistent switch.

Rationale

This feature is beneficial for remote-controlled window covers that have been adapted for HomeAssistant integration. These covers typically expect button presses for operation and only stop when a dedicated stop button is pressed. This PR enables the simulation of such button presses, making the integration compatible for these types of setups.

Changes

  • Added the is_button configuration option for all covers. It defaults to false to preserve compatibility with existing configurations.
  • Utilized asyncio for its sleep functionality to manage timed deactivation.
  • Implemented a delay in the _async_handle_command function to turn off the switch after 1 second of activation, simulating a button press. This is only enabled for covers where is_button is set to true.

@Sese-Schneider Sese-Schneider self-assigned this Sep 23, 2024
@Sese-Schneider Sese-Schneider added the enhancement New feature or request label Sep 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants