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 details)

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

Details for the file simplyprint_ws_client-0.0.6.tar.gz.

File metadata

  • Download URL: simplyprint_ws_client-0.0.6.tar.gz
  • Upload date:
  • Size: 28.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.10

File hashes

Hashes for simplyprint_ws_client-0.0.6.tar.gz
Algorithm Hash digest
SHA256 ea82490aa2a8cbcadb1ba85fc7d553f8d54e5762d434f82f6f82173024319eb7
MD5 811e87df9e7d7ea99b9683a4dc95c17d
BLAKE2b-256 4d02370c9e97da0c28fd5c44d0bbea8f3910f73f41a09b3590a3edefe3976f39

See more details on using hashes here.

File details

Details for the file simplyprint_ws_client-0.0.6-py3-none-any.whl.

File metadata

File hashes

Hashes for simplyprint_ws_client-0.0.6-py3-none-any.whl
Algorithm Hash digest
SHA256 e152e18510d5fd18218c8715a40906956638c9e7b99a900213f02cad00a18d0b
MD5 71cfd2eb79e05d1bc09067ddfc102d4e
BLAKE2b-256 dc7132f5fda8dd4a76ee897204fbb32eb15c30bfd57a9dbc4d0d9e9789db2ac2

See more details on using hashes here.

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