Entities
EntityT = typing.TypeVar('EntityT', bound='BaseEntity', covariant=True)
module-attribute
Represents a specific entity type, e.g., LightEntity, SensorEntity, etc.
BaseEntity
Bases: BaseModel, Generic[StateT, StateValueT]
Base class for all entities.
Source code in src/hassette/models/entities/base.py
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 | |
hassette: Hassette
property
Get the HassAPI instance for this state.
api: Api
property
Get the Hassette API instance for this state.
turn_off()
async
Turn off the entity.
Source code in src/hassette/models/entities/base.py
62 63 64 | |
turn_on(**data)
async
Turn on the entity.
Source code in src/hassette/models/entities/base.py
66 67 68 | |
toggle()
async
Toggle the entity.
Source code in src/hassette/models/entities/base.py
70 71 72 | |
BaseEntitySyncFacade
Bases: Generic[StateT, StateValueT]
Synchronous facade for BaseEntity to allow easier access to properties without async/await.
Source code in src/hassette/models/entities/base.py
75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 | |
turn_off()
Turn off the entity.
Source code in src/hassette/models/entities/base.py
83 84 85 | |
turn_on(**data)
Turn on the entity.
Source code in src/hassette/models/entities/base.py
87 88 89 | |
toggle()
Toggle the entity.
Source code in src/hassette/models/entities/base.py
91 92 93 | |