pairing

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: May 12, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package pairing for Device Pairing.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceRequest

type DeviceRequest struct {
	ParingType string           `url:"-" validate:"required" json:"paring_type"`  // paring type,support BLE, AP, EZ
	UID        string           `url:"-" validate:"required" json:"uid"`          // Tuya user id
	TimeZoneID string           `url:"-" validate:"required" json:"time_zone_id"` // User's time zone id, device needs for daylight saving time
	HomeID     string           `url:"-" json:"home_id"`                          // Home id . If empty ,default user home
	Extension  RequestExtension `url:"-" json:"extension"`                        // extension, the paring type is BLE and the device UUID is passed in
}

func (*DeviceRequest) Method

func (s *DeviceRequest) Method() string

Method for Request.Method()

func (*DeviceRequest) URL

func (s *DeviceRequest) URL() string

URL for Request.URL()

type DeviceResponse

type DeviceResponse struct {
	ExpireTime int64             `json:"expire_time"` // Token expiration time
	Region     string            `json:"region"`      // Current region, support:AY EU US
	Token      string            `json:"token"`       // paring token
	Secret     string            `json:"secret"`      // secret
	Extension  ResponseExtension `json:"extension"`   // extension
}

type QueryPairingDeviceListRequest

type QueryPairingDeviceListRequest struct {
	Token string `url:"-" validate:"required" json:"-"` // device paring token
}

func (*QueryPairingDeviceListRequest) Method

Method for Request.Method()

func (*QueryPairingDeviceListRequest) URL

URL for Request.URL()

type QueryPairingDeviceListResponse

type QueryPairingDeviceListResponse struct {
	Failed []struct {
		DeviceID string `json:"device_id"` // Device id
		Code     string `json:"code"`      // errorCode
		Msg      string `json:"msg"`       // errorMsg
		Name     string `json:"name"`      // Device name
	} `json:"failed"`
	Success []struct {
		Category  string `json:"category"`   // Device category
		DeviceID  string `json:"device_id"`  // Device id
		Name      string `json:"name"`       // Device name
		ProductID string `json:"product_id"` // Product id
	} `json:"success"`
}

type RequestExtension

type RequestExtension struct {
	UUID string `url:"-" json:"uuid"`
}

type ResponseExtension

type ResponseExtension struct {
	EncryptKey string `json:"encrypt_key"` // encrypt key
	Random     string `json:"random"`      // Encrypted string
}

type ZigbeeGatewayPairedListRequest

type ZigbeeGatewayPairedListRequest struct {
	DeviceID string `url:"-" validate:"required" json:"-"` // Device id
}

func (*ZigbeeGatewayPairedListRequest) Method

Method for Request.Method()

func (*ZigbeeGatewayPairedListRequest) URL

URL for Request.URL()

type ZigbeeGatewayPairedListResponse

type ZigbeeGatewayPairedListResponse struct {
	ID         string `json:"id"`          // Device id
	ProductID  string `json:"product_id"`  // Product id
	OwnerID    string `json:"owner_id"`    // Home id
	Online     bool   `json:"online"`      // Device online state
	Name       string `json:"name"`        // Device name
	UpdateTime int64  `json:"update_time"` // Update time
	ActiveTime int64  `json:"active_time"` // Last active time
	Category   string `json:"category"`    // Category
}

type ZigbeeGatewayPairingListRequest

type ZigbeeGatewayPairingListRequest struct {
	DeviceID      string `url:"-" validate:"required" json:"-"`              // gateway ID
	DiscoveryTime int64  `url:"discovery_time" validate:"required" json:"-"` // Gateway enabled time
}

func (*ZigbeeGatewayPairingListRequest) Method

Method for Request.Method()

func (*ZigbeeGatewayPairingListRequest) URL

URL for Request.URL()

type ZigbeeGatewayPairingListResponse

type ZigbeeGatewayPairingListResponse struct {
	ID         string `json:"id"`          // Device id
	Category   string `json:"category"`    // Category
	ProductID  string `json:"product_id"`  // Product id
	UUID       string `json:"uuid"`        // Device chip id
	OwnerID    string `json:"owner_id"`    // Home id
	Online     bool   `json:"online"`      // Device online state
	ActiveTime int64  `json:"active_time"` // Active time
	UpdateTime int64  `json:"update_time"` // Device update time
}

type ZigbeeGatewayPairingRequest

type ZigbeeGatewayPairingRequest struct {
	DeviceID string `url:"-" validate:"required" json:"-"` // device ID
	Duration int    `url:"duration" json:"-"`              // Gateway discovery time, default 100 seconds, maximum 3600 seconds , 0: stop discovery
}

func (*ZigbeeGatewayPairingRequest) Method

func (s *ZigbeeGatewayPairingRequest) Method() string

Method for Request.Method()

func (*ZigbeeGatewayPairingRequest) URL

URL for Request.URL()

type ZigbeeGatewayPairingResponse

type ZigbeeGatewayPairingResponse bool

Jump to

Keyboard shortcuts

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