gree

package
v0.0.0-...-ff864b5 Latest Latest
Warning

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

Go to latest
Published: Oct 12, 2022 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ECBDecrypt

func ECBDecrypt(crypted, key []byte) ([]byte, error)

func ECBEncrypt

func ECBEncrypt(src, key []byte) ([]byte, error)

func Encrypt

func Encrypt(output interface{}, key string) string

func PKCS5Padding

func PKCS5Padding(ciphertext []byte, blockSize int) []byte

func PKCS5UnPadding

func PKCS5UnPadding(origData []byte) ([]byte, error)

Types

type Air

type Air struct {
	Code  string         `json:"code"`
	Value map[string]int `json:"value"`
}

type Blow

type Blow struct {
	Code  string         `json:"code"`
	Value map[string]int `json:"value"`
}

type Command

type Command struct {
	Power           Power           `json:"power"`
	Mode            Mode            `json:"mode"`
	TemperatureUnit TemperatureUnit `json:"temperatureUnit"`
	Temperature     Temperature     `json:"temperature"`
	FanSpeed        FanSpeed        `json:"fanSpeed"`
	Air             Air             `json:"air"`
	Blow            Blow            `json:"blow"`
	Health          Health          `json:"health"`
	Sleep           Sleep           `json:"sleep"`
	Lights          Lights          `json:"lights"`
	SwingHor        SwingHor        `json:"swingHor"`
	SwingVert       SwingVert       `json:"swingVert"`
	Quiet           Quiet           `json:"quiet"`
	Turbo           Turbo           `json:"turbo"`
	PowerSave       PowerSave       `json:"powerSave"`
}

func Commands

func Commands() Command

type Device

type Device struct {
	Id      string
	Name    string
	Address string
	Port    int
	Bound   bool
	Props   map[string]int
	Key     string
}

type DeviceFactory

type DeviceFactory struct {
	Host        net.IP
	OnStatus    func(device *Device)
	OnUpdate    func(device *Device)
	OnConnected func()
	Conn        net.Conn
	Device      Device
}

func Create

func Create(option *DeviceFactory) *DeviceFactory

func (*DeviceFactory) ConnectToDevice

func (options *DeviceFactory) ConnectToDevice(address net.IP)

func (*DeviceFactory) SetAir

func (options *DeviceFactory) SetAir(value bool)

func (*DeviceFactory) SetBFCommand

func (options *DeviceFactory) SetBFCommand(comm []string, value []int)

func (*DeviceFactory) SetBlow

func (options *DeviceFactory) SetBlow(value bool)

func (*DeviceFactory) SetFanSpeed

func (options *DeviceFactory) SetFanSpeed(value int)

func (*DeviceFactory) SetHealthMode

func (options *DeviceFactory) SetHealthMode(value bool)

func (*DeviceFactory) SetLights

func (options *DeviceFactory) SetLights(value bool)

func (*DeviceFactory) SetMode

func (options *DeviceFactory) SetMode(value int)

func (*DeviceFactory) SetPower

func (options *DeviceFactory) SetPower(value bool)

func (*DeviceFactory) SetPowerSave

func (options *DeviceFactory) SetPowerSave(value bool)

func (*DeviceFactory) SetQuietMode

func (options *DeviceFactory) SetQuietMode(value int)

func (*DeviceFactory) SetSleepMode

func (options *DeviceFactory) SetSleepMode(value bool)

func (*DeviceFactory) SetSwingHor

func (options *DeviceFactory) SetSwingHor(value int)

func (*DeviceFactory) SetSwingVert

func (options *DeviceFactory) SetSwingVert(value int)

func (*DeviceFactory) SetTemperature

func (options *DeviceFactory) SetTemperature(value int, unit int)

SetTemperature /**

func (*DeviceFactory) SetTurbo

func (options *DeviceFactory) SetTurbo(value bool)

type DeviceInfo

type DeviceInfo struct {
	T       string   `json:"t"`
	Cid     string   `json:"cid"`
	Bc      string   `json:"bc"`
	Brand   string   `json:"brand"`
	Catalog string   `json:"catalog"`
	Mac     string   `json:"mac"`
	Mid     string   `json:"mid"`
	Model   string   `json:"model"`
	Name    string   `json:"name"`
	Lock    int      `json:"lock"`
	Series  string   `json:"series"`
	Vender  string   `json:"vender"`
	Ver     string   `json:"ver"`
	Key     string   `json:"key"`
	Dat     []int    `json:"dat"`
	Cols    []string `json:"cols"`
	Val     []int    `json:"val"`
	P       []int    `json:"p"`
	R       int      `json:"r"`
	Opt     []string `json:"opt"`
}

func Decrypt

func Decrypt(input UDPInfo, key string) DeviceInfo

type FanSpeed

type FanSpeed struct {
	Code  string         `json:"code"`
	Value map[string]int `json:"value"`
}

type Health

type Health struct {
	Code  string         `json:"code"`
	Value map[string]int `json:"value"`
}

type Lights

type Lights struct {
	Code  string         `json:"code"`
	Value map[string]int `json:"value"`
}

type Mode

type Mode struct {
	Code  string         `json:"code"`
	Value map[string]int `json:"value"`
}

type Power

type Power struct {
	Code  string         `json:"code"`
	Value map[string]int `json:"value"`
}

type PowerSave

type PowerSave struct {
	Code  string         `json:"code"`
	Value map[string]int `json:"value"`
}

type Quiet

type Quiet struct {
	Code  string         `json:"code"`
	Value map[string]int `json:"value"`
}

type Sleep

type Sleep struct {
	Code  string         `json:"code"`
	Value map[string]int `json:"value"`
}

type SwingHor

type SwingHor struct {
	Code  string         `json:"code"`
	Value map[string]int `json:"value"`
}

type SwingVert

type SwingVert struct {
	Code  string         `json:"code"`
	Value map[string]int `json:"value"`
}

type Temperature

type Temperature struct {
	Code string `json:"code"`
}

type TemperatureUnit

type TemperatureUnit struct {
	Code  string         `json:"code"`
	Value map[string]int `json:"value"`
}

type Turbo

type Turbo struct {
	Code  string         `json:"code"`
	Value map[string]int `json:"value"`
}

type UDPInfo

type UDPInfo struct {
	T    string `json:"t"`
	I    int    `json:"i"`
	Uid  int    `json:"uid"`
	Cid  string `json:"cid"`
	Tcid string `json:"tcid"`
	Pack string `json:"pack"`
}

type Value

type Value struct {
	Off int `json:"off"`
	On  int `json:"on"`
}

Jump to

Keyboard shortcuts

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