-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
Media Source implementation for Chromecast #39305
Conversation
a44dcca
to
47fb16e
Compare
hass_url = get_url(self.hass, prefer_external=True) | ||
media_id = f"{hass_url}{media_id}" | ||
|
||
await self.hass.async_add_job( |
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.
await self.hass.async_add_job( | |
await self.hass.async_add_executor_job( |
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 wasn't addressed.
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.
Sorry, I thought Paulus addressed it in his followup commits. Either way, this is exactly what the parent does.
https://github.com/home-assistant/core/blob/dev/homeassistant/components/media_player/__init__.py#L600-L604
I can add a follow-up PR to change it there and simply call super
in this class if you would like.
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.
Yes, please. 👍
d66c0e0
to
7e8a96d
Compare
7e8a96d
to
de97d23
Compare
Co-authored-by: Paulus Schoutsen <paulus@home-assistant.io>
Proposed change
This PR implements a relatively simple new integration that exposes media files found in
allowlist_external_dirs
with a media browser compatible API through a new/media
view behind auth. It also creates a new websocket formedia_finder/browse_media
which along withauth/sign_path
will allow for a lovelace card to be developed to play local media files in the browser. The name for the integration is still up in the air, so feel free to vote for one.Here I also implement Media Browser for the
cast
integration since Chromecast allows playing of arbitrary URLs. To pass auth, we sign the path with the Home Assistant Cast user with a 5 minute expiration.Type of change
Example entry for
configuration.yaml
:media_finder:
or
default_config:
Additional information
Checklist
black --fast 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
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: