custom-components / zaptec

zaptec charger custom component for home assistant
MIT License
66 stars 20 forks source link

Using webhook auth but still showing no authentication #67

Closed gustafssone closed 1 month ago

gustafssone commented 1 year ago

Hi!

Using the new 0.7.0 version. I have currently a webhook authentication, but it still shows in the settins as "Authorization required: Not required". If I change in Zaptec Portal under authentication to "local/native authentication", the padlock is off (not required). Shouldn't at least the sensor for Authorization request it is show "webhook auth"? And/or the Authentication (press start!) be disabled when it is not possible to use it? I am considering switching to the preferred way of authenticating (available charge current to 0 A), but not there yet.

Thanks for the great work.

Cheers

sveinse commented 1 year ago

This is a good idea. I propose adding a new sensor "Authentication Type" which takes on the values "Native", "WebHooks" and "Ocpp" (names fetched from Zaptec). With this it should be possible to disable the buttons that doesn't work unless in native mode.

As for "Authentication required" this value is reported to 0 by zaptec when webhooks or ocpp is selected. Perhaps this is another of the the entities which needs to made unavailable in these two auth modes?

gustafssone commented 1 year ago

Good idea with new sensor. I guess so, yes. In conjunction with Authentication Type it is technically invalid, it is not used. Just saying it can be confusing for some users where they have some other type of authentication but tries to enable it nonetheless. Also it says Authentication in most places in zaptec portal but "Authorization required" (which I guess is technically correct).

sveinse commented 1 year ago

I see both "authentication" and "authorization" in use in Zaptec, and possibly the terms are used correctly. I'll wash through the codebase to see if we use it incorrectly

sveinse commented 1 year ago

It certainly is confusing:

sveinse commented 1 month ago

A new sensor indication authentication type has been added in #73, and I've gone over the usage of "authentication" vs "authorization" and I think its consistent. I don't see there are any more that should be done. If you don't mind; I'd like to close this issue.