-
-
Notifications
You must be signed in to change notification settings - Fork 28.5k
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 energy management for efergy #56511
Conversation
@@ -146,7 +153,7 @@ def __init__( | |||
if sid: | |||
self._attr_name = f"efergy_{sid}" | |||
if description.key == CONF_COST: | |||
self._attr_native_unit_of_measurement = f"{currency}/{period}" | |||
self._attr_native_unit_of_measurement = currency |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will be a breaking change. Is just the currency accurate as unit of measurement for this measurement?
If we're going to keep the device class as monetary for this sensor we need to validate that the currency config is an ISO-standard currency code.
core/homeassistant/helpers/config_validation.py
Line 1287 in b1f4ccf
currency = vol.In( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The user can specify the period in the yaml and it defaults to yearly.
So I just tested these changes further. Adding one of the two sensors for consumption is breaking the energy dashboard:
|
Marked as draft to block merge until issue is resolved. |
I've now tested this on my production machine and everything works fine. This has to do with the current dev build or just my dev environment being screwy. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Please link a docs PR where we update the currency config item description and example. https://www.home-assistant.io/integrations/efergy/#configuration |
Changing to draft to avoid merging accidentally. We, author and me, decided to hold this until next release to give some time to add a config flow to avoid more than one breaking change release. The config flow is in the works. |
Closing as merger went wrong. |
Breaking change
Unit of measurement now uses an ISO standard currency code. Periods are now separate from the currency specified by the user, in the entity unit of measurement. Users are advised to adjust the currency configuration item, if set, to be a valid ISO standard currency code and also any automations, scripts, or templates that handle the entity unit of measurement.
Proposed change
Follow-up to: #54210
Should be merged after: #56890
Type of change
Additional information
Checklist
black --fast homeassistant tests
)If user exposed functionality or configuration variables are added/changed:
If the code communicates with devices, web services, or third-party tools:
Updated and included derived files by running:
python3 -m script.hassfest
.requirements_all.txt
.Updated by running
python3 -m script.gen_requirements_all
..coveragerc
.The integration reached or maintains the following Integration Quality Scale:
To help with the load of incoming pull requests: