litterrobot

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2019 License: MIT Imports: 5 Imported by: 1

README

litterrobot

    client := NewClient(local, email, password, apikey)
    client.GetStatus()

More to come!

  • Improvements
  • UDP-based Option

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client - The Client for accessing data

func NewClient

func NewClient(local bool, email string, password string, apikey string) *Client

NewClient - Create a new Client for a given address

func (*Client) Cycle

func (c *Client) Cycle(identifier string)

Cycle - Cycle Command

func (*Client) NightLightOff

func (c *Client) NightLightOff(identifier string)

NightLightOff - NightLight Command

func (*Client) NightLightOn

func (c *Client) NightLightOn(identifier string)

NightLightOn - NightLight Command

func (*Client) PanelLockOff

func (c *Client) PanelLockOff(identifier string)

PanelLockOff - PanelLock Command

func (*Client) PanelLockOn

func (c *Client) PanelLockOn(identifier string)

PanelLockOn - PanelLock Command

func (*Client) PowerOff

func (c *Client) PowerOff(identifier string)

PowerOff - Power Command

func (*Client) PowerOn

func (c *Client) PowerOn(identifier string)

PowerOn - Power Command

func (*Client) PublishStates

func (c *Client) PublishStates()

PublishStates - Fetch & sendState states from the Litter Robot API

func (*Client) Register

func (c *Client) Register(l Observer)

Register - Register observers

func (*Client) Run

func (c *Client) Run()

Run - Run a UDP server to listen for packets from the LR

func (*Client) States

func (c *Client) States() ([]State, error)

States - Fetch states from the Litter Robot API

func (*Client) Wait

func (c *Client) Wait(identifier string, val string)

Wait - Wait Command

type Event

type Event struct {
	Version int64
	Data    State
}

Event - An event from the API or UDP

type Observer

type Observer interface {
	ReceiveState(Event)
}

Observer - Receieve observations from a publisher

type Publisher

type Publisher interface {
	Register(Observer)
}

Publisher - Receieve observers

type State

type State struct {
	LitterRobotID     string
	LitterRobotSerial string

	PowerStatus               string
	UnitStatus                string
	CycleCount                string
	CycleCapacity             string
	CyclesAfterDrawerFull     string
	DFICycleCount             string
	CleanCycleWaitTimeMinutes string

	PanelLockActive  bool
	NightLightActive bool
	DidNotifyOffline bool
	DFITriggered     bool
	SleepModeActive  bool
}

State - The state of the litter robot

Jump to

Keyboard shortcuts

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