trv

package
v0.2024.5 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const DefaultPollInterval = 30 * time.Second
View Source
const DriverName = "shelly-trv"

Variables

View Source
var Factory driver.Factory = factory{}

Functions

func DataToAirTemperature

func DataToAirTemperature(data ThermostatData) *traits.AirTemperature

Types

type Driver

type Driver struct {
	*service.Service[config.Root]
	// contains filtered or unexported fields
}

type TRV

type TRV struct {
	Data *concurrent.Value[ThermostatData]
	// contains filtered or unexported fields
}

func NewTRV

func NewTRV(conf config.TRVConfig, logger *zap.Logger) (*TRV, error)

func (*TRV) ClearTargetTemperature

func (t *TRV) ClearTargetTemperature(ctx context.Context) error

func (*TRV) Poll

func (t *TRV) Poll(ctx context.Context) error

func (*TRV) Refresh

func (t *TRV) Refresh(ctx context.Context) (data ThermostatData, err error)

API calls

func (*TRV) SetTargetTemperature

func (t *TRV) SetTargetTemperature(ctx context.Context, temperature float64) error

type ThermostatData

type ThermostatData struct {
	Position          float64 `json:"pos"`
	TargetTemperature struct {
		Enabled bool    `json:"enabled"`
		Value   float64 `json:"value"`
		Units   string  `json:"units"`
	} `json:"target_t"`
	Temperature struct {
		Value   float64 `json:"value"`
		Units   string  `json:"units"`
		IsValid bool    `json:"is_valid"`
	} `json:"tmp"`
	Schedule        bool `json:"schedule"`
	ScheduleProfile int  `json:"schedule_profile"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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