Interface AccessoryWithRemainingDuration


  • public interface AccessoryWithRemainingDuration
    Accessory with remaining duration characteristic.
    Author:
    Tim Harper
    • Method Detail

      • getRemainingDuration

        java.util.concurrent.CompletableFuture<java.lang.Integer> getRemainingDuration()
        Retrieves the remaining duration
        Returns:
        a future with the duration in seconds
      • getMinRemainingDuration

        default int getMinRemainingDuration()
        return the min value for remaining duration. overwrite if you want to change the default value.
        Returns:
        min remaining duration
      • getMaxRemainingDuration

        default int getMaxRemainingDuration()
        return the max value for remaining duration. overwrite if you want to change the default value.
        Returns:
        max remaining duration
      • subscribeRemainingDuration

        void subscribeRemainingDuration​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in the duration; note it is not necessary to emit a change every second, homekit infers the countdown progress client side.
        Parameters:
        callback - the function when the existing duration has been replaced with a new one.
      • unsubscribeRemainingDuration

        void unsubscribeRemainingDuration()
        Unsubscribes from changes