Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/brutella/hc
Browse files Browse the repository at this point in the history
  • Loading branch information
brutella committed Feb 21, 2020
2 parents f544579 + e21f460 commit da56e82
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ You can focus on implementing the business logic for your accessory, without hav

Here are some projects which use `hc`.

- [hkknx](https://hochgatterer.me/hkknx)
- [hkcam](https://github.com/brutella/hkcam)
- [hklifx](https://github.com/brutella/hklifx/)
- [hkuvr](https://github.com/brutella/hkuvr)
Expand Down
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 da56e82

Please sign in to comment.