platypush.backend.alarm

class platypush.backend.alarm.AlarmBackend(alarms: Union[list, Dict[str, Any], None] = None, audio_plugin: str = 'media.mplayer', *args, **kwargs)[source]

Backend to handle user-configured alarms.

Triggers:

__init__(alarms: Union[list, Dict[str, Any], None] = None, audio_plugin: str = 'media.mplayer', *args, **kwargs)[source]
Parameters:alarms – List or name->value dict with the configured alarms. Example:
morning_alarm:
    when: '0 7 * * 1-5'   # Cron expression format: run every weekday at 7 AM
    audio_file: ~/path/your_ringtone.mp3
    audio_plugin: media.mplayer
    audio_volume: 10       # 10%
    snooze_interval: 300   # 5 minutes snooze
    actions:
        - action: tts.say
          args:
              text: Good morning

        - action: light.hue.bri
          args:
              value: 1

        - action: light.hue.bri
          args:
              value: 140
              transitiontime: 150

one_shot_alarm:
    when: '2020-02-18T07:00:00.000000'   # One-shot execution, with timestamp in ISO format
    audio_file: ~/path/your_ringtone.mp3
    actions:
        - action: light.hue.on
Parameters:audio_plugin – Media plugin (instance of platypush.plugins.media.MediaPlugin) that will be used to play the alarm audio (default: media.mplayer).
class platypush.backend.alarm.AlarmState[source]

An enumeration.