Wifi Occupancy Sensor for HomeControl
package main
import (
"github.com/brutella/hc"
"github.com/brutella/hc/accessory"
"github.com/llun/hkwifioccupancy"
)
func main() {
wifi := wifioccupancy.NewWifi("/tmp/presence.wifi", NewSet("MAC ADDRESS1", "MAC ADDRESS2"))
t, err := hc.NewIPTransport(hc.Config{
Pin: "32191123",
}, wifi.Accessory)
if err != nil {
log.Fatal(err)
}
hc.OnTermination(func() {
t.Stop()
})
t.Start()
}
MIT