[pkg-fso-commits] [SCM] framworkd debian packageing branch, master, updated. milestone2-110-g76700a0
Michael 'Mickey' Lauer
mickey at vanille-media.de
Tue Sep 2 10:34:59 UTC 2008
The following commit has been merged in the master branch:
commit 76700a094eec35ebeadc68f8ad28757001df8ce4
Author: Michael 'Mickey' Lauer <mickey at vanille-media.de>
Date: Tue Sep 2 10:51:58 2008 +0200
oeventsd: add 'blink' action to LedAction, adjust rules file
diff --git a/etc/freesmartphone/oevents/rules.yaml b/etc/freesmartphone/oevents/rules.yaml
index 4ccb20d..0034e50 100644
--- a/etc/freesmartphone/oevents/rules.yaml
+++ b/etc/freesmartphone/oevents/rules.yaml
@@ -45,19 +45,23 @@
trigger: PowerStatus()
filters: HasAttr(status, "Charging"))
actions:
- - SetLed("gta02_power_blue","light")
- - SetLed("gta02_power_orange","dark")
+ - SetLed("gta02_power_blue", "dark")
+ - SetLed("gta02_power_orange", "light")
-
trigger: PowerStatus()
filters: HasAttr(status, "Discharging"))
actions:
- - SetLed("gta02_power_blue","dark")
- - SetLed("gta02_power_orange","dark")
+ - SetLed("gta02_power_blue", "dark")
+ - SetLed("gta02_power_orange", "dark")
-
trigger: PowerStatus()
filters: HasAttr(status, "Full"))
actions:
+ - SetLed("gta02_power_blue", "light")
+ - SetLed("gta02_power_orange", "dark")
+-
+ trigger: PowerStatus()
+ filters: HasAttr(status, "Critical"))
+ actions:
- SetLed("gta02_power_blue","dark")
- - SetLed("gta02_power_orange","light")
-
-
+ - SetLed("gta02_power_orange","blink")
diff --git a/framework/subsystems/oeventsd/action.py b/framework/subsystems/oeventsd/action.py
index b346265..59cdf20 100644
--- a/framework/subsystems/oeventsd/action.py
+++ b/framework/subsystems/oeventsd/action.py
@@ -35,7 +35,7 @@ class Action(object):
An action is a functor object that is called by a rule
"""
__metaclass__ = ActionMetaClass
-
+
def __init__(self):
pass
def __call__(self, **kargs):
@@ -50,7 +50,7 @@ class DebugAction(Action):
A special action for debugging purposes
"""
function_name = 'Debug'
-
+
def __init__(self, msg):
self.msg = msg
def __call__(self, **kargs):
@@ -113,14 +113,14 @@ class AudioAction(DBusAction):
interface = 'org.freesmartphone.Device.Audio'
method = 'PlaySound' if action == 'play' else 'StopSound'
super(AudioAction, self).__init__(bus, service, obj, interface, method, scenario)
-
+
#============================================================================#
class PlaySound(AudioAction):
#============================================================================#
function_name = 'PlaySound'
def __init__(self, file):
super(PlaySound, self).__init__(file, 'play')
-
+
#============================================================================#
class StopSound(AudioAction):
#============================================================================#
@@ -135,7 +135,7 @@ class AudioScenarioAction(DBusAction):
A dbus action on the freesmartphone audio device
"""
function_name = 'SetScenario'
-
+
def __init__(self, scenario = None, action = 'set' ):
bus = dbus.SystemBus()
service = 'org.freesmartphone.odeviced'
@@ -145,7 +145,7 @@ class AudioScenarioAction(DBusAction):
# FIXME gsmhandset ugly ugly hardcoded
super(AudioScenarioAction, self).__init__(bus, service, obj, interface, "SetScenario", scenario)
else:
- logger.error( "unhandled action for Audio scenario" )
+ logger.error( "unhandled action '%s' for Audio scenario" % action )
#============================================================================#
class LedAction(DBusAction):
@@ -154,7 +154,7 @@ class LedAction(DBusAction):
A dbus action on an Openmoko Neo LED device
"""
function_name = 'SetLed'
-
+
# FIXME device specific, needs to go away from here
def __init__(self, device, action):
bus = dbus.SystemBus()
@@ -163,8 +163,12 @@ class LedAction(DBusAction):
interface = 'org.freesmartphone.Device.LED'
if action == 'light':
super(LedAction, self).__init__(bus, service, obj, interface, 'SetBrightness', 100)
+ elif action == 'blink':
+ super(LedAction, self).__init__(bus, service, obj, interface, 'SetBlinking', 100, 1500)
+ elif action == 'dark':
+ super(LedAction, self).__init__(bus, service, obj, interface, 'SetBrightness', 0)
else:
- super(LedAction, self).__init__(bus, service, obj, interface, 'SetBrightness', 0)
+ logger.error( "unhandled action '%s' for Led" % action )
#============================================================================#
class VibratorAction(DBusAction):
@@ -182,12 +186,12 @@ class VibratorAction(DBusAction):
super(VibratorAction, self).__init__(bus, service, obj, interface, 'SetBlinking', 300, 700)
else:
super(VibratorAction, self).__init__(bus, service, obj, interface, 'SetBrightness', 0)
-
+
class StartVibrationAction(VibratorAction):
function_name = 'StartVibration'
def __init__(self):
super(StartVibrationAction, self).__init__(action='start')
-
+
class StopVibrationAction(VibratorAction):
function_name = 'StopVibration'
def __init__(self):
--
framworkd debian packageing
More information about the pkg-fso-commits
mailing list