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

Python-autarco with PyCharm #413

Closed
Quidditchspiele opened this issue Jun 5, 2024 Discussed in #325 · 7 comments
Closed

Python-autarco with PyCharm #413

Quidditchspiele opened this issue Jun 5, 2024 Discussed in #325 · 7 comments

Comments

@Quidditchspiele
Copy link

Quidditchspiele commented Jun 5, 2024

I try to take the latest Python-autarco version in operation mode with the PyCharm IDE. I use Python 3.12.3. Unfortunately I get always the following error messages.

Any idea..?

Traceback (most recent call last):
  File "C:\Users\PC\Projekte\python-autarco\examples\all_output.py", line 50, in <module>
    asyncio.run(main())
  File "C:\Program Files\Python\Python 3.12\Lib\asyncio\runners.py", line 194, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python\Python 3.12\Lib\asyncio\runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\Python\Python 3.12\Lib\asyncio\base_events.py", line 687, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "C:\Users\PC\Projekte\python-autarco\examples\all_output.py", line 14, in main
    public_key = await autarco.get_public_key()
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\PC\Projekte\python-autarco\src\autarco\autarco.py", line 134, in get_public_key
    public_key: str = data[0]["public_key"]
@klaasnicolaas
Copy link
Owner

Looks like it can't find the public_key from the response.

./Klaas

@Quidditchspiele
Copy link
Author

Yes, that could be, but I don´t understand why? Because the email and the password is correct. The login with a browser works fine.

@klaasnicolaas
Copy link
Owner

The public_key is retrieved from the following URL (https://my.autarco.com/api/site/), you could use Postman to see what the response is with your own login. Unfortunately I don't own an Autarco to check this myself.

./Klaas

@Quidditchspiele
Copy link
Author


Postman response:
{
"current_page": 1,
"data": [
{
"mock": 0,
"name_end_user": "My Autarco solar installation",
"name_retailer": "xxxxxxxxxx",
"public_key": "xxxxxxxxx",
"dt_created": "2023-11-17 07:42:16",
"dt_updated": "2023-11-17 07:42:16",
"address_line_1": "xxxxxxxxxx",
"address_line_2": null,
"address_line_3": null,
"city": "xxxxxxxx",
"postcode": "xxxxxxxxxx",
"country_code": "DE",
"country_name": null,
"site_id": xxxxxx,
"address_id": xxxxxxx,
"nominal_power": xxxx,
"health": "OK",
"name": "My Autarco solar installation"
}
],
"first_page_url": "https://my.autarco.com/api/site?page=1",
"from": 1,
"next_page_url": null,
"path": "https://my.autarco.com/api/site",
"per_page": 30,
"prev_page_url": null,
"to": 1
}

The response of Postman is OK. I can see the expected "public_key". I don´t believe that the handling with the public_key is the reason.
I think I have done something wrong in my development environment.
I will create a new setup from scratch.

Klaas, thanks for the support...

@Quidditchspiele
Copy link
Author

Quidditchspiele commented Jun 20, 2024 via email

@klaasnicolaas
Copy link
Owner

klaasnicolaas commented Jun 20, 2024

Do not respond to emails from Github, but post them directly on GitHub. Otherwise it is not readable 😅

./Klaas

@klaasnicolaas klaasnicolaas reopened this Jun 20, 2024
@klaasnicolaas
Copy link
Owner

This problem will be resolved in the next release.

./Klaas

@github-actions github-actions bot locked and limited conversation to collaborators Aug 8, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants