entities

package
v0.9.7 Latest Latest
Warning

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

Go to latest
Published: Aug 2, 2023 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 ApcHost

type ApcHost struct {
	IpAddress            string
	Name                 string
	NetworkSamplePeriod  time.Duration
	GraphingSamplePeriod time.Duration
	Enabled              bool
	TrayIcon             bool
	State                string
	Bloadpct             binding.String `json:"-"`
	Bbcharge             binding.String `json:"-"`
	Blinev               binding.String `json:"-"`
	Bcumonbatt           binding.String `json:"-"`
	Bxoffbatt            binding.String `json:"-"`
	Bxonbatt             binding.String `json:"-"`
	Bnumxfers            binding.String `json:"-"`
	Bmaster              binding.String `json:"-"`
	Bcable               binding.String `json:"-"`
}

func NewApcHost

func NewApcHost(name, ip string, networkSamplePeriod, graphingSamplePeriod time.Duration, enable, trayIcon bool) *ApcHost

func (*ApcHost) IsNil added in v0.9.3

func (a *ApcHost) IsNil() bool

type ChannelTuple

type ChannelTuple struct {
	Events chan []string
	Status chan []string
}

func NewChannelTuple

func NewChannelTuple(depth int) *ChannelTuple

func (*ChannelTuple) Close

func (ct *ChannelTuple) Close()

type Device added in v0.9.6

type Device struct {
	Id         string `json:"id"`
	Name       string `json:"name"`
	Label      string `json:"label"`
	Type       string `json:"type"`
	Room       string `json:"room"`
	Attributes []struct {
		Name         string      `json:"name"`
		CurrentValue interface{} `json:"currentValue"`
		DataType     string      `json:"dataType"`
		Values       []string    `json:"values,omitempty"`
	} `json:"attributes"`
	Capabilities []interface{} `json:"capabilities"`
	Commands     []string      `json:"commands"`
}

type DeviceCapabilities added in v0.9.6

type DeviceCapabilities struct {
	Capabilities []interface{} `json:"capabilities"`
}

type DeviceDetails added in v0.9.6

type DeviceDetails struct {
	Name         string      `json:"name"`
	Label        string      `json:"label"`
	Type         string      `json:"type"`
	Id           string      `json:"id"`
	Date         *string     `json:"date"`
	Model        interface{} `json:"model"`
	Manufacturer interface{} `json:"manufacturer"`
	Room         string      `json:"room"`
	Capabilities []string    `json:"capabilities"`
	Attributes   struct {
		Voltage   string      `json:"voltage"`
		DataType  string      `json:"dataType"`
		Values    interface{} `json:"values"`
		Energy    string      `json:"energy"`
		Amperage  string      `json:"amperage"`
		Frequency interface{} `json:"frequency"`
		Switch    string      `json:"switch"`
		Power     string      `json:"power"`
	} `json:"attributes"`
	Commands []struct {
		Command string `json:"command"`
	} `json:"commands"`
	BWattValue binding.Float `json:"-"`
}

type DeviceEvent added in v0.9.6

type DeviceEvent struct {
	DeviceId      string `json:"device_id"`
	Label         string `json:"label"`
	Room          string `json:"room"`
	Name          string `json:"name"`
	Value         string `json:"value"`
	Date          string `json:"date"`
	Unit          string `json:"unit"`
	IsStateChange bool   `json:"isStateChange"`
	Source        string `json:"source"`
}

type DeviceEventStream added in v0.9.6

type DeviceEventStream struct {
	Content struct {
		Name            string      `json:"name"`
		Value           string      `json:"value"`
		DisplayName     string      `json:"displayName"`
		DeviceId        string      `json:"deviceId"`
		DescriptionText string      `json:"descriptionText"`
		Unit            string      `json:"unit"`
		Type            interface{} `json:"type"`
		Data            interface{} `json:"data"`
	} `json:"content"`
}

type DeviceList added in v0.9.6

type DeviceList struct {
	Id    string `json:"id"`
	Name  string `json:"name"`
	Label string `json:"label"`
	Type  string `json:"type"`
	Room  string `json:"room"`
}

type GraphAverage added in v0.9.3

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

func NewGraphAverage added in v0.9.3

func NewGraphAverage(hostName, pointName string, graphPeriod time.Duration) *GraphAverage

NewGraphAverage create a data queue of graphPeriod depth returns the straight average of the queue,

func (*GraphAverage) AddValue added in v0.9.3

func (g *GraphAverage) AddValue(value float64) float64

AddValue adds the given float32 value into the queue and return the average value of the queue value queue's size is limited by graph period config value

func (*GraphAverage) IsNil added in v0.9.3

func (g *GraphAverage) IsNil() bool

func (*GraphAverage) SeriesName added in v0.9.3

func (g *GraphAverage) SeriesName() string

func (*GraphAverage) String added in v0.9.3

func (g *GraphAverage) String() string

type HubHost added in v0.9.6

type HubHost struct {
	Id            string
	Name          string
	IpAddress     string
	AccessToken   string
	ListenerUri   string // "http://IPADDR:2600/hubEvents"
	ThisIpAddress string
	Value         float64
	DeviceDetails []*DeviceDetails `json:"-"`
}

func NewHubHost added in v0.9.6

func NewHubHost(name, ipaddress, accessToken, listenOnIp string) *HubHost

type UpsStatusValueBindings added in v0.9.4

type UpsStatusValueBindings struct {
	Host       *ApcHost
	Bselftest  binding.String
	Bnumxfers  binding.String
	Blastxfer  binding.String
	Bxonbatt   binding.String
	Bxoffbatt  binding.String
	Btonbatt   binding.String
	Bcumonbatt binding.String
	Bhostname  binding.String
	Bupsname   binding.String
	Bmaster    binding.String
	Blinev     binding.String
	Bbattv     binding.String
	Bbcharge   binding.String
	Bloadpct   binding.String
	Btimeleft  binding.String
	Bversion   binding.String
	Bcable     binding.String
	Bdriver    binding.String
	Bupsmode   binding.String
	Bstarttime binding.String
	Bstatus    binding.String
	Bmodel     binding.String
	Bserialno  binding.String
	Bmandate   binding.String
	Bfirmware  binding.String
	Bbattdate  binding.String
	Bitemp     binding.String
}

UpsStatusValueBindings bond datapoints for UPS status display

func NewUpsStatusValueBindings added in v0.9.4

func NewUpsStatusValueBindings(h *ApcHost) *UpsStatusValueBindings

NewUpsStatusValueBindings creates a new collection of string to be bound to the view elements for UPS.

func (*UpsStatusValueBindings) Apply added in v0.9.4

func (b *UpsStatusValueBindings) Apply(params map[string]string)

Apply reads slices from provided channel and assigns value to bond strings

func (*UpsStatusValueBindings) IsNil added in v0.9.4

func (b *UpsStatusValueBindings) IsNil() bool

func (*UpsStatusValueBindings) UnbindUpsData added in v0.9.4

func (b *UpsStatusValueBindings) UnbindUpsData()

Jump to

Keyboard shortcuts

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