diff --git a/rustplus/__init__.py b/rustplus/__init__.py index f1bc439..5db485f 100644 --- a/rustplus/__init__.py +++ b/rustplus/__init__.py @@ -22,5 +22,5 @@ __name__ = "rustplus" __author__ = "olijeffers0n" -__version__ = "5.6.2" +__version__ = "5.6.3" __support__ = "Discord: https://discord.gg/nQqJe8qvP8" diff --git a/rustplus/api/remote/rust_remote_interface.py b/rustplus/api/remote/rust_remote_interface.py index 97211a3..56ba52a 100644 --- a/rustplus/api/remote/rust_remote_interface.py +++ b/rustplus/api/remote/rust_remote_interface.py @@ -3,6 +3,8 @@ from asyncio import Future from typing import Union, Dict +import betterproto + from .camera.camera_manager import CameraManager from .events import EventLoopManager, EntityEvent, RegisteredListener from .rustplus_proto import AppRequest, AppMessage, AppEmpty, AppCameraSubscribe @@ -173,7 +175,7 @@ async def get_entity_info(remote: RustRemote, eid): await remote.api._handle_ratelimit() app_request: AppRequest = remote.api._generate_protobuf() - app_request.entityId = eid + app_request.entity_id = eid app_request.get_entity_info = AppEmpty() app_request.get_entity_info._serialized_on_wire = True @@ -182,16 +184,16 @@ async def get_entity_info(remote: RustRemote, eid): return await remote.get_response(app_request.seq, app_request, False) def entity_event_callback(future_inner: Future) -> None: - entity_info = future_inner.result() + entity_info: AppMessage = future_inner.result() - if entity_info.response.HasField("error"): + if betterproto.serialized_on_wire(entity_info.response.error): raise SmartDeviceRegistrationError( f"Entity: '{entity_id}' has not been found" ) EntityEvent.handlers.register( RegisteredListener( - entity_id, (coroutine, entity_info.response.entityInfo.type) + entity_id, (coroutine, entity_info.response.entity_info.type) ), self.server_id, ) diff --git a/rustplus/api/remote/rustws.py b/rustplus/api/remote/rustws.py index 39425e0..7d81dd1 100644 --- a/rustplus/api/remote/rustws.py +++ b/rustplus/api/remote/rustws.py @@ -168,7 +168,7 @@ async def run(self) -> None: try: await self.handle_message(app_message) except Exception: - self.logger.exception("An Error occurred whilst handling the event") + self.logger.exception("An Error occurred whilst handling the message from the server") async def handle_message(self, app_message: AppMessage) -> None: if app_message.response.seq in self.remote.ignored_responses: