device

package
v3.2.2 Latest Latest
Warning

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

Go to latest
Published: Apr 16, 2024 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const AvailabilityOfflineValue = "offline"
View Source
const AvailabilityOnlineValue = "online"
View Source
const AvailabilityRegisterName = "Available"

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config interface {
	Name() string
	Filter() dataflow.RegisterFilterConf
	LogDebug() bool
	LogComDebug() bool
}

type Device

type Device interface {
	Name() string
	Config() Config
	RegisterDb() *dataflow.RegisterDb
	SubscribeAvailableSendInitial(ctx context.Context) (availChan <-chan bool)
	Model() string
	Run(ctx context.Context) (err error, immediateError bool)
}

type State

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

func NewState

func NewState(deviceConfig Config, stateStorage *dataflow.ValueStorage) State

func (*State) Config

func (c *State) Config() Config

func (*State) GetAvailableByState

func (c *State) GetAvailableByState(state []dataflow.Value) (avail, ok bool)

func (*State) Name

func (c *State) Name() string

func (*State) RegisterDb

func (c *State) RegisterDb() *dataflow.RegisterDb

func (*State) SetAvailable

func (c *State) SetAvailable(v bool)

func (*State) StateStorage

func (c *State) StateStorage() *dataflow.ValueStorage

func (*State) SubscribeAvailableSendInitial

func (c *State) SubscribeAvailableSendInitial(ctx context.Context) <-chan bool

func (*State) UpdateAvailable

func (c *State) UpdateAvailable(oldAvail bool, newValue dataflow.Value) (avail, updated bool)

Jump to

Keyboard shortcuts

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