collector

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: MIT Imports: 13 Imported by: 1

Documentation

Index

Constants

View Source
const (
	Channel = "org.codeberg.clambin.proteus.tado"
)
View Source
const ZoneOverlayTerminationTypeNONE = tado.ZoneOverlayTerminationType("NONE")

Variables

This section is empty.

Functions

func NewCollector

func NewCollector(
	publisher collector.Publisher[Update],
	poller collector.Poller[Update],
	namespace string,
	logger *slog.Logger,
) *collector.PublishingCollector[Update]

Types

type MobileDevices

type MobileDevices []tado.MobileDevice

func (MobileDevices) GeoTrackedDevices

func (m MobileDevices) GeoTrackedDevices() iter.Seq[tado.MobileDevice]

func (MobileDevices) GetDeviceState

func (m MobileDevices) GetDeviceState(ids ...tado.MobileDeviceId) ([]string, []string)

func (MobileDevices) GetMobileDevice

func (m MobileDevices) GetMobileDevice(deviceName string) (tado.MobileDevice, bool)

func (MobileDevices) LogValue

func (m MobileDevices) LogValue() slog.Value

type Poller

type Poller struct {
	Client TadoClient
	Logger *slog.Logger
}

func (*Poller) Poll

func (p *Poller) Poll(ctx context.Context) (Update, error)

type TadoClient

type TadoClient interface {
	GetMeWithResponse(ctx context.Context, reqEditors ...tado.RequestEditorFn) (*tado.GetMeResponse, error)
	GetZonesWithResponse(ctx context.Context, homeId tado.HomeId, reqEditors ...tado.RequestEditorFn) (*tado.GetZonesResponse, error)
	GetZoneStateWithResponse(ctx context.Context, homeId tado.HomeId, zoneId tado.ZoneId, reqEditors ...tado.RequestEditorFn) (*tado.GetZoneStateResponse, error)
	GetMobileDevicesWithResponse(ctx context.Context, homeId tado.HomeId, reqEditors ...tado.RequestEditorFn) (*tado.GetMobileDevicesResponse, error)
	GetWeatherWithResponse(ctx context.Context, homeId tado.HomeId, reqEditors ...tado.RequestEditorFn) (*tado.GetWeatherResponse, error)
	GetHomeStateWithResponse(ctx context.Context, homeId tado.HomeId, reqEditors ...tado.RequestEditorFn) (*tado.GetHomeStateResponse, error)
}

type Update

type Update struct {
	HomeBase      tado.HomeBase  `json:"homeBase"`
	HomeState     tado.HomeState `json:"homeState"`
	Weather       tado.Weather   `json:"weather"`
	Zones         Zones          `json:"zones"`
	MobileDevices MobileDevices  `json:"mobileDevices"`
}

func (Update) Home

func (u Update) Home() bool

type Zone

type Zone struct {
	Zone      tado.Zone      `json:"zone"`
	ZoneState tado.ZoneState `json:"zoneState"`
}

func (Zone) GetTargetTemperature

func (z Zone) GetTargetTemperature() float32

func (Zone) GetZoneOverlayTerminationType

func (z Zone) GetZoneOverlayTerminationType() tado.ZoneOverlayTerminationType

type Zones

type Zones []Zone

func (Zones) GetZone

func (z Zones) GetZone(name string) (Zone, bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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