w1ll1am23 / pyeconet

Python 3 interface to the EcoNet API
MIT License
34 stars 20 forks source link

getLocation stopped working 2023-10-24 #35

Closed teleshoes closed 1 year ago

teleshoes commented 1 year ago

api call to /getLocation returns {'results': {}, 'success': False, 'logs': 'The error has occurred in getLocation'}

its been working perfectly for a few months for me, until yesterday. the awful app continues to work.

teleshoes commented 1 year ago

more specifically {"error":{"id":"SOMEUUID","message":"Permission denied","detail":"Permission denied","line":"clearblade/core_code/module.go:184"},"statusCode":500}

w1ll1am23 commented 1 year ago

Report on HA's github

https://github.com/home-assistant/core/issues/102800

teleshoes commented 1 year ago

i do not use home assistant, though

edit: oh i see, it was already reported there. thanks!

w1ll1am23 commented 1 year ago

@teleshoes can you confirm if the 0.1.21 release is working for you? Seems to be working for me locally but not working when I try to pull it in to Home Assistant. Another confirmation that its working outside of there would be helpful.

teleshoes commented 1 year ago

im sorry, its not working for me. same error

wolke:~/Code/pyeconet/src/pyeconet$ git rev-parse HEAD
c4243127e9cc919d3b6e57cd39648faebf84d6ed
wolke:~/Code/pyeconet/src/pyeconet$ md5sum api.py 
49efff02730996013c052c37ca247890  api.py
wolke:~/Code/pyeconet/src/pyeconet$ pyeconet 
Traceback (most recent call last):
  File "/home/wolke/bin/pyeconet", line 330, in <module>
    loop.run_until_complete(main())
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/wolke/bin/pyeconet", line 84, in main
    all_equipment = await api.get_equipment_by_type(
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wolke/.local/lib/python3.11/site-packages/pyeconet/api.py", line 173, in get_equipment_by_type
    await self._get_equipment()
  File "/home/wolke/.local/lib/python3.11/site-packages/pyeconet/api.py", line 138, in _get_equipment
    _locations: List = await self._get_location()
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/wolke/.local/lib/python3.11/site-packages/pyeconet/api.py", line 201, in _get_location
    raise GenericHTTPError(resp.status)
pyeconet.errors.GenericHTTPError: 401
wolke:~/Code/pyeconet/src/pyeconet$ md5sum /home/wolke/.local/lib/python3.11/site-packages/pyeconet/api.py
49efff02730996013c052c37ca247890  /home/wolke/.local/lib/python3.11/site-packages/pyeconet/api.py
w1ll1am23 commented 1 year ago

Well okay... I must have done something wrong then. I'll take a closer look.

teleshoes commented 1 year ago

ok, problem solved! the new endpoint fixes it for me, you just typoed HEADERS for _headers, so the token header is missing from the POST

teleshoes commented 1 year ago

thanks for the incredibly quick fix!

w1ll1am23 commented 1 year ago

Ugh I've been looking that that for like 20 minutes lol I'll push up a fix