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

Give Thermometer enable/disable methods #1346

Merged
merged 2 commits into from
Jun 1, 2017

Conversation

islemaster
Copy link
Contributor

Addresses #1297 by giving the Thermometer component enable() and disable() methods.

I've added tests but I'm a little confused by the structure of the Thermometer unit tests - this feature lives on the prototype and should be the same for all controllers, but it looks like it has to be tested per-controller? But similar tests aren't applied to all controllers either. Let me know if I should make sure these tests get added to every controller, or if we can run them just once on the default controller, etc.

Thanks!

Updates board snapshot and serialize tests to account for the new thermometer `freq` property.
@rwaldron
Copy link
Owner

rwaldron commented Jun 1, 2017

I've added tests but I'm a little confused by the structure of the Thermometer unit tests - this feature lives on the prototype and should be the same for all controllers, but it looks like it has to be tested per-controller?

This is what I try to do, but not what always ends up happening, for a variety of reasons.

But similar tests aren't applied to all controllers either.

Such is the result of a relaxed contribution policy, but I'm ok with the incurred technical debt (for now).

Let me know if I should make sure these tests get added to every controller,

Don't worry about that for now :)

or if we can run them just once on the default controller, etc.

This should be fine for now.

Copy link
Owner

@rwaldron rwaldron left a comment

Choose a reason for hiding this comment

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

freq: opts.freq || 25,
previousFreq: opts.freq || 25,
};
priv.set(this, state);
Copy link
Owner

Choose a reason for hiding this comment

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

👍

state.intervalId = setInterval(eventProcessing, newFreq);
}
}
},
Copy link
Owner

Choose a reason for hiding this comment

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

👍

if (state.enabled) {
this.freq = state.freq;
}
}
Copy link
Owner

Choose a reason for hiding this comment

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

👍

}.bind(this), freq);
}
return this;
};
Copy link
Owner

Choose a reason for hiding this comment

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

👍

}

return this;
};
Copy link
Owner

Choose a reason for hiding this comment

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

👍

},
enable: testEnable,
disable: testDisable,
constructDisabled: testConstructDisabled,
Copy link
Owner

Choose a reason for hiding this comment

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

👍

@rwaldron rwaldron merged commit 7b4489d into rwaldron:master Jun 1, 2017
@islemaster
Copy link
Contributor Author

Done: Documented enabled, freq, enable() and disable() on the Thermometer wiki page (diff). Also documented the same on the Sensor wiki page (diff) which was missing these.

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