internal

package
v0.7.1 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2025 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Overview

http is used to interact with the home assistant REST API. Currently only used to retrieve state for a single entity_id

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetEquivalentWebsocketScheme added in v0.7.1

func GetEquivalentWebsocketScheme(scheme string) (string, error)

GetEquivalentWebsocketScheme returns the equivalent websocket scheme for the given scheme. If the scheme is http or https, it returns ws or wss respectively. If the scheme is ws or wss, it returns the same scheme. If the scheme is not any of the above, it returns an error.

func GetFunctionName

func GetFunctionName(i interface{}) string

GetFunctionName returns the name of the function that the interface is a pointer to.

func NextId

func NextId() int64

NextId returns a unique integer (for the given process), often used for providing a uniquely identifiable id for a request. This function is thread-safe.

func ParseDuration added in v0.7.1

func ParseDuration(s string) time.Duration

func ParseTime added in v0.7.1

func ParseTime(s string) *carbon.Carbon

Parses a HH:MM string.

Types

type EnabledDisabledInfo

type EnabledDisabledInfo struct {
	Entity     string
	State      string
	RunOnError bool
}

type HttpClient

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

func NewHttpClient

func NewHttpClient(ctx context.Context, baseUrl *url.URL, token string) *HttpClient

func (*HttpClient) GetState

func (c *HttpClient) GetState(entityId string) ([]byte, error)

func (*HttpClient) GetStates added in v0.7.1

func (c *HttpClient) GetStates() ([]byte, error)

GetStates returns the states of all entities.

Directories

Path Synopsis
Package websocket is used to interact with the Home Assistant websocket API.
Package websocket is used to interact with the Home Assistant websocket API.

Jump to

Keyboard shortcuts

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