package grpc import ( "context" hav1 "gitea.nik4nao.com/nik/home-services/gen/ha/v1" "gitea.nik4nao.com/nik/home-services/ha-gateway/internal/core/ports/driving" ) type RemoteGRPC struct { hav1.UnimplementedRemoteServiceServer svc driving.RemoteService } // NewRemoteGRPC constructs the gRPC adapter for RemoteService. func NewRemoteGRPC(svc driving.RemoteService) *RemoteGRPC { return &RemoteGRPC{svc: svc} } // SendCommand forwards a SwitchBot Cloud device command to the domain service. func (h *RemoteGRPC) SendCommand(ctx context.Context, req *hav1.SendCommandRequest) (*hav1.SendCommandResponse, error) { if err := h.svc.SendCommand(ctx, req.DeviceId, req.Command, req.CommandType); err != nil { return nil, grpcError(err) } return &hav1.SendCommandResponse{}, nil }