electricpower

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2025 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PowerReader

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

func New

func New(a i2c.Connector, i2cBus int, s0PulsePerkWh uint32) *PowerReader

New creates a new object of power reader typical pulse rates are 10, 100 and 1000 pulses per kWh (1000 equals 1 pulse per Wh)

func (*PowerReader) Connection

func (pr *PowerReader) Connection() gobot.Connection

Connection implements gobot.Device

func (*PowerReader) GetKiloWattHoursOfLastDay added in v0.0.2

func (pr *PowerReader) GetKiloWattHoursOfLastDay() float64

GetKiloWattHoursOfLastDay returns the power consumption of the last 24h.

func (*PowerReader) GetKiloWattHoursOfLastHour added in v0.0.2

func (pr *PowerReader) GetKiloWattHoursOfLastHour() float64

GetKiloWattHoursOfLastHour returns the power consumption of the last hour.

func (*PowerReader) GetKiloWattHoursOfLastMinute added in v0.0.2

func (pr *PowerReader) GetKiloWattHoursOfLastMinute() float64

GetKiloWattHoursOfLastMinute returns the power consumption of the last minute.

func (*PowerReader) GetKiloWattHoursOfLastMonth added in v0.0.2

func (pr *PowerReader) GetKiloWattHoursOfLastMonth() float64

GetKiloWattHoursOfLastMonth returns the power consumption of the last 30 days.

func (*PowerReader) Halt

func (pr *PowerReader) Halt() error

Halt implements gobot.Device

func (*PowerReader) Name

func (pr *PowerReader) Name() string

Name implements gobot.Device

func (*PowerReader) Read

func (pr *PowerReader) Read() (float64, error)

Read reads the counter, updates the linear buffer and returns the consumed power in [kWh] since program start.

func (*PowerReader) SetName

func (pr *PowerReader) SetName(n string)

SetName implements gobot.Device

func (*PowerReader) Start

func (pr *PowerReader) Start() error

Jump to

Keyboard shortcuts

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