Documentation
¶
Index ¶
- func ComputeDeviceInfo(version string) *hass.Device
- func RegisterConfigurationPartParser(key string, parser ConfigurationPartParser) error
- type ConfigurationContext
- type ConfigurationPartParser
- type ConfigurationSection
- type DeviceInitializer
- type RuntimeContext
- type StartLevel
- type WscgoConfiguration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputeDeviceInfo ¶
ComputeDeviceInfo extracts discovery metadata from the host system
func RegisterConfigurationPartParser ¶
func RegisterConfigurationPartParser(key string, parser ConfigurationPartParser) error
RegisterConfigurationPartParser registers a configuratuin part parser
Types ¶
type ConfigurationContext ¶
type ConfigurationContext interface {
AddDeviceInitializer(StartLevel, DeviceInitializer)
}
ConfigurationContext is holder initializers
type ConfigurationPartParser ¶
type ConfigurationPartParser interface { // ParseConfiguration parses the given section expected to provide configuration the given context ParseConfiguration(ConfigurationSection, ConfigurationContext) error }
ConfigurationPartParser is an object capable of parsing a particular type of configuration section
func GetConfigurationPartParser ¶
func GetConfigurationPartParser(key string) (ConfigurationPartParser, error)
GetConfigurationPartParser finds configuration part parser by name
type ConfigurationSection ¶
type ConfigurationSection interface { // FillData fills the values held by this instance to the given struct FillData(interface{}) error // GetID returns the locally unique identifier of this section GetID() string }
ConfigurationSection denotes a section in the configuration
type DeviceInitializer ¶
type DeviceInitializer func(RuntimeContext) error
DeviceInitializer is a function capable of initializing a device
type RuntimeContext ¶
type RuntimeContext interface { // AddDevice registers a device to this context AddDevice(devices.Device) // AddProtocol registers a protocol connection to this context AddProtocol(protocol.IDiscoverable) }
RuntimeContext is holding devices and protocol conntections
type StartLevel ¶
type StartLevel int
StartLevel is used to order in which the devices are initialized
const SLDevice StartLevel = 10
SLDevice is the default start level for controlled devices
const SLExtender StartLevel = 0
SLExtender is the default start level for IO extenders
type WscgoConfiguration ¶
type WscgoConfiguration struct { protocol.MqttConfig // Node holds discovery metadata for the WSCGO instance Node protocol.DiscoverableNode // contains filtered or unexported fields }
WscgoConfiguration holds the configuration of a WSCGO instance
func LoadConfig ¶
func LoadConfig(filename string) *WscgoConfiguration
LoadConfig loads a configuration ini file
func (*WscgoConfiguration) AddDeviceInitializer ¶
func (config *WscgoConfiguration) AddDeviceInitializer(startLevel StartLevel, d DeviceInitializer)
AddDeviceInitializer registers a device initializer
func (*WscgoConfiguration) GetDeviceInitializers ¶
func (config *WscgoConfiguration) GetDeviceInitializers() []DeviceInitializer
GetDeviceInitializers returns the list of initializers configured