Package io.github.hapjava.accessories
Interface CarbonMonoxideSensorAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface CarbonMonoxideSensorAccessory extends HomekitAccessory
A carbon monoxide sensor reports whether carbon monoxide has been detected or not.- Author:
- Gaston Dombiak
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<CarbonMonoxideDetectedEnum>
getCarbonMonoxideDetectedState()
Retrieves the state of the sensor that indicates if carbon monoxide has been detected.default java.util.Collection<Service>
getServices()
The collection of Services this accessory supports.void
subscribeCarbonMonoxideDetectedState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the carbon monoxide's state.void
unsubscribeCarbonMonoxideDetectedState()
Unsubscribes from changes in the carbon monoxide's state.-
Methods inherited from interface io.github.hapjava.accessories.HomekitAccessory
getFirmwareRevision, getId, getManufacturer, getModel, getName, getPrimaryService, getSerialNumber, identify
-
-
-
-
Method Detail
-
getCarbonMonoxideDetectedState
java.util.concurrent.CompletableFuture<CarbonMonoxideDetectedEnum> getCarbonMonoxideDetectedState()
Retrieves the state of the sensor that indicates if carbon monoxide has been detected.- Returns:
- a future that will contain the carbon monoxide sensor's state
-
subscribeCarbonMonoxideDetectedState
void subscribeCarbonMonoxideDetectedState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the carbon monoxide's state.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeCarbonMonoxideDetectedState
void unsubscribeCarbonMonoxideDetectedState()
Unsubscribes from changes in the carbon monoxide's state.
-
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.
-
-