Skip to content

SoundTouch speaker for HomeControl

Notifications You must be signed in to change notification settings

llun/hksoundtouch

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

hksoundtouch

SoundTouch speaker for HomeControl

Sample Code for using with HC

package main

import (
  "github.com/brutella/hc"
  "github.com/brutella/hc/accessory"
  "github.com/llun/hksoundtouch"
)

func getSoundTouchAccessories() []*accessory.Accessory {
  services := soundtouch.Lookup()

  accessories := make([]*accessory.Accessory, len(services))
  for idx, service := range services {
    accessories[idx] = service.Accessory
  }

  return accessories
}

func main() {
  accessories := getSoundTouchAccessories()

  t, err := hc.NewIPTransport(hc.Config{
    Pin:  "32191123",
    Port: "51827",
  }, accessories[0], accessories[1:]...)
  if err != nil {
    log.Fatal(err)
  }

  hc.OnTermination(func() {
    t.Stop()
  })

  t.Start()
}

License

MIT

About

SoundTouch speaker for HomeControl

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages