automation

package
v0.0.0-...-3b0d57d Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2024 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 Climate

type Climate interface {
}

type DeviceClass

type DeviceClass int64
const (
	DeviceClass_Energy DeviceClass = iota
)

func (DeviceClass) String

func (dc DeviceClass) String() string

type Icon

type Icon int64
const (
	Icon_Wh Icon = iota
	Icon_W
	Icon_V
	Icon_A
	Icon_Battery
)

func (Icon) String

func (i Icon) String() string

type Node

type Node interface {
	Connect() error
	Disconnect() error
	CreateSensor(template *SensorTemplate) Sensor
	CreateClimate(template *ObjectTemplate) Climate
}

type Object

type Object interface {
}

type ObjectTemplate

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

type Registry

type Registry interface {
	EnableMqtt(broker mqtt.Broker)
	EnableInfluxDB(influx influxdb.Client)
	EnableHomeAssistant()
	CreateNode(name string) Node
}

func GetRegistry

func GetRegistry() Registry

type Sensor

type Sensor interface {
	Object
	SetState(state any)
	Unit() Unit
}

type SensorTemplate

type SensorTemplate struct {
	ObjectTemplate
	// contains filtered or unexported fields
}

func MakeSensorTemplate

func MakeSensorTemplate(name string) *SensorTemplate

func (*SensorTemplate) SetDeviceClass

func (t *SensorTemplate) SetDeviceClass(deviceClass DeviceClass) *SensorTemplate

func (*SensorTemplate) SetIcon

func (t *SensorTemplate) SetIcon(icon Icon) *SensorTemplate

func (*SensorTemplate) SetPrecision

func (t *SensorTemplate) SetPrecision(precision uint) *SensorTemplate

func (*SensorTemplate) SetStateClass

func (t *SensorTemplate) SetStateClass(stateClass StateClass) *SensorTemplate

func (*SensorTemplate) SetUnit

func (t *SensorTemplate) SetUnit(unit Unit) *SensorTemplate

type StateClass

type StateClass int64
const (
	StateClass_Measurement StateClass = iota
	StateClass_Total
)

func (StateClass) String

func (sc StateClass) String() string

type Unit

type Unit int64
const (
	Unit_Number Unit = iota
	Unit_Wh
	Unit_kWh
	Unit_W
	Unit_kW
	Unit_V
	Unit_A
	Unit_Percent
)

func (Unit) String

func (u Unit) String() string

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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