Skip to content

Add getTemp#2

Open
Morgul wants to merge 6 commits into
brendanashworth:masterfrom
Morgul:add-get-temp
Open

Add getTemp#2
Morgul wants to merge 6 commits into
brendanashworth:masterfrom
Morgul:add-get-temp

Conversation

@Morgul

@Morgul Morgul commented Jan 18, 2018

Copy link
Copy Markdown

Exposed the get_tmp call as getTemp. Supports units (as strings), and includes both documentation and unit tests.

Comment thread README.md Outdated
Comment thread src/binding.cc Outdated
Comment thread index.js Outdated
Comment thread README.md Outdated
Comment thread index.js Outdated
@brendanashworth

Copy link
Copy Markdown
Owner

@Morgul thanks for putting this together, this'll be great to add. I had a few comments, not quite sure how best to handle the units — what you did isn't bad but I can't think of much better, lmk your thoughts.

@Morgul

Morgul commented Jan 19, 2018

Copy link
Copy Markdown
Author

@brendanashworth I'll get those in tomorrow, shouldn't take too long.

Just have to say, this was my first foray into node bindings, and the first C code I've written in like 5 years. It was honestly a lot of fun, and the library was pretty simple to get started with.

It's currently powering my node fan controller for my poor rMBP which a broken temperature sensor. (The CPU die sensors work, but the proximity sensor gives really wrong readings, and since that controls the fans... I had to improvise.)

@brendanashworth

Copy link
Copy Markdown
Owner

@Morgul no rush! Happy to see someone actually uses this project 👍 open source is a wonder.

@Morgul

Morgul commented Jan 19, 2018

Copy link
Copy Markdown
Author

@brendanashworth Should be good to go now.

@brendanashworth brendanashworth left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

just a few last things. CI had an issue due to the tests

Comment thread index.js Outdated
Comment thread test/disk.js Outdated
Comment thread test/disk.js
t.ok(typeof info.name === 'string');
t.ok(typeof info.speed === 'number');
});

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we test for type checking? (passing non-strings, etc)

@Morgul

Morgul commented Jan 21, 2018

Copy link
Copy Markdown
Author

@brendanashworth Got those fixes in. Let me know if there's anything else.

@Morgul

Morgul commented Jan 21, 2018

Copy link
Copy Markdown
Author

@brendanashworth I looked at those failures, and they don't seem related to my changes. It seems like incompatibility with NAN and node < 4.X.

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.

2 participants