danielthor / blink_stick

Control your BlinkStick
MIT License
2 stars 2 forks source link

Create a functionality similar to the light on a sleeping Apple laptop #7

Closed bjonord closed 10 years ago

bjonord commented 10 years ago

I'm thinking this will be a good functionality to build on, in the long run.

danielthor commented 10 years ago

This is my take on a very rough fade method (which the sleep light basically is). Not ready for prime time. I know you are working on the same, but the problem intrigued me so couldn't stop. Hope you don't mind. https://github.com/danielthor/blink_stick/blob/color_fade/lib/blink_stick/action_handler.rb#L21

bjonord commented 10 years ago

Not at all, will have a look at it tomorrow. :+1:

bjonord commented 10 years ago

Went all out on writing this as a separate class. Might have been overkill as you could just as well have done it in the rows you linked to above. At least I managed to do it in less than 100 lines with a bit of ruby magic. Somehow writing a proper class felt more appropriate. :smile:

But I am envisioning this as a start for more actions that can be developed. Not exactly sure which yet.

danielthor commented 10 years ago

pulse method added in 398c8af0fe3b90e48e3926312418daaaf1a40b0b thanks to @bjoska!