Skip to main content

SimplyPrint Websocket Client

Project description

Printer WS Client

A package for easy implementations of SimplyPrint printers.

Usage

from printer_ws_client import *

class MyClient(Client):
    def __init__(self):
        self.info.ui = "My Ui"
        self.info.ui_version = "0.0.1"

        self.info.api = "My Api"
        self.info.api_version = "4.2.0"

        self.local_path = "path_to_local_files"

    # define a callback
    async def on_connect(self, event: ConnectEvent):
        print(f"Connected, got name: {event.name}")

    # define another callback
    async def on_start_print(self, _: StartPrintEvent):
        # start the print somehow
        start_print(self.selected_file)

my_client = MyClient()

# start the client
# this runs the background thread and starts even processing
my_client.start()

# run some loop
while True:
    sleep(1)
    # get data from printer
    my_client.tool_temperatures = poll_tool_temperatures()
    my_client.bed_temperature = poll_bed_temperature()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

simplyprint_ws_client-0.0.6.tar.gz (28.9 kB view hashes)

Uploaded Source

Built Distribution

simplyprint_ws_client-0.0.6-py3-none-any.whl (32.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page