Documentation ¶
Index ¶
- type Client
- func (c *Client) Connect() error
- func (c *Client) GetPublisher(tempChan, dewptChan, lightChan, dutyChan <-chan float64, ...) func() error
- func (c *Client) HassAnnounceAll()
- func (c *Client) HassAnnounceSensor(sensor HassSensor)
- func (c *Client) HassPublishSensor(uniqueID, state string) error
- func (c *Client) HomeAssistant() error
- func (c *Client) NewHassSensor(name string, sensorType HassSensorType) HassSensor
- func (p *Client) Publish(topic string, msg string)
- func (c *Client) RegisterHassSensor(sensor HassSensor) string
- func (c *Client) Subscribe(topic string, handler paho.MessageHandler) error
- func (c *Client) SwitchFn(name string, onFn func(), offFn func(), stateFn func() bool) func() error
- type HassDevice
- type HassSensor
- type HassSensorType
- type Sample
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) GetPublisher ¶
func (*Client) HassAnnounceAll ¶
func (c *Client) HassAnnounceAll()
func (*Client) HassAnnounceSensor ¶
func (c *Client) HassAnnounceSensor(sensor HassSensor)
func (*Client) HassPublishSensor ¶
func (*Client) HomeAssistant ¶
func (*Client) NewHassSensor ¶
func (c *Client) NewHassSensor(name string, sensorType HassSensorType) HassSensor
func (*Client) RegisterHassSensor ¶
func (c *Client) RegisterHassSensor(sensor HassSensor) string
type HassDevice ¶
type HassSensor ¶
type HassSensor struct { Name string `json:"name"` UniqueID string `json:"unique_id"` Device HassDevice `json:"device,omitempty"` DeviceClass string `json:"device_class,omitempty"` StateTopic string `json:"state_topic"` UnitOfMeasurement string `json:"unit_of_measurement,omitempty"` Icon string `json:"icon,omitempty"` // contains filtered or unexported fields }
type HassSensorType ¶
type HassSensorType int
const ( HassSensorGeneric HassSensorType = iota HassSensorIlluminance HassSensorTemperature HassSensorHumidity )
Click to show internal directories.
Click to hide internal directories.