As per a previous update, I’ve noticed traffic coming toward the site for alarm clock functionality for the Raspberry Pi. In between other bits of development I’m starting to get this all drawn together in Python and will be uploading it soon. It’s currently just a collection of classes but if people show interest I plan to develop it in 2 strands: one for just the classes for people to mangle as they wish and another for a full UI system to go with it.
Key features as-is
- Multiple alarms
- Alarms have settings for individual days
- Plays a set mp3 upon alarm triggering
- Delegate pattern set up for loading in the alarm data
- Observer pattern set up for when the alarm is firing/stops firing
- More configuration options on the alarms themselves
- Full UI system (I’ve got something very nice in mind)
- Web based configuration utility (to keep the alarm headerless if not using the UI)
A few notes:
The delegate for loading data up is there so you can loading in from any data source you like. It simply calls a specific method on whatever you pass in as the delegate object. You’ll just need to return a list of AlarmData objects to it. This could be used in a myriad of ways, you could even call data off your Google calendar and feed it into the alarm system on a whim.
The observer pattern for the alarm firing/not firing is there to allow some of the neat ideas I’ve seen people discussing for alarm clock systems. Such as having the alarm fire and then some lights/appliance/thing be triggered via the GPIO pins. I don’t want to include a load of extra code for dealing with that stuff, an Observer works just fine for the purpose.