cp2004 / OctoPrint-WS281x_LED_Status

Add some RGB LEDs to your printer for a quick status update!
https://plugins.octoprint.org/plugins/ws281x_led_status
GNU Affero General Public License v3.0
111 stars 26 forks source link

Update runner.py #152

Closed IzK666 closed 2 years ago

IzK666 commented 2 years ago

I would recommend to limit the progress between 0 and 100. Although not very usual, sometimes progress exceeds 100% and throws an error. In my case, the nozzle temperature began to cooldown, when the temperature was a few degrees over the goal temperature.

Here is the error:

[2021-07-12 18:54:44,921] DEBUG: Changing effect to success
[2021-07-12 18:54:46,085] INFO: progress_cooling 101
[2021-07-12 18:54:46,093] ERROR: Error running effect
[2021-07-12 18:54:46,094] DEBUG: Received message to update progress: progress_cooling 101
[2021-07-12 18:54:46,126] ERROR: Args: {'strip': <rpi_ws281x.rpi_ws281x.PixelStrip object at 0x72fca790>, 'queue': <queue.Queue object at 0x6791b290>, 'brightness_manager': <octoprint_ws281x_led_status.runner.BrightnessManager object at 0x6791bd70>, 'value': 101, 'progress_color': (64, 0, 0, 0), 'base_color': (0, 56, 56, 0), 'reverse': False}
[2021-07-12 18:54:46,155] ERROR: in method 'ws2811_led_set', argument 3 of type 'uint32_t'
cp2004 commented 2 years ago

Seems logical - I am sure I have fixed similar issues before but I can see how this one would occur. Thank you for the PR!