View Source HAP.AccessoryServer (HAP v0.4.9)

Represents a top-level HAP instance configuration

Summary

Types

A unique identifier string in the form "AA:BB:CC:DD:EE:FF"

A HAP specified value indicating the primary function of this device as found in Section 13 of Apple's HomeKit Accessory Protocol Specification. Valid values include

The model of this accessory server, for example 'HAP Co. Super Bridge III'

The name to advertise for this accessory server, for example 'HAP Bridge'

A pairing code of the form 123-45-678

A pairing URL suitable for display in a QR code

A 4 character string used as part of the accessory discovery process

t()

Represents an accessory server consisting of a number of accessories. Contains the following fields

Functions

Generates the pairing url to be used to pair with this accessory server. This URL can be encoded in a QR code to enable pairing directly from an iOS device

Types

Link to this type

accessory_identifier()

View Source
@type accessory_identifier() :: String.t()

A unique identifier string in the form "AA:BB:CC:DD:EE:FF"

@type accessory_type() :: integer()

A HAP specified value indicating the primary function of this device as found in Section 13 of Apple's HomeKit Accessory Protocol Specification. Valid values include:

  1. Other
  2. Bridge
  3. Fan
  4. Garage
  5. Lightbulb
  6. Door Lock
  7. Outlet
  8. Switch
  9. Thermostat
  10. Sensor
  11. Security System
  12. Door
  13. Window
  14. Window Covering
  15. Programmable Switch
  16. Range Extender
  17. IP Camera
  18. Video Door Bell
  19. Air Purifier
  20. Heater
  21. Air Conditioner
  22. Humidifier
  23. Dehumidifier
  24. Sprinkler
  25. Faucet
  26. Shower System
  27. Remote
@type model() :: String.t()

The model of this accessory server, for example 'HAP Co. Super Bridge III'

@type name() :: String.t()

The name to advertise for this accessory server, for example 'HAP Bridge'

@type pairing_code() :: String.t()

A pairing code of the form 123-45-678

@type pairing_url() :: String.t()

A pairing URL suitable for display in a QR code

@type setup_id() :: String.t()

A 4 character string used as part of the accessory discovery process

@type t() :: %HAP.AccessoryServer{
  accessories: [HAP.Accessory.t()],
  accessory_type: accessory_type(),
  data_path: String.t(),
  display_module: module(),
  identifier: accessory_identifier(),
  model: model(),
  name: name(),
  pairing_code: pairing_code(),
  setup_id: setup_id()
}

Represents an accessory server consisting of a number of accessories. Contains the following fields:

  • name: The name to assign to this device, for example 'HAP Bridge'
  • model: The model name to assign to this device, for example 'HAP Co. Super Bridge III'
  • identifier: A unique identifier string in the form "AA:BB:CC:DD:EE:FF"
  • pairing_code: A pairing code of the form 123-45-678 to be used for pairing. If not specified one will be defined dynamically.
  • setup_id: A 4 character string used as part of the accessory discovery process. If not specified one will be defined dynamically.
  • display_module: An optional implementation of HAP.Display used to present pairing and other information to the user. If not specified then a basic console-based display is used.
  • data_path: The path to where HAP will store its internal data. Will be created if it does not exist. If not specified, the default value depends on the value of Mix.target/0. If it is :host then a value of hap_data is used. If it is anything else (as it will be when compiling for a Nerves target, for example), the value of /root/hap_data is used. This allows HAP to work out-of-the-box in conventional and Nerves environments.
  • accessory_type: A HAP specified value indicating the primary function of this device. See HAP.AccessoryServer.accessory_type/0 for details
  • accessories: A list of HAP.Accessory structs to include in this accessory server

Functions

@spec pairing_url(t()) :: String.t()

Generates the pairing url to be used to pair with this accessory server. This URL can be encoded in a QR code to enable pairing directly from an iOS device