Add description classes to entity components (#53521)
* Add description classes to entity components * An -> A * Add StateVacuumEntityDescription
This commit is contained in:
parent
7cb3414517
commit
0b44265232
19 changed files with 157 additions and 19 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue