Package io.github.hapjava.accessories
Interface IrrigationSystemAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface IrrigationSystemAccessory extends HomekitAccessory
irrigation system accessory that controls several valves.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<ActiveEnum>
getActive()
An irrigation system is set to Active when the system is enabled.java.util.concurrent.CompletableFuture<InUseEnum>
getInUse()
Retrieves the current inUse state of the irrigation; InUse means one of the valves is set to In Use.java.util.concurrent.CompletableFuture<ProgramModeEnum>
getProgramMode()
Retrieves the program mode statusdefault java.util.Collection<Service>
getServices()
The collection of Services this accessory supports.java.util.concurrent.CompletableFuture<java.lang.Void>
setActive(ActiveEnum active)
Sets the irrigation active statevoid
subscribeActive(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the active state of the irrigation.void
subscribeInUse(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the inUse state.void
subscribeProgramMode(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the program mode of the irrigation system.void
unsubscribeActive()
Unsubscribes from changes in the irrigation active state.void
unsubscribeInUse()
Unsubscribes from changes in the inUse state.void
unsubscribeProgramMode()
Unsubscribes from changes in the program mode.-
Methods inherited from interface io.github.hapjava.accessories.HomekitAccessory
getFirmwareRevision, getId, getManufacturer, getModel, getName, getPrimaryService, getSerialNumber, identify
-
-
-
-
Method Detail
-
getActive
java.util.concurrent.CompletableFuture<ActiveEnum> getActive()
An irrigation system is set to Active when the system is enabled. When one of the valves is set to In Use, the irrigation system must be set to in use.- Returns:
- a future that will contain the binary state
-
setActive
java.util.concurrent.CompletableFuture<java.lang.Void> setActive(ActiveEnum active) throws java.lang.Exception
Sets the irrigation active state- Parameters:
active
- the binary state to set- Returns:
- a future that completes when the change is made
- Throws:
java.lang.Exception
- when the change cannot be made
-
getProgramMode
java.util.concurrent.CompletableFuture<ProgramModeEnum> getProgramMode()
Retrieves the program mode status- Returns:
- a future that will contain the valve type.
-
getInUse
java.util.concurrent.CompletableFuture<InUseEnum> getInUse()
Retrieves the current inUse state of the irrigation; InUse means one of the valves is set to In Use.- Returns:
- a future that will contain the binary state
-
subscribeInUse
void subscribeInUse(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the inUse state.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeInUse
void unsubscribeInUse()
Unsubscribes from changes in the inUse state.
-
subscribeActive
void subscribeActive(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the active state of the irrigation.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeActive
void unsubscribeActive()
Unsubscribes from changes in the irrigation active state.
-
subscribeProgramMode
void subscribeProgramMode(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the program mode of the irrigation system.- Parameters:
callback
- the function to call when the state changes.
-
unsubscribeProgramMode
void unsubscribeProgramMode()
Unsubscribes from changes in the program mode.
-
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.
-
-