Skip to content

Add transition support to scenes, cleanup blocking parameter #34434

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
Apr 21, 2020

Conversation

frenck
Copy link
Member

@frenck frenck commented Apr 19, 2020

Proposed change

This PR adds transition support to the scene.turn_on and scene.apply services.

Furthermore:

  • Removes unused blocking method parameter from async_reproduce_state in our state helpers.
  • Fixed a case where sync calls were made in an async context in LCN integration scene activation
  • Some small tweaks along the route, which is merely styling.

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

Example entry for configuration.yaml:

# Example configuration.yaml

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

@frenck frenck changed the title Add transition support to scenes, cleanup blocked parameter Add transition support to scenes, cleanup blocking parameter Apr 19, 2020
@frenck frenck marked this pull request as draft April 20, 2020 22:48
@frenck
Copy link
Member Author

frenck commented Apr 20, 2020

Moving PR back to draft. As discussed today, this needs some tuning to be more future proof.

@frenck frenck marked this pull request as ready for review April 21, 2020 00:17
@frenck
Copy link
Member Author

frenck commented Apr 21, 2020

Converted it to use reproduce_options instead. Service handlers now use **kwargs, to match others.

This allows us to easily add new reproduce/scene options in the future.

Added a link to the documentation PR as well.

@balloob balloob merged commit bc5a2da into dev Apr 21, 2020
@balloob balloob deleted the frenck-2020-0405 branch April 21, 2020 01:07
@@ -63,7 +65,7 @@ def __init__(self, config, address_connection):
async def async_added_to_hass(self):
"""Run when entity about to be added to hass."""

async def async_activate(self):
def activate(self, **kwargs: Any) -> None:
Copy link
Member

Choose a reason for hiding this comment

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

The pypck library supports asyncio via asyncio transports and protocols. This should run in the event loop.

Copy link
Member Author

Choose a reason for hiding this comment

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

    def send_command(self, pck):
        self.loop.create_task(self.send_command_async(pck))

It is indeed deeper into the pypck library. Thanks @MartinHjelmare 👍

#34493

@lock lock bot locked and limited conversation to collaborators Apr 25, 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.

4 participants