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

Set device_class to duration in HA sensor definitions #822

Closed
heennkkee opened this issue Dec 19, 2022 · 2 comments
Closed

Set device_class to duration in HA sensor definitions #822

heennkkee opened this issue Dec 19, 2022 · 2 comments
Labels
enhancement New feature or request
Milestone

Comments

@heennkkee
Copy link

Is your feature request related to a problem? Please describe.
When automatically detecting devices through MQTT in Home Assistant the uptime counters could have their device_class set to duration. I believe that the unit_of_measurement would also need to be changed from minutes to min.
This effects how the values are rendered by default in HA, and although I honestly prefer the way the default rendering for the values are "as is", flagging the values with the correct attributes are more correct and "future proofer".

With device_class set:
image

Existing settings:
image

Describe the solution you'd like
The above one

Describe alternatives you've considered
To ignore this and keep going as is works just fine, but thought this was an improvement.

Additional context
None

@heennkkee heennkkee added the enhancement New feature or request label Dec 19, 2022
@proddy
Copy link
Contributor

proddy commented Dec 23, 2022

I'll test it out, thanks for submitting.

@proddy
Copy link
Contributor

proddy commented Dec 23, 2022

@proddy proddy added this to the v3.5.0 milestone Dec 23, 2022
proddy added a commit to proddy/EMS-ESP32 that referenced this issue Dec 23, 2022
proddy added a commit that referenced this issue Dec 24, 2022
@proddy proddy closed this as completed Dec 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants