indiclient

package
v0.0.0-...-03232b1 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	Properties Properties
	// contains filtered or unexported fields
}

func New

func New(address string, eventChan chan Event) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) Connect

func (c *Client) Connect(driver string) error

func (*Client) GetProperties

func (c *Client) GetProperties() error

func (*Client) NewPropertyValue

func (c *Client) NewPropertyValue(selector PropertySelector) error

type Event

type Event struct {
	EventType EventType
	Property  Property
	Message   string
}

type EventType

type EventType uint8
const (
	Add EventType = iota
	Update
	Delete
	Message
	Timeout
)

type Notifier

type Notifier interface {
	Register(Observer)
	Unregister(Observer)
	Notify(Event)
}

type Observer

type Observer interface {
	OnNotify(Event)
}

type Properties

type Properties []Property

func (Properties) FindProperty

func (p Properties) FindProperty(selector PropertySelector) *Property

func (Properties) GetDeviceGroupsSorted

func (p Properties) GetDeviceGroupsSorted(device string) []string

func (Properties) GetDevicesSorted

func (p Properties) GetDevicesSorted() []string

func (Properties) GetPropertiesForDeviceGroup

func (p Properties) GetPropertiesForDeviceGroup(device, group string) Properties

type Property

type Property struct {
	Device    string
	Group     string
	Type      PropertyType
	Name      string
	Label     string
	State     string
	Perm      string
	Timeout   int
	Timestamp string
	Rule      string
	Values    []Value
}

type PropertySelector

type PropertySelector struct {
	Device    string `json:"device"`
	Name      string `json:"name"`
	ValueName string `json:"valueName"`
}

type PropertyType

type PropertyType int64
const (
	Number PropertyType = iota
	Switch
	Text
)

type Trimmer

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

Trimmer is used to remove blank space from received XML

func (Trimmer) Token

func (tr Trimmer) Token() (xml.Token, error)

type Value

type Value struct {
	Name   string
	Label  string
	Value  string
	Format string
	Min    int
	Max    int
	Step   float64
}

Jump to

Keyboard shortcuts

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