Add unit_of_measurement to number components (#147)

This commit is contained in:
Jesse Hills 2021-11-30 20:34:30 +13:00 committed by GitHub
parent 72a5130eab
commit da0ecd8437
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 63 additions and 54 deletions

View File

@ -873,6 +873,7 @@ message ListEntitiesNumberResponse {
float step = 8;
bool disabled_by_default = 9;
EntityCategory entity_category = 10;
string unit_of_measurement = 11;
}
message NumberStateResponse {
option (id) = 50;

File diff suppressed because one or more lines are too long

View File

@ -550,6 +550,7 @@ class NumberInfo(EntityInfo):
step: float = converter_field(
default=0.0, converter=fix_float_single_double_conversion
)
unit_of_measurement: str = ""
@dataclass(frozen=True)