|
1 | 1 | package com.beowulfe.hap.accessories; |
2 | 2 |
|
3 | | -import java.util.Collection; |
4 | | -import java.util.Collections; |
5 | | -import java.util.concurrent.CompletableFuture; |
6 | | - |
7 | | -import com.beowulfe.hap.*; |
8 | | -import com.beowulfe.hap.accessories.properties.ThermostatMode; |
9 | | -import com.beowulfe.hap.impl.services.ThermostatService; |
| 3 | +import com.beowulfe.hap.accessories.thermostat.*; |
10 | 4 |
|
11 | 5 | /** |
12 | 6 | * A thermostat with heating and cooling controls. |
13 | 7 | * |
14 | 8 | * @author Andy Lintner |
| 9 | + * @deprecated Use {@link BasicThermostat}, {@link HeatingThermostat}, and {@link CoolingThermostat} instead |
15 | 10 | */ |
16 | | -public interface Thermostat extends HomekitAccessory, TemperatureSensor { |
17 | | - |
18 | | - /** |
19 | | - * Retrieves the current {@link ThermostatMode} of the thermostat. |
20 | | - * @return a future that will contain the mode. |
21 | | - */ |
22 | | - CompletableFuture<ThermostatMode> getCurrentMode(); |
23 | | - |
24 | | - /** |
25 | | - * Subscribes to changes in the {@link ThermostatMode} of the thermostat. |
26 | | - * @param callback the function to call when the state changes. |
27 | | - */ |
28 | | - void subscribeCurrentMode(HomekitCharacteristicChangeCallback callback); |
29 | | - |
30 | | - /** |
31 | | - * Unsubscribes from changes in the mode of the thermostat. |
32 | | - */ |
33 | | - void unsubscribeCurrentMode(); |
34 | | - |
35 | | - /** |
36 | | - * Sets the {@link ThermostatMode} of the thermostat. |
37 | | - * @param mode The {@link ThermostatMode} to set. |
38 | | - * @throws Exception when the change cannot be made. |
39 | | - */ |
40 | | - void setTargetMode(ThermostatMode mode) throws Exception; |
41 | | - |
42 | | - /** |
43 | | - * Retrieves the pending, but not yet complete, {@link ThermostatMode} of the thermostat. |
44 | | - * @return a future that will contain the target mode. |
45 | | - */ |
46 | | - CompletableFuture<ThermostatMode> getTargetMode(); |
47 | | - |
48 | | - /** |
49 | | - * Subscribes to changes in the pending, but not yet complete, {@link ThermostatMode} of the thermostat. |
50 | | - * @param callback the function to call when the state changes. |
51 | | - */ |
52 | | - void subscribeTargetMode(HomekitCharacteristicChangeCallback callback); |
53 | | - |
54 | | - /** |
55 | | - * Unsubscribes from changes in the pending, but not yet complete, {@link ThermostatMode} of the thermostat. |
56 | | - */ |
57 | | - void unsubscribeTargetMode(); |
58 | | - |
59 | | - /** |
60 | | - * Retrieves the target temperature, in celsius degrees, used when the thermostat is in {@link ThermostatMode#AUTO} mode. |
61 | | - * @return a future that will contain the target temperature. |
62 | | - */ |
63 | | - CompletableFuture<Double> getTargetTemperature(); |
64 | | - |
65 | | - /** |
66 | | - * Sets the target temperature when in {@link ThermostatMode#AUTO} mode. |
67 | | - * @param value the target temperature, in celsius degrees. |
68 | | - * @throws Exception when the temperature cannot be changed. |
69 | | - */ |
70 | | - void setTargetTemperature(Double value) throws Exception; |
71 | | - |
72 | | - /** |
73 | | - * Subscribes to changes in the target temperature. |
74 | | - * @param callback the function to call when the state changes. |
75 | | - */ |
76 | | - void subscribeTargetTemperature(HomekitCharacteristicChangeCallback callback); |
77 | | - |
78 | | - /** |
79 | | - * Unsubscribes from changes in the target temperature. |
80 | | - */ |
81 | | - void unsubscribeTargetTemperature(); |
82 | | - |
83 | | - /** |
84 | | - * Retrieves the temperature below which the thermostat should begin heating. Used when the thermostat is in |
85 | | - * {@link ThermostatMode#HEAT} mode. |
86 | | - * @return a future that will contain the threshold temperature, in celsius degrees. |
87 | | - */ |
88 | | - CompletableFuture<Double> getHeatingThresholdTemperature(); |
89 | | - |
90 | | - /** |
91 | | - * Sets the temperature below which the thermostat should begin heating. Used when the thermostat is in |
92 | | - * {@link ThermostatMode#HEAT} mode. |
93 | | - * @param value the threshold temperature, in celsius degrees. |
94 | | - * @throws Exception when the threshold temperature cannot be changed. |
95 | | - */ |
96 | | - void setHeatingThresholdTemperature(Double value) throws Exception; |
97 | | - |
98 | | - /** |
99 | | - * Subscribes to changes in the heating threshold. |
100 | | - * @param callback the function to call when the state changes. |
101 | | - */ |
102 | | - void subscribeHeatingThresholdTemperature(HomekitCharacteristicChangeCallback callback); |
103 | | - |
104 | | - /** |
105 | | - * Unsubscribes from changes in the heating threshold. |
106 | | - */ |
107 | | - void unsubscribeHeatingThresholdTemperature(); |
108 | | - |
109 | | - /** |
110 | | - * Retrieves the temperature above which the thermostat should begin cooling. Used when the thermostat is in |
111 | | - * {@link ThermostatMode#COOL} mode. |
112 | | - * @return a future that will contain the threshold temperature, in celsius degrees. |
113 | | - */ |
114 | | - CompletableFuture<Double> getCoolingThresholdTemperature(); |
115 | | - |
116 | | - /** |
117 | | - * Sets the temperature above which the thermostat should begin cooling. Used when the thermostat is in |
118 | | - * {@link ThermostatMode#COOL} mode. |
119 | | - * @param value the threshold temperature, in celsius degrees. |
120 | | - * @throws Exception when the threshold temperature cannot be changed. |
121 | | - */ |
122 | | - void setCoolingThresholdTemperature(Double value) throws Exception; |
123 | | - |
124 | | - /** |
125 | | - * Subscribes to changes in the cooling threshold. |
126 | | - * @param callback the function to call when the state changes. |
127 | | - */ |
128 | | - void subscribeCoolingThresholdTemperature(HomekitCharacteristicChangeCallback callback); |
| 11 | +@Deprecated |
| 12 | +public interface Thermostat extends BasicThermostat, HeatingThermostat, CoolingThermostat { |
129 | 13 |
|
130 | | - /** |
131 | | - * Unsubscribes from changes in the cooling threshold. |
132 | | - */ |
133 | | - void unsubscribeCoolingThresholdTemperature(); |
134 | 14 |
|
135 | | - @Override |
136 | | - default Collection<Service> getServices() { |
137 | | - return Collections.singleton(new ThermostatService(this)); |
138 | | - } |
139 | 15 |
|
140 | 16 | } |
0 commit comments