Interface Characteristic
-
- All Known Subinterfaces:
EventableCharacteristic
- All Known Implementing Classes:
AccessoryFlagsCharacteristic,ActiveCharacteristic,ActiveIdentifierCharacteristic,AirPlayEnableCharacteristic,AirQualityCharacteristic,BaseCharacteristic,BatteryLevelCharacteristic,BooleanCharacteristic,BrightnessCharacteristic,CarbonDioxideDetectedCharacteristic,CarbonDioxideLevelCharacteristic,CarbonDioxidePeakLevelCharacteristic,CarbonMonoxideDetectedCharacteristic,CarbonMonoxideLevelCharacteristic,CarbonMonoxidePeakLevelCharacteristic,ChargingStateCharacteristic,ClosedCaptionsCharacteristic,ColorTemperatureCharacteristic,ConfiguredNameCharacteristic,ContactSensorStateCharacteristic,CoolingThresholdTemperatureCharacteristic,CurrentAirPurifierCharacteristic,CurrentAmbientLightLevelCharacteristic,CurrentDoorStateCharacteristic,CurrentFanStateCharacteristic,CurrentHeaterCoolerStateCharacteristic,CurrentHeatingCoolingStateCharacteristic,CurrentHorizontalTiltAngleCharacteristic,CurrentHumidifierDehumidifierStateCharacteristic,CurrentMediaStateCharacteristic,CurrentPositionCharacteristic,CurrentRelativeHumidityCharacteristic,CurrentSecuritySystemStateCharacteristic,CurrentSlatStateCharacteristic,CurrentTemperatureCharacteristic,CurrentTiltAngleCharacteristic,CurrentVerticalTiltAngleCharacteristic,CurrentVisibilityStateCharacteristic,EnumCharacteristic,FilterChangeIndicationCharacteristic,FilterLifeLevelCharacteristic,FirmwareRevisionCharacteristic,FloatCharacteristic,HardwareRevisionCharacteristic,HeatingThresholdTemperatureCharacteristic,HoldPositionCharacteristic,HueCharacteristic,HumidityDehumidifierThresholdCharacteristic,HumidityHumidifierThresholdCharacteristic,IdentifierCharacteristic,IdentifyCharacteristic,InputDeviceTypeCharacteristic,InputSourceTypeCharacteristic,IntegerCharacteristic,InUseCharacteristic,IsConfiguredCharacteristic,LeakDetectedStateCharacteristic,LockCurrentStateCharacteristic,LockPhysicalControlsCharacteristic,LockTargetStateCharacteristic,ManufacturerCharacteristic,ModelCharacteristic,MotionDetectedCharacteristic,MuteCharacteristic,NameCharacteristic,NitrogenDioxideDensityCharacteristic,ObstructionDetectedCharacteristic,OccupancyDetectedCharacteristic,OnCharacteristic,OutletInUseCharacteristic,OzoneDensityCharacteristic,PictureModeCharacteristic,PM10DensityCharacteristic,PM25DensityCharacteristic,PositionStateCharacteristic,PowerModeCharacteristic,ProgrammableSwitchEventCharacteristic,ProgramModeCharacteristic,RemainingDurationCharacteristic,RemoteKeyCharacteristic,ResetFilterIndicationCharacteristic,RotationDirectionCharacteristic,RotationSpeedCharacteristic,SaturationCharacteristic,SecuritySystemAlarmTypeCharacteristic,SerialNumberCharacteristic,ServiceLabelIndexCharacteristic,ServiceLabelNamespaceCharacteristic,SetDurationCharacteristic,SlatTypeCharacteristic,SleepDiscoveryModeCharacteristic,SmokeDetectedCharacteristic,StaticStringCharacteristic,StatusActiveCharacteristic,StatusFaultCharacteristic,StatusLowBatteryCharacteristic,StatusTamperedCharacteristic,StringCharacteristic,SulphurDioxideDensityCharacteristic,SwingModeCharacteristic,TargetAirPurifierStateCharacteristic,TargetDoorStateCharacteristic,TargetFanStateCharacteristic,TargetHeaterCoolerStateCharacteristic,TargetHeatingCoolingStateCharacteristic,TargetHorizontalTiltAngleCharacteristic,TargetHumidifierDehumidifierStateCharacteristic,TargetMediaStateCharacteristic,TargetPositionCharacteristic,TargetRelativeHumidityCharacteristic,TargetSecuritySystemStateCharacteristic,TargetTemperatureCharacteristic,TargetTiltAngleCharacteristic,TargetVerticalTiltAngleCharacteristic,TargetVisibilityStateCharacteristic,TemperatureDisplayUnitCharacteristic,ValveTypeCharacteristic,VersionCharacteristic,VOCDensityCharacteristic,VolumeCharacteristic,VolumeControlTypeCharacteristic,VolumeSelectorCharacteristic,WaterLavelCharacteristic
public interface CharacteristicInterface for the characteristics provided by a Service.Characteristics are the lowest level building block of the HomeKit Accessory Protocol. They define variables that can be retrieved or set by the remote client. Most consumers of this library will be better served by using one of the characteristic classes in
io.github.hapjava.characteristicswhen creating custom accessory types (the standard accessories fromio.github.hapjava.accessoriesalready include the necessary characteristics), instead of trying to implement the JSON formats directly.- Author:
- Andy Lintner
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description java.lang.StringgetType()voidsetValue(javax.json.JsonValue jsonValue)Invoked by the remote client, this updates the current value of the characteristic.voidsupplyValue(javax.json.JsonObjectBuilder characteristicBuilder)Adds an attribute to the passed JsonObjectBuilder named "value" with the current value of the characteristic.java.util.concurrent.CompletableFuture<javax.json.JsonObject>toJson(int iid)Creates the JSON representation of the characteristic, in accordance with the HomeKit Accessory Protocol.
-
-
-
Method Detail
-
getType
java.lang.String getType()
- Returns:
- The UUID type for this characteristic.
-
supplyValue
void supplyValue(javax.json.JsonObjectBuilder characteristicBuilder)
Adds an attribute to the passed JsonObjectBuilder named "value" with the current value of the characteristic.- Parameters:
characteristicBuilder- the JsonObjectBuilder to add the value attribute to.
-
toJson
java.util.concurrent.CompletableFuture<javax.json.JsonObject> toJson(int iid)
Creates the JSON representation of the characteristic, in accordance with the HomeKit Accessory Protocol.- Parameters:
iid- The instance ID of the characteristic to be included in the serialization.- Returns:
- the future completing with the resulting JSON.
-
setValue
void setValue(javax.json.JsonValue jsonValue)
Invoked by the remote client, this updates the current value of the characteristic.- Parameters:
jsonValue- the JSON serialized value to set.
-
-