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

Fix api inconsistency about temperature units #87

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

anxolerd
Copy link

Problem

When we read temperature the default units are Celsius and to get Fahrenheit we need to pass an additional flag. On the other hand heat index is calculated in Fahrenheit by default and there is a need to pass an additional boolean flag to retrieve a value in Celsius. See husky-dev/firebase-iot-codelab#3.

Description

This PR fixes the inconsistency by setting the default units to Celsius. Alongside this a little naming improvement has been done to make the purpose of flags in readTemperature more clear.

Limitations

Introduced changes are API-breaking, so a major version should be incremented in the release which will contain this patch.

As to husky-dev/firebase-iot-codelab#3 there is
a strange design when temperature is read in Celsius by default and
heatIndex is computed in Farenheit by default.

This commit sets the default unit to Celsius for calculating heatIndex.
S == Scale does not clearly represents the flag purpose. Rename it to
isFarenheit so it describes the flag purpose more precise
@dgellow
Copy link

dgellow commented Nov 24, 2019

This PR is now quite old, so I don't really expect it to be merged, but I agree with its spirit and came here to fix the same issue. It would be nice to have unit consistency, with Celsius as defalt everywhere.

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.

None yet

2 participants