hardbyte / ha-evnex

A cloud-polling Home Assistant component to integrate with an Evnex Charger
MIT License
8 stars 1 forks source link

Api differences with Commercial org? #5

Closed drc38 closed 1 year ago

drc38 commented 1 year ago

In order to get the HA add-on to fully load I had to change the org.id to org.slug and comment out the override call (which was returning a NotFound error).

Seems odd that a cloud api would behave differently, I am on firmware 1.2.7.4CFFD14. Any ideas?

drc38 commented 1 year ago

Suggest including handling for this in the check api response: {"errors": [{"status": "404","title": "NotFoundError"}]}

hardbyte commented 1 year ago

Thanks for the report, I'd very much like to ensure that the python lib and the HA integration work for commercial orgs too.

Would you be able to share a bit more detail - which schema did you need to alter? I did find issues with get override if the charge point was offline, I have hopefully protected against that with the latest version.

drc38 commented 1 year ago

I did not need to alter the schema I simply used org.slug in the calls to the api in lines 150 and 154. If using the slug works on your charger then that would make life easy otherwise both need to be tried before timing out.

drc38 commented 1 year ago

Looks like slug should be used based on the evnex web app: path={/v2/apps/organisations/${orgSlug}/charge-points} path={/v2/apps/organisations/${orgSlug}/summary/insights}