charge

package
v0.2.32 Latest Latest
Warning

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

Go to latest
Published: Mar 30, 2023 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Overview

Package charge implements a charge controller sensor

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AttrConfig

type AttrConfig struct {
	Path     string `json:"serial_path"`
	Baud     int    `json:"serial_baud_rate"`
	ModbusID byte   `json:"modbus_id"`
}

AttrConfig is used for converting config attributes.

type Charge

type Charge struct {
	SolarVolt             float32
	SolarAmp              float32
	SolarWatt             float32
	LoadVolt              float32
	LoadAmp               float32
	LoadWatt              float32
	BattVolt              float32
	BattChargePct         float32
	BattDegC              int16
	ControllerDegC        int16
	MaxSolarTodayWatt     float32
	MinSolarTodayWatt     float32
	MaxBattTodayVolt      float32
	MinBattTodayVolt      float32
	MaxSolarTodayAmp      float32
	MinSolarTodayAmp      float32
	ChargeTodayWattHrs    float32
	DischargeTodayWattHrs float32
	ChargeTodayAmpHrs     float32
	DischargeTodayAmpHrs  float32
	TotalBattOverCharges  float32
	TotalBattFullCharges  float32
}

Charge represents a charge state.

type Sensor

type Sensor struct {
	Name string

	generic.Unimplemented
	// contains filtered or unexported fields
}

Sensor is a serial charge controller.

func (*Sensor) GetControllerOutput

func (s *Sensor) GetControllerOutput(ctx context.Context) (Charge, error)

GetControllerOutput returns current readings from the charge controller.

func (*Sensor) Readings

func (s *Sensor) Readings(ctx context.Context, extra map[string]interface{}) (map[string]interface{}, error)

Readings returns a list containing single item (current temperature).

Jump to

Keyboard shortcuts

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