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

Add more fail checking of data #15

Merged
2 commits merged into from
Feb 21, 2017
Merged

Conversation

Danielhiversen
Copy link
Contributor

@Danielhiversen Danielhiversen commented Feb 14, 2017

Add more fail checking of data

Tested by myself and one user here: https://community.home-assistant.io/t/xiaomi-mi-plants-monitor-flower/3388/105?u=danielhiversen

self._cache = None
return
if self._firmware_version >= "2.6.6":
if sum(self._cache[10:]) == 0:
Copy link
Contributor Author

@Danielhiversen Danielhiversen Feb 14, 2017

Choose a reason for hiding this comment

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

I am not sure about the validity of this check.

I do not know the meaning of the data from index 10. But in all the test data I have achieved the values are above 0 when the values are valid. For invalid data the values are often 0.

@Danielhiversen
Copy link
Contributor Author

@open-homeautomation Could you have a look at this one?

@Danielhiversen
Copy link
Contributor Author

Danielhiversen commented Feb 21, 2017

@open-homeautomation
@usul27

@ghost
Copy link

ghost commented Feb 21, 2017

I can't say anything about the validity check with byte 10, but I recommend, we put it in and see what feedback is reported from users.

@ghost ghost merged commit e8ff3ca into basnijholt:master Feb 21, 2017
This pull request was closed.
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