Documentation
¶
Overview ¶
Package devicelogic ports the optional device behaviour simulators in pydevccu/device_logic. Each simulator runs a goroutine that toggles device values on a configurable interval to produce a steady stream of events for integration tests.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var Registry = map[string]Constructor{
"HM-Sec-SC-2": newHMSecSC2,
"HM-Sen-MDIR-WM55": newHMSenMDIRWM55,
}
Registry maps device-type names to their simulator constructors.
Functions ¶
This section is empty.
Types ¶
type Config ¶
Config controls the work loops.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig matches pydevccu's default startupdelay=5s, interval=60s.
type Constructor ¶
Constructor builds a Device. interval and startupDelay are taken from the user-supplied logic configuration.
type RPC ¶
type RPC interface {
Active() bool
GetValue(address, valueKey string) (any, error)
SetValue(address, valueKey string, value any, force bool) error
FireEvent(interfaceID, address, valueKey string, value any)
}
RPC is the subset of the CCU API required by a logic simulator. The production type is *ccu.RPCFunctions but the package consumes the surface via this interface so unit tests can stub it.