README.txt
author Alexander Schremmer <alex AT alexanderweb DOT de>
Sat Feb 06 00:24:50 2010 +0100 (2010-02-06)
changeset 56 7d806ddfbaa9
parent 5 9fc5b92b04f9
permissions -rw-r--r--
Fix IAPs call.
     1 dwimd
     2 =====
     3 the ambient sensing gestalt optimizer for the n900
     4 
     5 dwimd works by sampling sensors and taking user-defined actions
     6 based on a user-written config file.
     7 
     8 Howto
     9 =====
    10  1. Look at http://hg.alexanderweb.de/dwimd-main/file/tip/contrib/alex_config.py
    11     how a config file should look like.
    12  2. Write your own config file. Every function is executed every 30 seconds.
    13     You can use the values and actions explained below.
    14  3. Copy your config file to /etc/dwimd/dwimd_plugins/configs. It should have
    15     a .py extension.
    16 
    17 Reference
    18 =========
    19 dwimd ships the following sensors:
    20  * history: Not really a sensor, it buffers data and returns the buffered
    21             data as a list.
    22  * load:    Provides the system load as `load`.
    23  * locationcheck: Provides the current location as `location`. Such location
    24                   objects then have a `near` method that should be called with
    25 		  the name of a location that was previously defined with
    26 		  `define_location`. `define_location` takes a name and either
    27 		  `network_in_sight="network_name"` for wifi sensing or 
    28 		  `coordinates=(50, 8, 100)` for an 100m circle around 
    29 		  the GPS coordinates 50N 8E.
    30  * moving:  Provides `moving` and `not_moving_for_5min`. The latter is useful
    31  	    for autoaway.
    32  * orientation: Provides `orientation`, `face_up` and `on_stand`. `orientation`
    33 		either contains "portrait" or "landscape" or the same string
    34 		with " (inverse)" appended (XXX check). The other two variables
    35 		are booleans.
    36  * time:     Provides `time` which supports `time.between("12:00", "15:00")` like
    37  	     calls.
    38 
    39 It ships the following actions. These are activatable by using the verbs explained below.
    40  * availability: Should be activated with a status like "online" or "away". Additionally,
    41                  `availability_message` can be activated with the status message.
    42  * lock:         If activated with `off`, avoids that the screen locks.
    43  * profile:      Can be activated with a profile name that should be switched to (like
    44                  "silent" or "general").
    45  * wifi:         Should be activated with a network name as the value.
    46 
    47 These verbs are provided to activate an action:
    48  * require(object, value) triggers an error if somebody votes against it
    49  * suggest(object, value) is a weak vote (defaults values but does not count in votes)
    50  * vote(object, value, votes) is used for voting
    51  * force(object, value) overwrites requires and votes
    52 where object is a gestalt name or an action.
    53 
    54 Gestalts can be defined like this:
    55     define_gestalt("Default",
    56             availability="available",
    57             profile="general")
    58 They group similar action values.
    59 
    60 TODO
    61 ====
    62 
    63  * Adjustable sample rate for every plugin.
    64  * Planned inputs:
    65    gps, time, weekday, load, location, orientation
    66    charging, playing, display, locked, noise level, ringing
    67  * planned outputs:
    68    availability, profile, cellular, secure, lock, wifi
    69    os.system
    70