myuplink

package
v0.0.0-...-b3f9fd8 Latest Latest
Warning

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

Go to latest
Published: Feb 17, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AuthToken

type AuthToken struct {
	AccessToken string `json:"access_token"`

	ExpiresIn float64 `json:"expires_in"`
	TokenType string  `json:"token_type"`
	Scope     string  `json:"scope"`
	// contains filtered or unexported fields
}

func (*AuthToken) IsExpired

func (t *AuthToken) IsExpired() bool

func (*AuthToken) Process

func (t *AuthToken) Process() *AuthToken

type Client

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

func NewClient

func NewClient(logger *zap.SugaredLogger) *Client

func (*Client) Connect

func (c *Client) Connect(ctx context.Context) error

func (*Client) GetSystemDeviceFirmware

func (c *Client) GetSystemDeviceFirmware(ctx context.Context, deviceId string) (*SystemDeviceFirmwareInfo, error)

func (*Client) GetSystemDevicePoints

func (c *Client) GetSystemDevicePoints(ctx context.Context, deviceId string) (*SystemDevicePoints, error)

func (*Client) GetSystems

func (c *Client) GetSystems(ctx context.Context) (*ResultSystems, error)

func (*Client) SetApiUrl

func (c *Client) SetApiUrl(val string)

func (*Client) SetAuth

func (c *Client) SetAuth(clientId, clientSecret string)

func (*Client) SetDebugMode

func (c *Client) SetDebugMode(val bool)

func (*Client) SetUserAgent

func (c *Client) SetUserAgent(val string)

type ResultSystems

type ResultSystems struct {
	Page         int `json:"page"`
	ItemsPerPage int `json:"itemsPerPage"`
	NumItems     int `json:"numItems"`
	Systems      []struct {
		SystemID      string         `json:"systemId"`
		Name          string         `json:"name"`
		SecurityLevel string         `json:"securityLevel"`
		HasAlarm      bool           `json:"hasAlarm"`
		Country       string         `json:"country"`
		Devices       []SystemDevice `json:"devices"`
	} `json:"systems"`
}

type SystemDevice

type SystemDevice struct {
	ID               string `json:"id"`
	ConnectionState  string `json:"connectionState"`
	CurrentFwVersion string `json:"currentFwVersion"`
	Product          struct {
		SerialNumber string `json:"serialNumber"`
		Name         string `json:"name"`
	} `json:"product"`
}

func (*SystemDevice) IsConnectionStateAllowed

func (d *SystemDevice) IsConnectionStateAllowed(allowedValues []string) bool

type SystemDeviceFirmwareInfo

type SystemDeviceFirmwareInfo struct {
	DeviceID         string `json:"deviceId"`
	FirmwareID       string `json:"firmwareId"`
	CurrentFwVersion string `json:"currentFwVersion"`
	PendingFwVersion string `json:"pendingFwVersion"`
	DesiredFwVersion string `json:"desiredFwVersion"`
}

type SystemDevicePoint

type SystemDevicePoint struct {
	Category            string    `json:"category"`
	ParameterID         string    `json:"parameterId"`
	ParameterName       string    `json:"parameterName"`
	ParameterUnit       string    `json:"parameterUnit"`
	Writable            bool      `json:"writable"`
	Timestamp           time.Time `json:"timestamp"`
	Value               *float64  `json:"value"`
	StrVal              string    `json:"strVal"`
	SmartHomeCategories []string  `json:"smartHomeCategories"`
	MinValue            float64   `json:"minValue"`
	MaxValue            float64   `json:"maxValue"`
	StepValue           float64   `json:"stepValue"`
	EnumValues          []struct {
		Value string `json:"value"`
		Text  string `json:"text"`
		Icon  string `json:"icon"`
	} `json:"enumValues"`
	ScaleValue string `json:"scaleValue"`
	ZoneID     string `json:"zoneId"`
}

type SystemDevicePoints

type SystemDevicePoints []SystemDevicePoint

Jump to

Keyboard shortcuts

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