- Added ClimateApp to handle climate entity operations including turning on/off, adjusting temperature, and setting HVAC modes. - Implemented caching mechanism for climate entities to optimize state retrieval. - Created domain model for Climate with attributes such as current temperature, target temperature, and HVAC modes. - Developed unit tests for ClimateApp to ensure functionality and correctness. feat: add RemoteApp for SwitchBot commands - Introduced RemoteApp to facilitate sending commands to SwitchBot devices. - Implemented SendCommand method for executing device commands without state management. chore: update configuration for SwitchBot integration - Added SwitchBotToken and SwitchBotSecret to configuration for enabling SwitchBot Cloud commands. feat: define gRPC services for Climate and Remote operations - Created climate.proto and remote.proto files to define gRPC services for climate management and remote command execution. - Implemented corresponding request and response message structures for gRPC interactions.
183 lines
5.6 KiB
Go
183 lines
5.6 KiB
Go
// Code generated by protoc-gen-go. DO NOT EDIT.
|
|
// versions:
|
|
// protoc-gen-go v1.36.11
|
|
// protoc (unknown)
|
|
// source: ha/v1/remote.proto
|
|
|
|
package hav1
|
|
|
|
import (
|
|
protoreflect "google.golang.org/protobuf/reflect/protoreflect"
|
|
protoimpl "google.golang.org/protobuf/runtime/protoimpl"
|
|
reflect "reflect"
|
|
sync "sync"
|
|
unsafe "unsafe"
|
|
)
|
|
|
|
const (
|
|
// Verify that this generated code is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(20 - protoimpl.MinVersion)
|
|
// Verify that runtime/protoimpl is sufficiently up-to-date.
|
|
_ = protoimpl.EnforceVersion(protoimpl.MaxVersion - 20)
|
|
)
|
|
|
|
type SendCommandRequest struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
DeviceId string `protobuf:"bytes,1,opt,name=device_id,json=deviceId,proto3" json:"device_id,omitempty"`
|
|
Command string `protobuf:"bytes,2,opt,name=command,proto3" json:"command,omitempty"`
|
|
CommandType string `protobuf:"bytes,3,opt,name=command_type,json=commandType,proto3" json:"command_type,omitempty"` // "command" or "customize"
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *SendCommandRequest) Reset() {
|
|
*x = SendCommandRequest{}
|
|
mi := &file_ha_v1_remote_proto_msgTypes[0]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *SendCommandRequest) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*SendCommandRequest) ProtoMessage() {}
|
|
|
|
func (x *SendCommandRequest) ProtoReflect() protoreflect.Message {
|
|
mi := &file_ha_v1_remote_proto_msgTypes[0]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use SendCommandRequest.ProtoReflect.Descriptor instead.
|
|
func (*SendCommandRequest) Descriptor() ([]byte, []int) {
|
|
return file_ha_v1_remote_proto_rawDescGZIP(), []int{0}
|
|
}
|
|
|
|
func (x *SendCommandRequest) GetDeviceId() string {
|
|
if x != nil {
|
|
return x.DeviceId
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *SendCommandRequest) GetCommand() string {
|
|
if x != nil {
|
|
return x.Command
|
|
}
|
|
return ""
|
|
}
|
|
|
|
func (x *SendCommandRequest) GetCommandType() string {
|
|
if x != nil {
|
|
return x.CommandType
|
|
}
|
|
return ""
|
|
}
|
|
|
|
type SendCommandResponse struct {
|
|
state protoimpl.MessageState `protogen:"open.v1"`
|
|
unknownFields protoimpl.UnknownFields
|
|
sizeCache protoimpl.SizeCache
|
|
}
|
|
|
|
func (x *SendCommandResponse) Reset() {
|
|
*x = SendCommandResponse{}
|
|
mi := &file_ha_v1_remote_proto_msgTypes[1]
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
|
|
func (x *SendCommandResponse) String() string {
|
|
return protoimpl.X.MessageStringOf(x)
|
|
}
|
|
|
|
func (*SendCommandResponse) ProtoMessage() {}
|
|
|
|
func (x *SendCommandResponse) ProtoReflect() protoreflect.Message {
|
|
mi := &file_ha_v1_remote_proto_msgTypes[1]
|
|
if x != nil {
|
|
ms := protoimpl.X.MessageStateOf(protoimpl.Pointer(x))
|
|
if ms.LoadMessageInfo() == nil {
|
|
ms.StoreMessageInfo(mi)
|
|
}
|
|
return ms
|
|
}
|
|
return mi.MessageOf(x)
|
|
}
|
|
|
|
// Deprecated: Use SendCommandResponse.ProtoReflect.Descriptor instead.
|
|
func (*SendCommandResponse) Descriptor() ([]byte, []int) {
|
|
return file_ha_v1_remote_proto_rawDescGZIP(), []int{1}
|
|
}
|
|
|
|
var File_ha_v1_remote_proto protoreflect.FileDescriptor
|
|
|
|
const file_ha_v1_remote_proto_rawDesc = "" +
|
|
"\n" +
|
|
"\x12ha/v1/remote.proto\x12\x05ha.v1\"n\n" +
|
|
"\x12SendCommandRequest\x12\x1b\n" +
|
|
"\tdevice_id\x18\x01 \x01(\tR\bdeviceId\x12\x18\n" +
|
|
"\acommand\x18\x02 \x01(\tR\acommand\x12!\n" +
|
|
"\fcommand_type\x18\x03 \x01(\tR\vcommandType\"\x15\n" +
|
|
"\x13SendCommandResponse2U\n" +
|
|
"\rRemoteService\x12D\n" +
|
|
"\vSendCommand\x12\x19.ha.v1.SendCommandRequest\x1a\x1a.ha.v1.SendCommandResponseB4Z2gitea.nik4nao.com/nik/home-services/gen/ha/v1;hav1b\x06proto3"
|
|
|
|
var (
|
|
file_ha_v1_remote_proto_rawDescOnce sync.Once
|
|
file_ha_v1_remote_proto_rawDescData []byte
|
|
)
|
|
|
|
func file_ha_v1_remote_proto_rawDescGZIP() []byte {
|
|
file_ha_v1_remote_proto_rawDescOnce.Do(func() {
|
|
file_ha_v1_remote_proto_rawDescData = protoimpl.X.CompressGZIP(unsafe.Slice(unsafe.StringData(file_ha_v1_remote_proto_rawDesc), len(file_ha_v1_remote_proto_rawDesc)))
|
|
})
|
|
return file_ha_v1_remote_proto_rawDescData
|
|
}
|
|
|
|
var file_ha_v1_remote_proto_msgTypes = make([]protoimpl.MessageInfo, 2)
|
|
var file_ha_v1_remote_proto_goTypes = []any{
|
|
(*SendCommandRequest)(nil), // 0: ha.v1.SendCommandRequest
|
|
(*SendCommandResponse)(nil), // 1: ha.v1.SendCommandResponse
|
|
}
|
|
var file_ha_v1_remote_proto_depIdxs = []int32{
|
|
0, // 0: ha.v1.RemoteService.SendCommand:input_type -> ha.v1.SendCommandRequest
|
|
1, // 1: ha.v1.RemoteService.SendCommand:output_type -> ha.v1.SendCommandResponse
|
|
1, // [1:2] is the sub-list for method output_type
|
|
0, // [0:1] is the sub-list for method input_type
|
|
0, // [0:0] is the sub-list for extension type_name
|
|
0, // [0:0] is the sub-list for extension extendee
|
|
0, // [0:0] is the sub-list for field type_name
|
|
}
|
|
|
|
func init() { file_ha_v1_remote_proto_init() }
|
|
func file_ha_v1_remote_proto_init() {
|
|
if File_ha_v1_remote_proto != nil {
|
|
return
|
|
}
|
|
type x struct{}
|
|
out := protoimpl.TypeBuilder{
|
|
File: protoimpl.DescBuilder{
|
|
GoPackagePath: reflect.TypeOf(x{}).PkgPath(),
|
|
RawDescriptor: unsafe.Slice(unsafe.StringData(file_ha_v1_remote_proto_rawDesc), len(file_ha_v1_remote_proto_rawDesc)),
|
|
NumEnums: 0,
|
|
NumMessages: 2,
|
|
NumExtensions: 0,
|
|
NumServices: 1,
|
|
},
|
|
GoTypes: file_ha_v1_remote_proto_goTypes,
|
|
DependencyIndexes: file_ha_v1_remote_proto_depIdxs,
|
|
MessageInfos: file_ha_v1_remote_proto_msgTypes,
|
|
}.Build()
|
|
File_ha_v1_remote_proto = out.File
|
|
file_ha_v1_remote_proto_goTypes = nil
|
|
file_ha_v1_remote_proto_depIdxs = nil
|
|
}
|