-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
Use Home Assistant's device_class #528
Conversation
Thanks @felixtriller! I was still trying to figure out how to test this as it's a Docker addon and I have no idea how to do that :-) |
I updated the unit for |
lib/homeassistant.js
Outdated
@@ -157,7 +157,7 @@ const configurations = { | |||
type: 'sensor', | |||
object_id: 'lock', | |||
discovery_payload: { | |||
icon: 'mdi:lock', | |||
device_class: 'lock', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Device class lock does not exist for sensor: https://www.home-assistant.io/components/sensor/#device-class (only for binary sensor). Could you revert this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch!
Thanks! |
Thank you for your work on this project! If anyone wonders, you have to restart Home Assistant to get the new config from discovery. |
* Use Home Assistant's device_class for sensors. * Unit for pressure should be hPa * There is no device_class lock
As @RodBr wrote in #522 we should use
device_class
to have the default appearance in Home Assistant.I am not sure about
sensor_click
,sensor_power
,sensor_action
andsensor_brightness
.Available device classes can be found here and here.