2
2
3
3
import io .github .hapjava .HomekitCharacteristicChangeCallback ;
4
4
import io .github .hapjava .accessories .GarageDoor ;
5
- import io .github .hapjava .accessories .properties .DoorState ;
6
5
import io .github .hapjava .characteristics .EnumCharacteristic ;
7
6
import io .github .hapjava .characteristics .EventableCharacteristic ;
8
7
import java .util .concurrent .CompletableFuture ;
@@ -13,27 +12,27 @@ public class CurrentDoorStateCharacteristic extends EnumCharacteristic
13
12
private final GarageDoor door ;
14
13
15
14
public CurrentDoorStateCharacteristic (GarageDoor door ) {
16
- super ("00000032 -0000-1000-8000-0026BB765291" , true , true , "Target Door State" , 1 );
15
+ super ("0000000E -0000-1000-8000-0026BB765291" , false , true , "Current Door State" , 4 );
17
16
this .door = door ;
18
17
}
19
18
20
19
@ Override
21
20
protected void setValue (Integer value ) throws Exception {
22
- door . setTargetDoorState ( DoorState . fromCode ( value ));
21
+ // Read Only
23
22
}
24
23
25
24
@ Override
26
25
protected CompletableFuture <Integer > getValue () {
27
- return door .getTargetDoorState ().thenApply (s -> s .getCode ());
26
+ return door .getCurrentDoorState ().thenApply (s -> s .getCode ());
28
27
}
29
28
30
29
@ Override
31
30
public void subscribe (HomekitCharacteristicChangeCallback callback ) {
32
- door .subscribeTargetDoorState (callback );
31
+ door .subscribeCurrentDoorState (callback );
33
32
}
34
33
35
34
@ Override
36
35
public void unsubscribe () {
37
- door .unsubscribeTargetDoorState ();
36
+ door .unsubscribeCurrentDoorState ();
38
37
}
39
38
}
0 commit comments