Skip to content

Update endpoints.py - #7

Open
lalo-uy wants to merge 1 commit into
jpgimenez:masterfrom
lalo-uy:patch-2
Open

Update endpoints.py#7
lalo-uy wants to merge 1 commit into
jpgimenez:masterfrom
lalo-uy:patch-2

Conversation

@lalo-uy

@lalo-uy lalo-uy commented Aug 14, 2020

Copy link
Copy Markdown

Only plot one point per minute to unclutter several days fermentation charts.
Even on kettle to many point do not make sense.

Only plot one point per minute to unclutter several days fermentation charts.
Comment thread modules/logs/endpoints.py
row[0], "%Y-%m-%d %H:%M:%S") -
datetime.datetime(1970, 1, 1)).total_seconds()) * 1000
if ( abs(float(row[1])) < 110 ) and # filter invalid points
( p_time >= l_time ): # only plot if more than 60 sec from previus point

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.

good idea, but IMO should be configurable...

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

You mean the enable/disable or the time interval ( 60 sec )?

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@lalo-uy I think you could have a parameter plot_period to configure that and have the default of 60.

So you replace the line: l_time = p_time + 60000;
With: l_time = p_time + 1000 * cbpi.get_config_parameter("plot_period", 60)

It that what you meant @jpgimenez?

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.

👍 agree... the parameter is better than a hardcoded value

Comment thread modules/logs/endpoints.py
row[0], "%Y-%m-%d %H:%M:%S") -
datetime.datetime(1970, 1, 1)).total_seconds()) * 1000
if ( abs(float(row[1])) < 110 ) and # filter invalid points
( p_time >= l_time ): # only plot if more than 60 sec from previus point

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

@lalo-uy I think you could have a parameter plot_period to configure that and have the default of 60.

So you replace the line: l_time = p_time + 60000;
With: l_time = p_time + 1000 * cbpi.get_config_parameter("plot_period", 60)

It that what you meant @jpgimenez?

@lalo-uy

lalo-uy commented Oct 12, 2020 via email

Copy link
Copy Markdown
Author

@jpgimenez

Copy link
Copy Markdown
Owner

Good one.

@lalo-uy if you add the parameter I'm good with merging this...

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.

3 participants