Documentation
¶
Index ¶
- func LoadHomematicDevices(ctx Context, devices *Devices, device Device) error
- func LoadIoBrokerDevices(ctx Context, devices *Devices, device Device) error
- func LoadTasmotaDevices(ctx Context, devices *Devices, device Device) error
- type Context
- func (c *Context) Fatal(err error, args ...interface{})
- func (c *Context) Info(args ...interface{})
- func (c *Context) Pop()
- func (c *Context) Post(url string, contentType string, body io.Reader) (resp *http.Response, err error)
- func (c *Context) PushField(key string, value interface{})
- func (c *Context) PushFields(fields logrus.Fields)
- func (c *Context) Warn(err error, args ...interface{})
- type Device
- type DeviceInterface
- type DeviceList
- type Devices
- type HomematicDesc
- type HomematicDevice
- func (t *HomematicDevice) CategoryName() string
- func (t *HomematicDevice) CurrentValue(ctx Context) (float64, error)
- func (t *HomematicDevice) DeviceID() string
- func (t *HomematicDevice) FullName() string
- func (t *HomematicDevice) IntervalSec() uint64
- func (t *HomematicDevice) Labels() []string
- func (t *HomematicDevice) LastValue() string
- func (t *HomematicDevice) LogName() string
- func (t *HomematicDevice) MetricName() string
- func (t *HomematicDevice) Name() string
- func (t *HomematicDevice) Room() string
- type IoBrokerDevice
- func (t *IoBrokerDevice) CategoryName() string
- func (t *IoBrokerDevice) CurrentValue(ctx Context) (float64, error)
- func (t *IoBrokerDevice) DeviceID() string
- func (t *IoBrokerDevice) FullName() string
- func (t *IoBrokerDevice) IntervalSec() uint64
- func (t *IoBrokerDevice) Labels() []string
- func (t *IoBrokerDevice) LastValue() string
- func (t *IoBrokerDevice) LogName() string
- func (t *IoBrokerDevice) MetricName() string
- func (t *IoBrokerDevice) Name() string
- func (t *IoBrokerDevice) Room() string
- type TasmotaDevice
- func (t *TasmotaDevice) CategoryName() string
- func (t *TasmotaDevice) CurrentValue(ctx Context) (float64, error)
- func (t *TasmotaDevice) DeviceID() string
- func (t *TasmotaDevice) FullName() string
- func (t *TasmotaDevice) IntervalSec() uint64
- func (t *TasmotaDevice) Labels() []string
- func (t *TasmotaDevice) LastValue() string
- func (t *TasmotaDevice) LogName() string
- func (t *TasmotaDevice) MetricName() string
- func (t *TasmotaDevice) Name() string
- func (t *TasmotaDevice) Room() string
- type TasmotaEnergy
- type TasmotaStatus
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func LoadHomematicDevices ¶
func LoadIoBrokerDevices ¶
Types ¶
type Context ¶
type Context struct { Root string NetClient *http.Client Clog *logrus.Entry // contains filtered or unexported fields }
func (*Context) PushFields ¶
type Device ¶
type Device struct { Source struct { Provider string `yaml:"provider"` EnergyMetric string `yaml:"energy_metric"` PowerMetric string `yaml:"power_metric"` TemperatureMetric string `yaml:"temperature_metric"` LightMetric string `yaml:"light_metric"` Address string `yaml:"address"` UserName string `yaml:"user_name,omitempty"` Password string `yaml:"password,omitempty"` Interval string `yaml:"interval"` Devices []struct { Name string `yaml:"name"` Room string `yaml:"room"` Address string `yaml:"address"` HmName string `yaml:"hm_name"` } `yaml:"devices"` // contains filtered or unexported fields } `yaml:"source"` }
type DeviceInterface ¶
type DeviceList ¶
type DeviceList struct {
Devices *[]DeviceInterface
}
type HomematicDesc ¶
type HomematicDesc struct { HmName string Name string Room string Interval float64 ScriptUrl string UserName string Password string EnergyMetric string EnergyChannel int PowerMetric string PowerChannel int TemperatureMetric string TemperatureChannel int TemperatureName string LightMetric string LightChannel int LightName string }
type HomematicDevice ¶
type HomematicDevice struct {
// contains filtered or unexported fields
}
func (*HomematicDevice) CategoryName ¶
func (t *HomematicDevice) CategoryName() string
func (*HomematicDevice) CurrentValue ¶
func (t *HomematicDevice) CurrentValue(ctx Context) (float64, error)
func (*HomematicDevice) DeviceID ¶
func (t *HomematicDevice) DeviceID() string
func (*HomematicDevice) FullName ¶
func (t *HomematicDevice) FullName() string
func (*HomematicDevice) IntervalSec ¶
func (t *HomematicDevice) IntervalSec() uint64
func (*HomematicDevice) Labels ¶
func (t *HomematicDevice) Labels() []string
func (*HomematicDevice) LastValue ¶
func (t *HomematicDevice) LastValue() string
func (*HomematicDevice) LogName ¶
func (t *HomematicDevice) LogName() string
func (*HomematicDevice) MetricName ¶
func (t *HomematicDevice) MetricName() string
func (*HomematicDevice) Name ¶
func (t *HomematicDevice) Name() string
func (*HomematicDevice) Room ¶
func (t *HomematicDevice) Room() string
type IoBrokerDevice ¶
type IoBrokerDevice struct {
// contains filtered or unexported fields
}
func (*IoBrokerDevice) CategoryName ¶
func (t *IoBrokerDevice) CategoryName() string
func (*IoBrokerDevice) CurrentValue ¶
func (t *IoBrokerDevice) CurrentValue(ctx Context) (float64, error)
func (*IoBrokerDevice) DeviceID ¶
func (t *IoBrokerDevice) DeviceID() string
func (*IoBrokerDevice) FullName ¶
func (t *IoBrokerDevice) FullName() string
func (*IoBrokerDevice) IntervalSec ¶
func (t *IoBrokerDevice) IntervalSec() uint64
func (*IoBrokerDevice) Labels ¶
func (t *IoBrokerDevice) Labels() []string
func (*IoBrokerDevice) LastValue ¶
func (t *IoBrokerDevice) LastValue() string
func (*IoBrokerDevice) LogName ¶
func (t *IoBrokerDevice) LogName() string
func (*IoBrokerDevice) MetricName ¶
func (t *IoBrokerDevice) MetricName() string
func (*IoBrokerDevice) Name ¶
func (t *IoBrokerDevice) Name() string
func (*IoBrokerDevice) Room ¶
func (t *IoBrokerDevice) Room() string
type TasmotaDevice ¶
type TasmotaDevice struct {
// contains filtered or unexported fields
}
func (*TasmotaDevice) CategoryName ¶
func (t *TasmotaDevice) CategoryName() string
func (*TasmotaDevice) CurrentValue ¶
func (t *TasmotaDevice) CurrentValue(ctx Context) (float64, error)
func (*TasmotaDevice) DeviceID ¶
func (t *TasmotaDevice) DeviceID() string
func (*TasmotaDevice) FullName ¶
func (t *TasmotaDevice) FullName() string
func (*TasmotaDevice) IntervalSec ¶
func (t *TasmotaDevice) IntervalSec() uint64
func (*TasmotaDevice) Labels ¶
func (t *TasmotaDevice) Labels() []string
func (*TasmotaDevice) LastValue ¶
func (t *TasmotaDevice) LastValue() string
func (*TasmotaDevice) LogName ¶
func (t *TasmotaDevice) LogName() string
func (*TasmotaDevice) MetricName ¶
func (t *TasmotaDevice) MetricName() string
func (*TasmotaDevice) Name ¶
func (t *TasmotaDevice) Name() string
func (*TasmotaDevice) Room ¶
func (t *TasmotaDevice) Room() string
type TasmotaEnergy ¶
type TasmotaEnergy struct { StatusSNS struct { Time string `json:"Time"` ENERGY struct { TotalStartTime string `json:"TotalStartTime"` Total float64 `json:"Total"` Yesterday float64 `json:"Yesterday"` Today float64 `json:"Today"` Power int `json:"Power"` ApparentPower int `json:"ApparentPower"` ReactivePower int `json:"ReactivePower"` Factor float64 `json:"Factor"` Voltage int `json:"Voltage"` Current float64 `json:"Current"` } `json:"ENERGY"` } `json:"StatusSNS"` }
type TasmotaStatus ¶
type TasmotaStatus struct { Status struct { Module int `json:"Module"` DeviceName string `json:"DeviceName"` FriendlyName []string `json:"FriendlyName"` Topic string `json:"Topic"` ButtonTopic string `json:"ButtonTopic"` Power int `json:"Power"` PowerOnState int `json:"PowerOnState"` LedState int `json:"LedState"` LedMask string `json:"LedMask"` SaveData int `json:"SaveData"` SaveState int `json:"SaveState"` SwitchTopic string `json:"SwitchTopic"` SwitchMode []int `json:"SwitchMode"` ButtonRetain int `json:"ButtonRetain"` SwitchRetain int `json:"SwitchRetain"` SensorRetain int `json:"SensorRetain"` PowerRetain int `json:"PowerRetain"` InfoRetain int `json:"InfoRetain"` StateRetain int `json:"StateRetain"` } `json:"Status"` }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.