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
3declare(strict_types=1);
4
5namespace Stewart\Contracts\Exposure;
6
7use Stewart\Contracts\Exception\ExposureException;
8use Stewart\Contracts\Exposure\Action\ActionConfig;
9use Stewart\Contracts\Exposure\Action\ExposedAction;
10
11interface EntityExposure
12{
13    /** @throws ExposureException */
14    public function exposeSensor(ExposedEntityKey|string $key, SensorConfig $config = new SensorConfig(), ?DeviceInfo $device = null): ExposedSensor;
15
16    /** @throws ExposureException */
17    public function exposeBinarySensor(
18        ExposedEntityKey|string $key,
19        BinarySensorConfig $config = new BinarySensorConfig(),
20        ?DeviceInfo $device = null,
21    ): ExposedBinarySensor;
22
23    /** @throws ExposureException */
24    public function exposeSwitch(ExposedEntityKey|string $key, SwitchConfig $config = new SwitchConfig(), ?DeviceInfo $device = null): ExposedSwitch;
25
26    /** @throws ExposureException */
27    public function exposeButton(ExposedEntityKey|string $key, ButtonConfig $config = new ButtonConfig(), ?DeviceInfo $device = null): ExposedButton;
28
29    /** @throws ExposureException */
30    public function exposeNumber(ExposedEntityKey|string $key, NumberConfig $config, ?DeviceInfo $device = null): ExposedNumber;
31
32    /** @throws ExposureException */
33    public function exposeSelect(ExposedEntityKey|string $key, SelectConfig $config, ?DeviceInfo $device = null): ExposedSelect;
34
35    /** @throws ExposureException */
36    public function exposeText(ExposedEntityKey|string $key, TextConfig $config = new TextConfig(), ?DeviceInfo $device = null): ExposedText;
37
38    /** @throws ExposureException */
39    public function exposeTime(ExposedEntityKey|string $key, TimeConfig $config = new TimeConfig(), ?DeviceInfo $device = null): ExposedTime;
40
41    /** @throws ExposureException */
42    public function exposeDate(ExposedEntityKey|string $key, DateConfig $config = new DateConfig(), ?DeviceInfo $device = null): ExposedDate;
43
44    /** @throws ExposureException */
45    public function exposeDateTime(ExposedEntityKey|string $key, DateTimeConfig $config = new DateTimeConfig(), ?DeviceInfo $device = null): ExposedDateTime;
46
47    // Registers the Home Assistant action stewart.<app>_<key>; calls arrive through watchCalls().
48    /** @throws ExposureException */
49    public function exposeAction(ExposedEntityKey|string $key, ActionConfig $config = new ActionConfig()): ExposedAction;
50}