Fix incorrect power factor device class usage in Fronius#84374
Conversation
|
Hey there @nielstron, @farmio, mind taking a look at this pull request as it has been labeled with an integration ( Code owner commandsCode owners of
|
|
This sensor returns a float Afaic power factor is often written as 0..1 without unit (eg. on power supplys).
|
🤷 That was not in my scope; I just spotted this bug.
Home Assistant expects a percentage (as documented). |
|
@farmio I had a quick look at the code and it doesn't seem so easy to adjust the code and multiply by 100. |
|
Yes sure, I can do a follow-up. I'd just add a lambda to the entity descriptions. @epenet If you ask me, the correct way would be to support dimensionless numbers for power factor in HA. But you are the unit expert here. |
That is an architecture discussion, not a PR discussion. |
Proposed change
Fixes an case of incorrect device class usage in the Fronius integration.
The power factor sensors have the
power_factordevice class, but do not provide a valid unit for that device class. The only valid unit is%, but it isn't a percentage that these sensors provide in this integration.Therefore, I've removed the device class in this PR.
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: