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

Fix plant error when adding new value #25302

merged 3 commits into from Jul 19, 2019
Changes from 2 commits
File filter...
Filter file types
Jump to…
Jump to file or symbol
Failed to load files and symbols.


Just for now

@@ -363,7 +363,7 @@ def __init__(self, max_length):
def add_measurement(self, value, timestamp=None):
"""Add a new measurement for a certain day."""
day = (timestamp or
if value is None:
if not isinstance(value, (int, float)):
if self._days is None:
self._days = deque()
@@ -388,4 +388,6 @@ def _add_day(self, day, value):
oldest = self._days.popleft()
del self._max_dict[oldest]
if value is None or not isinstance(value, (int, float)):
This conversation was marked as resolved by cgtobi

This comment has been minimized.

Copy link

cgtobi Jul 19, 2019

Author Collaborator
Suggested change
if value is None or not isinstance(value, (int, float)):
if not isinstance(value, (int, float)):
self._max_dict[day] = value
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.