Package io.github.hapjava.accessories
Interface SecuritySystemAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface SecuritySystemAccessory extends HomekitAccessory
A security system that can be armed so that when a contact sensor is opened or a motion sensor detects movement, then a siren could be fired off. There are different modes for arming the system. SeeTargetSecuritySystemStateEnum
for more information.- Author:
- Gaston Dombiak
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<CurrentSecuritySystemStateEnum>
getCurrentSecuritySystemState()
Retrieves the current state of the security system.default CurrentSecuritySystemStateEnum[]
getCurrentSecuritySystemStateValidValues()
Valid values for current state.default java.util.Collection<Service>
getServices()
The collection of Services this accessory supports.java.util.concurrent.CompletableFuture<TargetSecuritySystemStateEnum>
getTargetSecuritySystemState()
Retrieves the pending, but not yet completed, state of the security system.default TargetSecuritySystemStateEnum[]
getTargetSecuritySystemStateValidValues()
Valid values for target state.void
setTargetSecuritySystemState(TargetSecuritySystemStateEnum state)
Sets the state of the security system.void
subscribeCurrentSecuritySystemState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes to the state of the security system.void
subscribeTargetSecuritySystemState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the pending, but not yet completed, state of the security system.void
unsubscribeCurrentSecuritySystemState()
Unsubscribes from changes in the state of the security system.void
unsubscribeTargetSecuritySystemState()
Unsubscribes from changes in the pending, but not yet completed, state of the security system.-
Methods inherited from interface io.github.hapjava.accessories.HomekitAccessory
getFirmwareRevision, getId, getManufacturer, getModel, getName, getPrimaryService, getSerialNumber, identify
-
-
-
-
Method Detail
-
getCurrentSecuritySystemState
java.util.concurrent.CompletableFuture<CurrentSecuritySystemStateEnum> getCurrentSecuritySystemState()
Retrieves the current state of the security system. The state describes if the system is armed in any of its variations; or if the alarm has been triggered; or if the system is disarmed.- Returns:
- current state of the security system.
-
subscribeCurrentSecuritySystemState
void subscribeCurrentSecuritySystemState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes to the state of the security system.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeCurrentSecuritySystemState
void unsubscribeCurrentSecuritySystemState()
Unsubscribes from changes in the state of the security system.
-
setTargetSecuritySystemState
void setTargetSecuritySystemState(TargetSecuritySystemStateEnum state) throws java.lang.Exception
Sets the state of the security system. The security system could be armed in any of its variations or disarmed.- Parameters:
state
- target state of the security system.- Throws:
java.lang.Exception
- when the change cannot be made.
-
getTargetSecuritySystemState
java.util.concurrent.CompletableFuture<TargetSecuritySystemStateEnum> getTargetSecuritySystemState()
Retrieves the pending, but not yet completed, state of the security system.- Returns:
- target state of the security system.
-
subscribeTargetSecuritySystemState
void subscribeTargetSecuritySystemState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the pending, but not yet completed, state of the security system.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeTargetSecuritySystemState
void unsubscribeTargetSecuritySystemState()
Unsubscribes from changes in the pending, but not yet completed, state of the security system.
-
getCurrentSecuritySystemStateValidValues
default CurrentSecuritySystemStateEnum[] getCurrentSecuritySystemStateValidValues()
Valid values for current state.- Returns:
- array of valid current states.
-
getTargetSecuritySystemStateValidValues
default TargetSecuritySystemStateEnum[] getTargetSecuritySystemStateValidValues()
Valid values for target state.- Returns:
- array of valid targe states.
-
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.
-
-