-
-
Notifications
You must be signed in to change notification settings - Fork 29k
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
Allow SensorDeviceClass.POWER_FACTOR unit None #85181
Conversation
Hey there @home-assistant/core, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
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 makes sense; looking at the original architectural discussion omitting the empty unit was mainly driven by showing history graphs.
LGTM ✅
Does need an end-user and dev docs adjustment too.
../Frenck
@@ -253,7 +253,7 @@ class SensorDeviceClass(StrEnum): | |||
POWER_FACTOR = "power_factor" | |||
"""Power factor. | |||
|
|||
Unit of measurement: `%` | |||
Unit of measurement: `%`, `None` |
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 should be adjusted in NumberDeviceClass
also.
This is nice! I was just thinking of doing that too 🤣 Should there be conversion of % to unit-less? Not sure if that makes sense... |
Yes, but not in a hotfix, it requires frontend and recorder support too. |
Untagging this from the hot fix because it depends on things moving to |
Backport PR created: #85287 |
Proposed change
Allow
SensorDeviceClass.POWER_FACTOR
unitNone
Background:
Power factor is the dimensionless ratio of the real power and apparent power. Partially because of now fixed limitations in frontend, Home Assistant has documented the only allowed unit as
%
, i.e. the ratio multiplied by 100. There are no longer such limitations in the frontend, and we can allow the unit to beNone
.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
.To help with the load of incoming pull requests: