Documentation ¶
Overview ¶
homeassistant implements an API client for Home Assistant API https://developers.home-assistant.io/docs/api/rest/
Index ¶
- type Client
- func (c *Client) Call(service, entity string) ([]*State, error)
- func (c *Client) Domains() ([]*Domain, error)
- func (c *Client) Events() ([]Event, error)
- func (c *Client) Health() (string, error)
- func (c *Client) Services(domain string) ([]*Service, error)
- func (c *Client) State(EntityId string) (*State, error)
- func (c *Client) States() ([]*State, error)
- type Domain
- type Event
- type Field
- type Selector
- type Service
- type State
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
*client.Client
}
func (*Client) Call ¶ added in v1.0.3
Call a service for an entity. Returns a list of states that have changed while the service was being executed. TODO: This is a placeholder implementation, and requires fields to be passed in the request
func (*Client) Domains ¶ added in v1.0.3
Domains returns all domains and their associated service objects
type Domain ¶ added in v1.0.3
type Field ¶ added in v1.0.3
type Service ¶ added in v1.0.3
type State ¶
type State struct { Entity string `json:"entity_id"` LastChanged time.Time `json:"last_changed,omitempty"` LastReported time.Time `json:"last_reported,omitempty"` LastUpdated time.Time `json:"last_updated,omitempty"` State string `json:"state"` Attributes map[string]any `json:"attributes"` Context struct { Id string `json:"id,omitempty"` ParentId string `json:"parent_id,omitempty"` UserId string `json:"user_id,omitempty"` } `json:"context"` }
func (State) Class ¶ added in v1.0.3
Class determines how the state should be interpreted, or will return "" if it's unknown
func (State) Domain ¶ added in v1.0.3
Domain is used to determine the services which can be called on the entity
func (State) UnitOfMeasurement ¶
UnitOfMeasurement provides the unit of measurement for the state, or "" if there is no unit of measurement