Rename SoC to Soc and LoadPoint to Loadpoint (#5549)

This commit is contained in:
andig 2022-12-23 10:19:23 +01:00 • committed by GitHub
parent 54f204c0f8
commit 03d6d1418a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
165 changed files with 1054 additions and 1032 deletions

View file

@ -55,8 +55,8 @@ type ActionConfig struct {
Mode *ChargeMode `mapstructure:"mode,omitempty"` // Charge Mode
MinCurrent *float64 `mapstructure:"minCurrent,omitempty"` // Minimum Current
MaxCurrent *float64 `mapstructure:"maxCurrent,omitempty"` // Maximum Current
MinSoC *int `mapstructure:"minSoC,omitempty"` // Minimum SoC
TargetSoC *int `mapstructure:"targetSoC,omitempty"` // Target SoC
MinSoc *int `mapstructure:"minSoc,omitempty"` // Minimum Soc
TargetSoc *int `mapstructure:"targetSoc,omitempty"` // Target Soc
}
// Merge merges all non-nil properties of the additional config into the base config.
@ -71,11 +71,11 @@ func (a ActionConfig) Merge(m ActionConfig) ActionConfig {
if m.MaxCurrent != nil {
a.MaxCurrent = m.MaxCurrent
}
if m.MinSoC != nil {
a.MinSoC = m.MinSoC
if m.MinSoc != nil {
a.MinSoc = m.MinSoc
}
if m.TargetSoC != nil {
a.TargetSoC = m.TargetSoC
if m.TargetSoc != nil {
a.TargetSoc = m.TargetSoc
}
return a
}
@ -107,9 +107,9 @@ type MeterCurrent interface {
Currents() (float64, float64, float64, error)
}
// Battery is able to provide battery SoC in %
// Battery is able to provide battery Soc in %
type Battery interface {
SoC() (float64, error)
Soc() (float64, error)
}
// ChargeState provides current charging status
@ -204,7 +204,7 @@ type VehiclePosition interface {
// SocLimiter returns the vehicles charge limit
type SocLimiter interface {
TargetSoC() (float64, error)
TargetSoc() (float64, error)
}
// VehicleChargeController allows to start/stop the charging session on the vehicle side

View file

@ -130,7 +130,7 @@ func (x *NewReply) GetVehicleId() int64 {
return 0
}
type SoCRequest struct {
type SocRequest struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -139,8 +139,8 @@ type SoCRequest struct {
VehicleId int64 `protobuf:"varint,2,opt,name=vehicle_id,json=vehicleId,proto3" json:"vehicle_id,omitempty"`
}
func (x *SoCRequest) Reset() {
*x = SoCRequest{}
func (x *SocRequest) Reset() {
*x = SocRequest{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_vehicle_proto_msgTypes[2]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -148,13 +148,13 @@ func (x *SoCRequest) Reset() {
}
}
func (x *SoCRequest) String() string {
func (x *SocRequest) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SoCRequest) ProtoMessage() {}
func (*SocRequest) ProtoMessage() {}
func (x *SoCRequest) ProtoReflect() protoreflect.Message {
func (x *SocRequest) ProtoReflect() protoreflect.Message {
mi := &file_proto_vehicle_proto_msgTypes[2]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -166,26 +166,26 @@ func (x *SoCRequest) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use SoCRequest.ProtoReflect.Descriptor instead.
func (*SoCRequest) Descriptor() ([]byte, []int) {
// Deprecated: Use SocRequest.ProtoReflect.Descriptor instead.
func (*SocRequest) Descriptor() ([]byte, []int) {
return file_proto_vehicle_proto_rawDescGZIP(), []int{2}
}
func (x *SoCRequest) GetToken() string {
func (x *SocRequest) GetToken() string {
if x != nil {
return x.Token
}
return ""
}
func (x *SoCRequest) GetVehicleId() int64 {
func (x *SocRequest) GetVehicleId() int64 {
if x != nil {
return x.VehicleId
}
return 0
}
type SoCReply struct {
type SocReply struct {
state protoimpl.MessageState
sizeCache protoimpl.SizeCache
unknownFields protoimpl.UnknownFields
@ -193,8 +193,8 @@ type SoCReply struct {
Soc float64 `protobuf:"fixed64,1,opt,name=soc,proto3" json:"soc,omitempty"`
}
func (x *SoCReply) Reset() {
*x = SoCReply{}
func (x *SocReply) Reset() {
*x = SocReply{}
if protoimpl.UnsafeEnabled {
mi := &file_proto_vehicle_proto_msgTypes[3]
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -202,13 +202,13 @@ func (x *SoCReply) Reset() {
}
}
func (x *SoCReply) String() string {
func (x *SocReply) String() string {
return protoimpl.X.MessageStringOf(x)
}
func (*SoCReply) ProtoMessage() {}
func (*SocReply) ProtoMessage() {}
func (x *SoCReply) ProtoReflect() protoreflect.Message {
func (x *SocReply) ProtoReflect() protoreflect.Message {
mi := &file_proto_vehicle_proto_msgTypes[3]
if protoimpl.UnsafeEnabled && x != nil {
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
@ -220,12 +220,12 @@ func (x *SoCReply) ProtoReflect() protoreflect.Message {
return mi.MessageOf(x)
}
// Deprecated: Use SoCReply.ProtoReflect.Descriptor instead.
func (*SoCReply) Descriptor() ([]byte, []int) {
// Deprecated: Use SocReply.ProtoReflect.Descriptor instead.
func (*SocReply) Descriptor() ([]byte, []int) {
return file_proto_vehicle_proto_rawDescGZIP(), []int{3}
}
func (x *SoCReply) GetSoc() float64 {
func (x *SocReply) GetSoc() float64 {
if x != nil {
return x.Soc
}
@ -280,16 +280,16 @@ var file_proto_vehicle_proto_msgTypes = make([]protoimpl.MessageInfo, 5)
var file_proto_vehicle_proto_goTypes = []interface{}{
(*NewRequest)(nil), // 0: NewRequest
(*NewReply)(nil), // 1: NewReply
(*SoCRequest)(nil), // 2: SoCRequest
(*SoCReply)(nil), // 3: SoCReply
(*SocRequest)(nil), // 2: SocRequest
(*SocReply)(nil), // 3: SocReply
nil, // 4: NewRequest.ConfigEntry
}
var file_proto_vehicle_proto_depIdxs = []int32{
4, // 0: NewRequest.config:type_name -> NewRequest.ConfigEntry
0, // 1: Vehicle.New:input_type -> NewRequest
2, // 2: Vehicle.SoC:input_type -> SoCRequest
2, // 2: Vehicle.Soc:input_type -> SocRequest
1, // 3: Vehicle.New:output_type -> NewReply
3, // 4: Vehicle.SoC:output_type -> SoCReply
3, // 4: Vehicle.Soc:output_type -> SocReply
3, // [3:5] is the sub-list for method output_type
1, // [1:3] is the sub-list for method input_type
1, // [1:1] is the sub-list for extension type_name
@ -328,7 +328,7 @@ func file_proto_vehicle_proto_init() {
}
}
file_proto_vehicle_proto_msgTypes[2].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SoCRequest); i {
switch v := v.(*SocRequest); i {
case 0:
return &v.state
case 1:
@ -340,7 +340,7 @@ func file_proto_vehicle_proto_init() {
}
}
file_proto_vehicle_proto_msgTypes[3].Exporter = func(v interface{}, i int) interface{} {
switch v := v.(*SoCReply); i {
switch v := v.(*SocReply); i {
case 0:
return &v.state
case 1:

View file

@ -19,7 +19,7 @@ const _ = grpc.SupportPackageIsVersion7
// For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
type VehicleClient interface {
New(ctx context.Context, in *NewRequest, opts ...grpc.CallOption) (*NewReply, error)
SoC(ctx context.Context, in *SoCRequest, opts ...grpc.CallOption) (*SoCReply, error)
Soc(ctx context.Context, in *SocRequest, opts ...grpc.CallOption) (*SocReply, error)
}
type vehicleClient struct {
@ -39,9 +39,9 @@ func (c *vehicleClient) New(ctx context.Context, in *NewRequest, opts ...grpc.Ca
return out, nil
}
func (c *vehicleClient) SoC(ctx context.Context, in *SoCRequest, opts ...grpc.CallOption) (*SoCReply, error) {
out := new(SoCReply)
err := c.cc.Invoke(ctx, "/Vehicle/SoC", in, out, opts...)
func (c *vehicleClient) Soc(ctx context.Context, in *SocRequest, opts ...grpc.CallOption) (*SocReply, error) {
out := new(SocReply)
err := c.cc.Invoke(ctx, "/Vehicle/Soc", in, out, opts...)
if err != nil {
return nil, err
}
@ -53,7 +53,7 @@ func (c *vehicleClient) SoC(ctx context.Context, in *SoCRequest, opts ...grpc.Ca
// for forward compatibility
type VehicleServer interface {
New(context.Context, *NewRequest) (*NewReply, error)
SoC(context.Context, *SoCRequest) (*SoCReply, error)
Soc(context.Context, *SocRequest) (*SocReply, error)
mustEmbedUnimplementedVehicleServer()
}
@ -64,8 +64,8 @@ type UnimplementedVehicleServer struct {
func (UnimplementedVehicleServer) New(context.Context, *NewRequest) (*NewReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method New not implemented")
}
func (UnimplementedVehicleServer) SoC(context.Context, *SoCRequest) (*SoCReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method SoC not implemented")
func (UnimplementedVehicleServer) Soc(context.Context, *SocRequest) (*SocReply, error) {
return nil, status.Errorf(codes.Unimplemented, "method Soc not implemented")
}
func (UnimplementedVehicleServer) mustEmbedUnimplementedVehicleServer() {}
@ -98,20 +98,20 @@ func _Vehicle_New_Handler(srv interface{}, ctx context.Context, dec func(interfa
return interceptor(ctx, in, info, handler)
}
func _Vehicle_SoC_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SoCRequest)
func _Vehicle_Soc_Handler(srv interface{}, ctx context.Context, dec func(interface{}) error, interceptor grpc.UnaryServerInterceptor) (interface{}, error) {
in := new(SocRequest)
if err := dec(in); err != nil {
return nil, err
}
if interceptor == nil {
return srv.(VehicleServer).SoC(ctx, in)
return srv.(VehicleServer).Soc(ctx, in)
}
info := &grpc.UnaryServerInfo{
Server: srv,
FullMethod: "/Vehicle/SoC",
FullMethod: "/Vehicle/Soc",
}
handler := func(ctx context.Context, req interface{}) (interface{}, error) {
return srv.(VehicleServer).SoC(ctx, req.(*SoCRequest))
return srv.(VehicleServer).Soc(ctx, req.(*SocRequest))
}
return interceptor(ctx, in, info, handler)
}
@ -128,8 +128,8 @@ var Vehicle_ServiceDesc = grpc.ServiceDesc{
Handler: _Vehicle_New_Handler,
},
{
MethodName: "SoC",
Handler: _Vehicle_SoC_Handler,
MethodName: "Soc",
Handler: _Vehicle_Soc_Handler,
},
},
Streams: []grpc.StreamDesc{},

View file

@ -6,7 +6,7 @@ option go_package = "proto/pb";
service Vehicle {
rpc New (NewRequest) returns (NewReply) {}
rpc SoC (SoCRequest) returns (SoCReply) {}
rpc Soc (SocRequest) returns (SocReply) {}
}
message NewRequest {
@ -19,11 +19,11 @@ message NewReply {
int64 vehicle_id = 1;
}
message SoCRequest {
message SocRequest {
string token = 1;
int64 vehicle_id = 2;
}
message SoCReply {
message SocReply {
double soc = 1;
}