Package io.github.hapjava.accessories
Interface HomekitAccessory
-
- All Known Subinterfaces:
AirPurifierAccessory,AirQualityAccessory,BatteryAccessory,Bridge,CarbonDioxideSensorAccessory,CarbonMonoxideSensorAccessory,ContactSensorAccessory,DoorAccessory,DoorbellAccessory,FanAccessory,FaucetAccessory,FilterMaintenanceAccessory,GarageDoorOpenerAccessory,HeaterCoolerAccessory,HumidifierDehumidifierAccessory,HumiditySensorAccessory,InputSourceAccessory,IrrigationSystemAccessory,LeakSensorAccessory,LightbulbAccessory,LightSensorAccessory,LockMechanismAccessory,MicrophoneAccessory,MotionSensorAccessory,OccupancySensorAccessory,OutletAccessory,SecuritySystemAccessory,SlatAccessory,SmartSpeakerAccessory,SmokeSensorAccessory,SpeakerAccessory,StatelessProgrammableSwitchAccessory,SwitchAccessory,TelevisionAccessory,TelevisionSpeakerAccessory,TemperatureSensorAccessory,ThermostatAccessory,ValveAccessory,WindowAccessory,WindowCoveringAccessory
public interface HomekitAccessoryBase interface for all HomeKit Accessories. You can implement this interface directly, but most users will prefer to use the more full featured interfaces inio.github.hapjava.accessorieswhich include a default implementation ofgetServices().- Author:
- Andy Lintner
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description CompletableFuture<String>getFirmwareRevision()Returns a firmware revision to display in iOS.intgetId()A unique identifier that must remain static across invocations to prevent errors with paired iOS devices.CompletableFuture<String>getManufacturer()Returns a manufacturer to display in iOS.CompletableFuture<String>getModel()Returns a model name to display in iOS.CompletableFuture<String>getName()Returns a name to display in iOS.default ServicegetPrimaryService()default implementation which is sufficient if accessory has only one servicesCompletableFuture<String>getSerialNumber()Returns a serial number to display in iOS.default Collection<Service>getServices()The collection of Services this accessory supports.voididentify()Performs an operation that can be used to identify the accessory.
-
-
-
Method Detail
-
getId
int getId()
A unique identifier that must remain static across invocations to prevent errors with paired iOS devices. When used as a child of a Bridge, this value must be greater than 1, as that ID is reserved for the Bridge itself.- Returns:
- the unique identifier.
-
getName
CompletableFuture<String> getName()
Returns a name to display in iOS.- Returns:
- the label.
-
identify
void identify()
Performs an operation that can be used to identify the accessory. This action can be performed without pairing.
-
getSerialNumber
CompletableFuture<String> getSerialNumber()
Returns a serial number to display in iOS.- Returns:
- the serial number, or null.
-
getModel
CompletableFuture<String> getModel()
Returns a model name to display in iOS.- Returns:
- the model name, or null.
-
getManufacturer
CompletableFuture<String> getManufacturer()
Returns a manufacturer to display in iOS.- Returns:
- the manufacturer, or null.
-
getFirmwareRevision
CompletableFuture<String> getFirmwareRevision()
Returns a firmware revision to display in iOS.- Returns:
- the firmware revision, or null.
-
getServices
default Collection<Service> getServices()
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.- Returns:
- the collection of services.
-
getPrimaryService
default Service getPrimaryService()
default implementation which is sufficient if accessory has only one services- Returns:
- primary service
-
-