Add precision parameter to dsmr sensor#19873
Merged
Merged
Conversation
Contributor
houndci-bot
reviewed
Jan 8, 2019
2 tasks
dgomes
reviewed
Jan 10, 2019
Contributor
dgomes
left a comment
There was a problem hiding this comment.
Instead of passing the full config object in to the device entity, you could just pass the precision.
balloob
reviewed
Jan 11, 2019
Contributor
Author
|
I've tested the precision parameter also with the latest version 0.86.4. |
MartinHjelmare
approved these changes
Jan 31, 2019
Member
MartinHjelmare
left a comment
There was a problem hiding this comment.
Looks good! @dgomes are you ok with this?
dgomes
approved these changes
Jan 31, 2019
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description:
I was working with the DSMR sensor for reading the power and gas usage.
It uses floats with 3 digits and was filling up the database really quickly.
I've added the precision parameter to make the number of digits configurable.
It works now beter with the value 2.
First I changed it in the file after every update, but I've tried to do my first pull request for this to fix this into the future.
Related issue (if applicable): fixes #
Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#8106
Example entry for
configuration.yaml(if applicable):Checklist:
tox. Your PR cannot be merged unless tests passIf user exposed functionality or configuration variables are added/changed:
If the code does not interact with devices: