Jan200101/ShellyPy

Authentication not implemented on Gen2 devices

Closed this issue · 2 comments

Hi,

I just noticed that a login parameter is available when instantiating Gen2 devices, but its values are not used yet. The only way to use it currently is to disable auth, which is not always possible. Are there already any plans on this? Or are you open to accept. PR's?

Thanks!

You are right, auth is currently broken for gen2.
The credentials are used but incorrectly

response = post(url, auth=self.__credentials__,
json=payload,
timeout=self.__timeout__)

authentication for Gen2 is done within the json-rpc body and not using HTTP Basic Auth.
https://shelly-api-docs.shelly.cloud/gen2/General/Authentication

I am open for PRs.

this was released with 0.3.0