Jan200101 / ShellyPy

Python library to interact with Shelly devices
MIT License
22 stars 14 forks source link

Authentication not implemented on Gen2 devices #5

Closed luckasdc closed 1 year ago

luckasdc commented 2 years ago

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!

Jan200101 commented 2 years ago

You are right, auth is currently broken for gen2. The credentials are used but incorrectly https://github.com/Jan200101/ShellyPy/blob/e78032cf25a571b5eccf86253a3b114ded9ea66d/ShellyPy/gen2.py#L46-L48

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.

Jan200101 commented 1 year ago

this was released with 0.3.0