Documentation
¶
Index ¶
- Variables
- type Client
- func (c *Client) Close() error
- func (c *Client) DeviceInfo() (*types.DeviceInfo, error)
- func (c *Client) Hello() (*types.HelloResponse, error)
- func (c *Client) LastMessageAt() time.Time
- func (c *Client) ListEntities() error
- func (c *Client) Login(password string) error
- func (c *Client) Ping() error
- func (c *Client) Send(message proto.Message) error
- func (c *Client) SendAndWaitForResponse(message proto.Message, messageType uint64) (proto.Message, error)
- func (c *Client) SubscribeLogs(level types.LogLevel) error
- func (c *Client) SubscribeStates() error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrPassword = errors.New("esphome_api: invalid password") ErrCommunicationTimeout = errors.New("esphome_api: communication timeout") )
Error types
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct { ID string CommunicationTimeout time.Duration // contains filtered or unexported fields }
Client struct.
func Init ¶
func Init(clientID, addr string, timeout time.Duration, handlerFunc func(proto.Message)) (*Client, error)
Init func
func (*Client) DeviceInfo ¶
func (c *Client) DeviceInfo() (*types.DeviceInfo, error)
DeviceInfo queries the ESPHome device information.
func (*Client) LastMessageAt ¶
LastMessage returns the time of the last message received.
func (*Client) SendAndWaitForResponse ¶
func (*Client) SubscribeLogs ¶
SubscribeLogs func
Click to show internal directories.
Click to hide internal directories.