klf200

package module
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: GPL-3.0 Imports: 12 Imported by: 0

README

klf200-go

Velux KLF 200 client for golang

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func MakeClient

func MakeClient(servAddr string, password string, log Logger) *Client

func (*Client) Close

func (client *Client) Close()

func (*Client) Commands

func (client *Client) Commands() *Commands

func (*Client) Config

func (client *Client) Config() *Config

func (*Client) Device

func (client *Client) Device() *Device

func (*Client) Info

func (client *Client) Info() *Info

func (*Client) RegisterNotifications

func (client *Client) RegisterNotifications(types []reflect.Type) Notifier

func (*Client) RegisterStatusChange

func (client *Client) RegisterStatusChange(callback func(ConnectionStatus))

func (*Client) Start

func (client *Client) Start()

func (*Client) Status

func (client *Client) Status() ConnectionStatus

type Commands

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

func (*Commands) ChangePosition

func (cmds *Commands) ChangePosition(ctx context.Context, nodeIndex int, position commands.MPValue) (*Session, error)

func (*Commands) Mode

func (cmds *Commands) Mode(ctx context.Context, nodeIndex int) (*Session, error)

func (*Commands) Status

func (cmds *Commands) Status(ctx context.Context, nodeIndexes []int) ([]*StatusData, error)

type Config

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

func (*Config) GetSystemTable

func (config *Config) GetSystemTable(ctx context.Context) ([]commands.SystemtableObject, error)

type ConnectionStatus

type ConnectionStatus uint8
const (
	ConnectionClosed      ConnectionStatus = 0
	ConnectionHandshaking ConnectionStatus = 1
	ConnectionOpen        ConnectionStatus = 2
)

func (ConnectionStatus) String

func (status ConnectionStatus) String() string

type Device

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

func (*Device) ChangePassword

func (dev *Device) ChangePassword(newPassword string) error

func (*Device) GetLocalTime

func (dev *Device) GetLocalTime() (*commands.GetLocalTimeCfm, error)

func (*Device) GetNetworkSetup

func (dev *Device) GetNetworkSetup() (*commands.GetNetworkSetupCfm, error)

func (*Device) GetProtocolVersion

func (dev *Device) GetProtocolVersion() (*commands.GetProtocolVersionCfm, error)

func (*Device) GetState

func (dev *Device) GetState() (*commands.GetStateCfm, error)

func (*Device) GetVersion

func (dev *Device) GetVersion() (*commands.GetVersionCfm, error)

func (*Device) LeaveLearnState

func (dev *Device) LeaveLearnState() error

func (*Device) Reboot

func (dev *Device) Reboot() error

func (*Device) SetFactoryDefault

func (dev *Device) SetFactoryDefault() error

func (*Device) SetTimeZone

func (dev *Device) SetTimeZone(tzstr string) error

func (*Device) SetUtc

func (dev *Device) SetUtc(timestamp time.Time) error

type Event

type Event interface {
}

type Info

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

func (*Info) GetAllNodesInformation

func (info *Info) GetAllNodesInformation(ctx context.Context) ([]*commands.GetAllNodesInformationNtf, error)

type Logger

type Logger interface {
	Debugf(format string, args ...interface{})
	Infof(format string, args ...interface{})
	Warnf(format string, args ...interface{})
	Errorf(format string, args ...interface{})

	Debug(msg string)
	Info(msg string)
	Warn(msg string)
	Error(msg string)

	WithError(err error) Logger
}

type Notifier

type Notifier interface {
	Stream() <-chan commands.Notify
	Close()
}

type RunError

type RunError struct {
	Err error
}

type RunRemainingTime

type RunRemainingTime struct {
	Duration time.Duration
}

type RunStatus

type RunStatus struct {
	StatusID       commands.CommandRunOwner
	ParameterValue commands.MPValue
	RunStatus      commands.CommandRunStatus
	StatusReply    commands.CommandRunStatusReply
}

type Session

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

func (*Session) Events

func (sess *Session) Events() <-chan Event

type StatusData

type StatusData struct {
	NodeIndex                  int
	StatusID                   commands.CommandRunOwner
	RunStatus                  commands.CommandRunStatus
	StatusReply                commands.CommandRunStatusReply
	TargetPosition             commands.MPValue
	CurrentPosition            commands.MPValue
	RemainingTime              time.Duration
	LastMasterExecutionAddress uint32
	LastCommandOriginator      commands.CommandOriginator
}

Directories

Path Synopsis
klf200 module

Jump to

Keyboard shortcuts

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