Add device_class attribute to sensor (#25)

This commit is contained in:
marecabo 2021-02-15 15:55:10 +01:00 committed by GitHub
parent 33ad17f99c
commit 10b0d82a23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 87 additions and 78 deletions

View File

@ -418,6 +418,7 @@ message ListEntitiesSensorResponse {
string unit_of_measurement = 6;
int32 accuracy_decimals = 7;
bool force_update = 8;
string device_class = 9;
}
message SensorStateResponse {
option (id) = 25;

File diff suppressed because one or more lines are too long

View File

@ -149,6 +149,7 @@ class LightState(EntityState):
@attr.s
class SensorInfo(EntityInfo):
icon = attr.ib(type=str, default='')
device_class = attr.ib(type=str, default='')
unit_of_measurement = attr.ib(type=str, default='')
accuracy_decimals = attr.ib(type=int, default=0)
force_update = attr.ib(type=bool, default=False)