LMS0815 / OctoPrint-hueCommands

Illuminate your print job and signal its status using a Philips Hue light. Enter a GCODE equivalent anywhere you want
GNU Affero General Public License v3.0
4 stars 2 forks source link

[Feature Request] A Toggle Light and or Flash light Option! #1

Open Dracrius opened 4 years ago

Dracrius commented 4 years ago

I tend to change the color of my lights a fair bit and don't really want my room lights to stay green or red for instance just to notify me and then have to change back manually. I can't figure out a way to change colors and go back to the color it was and that may be very complicated to add. Because of that I set your plugin up to flash my desk lights a different number of times for different events but this still has two flaws. First I have to assume the lights are ON and end my gcode by turning the lights On again but this would be an annoyance if I'm sleeping or watching a movie. Second it requires a fair bit of gcode for a simple trick. This is the Start Gcode I use just to flash twice

hue L11 d0.5 off
G4 P500
hue L11 d1 on
G4 P500
hue L11 d0.5 off
G4 P500
hue L11 d0.5 on

And this is the end gcode I use to flash 3 times haha

hue L11 d0.5 off
G4 P500
hue L11 d0.5 on
G4 S0.5
hue L11 d0.5 off
G4 P500
hue L11 d0.5 on
G4 P500
hue L11 d0.5 off
G4 P500
hue L11 d0.5 on

I think it would be extremely helpful to have a hue L11 toggle and a hue L11 f3 d0.5 toggle where f ( or possibly n for number) is defined as the number of flashes/fades and t and d are still used to define how long the transitions are including the pause to keep it simple I'd think ied0.5 means fade over half a second and wait half a second before transitioning again when used with f. Toggle would be just like ON or OFF but instead it would just reverse the lights current state meaning to be clear a f3 would toggle the lights 3 times either ON,OFF,ON or OFF,ON,OFF. With these settings I could simply add

hue L11 f4 d0.5 toggle to the start gcode and hue L11 f6 d0.5 toggle to the end gcode in my slicer!

I am sure many would use both these options and it would add more reasons it is the best hue plugin for Octoprint as I couldn't even get something like I use now with the other options.

If you ever did find a way to save the current light color before an event f could actually be used in a few fun situations like hue L11 f4 d0.5 $GREEN could flash the lights green twice!

Thank you for all your work this has quickly become one of my favorite plugins!

LMS0815 commented 4 years ago

I am not sure, if I understand you right. You proposed to use fn command to execute a command n times. Although I like the idea, I am not sure if this would negatively interfere with the script processing - I need to check.

If you want to toggle a light/group, you

Which kind of toggle do you require? Just on/off or on/pop (= all device settings back to an od state incl brightness) off/push (= save all current settings)

I'll assume the solution would be reading the current state of a device prior to the first execution of a sequence and writing it after the last execution. I'll give it a try (as I would like blinking as well).