Conf file move, multi config support, on time support

This commit is contained in:
Ian Gulliver
2022-09-24 17:20:10 -07:00
parent 40c4abd0cd
commit 035df9e7fd
5 changed files with 133 additions and 13 deletions

View File

@@ -4,6 +4,7 @@ import "github.com/stianeikeland/go-rpio/v4"
type Relay struct {
pin rpio.Pin
on bool
}
func NewRelay(pin int) *Relay {
@@ -18,8 +19,14 @@ func NewRelay(pin int) *Relay {
func (r *Relay) On() {
r.pin.High()
r.on = true
}
func (r *Relay) Off() {
r.pin.Low()
r.on = false
}
func (r *Relay) IsOn() bool {
return r.on
}