Git Product home page Git Product logo

Comments (6)

MTrab avatar MTrab commented on August 22, 2024

Guess you haven't authorized before connecting

from pyworxcloud.

mrbgfromv avatar mrbgfromv commented on August 22, 2024

Mmmh.
I tried setting the three environment variables and analternativly hard coded them into test.py
In both ways setup.py didn't complain about missing credentials.

That should be enough, shouldn't it?

from pyworxcloud.

sracing avatar sracing commented on August 22, 2024

I can confirm there is a issue.

Using either the script pyworxcloud/blob/master/test.py or pyworxcloud/blob/master/test_async.py and by using my credentials:
EMAIL = "[email protected]" # environ["EMAIL"]
PASS = "notdisclosed" # environ["PASSWORD"]
TYPE = "worx" # environ["TYPE"]

I am getting the same Error message:

`2023-04-02 13:24:58,130 [init.py] [init] [DEBUG] [153] Initializing EventHandler ...
2023-04-02 13:24:58,131 [init.py] [connect] [DEBUG] [233] Fetching basic API data
Traceback (most recent call last):
File "C:\Users\plane\PycharmProjects\pyworx\venv\Lib\site-packages\pyworxcloud\utils\requests.py", line 73, in GET
req.raise_for_status()
File "C:\Users\plane\PycharmProjects\pyworx\venv\Lib\site-packages\requests\models.py", line 1021, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 401 Client Error: Unauthorized for url: https://api.worxlandroid.com/api/v2/product-items?status=1

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\plane\AppData\Roaming\JetBrains\PyCharmCE2022.3\scratches\scratch_1.py", line 51, in
asyncio.run(main())
File "C:\Program Files\Python\Python_311\Lib\asyncio\runners.py", line 190, in run
return runner.run(main)
^^^^^^^^^^^^^^^^
File "C:\Program Files\Python\Python_311\Lib\asyncio\runners.py", line 118, in run
return self.loop.run_until_complete(task)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python\Python_311\Lib\asyncio\base_events.py", line 653, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "C:\Users\plane\AppData\Roaming\JetBrains\PyCharmCE2022.3\scratches\scratch_1.py", line 20, in main
await async_worx()
File "C:\Users\plane\AppData\Roaming\JetBrains\PyCharmCE2022.3\scratches\scratch_1.py", line 28, in async_worx
cloud.connect()
File "C:\Users\plane\PycharmProjects\pyworx\venv\Lib\site-packages\pyworxcloud_init
.py", line 234, in connect
self.fetch()
File "C:\Users\plane\PycharmProjects\pyworx\venv\Lib\site-packages\pyworxcloud_init
.py", line 496, in _fetch
self._mowers = self._api.get_mowers()
^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\plane\PycharmProjects\pyworx\venv\Lib\site-packages\pyworxcloud\api.py", line 102, in get_mowers
mowers = GET(
^^^^
File "C:\Users\plane\PycharmProjects\pyworx\venv\Lib\site-packages\pyworxcloud\utils\requests.py", line 79, in GET
raise AuthorizationError()
pyworxcloud.exceptions.AuthorizationError`

from pyworxcloud.

MTrab avatar MTrab commented on August 22, 2024

Yeah - as mentioned (somewhere) the test files and documentation isn't up to par with version 3 at the moment.

But a valid connection sequence should be something like this

cloud = WorxCloud(email, password, vendor)
cloud.authenticate()
cloud.connect()

from pyworxcloud.

mrbgfromv avatar mrbgfromv commented on August 22, 2024

Yes, that's it!
-> simply a missing line in setup.pi
With a bit of twiddling it is displaying all the relevant data.
Thank you very much!

I would - if I knew how - update setup.py so that it should work for other users as well.

from pyworxcloud.

MTrab avatar MTrab commented on August 22, 2024

Will be updated when the last few problems are fixed

from pyworxcloud.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.