FritzDECT: simplify
This commit is contained in:
parent
b4fd6264af
commit
bdf9857c47
2 changed files with 3 additions and 6 deletions
|
|
@ -25,11 +25,8 @@ func init() {
|
|||
// NewFritzDECTFromConfig creates a fritzdect charger from generic config
|
||||
func NewFritzDECTFromConfig(other map[string]interface{}) (api.Charger, error) {
|
||||
cc := struct {
|
||||
URI string
|
||||
AIN string
|
||||
User string
|
||||
Password string
|
||||
StandbyPower float64
|
||||
fritzdect.Settings `mapstructure:",squash"`
|
||||
StandbyPower float64
|
||||
}{}
|
||||
|
||||
if err := util.DecodeOther(other, &cc); err != nil {
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ func init() {
|
|||
|
||||
// NewFritzDECTFromConfig creates a fritzdect meter from generic config
|
||||
func NewFritzDECTFromConfig(other map[string]interface{}) (api.Meter, error) {
|
||||
cc := &fritzdect.Settings{}
|
||||
var cc fritzdect.Settings
|
||||
if err := util.DecodeOther(other, &cc); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue