Documentation ¶
Index ¶
- type App
- func (a *App) BackgroundCheck()
- func (a *App) MaybeTurnPirOff(pir *Pir) error
- func (a *App) MaybeTurnPirOn(pir *Pir, newState relayState) error
- func (a *App) PirByName(name string) *Pir
- func (a *App) ScheduleBackgroundUpdater(doneCh <-chan os.Signal, tickInterval time.Duration)
- func (a *App) UpdatePirState(pir *Pir, data map[string]int64) error
- func (a *App) UpdateSchedule()
- func (a *App) UpdateState() error
- func (a *App) ValidTime() bool
- type Pir
- type Unit
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type App ¶
type App struct { Snmp snmp.GetterSetter Clock clock.Clock TZ *time.Location Sunriser sunrise.Sunriser // time of the SunriseTime SunriseTime time.Time // time of the SunsetTime SunsetTime time.Time // SunriseTime and SunsetTime are date specific, therefore need to // be updated. `SunsetUpdateDate` used as a cache mark // indicating the date of values. if today != SunsetUpdateDate // values need to be updated SunsetUpdateDate string Pirs map[string]*Pir TimeoutOid string }
func (*App) BackgroundCheck ¶
func (a *App) BackgroundCheck()
func (*App) MaybeTurnPirOff ¶
func (*App) MaybeTurnPirOn ¶
func (*App) ScheduleBackgroundUpdater ¶
func (*App) UpdateSchedule ¶
func (a *App) UpdateSchedule()
func (*App) UpdateState ¶
type Pir ¶
type Pir struct { Name string // remote State of the PIR State Unit // PIR is Enabled if pin set to 0 (MANUAL) Enabled Unit // current relayState of the Relay Relay Unit // timestamp when relayState changed to ON // used for tracking a single session duration TurnedOn time.Time LastChange time.Time Timeout time.Duration // indicates whether time schedule is Enabled TimeSchedule bool // Duration of lights being on DurationMetric *metrics.Summary }
Click to show internal directories.
Click to hide internal directories.