func NewSMAFromConfig(other map[string]interface{}) (api.Meter, error) {
	cc := struct {
		URI, Password, Interface string
		Serial                   uint32
		Power, Energy            string
		Scale                    float64 // power only
	}{
		Password: "0000",
		Scale:    1,
	}

	if err := util.DecodeOther(other, &cc); err != nil {
		return nil, err
	}

	if cc.Power != "" || cc.Energy != "" {
		util.NewLogger("sma").WARN.Println("energy and power setting are deprecated and will be removed in a future release")
	}

	return NewSMA(cc.URI, cc.Password, cc.Interface, cc.Serial, cc.Scale)
}
// NewSMAFromConfig creates a SMA Meter from generic config
NewSMAFromConfig creates a SMA Meter from generic config
// NewSMAFromConfig creates a SMA Meter from generic config
func NewSMAFromConfig(other map[string]interface{}) (api.Meter, error) {
	cc := struct {
		URI, Password, Interface string
		Serial                   uint32
		Power, Energy            string
		Scale                    float64 
	}{
		Password: "0000",
		Scale:    1,
	}
	if err := util.DecodeOther(other, &cc); err != nil {
		return nil, err
	}
	if cc.Power != "" || cc.Energy != "" {
		util.NewLogger("sma").WARN.Println("energy and power setting are deprecated and will be removed in a future release")
	}
	return NewSMA(cc.URI, cc.Password, cc.Interface, cc.Serial, cc.Scale)
}
func NewSMAFromConfig ( other map [ string ] interface { } ) ( api . Meter , error ) { cc := struct { URI , Password , Interface string Serial uint32 Power , Energy string Scale float64 } { Password : " " , Scale : 1 , } if err := util . DecodeOther ( other , & cc ) ; err != nil { return nil , err } if cc . Power != " " || cc . Energy != " " { util . NewLogger ( " " ) . WARN . Println ( " " ) } return NewSMA ( cc . URI , cc . Password , cc . Interface , cc . Serial , cc . Scale ) }
NewSMAFromConfig creates a SMA Meter from generic config
NewSMAFromConfig creates a SMA Meter from generic config
// power only