Skip to content

Add "stream" to default_config#90153

Merged
balloob merged 4 commits into
home-assistant:devfrom
tsbernar:update_stream_default_for_new_av_version
Mar 27, 2023
Merged

Add "stream" to default_config#90153
balloob merged 4 commits into
home-assistant:devfrom
tsbernar:update_stream_default_for_new_av_version

Conversation

@tsbernar
Copy link
Copy Markdown
Contributor

Proposed change

This last PR (#89969) got locked, and I'm not sure my last comment was seen about the av 8.0.0 release before that happened. Re-opening, and adding the context again here:

We do not try to install the av package on startup when resolving the dependencies of the default config. It seems like this is an artifact from before av used binary wheels and had a more difficult manual installation process. I see that line in default_config/__init__.py was written in 2019, and av was updated in 2020 to use binary wheels so can now be easily installed with pip

Due to the complexity of the dependencies, PyAV is not always the easiest Python package to install from source. Since release 8.0.0 binary wheels are provided on PyPI for Linux, Mac and Windows linked against a modern FFmpeg. You can install these wheels by running:

pip install av

(https://pypi.org/project/av/#description)

It took some digging to figure this out for me when adding a generic camera did not work.

The UI showed "unknown error"; the logs showed that it was because stream was not set up, which was ultimately because av was not installed, and it did not get auto-installed on startup when reading the config.

I think it is safe now to make this change since av 8.0.0 release and stream should get set up correctly including the install of av.

If you would like to keep it this way for a manual install, I could instead update the documentation here:
https://www.home-assistant.io/integrations/stream/

Maybe with a troubleshooting section or a note about installing av manually?

Let me know your thoughts.

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

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
  • I have followed the perfect PR recommendations
  • 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.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.
  • Untested files have been added to .coveragerc.

To help with the load of incoming pull requests:

@home-assistant
Copy link
Copy Markdown
Contributor

Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration (default_config) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of default_config can trigger bot actions by commenting:

  • @home-assistant close Closes the pull request.
  • @home-assistant rename Awesome new title Renames the pull request.
  • @home-assistant reopen Reopen the pull request.
  • @home-assistant unassign default_config Removes the current integration label and assignees on the pull request, add the integration domain after the command.

@emontnemery emontnemery changed the title Update stream default for new av version Add "stream" to default_config Mar 23, 2023
Comment thread homeassistant/components/default_config/__init__.py
@balloob
Copy link
Copy Markdown
Member

balloob commented Mar 23, 2023

I discussed it with some other devs and this change is ok to move on 👍

@allenporter
Copy link
Copy Markdown
Contributor

Looks like this requires some hassfest updates / update of package_constraints.txt? Otherwise really happy to see stream setup get simpler!

@uvjustin for FYI

Copy link
Copy Markdown
Member

@MartinHjelmare MartinHjelmare left a comment

Choose a reason for hiding this comment

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

Please run python3 -m script.gen_requirements_all and commit and push the changes.

@home-assistant home-assistant Bot marked this pull request as draft March 24, 2023 07:47
@home-assistant
Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@MartinHjelmare
Copy link
Copy Markdown
Member

Please link a docs PR. Then we can merge.

@tsbernar
Copy link
Copy Markdown
Contributor Author

Thanks, everyone!

@MartinHjelmare, which documentation should I be updating for this? The home-assistant.io docs for stream already say

The stream integration is automatically loaded by default_config and enabled by the camera platforms that support it
(https://www.home-assistant.io/integrations/stream/)

which now matches this change

@MartinHjelmare
Copy link
Copy Markdown
Member

@balloob do you want further documentation changes?

@balloob balloob marked this pull request as ready for review March 27, 2023 17:57
@home-assistant home-assistant Bot requested a review from MartinHjelmare March 27, 2023 17:57
@balloob
Copy link
Copy Markdown
Member

balloob commented Mar 27, 2023

oh, looks good indeed.

@balloob balloob merged commit d59e2b1 into home-assistant:dev Mar 27, 2023
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 28, 2023
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.

HomeAssistant can't setup the Stream integration after installing through Python

4 participants