home-assistant/developers.home-assistant

Media player documentation is incorrectly stating MediaPlayerState's as uppercase

ss89 opened this issue · 2 comments

ss89 commented

The states of a media player are documented here as uppercase: https://developers.home-assistant.io/docs/core/entity/media-player/#states

However i just discovered in the developer tools of home assistant (2024.3.3) that in fact these values should be lower case (at least with my media player).

See: https://github.com/home-assistant/core/blob/429b5d22cf92a3f1c615ac6593ed2a309b086477/homeassistant/components/media_player/const.py#L46

Code snippet {{states('media_player.kuche')}} results in paused not PAUSED, as PAUSED is just the key of the enums field, not the value.

One could also argue that the table should contain: key, value and description instead of just value (incorrect, as is key/field) and description.

It might be obvious for people that to development on home assistants core, but it is not obvious for people that start with creating automations - or am i reading the wrong page of documentation?

The page you are referring to is how it's displayed in the code, so the page is correct.

If there was more documentation about it, I'd expect it in the normal documentation, but I can't find it, maybe we need to improve there.

ss89 commented

Thanks, i created the issue for the integrations page instead.