Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sensor state name incorrect #13

Closed
frenck opened this issue Dec 10, 2018 · 4 comments
Closed

Sensor state name incorrect #13

frenck opened this issue Dec 10, 2018 · 4 comments
Labels
bug Something isn't working help wanted Extra attention is needed released

Comments

@frenck
Copy link

frenck commented Dec 10, 2018

The card does not show the correct state name for sensors.
See this example of a binary sensor that has the window device class:

screen shot 2018-12-10 at 00 59 36

I expected the card to show "Closed", instead of "off".

@nervetattoo nervetattoo added the bug Something isn't working label Dec 12, 2018
@nervetattoo nervetattoo added the help wanted Extra attention is needed label Jan 15, 2019
@nervetattoo
Copy link
Owner

I would love some input on how to most easily infer this from whatever HA leaves around in the exposed global objects if anyone know. I think I've seen some other cards have a hard coded map for device class state mappings but that is something I would not like to maintain. I hope there is a clean and good solution to get this information.
@thomasloven @iantrich ?

@thomasloven
Copy link

There's lots of nice stuff in the hass object.
Such as
hass.language and hass.resources[language_code]["state.binary_sensor.door.on"]

If you wish to take a look at it outside of a card e.g. in the chrome console, you can find it at document.querySelector("home-assistant").hass.

@nervetattoo
Copy link
Owner

Thanks. I already had localisation support for some other stuff, but good to get some info on how the key looked for this type of value 👍

@github-actions
Copy link

🎉 This issue has been resolved in version 1.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed released
Projects
None yet
Development

No branches or pull requests

3 participants