diff --git a/README.md b/README.md index b400f94..e40e667 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,9 @@ If you've found this package useful, help us support more printers with the link ## Status -[![flake8](https://github.com/mchrisgm/bambulabs_api/actions/workflows/flake8.yml/badge.svg)](https://github.com/mchrisgm/bambulabs_api/actions/workflows/flake8.yml) -[![pytest-unit-tests](https://github.com/mchrisgm/bambulabs_api/actions/workflows/pytest-unit-tests.yml/badge.svg)](https://github.com/mchrisgm/bambulabs_api/actions/workflows/pytest-unit-tests.yml) -[![GitHub Pages](https://github.com/mchrisgm/bambulabs_api/actions/workflows/static.yml/badge.svg)](https://github.com/mchrisgm/bambulabs_api/actions/workflows/static.yml) +[![flake8](https://github.com/BambuTools/bambulabs_api/actions/workflows/flake8.yml/badge.svg)](https://github.com/BambuTools/bambulabs_api/actions/workflows/flake8.yml) +[![pytest-unit-tests](https://github.com/BambuTools/bambulabs_api/actions/workflows/pytest-unit-tests.yml/badge.svg)](https://github.com/BambuTools/bambulabs_api/actions/workflows/pytest-unit-tests.yml) +[![GitHub Pages](https://github.com/BambuTools/bambulabs_api/actions/workflows/static.yml/badge.svg)](https://github.com/BambuTools/bambulabs_api/actions/workflows/static.yml) ## Documentation @@ -78,6 +78,12 @@ if __name__ == '__main__': printer.disconnect() ``` +## Known Limitations + +* X1 Printers are not fully supported yet - camera integration is not yet implemented (for api versions < 2.7.0 please see the [No Camera Example](/examples/Basic/basic_no_camera.py)). +* H2D printers have not been tested yet. + + ## Development If you want to contribute to the development of this API or run it in a development environment, follow these steps: @@ -92,7 +98,7 @@ If you want to contribute to the development of this API or run it in a developm 1. Clone the repository: ```bash - git clone https://github.com/mchrisgm/bambulabs_api.git + git clone https://github.com/BambuTools/bambulabs_api.git ``` 2. Change directory: @@ -145,7 +151,7 @@ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file ## Support -If you encounter any issues or have questions, feel free to open an issue on the [GitHub repository](https://github.com/mchrisgm/bambulabs_api/issues). +If you encounter any issues or have questions, feel free to open an issue on the [GitHub repository](https://github.com/BambuTools/bambulabs_api/issues). ## Acknowledgements diff --git a/docs/examples.rst b/docs/examples.rst index 3124624..cd377ba 100644 --- a/docs/examples.rst +++ b/docs/examples.rst @@ -10,6 +10,17 @@ Make sure that ports 8883, 6000 and 990 are accessible from your machine. .. literalinclude:: ../examples/Basic/basic.py :language: python +Basic No Camera +--------------- + +If using the api without camera connection follow the below example. +Note that camera on X1 machines is not supported on the API for versions less +than 2.7.0 + +.. literalinclude:: ../examples/Basic/basic_no_camera.py + :language: python + + Basic Subscription ------------------ diff --git a/examples/Basic/basic_no_camera.py b/examples/Basic/basic_no_camera.py new file mode 100644 index 0000000..a893890 --- /dev/null +++ b/examples/Basic/basic_no_camera.py @@ -0,0 +1,36 @@ +import time +import bambulabs_api as bl + +IP = '192.168.1.200' +SERIAL = 'AC12309BH109' +ACCESS_CODE = '12347890' + +if __name__ == '__main__': + print('Starting bambulabs_api example') + print('Connecting to Bambulabs 3D printer') + print(f'IP: {IP}') + print(f'Serial: {SERIAL}') + print(f'Access Code: {ACCESS_CODE}') + + # Create a new instance of the API + printer = bl.Printer(IP, ACCESS_CODE, SERIAL) + + # Connect to the Bambulabs 3D printer without connecting to the camera + printer.mqtt_start() + + time.sleep(2) + + # Get the printer status + status = printer.get_state() + print(f'Printer status: {status}') + + # Turn the light off + printer.turn_light_off() + + time.sleep(2) + + # Turn the light on + printer.turn_light_on() + + # Disconnect the mqtt client + printer.mqtt_stop()