client

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HatsClient

type HatsClient struct {
	// contains filtered or unexported fields
}

func NewHatsClient

func NewHatsClient(baseUrl string, token string) *HatsClient

func (*HatsClient) CallService

func (c *HatsClient) CallService(entityId string, service string, extras ...map[string]any) error

func (*HatsClient) CancelTimer

func (c *HatsClient) CancelTimer(name string) error

func (*HatsClient) DeleteSchedule

func (c *HatsClient) DeleteSchedule(name string) error

func (*HatsClient) GetSchedule

func (c *HatsClient) GetSchedule(name string) (string, error)

func (*HatsClient) GetState

func (c *HatsClient) GetState(entityId string) (string, error)

func (*HatsClient) GetStateBool

func (c *HatsClient) GetStateBool(entityId string) (bool, error)

func (*HatsClient) GetStateFloat added in v0.15.0

func (c *HatsClient) GetStateFloat(entityId string) (float64, error)

func (*HatsClient) GetStateFull

func (c *HatsClient) GetStateFull(entityId string) (ha.StateData, error)

func (*HatsClient) GetStateWithDefault

func (c *HatsClient) GetStateWithDefault(entityId string, defaultValue string) string

func (*HatsClient) GetTimer

func (c *HatsClient) GetTimer(name string) (string, error)

func (*HatsClient) SendNtfyMessage

func (c *HatsClient) SendNtfyMessage(data ntfy.Message) error

func (*HatsClient) SetSchedule

func (c *HatsClient) SetSchedule(name string, cron string) (string, error)

SetSchedule: set a cron schedule

name: a unique identifying string
cron: a cron expression with seconds, like "0 */5 * * * *" (every 5 minutes)

func (*HatsClient) StartTimer

func (c *HatsClient) StartTimer(name string, duration string, force bool) (string, error)

Start a timer

name: the name of the timer (should be unique)
duration: time.Duration string for how long the timer should last
force: if true, will start the timer over even if it is already running

Jump to

Keyboard shortcuts

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