bot

package
v0.15.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Bot

type Bot struct {
	Tado TadoSetter
	// contains filtered or unexported fields
}

func New

func New(tado TadoSetter, s SlackBot, p poller.Poller, controller Controller, logger *slog.Logger) *Bot

func (*Bot) DoRefresh

func (b *Bot) DoRefresh(_ context.Context, _ ...string) []slack.Attachment

func (*Bot) ReportRooms

func (b *Bot) ReportRooms(_ context.Context, _ ...string) []slack.Attachment

func (*Bot) ReportRules

func (b *Bot) ReportRules(_ context.Context, _ ...string) []slack.Attachment

func (*Bot) ReportUsers

func (b *Bot) ReportUsers(_ context.Context, _ ...string) []slack.Attachment

func (*Bot) Run

func (b *Bot) Run(ctx context.Context) error

Run the controller

func (*Bot) SetHome added in v0.15.2

func (b *Bot) SetHome(ctx context.Context, args ...string) []slack.Attachment

func (*Bot) SetRoom

func (b *Bot) SetRoom(ctx context.Context, args ...string) []slack.Attachment

type Controller

type Controller interface {
	ReportTasks() []string
}

type SlackBot

type SlackBot interface {
	Add(commands slackbot.Commands)
	Run(ctx context.Context) error
}

type TadoSetter

type TadoSetter interface {
	DeleteZoneOverlay(context.Context, int) error
	SetZoneTemporaryOverlay(context.Context, int, float64, time.Duration) error
	SetHomeState(ctx context.Context, home bool) error
	UnsetHomeState(ctx context.Context) error
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL