Add device class support to Switch (#157)

This commit is contained in:
Franck Nijhof 2021-12-28 11:04:59 +01:00 committed by GitHub
parent 7d05c9b52a
commit 34180576ca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 115 additions and 106 deletions

View File

@ -513,6 +513,7 @@ message ListEntitiesSwitchResponse {
bool assumed_state = 6;
bool disabled_by_default = 7;
EntityCategory entity_category = 8;
string device_class = 9;
}
message SwitchStateResponse {
option (id) = 26;

File diff suppressed because one or more lines are too long

View File

@ -375,6 +375,7 @@ class SensorState(EntityState):
@dataclass(frozen=True)
class SwitchInfo(EntityInfo):
assumed_state: bool = False
device_class: str = ""
@dataclass(frozen=True)