Documentation ¶
Index ¶
- func DeviceTree(client modbus.Client) ([]sunspec.Device, error)
- func FixKostal(p sunspec.Point)
- type SunSpec
- func (d *SunSpec) Descriptor() meters.DeviceDescriptor
- func (d *SunSpec) Initialize(client modbus.Client) error
- func (d *SunSpec) InitializeWithTree(devices []sunspec.Device) error
- func (d *SunSpec) Probe(client modbus.Client) (res meters.MeasurementResult, err error)
- func (d *SunSpec) Query(client modbus.Client) (res []meters.MeasurementResult, err error)
- func (d *SunSpec) QueryOp(client modbus.Client, measurement meters.Measurement) (res meters.MeasurementResult, err error)
- func (d *SunSpec) QueryPoint(client modbus.Client, modelID, blockID int, pointID string) (float64, error)
- func (d *SunSpec) QueryPointAny(client modbus.Client, modelID, blockID int, pointID string) (block sunspec.Block, point sunspec.Point, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DeviceTree ¶
Initialize reads the device tree
func FixKostal ¶
FixKostal implements workaround for negative KOSTAL values (https://github.com/volkszaehler/mbmd/pull/97)
Types ¶
type SunSpec ¶
type SunSpec struct {
// contains filtered or unexported fields
}
SunSpec is the sunspec device implementation
func (*SunSpec) Descriptor ¶
func (d *SunSpec) Descriptor() meters.DeviceDescriptor
Descriptor implements the Device interface
func (*SunSpec) Initialize ¶
Initialize implements the Device interface
func (*SunSpec) InitializeWithTree ¶
func (*SunSpec) Query ¶
Query is called by the handler after preparing the bus by setting the device id and waiting for rate limit The results are scaled as defined in the divider map.
func (*SunSpec) QueryOp ¶
func (d *SunSpec) QueryOp(client modbus.Client, measurement meters.Measurement) (res meters.MeasurementResult, err error)
QueryOp queries all models and blocks until measurement is found. The result is scaled as defined in the divider map.
Click to show internal directories.
Click to hide internal directories.