Skip to content

Errors on token #27

@fmarzocca

Description

@fmarzocca

I am getting this error when running the example:

Traceback (most recent call last):
  File "/home/boss/.node-red/assets/./testC4.py", line 31, in <module>
    print(asyncio.run(director.getAllItemInfo()))
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 190, in run
    return runner.run(main)
           ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/runners.py", line 118, in run
    return self._loop.run_until_complete(task)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/pyControl4/director.py", line 119, in getAllItemInfo
    return await self.sendGetRequest("/api/v1/items")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/pyControl4/director.py", line 56, in sendGetRequest
    await checkResponseForError(await resp.text())
  File "/usr/local/lib/python3.11/dist-packages/pyControl4/error_handling.py", line 120, in checkResponseForError
    raise exception(response_text)
pyControl4.error_handling.BadToken: {
 "error": "Unauthorized",
 "details": "Expired or invalid token"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions