Documentation
¶
Index ¶
- Variables
- type Sensor
- type Sensors
- type Simple
- func (s *Simple) AppConfig() []appconfig.ConfigValue
- func (s *Simple) ApplyOverlay(overlay *devicetree.DeviceTree) error
- func (s *Simple) CPPComponentType() string
- func (s *Simple) Clusters() cluster.Clusters
- func (s *Simple) Includes() []string
- func (s *Simple) Label() string
- func (s *Simple) NeedsDevice() bool
- func (s *Simple) String() string
- func (s *Simple) Template() string
- func (s *Simple) WriteFiles() []generator.WriteFile
- type WithExtenders
Constants ¶
This section is empty.
Variables ¶
View Source
var SensorLabelFn = func(s Sensor) string { sensorCounter += 1 cleanLabel := strings.ReplaceAll(strings.ToLower(fmt.Sprintf("%T_", s)), ".", "_") return strings.TrimPrefix(cleanLabel, "*") + strconv.Itoa(sensorCounter) }
SensorLabelFn returns a unique label for a sensor.
Functions ¶
This section is empty.
Types ¶
type Sensor ¶
type Sensor interface {
// Stringer is for human-readable name
fmt.Stringer
// Label returns unique label value for the sensor.
// Generally this method should not be defined by user,
// intstead it will be defined in embedded `*base.Base`
Label() string
Template() string
// Some additional functions to complement code generation
// and setup for C code.
NeedsDevice() bool
CPPComponentType() string
cluster.Provider
appconfig.Provider
devicetree.Applier
}
type Sensors ¶
type Sensors []Sensor
func (*Sensors) UniqueClusters ¶
UniqueClusters will return all unique clusters across all the sensors. Clusters might be configured for a specific sensor, so this method is mostly useful to *know* which clusters are available.
type Simple ¶
type Simple struct {
SensorName string
SensorLabel string
SensorTemplate string
SensorIncludes []string
SensorWriteFiles []generator.WriteFile
SensorNeedsDevice bool
SensorCPPComponentType string
SensorClusters cluster.Clusters
SensorAppConfig []appconfig.ConfigValue
SensorAppOverlay func(*devicetree.DeviceTree) error
}
func (*Simple) AppConfig ¶
func (s *Simple) AppConfig() []appconfig.ConfigValue
func (*Simple) ApplyOverlay ¶
func (s *Simple) ApplyOverlay(overlay *devicetree.DeviceTree) error
func (*Simple) CPPComponentType ¶
func (*Simple) NeedsDevice ¶
func (*Simple) WriteFiles ¶
type WithExtenders ¶
Click to show internal directories.
Click to hide internal directories.