climate

package
v0.8.3 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DeviceMetrics

type DeviceMetrics struct {
	// Zone is the zone the device belongs to
	Zone string
	// ConnectionState is true if the device is reachable
	ConnectionState bool
	// BatteryState is true if the battery is healthy
	BatteryState bool
}

type HomeMetrics

type HomeMetrics struct {
	// States contains all encountered home states. The current home state is set to true.
	States map[string]bool
	// ID of the home
	ID int64
	// Manual indicates that the current home mode is set manually
	Manual bool
}

func (HomeMetrics) IsHome

func (h HomeMetrics) IsHome() bool

type MetricDescriptors

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

func NewMetricDescriptors

func NewMetricDescriptors(prefix string) *MetricDescriptors

func (*MetricDescriptors) Describe

func (d *MetricDescriptors) Describe(ch chan<- *prometheus.Desc)

type Metrics

type Metrics struct {
	Users   UserMetrics
	Devices map[string]DeviceMetrics
	Zones   map[string]ZoneMetrics
	Weather WeatherMetrics
	Home    HomeMetrics
	// contains filtered or unexported fields
}

func (Metrics) Collect

func (m Metrics) Collect(ch chan<- prometheus.Metric)

func (Metrics) Describe

func (m Metrics) Describe(ch chan<- *prometheus.Desc)

func (Metrics) WithMetricDescriptors added in v0.8.1

func (m Metrics) WithMetricDescriptors(descriptors *MetricDescriptors) Metrics

type OverlayMode

type OverlayMode int

OverlayMode represents the current overlay mode of a zone.

const (
	OverlayModeOff OverlayMode = iota
	OverlayModeManual
	OverlayModeTimer
)

type UserMetrics

type UserMetrics struct {
	// 	// States is the home presence of geotagged users
	States map[string]bool
}

type WeatherMetrics

type WeatherMetrics struct {
	// States contains all encountered weather states. The current weather state is set to true.
	States map[string]bool
	// SolarIntensity contains the solar intensity as a percentage (0.0 - 1.0)
	SolarIntensity float32
	// OutsideTemperature contains the outside temperature in degrees Celsius
	OutsideTemperature float32
}

func (WeatherMetrics) Weather

func (m WeatherMetrics) Weather() string

type ZoneMetrics

type ZoneMetrics struct {
	// Type is the type of system (heating, air conditioning, etc.)
	Type string
	// ID is the zone's unique identifier
	ID int64
	// OverlayMode indicates if the zone is controlled manually
	OverlayMode OverlayMode
	// OverlayRemaining is the remaining time in seconds for the manual control.
	// This is only used when OverlayMode is [OverlayModeTimer]
	OverlayRemaining time.Duration
	// OpenWindowDuration is the amount of time that the window has been open
	OpenWindowDuration time.Duration
	// OpenWindowRemaining is the amount of time before heating is switched on again
	OpenWindowRemaining time.Duration
	// Temperature is the zone's temperature, in Celsius
	Temperature float32
	// Humidity is the zone's humidity, in percent (0.0 - 1.0)
	Humidity float32
	// TargetTemperature is the zone's target temperature
	TargetTemperature float32
	// OpenWindow is true if the window is open
	OpenWindow bool
	// Heating is true if the zone is being heated
	Heating bool
}

Directories

Path Synopsis
bot

Jump to

Keyboard shortcuts

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