ws

package
v0.0.0-...-d52d93c Latest Latest
Warning

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

Go to latest
Published: Apr 3, 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 Keys

type Keys map[string]string

type RequestConnect

type RequestConnect struct {
	Lang    string `json:"lang"`
	Token   string `json:"token"`
	Service string `json:"service"`
}

type RequestReal

type RequestReal struct {
	Lang       string `json:"lang"`
	Token      string `json:"token"`
	DevId      string `json:"dev_id"`
	Service    string `json:"service"`
	Time123456 int64  `json:"time123456"`
}

type ResponseConnect

type ResponseConnect struct {
	ResultCode int    `json:"result_code"`
	ResultMsg  string `json:"result_msg"`
	ResultData struct {
		Service     string
		Token       string
		Uid         int
		TipsDisable int `json:"tips_disable"`
	} `json:"result_data"`
}

type ResponseReal

type ResponseReal struct {
	ResultCode int    `json:"result_code"`
	ResultMsg  string `json:"result_msg"`
	ResultData struct {
		Service string
		List    []struct {
			DataName  string `json:"data_name"`
			DataValue string `json:"data_value"`
			DataUnit  string `json:"data_unit"`
		}
		Count int
	} `json:"result_data"`
}

type WS

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

func NewWS

func NewWS(ip net.IP, port int, path string) *WS

NewWS returns a new WS instance.

func (*WS) Battery

func (ws *WS) Battery(keyList Keys, separator string) (err error)

Battery fetches battery data from the inverter.

func (*WS) Close

func (ws *WS) Close()

Close closes the connection.

func (*WS) Connect

func (ws *WS) Connect() (err error)

Connect connects to the inverter using the WebSocket protocol.

func (*WS) Pv

func (ws *WS) Pv(keyList Keys, separator string) (err error)

Pv fetches pv data from the inverter.

Jump to

Keyboard shortcuts

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