neato

package module
v0.0.0-...-746ca2f Latest Latest
Warning

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

Go to latest
Published: Feb 27, 2020 License: GPL-3.0 Imports: 13 Imported by: 0

README

neato

A Golang SDK for the Neato Beehive and Nucleo APIs.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Map

type Map struct {
	Version                        int       `json:"version"`
	ID                             string    `json:"id"`
	URL                            string    `json:"url"`
	URLValidForSeconds             int       `json:"url_valid_for_seconds"`
	RunID                          string    `json:"run_id"`
	Status                         string    `json:"status"`
	LaunchedFrom                   string    `json:"launched_from"`
	Error                          string    `json:"error"`
	Category                       int       `json:"category"`
	Mode                           int       `json:"mode"`
	Modifier                       int       `json:"modifier"`
	StartAt                        time.Time `json:"start_at"`
	EndAt                          time.Time `json:"end_at"`
	EndOrientationRelativeDegrees  int       `json:"end_orientation_relative_degrees"`
	RunChargeAtStart               int       `json:"run_charge_at_start"`
	RunChargeAtEnd                 int       `json:"run_charge_at_end"`
	SuspendedCleaningChargingCount int       `json:"suspended_cleaning_charging_count"`
	TimeInSuspendedCleaning        int       `json:"time_in_suspended_cleaning"`
	TimeInError                    int       `json:"time_in_error"`
	TimeInPause                    int       `json:"time_in_pause"`
	CleanedArea                    float64   `json:"cleaned_area"`
	BaseCount                      int       `json:"base_count"`
	IsDocked                       bool      `json:"is_docked"`
	Delocalized                    bool      `json:"delocalized"`
}

Map is a single map, as stored on a Robot

type MapsResult

type MapsResult struct {
	Stats struct{} `json:"stats"`
	Maps  []Map    `json:"maps"`
}

MapsResult contains details about the maps available on a Robot

type Params

type Params struct {
	Category                     int      `json:"category"`
	Mode                         int      `json:"mode"`
	Modifier                     int      `json:"modifier"`
	RobotSounds                  bool     `json:"robotSounds"`
	DirtbinAlert                 bool     `json:"dirtbinAlert"`
	AllAlerts                    bool     `json:"allAlerts"`
	Leds                         bool     `json:"leds"`
	ButtonClicks                 bool     `json:"buttonClicks"`
	DirtbinAlertReminderInterval int      `json:"dirtbinAlertReminderInterval"`
	FilterChangeReminderInterval int      `json:"filterChangeReminderInterval"`
	BrushChangeReminderInterval  int      `json:"brushChangeReminderInterval"`
	Clock24H                     bool     `json:"clock24h"`
	Locale                       string   `json:"locale"`
	AvailableLocales             []string `json:"availableLocales"`
	NavigationMode               int      `json:"navigationMode"`
	BoundaryID                   string   `json:"boundaryId"`
	SpotWidth                    int      `json:"spotWidth"`
	SpotHeight                   int      `json:"spotHeight"`
	Events                       []event  `json:"events"`
}

Params are values supplied to modify Nucleo requests. In some cases there are particular mandatory values. This varies between robots and software versions.

type Response

type Response struct {
	Version           int               `json:"version"`
	ReqID             reqID             `json:"reqId"`
	Result            string            `json:"result"`
	Data              data              `json:"data"`
	State             int               `json:"state,omitempty"`
	Action            int               `json:"action,omitempty"`
	Error             interface{}       `json:"error,omitempty"`
	Alert             string            `json:"alert,omitempty"`
	Cleaning          cleaning          `json:"cleaning,omitempty"`
	Details           details           `json:"details,omitempty"`
	AvailableCommands availableCommands `json:"availableCommands,omitempty"`
	AvailableServices availableServices `json:"availableServices,omitempty"`
	Meta              meta              `json:"meta,omitempty"`
}

Response combines the Standard Response and the State Response values

type Robot

type Robot struct {
	Serial      string    `json:"serial"`
	Prefix      string    `json:"prefix"`
	Name        string    `json:"name"`
	Model       string    `json:"model"`
	SecretKey   string    `json:"secret_key"`
	PurchasedAt time.Time `json:"purchased_at"`
	LinkedAt    time.Time `json:"linked_at"`
	Traits      []string  `json:"traits"`
}

A Robot corresponds to the data and controls for a physical robot

func (*Robot) DisableSchedule

func (r *Robot) DisableSchedule(a *Params) (*Response, error)

DisableSchedule disables the schedule on the Robot in question

func (*Robot) EnableSchedule

func (r *Robot) EnableSchedule(a *Params) (*Response, error)

EnableSchedule enables the schedule on the Robot in question

func (*Robot) FindMe

func (r *Robot) FindMe(a *Params) (*Response, error)

FindMe causes the Robot in question to emit an audible alert

