Documentation ¶
Overview ¶
Package control is a generated protocol buffer package.
It is generated from these files:
control.proto service.proto
It has these top-level messages:
Radiator Zone GetZonesRequest GetZonesReply GetZoneStatusRequest GetZoneStatusReply SetZoneScheduleRequest SetZoneScheduleReply Config
Package control is a reverse proxy.
It translates gRPC into RESTful JSON APIs.
Index ¶
- Constants
- Variables
- func RegisterHeatingControlServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
- func RegisterHeatingControlServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HeatingControlServiceClient) error
- func RegisterHeatingControlServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, ...) (err error)
- func RegisterHeatingControlServiceServer(s *grpc.Server, srv HeatingControlServiceServer)
- type ByName
- type Config
- type Controller
- func (c *Controller) ControlRadiators(ctx context.Context)
- func (c *Controller) GetNextState(room *Room) HeatingState
- func (s *Controller) GetZoneStatus(ctx context.Context, req *GetZoneStatusRequest) (*GetZoneStatusReply, error)
- func (s *Controller) GetZones(ctx context.Context, req *GetZonesRequest) (*GetZonesReply, error)
- func (s *Controller) SetZoneSchedule(ctx context.Context, req *SetZoneScheduleRequest) (*SetZoneScheduleReply, error)
- type GetZoneStatusReply
- func (*GetZoneStatusReply) Descriptor() ([]byte, []int)
- func (m *GetZoneStatusReply) GetCurrentTemperature() float32
- func (m *GetZoneStatusReply) GetName() string
- func (m *GetZoneStatusReply) GetState() HeatingState
- func (m *GetZoneStatusReply) GetTargetTemperature() float32
- func (*GetZoneStatusReply) ProtoMessage()
- func (m *GetZoneStatusReply) Reset()
- func (m *GetZoneStatusReply) String() string
- type GetZoneStatusRequest
- type GetZonesReply
- type GetZonesRequest
- type HeatingControlServiceClient
- type HeatingControlServiceServer
- type HeatingState
- type Radiator
- type RadiatorController
- type RadioController
- type Room
- type SetZoneScheduleReply
- type SetZoneScheduleRequest
- type Zone
Constants ¶
const ( Day = 0x05 Night = 0x03 Defrost = 0x09 Off = 0x60 Auto = 0x11 )
Variables ¶
var HeatingState_name = map[int32]string{
0: "UNKNOWN",
1: "ON",
2: "OFF",
}
var HeatingState_value = map[string]int32{
"UNKNOWN": 0,
"ON": 1,
"OFF": 2,
}
Functions ¶
func RegisterHeatingControlServiceHandler ¶
func RegisterHeatingControlServiceHandler(ctx context.Context, mux *runtime.ServeMux, conn *grpc.ClientConn) error
RegisterHeatingControlServiceHandler registers the http handlers for service HeatingControlService to "mux". The handlers forward requests to the grpc endpoint over "conn".
func RegisterHeatingControlServiceHandlerClient ¶
func RegisterHeatingControlServiceHandlerClient(ctx context.Context, mux *runtime.ServeMux, client HeatingControlServiceClient) error
RegisterHeatingControlServiceHandler registers the http handlers for service HeatingControlService to "mux". The handlers forward requests to the grpc endpoint over the given implementation of "HeatingControlServiceClient". Note: the gRPC framework executes interceptors within the gRPC handler. If the passed in "HeatingControlServiceClient" doesn't go through the normal gRPC flow (creating a gRPC client etc.) then it will be up to the passed in "HeatingControlServiceClient" to call the correct interceptors.
func RegisterHeatingControlServiceHandlerFromEndpoint ¶
func RegisterHeatingControlServiceHandlerFromEndpoint(ctx context.Context, mux *runtime.ServeMux, endpoint string, opts []grpc.DialOption) (err error)
RegisterHeatingControlServiceHandlerFromEndpoint is same as RegisterHeatingControlServiceHandler but automatically dials to "endpoint" and closes the connection when "ctx" gets done.
func RegisterHeatingControlServiceServer ¶
func RegisterHeatingControlServiceServer(s *grpc.Server, srv HeatingControlServiceServer)
Types ¶
type Config ¶
type Config struct {
Zone []*Zone `protobuf:"bytes,1,rep,name=zone" json:"zone,omitempty"`
}
func (*Config) Descriptor ¶
func (*Config) ProtoMessage ¶
func (*Config) ProtoMessage()
type Controller ¶
func NewController ¶
func NewController( path string, controller RadiatorController, calendarService *calendar.CalendarScheduleService, logger *zap.SugaredLogger, ) (*Controller, error)
func (*Controller) ControlRadiators ¶
func (c *Controller) ControlRadiators(ctx context.Context)
func (*Controller) GetNextState ¶
func (c *Controller) GetNextState(room *Room) HeatingState
func (*Controller) GetZoneStatus ¶
func (s *Controller) GetZoneStatus(ctx context.Context, req *GetZoneStatusRequest) (*GetZoneStatusReply, error)
func (*Controller) GetZones ¶
func (s *Controller) GetZones(ctx context.Context, req *GetZonesRequest) (*GetZonesReply, error)
func (*Controller) SetZoneSchedule ¶
func (s *Controller) SetZoneSchedule(ctx context.Context, req *SetZoneScheduleRequest) (*SetZoneScheduleReply, error)
type GetZoneStatusReply ¶
type GetZoneStatusReply struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` TargetTemperature float32 `protobuf:"fixed32,2,opt,name=target_temperature,json=targetTemperature" json:"target_temperature,omitempty"` CurrentTemperature float32 `protobuf:"fixed32,3,opt,name=current_temperature,json=currentTemperature" json:"current_temperature,omitempty"` State HeatingState `protobuf:"varint,4,opt,name=state,enum=control.HeatingState" json:"state,omitempty"` }
func (*GetZoneStatusReply) Descriptor ¶
func (*GetZoneStatusReply) Descriptor() ([]byte, []int)
func (*GetZoneStatusReply) GetCurrentTemperature ¶
func (m *GetZoneStatusReply) GetCurrentTemperature() float32
func (*GetZoneStatusReply) GetName ¶
func (m *GetZoneStatusReply) GetName() string
func (*GetZoneStatusReply) GetState ¶
func (m *GetZoneStatusReply) GetState() HeatingState
func (*GetZoneStatusReply) GetTargetTemperature ¶
func (m *GetZoneStatusReply) GetTargetTemperature() float32
func (*GetZoneStatusReply) ProtoMessage ¶
func (*GetZoneStatusReply) ProtoMessage()
func (*GetZoneStatusReply) Reset ¶
func (m *GetZoneStatusReply) Reset()
func (*GetZoneStatusReply) String ¶
func (m *GetZoneStatusReply) String() string
type GetZoneStatusRequest ¶
type GetZoneStatusRequest struct {
Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"`
}
func (*GetZoneStatusRequest) Descriptor ¶
func (*GetZoneStatusRequest) Descriptor() ([]byte, []int)
func (*GetZoneStatusRequest) GetName ¶
func (m *GetZoneStatusRequest) GetName() string
func (*GetZoneStatusRequest) ProtoMessage ¶
func (*GetZoneStatusRequest) ProtoMessage()
func (*GetZoneStatusRequest) Reset ¶
func (m *GetZoneStatusRequest) Reset()
func (*GetZoneStatusRequest) String ¶
func (m *GetZoneStatusRequest) String() string
type GetZonesReply ¶
type GetZonesReply struct {
Zone []*Zone `protobuf:"bytes,1,rep,name=zone" json:"zone,omitempty"`
}
func (*GetZonesReply) Descriptor ¶
func (*GetZonesReply) Descriptor() ([]byte, []int)
func (*GetZonesReply) GetZone ¶
func (m *GetZonesReply) GetZone() []*Zone
func (*GetZonesReply) ProtoMessage ¶
func (*GetZonesReply) ProtoMessage()
func (*GetZonesReply) Reset ¶
func (m *GetZonesReply) Reset()
func (*GetZonesReply) String ¶
func (m *GetZonesReply) String() string
type GetZonesRequest ¶
type GetZonesRequest struct { }
func (*GetZonesRequest) Descriptor ¶
func (*GetZonesRequest) Descriptor() ([]byte, []int)
func (*GetZonesRequest) ProtoMessage ¶
func (*GetZonesRequest) ProtoMessage()
func (*GetZonesRequest) Reset ¶
func (m *GetZonesRequest) Reset()
func (*GetZonesRequest) String ¶
func (m *GetZonesRequest) String() string
type HeatingControlServiceClient ¶
type HeatingControlServiceClient interface { GetZones(ctx context.Context, in *GetZonesRequest, opts ...grpc.CallOption) (*GetZonesReply, error) GetZoneStatus(ctx context.Context, in *GetZoneStatusRequest, opts ...grpc.CallOption) (*GetZoneStatusReply, error) SetZoneSchedule(ctx context.Context, in *SetZoneScheduleRequest, opts ...grpc.CallOption) (*SetZoneScheduleReply, error) }
func NewHeatingControlServiceClient ¶
func NewHeatingControlServiceClient(cc *grpc.ClientConn) HeatingControlServiceClient
type HeatingControlServiceServer ¶
type HeatingControlServiceServer interface { GetZones(context.Context, *GetZonesRequest) (*GetZonesReply, error) GetZoneStatus(context.Context, *GetZoneStatusRequest) (*GetZoneStatusReply, error) SetZoneSchedule(context.Context, *SetZoneScheduleRequest) (*SetZoneScheduleReply, error) }
type HeatingState ¶
type HeatingState int32
const ( HeatingState_UNKNOWN HeatingState = 0 HeatingState_ON HeatingState = 1 HeatingState_OFF HeatingState = 2 )
func (HeatingState) EnumDescriptor ¶
func (HeatingState) EnumDescriptor() ([]byte, []int)
func (HeatingState) String ¶
func (x HeatingState) String() string
type Radiator ¶
type Radiator struct {
Address []byte `protobuf:"bytes,1,opt,name=address,proto3" json:"address,omitempty"`
}
func (*Radiator) Descriptor ¶
func (*Radiator) GetAddress ¶
func (*Radiator) ProtoMessage ¶
func (*Radiator) ProtoMessage()
type RadiatorController ¶
type RadioController ¶
type RadioController struct {
// contains filtered or unexported fields
}
func NewRadioController ¶
func NewRadioController() *RadioController
func (*RadioController) TurnOff ¶
func (c *RadioController) TurnOff(addr []byte)
func (*RadioController) TurnOn ¶
func (c *RadioController) TurnOn(addr []byte)
type Room ¶
type Room struct { Pid *pidctrl.PIDController LastTemp float64 // contains filtered or unexported fields }
type SetZoneScheduleReply ¶
type SetZoneScheduleReply struct { }
func (*SetZoneScheduleReply) Descriptor ¶
func (*SetZoneScheduleReply) Descriptor() ([]byte, []int)
func (*SetZoneScheduleReply) ProtoMessage ¶
func (*SetZoneScheduleReply) ProtoMessage()
func (*SetZoneScheduleReply) Reset ¶
func (m *SetZoneScheduleReply) Reset()
func (*SetZoneScheduleReply) String ¶
func (m *SetZoneScheduleReply) String() string
type SetZoneScheduleRequest ¶
type SetZoneScheduleRequest struct { }
func (*SetZoneScheduleRequest) Descriptor ¶
func (*SetZoneScheduleRequest) Descriptor() ([]byte, []int)
func (*SetZoneScheduleRequest) ProtoMessage ¶
func (*SetZoneScheduleRequest) ProtoMessage()
func (*SetZoneScheduleRequest) Reset ¶
func (m *SetZoneScheduleRequest) Reset()
func (*SetZoneScheduleRequest) String ¶
func (m *SetZoneScheduleRequest) String() string
type Zone ¶
type Zone struct { Name string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Radiator []*Radiator `protobuf:"bytes,2,rep,name=radiator" json:"radiator,omitempty"` CalendarId string `protobuf:"bytes,4,opt,name=calendar_id,json=calendarId" json:"calendar_id,omitempty"` TargetTemperature int32 `protobuf:"varint,5,opt,name=target_temperature,json=targetTemperature" json:"target_temperature,omitempty"` }
func (*Zone) Descriptor ¶
func (*Zone) GetCalendarId ¶
func (*Zone) GetRadiator ¶
func (*Zone) GetTargetTemperature ¶
func (*Zone) ProtoMessage ¶
func (*Zone) ProtoMessage()