Skip to content

Commit fc078d1

Browse files
committed
make service characteristics complete
1 parent 68f09a7 commit fc078d1

File tree

45 files changed

+1098
-142
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+1098
-142
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package io.github.hapjava.accessories.optionalcharacteristic;
2+
3+
import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
4+
import io.github.hapjava.characteristics.impl.accessoryinformation.AccessoryFlagsEnum;
5+
import java.util.concurrent.CompletableFuture;
6+
7+
/**
8+
* Accessory with accessory flags, which indicates that additional setup is required
9+
*
10+
* @author Eugen Freiter
11+
*/
12+
public interface AccessoryWithAccessoryFlags {
13+
14+
/**
15+
* When set indicates accessory requires additional setup.
16+
*
17+
* @return a future that will contain the accessory flags
18+
*/
19+
CompletableFuture<AccessoryFlagsEnum> getAccessoryFlags();
20+
21+
/**
22+
* Subscribes to changes in accessory flags
23+
*
24+
* @param callback the function to call when the accessory flags changes.
25+
*/
26+
void subscribeAccessoryFlags(HomekitCharacteristicChangeCallback callback);
27+
28+
/** Unsubscribes from changes in the accessory flags . */
29+
void unsubscribeAccessoryFlags();
30+
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
package io.github.hapjava.accessories.optionalcharacteristic;
2+
3+
import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
4+
import java.util.concurrent.CompletableFuture;
5+
6+
/**
7+
* Accessory with color temperature.
8+
*
9+
* @author Eugen Freiter
10+
*/
11+
public interface AccessoryWithColorTemperature {
12+
13+
/**
14+
* Retrieves the color temperature
15+
*
16+
* @return a future that will contain the brightness, expressed as an integer between 0 and 100.
17+
*/
18+
CompletableFuture<Integer> getColorTemperature();
19+
20+
/**
21+
* Sets the color temperature
22+
*
23+
* @param value the brightness, on a scale of 0 to 100, to set
24+
* @return a future that completes when the brightness is changed
25+
* @throws Exception when the brightness cannot be set
26+
*/
27+
CompletableFuture<Void> setColorTemperature(Integer value) throws Exception;
28+
29+
/**
30+
* Subscribes to changes in color temperature.
31+
*
32+
* @param callback the function to call when the color temperature changes.
33+
*/
34+
void subscribeColorTemperature(HomekitCharacteristicChangeCallback callback);
35+
36+
/** Unsubscribes from changes in the color temperature. */
37+
void unsubscribeColorTemperature();
38+
}

src/main/java/io/github/hapjava/accessories/optionalcharacteristic/AccessoryWithCoolingThresholdTemprature.java renamed to src/main/java/io/github/hapjava/accessories/optionalcharacteristic/AccessoryWithCoolingThresholdTemperature.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
44
import java.util.concurrent.CompletableFuture;
55

6-
public interface AccessoryWithCoolingThresholdTemprature {
6+
/**
7+
* Accessory with cooling threshold temperature.
8+
*
9+
* @author Eugen Freiter
10+
*/
11+
public interface AccessoryWithCoolingThresholdTemperature {
712

813
/**
914
* Retrieves the temperature above which the thermostat should begin cooling.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
package io.github.hapjava.accessories.optionalcharacteristic;
2+
3+
import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
4+
import java.util.concurrent.CompletableFuture;
5+
6+
/**
7+
* Accessory with current horizontal tilting characteristic.
8+
*
9+
* @author Andy Lintner
10+
*/
11+
public interface AccessoryWithCurrentHorizontalTilting {
12+
13+
/**
14+
* Retrieves the current horizontal tilt angle
15+
*
16+
* @return a future that will contain the position as a value between -90 and 90
17+
*/
18+
CompletableFuture<Integer> getCurrentHorizontalTiltAngle();
19+
20+
/**
21+
* Subscribes to changes in the current horizontal tilt angle.
22+
*
23+
* @param callback the function to call when the state changes.
24+
*/
25+
void subscribeCurrentHorizontalTiltAngle(HomekitCharacteristicChangeCallback callback);
26+
27+
/** Unsubscribes from changes in the current horizontal tilt angle */
28+
void unsubscribeCurrentHorizontalTiltAngle();
29+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
package io.github.hapjava.accessories.optionalcharacteristic;
2+
3+
import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
4+
import java.util.concurrent.CompletableFuture;
5+
6+
/** accessory with current relative humidity. */
7+
public interface AccessoryWithCurrentRelativeHumidity {
8+
9+
/**
10+
* Retrieves the current relative humidity.
11+
*
12+
* @return a future that will contain the current relative humidity.
13+
*/
14+
CompletableFuture<Double> getCurrentRelativeHumidity();
15+
16+
/**
17+
* Subscribes to changes in current relative humidity.
18+
*
19+
* @param callback the function to call when the current relative humidity changes.
20+
*/
21+
void subscribeCurrentRelativeHumidity(HomekitCharacteristicChangeCallback callback);
22+
23+
/** Unsubscribes from changes in the current relative humidity. */
24+
void unsubscribeCurrentRelativeHumidity();
25+
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package io.github.hapjava.accessories.optionalcharacteristic;
2+
3+
import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
4+
import java.util.concurrent.CompletableFuture;
5+
6+
/** Accessory with current vertical tilting characteristic. */
7+
public interface AccessoryWithCurrentVerticalTilting {
8+
/**
9+
* Retrieves the current vertical tilt angle
10+
*
11+
* @return a future that will contain the position as a value between -90 and 90
12+
*/
13+
CompletableFuture<Integer> getCurrentVerticalTiltAngle();
14+
15+
/**
16+
* Subscribes to changes in the current vertical tilt angle.
17+
*
18+
* @param callback the function to call when the state changes.
19+
*/
20+
void subscribeCurrentVerticalTiltAngle(HomekitCharacteristicChangeCallback callback);
21+
22+
/** Unsubscribes from changes in the current vertical tilt angle */
23+
void unsubscribeCurrentVerticalTiltAngle();
24+
}

src/main/java/io/github/hapjava/accessories/optionalcharacteristic/AccessoryWithFanState.java

Lines changed: 0 additions & 105 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22

33
import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
44
import io.github.hapjava.characteristics.impl.fan.CurrentFanStateEnum;
5-
import io.github.hapjava.characteristics.impl.fan.LockPhysicalControlsEnum;
6-
import io.github.hapjava.characteristics.impl.fan.RotationDirectionEnum;
7-
import io.github.hapjava.characteristics.impl.fan.SwingModeEnum;
85
import io.github.hapjava.characteristics.impl.fan.TargetFanStateEnum;
96
import java.util.concurrent.CompletableFuture;
107

@@ -37,75 +34,6 @@ public interface AccessoryWithFanState {
3734
*/
3835
CompletableFuture<Void> setTargetFanState(TargetFanStateEnum targetState);
3936

40-
/**
41-
* Retrieves the swing mode of the fan.
42-
*
43-
* @return a future that will contain the swing mode
44-
*/
45-
CompletableFuture<SwingModeEnum> getSwingMode();
46-
47-
/**
48-
* Set the swing mode of the fan (DISABLED, ENABLED).
49-
*
50-
* @param swingMode swing mode
51-
* @return a future that completes when the change is made
52-
*/
53-
CompletableFuture<Void> setSwingMode(SwingModeEnum swingMode);
54-
55-
/**
56-
* OPTIONAL: Retrieves the lock controls of the fan.
57-
*
58-
* @return a future that will contain the lock controls
59-
*/
60-
CompletableFuture<LockPhysicalControlsEnum> getLockControls();
61-
62-
/**
63-
* Set the lock controls of the fan (DISABLED, ENABLED).
64-
*
65-
* @param lockControls lock controls mode
66-
* @return a future that completes when the change is made
67-
*/
68-
CompletableFuture<Void> setLockControls(LockPhysicalControlsEnum lockControls);
69-
70-
/**
71-
* Retrieves the current rotation direction of the fan.
72-
*
73-
* @return a future that will contain the direction
74-
*/
75-
CompletableFuture<RotationDirectionEnum> getRotationDirection();
76-
77-
/**
78-
* Retrieves the current speed of the fan's rotation
79-
*
80-
* @return a future that will contain the speed, expressed as an integer between 0 and 100.
81-
*/
82-
CompletableFuture<Integer> getRotationSpeed();
83-
84-
/**
85-
* Sets the rotation direction of the fan
86-
*
87-
* @param direction the direction to set
88-
* @return a future that completes when the change is made
89-
* @throws Exception when the change cannot be made
90-
*/
91-
CompletableFuture<Void> setRotationDirection(RotationDirectionEnum direction) throws Exception;
92-
93-
/**
94-
* OPTIONAL: Sets the speed of the fan's rotation
95-
*
96-
* @param speed the speed to set, expressed as an integer between 0 and 100.
97-
* @return a future that completes when the change is made
98-
* @throws Exception when the change cannot be made
99-
*/
100-
CompletableFuture<Void> setRotationSpeed(Integer speed) throws Exception;
101-
102-
/**
103-
* Subscribes to changes in the rotation direction of the fan.
104-
*
105-
* @param callback the function to call when the direction changes.
106-
*/
107-
void subscribeRotationDirection(HomekitCharacteristicChangeCallback callback);
108-
10937
/**
11038
* Subscribes to changes in the current fan state.
11139
*
@@ -120,42 +48,9 @@ public interface AccessoryWithFanState {
12048
*/
12149
void subscribeTargetFanState(HomekitCharacteristicChangeCallback callback);
12250

123-
/**
124-
* Subscribes to changes in the rotation speed of the fan.
125-
*
126-
* @param callback the function to call when the speed changes.
127-
*/
128-
void subscribeRotationSpeed(HomekitCharacteristicChangeCallback callback);
129-
130-
/**
131-
* Subscribes to changes in the swing mode of the fan.
132-
*
133-
* @param callback the function to call when the swing mode changes.
134-
*/
135-
void subscribeSwingMode(HomekitCharacteristicChangeCallback callback);
136-
137-
/**
138-
* Subscribes to changes in the lock controls of the fan.
139-
*
140-
* @param callback the function to call when the lock controls changes.
141-
*/
142-
void subscribeLockControls(HomekitCharacteristicChangeCallback callback);
143-
144-
/** Unsubscribes from changes in the rotation direction of the fan. */
145-
void unsubscribeRotationDirection();
146-
147-
/** Unsubscribes from changes in the fan's rotation speed. */
148-
void unsubscribeRotationSpeed();
149-
15051
/** Unsubscribes from changes in the current state of the fan. */
15152
void unsubscribeCurrentFanState();
15253

15354
/** Unsubscribes from changes in the target state of the fan. */
15455
void unsubscribeTargetFanState();
155-
156-
/** Unsubscribes from changes in the swing mode of the fan. */
157-
void unsubscribeSwingMode();
158-
159-
/** Unsubscribes from changes in the lock controls of the fan. */
160-
void unsubscribeLockControls();
16156
}

src/main/java/io/github/hapjava/accessories/optionalcharacteristic/AccessoryWithHearingThresholdTemprature.java renamed to src/main/java/io/github/hapjava/accessories/optionalcharacteristic/AccessoryWithHeatingThresholdTemprature.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
44
import java.util.concurrent.CompletableFuture;
55

6-
public interface AccessoryWithHearingThresholdTemprature {
6+
public interface AccessoryWithHeatingThresholdTemprature {
77

88
/**
99
* Retrieves the temperature below which the thermostat should begin heating.
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
package io.github.hapjava.accessories.optionalcharacteristic;
2+
3+
import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
4+
import io.github.hapjava.characteristics.impl.common.IsConfiguredEnum;
5+
import java.util.concurrent.CompletableFuture;
6+
7+
/**
8+
* Accessory with isConfigured characteristics. This characteristic describes if the service is
9+
* configured for use. For example, all of the valves in an irrigation system may not be configured
10+
* depending on physical wire connection.
11+
*
12+
* @author Eugen Freiter
13+
*/
14+
public interface AccessoryWithIsConfigured {
15+
16+
/**
17+
* isConfigured state
18+
*
19+
* @return a future that will contain the isConfigured state
20+
*/
21+
CompletableFuture<IsConfiguredEnum> getIsConfigured();
22+
23+
/**
24+
* Set the isConfigured (NOT_CONFIGURED, CONFIGURED).
25+
*
26+
* @param isConfigured isConfigured state
27+
* @return a future that completes when the change is made
28+
*/
29+
CompletableFuture<Void> setIsConfigured(IsConfiguredEnum isConfigured);
30+
31+
/**
32+
* Subscribes to changes in isConfigured state
33+
*
34+
* @param callback the function to call when the isConfigured state changes.
35+
*/
36+
void subscribeIsConfigured(HomekitCharacteristicChangeCallback callback);
37+
38+
/** Unsubscribes from changes in the isConfigured state. */
39+
void unsubscribeIsConfigured();
40+
}
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
package io.github.hapjava.accessories.optionalcharacteristic;
2+
3+
import io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback;
4+
import io.github.hapjava.characteristics.impl.lock.LockCurrentStateEnum;
5+
import java.util.concurrent.CompletableFuture;
6+
7+
/**
8+
* Accessory with current lock state.
9+
*
10+
* @author Eugen Freiter
11+
*/
12+
public interface AccessoryWithLockCurrentState {
13+
14+
/**
15+
* Retrieves the lock states. The current state of the physical security mechanism (e.g. deadbolt)
16+
*
17+
* @return a future with the value
18+
*/
19+
CompletableFuture<LockCurrentStateEnum> getLockCurrentState();
20+
21+
/**
22+
* Subscribes to changes in lock current state.
23+
*
24+
* @param callback the function when the lock current state changes
25+
*/
26+
void subscribeLockCurrentState(HomekitCharacteristicChangeCallback callback);
27+
28+
/** Unsubscribes from changes */
29+
void unsubscribeLockCurrentState();
30+
}

0 commit comments

Comments
 (0)