chvolkmann / govee_btled

A Python wrapper for controlling a cheap Bluetooth RGB light bulb.
91 stars 14 forks source link

The dumb dude has an problem again. #7

Open qawsedrftgzh opened 3 years ago

qawsedrftgzh commented 3 years ago

Traceback (most recent call last): File "/home/qawsedrftgzh/Dokumente/python/bluetooth-lamp.py", line 6, in <module> led.set_state(True) File "/home/qawsedrftgzh/.local/lib/python3.9/site-packages/govee_btled/bluetooth_led.py", line 85, in set_state self._send(LedCommand.POWER, [0x1 if onoff else 0x0]) File "/home/qawsedrftgzh/.local/lib/python3.9/site-packages/govee_btled/bluetooth_led.py", line 81, in _send self._dev.char_write(UUID_CONTROL_CHARACTERISTIC, frame) File "/usr/lib/python3.9/site-packages/pygatt/device.py", line 121, in char_write return self.char_write_handle(self.get_handle(uuid), value, File "/usr/lib/python3.9/site-packages/pygatt/device.py", line 267, in get_handle self._characteristics = self.discover_characteristics() File "/usr/lib/python3.9/site-packages/pygatt/backends/gatttool/device.py", line 17, in wrapper return func(self, *args, **kwargs) File "/usr/lib/python3.9/site-packages/pygatt/backends/gatttool/device.py", line 57, in discover_characteristics self._characteristics = self._backend.discover_characteristics( File "/usr/lib/python3.9/site-packages/pygatt/backends/gatttool/gatttool.py", line 50, in wrapper return func(self, *args, **kwargs) File "/usr/lib/python3.9/site-packages/pygatt/backends/gatttool/gatttool.py", line 531, in discover_characteristics raise NotConnectedError("Characteristic discovery failed") pygatt.exceptions.NotConnectedError: Characteristic discovery failed Exception ignored in: <function BluetoothLED.__del__ at 0x7f5ce204aee0> Traceback (most recent call last): File "/home/qawsedrftgzh/.local/lib/python3.9/site-packages/govee_btled/bluetooth_led.py", line 49, in __del__ File "/home/qawsedrftgzh/.local/lib/python3.9/site-packages/govee_btled/bluetooth_led.py", line 53, in _cleanup File "/usr/lib/python3.9/site-packages/pygatt/backends/gatttool/device.py", line 17, in wrapper File "/usr/lib/python3.9/site-packages/pygatt/backends/gatttool/device.py", line 52, in disconnect File "/usr/lib/python3.9/site-packages/pygatt/backends/gatttool/gatttool.py", line 49, in wrapper pygatt.exceptions.NotConnectedError: The code is just the normal start script: `import time from govee_btled import BluetoothLED import pygatt

led = BluetoothLED('my mac') led.set_state(True) led.set_color('blue') time.sleep(1) led.set_color('#facd03') time.sleep(1)` Have you any idea what is wrong, I really don't understand the error log.