api

package
v0.0.0-...-628bc9f Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Device

type Device struct {
	Device struct {
		ProductName        string   `json:"product_name"`
		Model              string   `json:"model"`
		DSN                string   `json:"dsn"`
		OEMModel           string   `json:"oem_model"`
		SWVersion          string   `json:"sw_version"`
		TemplateID         int      `json:"template_id"`
		MAC                string   `json:"mac"`
		UniqueHardwareID   *string  `json:"unique_hardware_id"` // Could be nil
		HWSig              string   `json:"hwsig"`
		LanIP              string   `json:"lan_ip"`
		ConnectedAt        string   `json:"connected_at"`
		Key                int      `json:"key"`
		LanEnabled         bool     `json:"lan_enabled"`
		ConnectionPriority []string `json:"connection_priority"`
		HasProperties      bool     `json:"has_properties"`
		ProductClass       *string  `json:"product_class"` // Could be nil
		ConnectionStatus   string   `json:"connection_status"`
		Lat                string   `json:"lat"`
		Lng                string   `json:"lng"`
		Locality           string   `json:"locality"`
		DeviceType         string   `json:"device_type"`
		Dealer             *string  `json:"dealer"` // Could be nil
		ManufModel         string   `json:"manuf_model"`
	} `json:"device"`
}

type OwletAPI

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

func NewOwletAPI

func NewOwletAPI(region, user, password string) (*OwletAPI, error)

func (*OwletAPI) Activate

func (api *OwletAPI) Activate(deviceSerial string) error

func (*OwletAPI) Authenticate

func (api *OwletAPI) Authenticate() error

func (*OwletAPI) CheckTokens

func (api *OwletAPI) CheckTokens(tempTokens TokenInfo) *TokenInfo

func (*OwletAPI) GetDevices

func (api *OwletAPI) GetDevices() (map[string]interface{}, error)

func (*OwletAPI) GetProperties

func (api *OwletAPI) GetProperties(deviceSerial string) (map[string]interface{}, error)

func (*OwletAPI) Tokens

func (api *OwletAPI) Tokens() TokenInfo

type OwletAuthenticationError

type OwletAuthenticationError struct{ OwletError }

func NewOwletAuthenticationError

func NewOwletAuthenticationError(message string) OwletAuthenticationError

type OwletConnectionError

type OwletConnectionError struct{ OwletError }

func NewOwletConnectionError

func NewOwletConnectionError(message string) OwletConnectionError

type OwletCredentialsError

type OwletCredentialsError struct{ OwletError }

func NewOwletCredentialsError

func NewOwletCredentialsError(message string) OwletCredentialsError

type OwletDevicesError

type OwletDevicesError struct{ OwletError }

type OwletEmailError

type OwletEmailError struct{ OwletError }

func NewOwletEmailError

func NewOwletEmailError(message string) OwletEmailError

type OwletError

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

func NewOwletError

func NewOwletError(message string) OwletError

func (OwletError) Error

func (e OwletError) Error() string

type OwletPasswordError

type OwletPasswordError struct{ OwletError }

func NewOwletPasswordError

func NewOwletPasswordError(message string) OwletPasswordError

type Property

type Property struct {
	Type             string      `json:"type"`
	Name             string      `json:"name"`
	BaseType         string      `json:"base_type"`
	ReadOnly         bool        `json:"read_only"`
	Direction        string      `json:"direction"`
	Scope            string      `json:"scope"`
	DataUpdatedAt    string      `json:"data_updated_at"`
	Key              int         `json:"key"`
	DeviceKey        int         `json:"device_key"`
	ProductName      string      `json:"product_name"`
	TrackOnlyChanges bool        `json:"track_only_changes"`
	DisplayName      string      `json:"display_name"`
	HostSwVersion    bool        `json:"host_sw_version"`
	TimeSeries       bool        `json:"time_series"`
	Derived          bool        `json:"derived"`
	AppType          *string     `json:"app_type"`
	Recipe           *string     `json:"recipe"`
	Value            interface{} `json:"value"`
	GeneratedFrom    *string     `json:"generated_from"`
	GeneratedAt      *string     `json:"generated_at"`
	DeniedRoles      []string    `json:"denied_roles"`
	AckEnabled       bool        `json:"ack_enabled"`
	RetentionDays    int         `json:"retention_days"`
	AckStatus        *string     `json:"ack_status"`
	AckMessage       *string     `json:"ack_message"`
	AckedAt          *string     `json:"acked_at"`
}

type PropertyMap

type PropertyMap struct {
	Property Property `json:"property"`
}

type RegionInfo

type RegionInfo struct {
	URLMini    string
	URLSignin  string
	URLRefresh string
	URLBase    string
	APIKey     string
	AppID      string
	AppSecret  string
}

type TokenInfo

type TokenInfo struct {
	APIToken string
	Expiry   time.Time
	Refresh  string
}

Jump to

Keyboard shortcuts

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