-
Notifications
You must be signed in to change notification settings - Fork 1
/
structs.go
125 lines (115 loc) · 4.89 KB
/
structs.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
package envoy
type LoginResponse struct {
Message string `json:"message"`
SessionId string `json:"session_id"`
ManagerToken string `json:"manager_token"`
IsConsumer bool `json:"is_consumer"`
}
type ProductionResponse struct {
Production []Measurement `json:"production"`
Consumption []Measurement `json:"consumption"`
Storage []Storage `json:"storage"`
}
type Storage struct {
Type string `json:"type"`
ActiveCount int `json:"activeCount"`
ReadingTime int `json:"readingTime"`
WNow float64 `json:"wNow"`
WhNow float64 `json:"whNow"`
State string `json:"state"`
}
type Measurement struct {
Type string `json:"type"`
ActiveCount int `json:"activeCount"`
ReadingTime int `json:"readingTime"`
WNow float64 `json:"wNow"`
WhLifetime float64 `json:"whLifetime"`
MeasurementType string `json:"measurementType,omitempty"`
VarhLeadLifetime float64 `json:"varhLeadLifetime,omitempty"`
VarhLagLifetime float64 `json:"varhLagLifetime,omitempty"`
VahLifetime float64 `json:"vahLifetime,omitempty"`
RmsCurrent float64 `json:"rmsCurrent,omitempty"`
RmsVoltage float64 `json:"rmsVoltage,omitempty"`
ReactPwr float64 `json:"reactPwr,omitempty"`
ApprntPwr float64 `json:"apprntPwr,omitempty"`
PwrFactor float64 `json:"pwrFactor,omitempty"`
WhToday float64 `json:"whToday,omitempty"`
WhLastSevenDays float64 `json:"whLastSevenDays,omitempty"`
VahToday float64 `json:"vahToday,omitempty"`
VarhLeadToday float64 `json:"varhLeadToday,omitempty"`
VarhLagToday float64 `json:"varhLagToday,omitempty"`
Lines []Line `json:"lines,omitempty"`
}
type Line struct {
WNow float64 `json:"wNow"`
WhLifetime float64 `json:"whLifetime"`
VarhLeadLifetime float64 `json:"varhLeadLifetime"`
VarhLagLifetime float64 `json:"varhLagLifetime"`
VahLifetime float64 `json:"vahLifetime"`
RmsCurrent float64 `json:"rmsCurrent"`
RmsVoltage float64 `json:"rmsVoltage"`
ReactPwr float64 `json:"reactPwr"`
ApprntPwr float64 `json:"apprntPwr"`
PwrFactor float64 `json:"pwrFactor"`
WhToday float64 `json:"whToday"`
WhLastSevenDays float64 `json:"whLastSevenDays"`
VahToday float64 `json:"vahToday"`
VarhLeadToday float64 `json:"varhLeadToday"`
VarhLagToday float64 `json:"varhLagToday"`
}
type TokenResponse struct {
GenerationTime int64 `json:"generation_time"`
Token string `json:"token"`
ExpiresAt int64 `json:"expires_at"`
}
type Inverter struct {
SerialNumber string `json:"serialNumber"`
LastReportDate int `json:"lastReportDate"`
DevType int `json:"devType"`
LastReportWatts int `json:"lastReportWatts"`
MaxReportWatts int `json:"maxReportWatts"`
}
type CommCheckResponse map[string]int
type DiscoverResponse struct {
IPV4 string
IPV6 string
Serial string
ProtoVersion string
}
type InventoryResponse []struct {
Batteries []Battery `json:"devices"`
Type string `json:"type"`
}
type Battery struct {
EnchgGridMode string `json:"Enchg_grid_mode,omitempty"`
EnpwrCurrStateID int `json:"Enpwr_curr_state_id,omitempty"`
EnpwrGridMode string `json:"Enpwr_grid_mode,omitempty"`
EnpwrRelayStateBm int `json:"Enpwr_relay_state_bm,omitempty"`
AdminState int `json:"admin_state"`
AdminStateStr string `json:"admin_state_str"`
BmuFwVersion string `json:"bmu_fw_version,omitempty"`
CommLevel24Ghz int `json:"comm_level_2_4_ghz"`
CommLevelSubGhz int `json:"comm_level_sub_ghz"`
Communicating bool `json:"communicating"`
CreatedDate int `json:"created_date"`
DcSwitchOff bool `json:"dc_switch_off"`
DerIndex int `json:"der_index,omitempty"`
DeviceStatus []string `json:"device_status"`
EnchargeCapacity int `json:"encharge_capacity,omitempty"`
EnchargeRev int `json:"encharge_rev,omitempty"`
ImgLoadDate int `json:"img_load_date"`
ImgPnumRunning string `json:"img_pnum_running"`
Installed int `json:"installed"`
LastRptDate int `json:"last_rpt_date"`
LedStatus int `json:"led_status,omitempty"`
MainsAdminState string `json:"mains_admin_state,omitempty"`
MainsOperState string `json:"mains_oper_state,omitempty"`
MaxCellTemp int `json:"maxCellTemp,omitempty"`
PartNum string `json:"part_num"`
PercentFull int `json:"percentFull,omitempty"`
Phase string `json:"phase,omitempty"`
ReportedEncGridState string `json:"reported_enc_grid_state,omitempty"`
SerialNum string `json:"serial_num"`
SleepEnabled bool `json:"sleep_enabled"`
Temperature int `json:"temperature"`
}