Interface OccupancySensorAccessory

  • All Superinterfaces:
    HomekitAccessory

    public interface OccupancySensorAccessory
    extends HomekitAccessory
    An occupancy sensor that reports whether occupancy has been detected.
    Author:
    Tim Harper
    • Method Detail

      • getOccupancyDetected

        java.util.concurrent.CompletableFuture<OccupancyDetectedEnum> getOccupancyDetected()
        Retrieves the state of the occupancy sensor. If true then occupancy has been detected.
        Returns:
        a future that will contain the occupancy sensor's state
      • subscribeOccupancyDetected

        void subscribeOccupancyDetected​(HomekitCharacteristicChangeCallback callback)
        Subscribes to changes in the occupancy sensor.
        Parameters:
        callback - the function to call when the state changes.
      • unsubscribeOccupancyDetected

        void unsubscribeOccupancyDetected()
        Unsubscribes from changes in the occupancy sensor.
      • getServices

        default java.util.Collection<Service> getServices()
        Description copied from interface: HomekitAccessory
        The collection of Services this accessory supports. Services are the primary way to interact with the accessory via HomeKit. Besides the Services offered here, the accessory will automatically include the required information service.

        This method will only be useful if you're implementing your own accessory type. For the standard accessories, use the default implementation provided by the interfaces in io.github.hapjava.accessories.

        Specified by:
        getServices in interface HomekitAccessory
        Returns:
        the collection of services.