pin

package
v0.0.0-...-2e4b27e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 10, 2019 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const TimeForm = "01-02-2006 15:04"

Variables

View Source
var LocationMountain, _ = time.LoadLocation("US/Mountain") //"America/Denver""Etc/GMT-7"

Functions

func InitPins

func InitPins() error

Types

type Pin

type Pin struct {
	Id      int    `json:"Id"`
	Status  bool   `json:"Status"`
	Enabled bool   `json:"Enabled"`
	Info    string `json:"Info"`

	//Schedule fields
	NextWatering string            `json:"NextWatering"`
	Schedules    map[string]uint32 `json:"Schedules"`

	//PriorityQueue specific fields
	Index    int   `json:"Index"`
	Priority int64 `json:"Priority"`
}

func NewPin

func NewPin(id int) *Pin

func (*Pin) GetNextWatering

func (p *Pin) GetNextWatering() (time.Time, error)

func (*Pin) RunPinForDuration

func (p *Pin) RunPinForDuration(dur int)

func (*Pin) TurnOff

func (p *Pin) TurnOff()

func (*Pin) TurnOn

func (p *Pin) TurnOn()

func (*Pin) UpdatePriorityAndNextWatering

func (p *Pin) UpdatePriorityAndNextWatering() (time.Time, error)

func (*Pin) UpdateTime

func (p *Pin) UpdateTime(timeString string, updateToTime time.Time) (time.Time, error)

func (*Pin) Validate

func (p *Pin) Validate() bool

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL