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

[Refactor] Add helper functions select_command and select_state. #91

Closed
wants to merge 1 commit into from

Conversation

vlebourl
Copy link
Collaborator

@vlebourl vlebourl commented Jun 29, 2020

Add two functions to select first existing command or state from a list.
Implemented in cover.py as a proof of concept.

Add two functions to select first existing command or state from a list.
Implement in cover.py
vlebourl added a commit that referenced this pull request Jun 29, 2020
@vlebourl vlebourl marked this pull request as draft June 29, 2020 14:38
@vlebourl vlebourl marked this pull request as ready for review July 1, 2020 07:13
async def async_apply_action(self, cmd_name, *args):
"""Apply Action to Device in async context."""
await self.hass.async_add_executor_job(self.apply_action, cmd_name, *args)

def apply_action(self, cmd_name, *args):
"""Apply Action to Device."""

if cmd_name is None:
Copy link
Owner

Choose a reason for hiding this comment

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

When can cmd_name be none?

@vlebourl
Copy link
Collaborator Author

vlebourl commented Jul 3, 2020

That was a PR to refactor and simplified code. Not urgent for now.

@vlebourl vlebourl closed this Jul 3, 2020
@iMicknl iMicknl deleted the add_select_command branch January 27, 2021 14:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants