Daheimladen: add missing status (#2156)
Co-authored-by: Kumar Utsav Anand <utsavanand2@gmail.com>
This commit is contained in:
parent
159e0304c5
commit
1a66593512
2 changed files with 3 additions and 6 deletions
|
|
@ -96,9 +96,6 @@ func (c *DaheimLaden) Enable(enable bool) error {
|
|||
}
|
||||
|
||||
c.transactionID = res.TransactionID
|
||||
if c.transactionID == 0 {
|
||||
return fmt.Errorf("cannot stop transaction as the transaction was started with plug and charge mode")
|
||||
}
|
||||
|
||||
data := daheimladen.RemoteStopRequest{
|
||||
TransactionID: c.transactionID,
|
||||
|
|
@ -153,7 +150,7 @@ func (c *DaheimLaden) Status() (api.ChargeStatus, error) {
|
|||
return api.StatusA, nil
|
||||
case daheimladen.PREPARING:
|
||||
return api.StatusB, nil
|
||||
case daheimladen.CHARGING:
|
||||
case daheimladen.CHARGING, daheimladen.FINISHING:
|
||||
return api.StatusC, nil
|
||||
case daheimladen.FAULTED:
|
||||
return api.StatusF, nil
|
||||
|
|
@ -169,7 +166,7 @@ func (c *DaheimLaden) CurrentPower() (float64, error) {
|
|||
var res daheimladen.GetLatestMeterValueResponse
|
||||
uri := fmt.Sprintf("%s/cs/%s/metervalue", daheimladen.BASE_URL, c.stationID)
|
||||
err := c.GetJSON(uri, &res)
|
||||
return float64(res.PowerActiveImport), err
|
||||
return float64(res.ActivePowerImport * 1e3), err
|
||||
}
|
||||
|
||||
var _ api.MeterEnergy = (*DaheimLaden)(nil)
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ type GetLatestInProgressTransactionResponse struct {
|
|||
type GetLatestMeterValueResponse struct {
|
||||
ChargingStationID string `json:"charging_station_id"`
|
||||
ConnectorID int32 `json:"connector_id"`
|
||||
PowerActiveImport float32 `json:"power_active_import"`
|
||||
ActivePowerImport float32 `json:"active_power_import"`
|
||||
CurrentImportPhaseL1 float32 `json:"current_import_phasel1"`
|
||||
CurrentImportPhaseL2 float32 `json:"current_import_phasel2"`
|
||||
CurrentImportPhaseL3 float32 `json:"current_import_phasel3"`
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue