tapogo

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2023 License: Apache-2.0 Imports: 18 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PKCS7Padding

func PKCS7Padding(data []byte) []byte

func PKCS7Unpadding

func PKCS7Unpadding(data []byte) ([]byte, error)

Types

type HandshakeData

type HandshakeData struct {
	LocalSeed          []byte // OK
	RemoteSeed         []byte // OK
	AuthHash           []byte // OK
	RemoteSeedAuthHash []byte // OK

	Cookies []*http.Cookie         // OK
	Session *KlapEncryptionSession // OK

	EncodedCredentialsLocalSeed []byte // TODO REVIEW
}

HandshakeData represents TODO

type KlapEncryptionSession

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

KlapEncryptionSession representa una sesión de cifrado y su estado interno.

func NewKlapEncryptionSession

func NewKlapEncryptionSession(localSeed, remoteSeed, userHash string) *KlapEncryptionSession

NewKlapEncryptionSession crea una nueva instancia de KlapEncryptionSession.

type Tapo

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

func NewTapo

func NewTapo(ip, email, password string, options *TapoOptions) (*Tapo, error)

func (*Tapo) DeviceInfo

func (d *Tapo) DeviceInfo() (response *types.ResponseSpec, err error)

DeviceInfo TODO

func (*Tapo) GenerateAuthHashV2

func (d *Tapo) GenerateAuthHashV2() []byte

GenerateAuthHashV2 TODO

func (*Tapo) GenerateSeedAuthHash

func (d *Tapo) GenerateSeedAuthHash(localSeed []byte, remoteSeed []byte, authHash []byte, handshakeStage int) []byte

GenerateSeedAuthHash TODO

func (*Tapo) GetEnergyUsage

func (d *Tapo) GetEnergyUsage() (response *types.ResponseSpec, err error)

GetEnergyUsage TODO

func (*Tapo) Handshake

func (d *Tapo) Handshake() error

Handshake TODO

func (*Tapo) Handshake1

func (d *Tapo) Handshake1() (handshakeData HandshakeData, err error)

Handshake1 TODO

func (*Tapo) Handshake2

func (d *Tapo) Handshake2(handshakeData *HandshakeData) error

Handshake2 TODO

func (*Tapo) PerformRequest

func (d *Tapo) PerformRequest(request *types.RequestSpec) (response *types.ResponseSpec, err error)

PerformRequest TODO

func (*Tapo) TurnOff

func (d *Tapo) TurnOff() (response *types.ResponseSpec, err error)

TurnOff TODO

func (*Tapo) TurnOn

func (d *Tapo) TurnOn() (response *types.ResponseSpec, err error)

TurnOn TODO

type TapoOptions added in v0.2.0

type TapoOptions struct {
	// HandshakeDelay represents number of seconds to wait after a handshake operation is done
	// Higher amounts are more reliable as device is incredible slow performing authorization internally
	HandshakeDelayDuration time.Duration
}

Jump to

Keyboard shortcuts

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