Add description classes to entity components (#53521)

* Add description classes to entity components

* An -> A

* Add StateVacuumEntityDescription
This commit is contained in:
Franck Nijhof 2021-07-27 00:22:21 +02:00 committed by GitHub
parent 7cb3414517
commit 0b44265232
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 157 additions and 19 deletions

View file

@ -181,7 +181,7 @@ class DeviceInfo(TypedDict, total=False):
@dataclass
class EntityDescription:
"""An class that describes Home Assistant entities."""
"""A class that describes Home Assistant entities."""
# This is the key identifier for this entity
key: str
@ -857,9 +857,15 @@ class Entity(ABC):
self.parallel_updates.release()
@dataclass
class ToggleEntityDescription(EntityDescription):
"""A class that describes toggle entities."""
class ToggleEntity(Entity):
"""An abstract class for entities that can be turned on and off."""
entity_description: ToggleEntityDescription
_attr_is_on: bool
_attr_state: None = None