Skip to content
This repository has been archived by the owner on Nov 4, 2023. It is now read-only.

Media player source name is ugly #94

Closed
rchl opened this issue Jul 17, 2018 · 11 comments
Closed

Media player source name is ugly #94

rchl opened this issue Jul 17, 2018 · 11 comments

Comments

@rchl
Copy link
Collaborator

rchl commented Jul 17, 2018

The media source name shown on media player tile is "ugly" (non-descriptive). At least for the component that I'm using to control my Sony Bravia TV (https://github.com/gerard33/sony-bravia-ha).

Let me show that in pictures:

This is how the tile looks like with any of the 4 HDMI sources selected (it shows same for all):
hdmi-source

As you can see, it shows "extInput:hdmi" which is neither precise enough (shows same for all 4 hdmis) nor clean.

This is the list of sources shown on clicking the source name:
source-list

That looks nice and correct.

Here is the state snapshot of the entity:

{
    "entity_id": "media_player.mybraviatv",
    "state": "on",
    "attributes": {
        "volume_level": 0.1,
        "is_volume_muted": false,
        "media_content_id": "HDMI 4",
        "media_content_type": "tvshow",
        "media_title": "HDMI 4",
        "source": "extInput:hdmi",
        "source_list": [
            "HDMI 1",
            "HDMI 2",
            "HDMI 3/ARC",
            "HDMI 4",
            "AV 1",
            "AV 2/Component"
        ],
        "friendly_name": "MyBraviaTV",
        "supported_features": 23997,
    },
    "last_changed": "2018-07-17T21:46:06.771413+00:00",
    "last_updated": "2018-07-17T21:47:04.259447+00:00"
}

As you can see here, the better choice to show would be either attributes.media_title or attributes.media_content_id. Not sure which one is more "standard" or common.

@rchl
Copy link
Collaborator Author

rchl commented Jul 17, 2018

Or possibly the component is doing a bad job here by not translating internal name to user-friendly one...

@resoai
Copy link
Collaborator

resoai commented Jul 17, 2018

I have the very same issue as I'm a (not so) proud owner of 65' Sony Android TV (2015). We really need to test it as media_title could be showing name of the movie instead of the source etc. There could be situations where media_title could not be present at all etc. This could also be specific to that component.

@rchl
Copy link
Collaborator Author

rchl commented Jul 17, 2018

I've created an issue for that component (referenced here) so we'll see if that can be fixed there.

As for TileBoard, I thought one can work-around it by disabling source and using subtitle instead, like:

...
hideSource: true,
subtitle: '@attributes.media_title',
...

but when turning on netflix for example, media_title (and also source) are disappearing completely...

"attributes": {
        "volume_level": 0.1,
        "is_volume_muted": false,
        "media_content_type": "tvshow",
        "media_series_title": "No info (resumed after pause or                                           app opened)",
        "source_list": [
            "HDMI 1",
            "HDMI 2",
            "HDMI 3/ARC",
            "HDMI 4",
            "AV 1",
            "AV 2/Component"
        ],
        "friendly_name": "MyBraviaTV",
        "supported_features": 23997,
    },

And yeah, I don't want to disable source as then I can't change the source.

@resoai
Copy link
Collaborator

resoai commented Jul 17, 2018

I have not looked at HA's code but I think what HA is doing is showing name of the source as long as source is within source_list array and simply Source title otherwise. If this is an adequate enough solution, we could easily do that.

@rchl
Copy link
Collaborator Author

rchl commented Jul 17, 2018

Yes, that is true - it shows 'Source' when there is no source attribute.

@resoai
Copy link
Collaborator

resoai commented Jul 17, 2018

We are doing the same thing in TileBoard already but we don't verify source against source_list.

@rchl
Copy link
Collaborator Author

rchl commented Jul 17, 2018

Well, I meant that TileBoard does that (shows "Source") already. That's OK.
The only problem seems to be with the component that it doesn't translate internal name in source in the same way it does for source_list. So I think there is nothing wrong with TileBoard here really.

@resoai
Copy link
Collaborator

resoai commented Jul 17, 2018

The only logical solution would be to understand how HA's UI does it and do the same thing.

@Evgeny-
Copy link
Collaborator

Evgeny- commented Jul 18, 2018

I think it's your TV problem. But I'm not sure.
See no reason why media title should be used instead source.

@rchl
Copy link
Collaborator Author

rchl commented Jul 18, 2018

As I said, it's probably HA's component fault. But as @resoai pointed out, HA manages to show correct input name.

@rchl
Copy link
Collaborator Author

rchl commented Jul 19, 2018

I think HA just shows media_title which makes it look like it shows correct source. But the source selector doesn't show selected source which is probably due to source not matching selected source from source_list. So there is nothing to fix in TileBoard IMO - feel free to close unless you see something that can be improved.

@Evgeny- Evgeny- closed this as completed Jul 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants