hassio

package
v0.0.0-...-371e65d Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2022 License: MIT Imports: 5 Imported by: 0

Documentation

Index

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 NewClient

func NewClient(broker string, id string, user string, password string) Client

Create New Client To Broker

func (Client) AddDevice

func (client Client) AddDevice(name string, model string, vendor string, swVersion string, identifiers []string) Device

Add Device to Client

func (Client) Connect

func (client Client) Connect()

Connect To Broker

func (Client) Disconnect

func (client Client) Disconnect()

Disconnect From Broker

func (Client) Publish

func (client Client) Publish(topic string, qos byte, retained bool, payload string) error

Submit Message

type Device

type Device struct {
	// contains filtered or unexported fields
}

func (*Device) AddSensor

func (device *Device) AddSensor(
	name string,
	id string,
	deviceClass interface{},
	unitOfMeasurement interface{},
	valueTemplateFilter string,
	icon string,
	sensorValueFunction SensorValueFunction) Sensor

Add Sensor To Device

func (*Device) SubmitChanges

func (device *Device) SubmitChanges()

Submit Changes to MQTT Broker

func (*Device) UpdateSensorValues

func (device *Device) UpdateSensorValues()

Update Sensor Values

type Sensor

type Sensor struct {
	// contains filtered or unexported fields
}

func (*Sensor) SetValue

func (sensor *Sensor) SetValue(value interface{})

Set Sensor Value

func (*Sensor) UpdateSensorValue

func (sensor *Sensor) UpdateSensorValue()

Update Sensor Value

type SensorValueFunction

type SensorValueFunction func() interface{}

Jump to

Keyboard shortcuts

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