luxtronik

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Filters

type Filters []struct {
	Match struct {
		Value string `yaml:"value"`
	} `yaml:"match"`
	Set struct {
		Key   string `yaml:"key"`
		Value string `yaml:"value"`
	} `yaml:"set"`
}

Filters are needed, as the luxtronik does a very bad job at serializing it's data. Numeric data gets messed up with units, extra-chars, etc. They even differ by language. This is addressed by dynamic filters. The first filter that matches is used.

Match.Value: Regular Expression (re2) matched against the original value Set.Key: text/template used as the new key, ignored if blank (MAY BE) Set.Value: text/template used as the new value, in json (MUST), not blank (MUST NOT)

type Location

type Location struct {
	Domain, Field string
}

Location is just a pair of Domain and Field and represents the location of data in our datastore

type Luxtronik

type Luxtronik struct {

	// OnUpdate gets called as soon as new data got is received and stored.
	OnUpdate func(new []Location)
	// contains filtered or unexported fields
}

Luxtronik represents a luxtronik2 heatpump (AlphaInnotec, Siemens, etc.) and contains the data returned by the appliance, but also the things required to interact with it (websocket, etc.).

func Connect

func Connect(ip string, filters Filters) *Luxtronik

Connect initiates the connection to the heatpump, retrieves the initial data-set, stores it and launches the update-routine. The heatpump object is returned.

func (*Luxtronik) Domains

func (l *Luxtronik) Domains() map[string]map[string]string

Domains return all available domains

func (*Luxtronik) Value

func (l *Luxtronik) Value(domain, key string) string

Value returns the value of a domain.key

Jump to

Keyboard shortcuts

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