Package io.github.hapjava.accessories
Interface DoorbellAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface DoorbellAccessory extends HomekitAccessory
doorbell accessory with a switch (button push) event.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default java.util.Collection<Service>
getServices()
The collection of Services this accessory supports.java.util.concurrent.CompletableFuture<ProgrammableSwitchEnum>
getSwitchEvent()
Retrieves the last states of the doorbell.void
subscribeSwitchEvent(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in doorbell switch event, i.e.void
unsubscribeSwitchEvent()
Unsubscribes from changes in doorbell switch event.-
Methods inherited from interface io.github.hapjava.accessories.HomekitAccessory
getFirmwareRevision, getId, getManufacturer, getModel, getName, getPrimaryService, getSerialNumber, identify
-
-
-
-
Method Detail
-
getSwitchEvent
java.util.concurrent.CompletableFuture<ProgrammableSwitchEnum> getSwitchEvent()
Retrieves the last states of the doorbell. Bluetooth device should return the last event, the IP device should always return null- Returns:
- state of the door bell event
-
subscribeSwitchEvent
void subscribeSwitchEvent(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in doorbell switch event, i.e. pressing on the door bell button.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeSwitchEvent
void unsubscribeSwitchEvent()
Unsubscribes from changes in doorbell switch event.
-
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 interfaceHomekitAccessory
- Returns:
- the collection of services.
-
-