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

Update endpoints.py #7

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

Update endpoints.py #7

wants to merge 1 commit into from

Conversation

lalo-uy
Copy link

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

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.
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
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
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 )?

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
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

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

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
Copy link
Author

lalo-uy commented Oct 12, 2020 via email

@jpgimenez
Copy link
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