-
-
Notifications
You must be signed in to change notification settings - Fork 31.5k
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
Converge stream av open methods, options, and error handling #134020
base: dev
Are you sure you want to change the base?
Conversation
Hey there @hunterjm, @uvjustin, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
Hey there @rytilahti, @bdraco, @sdb9696, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
# Import from stream.worker as stream cannot reexport from worker | ||
# without forcing the av dependency on default_config | ||
# pylint: disable-next=import-outside-toplevel | ||
from homeassistant.components.stream.worker import StreamWorkerError |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FYI, this is removing rather than moving to new import location. This can never be thrown here since its caught by Stream
and never exposed. We can fix exception handling here by exposing the error codes in a follow up.
@@ -48,7 +49,7 @@ | |||
CONF_PART_DURATION = "part_duration" | |||
CONF_SEGMENT_DURATION = "segment_duration" | |||
|
|||
CONF_PREFER_TCP = "prefer_tcp" | |||
ATTR_PREFER_TCP = "prefer_tcp" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reaming this since its not a configuration option. This is not exposed in __all__
today.
super().__init__(*args, **kwargs) | ||
|
||
|
||
async def _async_try_open_stream( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is removed since it is not used anywhere.
if pyav_options is None: | ||
pyav_options = {} | ||
|
||
default_pyav_options = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These options are slightly different than the defaults used by the stream component. These have been removed and converted with the existing default.
|
||
def _try_open_stream( | ||
source: str, pyav_options: dict[str, str] | None = None | ||
) -> InputContainer | OutputContainer: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is changed to only be InputContainer
when moving since we're only using one of the open constructors for input.
Proposed change
Address proposed improvements in #132866 with related cleanup. This converges:
generic
config flow which will happen in follow up steps. Currently the exceptions caught in generic are not validType of change
Additional information
Checklist
ruff format homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
.To help with the load of incoming pull requests: