Fix duplicate sensors being created #25 #45
Merged
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.
Fix for duplicate sensor setup as described in #25.
If one has both electricity and gas from Zonneplan, one will have two
connections
in the response. Theelectricity
connection contains all relevant data, such as electricity and gas prices. Thegas
connection lacks a lot of information, but is still getting setup:https://github.com/fsaris/home-assistant-zonneplan-one/blob/main/custom_components/zonneplan_one/coordinator.py#L87-L90
This PR first tries to use the
electricity
connection to poll for thesummary
data and if successful skips retrieving thesummary
data for thegas
connection.If you are affected by this bug, follow these steps:
Likely introduced in 11e9adb
Fixes #25