HAP.CharacteristicDefinition behaviour (HAP v0.2.0) View Source
A behaviour which encapsulates the functinos required to define a characteristic.
At runtime, characteristics are modeled via the HAP.Characteristic
struct which
contains the runtime values for the characteristic itself, as well as metadata about
the characteristic. A HAP.CharacteristicDefinition
is used to provide the template
values for these fields. HAP contains definitions for many common HomeKit characteristics
already, and users may define other characteristics by providing an implemenation of
this behaviour as the first value in the characteristic definition tuple in a service.
Link to this section Summary
Types
The format of a characteristic as defined in Table 6.5 of Apple's HomeKit Accessory Protocol Specification.
One of bool
, uint8
, uint16
, uint32
, uint64
, int
, float
, string
, tlv8
, or data
A permission of a characteristic as defined in Table 6.4 of Apple's HomeKit Accessory Protocol Specification.
One of pr
, pw
, ev
, aa
, tw
, hd
, or wr
The type of a characteristic as defined in Section 6.6.1 of Apple's HomeKit Accessory Protocol Specification.
The unit of measure of a characrteristic's value
Callbacks
The format of this characteristic's data
The maximum value allowed for this characteristic's value
The minimum value allowed for this characteristic's value
The permissions to allow for this characteristic
The step size by which this characteristic's value may change
The HomeKit type code for this characteristic
The units of this Characteristic's value
Link to this section Types
Specs
format() :: String.t()
The format of a characteristic as defined in Table 6.5 of Apple's HomeKit Accessory Protocol Specification.
One of bool
, uint8
, uint16
, uint32
, uint64
, int
, float
, string
, tlv8
, or data
Specs
perm() :: String.t()
A permission of a characteristic as defined in Table 6.4 of Apple's HomeKit Accessory Protocol Specification.
One of pr
, pw
, ev
, aa
, tw
, hd
, or wr
Specs
type() :: String.t()
The type of a characteristic as defined in Section 6.6.1 of Apple's HomeKit Accessory Protocol Specification.
Specs
unit() :: any()
The unit of measure of a characrteristic's value
Link to this section Callbacks
Specs
format() :: format()
The format of this characteristic's data
Specs
max_value() :: HAP.Characteristic.value()
The maximum value allowed for this characteristic's value
Specs
min_value() :: HAP.Characteristic.value()
The minimum value allowed for this characteristic's value
Specs
perms() :: [perm()]
The permissions to allow for this characteristic
Specs
step_value() :: HAP.Characteristic.value()
The step size by which this characteristic's value may change
Specs
type() :: type()
The HomeKit type code for this characteristic
Specs
units() :: unit()
The units of this Characteristic's value