model

package
v0.0.0-...-6684604 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: AGPL-3.0 Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Contact

type Contact struct {
	Changes uint64
	Status  uint8
	Value   float64
	Unit    string
	Name    string
	// contains filtered or unexported fields
}

func NewContact

func NewContact(deviceID uint64, probeID uint64, id uint64) *Contact

func (*Contact) DeviceID

func (c *Contact) DeviceID() uint64

func (*Contact) ID

func (c *Contact) ID() uint64

func (*Contact) ProbeID

func (c *Contact) ProbeID() uint64

type Device

type Device struct {
	LastSeen uint64
	Uptime   uint64
	Model    uint8
	Firmware string
	Address  string
	Name     string

	Probes []Probe
	// contains filtered or unexported fields
}

func NewDevice

func NewDevice(id uint64) *Device

func (*Device) FindProbeById

func (d *Device) FindProbeById(id uint64, group ProbeGroup) (Probe, bool)

func (*Device) ID

func (d *Device) ID() uint64

type Probe

type Probe struct {
	PrimaryAddress   uint64
	SecondaryAddress uint64
	Name             string

	Contacts []Contact
	// contains filtered or unexported fields
}

func NewProbe

func NewProbe(deviceID uint64, id uint64, group ProbeGroup) *Probe

func (*Probe) DeviceID

func (p *Probe) DeviceID() uint64

func (*Probe) FindContactById

func (p *Probe) FindContactById(id uint64) (Contact, bool)

func (*Probe) Group

func (p *Probe) Group() ProbeGroup

func (*Probe) ID

func (p *Probe) ID() uint64

func (*Probe) SetContact

func (p *Probe) SetContact(m Contact) []Contact

type ProbeGroup

type ProbeGroup string
const (
	MeterProbeGroup  ProbeGroup = "meter"
	InputProbeGroup  ProbeGroup = "input"
	OutputProbeGroup ProbeGroup = "output"
	SensorProbeGroup ProbeGroup = "sensor"
)

func (ProbeGroup) String

func (t ProbeGroup) String() string

Jump to

Keyboard shortcuts

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