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

[Bug]: Active Times gets confused if end time passes over into next day #214

Open rorosaurus opened 1 year ago

rorosaurus commented 1 year ago

Description of the bug

At 11am, I noticed the lights still weren't on. If I disabled active times, the lights came on. Enabling active times, lights went off.

On a hunch, I changed the end time to 11pm, and the lights worked as expected. So I suspect there's a minor bug in the active time code that gets confused if the end time proceeds to the next day.

I verified this wasn't timezone related, confirmed correct time zone and time reported by date command.

Steps to reproduce

Active Time Settings used: Start Time: 8am End Time: 1am

Expected on time range: 8am-1am (implied next day) Expected off time range: 1am-8am Lights checked at: 11am

What happened instead?

Lights remained off during a time when they should be enabled.

Plugin version

0.8.1

OctoPrint version

1.8.7

(if relevant) OctoPi version

1.0.0

Log Files & Screenshots

No response

Anything else?

No response

cp2004 commented 1 year ago

Hmm, that should have been handled by the code already, but perhaps there still exists some bugs with certain times. I remember working to fix this before. I'll take a look when I can but it might not be for a while unfortunately.