homescript

package
v0.2.0-beta Latest Latest
Warning

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

Go to latest
Published: Mar 21, 2022 License: GPL-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(username string, scriptLabel string, scriptCode string, serverUrl string, cookies []*http.Cookie)

Executes a given homescript as a given user, returns the output and a possible error

func RunFile

func RunFile(username string, filename string, serverUrl string, cookies []*http.Cookie)

Types

type Executor

type Executor struct {
	ScriptName     string
	Username       string
	ServerUrl      string
	SessionCookies []*http.Cookie
	Output         string
}

func (*Executor) Exit

func (self *Executor) Exit(code int)

func (*Executor) GetDate

func (self *Executor) GetDate() (int, int, int, int, int, int)

func (*Executor) GetDebugInfo

func (self *Executor) GetDebugInfo() (string, error)

func (*Executor) GetTemperature

func (self *Executor) GetTemperature() (int, error)

func (*Executor) GetUser

func (self *Executor) GetUser() string

func (*Executor) GetWeather

func (self *Executor) GetWeather() (string, error)

func (*Executor) Log

func (self *Executor) Log(
	title string,
	description string,
	level interpreter.LogLevel,
) error

func (*Executor) Notify

func (self *Executor) Notify(
	title string,
	description string,
	level interpreter.LogLevel,
) error

func (*Executor) Play

func (self *Executor) Play(server string, mode string) error

func (*Executor) Print

func (self *Executor) Print(args ...string)

func (*Executor) Switch

func (self *Executor) Switch(switchId string, powerOn bool) error

func (*Executor) SwitchOn

func (self *Executor) SwitchOn(switchId string) (bool, error)

type PowerRequest

type PowerRequest struct {
	Switch  string `json:"switch"`
	PowerOn bool   `json:"powerOn"`
}

Jump to

Keyboard shortcuts

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