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

Maker: Round scaled sensor values #14136

Merged
merged 6 commits into from Apr 1, 2017
Merged

Conversation

islemaster
Copy link
Contributor

@islemaster islemaster commented Mar 31, 2017

Requested by curriculum: sensor.value should always return a round number after calling setScale(0, 1023) (which maps the normal 0-1023 range onto a different range). We're okay with the loss of precision inherent in this decision. (one-line spec)

I wrote tests for this here, but to make the actual fix I had to fork johnny-five, because its Sensor component defines its value property in the constructor as a nonconfigurable getter that I can't modify, replace, or override with a subclass.

@islemaster islemaster self-assigned this Mar 31, 2017
@islemaster islemaster merged commit 4162d7d into staging Apr 1, 2017
@islemaster islemaster deleted the maker-round-scaled-sensor-values branch April 1, 2017 00:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant