Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Mobile Charger Connect #40

Merged
merged 18 commits into from
Apr 19, 2020
Merged

Add Mobile Charger Connect #40

merged 18 commits into from
Apr 19, 2020

Conversation

DerAndereAndi
Copy link
Contributor

  • The charger is or will be used by Audi, Bentley, Porsche
  • Support implemented for
    • Login and auth token refresh
    • Status
    • Enabled
    • MaxCurrent
    • CurrentPower
    • ChargedEnergy
    • ChargingTime
  • Enable is not supported as there is no known API to provide it
  • Tested with 1 Phase standard home connector (230V)
  • Test cases are not yet provided

- The charger is or will be used by Audi, Bentley, Porsche
- Support implemented for
  - Login and auth token refresh
  - Status
  - Enabled
  - MaxCurrent
  - CurrentPower
  - ChargedEnergy
  - ChargingTime
- Enable is not supported as there is no known API to provide it
- Tested with 1 Phase standard home connector (230V)
- Test cases are not yet provided
@DerAndereAndi
Copy link
Contributor Author

DerAndereAndi commented Apr 17, 2020

Hi @andig

this is my first try on go, so please don't be too harsh, but any feedback is more than welcome :)

I am planning on adding some tests as well, but wanted to provide a first try as quickly as possible.

Thanks,
Andreas

Copy link
Member

@andig andig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stark für den erste Go Code!

charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/config.go Outdated Show resolved Hide resolved
charger/mcc.go Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
evcc.dist.yaml Show resolved Hide resolved
@andig
Copy link
Member

andig commented Apr 17, 2020

Du kannst einfach neue commits nachschieben.

Not all, but getting there
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
Added references to Mobile Charger Connect support
api/http.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
@DerAndereAndi
Copy link
Contributor Author

Ich würde gerne für die super genial schönen API Aufrufe Tests einbauen. Auch vor allem weil ich damit rechne dass in neuen Software Versionen an denen schon mal gedreht werden wird.

Hast du da einen Hinweis wie man das hier am Besten anstellen könnte?

@andig
Copy link
Member

andig commented Apr 18, 2020 via email

- Followed approach at http://hassansin.github.io/Unit-Testing-http-client-in-Go
- Not happy yet by providing the HTTP response body as escaped strings in code
- The base test structure was generated with VS Code automated test file generation
@DerAndereAndi
Copy link
Contributor Author

So, habe etwas gebaut und Tests hinzugefügt. Bin noch nicht ganz glücklich aber auf Feedback gespannt 😄

api/http.go Outdated Show resolved Hide resolved
charger/mcc.go Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc.go Outdated Show resolved Hide resolved
charger/mcc_test.go Outdated Show resolved Hide resolved
charger/mcc_test.go Outdated Show resolved Hide resolved
charger/mcc_test.go Outdated Show resolved Hide resolved
charger/mcc_test.go Show resolved Hide resolved
@andig
Copy link
Member

andig commented Apr 19, 2020 via email

Fix states with the explanation from https://evsim.gonium.net

StatusA		Unplugged
StatusB		Plugged
StatusC		Charging
StatusD		Charging with ventilator
StatusE		Error (Kurzschluss)
StatusF		Error (Ausfall Wallbox)
- Fixed typo
- Simplified code
- Aligned style to codebase
- Remove non-implemented test cases
Added a reference to the source for the http test approach
@DerAndereAndi
Copy link
Contributor Author

If this looks good, I am ready :)

@DerAndereAndi
Copy link
Contributor Author

Wir sollten hier noch die Erkenntnisse aus #42 abwarten, denn momentan ist der ChargeStatus wohl nicht so gesetzt wie es benötigt wird,

The test cases provided correlate to the wallbox software version 2914
@andig andig added the enhancement New feature or request label Apr 19, 2020
@DerAndereAndi
Copy link
Contributor Author

So, das sollte es dann sein. 😄

@andig andig merged this pull request into evcc-io:master Apr 19, 2020
@DerAndereAndi DerAndereAndi deleted the feature/mobile-charger-connect branch April 19, 2020 19:43
@andig andig changed the title [WIP] Initial support for Mobile Charger Connect Add Mobile Charger Connect Apr 19, 2020
andig pushed a commit that referenced this pull request Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants