solarman

package module
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 8 Imported by: 3

README

go-solarman

Unnoficial Solarman Inverter API implementation in Go.

Only implements /token and /currentData endpoints for now.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func New

func New(appID, appSecret, email, password string) (*Client, error)

func (*Client) CurrentData

func (c *Client) CurrentData(inverterSN string) (CurrentData, error)

type CurrentData

type CurrentData struct {
	Code           any        `json:"code"`
	Msg            any        `json:"msg"`
	Success        bool       `json:"success"`
	RequestID      string     `json:"requestId"`
	DeviceSn       string     `json:"deviceSn"`
	DeviceID       int        `json:"deviceId"`
	DeviceType     string     `json:"deviceType"`
	DeviceState    int        `json:"deviceState"`
	CollectionTime int        `json:"collectionTime"`
	DataList       []DataList `json:"dataList"`
}

type DataList

type DataList struct {
	Key   string `json:"key"`
	Value string `json:"value"`
	Unit  any    `json:"unit"`
	Name  string `json:"name"`
}

Jump to

Keyboard shortcuts

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