peteS-UK / emotiva

Home Assistant Media Player for Emotiva Processors
Other
1 stars 1 forks source link

Feature Request: Current Input as a Select Entity #8

Closed JoshMcWilson closed 2 weeks ago

JoshMcWilson commented 2 weeks ago

If this is not feasible, or redundant, I totally understand. :)

Basically, it would be really handy to have a specific select entity for the processor that displays the current HDMI input selected. I know that in the media player entities attributes, you can see the current selected input for the processor. I am not super well versed in using yaml or jinja to customize buttons and extract those attributes out to customize my dashboards.

It would be really nice to be able to have a some sort of specific entity and it's state would be the current HDMI input selected. That way I could have on my dashboard some buttons to switch inputs that would only be enabled depending on which input is selected.

This would still require some logic to display this, but I think it might be easier to work off of if there was an entity whose state was the HDMI input selected.

Here is an example of the JVC Projector integration which has such an entity:

image

Thanks!

peteS-UK commented 2 weeks ago

Is this actually an entity, or a sensor? Have you got a link to the JVC integration you're using?

You probably want the source rather than the input. As we discussed in the other thread, sources are made up of a video and audio format and are configurable and name-able. So, the source list from the media player entity.

JoshMcWilson commented 2 weeks ago

It's quite possible I'm not using the correct terminology there, it may be considered a sensor. Here is the link to the JVC integration:

https://www.home-assistant.io/integrations/jvc_projector/

It does appear to be listed as an actual entity, although it does mention both a select entity and a sensor for the HDMI input in the documentation.

image

peteS-UK commented 2 weeks ago

Ah - looking at the doc, it creates both a sensor and a select entity (which I've never heard of before!). Looks like it's only a couple of lines of code https://developers.home-assistant.io/docs/core/entity/select/. I'll take a look when I get a mo.

I'm just doing a simple IR based integration atm, wrapping a broadlink ir blaster into a media player so I can control my old Naim stuff from HA as well, and rebuilding my proxmox cluster which runs HA. Got to pick a time to do that which doesn't upset my wife too much as nothing in the house will work.

peteS-UK commented 2 weeks ago

OK - was literally about 3 lines of code. Added a source select entity and posted it as version 1.8 with the other chnges

JoshMcWilson commented 2 weeks ago

Sick, thank you so much! This game me exactly what I was looking for! Now I can have fancy buttons that light up whenever a specific source is selected:

image

Glad it was an easy change.

And totally understand that, I've been juggling multiple home projects with HA and automation in between taking care of our 4 month old so it's difficult to find the time sometimes. Not to mention upgrading my Unraid NAS/server and keeping Plex up so the wife's shows are always available :)

peteS-UK commented 2 weeks ago

OK - fixed in 1.8.0