feat: Expose new rate structure property #81
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.
I have a gnarly template in my home assistant config to reverse-calculate the rate name from the current cost, which is kind of a bummer because Jinja floats absolutely suck.
While I'm sure this template could be better (I'm no Jinja master), I can't see any way around the gross
map('round', 3)
call except to expose the index of the selected rate structure. SDG&E's EV-TOU-2 plan has both Summer and Winter periods for On, Off, and Super Off Peak periods.This PR adds the current_rate_structure from firstof9/python-openei#182 to Home Assistant.