diff --git a/client_examples/hello_client.py b/client_examples/hello_client.py index 5c10086..2b2b63e 100644 --- a/client_examples/hello_client.py +++ b/client_examples/hello_client.py @@ -32,6 +32,11 @@ async def amain(): print("I'm here") await client.send_chat("Hello World!", chat_type=ChatType.SHOUT) client.session.message_handler.subscribe("ChatFromSimulator", _respond_to_chat) + + # Example of how to work with caps + async with client.main_region.caps_client.get("SimulatorFeatures") as features_resp: + print("Features:", await features_resp.read_llsd()) + while True: try: await asyncio.sleep(0.001) diff --git a/hippolyzer/lib/client/hippo_client.py b/hippolyzer/lib/client/hippo_client.py index ddc5d22..bb0bb9d 100644 --- a/hippolyzer/lib/client/hippo_client.py +++ b/hippolyzer/lib/client/hippo_client.py @@ -376,6 +376,12 @@ class HippoClient(BaseClientSessionManager): self.settings = ClientSettings() self._resend_task: Optional[asyncio.Task] = None + @property + def main_region(self) -> Optional[HippoClientRegion]: + if not self.session: + return None + return self.session.main_region + async def aclose(self): try: if self.session: