poller

package
v0.16.0 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const ZoneOverlayTerminationTypeNONE = tado.ZoneOverlayTerminationType("NONE")

Variables

This section is empty.

Functions

This section is empty.

Types

type MobileDevices

type MobileDevices []tado.MobileDevice

func (MobileDevices) GeoTrackedDevices added in v0.16.0

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

func (MobileDevices) GetDeviceState added in v0.16.0

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

func (MobileDevices) GetMobileDevice added in v0.16.0

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

func (MobileDevices) LogValue

func (m MobileDevices) LogValue() slog.Value

type Poller

type Poller interface {
	Subscribe() chan Update
	Unsubscribe(ch chan Update)
	Refresh()
}

type TadoClient added in v0.16.0

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 TadoPoller

type TadoPoller struct {
	TadoClient
	*pubsub.Publisher[Update]

	HomeId tado.HomeId
	// contains filtered or unexported fields
}

func New

func New(tadoClient TadoClient, interval time.Duration, logger *slog.Logger) *TadoPoller

func (*TadoPoller) Refresh

func (p *TadoPoller) Refresh()

func (*TadoPoller) Run

func (p *TadoPoller) Run(ctx context.Context) error

type Update

type Update struct {
	tado.HomeBase
	tado.HomeState
	tado.Weather
	Zones
	MobileDevices
}

func (Update) Home

func (u Update) Home() bool

type Zone added in v0.16.0

type Zone struct {
	tado.Zone
	tado.ZoneState
}

func (Zone) GetTargetTemperature added in v0.16.0

func (z Zone) GetTargetTemperature() float32

func (Zone) GetZoneOverlayTerminationType added in v0.16.0

func (z Zone) GetZoneOverlayTerminationType() tado.ZoneOverlayTerminationType

type Zones added in v0.16.0

type Zones []Zone

func (Zones) GetZone added in v0.16.0

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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