Skip to content

Commit

Permalink
Merge pull request #161 from yakutozcan/master
Browse files Browse the repository at this point in the history
Create window accessory
  • Loading branch information
brutella authored Feb 12, 2020
2 parents fcdb46a + 39d40e1 commit 81d1d3a
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions accessory/window.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
package accessory

import (
"github.com/brutella/hc/service"
)

type Windows struct {
*Accessory
Window *service.Window
}

// NewWindow returns a window which implements model.NewWindow.
func NewWindow(info Info, currentState int) *Windows {
acc := Windows{}
acc.Accessory = New(info, TypeWindow)
acc.Window = service.NewWindow()
acc.Window.CurrentPosition.SetValue(currentState)
acc.AddService(acc.Window.Service)

return &acc
}

0 comments on commit 81d1d3a

Please sign in to comment.