-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathevcc-tesla-proxy-0.124.10.patch
More file actions
126 lines (106 loc) · 3.63 KB
/
evcc-tesla-proxy-0.124.10.patch
File metadata and controls
126 lines (106 loc) · 3.63 KB
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
126
*** evcc/vehicle/tesla.go 2024-02-24 08:34:28.285811074 +0800
--- evcc/vehicle/tesla.go.new 2024-02-24 08:36:39.811461111 +0800
***************
*** 8,14 ****
"github.com/evcc-io/evcc/api"
"github.com/evcc-io/evcc/util"
"github.com/evcc-io/evcc/util/request"
! "github.com/evcc-io/evcc/util/sponsor"
"github.com/evcc-io/evcc/util/transport"
"github.com/evcc-io/evcc/vehicle/tesla"
teslaclient "github.com/evcc-io/tesla-proxy-client"
--- 8,14 ----
"github.com/evcc-io/evcc/api"
"github.com/evcc-io/evcc/util"
"github.com/evcc-io/evcc/util/request"
! // "github.com/evcc-io/evcc/util/sponsor"
"github.com/evcc-io/evcc/util/transport"
"github.com/evcc-io/evcc/vehicle/tesla"
teslaclient "github.com/evcc-io/tesla-proxy-client"
***************
*** 98,104 ****
pc := request.NewClient(log)
pc.Transport = &transport.Decorator{
Decorator: transport.DecorateHeaders(map[string]string{
! "X-Auth-Token": sponsor.Token,
}),
Base: hc.Transport,
}
--- 98,104 ----
pc := request.NewClient(log)
pc.Transport = &transport.Decorator{
Decorator: transport.DecorateHeaders(map[string]string{
! "X-Auth-Token": "gibberish",
}),
Base: hc.Transport,
}
*** evcc/vehicle/tesla/controller.go 2024-02-24 08:34:28.285811074 +0800
--- evcc/vehicle/tesla/controller.go.new 2024-02-24 08:37:31.033663961 +0800
***************
*** 5,15 ****
"slices"
"github.com/evcc-io/evcc/api"
! "github.com/evcc-io/evcc/util/sponsor"
"github.com/evcc-io/tesla-proxy-client"
)
! const ProxyBaseUrl = "https://tesla.evcc.io"
type Controller struct {
vehicle *tesla.Vehicle
--- 5,15 ----
"slices"
"github.com/evcc-io/evcc/api"
! // "github.com/evcc-io/evcc/util/sponsor"
"github.com/evcc-io/tesla-proxy-client"
)
! const ProxyBaseUrl = "https://%%TESLAPROXY%%"
type Controller struct {
vehicle *tesla.Vehicle
***************
*** 27,35 ****
// StartCharge implements the api.VehicleChargeController interface
func (v *Controller) MaxCurrent(current int64) error {
! if !sponsor.IsAuthorized() {
! return api.ErrSponsorRequired
! }
return apiError(v.vehicle.SetChargingAmps(int(current)))
}
--- 27,35 ----
// StartCharge implements the api.VehicleChargeController interface
func (v *Controller) MaxCurrent(current int64) error {
! // if !sponsor.IsAuthorized() {
! // return api.ErrSponsorRequired
! // }
return apiError(v.vehicle.SetChargingAmps(int(current)))
}
***************
*** 38,46 ****
// StartCharge implements the api.VehicleChargeController interface
func (v *Controller) StartCharge() error {
! if !sponsor.IsAuthorized() {
! return api.ErrSponsorRequired
! }
err := apiError(v.vehicle.StartCharging())
if err != nil && slices.Contains([]string{"complete", "is_charging"}, err.Error()) {
--- 38,46 ----
// StartCharge implements the api.VehicleChargeController interface
func (v *Controller) StartCharge() error {
! // if !sponsor.IsAuthorized() {
! // return api.ErrSponsorRequired
! // }
err := apiError(v.vehicle.StartCharging())
if err != nil && slices.Contains([]string{"complete", "is_charging"}, err.Error()) {
***************
*** 51,59 ****
// StopCharge implements the api.VehicleChargeController interface
func (v *Controller) StopCharge() error {
! if !sponsor.IsAuthorized() {
! return api.ErrSponsorRequired
! }
err := apiError(v.vehicle.StopCharging())
--- 51,59 ----
// StopCharge implements the api.VehicleChargeController interface
func (v *Controller) StopCharge() error {
! // if !sponsor.IsAuthorized() {
! // return api.ErrSponsorRequired
! // }
err := apiError(v.vehicle.StopCharging())