ringo

package module
v0.0.0-...-34e810e Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2019 License: MIT Imports: 11 Imported by: 0

README

Ringo

Documentation license

Documentation

Overview

Package ringo provides an unofficial client to the unpublished Ring API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	APIVersion int
	Username   string `mapstructure:"username"`
	Password   string `mapstructure:"password"`
	Token      string `json:"authentication_token"`
}

Config collects a number of parameters. A nil *Config is valid but will result in the inability to connect.

type DeviceHealth

type DeviceHealth struct {
	ID                        int64       `json:"id,omitempty"`
	WifiName                  string      `json:"wifi_name,omitempty"`
	BatteryPercentage         batteryLife `json:"battery_percentage,omitempty"`
	BatteryPercentageCategory string      `json:"battery_percentage_category,omitempty"`
	BatteryVoltage            batteryLife `json:"battery_voltage,omitempty"`
	BatteryVoltageCategory    string      `json:"battery_voltage_category,omitempty"`
	LatestSignalStrength      int64       `json:"latest_signal_strength,omitempty"`
	LatestSignalCategory      string      `json:"latest_signal_category,omitempty"`
	AverageSignalStrength     int64       `json:"average_signal_strength,omitempty"`
	AverageSignalCategory     string      `json:"average_signal_category,omitempty"`
	Firmware                  string      `json:"firmware,omitempty"`
	UpdatedAt                 time.Time   `json:"updated_at,omitempty"`
	WifiIsRingNetwork         bool        `json:"wifi_is_ring_network,omitempty"`
	PacketLossCategory        string      `json:"packet_loss_category,omitempty"`
	PacketLossStrength        int64       `json:"packet_loss_strength,omitempty"`
}

DeviceHealth contains the health of a device.

type Devices

type Devices struct {
	Doorbots    []*device `json:"doorbots,omitempty"`
	StickupCams []*device `json:"stickup_cams,omitempty"`
}

Devices contains lists of different devices.

type Ringo

type Ringo struct {
	BaseURL *url.URL
	Client  *http.Client
	Config  *Config
}

Ringo is used to make requests to the unpublished Ring API.

func NewRingo

func NewRingo(baseURL *url.URL, client *http.Client, config *Config) *Ringo

NewRingo constructs a new Ringo which can make requests to the unpublished Ring API.

func (*Ringo) Authenticate

func (r *Ringo) Authenticate() error

Authenticate sets token based on login information.

func (*Ringo) Devices

func (r *Ringo) Devices() (*Devices, error)

Devices returns all devices connected to logged in account.

func (*Ringo) Health

func (r *Ringo) Health(id int64) (*DeviceHealth, error)

Health returns the health of a device from it's ID.

Jump to

Keyboard shortcuts

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