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

missed unit_of_measurement #8

Closed
krom opened this issue Mar 28, 2023 · 2 comments · Fixed by #11
Closed

missed unit_of_measurement #8

krom opened this issue Mar 28, 2023 · 2 comments · Fixed by #11
Labels
enhancement New feature or request roadmap Roadmap item, to be implemented in an upcoming version. v0.2.0

Comments

@krom
Copy link

krom commented Mar 28, 2023

Your excample sensor provide text sensor with human friendly unit of measurement

- name: Sensible Root Disk Free
  kind: script
  sensorid: root_free
  script: root_free.sh
  icon: mdi:harddisk

and script

#!/bin/sh
df  /  -h | tail -n 1 | awk '/ / {print $4}'

But it's not good solution because it's not useful for authomations and graphs

I've replaces config to

- name: Sensible Root Disk Free
  kind: script
  sensorid: root_free
  script: root_free.sh
  unit_of_measurement: GB
  icon: mdi:harddisk

and script to

#!/bin/sh
df / | tail -n 1 | awk '/ / {print $4 / 1048576}'

But unit_of_measurement does not exist in config.

Could you please provide unit_of_measurement and change your configs

This issue is related to #4

@TheTinkerDad TheTinkerDad added enhancement New feature or request roadmap Roadmap item, to be implemented in an upcoming version. labels Mar 29, 2023
@TheTinkerDad
Copy link
Owner

Thanks, I'll definitely add this as part of the next release!

@TheTinkerDad TheTinkerDad linked a pull request Apr 22, 2023 that will close this issue
@TheTinkerDad
Copy link
Owner

Implemented this and it's available on the latest branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request roadmap Roadmap item, to be implemented in an upcoming version. v0.2.0
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants