diff --git a/CHANGELOG.md b/CHANGELOG.md index 1aae78d..f477905 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,6 +12,12 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## Unreleased +### Added +### Changed +### Removed + +## [v0.2.dev4] - 2021-09-03 + ### Added - Parsers for events `on_message_create` and `on_message_delete` - New property `room_ids` to `HivenClient` @@ -23,6 +29,7 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - Moved `Connection` class initialisation to `HivenClient.connect()` and added deletion after the HivenClient closed to allow for a full-recreation if the client reconnects. +- Fixed HTTP `json.JSONDecodeError` on empty responses for success returns `200` - Moved value configuration of `host`, `api_version`, `heartbeat` and `close_timeout` to `HivenClient.__init__()` - Fixed `rooms` and `entities` property in `House` @@ -251,7 +258,9 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). - `ping` from the HivenClient (Will be added back later but with better implementation) -[unreleased]: https://github.com/Para-C/Para-C/compare/0.2.dev3...v0.2.dev +[unreleased]: https://github.com/Para-C/Para-C/compare/0.2.dev4...v0.2.dev + +[v0.2.dev4]: https://github.com/Para-C/Para-C/compare/0.2.dev3...0.2.dev4 [v0.2.dev3]: https://github.com/Para-C/Para-C/compare/0.2.dev2...0.2.dev3 diff --git a/openhivenpy/__init__.py b/openhivenpy/__init__.py index 9cfb107..58bbc73 100644 --- a/openhivenpy/__init__.py +++ b/openhivenpy/__init__.py @@ -31,7 +31,7 @@ __title__ = "openhiven.py" __author__ = "Luna Klatzer" __license__ = "MIT" -__version__ = "0.2.dev3" +__version__ = "0.2.dev4" __copyright__ = "Luna Klatzer" import logging diff --git a/openhivenpy/gateway/http.py b/openhivenpy/gateway/http.py index 55bfa68..08056c4 100644 --- a/openhivenpy/gateway/http.py +++ b/openhivenpy/gateway/http.py @@ -30,7 +30,6 @@ import asyncio import json as json_decoder -import json as json_module import logging import sys import time @@ -303,7 +302,7 @@ async def http_request( _json_data = json_decoder.loads(data) # empty data - except json_module.JSONDecodeError as e: + except json_decoder.decoder.JSONDecodeError as e: # Success but no data if http_resp_code == 200: logger.debug( diff --git a/pytest/test_client/test_hivenclient.py b/pytest/test_client/test_hivenclient.py index c5a3cc4..94d836b 100644 --- a/pytest/test_client/test_hivenclient.py +++ b/pytest/test_client/test_hivenclient.py @@ -125,11 +125,13 @@ async def on_init(): @client.event() async def on_ready(): print("\non_ready was called!") - await client.parsers.dispatch('message_create', {}) + await client.parsers.dispatch( + 'presence_update', {} + ) @client.event() - async def on_message_create(): - print("Received message") + async def on_presence_update(*args, **kwargs): + print("Received") await client.close() client.run(token) diff --git a/setup.py b/setup.py index f6ec479..c6ef3f0 100644 --- a/setup.py +++ b/setup.py @@ -8,7 +8,7 @@ setuptools.setup( name="openhivenpy", - version="0.2.dev3", + version="0.2.dev4", author="Luna Klatzer", author_email="luna.klatzer@gmail.com", description="The OpenSource Python API Wrapper and Bot-Framework for Hiven",