A demo app for HAP, the Elixir HomeKit Accessory Protocol library
This project is an example of how to use the HAP library
to create HomeKit controllable software using Elixir & Nerves. This example is focused on RPi
and wires up a GPIO pin to represent a light bulb. To demonstrate asynchronous notifcations you
may send messages to the GPIO module like so:
HAPDemo.GPIO.toggle(22)
These changes will be reflected in real-time within any HomeKit controller that lists the light
bulb service.
As a demonstration project, this project is intended to be run on a Raspberry Pi of
just about any flavour (it should also run on other Nerves targets with minor changes to
GPIO pin numbers). To install & run it, simply:
MIX_TARGET=rpi_0 mix deps.get
MIX_TARGET=rpi_0 mix firmware
MIX_TARGET=rpi_0 mix firmware.burn
HAP.Display.update_pairing_info_display()
.Note that HAP has a hard requirement for OTP 23 or greater due to the availability of
certain crypto routines. If you use asdf to host your Erlangs, the .tool-versions
file
in this project will take care of you; just run asdf install
in this folder and you
should be good to go.
MIT