diff --git a/charger/hardybarth.go b/charger/hardybarth.go index c9e12846a..9ade15b06 100644 --- a/charger/hardybarth.go +++ b/charger/hardybarth.go @@ -25,9 +25,10 @@ import ( "github.com/evcc-io/evcc/api" "github.com/evcc-io/evcc/charger/echarge" - "github.com/evcc-io/evcc/charger/obis" + "github.com/evcc-io/evcc/meter/obis" "github.com/evcc-io/evcc/util" "github.com/evcc-io/evcc/util/request" + "github.com/evcc-io/evcc/util/sponsor" ) // http://apidoc.ecb1.de @@ -66,7 +67,7 @@ func NewHardyBarthFromConfig(other map[string]interface{}) (api.Charger, error) // NewHardyBarth creates HardyBarth charger func NewHardyBarth(uri string, chargecontrol, meter int) (api.Charger, error) { - log := util.NewLogger("hardybarth") + log := util.NewLogger("hardy") wb := &HardyBarth{ Helper: request.NewHelper(log), @@ -76,9 +77,9 @@ func NewHardyBarth(uri string, chargecontrol, meter int) (api.Charger, error) { current: 6, } - // if !sponsor.IsAuthorized() { - // return nil, api.ErrSponsorRequired - // } + if !sponsor.IsAuthorized() { + return nil, api.ErrSponsorRequired + } uri = fmt.Sprintf("%s/api/v1/chargecontrols/%d/mode", wb.uri, wb.chargecontrol) data := url.Values{"mode": {echarge.ModeManual}} diff --git a/charger/obis/obis.go b/meter/obis/obis.go similarity index 100% rename from charger/obis/obis.go rename to meter/obis/obis.go diff --git a/templates/definition/charger/hardybarth.yaml b/templates/definition/charger/hardybarth.yaml new file mode 100644 index 000000000..1cde1353a --- /dev/null +++ b/templates/definition/charger/hardybarth.yaml @@ -0,0 +1,12 @@ +template: hardybarth-cph1 +products: +- brand: hardybarth-cph1 + description: + generic: HardyBarth cPH1 +params: +- name: host + required: true + example: 192.0.2.2 +render: | + type: hardybarth + uri: http://{{ .host }} diff --git a/templates/docs/charger/hardybarth-cph1_0.yaml b/templates/docs/charger/hardybarth-cph1_0.yaml new file mode 100644 index 000000000..60a28b22e --- /dev/null +++ b/templates/docs/charger/hardybarth-cph1_0.yaml @@ -0,0 +1,9 @@ +product: + brand: hardybarth-cph1 + description: HardyBarth cPH1 + +render: +- default: | + type: template + template: hardybarth-cph1 + host: 192.0.2.2 # IP-Adresse oder Hostname \ No newline at end of file