Lines
n/a
0 / 0
Functions and Methods
n/a
0 / 0
Classes and Traits
n/a
0 / 0
| Name | Lines | Functions and Methods | CRAP | Classes and Traits | ||||||
|---|---|---|---|---|---|---|---|---|---|---|
| 1 | <?php | |
| 2 | ||
| 3 | declare(strict_types=1); | |
| 4 | ||
| 5 | namespace Stewart\Contracts\Exposure; | |
| 6 | ||
| 7 | use Stewart\Contracts\Entity\EntityId; | |
| 8 | use Stewart\Contracts\Exception\ExposureException; | |
| 9 | ||
| 10 | /** @phpstan-type ExposedAttributes array<string, mixed> */ | |
| 11 | interface ExposedEntity | |
| 12 | { | |
| 13 | public function getKey(): ExposedEntityKey; | |
| 14 | ||
| 15 | // Null until Home Assistant has created the entity, which waits for the stewart integration session. | |
| 16 | public function getEntityId(): ?EntityId; | |
| 17 | ||
| 18 | /** @return ExposedAttributes */ | |
| 19 | public function getAttributes(): array; | |
| 20 | ||
| 21 | public function isAvailable(): bool; | |
| 22 | ||
| 23 | /** | |
| 24 | * @param ExposedAttributes $attributes | |
| 25 | * @throws ExposureException | |
| 26 | */ | |
| 27 | public function setAttributes(array $attributes): void; | |
| 28 | ||
| 29 | /** @throws ExposureException */ | |
| 30 | public function markAvailable(): void; | |
| 31 | ||
| 32 | /** @throws ExposureException */ | |
| 33 | public function markUnavailable(): void; | |
| 34 | ||
| 35 | /** @throws ExposureException */ | |
| 36 | public function remove(): void; | |
| 37 | } |