rules

package
v0.0.0-...-8d45dd8 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Embedded embed.FS

Functions

This section is empty.

Types

type Actions

type Actions struct {
	Capabilities Capabilities
}

type Capabilities

type Capabilities struct {
	Add    map[string]CapabilityValues
	Remove map[string]CapabilityValues
}

type CapabilityValues

type CapabilityValues map[string]string

type CompiledActions

type CompiledActions struct {
	Capabilities CompiledCapabilities
}

type CompiledCapabilities

type CompiledCapabilities struct {
	Add    map[string]CompiledCapabilityValues
	Remove map[string]CompiledCapabilityValues
}

type CompiledCapabilityValues

type CompiledCapabilityValues map[string]*vm.Program

type CompiledRule

type CompiledRule struct {
	Description string
	Filter      *vm.Program
	Actions     CompiledActions
	Children    []CompiledRule
}

type Engine

type Engine struct {
	RuleSets map[string]RuleSet
	Rules    []CompiledRule
}

func New

func New() *Engine

func (*Engine) CompileRules

func (e *Engine) CompileRules() error

func (*Engine) Execute

func (e *Engine) Execute(i Input) (Output, error)

func (*Engine) LoadFS

func (e *Engine) LoadFS(lFS fs.FS) error

func (*Engine) LoadReader

func (e *Engine) LoadReader(r io.Reader) error

type Fn

type Fn struct{}

func (Fn) AttributeID

func (f Fn) AttributeID(a int) zcl.AttributeID

func (Fn) ClusterID

func (f Fn) ClusterID(c int) zigbee.ClusterID

func (Fn) Endpoint

func (f Fn) Endpoint(e int) zigbee.Endpoint

type Input

type Input struct {
	Node     InputNode
	Self     int
	Product  map[int]InputProductData
	Endpoint map[int]InputEndpoint
	Fn       Fn
}

type InputEndpoint

type InputEndpoint struct {
	ID          int
	ProfileID   int
	DeviceID    int
	InClusters  []int
	OutClusters []int
}

type InputNode

type InputNode struct {
	ManufacturerCode int
	Type             string
}

type InputProductData

type InputProductData struct {
	Name         string
	Manufacturer string
	Version      string
	Serial       string
}

type Output

type Output struct {
	Capabilities map[string]map[string]any
}

type Rule

type Rule struct {
	Description string
	Filter      string
	Actions     Actions
	Children    []Rule
}

type RuleSet

type RuleSet struct {
	Name      string
	DependsOn []string
	Rules     []Rule
}

Jump to

Keyboard shortcuts

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