Package io.github.hapjava.accessories
Interface SmartSpeakerAccessory
-
- All Superinterfaces:
HomekitAccessory
public interface SmartSpeakerAccessory extends HomekitAccessory
Smart Speaker accessory.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description java.util.concurrent.CompletableFuture<CurrentMediaStateEnum>
getCurrentMediaState()
Retrieves the current media state (seeCurrentMediaStateEnum
for supported values).default java.util.Collection<Service>
getServices()
The collection of Services this accessory supports.java.util.concurrent.CompletableFuture<TargetMediaStateEnum>
getTargetMediaState()
Retrieves the target media state (seeTargetMediaStateEnum
for supported values).java.util.concurrent.CompletableFuture<java.lang.Void>
setTargetMediaState(TargetMediaStateEnum targetMediaState)
Set the target media state (seeTargetMediaStateEnum
for supported values).void
subscribeCurrentMediaState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the current media state.void
subscribeTargetMediaState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the target media state.void
unsubscribeCurrentMediaState()
Unsubscribes from changes in the current media state.void
unsubscribeTargetMediaState()
Unsubscribes from changes in the target media state.-
Methods inherited from interface io.github.hapjava.accessories.HomekitAccessory
getFirmwareRevision, getId, getManufacturer, getModel, getName, getPrimaryService, getSerialNumber, identify
-
-
-
-
Method Detail
-
getCurrentMediaState
java.util.concurrent.CompletableFuture<CurrentMediaStateEnum> getCurrentMediaState()
Retrieves the current media state (seeCurrentMediaStateEnum
for supported values).- Returns:
- a future that will contain the current media state
-
subscribeCurrentMediaState
void subscribeCurrentMediaState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the current media state.- Parameters:
callback
- the function to call when the current media state changes.
-
unsubscribeCurrentMediaState
void unsubscribeCurrentMediaState()
Unsubscribes from changes in the current media state.
-
getTargetMediaState
java.util.concurrent.CompletableFuture<TargetMediaStateEnum> getTargetMediaState()
Retrieves the target media state (seeTargetMediaStateEnum
for supported values).- Returns:
- a future that will contain the target media state
-
setTargetMediaState
java.util.concurrent.CompletableFuture<java.lang.Void> setTargetMediaState(TargetMediaStateEnum targetMediaState)
Set the target media state (seeTargetMediaStateEnum
for supported values).- Parameters:
targetMediaState
- target media state- Returns:
- a future that completes when the change is made
-
subscribeTargetMediaState
void subscribeTargetMediaState(HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the target media state.- Parameters:
callback
- the function to call when the target media state changes.
-
unsubscribeTargetMediaState
void unsubscribeTargetMediaState()
Unsubscribes from changes in the target media 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.
-
-