Documentation ¶
Overview ¶
Package fake is a fake PowerSensor for testing
Index ¶
- type Config
- type PowerSensor
- func (f *PowerSensor) Close(ctx context.Context) error
- func (f *PowerSensor) Current(ctx context.Context, cmd map[string]interface{}) (float64, bool, error)
- func (f *PowerSensor) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
- func (f *PowerSensor) Power(ctx context.Context, cmd map[string]interface{}) (float64, error)
- func (f *PowerSensor) Readings(ctx context.Context, extra map[string]interface{}) (map[string]interface{}, error)
- func (f *PowerSensor) Voltage(ctx context.Context, cmd map[string]interface{}) (float64, bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
resource.TriviallyValidateConfig
}
Config is used for converting fake movementsensor attributes.
type PowerSensor ¶
type PowerSensor struct { resource.Named resource.AlwaysRebuild // contains filtered or unexported fields }
PowerSensor implements a fake PowerSensor interface.
func (*PowerSensor) Close ¶
func (f *PowerSensor) Close(ctx context.Context) error
Close closes the fake powersensor.
func (*PowerSensor) Current ¶
func (f *PowerSensor) Current(ctx context.Context, cmd map[string]interface{}) (float64, bool, error)
Current gets the current and isAC of a fake powersensor.
func (*PowerSensor) DoCommand ¶
func (f *PowerSensor) DoCommand(ctx context.Context, cmd map[string]interface{}) (map[string]interface{}, error)
DoCommand uses a map string to run custom functionality of a fake powersensor.
Click to show internal directories.
Click to hide internal directories.