client

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 6, 2023 License: Apache-2.0 Imports: 9 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	ID string

	CommunicationTimeout time.Duration
	// contains filtered or unexported fields
}

Client struct.

func GetClient added in v1.3.0

func GetClient(clientID, address, encryptionKey string, timeout time.Duration, handlerFunc func(proto.Message)) (*Client, error)

GetClient returns esphome api client

func (*Client) Close

func (c *Client) Close() error

Close the client

func (*Client) DeviceInfo

func (c *Client) DeviceInfo() (*types.DeviceInfo, error)

DeviceInfo queries the ESPHome device information.

func (*Client) Hello

func (c *Client) Hello() (*types.HelloResponse, error)

Hello func

func (*Client) LastMessageAt

func (c *Client) LastMessageAt() time.Time

LastMessage returns the time of the last message received.

func (*Client) ListEntities

func (c *Client) ListEntities() error

ListEntities func

func (*Client) Login

func (c *Client) Login(password string) error

Login func

func (*Client) Ping

func (c *Client) Ping() error

Ping func

func (*Client) Send

func (c *Client) Send(message proto.Message) error

func (*Client) SendAndWaitForResponse

func (c *Client) SendAndWaitForResponse(message proto.Message, messageType uint64) (proto.Message, error)

func (*Client) SubscribeLogs

func (c *Client) SubscribeLogs(level types.LogLevel) error

SubscribeLogs func

func (*Client) SubscribeStates

func (c *Client) SubscribeStates() error

SubscribeStates func

Jump to

Keyboard shortcuts

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