shelly

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolToFloat

func BoolToFloat(b bool) float64

func CelsiusToKelvin

func CelsiusToKelvin(celsius float64) float64

func DeviceLabels

func DeviceLabels(s *Shelly) []string

func LineLabels

func LineLabels(s *Shelly, kind string, line int) []string

Types

type Device

type Device interface {
	FetchStatus() error
	FillMetrics(m *Metrics)
}

type Metrics

type Metrics struct {
	Power                 *prometheus.GaugeVec
	PowerLimit            *prometheus.GaugeVec
	Current               *prometheus.GaugeVec
	CurrentLimit          *prometheus.GaugeVec
	NeutralCurrent        *prometheus.GaugeVec
	NeutralIxsum          *prometheus.GaugeVec
	NeutralMismatch       *prometheus.GaugeVec
	NeutralValid          *prometheus.GaugeVec
	Voltage               *prometheus.GaugeVec
	VoltageLimit          *prometheus.GaugeVec
	PowerFactor           *prometheus.GaugeVec
	Total                 *prometheus.CounterVec
	TotalReturned         *prometheus.CounterVec
	RelativeHumidity      *prometheus.GaugeVec
	Temperature           *prometheus.GaugeVec
	TemperatureDevice     *prometheus.GaugeVec
	Voltmeter             *prometheus.GaugeVec
	RelayOpen             *prometheus.GaugeVec
	RelayOverpowered      *prometheus.GaugeVec
	RelayValid            *prometheus.GaugeVec
	InputState            *prometheus.GaugeVec
	InputEventCount       *prometheus.CounterVec
	InputPercent          *prometheus.GaugeVec
	HasUpdate             *prometheus.GaugeVec
	CloudEnabled          *prometheus.GaugeVec
	CloudConnected        *prometheus.GaugeVec
	WifiConnected         *prometheus.GaugeVec
	WifiSignal            *prometheus.GaugeVec
	DevicePowerVoltage    *prometheus.GaugeVec
	DevicePowerPercentage *prometheus.GaugeVec
	LightBrightness       *prometheus.GaugeVec
	LightState            *prometheus.GaugeVec
	CoverPosition         *prometheus.GaugeVec
}

func NewMetrics

func NewMetrics(reg *prometheus.Registry) *Metrics

type Shelly

type Shelly struct {
	TargetHost string
	UserAgent  string
	Username   string
	Password   string
}

Jump to

Keyboard shortcuts

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