mattcar15 / bambu-connect

Connect to the stats, controls, and camera of your bambu printer
Other
47 stars 8 forks source link

Can't init BambuClient #8

Closed tommy4111 closed 3 months ago

tommy4111 commented 5 months ago

C:\Users\chris\Downloads\bambu-connect-main\bambu-connect-main\examples>python file_list_and_gcode.py Exception ignored in: <function Client.del at 0x0000020CDD791000> Traceback (most recent call last): File "C:\Python310\lib\site-packages\paho\mqtt\client.py", line 874, in del self._reset_sockets() File "C:\Python310\lib\site-packages\paho\mqtt\client.py", line 1133, in _reset_sockets self._sock_close() File "C:\Python310\lib\site-packages\paho\mqtt\client.py", line 1119, in _sock_close if not self._sock: AttributeError: 'Client' object has no attribute '_sock' Traceback (most recent call last): File "C:\Users\chris\Downloads\bambu-connect-main\bambu-connect-main\examples\file_list_and_gcode.py", line 36, in main() File "C:\Users\chris\Downloads\bambu-connect-main\bambu-connect-main\examples\file_list_and_gcode.py", line 14, in main bambu_client = BambuClient(hostname, access_code, serial) File "C:\Python310\lib\site-packages\bambu_connect\BambuClient.py", line 12, in init self.watchClient = WatchClient(hostname, access_code, serial) File "C:\Python310\lib\site-packages\bambu_connect\WatchClient.py", line 14, in init self.client = self.setup_mqtt_client() File "C:\Python310\lib\site-packages\bambu_connect\WatchClient.py", line 20, in setup_mqtt_client client = mqtt.Client() TypeError: Client.init() missing 1 required positional argument: 'callback_api_version' Exception ignored in: <function BambuClient.del__ at 0x0000020CDD7A7F40> Traceback (most recent call last): File "C:\Python310\lib\site-packages\bambu_connect\BambuClient.py", line 17, in del__ self.executeClient.disconnect() AttributeError: 'BambuClient' object has no attribute 'executeClient'

fred913 commented 4 months ago

It should be fixed in my PR #9 which states this bug to the version bump of paho-mqtt.

praetp commented 3 months ago

@mattcar15 can you publish a new version that includes this fix ?

mattcar15 commented 3 months ago

Hi, sorry I hadn't gotten a chance to release it until now. Just did https://pypi.org/project/bambu-connect/