Closed Switch123456789 closed 10 months ago
Not quite sure what you aim to do with the media_content_id
.
If you could provide an example that would make things clearer.
I'm not sure on how to add consume_mode to the entity, but it makes sense. I will dig in a bit
Not quite sure what you aim to do with the
media_content_id
.
It's value contains the media-type (or rather media source), I wish to see what the media-source is in lovelace. I could try to split the string in jinja or java (costum:button-card) to get unique strings that will work as conditions.
I can see that this might be not worth the effort to implement, depending on how much work it would take
I will dig in a bit
Thank you :) Are there limitations to mopidy's media-player-entity?
I found a way to extract the music-source from media_content_id
, those 2 example strings show how.
As Template: state_attr('media_player.mopidy', 'media_content_id').split(':')[0]
In costum:button-card: states['media_player.mopidy'].attributes.media_content_id.split(':')[0]
Causes a bit of clutter, but it's not too bad :D
Aha... I think I understand. You would like to have the source (eg local, spotify, tunein, tidal,...) separately
That is doable. I could add an attribute called source_extension
Something like this (line 23 in the screenshot)
mopidy_extension
Something like this
exactly!
In an effort to provide some more newer Home Assistant features, I've refactored all my code. The above can be found in my development branch for v2 called feature/compat.
If you want, you can give it a spin.
Nice! I am working with v2 since yesterday and it's working fine :) thank you!
I noticed that some services are not available, turn_on
turn_off
& toggle
. I think because of that it is impossible to stop playback with the default media-player-card/info-panel. Personally I don't mind that since I don't use it and calling the media_player.stop
-service does turn off the player but I can imagine some people might get bothered by that.
EDIT: media_playlist
seems to be gone , I use that for a bunch of things, I hope you can bring that back sir :)
Your efforts are much appreciated.
Thanks for the feedback!
I did indeed remove the turn_on
and turn_off
capability, as after reading a bit on the topic it means you have a real toggle to turn on or off the device, which is not the case.
Both the default media card and the mini-media-card can pause
what you are playing. Stopping it from any of these cards seems not to have been implemented.
Personally I prefer not having the turn on/off functionality, as it hides too much stuff when turning it off.
I also asked feedback in my home assistant thread, so I'll see what happens...
Makes sense, I am not sure but I though Mopidy keeps sending audio when paused, this could waste some of the host machines resources, as long as you don't remove stop button I am happy :)
Did you notice my edit in the last post? Most of my implementations rely on playlists, please help :D
It must have crossed posts. I did not intentionally remove media_playlist
, so I will definitely restore its functionality.
Wrt signal being sent out when not turned off, how can I reproduce this? What are the steps you took, so I can investigate a bit more?
media_playlist
should be available now
fixed with #37
Yesterday I finally found time to check out your changes. I noticed you included the capability to add songs to the queue, which wasn't possible before (or I didn't see it), that's great :)
I did some testing and things work very well! There is only 2 minor things I noticed:
Nonetheless this update is great and much appreciated. Thank you!!!
Many thanks for testing. The lag you are experiencing is because of the home assistant component update schedule. it is a fixed time interval (of about 10 seconds). I believe I would be able to do it using async methods, but I need to look into this. I am not a coder, so these things tend to take some time for me to understand how to properly code.
I feel you, I just created my first home assistant add-on with only knowing a thing or two about shell script and had to learn everything from scratch on my way (it is a mopidy-add-on with extras btw.).
It would be a nice addition to have a more responsive interface but it's not a deal-breaker if it isn't. Controlling the music in my whole flat with Home Assistant is already so cool & practical within itself :) I love it!
Hey, it is me again :) still messing around with your integration to see what I can do.
Today I wanted to make Lovelace react to the
media_type
that is playing (local:track:
,youtube:video:
,http:
, ect.) I know it is part ofmedia_content_id
but it turned out to be a pain in the b*tt to just do a simple trim on a string within lovelace to get a proper value, so it would be very handy for those 2 people on earth who would want that without the clutter.Having feedback in Home Assistant for the state of the
consume_mode
would be nice as well :)