Repository navigation
New Pressure Unit - #768
Conversation
|
With reference to #752 |
|
The changes in this pull request are now breaking existing code using Bmxx80 pressure readings, due to the implementation of a Pressure struct that works like the Temperature one. |
Great! OK for merge now? |
|
Cheers! |
|
@krwq please note that the tutorial https://msdn.microsoft.com/magazine/mt833493 referenced from https://github.com/dotnet/iot will no longer be working with this merge. |
Please take note @dawidborycki |
|
@MarkCiliaVincenti good point, We should add some comment under the article clarifying the difference or make a tiny change if possible to use older package version which still has the old API. Fortunately this difference is relatively small and rather straight forward to fix and actually makes code cleaner. Perhaps we should consider adding more units we're likely going to add anyway in the future... |
|
FYI: @joperezr I created the label to track these kind of changes in case we need to document them |
|
@krwq I just saw this. Instead of breaking, should we just add a new overload that returns the new type instead of double? I would really like to minimize breaking-changes even for the device bindings when possible, and this case seems like it is something that could easily be avoided with a new overload |
|
@joperezr I'm fine with that if the old API has units in the name (which I don't think it does). If not I'd go with the breaking change on this one but I'm ok with doing that if I'm outvoted |
|
I don't see how you could do this without breaking, otherwise it will be messy. There's a unit for Temperature and all methods return an instance of Temperature. Pressure was missing a unit, which it now has, and is consistent with Temperature. It's been merged a while ago now, so either way it's going to break either for those who are on stable or the ones who are on prerelease who have already adapted their code for this PR. Furthermore there are other PRs which are dependent on this, such as the WeatherHelper. |
|
I agree with the "will be messy" part. I think this one is worth to make a breaking change for consistency. What we can consider though is perhaps making Pressure be implicitly convertible to double with whatever unit we used before (hPa?) |
Uh oh!
There was an error while loading. Please reload this page.