Package io.github.hapjava.accessories
Interface LightSensorAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface LightSensorAccessory extends HomekitAccessory
A light sensor that reports current ambient light level.- Author:
- Gaston Dombiak
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<java.lang.Double>
getCurrentAmbientLightLevel()
Retrieves the current ambient light level.default double
getMaxCurrentAmbientLightLevel()
return the max value for current ambient light level.default double
getMinCurrentAmbientLightLevel()
return the min value for current ambient light level.default double
getMinStepCurrentAmbientLightLevel()
return the min step value for current ambient light level.default java.util.Collection<Service>
getServices()
The collection of Services this accessory supports.void
subscribeCurrentAmbientLightLevel(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the current ambient light level.void
unsubscribeCurrentAmbientLightLevel()
Unsubscribes from changes in the current ambient light level.-
Methods inherited from interface io.github.hapjava.accessories.HomekitAccessory
getFirmwareRevision, getId, getManufacturer, getModel, getName, getPrimaryService, getSerialNumber, identify
-
-
-
-
Method Detail
-
getCurrentAmbientLightLevel
java.util.concurrent.CompletableFuture<java.lang.Double> getCurrentAmbientLightLevel()
Retrieves the current ambient light level.- Returns:
- a future that will contain the luminance level expressed in LUX.
-
subscribeCurrentAmbientLightLevel
void subscribeCurrentAmbientLightLevel(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the current ambient light level.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeCurrentAmbientLightLevel
void unsubscribeCurrentAmbientLightLevel()
Unsubscribes from changes in the current ambient light level.
-
getMinCurrentAmbientLightLevel
default double getMinCurrentAmbientLightLevel()
return the min value for current ambient light level. overwrite if you want to change the default value.- Returns:
- min current ambient light level
-
getMaxCurrentAmbientLightLevel
default double getMaxCurrentAmbientLightLevel()
return the max value for current ambient light level. overwrite if you want to change the default value.- Returns:
- max current ambient light level
-
getMinStepCurrentAmbientLightLevel
default double getMinStepCurrentAmbientLightLevel()
return the min step value for current ambient light level. overwrite if you want to change the default value.- Returns:
- min step current ambient light level
-
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.
-
-