core: Missing device_class for Android TV media_player entities

The problem

Hi,

i am setting up my homekit integration right now. I read about the supported components and TV devices here: https://www.home-assistant.io/integrations/homekit/#supported-components

<html> <body>
media_player TelevisionMediaPlayer All media players that have tv as their device_class. Represented as Television and Remote accessories in HomeKit to control on / off, play / pause, select source, or volume increase / decrease, depending on supported_features of entity. Requires iOS 12.2/macOS 10.14.4 or later.
</body> </html>

But for my android TV media_player entity the device class is missing. The entity just got none. Could this be corrected an the missing device_class “tv” added for this integration

What version of Home Assistant Core has the issue?

core-2022.8.0b2

What was the last working version of Home Assistant Core?

What type of installation are you running?

Home Assistant OS

Integration causing the issue

Andoid TV

Link to integration documentation on our website

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

Diagnostics information

config_entry-androidtv-e9c8cc04dbf4da1d2245671b356cd74d.json.txt

Example YAML snippet

./. (UI)

Anything in the logs that might be useful for us?

no

Additional information

No response

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 21 (4 by maintainers)

Most upvoted comments

Because @bdraco is in this thread. I will wait for his opinion. No problem to create a PR to add device class if he think that this make sense.

@ollo69 Could you please create a PR for it?

Maybe later on somebody can add customization to the frondend for media_players. Before that everybody could use customize in rare usecases if tv is not working for them. For people that are using customize right now to add the device_class, nothing changes in my oppinion. So maybe this is not even a breaking change, only streamlining the usage of media players and homekit a little 😃

It does look like tv is a reasonable device class for this based on https://www.android.com/tv/. Some of them may be headless but they still generally behave like a TV.

It would also be good to add customize support to the frontend for media_players as its expected that the device class may not always be perfect. As developers we can only accommodate the most likely use case.

Because at this moment just exist 3 device class, all cast device (as Chromecast or FireTV) probably better match to DeviceClass TV than any others. At the end these devices just transform a classic TV to a Smart TV.

@ollo69 I read here: https://www.home-assistant.io/integrations/media_player/#device-class

… that we should be able to select the device class in the customize section. But I don’t see this option.

Here I can change it: image

But for the anroidTV integration I don’t see it: image

There is a reference blog entry: https://www.home-assistant.io/blog/2021/12/11/release-202112/

The customize.yaml UI (customization) has been removed. The YAML configuration for this is recommended and remains available. To customize entities, use the entity settings available via the icon in the top right of the entity “more info” dialog (when clicking on an entity). Entity settings now also allows customizing device_class for certain binary_sensor and cover cases.

So setting the device_class is right now not available for media_players… This path could be another way to solve this: Add “show as” to the media_player integration itself.

I am curios for @bdraco opinion.

Seb

Because @bdraco is in this thread. I will wait for his opinion. No problem to create a PR to add device class if he think that this make sense.