func (*Robot) GetGeneralInfo

func (r *Robot) GetGeneralInfo(a *Params) (*Response, error)

GetGeneralInfo returns a variety of information about the Robot

func (*Robot) GetLocalStats

func (r *Robot) GetLocalStats(a *Params) (*Response, error)

GetLocalStats returns local statistics about the Robot in question

func (*Robot) GetMapBoundaries

func (r *Robot) GetMapBoundaries(a *Params) (*Response, error)

GetMapBoundaries returns the boundary parameters for the given Robot and Map

func (*Robot) GetPreferences

func (r *Robot) GetPreferences(a *Params) (*Response, error)

GetPreferences retrieves preferences for a Robot

func (*Robot) GetRobotInfo

func (r *Robot) GetRobotInfo(a *Params) (*Response, error)

GetRobotInfo returns information about that Robot

func (*Robot) GetRobotManualCleaningInfo

func (r *Robot) GetRobotManualCleaningInfo(a *Params) (*Response, error)

GetRobotManualCleaningInfo returns manual cleaning info for the given robot

func (*Robot) GetSchedule

func (r *Robot) GetSchedule(a *Params) (*Response, error)

GetSchedule returns details of the schedule for the Robot

func (*Robot) PauseCleaning

func (r *Robot) PauseCleaning(a *Params) (*Response, error)

PauseCleaning causes the Robot to stop cleaning

func (*Robot) ResumeCleaning

func (r *Robot) ResumeCleaning(a *Params) (*Response, error)

ResumeCleaning causes the Robot to resume a cleaning run

func (*Robot) SendToBase

func (r *Robot) SendToBase(a *Params) (*Response, error)

SendToBase sends the Robot back to the charging base

func (*Robot) SetMapBoundaries

func (r *Robot) SetMapBoundaries(a *Params) (*Response, error)

SetMapBoundaries sets boundary parameters for the given robot and Map

func (*Robot) SetPreferences

func (r *Robot) SetPreferences(a *Params) (*Response, error)

SetPreferences sets preferences for a Robot

func (*Robot) SetSchedule

func (r *Robot) SetSchedule(a *Params) (*Response, error)

SetSchedule sets the schedule on the Robot in question

func (*Robot) StartCleaning

func (r *Robot) StartCleaning(a *Params) (*Response, error)

StartCleaning makes the Robot begin a cleaning run with the supplied parameters

func (*Robot) StartPersistentMapExploration

func (r *Robot) StartPersistentMapExploration(a *Params) (*Response, error)

StartPersistentMapExploration sends the Robot on a new map exploration

func (*Robot) StopCleaning

func (r *Robot) StopCleaning(a *Params) (*Response, error)

StopCleaning causes the Robot to start cleaning

type Session

type Session struct {
	AccessToken string    `json:"access_token"`
	CurrentTime time.Time `json:"current_time"`
	// contains filtered or unexported fields
}

Session contains HTTP session data for use with the Neato Beehive API

func NewSession

func NewSession() (*Session, error)

NewSession generates a new Session for use with the Neato Beehive API

func (*Session) GetRobotMap

func (s *Session) GetRobotMap(robot, id string) (*Map, error)

GetRobotMap retrieves a particular Map from a specific Robot

func (*Session) GetUser

func (s *Session) GetUser() (*User, error)

GetUser returns the User for the account

func (*Session) ListRobotMaps

func (s *Session) ListRobotMaps(robot string) (*MapsResult, error)

ListRobotMaps returns the maps for the specified robot

func (*Session) ListRobotPersistentMaps

func (s *Session) ListRobotPersistentMaps(robot string) ([]Map, error)

ListRobotPersistentMaps returns the persistent maps for the specified Robot

func (*Session) ListRobots

func (s *Session) ListRobots() ([]Robot, error)

ListRobots returns the Robots for the account

func (*Session) Refresh

func (s *Session) Refresh() error

Refresh updates a *Session's authentication data

type User

type User struct {
	ID          string    `json:"id"`
	FirstName   string    `json:"first_name"`
	LastName    string    `json:"last_name"`
	Company     string    `json:"company"`
	Locale      string    `json:"locale"`
	PhoneNumber string    `json:"phone_number"`
	Street1     string    `json:"street_1"`
	Street2     string    `json:"street_2"`
	City        string    `json:"city"`
	PostCode    string    `json:"post_code"`
	Province    string    `json:"province"`
	StateRegion string    `json:"state_region"`
	CountryCode string    `json:"country_code"`
	Developer   bool      `json:"developer"`
	Email       string    `json:"email"`
	Newsletter  bool      `json:"newsletter"`
	CreatedAt   time.Time `json:"created_at"`
	VerifiedAt  time.Time `json:"verified_at"`
}

User is a user on the Neato systems with access to zero or more resources

Jump to

Keyboard shortcuts

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