HAP.Display behaviour (HAP v0.7.0)

Copy Markdown View Source

A behaviour which encapsulates all user-facing display concerns for an accessory. Applications which use HAP may provide their own implementation of this behaviour as a field in a HAP.AccessoryServer. If no such implementation is provided HAP uses a default console based implementation

Summary

Callbacks

Stop displaying any currently displayed pairing information to the user. This is most commonly because a pairing has been established with a controller

Display a notification to the user containing information on how to pair with this accessory server. The value of pairing_url can be encoded in a QR code to enable pairing directly from an iOS device.

Display a notification to the user that identifies the named device or accessory. This comes from a user request within the Home app to identify the given device or accessory.

Callbacks

clear_pairing_code()

@callback clear_pairing_code() :: any()

Stop displaying any currently displayed pairing information to the user. This is most commonly because a pairing has been established with a controller

display_pairing_code(name, pairing_code, pairing_url)

@callback display_pairing_code(
  name :: HAP.AccessoryServer.name(),
  pairing_code :: HAP.AccessoryServer.pairing_code(),
  pairing_url :: HAP.AccessoryServer.pairing_url()
) :: any()

Display a notification to the user containing information on how to pair with this accessory server. The value of pairing_url can be encoded in a QR code to enable pairing directly from an iOS device.

identify(name)

@callback identify(name :: String.t()) :: any()

Display a notification to the user that identifies the named device or accessory. This comes from a user request within the Home app to identify the given device or accessory.