Ludy87 / pyxplora_api

Unofficial python library for the Xplora® API
MIT License
8 stars 2 forks source link

Not getting chat messages #118

Closed phil1283 closed 1 year ago

phil1283 commented 1 year ago

Describe the bug I am trying to get chat messages from the watch. Therefore I just used the sample main.py and changed print(xplora.getUserName()) to print(xplora.getWatchChatsRaw('theRealWuid')) I am getting the following error message. (I tried several variants: ...getWatchChatsRaw('theRealWuid', 3, 2, "5") and ...0, 0, ""))

Traceback (most recent call last): File "/root/pyxplora_api-2.9.0/sample/main.py", line 28, in main() File "/root/pyxplora_api-2.9.0/sample/main.py", line 24, in main print(xplora.getWatchChatsRaw('theRealWuid')) File "/usr/local/lib/python3.9/dist-packages/pyxplora_api/pyxplora_api.py", line 340, in getWatchChatsRaw result = ChatsNew.from_dict(result.get("chatsNew", None)) File "/usr/local/lib/python3.9/dist-packages/dataclasses_json/api.py", line 72, in from_dict return _decode_dataclass(cls, kvs, infer_missing) File "/usr/local/lib/python3.9/dist-packages/dataclasses_json/core.py", line 152, in _decode_dataclass types = get_type_hints(cls) File "/usr/lib/python3.9/typing.py", line 1417, in get_type_hints value = _eval_type(value, base_globals, localns) File "/usr/lib/python3.9/typing.py", line 283, in _eval_type return t._evaluate(globalns, localns, recursive_guard) File "/usr/lib/python3.9/typing.py", line 539, in _evaluate eval(self.__forward_code__, globalns, localns), File "", line 1, in TypeError: unsupported operand type(s) for |: 'types.GenericAlias' and 'NoneType'

To Reproduce with every execution

Expected behavior getting the chat data

Ludy87 commented 1 year ago

Hello @phil1283, thanks for the report. You are using Python3.9, the version of the lib is compatible from Python3.10.

phil1283 commented 1 year ago

Thanks @Ludy87, now the error message does not appear anymore! But I get an empty list, regardless what options I choose. Any hints for me? Examples:

print(xplora.getWatchChatsRaw('theRealWuid', 0, 20, "1", True))
>>> {'list': []}
print(xplora.getWatchChats('theRealWuid', 0, 20, "1"))
>>>[]