HardyBarth: add template (#2891)
This commit is contained in:
parent
616514a741
commit
3cb9bacf70
4 changed files with 27 additions and 5 deletions
|
|
@ -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}}
|
||||
|
|
|
|||
12
templates/definition/charger/hardybarth.yaml
Normal file
12
templates/definition/charger/hardybarth.yaml
Normal file
|
|
@ -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 }}
|
||||
9
templates/docs/charger/hardybarth-cph1_0.yaml
Normal file
9
templates/docs/charger/hardybarth-cph1_0.yaml
Normal file
|
|
@ -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
|
||||
Loading…
Add table
Add a link
Reference in a new issue