Documentation ¶
Index ¶
- type HatsClient
- func (c *HatsClient) CallService(entityId string, service string, extras ...map[string]any) error
- func (c *HatsClient) CancelTimer(name string) error
- func (c *HatsClient) DeleteSchedule(name string) error
- func (c *HatsClient) GetSchedule(name string) (string, error)
- func (c *HatsClient) GetState(entityId string) (string, error)
- func (c *HatsClient) GetStateBool(entityId string) (bool, error)
- func (c *HatsClient) GetStateFloat(entityId string) (float64, error)
- func (c *HatsClient) GetStateFull(entityId string) (ha.StateData, error)
- func (c *HatsClient) GetStateWithDefault(entityId string, defaultValue string) string
- func (c *HatsClient) GetTimer(name string) (string, error)
- func (c *HatsClient) SendNtfyMessage(data ntfy.Message) error
- func (c *HatsClient) SetSchedule(name string, cron string) (string, error)
- func (c *HatsClient) StartTimer(name string, duration string, force bool) (string, error)
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 (*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) GetStateBool ¶
func (c *HatsClient) GetStateBool(entityId string) (bool, error)
func (*HatsClient) GetStateFloat ¶
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) 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 ¶
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
Click to show internal directories.
Click to hide internal directories.