-
ContextThere are currently a wide range of units available for implementing sensors. While distance ist currently available in Si and imperial units, area is only.available in square meters. I came across this lack of functionality when working with a sensor for a robot vacuum, which exposes it's cleaning area down to mm² precision. ProposalI propose to add area Units similar to the already existing distance units. ConsequencesArea units are handled in a standardized way and represented in the unit of choice for the end users. |
Beta Was this translation helpful? Give feedback.
Replies: 5 comments 7 replies
-
When we add things to our global constants file, we will do that only if there is a bigger benefit to doing so. Which integrations would be able to benefit from this? And which values would the enum have? Would there be a conversion capability for the end-user? |
Beta Was this translation helpful? Give feedback.
-
The conversation is dictated by the selected unit system. In this case it is about cleaning area, which is exposed as mm² by the robot. This would most likely be used by other robot vacuum integrations as well. |
Beta Was this translation helpful? Give feedback.
-
Values could be similar to the distance enum: # Area units
class UnitOfArea(StrEnum):
"""Area units."""
SQUARE_MILLIMETERS = "mm²"
SQUARE_CENTIMETERS = "cm²"
SQUARE_METERS = "m²"
SQUARE_KILOMETERS = "km²"
SQUARE_INCHES = "in²"
SQUARE_FEET = "ft²"
SQUARE_YARDS = "yd²"
SQUARE_MILES = "mi²" |
Beta Was this translation helpful? Give feedback.
-
As per #849 (reply in thread) ../Frenck |
Beta Was this translation helpful? Give feedback.
-
If I may, I'd like to add my 2 cents. I have 2 vacuum robots that, as @Xyaren mentioned, expose the cleaned area. In my case this sensors are in MQTT because of how the robots are integrated into the ecosystem. So any robot through MQTT can benefit. Not only core integrations (like the ones for vacuums directly or via mqtt) can benefit from this, but also template sensors created by the user. And as it's part of the SI, I don't see any point against. |
Beta Was this translation helpful? Give feedback.
As per #849 (reply in thread)
../Frenck