Ken Guest’s online diary

December 25, 2015

USB Lamp tweaks.

Filed under: phing,python — kenguest @ 22:04

My wife got me a cheeky webmail notifier (an USB lamp that changes colour) as a part of my over-generous Christmas present.

After a little diversion to Christian’s write-up, I downloaded the  usblamp project from GitHub and made a few little pythonic tweaks I decided to share:

  1. imap.py is more configurable (the mailbox and lamp colour had been hard-coded).
  2. The lamp is turned off once new emails have been opened.
  3. imap.py closes cleanly, turning off the lamp too –
  4. usblamp recognises ‘pink’ as a colour, which my wife kinda insisted on 🙂 [ e.g. $ usblamp pink works 🙂 ]

So now my lamp turns pink when I receive a new email from Aisling, and turns off once I read it.

There is one issue that I haven’t addressed: what if the lamp is already on, and set to some other colour when it is supposed to switch on in imap.py? If, for example, I have phing switching it to red because a build has failed, I might want it to flash between the two colours.

I guess that’s something I’ll have to leave for another day.

Advertisements

1 Comment »

  1. […] After a little diversion to Christian’s write-up, I downloaded the usblamp project from GitHub and made a few little pythonic tweaks I decided <a class="colorbox" …read more […]

    Pingback by USB Lamp tweaks. | PHP Information — December 26, 2015 @ 05:20


RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.