Documentation
¶
Index ¶
- Constants
- 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) NoiseEncryptionSetKey(key []byte) (*api.NoiseEncryptionSetKeyResponse, 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 ¶
const ( ClientAPIVersionMajor uint32 = 1 ClientAPIVersionMinor uint32 = 14 )
API version sent in HelloRequest.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
ID string
CommunicationTimeout time.Duration
// DisconnectReason from device DisconnectRequest (0 if none).
DisconnectReason api.DisconnectReason
// contains filtered or unexported fields
}
Client struct.
func GetClient ¶ added in v1.3.0
func GetClient(clientID, address, encryptionKey string, timeout time.Duration, callBackFunc types.CallBackFunc) (*Client, error)
GetClient returns esphome api client
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) Login ¶
Login uses the legacy API password. Removed in ESPHome 2026.1.0; use Hello() instead.
func (*Client) NoiseEncryptionSetKey ¶ added in v1.4.0
func (c *Client) NoiseEncryptionSetKey(key []byte) (*api.NoiseEncryptionSetKeyResponse, error)
func (*Client) SendAndWaitForResponse ¶
func (*Client) SubscribeLogs ¶
SubscribeLogs func