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

Support for hourly data for precipitation graph. #21

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Support for hourly data for precipitation graph. #21

wants to merge 1 commit into from

Conversation

vlebourl
Copy link

This is an attempt to get the precipitation graph when minutely data are not available.

this.isAnyPrecipitation(minutely))) {
wrapper.appendChild(this.renderPrecipitationGraph());
this.isAnyPrecipitation(minutely,hourly))) {
wrapper.appendChild(this.renderPrecipitationGraph(minutely?this.weatherData.minutely.data:this.weatherData.hourly.data));
Copy link
Owner

Choose a reason for hiding this comment

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

Will you please extract the minutely?... ternary to another line? Also add spaces between all parts for readability.

@@ -195,8 +195,8 @@ Module.register("MMM-forecast-io", {

if (this.config.alwaysShowPrecipitationGraph ||
(this.config.enablePrecipitationGraph &&
this.isAnyPrecipitation(minutely))) {
wrapper.appendChild(this.renderPrecipitationGraph());
this.isAnyPrecipitation(minutely,hourly))) {
Copy link
Owner

Choose a reason for hiding this comment

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

Will you add a space after the comma?

isAnyPrecipitation: function (minutely) {
if (!minutely) {
isAnyPrecipitation: function (minutely,hourly) {
if (!minutely&&!hourly) {
Copy link
Owner

Choose a reason for hiding this comment

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

Please add spaces.

return false;
}
var data = this.weatherData.minutely.data;
var data = minutely?this.weatherData.minutely.data:this.weatherData.hourly.data;
Copy link
Owner

Choose a reason for hiding this comment

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

Please add spaces.

Copy link
Owner

@dmcinnes dmcinnes left a comment

Choose a reason for hiding this comment

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

Looks like this still needs some fixes.

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