Updated MySubaru example script
This commit is contained in:
101
vehicle.go
101
vehicle.go
@ -380,41 +380,6 @@ func (v *Vehicle) HornStop() {
|
||||
|
||||
// ChargeStart .
|
||||
func (v *Vehicle) ChargeOn() {
|
||||
// {
|
||||
// "success": true,
|
||||
// "errorCode": null,
|
||||
// "dataName": "remoteServiceStatus",
|
||||
// "data": {
|
||||
// "serviceRequestId": "4S4BTGND8L3137058_1640542818241_31_@NGTP",
|
||||
// "success": false,
|
||||
// "cancelled": false,
|
||||
// "remoteServiceType": "phevChargeNow",
|
||||
// "remoteServiceState": "started",
|
||||
// "subState": null,
|
||||
// "errorCode": null,
|
||||
// "result": null,
|
||||
// "updateTime": null,
|
||||
// "vin": "4S4BTGND8L3137058"
|
||||
// }
|
||||
// }
|
||||
// {
|
||||
// "success": true,
|
||||
// "errorCode": null,
|
||||
// "dataName": "remoteServiceStatus",
|
||||
// "data": {
|
||||
// "serviceRequestId": "4S4BTGND8L3137058_1640542818241_31_@NGTP",
|
||||
// "success": false,
|
||||
// "cancelled": false,
|
||||
// "remoteServiceType": "phevChargeNow",
|
||||
// "remoteServiceState": "finished",
|
||||
// "subState": null,
|
||||
// "errorCode": "NegativeAcknowledge:unknown",
|
||||
// "result": null,
|
||||
// "updateTime": 1640542824000,
|
||||
// "vin": "4S4BTGND8L3137058"
|
||||
// }
|
||||
// }
|
||||
|
||||
if v.isEV() {
|
||||
v.selectVehicle()
|
||||
params := map[string]string{
|
||||
@ -430,46 +395,6 @@ func (v *Vehicle) ChargeOn() {
|
||||
// GetLocation .
|
||||
func (v *Vehicle) GetLocation(force bool) {
|
||||
if force { // Sends a locate command to the vehicle to get real time position
|
||||
// {
|
||||
// "success": true,
|
||||
// "errorCode": null,
|
||||
// "dataName": "remoteServiceStatus",
|
||||
// "data": {
|
||||
// "serviceRequestId": "4S4BTGND8L3137058_1640454589498_11_@NGTP",
|
||||
// "success": false,
|
||||
// "cancelled": false,
|
||||
// "remoteServiceType": "vehicleStatus",
|
||||
// "remoteServiceState": "started",
|
||||
// "subState": null,
|
||||
// "errorCode": null,
|
||||
// "result": null,
|
||||
// "updateTime": 1640454589000,
|
||||
// "vin": "4S4BTGND8L3137058"
|
||||
// }
|
||||
// }
|
||||
// {
|
||||
// "success": true,
|
||||
// "errorCode": null,
|
||||
// "dataName": "remoteServiceStatus",
|
||||
// "data": {
|
||||
// "serviceRequestId": null,
|
||||
// "success": true,
|
||||
// "cancelled": false,
|
||||
// "remoteServiceType": "locate",
|
||||
// "remoteServiceState": "finished",
|
||||
// "subState": null,
|
||||
// "errorCode": null,
|
||||
// "result": {
|
||||
// "latitude": 40.700294,
|
||||
// "longitude": -74.401344,
|
||||
// "speed": 0,
|
||||
// "heading": 189,
|
||||
// "timestamp": 1640454600000
|
||||
// },
|
||||
// "updateTime": null,
|
||||
// "vin": "4S4BTGND8L3137058"
|
||||
// }
|
||||
// }
|
||||
v.selectVehicle()
|
||||
reqURL := MOBILE_API_VERSION + apiURLs["API_G2_LOCATE_UPDATE"]
|
||||
pollingURL := MOBILE_API_VERSION + apiURLs["API_G2_LOCATE_STATUS"]
|
||||
@ -482,29 +407,6 @@ func (v *Vehicle) GetLocation(force bool) {
|
||||
}
|
||||
v.client.execute(reqURL, POST, params, pollingURL, true)
|
||||
} else { // Reports the last location the vehicle has reported to Subaru
|
||||
// {
|
||||
// "success": true,
|
||||
// "errorCode": null,
|
||||
// "dataName": "remoteServiceStatus",
|
||||
// "data": {
|
||||
// "serviceRequestId": null,
|
||||
// "success": true,
|
||||
// "cancelled": false,
|
||||
// "remoteServiceType": "locate",
|
||||
// "remoteServiceState": "finished",
|
||||
// "subState": null,
|
||||
// "errorCode": null,
|
||||
// "result": {
|
||||
// "latitude": 40.700203,
|
||||
// "longitude": -74.40142,
|
||||
// "speed": 0,
|
||||
// "heading": 156,
|
||||
// "timestamp": 1642526388000
|
||||
// },
|
||||
// "updateTime": null,
|
||||
// "vin": "4S4BTGND8L3137058"
|
||||
// }
|
||||
// }
|
||||
v.selectVehicle()
|
||||
params := map[string]string{
|
||||
"vin": v.Vin,
|
||||
@ -517,9 +419,6 @@ func (v *Vehicle) GetLocation(force bool) {
|
||||
// GetClimateQuickPresets .
|
||||
func (v *Vehicle) GetClimateQuickPresets() {
|
||||
if v.getRemoteOptionsStatus() {
|
||||
// params := map[string]string{
|
||||
// "vin": v.Vin,
|
||||
// "pin": v.Client.credentials.PIN}
|
||||
v.selectVehicle()
|
||||
reqURL := MOBILE_API_VERSION + apiURLs["API_G2_FETCH_RES_QUICK_START_SETTINGS"]
|
||||
resp := v.client.execute(reqURL, GET, map[string]string{}, "", false)
|
||||
|
Reference in New Issue
Block a user