We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It would be cool to have a complet example code. E.g. i tried this so far:
from moonraker_api import MoonrakerClient, MoonrakerListener class APIConnector(MoonrakerListener): def __init__(self): self.running = False self.client = MoonrakerClient( self, "yourURL.local", "7125", "", ) async def start(self) -> None: """Start the websocket connection.""" self.running = True return await self.client.connect() async def stop(self) -> None: """Stop the websocket connection.""" self.running = False await self.client.disconnect() async def get_printer_info(): api_connector = APIConnector() await api_connector.start() response = await api_connector.client.request("printer.info") return response printer_info = asyncio.run(get_printer_info()) print(printer_info)
but I always get the error:
response = await api_connector.client.request("printer.info") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ TypeError: object AwaitableTaskContext can't be used in 'await' expression Unclosed client session client_session: <aiohttp.client.ClientSession object at 0x0000024C10544290>```
The text was updated successfully, but these errors were encountered:
No branches or pull requests
It would be cool to have a complet example code.
E.g. i tried this so far:
but I always get the error:
The text was updated successfully, but these errors were encountered: