Versions in this module Expand all Collapse all v0 v0.32.16 May 10, 2023 v0.32.15 May 10, 2023 v0.32.14 May 10, 2023 v0.32.13 May 10, 2023 v0.32.12 May 5, 2023 v0.32.11 May 5, 2023 v0.32.10 May 5, 2023 v0.32.9 May 5, 2023 v0.32.8 May 5, 2023 v0.32.7 Apr 19, 2023 v0.32.6 Apr 11, 2023 v0.32.5 Feb 8, 2023 v0.32.4 Feb 8, 2023 v0.32.3 Feb 8, 2023 v0.32.2 Feb 8, 2023 v0.32.1 Feb 8, 2023 v0.32.0 Feb 4, 2023 Changes in this version + var Brightness_name = map[int32]string + var Brightness_value = map[string]int32 + var ColorTemperature_name = map[int32]string + var ColorTemperature_value = map[string]int32 + var ErrHandlerFailed = errors.New("handler failed") + var ErrNilConfig = errors.New("nil lights config") + var ErrNoRoomsConfigured = errors.New("no rooms configured") + var ErrRoomNotFound = errors.New("room not found") + var ErrUnhandledEventName = errors.New("unhandled event name") + var ErrUnknownActionEvent = errors.New("unknown action event") + var File_modules_lights_lights_proto protoreflect.FileDescriptor + var Lights_ServiceDesc = grpc.ServiceDesc + var ZoneState_name = map[int32]string + var ZoneState_value = map[string]int32 + func ParseHexColor(s string) (c color.RGBA, err error) + func RegisterLightsServer(s grpc.ServiceRegistrar, srv LightsServer) + type Brightness int32 + const Brightness_DIM + const Brightness_DIMPLUS + const Brightness_FULL + const Brightness_LOW + const Brightness_LOWPLUS + const Brightness_VERYLOW + func (Brightness) Descriptor() protoreflect.EnumDescriptor + func (Brightness) EnumDescriptor() ([]byte, []int) + func (Brightness) Type() protoreflect.EnumType + func (x Brightness) Enum() *Brightness + func (x Brightness) Number() protoreflect.EnumNumber + func (x Brightness) String() string + type ColorTempSchedule map[ColorTemperature]time.Time + func (c ColorTempSchedule) MostRecent() ColorTemperature + type ColorTempSchedulerFunc func() ColorTempSchedule + func StaticColorTempSchedule(timezone string) (ColorTempSchedulerFunc, error) + type ColorTemperature int32 + const ColorTemperature_DAY + const ColorTemperature_EVENING + const ColorTemperature_FIRSTLIGHT + const ColorTemperature_LATEAFTERNOON + const ColorTemperature_MORNING + func (ColorTemperature) Descriptor() protoreflect.EnumDescriptor + func (ColorTemperature) EnumDescriptor() ([]byte, []int) + func (ColorTemperature) Type() protoreflect.EnumType + func (x ColorTemperature) Enum() *ColorTemperature + func (x ColorTemperature) Number() protoreflect.EnumNumber + func (x ColorTemperature) String() string + type Config struct + PartyColors []string + Rooms []Room + TimeZone string + func (c *Config) Room(name string) (Room, error) + type Handler interface + Alert func(context.Context, string) error + Off func(context.Context, string) error + On func(context.Context, string) error + RandomColor func(context.Context, string, []string) error + SetBrightness func(context.Context, string, int32) error + SetColor func(context.Context, string, string) error + SetColorTemp func(context.Context, string, int32) error + Toggle func(context.Context, string) error + func NewZigbeeLight(cfg Config, mqttClient mqtt.Client, inv inventory.Inventory, logger log.Logger) (Handler, error) + type Light struct + Id int32 + Name string + Type string + func (*Light) Descriptor() ([]byte, []int) + func (*Light) ProtoMessage() + func (x *Light) GetId() int32 + func (x *Light) GetName() string + func (x *Light) GetType() string + func (x *Light) ProtoReflect() protoreflect.Message + func (x *Light) Reset() + func (x *Light) String() string + type LightGroup struct + Id int32 + Lights []int32 + Name string + Type string + func (*LightGroup) Descriptor() ([]byte, []int) + func (*LightGroup) ProtoMessage() + func (x *LightGroup) GetId() int32 + func (x *LightGroup) GetLights() []int32 + func (x *LightGroup) GetName() string + func (x *LightGroup) GetType() string + func (x *LightGroup) ProtoReflect() protoreflect.Message + func (x *LightGroup) Reset() + func (x *LightGroup) String() string + type LightResponse struct + Groups []*LightGroup + Lights []*Light + func (*LightResponse) Descriptor() ([]byte, []int) + func (*LightResponse) ProtoMessage() + func (x *LightResponse) GetGroups() []*LightGroup + func (x *LightResponse) GetLights() []*Light + func (x *LightResponse) ProtoReflect() protoreflect.Message + func (x *LightResponse) Reset() + func (x *LightResponse) String() string + type Lights struct + func New(cfg Config, logger log.Logger) (*Lights, error) + func (l *Lights) ActionHandler(ctx context.Context, action *iot.Action) error + func (l *Lights) AddHandler(h Handler) + func (l *Lights) NamedTimerHandler(ctx context.Context, e string) error + func (l *Lights) SetColorTempScheduler(c ColorTempSchedulerFunc) + func (l *Lights) SetRoomForEvent(ctx context.Context, event string) error + type LightsClient interface + SetState func(ctx context.Context, in *ZoneStateRequest, opts ...grpc.CallOption) (*ZoneStateResponse, error) + func NewLightsClient(cc grpc.ClientConnInterface) LightsClient + type LightsServer interface + SetState func(context.Context, *ZoneStateRequest) (*ZoneStateResponse, error) + type MockLight struct + AlertCalls map[string]int + OffCalls map[string]int + OnCalls map[string]int + RandomColorCalls map[string]int + SetBrightnessCalls map[string]int + SetColorCalls map[string]int + SetColorTempCalls map[string]int + ToggleCalls map[string]int + func (m *MockLight) Alert(ctx context.Context, groupName string) error + func (m *MockLight) Off(ctx context.Context, groupName string) error + func (m *MockLight) On(ctx context.Context, groupName string) error + func (m *MockLight) RandomColor(ctx context.Context, groupName string, colors []string) error + func (m *MockLight) SetBrightness(ctx context.Context, groupName string, brightness int32) error + func (m *MockLight) SetColor(ctx context.Context, groupName string, hex string) error + func (m *MockLight) SetColorTemp(ctx context.Context, groupName string, temp int32) error + func (m *MockLight) Toggle(ctx context.Context, groupName string) error + type Room struct + Name string + States []StateSpec + type StateSpec struct + Brightness *Brightness + ColorTemp *ColorTemperature + Event string + State ZoneState + func (s *StateSpec) UnmarshalYAML(unmarshal func(interface{}) error) error + type UnimplementedLightsServer struct + func (UnimplementedLightsServer) SetState(context.Context, *ZoneStateRequest) (*ZoneStateResponse, error) + type UnsafeLightsServer interface + type Zone struct + func NewZone(name string) *Zone + func (z *Zone) Alert(ctx context.Context) error + func (z *Zone) DecrementBrightness(ctx context.Context) error + func (z *Zone) Flush(ctx context.Context) error + func (z *Zone) IncrementBrightness(ctx context.Context) error + func (z *Zone) Name() string + func (z *Zone) Off(ctx context.Context) error + func (z *Zone) On(ctx context.Context) error + func (z *Zone) RandomColor(ctx context.Context, colors []string) error + func (z *Zone) SetBrightness(ctx context.Context, brightness Brightness) error + func (z *Zone) SetBrightnessMap(m map[Brightness]int32) + func (z *Zone) SetColor(ctx context.Context, color string) error + func (z *Zone) SetColorTemperature(ctx context.Context, colorTemp ColorTemperature) error + func (z *Zone) SetColorTemperatureMap(m map[ColorTemperature]int32) + func (z *Zone) SetHandlers(handlers ...Handler) + func (z *Zone) SetName(name string) + func (z *Zone) SetState(ctx context.Context, state ZoneState) error + func (z *Zone) Toggle(ctx context.Context) error + type ZoneState int32 + const ZoneState_COLOR + const ZoneState_EVENINGVISION + const ZoneState_MORNINGVISION + const ZoneState_NIGHTVISION + const ZoneState_OFF + const ZoneState_OFFTIMER + const ZoneState_ON + const ZoneState_RANDOMCOLOR + func (ZoneState) Descriptor() protoreflect.EnumDescriptor + func (ZoneState) EnumDescriptor() ([]byte, []int) + func (ZoneState) Type() protoreflect.EnumType + func (x ZoneState) Enum() *ZoneState + func (x ZoneState) Number() protoreflect.EnumNumber + func (x ZoneState) String() string + type ZoneStateRequest struct + Name string + State ZoneState + func (*ZoneStateRequest) Descriptor() ([]byte, []int) + func (*ZoneStateRequest) ProtoMessage() + func (x *ZoneStateRequest) GetName() string + func (x *ZoneStateRequest) GetState() ZoneState + func (x *ZoneStateRequest) ProtoReflect() protoreflect.Message + func (x *ZoneStateRequest) Reset() + func (x *ZoneStateRequest) String() string + type ZoneStateResponse struct + Color string + func (*ZoneStateResponse) Descriptor() ([]byte, []int) + func (*ZoneStateResponse) ProtoMessage() + func (x *ZoneStateResponse) GetColor() string + func (x *ZoneStateResponse) ProtoReflect() protoreflect.Message + func (x *ZoneStateResponse) Reset() + func (x *ZoneStateResponse) String() string + type Zones struct + func (z *Zones) GetZone(name string) *Zone + func (z *Zones) GetZones() []*Zone