File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
src/main/java/io/github/hapjava
impl/characteristics/thermostat Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -70,4 +70,14 @@ default TemperatureUnit getTemperatureUnit() {
7070 default void setTemperatureUnit (TemperatureUnit unit ) {
7171 // override depending on the thermostat if required.
7272 }
73+
74+ /**
75+ * subscribe to unit changes.
76+ *
77+ * @param callback callback
78+ */
79+ default void subscribeTemperatureUnit (final HomekitCharacteristicChangeCallback callback ) {}
80+
81+ /** unsubscribe from unit changes. */
82+ default void unsubscribeTemperatureUnit () {}
7383}
Original file line number Diff line number Diff line change @@ -29,8 +29,12 @@ protected CompletableFuture<Integer> getValue() {
2929 }
3030
3131 @ Override
32- public void subscribe (final HomekitCharacteristicChangeCallback callback ) {}
32+ public void subscribe (final HomekitCharacteristicChangeCallback callback ) {
33+ thermostat .subscribeTemperatureUnit (callback );
34+ }
3335
3436 @ Override
35- public void unsubscribe () {}
37+ public void unsubscribe () {
38+ thermostat .unsubscribeTemperatureUnit ();
39+ }
3640}
You can’t perform that action at this time.
0 commit comments