Round electric current value of Fritz!DECT smart plugs#73865
Conversation
|
Hey there @flabbamann, mind taking a look at this pull request as it has been labeled with an integration ( |
| state_class=SensorStateClass.MEASUREMENT, | ||
| suitable=lambda device: device.has_powermeter, # type: ignore[no-any-return] | ||
| native_value=lambda device: device.power / device.voltage / 1000 | ||
| native_value=lambda device: round(device.power / device.voltage / 1000, 4) |
There was a problem hiding this comment.
Actually, this is a "virtual" entity, as it is not a native value provided by the device or service (but calculated in HA). That is not allowed. This sensor should be removed.
There was a problem hiding this comment.
It would be very helpful to see current in ampere out of the box from this device to improve user experience, because most other devices provide the same.
I don't see any convenient way to calculate current in HA. Is there an easy way by GUI to create a current entity by doing calculation including rounding? A rule would run into errors, if the device is renamed.
So why not provide calculated current out of the box?
There was a problem hiding this comment.
this discussion should be continued in #78324 (comment)
|
There hasn't been any activity on this pull request recently. This pull request has been automatically marked as stale because of that and will be closed if no further activity occurs within 7 days. |
|
not stale |
|
still not stale |
|
this PR is superseded by #78324 |
Proposed change
Based on #73224 (comment) and #73224 (comment) this will round the value of the electric current sensor to a precision of 4 digits
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: