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

Use Home Assistant's device_class #528

Merged
merged 3 commits into from
Oct 24, 2018
Merged

Use Home Assistant's device_class #528

merged 3 commits into from
Oct 24, 2018

Conversation

felixtriller
Copy link
Contributor

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 and sensor_brightness.

Available device classes can be found here and here.

@felixtriller felixtriller changed the title Use Home Assistant's device_class for sensors. Use Home Assistant's device_class Oct 22, 2018
@RodBr
Copy link

RodBr commented Oct 22, 2018

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 :-)

@felixtriller
Copy link
Contributor Author

I updated the unit for sensor_pressure, it should be hPa, not Pa.

@@ -157,7 +157,7 @@ const configurations = {
type: 'sensor',
object_id: 'lock',
discovery_payload: {
icon: 'mdi:lock',
device_class: 'lock',
Copy link
Owner

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!

@Koenkk
Copy link
Owner

Koenkk commented Oct 24, 2018

Thanks!

@Koenkk Koenkk merged commit d0cf61b into Koenkk:dev Oct 24, 2018
@felixtriller felixtriller deleted the hass-device-class branch October 24, 2018 19:16
@felixtriller
Copy link
Contributor Author

Thank you for your work on this project!

If anyone wonders, you have to restart Home Assistant to get the new config from discovery.

wilmardo pushed a commit to wilmardo/zigbee2mqtt that referenced this pull request Sep 26, 2019
* Use Home Assistant's device_class for sensors.

* Unit for pressure should be hPa

* There is no device_class lock
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants