Some updates
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
package mysubaru
|
||||
|
||||
// Lastest version /g2v27
|
||||
var MOBILE_API_VERSION = "/g2v30"
|
||||
|
||||
var MOBILE_API_SERVER = map[string]string{
|
||||
@ -25,6 +24,9 @@ var apiURLs = map[string]string{
|
||||
"WEB_API_NAME_DEVICE": "/profile/addDeviceName.json",
|
||||
"WEB_API_EDIT_NAME_DEVICE": "/profile/editDeviceName.json",
|
||||
"WEB_API_VERIFY_NAME_DEVICE": "/profile/verifyDeviceName.json",
|
||||
"API_2FA_CONTACT": "/twoStepAuthContacts.json",
|
||||
"API_2FA_SEND_VERIFICATION": "/twoStepAuthSendVerification.json",
|
||||
"API_2FA_AUTH_VERIFY": "/twoStepAuthVerify.json",
|
||||
"API_LOGIN": "/login.json", // Same API for g1 and g2
|
||||
"API_REFRESH_VEHICLES": "/refreshVehicles.json",
|
||||
"API_SELECT_VEHICLE": "/selectVehicle.json",
|
||||
@ -58,16 +60,13 @@ var apiURLs = map[string]string{
|
||||
"API_G2_REMOTE_ENGINE_START": "/service/g2/engineStart/execute.json",
|
||||
"API_G2_REMOTE_ENGINE_START_CANCEL": "/service/g2/engineStart/cancel.json",
|
||||
"API_G2_REMOTE_ENGINE_STOP": "/service/g2/engineStop/execute.json",
|
||||
|
||||
"API_G2_FETCH_CLIMATE_SETTINGS": "/service/g2/remoteEngineStart/fetch.json",
|
||||
"API_G2_SAVE_CLIMATE_SETTINGS": "/service/g2/remoteEngineStart/save.json",
|
||||
|
||||
"API_G2_FETCH_RES_QUICK_START_SETTINGS": "/service/g2/remoteEngineQuickStartSettings/fetch.json",
|
||||
"API_G2_FETCH_RES_USER_PRESETS": "/service/g2/remoteEngineStartSettings/fetch.json",
|
||||
"API_G2_FETCH_RES_SUBARU_PRESETS": "/service/g2/climatePresetSettings/fetch.json",
|
||||
"API_G2_SAVE_RES_SETTINGS": "/service/g2/remoteEngineStartSettings/save.json",
|
||||
"API_G2_SAVE_RES_QUICK_START_SETTINGS": "/service/g2/remoteEngineQuickStartSettings/save.json",
|
||||
|
||||
"API_EV_CHARGE_NOW": "/service/g2/phevChargeNow/execute.json", // EV-Only API
|
||||
"API_EV_FETCH_CHARGE_SETTINGS": "/service/g2/phevGetTimerSettings/execute.json",
|
||||
"API_EV_SAVE_CHARGE_SETTINGS": "/service/g2/phevSendTimerSetting/execute.json",
|
||||
|
@ -1,15 +1,14 @@
|
||||
mysubaru:
|
||||
credentials:
|
||||
username: user@email.com
|
||||
password: "Secr#TPassW0rd"
|
||||
pin: "PIN"
|
||||
deviceId: GENERATE-DEVICE-ID
|
||||
deviceName: Golang Integration
|
||||
mysubaru:
|
||||
deviceid: GENERATE-DEVICE-ID
|
||||
devicename: Golang Integration
|
||||
region: USA
|
||||
mqtt:
|
||||
client_id: mysubaru
|
||||
username: mysubaru
|
||||
password:
|
||||
host: mqtt.hostname.com
|
||||
port: 1883
|
||||
log: info
|
||||
auto_reconnect: true
|
||||
timezone: "America/New_York"
|
||||
logging:
|
||||
level: INFO
|
||||
output: json
|
||||
source: false
|
||||
|
@ -2,7 +2,7 @@ module example
|
||||
|
||||
go 1.24
|
||||
|
||||
require git.savin.nyc/alex/mysubaru v0.0.0-20250520200227-71e00595ca48
|
||||
require git.savin.nyc/alex/mysubaru v0.0.0-20250520201343-455e885a2cf3
|
||||
|
||||
require (
|
||||
github.com/Jeffail/gabs/v2 v2.7.0 // indirect
|
||||
|
1
go.mod
1
go.mod
@ -3,7 +3,6 @@ module git.savin.nyc/alex/mysubaru
|
||||
go 1.24
|
||||
|
||||
require (
|
||||
github.com/Jeffail/gabs v1.4.0
|
||||
github.com/Jeffail/gabs/v2 v2.7.0
|
||||
github.com/go-resty/resty/v2 v2.16.5
|
||||
github.com/sirupsen/logrus v1.9.3
|
||||
|
34
vehicle.go
34
vehicle.go
@ -12,26 +12,26 @@ import (
|
||||
)
|
||||
|
||||
var parts = map[string]map[string][]string{
|
||||
"door": map[string][]string{
|
||||
"suffix": []string{"position", "status"},
|
||||
"position1": []string{"front", "rear", "boot", "enginehood"},
|
||||
"position2": []string{"right", "left"},
|
||||
"door": {
|
||||
"suffix": {"position", "status"},
|
||||
"position1": {"front", "rear", "boot", "enginehood"},
|
||||
"position2": {"right", "left"},
|
||||
},
|
||||
"window": map[string][]string{
|
||||
"suffix": []string{"status"},
|
||||
"position1": []string{"front", "rear", "sunroof"},
|
||||
"position2": []string{"right", "left"},
|
||||
"window": {
|
||||
"suffix": {"status"},
|
||||
"position1": {"front", "rear", "sunroof"},
|
||||
"position2": {"right", "left"},
|
||||
},
|
||||
"tire": map[string][]string{
|
||||
"prefix": []string{"status"},
|
||||
"position1": []string{"front", "rear"},
|
||||
"position2": []string{"right", "left"},
|
||||
"tire": {
|
||||
"prefix": {"status"},
|
||||
"position1": {"front", "rear"},
|
||||
"position2": {"right", "left"},
|
||||
},
|
||||
"tyre": map[string][]string{
|
||||
"prefix": []string{"pressure"},
|
||||
"suffix": []string{"psi", "unit"},
|
||||
"position1": []string{"front", "rear"},
|
||||
"position2": []string{"right", "left"},
|
||||
"tyre": {
|
||||
"prefix": {"pressure"},
|
||||
"suffix": {"psi", "unit"},
|
||||
"position1": {"front", "rear"},
|
||||
"position2": {"right", "left"},
|
||||
},
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user