public class WolSwitch extends Object implements io.github.hapjava.accessories.SwitchAccessory, io.github.hapjava.accessories.optionalcharacteristic.AccessoryWithHardwareRevision, Serializable
| 构造器和说明 |
|---|
WolSwitch(int id,
String ipAddress,
String macAddress)
默认平台Windows
|
WolSwitch(int id,
String ipAddress,
String macAddress,
PlatformEnum platform) |
WolSwitch(int id,
String ipAddress,
String macAddress,
PlatformEnum platform,
TimeUnit timeUnit,
long timeOut) |
WolSwitch(int id,
String ipAddress,
String macAddress,
PlatformEnum platform,
TimeUnit timeUnit,
long timeOut,
int retry) |
WolSwitch(int id,
String ipAddress,
String macAddress,
PlatformEnum platform,
TimeUnit timeUnit,
long timeOut,
int retry,
String broadcastIp,
int broadcastPort) |
| 限定符和类型 | 方法和说明 |
|---|---|
CompletableFuture<String> |
getFirmwareRevision() |
CompletableFuture<String> |
getHardwareRevision() |
int |
getId() |
CompletableFuture<String> |
getManufacturer() |
CompletableFuture<String> |
getModel() |
CompletableFuture<String> |
getName() |
CompletableFuture<String> |
getSerialNumber() |
CompletableFuture<Boolean> |
getSwitchState()
Retrieves the current binary state of the switch.
|
void |
identify() |
CompletableFuture<Void> |
setSwitchState(boolean state)
Sets the binary state of the switch
|
void |
subscribeSwitchState(io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback callback)
Subscribes to changes in the binary state of the switch.
|
void |
unsubscribeSwitchState()
Unsubscribes from changes in the binary state of the switch.
|
public WolSwitch(int id,
String ipAddress,
String macAddress)
id - HomeKit Accessory IdipAddress - ipAddressmacAddress - macAddresspublic WolSwitch(int id,
String ipAddress,
String macAddress,
PlatformEnum platform)
id - HomeKit Accessory IdipAddress - ipAddressmacAddress - macAddressplatform - platformpublic WolSwitch(int id,
String ipAddress,
String macAddress,
PlatformEnum platform,
TimeUnit timeUnit,
long timeOut)
id - HomeKit Accessory IdipAddress - ipAddressmacAddress - macAddressplatform - platformtimeUnit - timeUnittimeOut - timeOutpublic WolSwitch(int id,
String ipAddress,
String macAddress,
PlatformEnum platform,
TimeUnit timeUnit,
long timeOut,
int retry)
id - HomeKit Accessory IdipAddress - ipAddressmacAddress - macAddressplatform - platformtimeUnit - timeUnittimeOut - timeOutpublic WolSwitch(int id,
String ipAddress,
String macAddress,
PlatformEnum platform,
TimeUnit timeUnit,
long timeOut,
int retry,
String broadcastIp,
int broadcastPort)
public int getId()
getId 在接口中 io.github.hapjava.accessories.HomekitAccessorypublic CompletableFuture<String> getName()
getName 在接口中 io.github.hapjava.accessories.HomekitAccessorypublic void identify()
identify 在接口中 io.github.hapjava.accessories.HomekitAccessorypublic CompletableFuture<String> getSerialNumber()
getSerialNumber 在接口中 io.github.hapjava.accessories.HomekitAccessorypublic CompletableFuture<String> getModel()
getModel 在接口中 io.github.hapjava.accessories.HomekitAccessorypublic CompletableFuture<String> getManufacturer()
getManufacturer 在接口中 io.github.hapjava.accessories.HomekitAccessorypublic CompletableFuture<String> getFirmwareRevision()
getFirmwareRevision 在接口中 io.github.hapjava.accessories.HomekitAccessorypublic CompletableFuture<String> getHardwareRevision()
getHardwareRevision 在接口中 io.github.hapjava.accessories.optionalcharacteristic.AccessoryWithHardwareRevisionpublic CompletableFuture<Boolean> getSwitchState()
getSwitchState 在接口中 io.github.hapjava.accessories.SwitchAccessorypublic CompletableFuture<Void> setSwitchState(boolean state) throws Exception
setSwitchState 在接口中 io.github.hapjava.accessories.SwitchAccessorystate - the binary state to setException - when the change cannot be madepublic void subscribeSwitchState(io.github.hapjava.characteristics.HomekitCharacteristicChangeCallback callback)
subscribeSwitchState 在接口中 io.github.hapjava.accessories.SwitchAccessorycallback - the function to call when the state changes.public void unsubscribeSwitchState()
unsubscribeSwitchState 在接口中 io.github.hapjava.accessories.SwitchAccessoryCopyright © 2021. All rights reserved.