FritzDECT: simplify

This commit is contained in:
andig 2022-07-13 12:50:41 +02:00
parent b4fd6264af
commit bdf9857c47
2 changed files with 3 additions and 6 deletions

View file

@ -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 {

View file

@ -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
}