-
Notifications
You must be signed in to change notification settings - Fork 16
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
Barometer sensor: Soft-remove hPA
unit for compatibility reasons
#72
Conversation
This way, an endpoint with a barometer sensor can be compatible with both 0.13 and 0.14. See discussion in #69.
I'm not sure if we should add the unit if there is just one unit that you can choose from? I mean, it's more explicit that way, but also kinda useless. |
It's mostly a compatibility thing, v0.13 requires the unit and if we remove the unit field we break compatibility. It's also more open for extension in case there are other units in the future. We can of course say that all units must be normalized to standardized SI units, but for example for air pressure, would you specify Pa or hPa? Pa is the SI base unit but hPa is what's being used to specify air pressure. I'd keep the unit, it doesn't break compatibility and it makes the sensor values self-describing. |
It wouldn't break compatibility if we remove it, 0.13 should still have it and 0.14 wouldn't care. Alternatively i would also add kPa (that's what i3 uses, 1 of 4 spaces that has barometer readings). Isn't Pa the SI unit and hPa and kPa are just factors and by that still a SI unit? |
Oh, I forgot that we'll simply ignore unknown values... That is true. But it would only work if we'd take If we'd start from a green field, I would suggest to leave away the unit and to always force the use of appropriate SI units (
Hm, yeah, we need to find a tradeoff between making it easy to enter the data (by just using the units that are available) versus making it easy to consume the data (since data needs to be normalized). kPa seems to be a common unit for car tire pressure, for example. Meteorology uses hPa mostly. I'm not sure whether we should add kPa. Maybe we should always add the base unit and the commonly used unit for the type of sensor being used (if different)? In this case that would be (Edit: I just saw that i3 also provides a Some brainstorming: Another approach would be to specify the value together with a factor. So pressure would be |
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.
Nice! I like the approach of soft deprecation 🙂
This way, an endpoint with a barometer sensor can be compatible with
both 0.13 and 0.14. See discussion in #69.