niu

package
v0.0.0-...-499f9e9 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	AuthURI = "https://account-fk.niu.com"
	ApiURI  = "https://app-api-fk.niu.com"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Response

type Response struct {
	Data struct {
		IsCharging  int   `json:"isCharging,omitempty"`
		IsConnected bool  `json:"isConnected,omitempty"`
		Timestamp   int64 `json:"time,omitempty"`
		Batteries   struct {
			CompartmentA struct {
				BatteryCharging int64 `json:"batteryCharging,omitempty"`
			} `json:"compartmentA"`
		}
		// LeftTime         float32 `json:"leftTime,omitempty"`
		EstimatedMileage int64 `json:"estimatedMileage,omitempty"`
	}
}

Response is the Niu motor_data api response https://app-api-fk.niu.com/v3/motor_data/index_info?sn=<ScooterSerialNumber>

type Token

type Token oauth2.Token

https://account-fk.niu.com/v3/api/oauth2/token?account=<NiuUser>&app_id=niu_8xt1afu6&grant_type=password&password=<MD5PasswordHash>&scope=base

func (*Token) UnmarshalJSON

func (t *Token) UnmarshalJSON(data []byte) error

UnmarshalJSON decodes the token api response

Jump to

Keyboard shortcuts

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